forked from aseprite/aseprite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp_state.cpp
More file actions
40 lines (30 loc) · 723 Bytes
/
app_state.cpp
File metadata and controls
40 lines (30 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Aseprite UI Library
// Copyright (C) 2022 Igara Studio S.A.
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ui/app_state.h"
#include "ui/manager.h"
namespace ui {
AppState g_state = AppState::kNormal;
void set_app_state(AppState state)
{
g_state = state;
if (state == AppState::kClosingWithException) {
if (auto man = ui::Manager::getDefault())
man->_closingAppWithException();
}
}
AppState get_app_state()
{
return g_state;
}
bool is_app_state_closing()
{
return (g_state == AppState::kClosing ||
g_state == AppState::kClosingWithException);
}
} // namespace ui