forked from aseprite/aseprite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.h
More file actions
132 lines (106 loc) · 2.98 KB
/
app.h
File metadata and controls
132 lines (106 loc) · 2.98 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// Aseprite
// Copyright (C) 2001-2016 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
#ifndef APP_APP_H_INCLUDED
#define APP_APP_H_INCLUDED
#pragma once
#include "app/app_brushes.h"
#include "base/mutex.h"
#include "base/unique_ptr.h"
#include "doc/pixel_format.h"
#include "obs/signal.h"
#include <string>
#include <vector>
namespace doc {
class Layer;
}
namespace ui {
class UISystem;
}
namespace app {
class AppOptions;
class BackupIndicator;
class ContextBar;
class Document;
class DocumentExporter;
class INotificationDelegate;
class InputChain;
class LegacyModules;
class LoggerModule;
class MainWindow;
class Preferences;
class RecentFiles;
class Timeline;
class Workspace;
namespace crash {
class DataRecovery;
}
namespace tools {
class ActiveToolManager;
class Tool;
class ToolBox;
}
using namespace doc;
class App {
public:
App();
~App();
static App* instance() { return m_instance; }
// Returns true if Aseprite is running with GUI available.
bool isGui() const { return m_isGui; }
// Returns true if the application is running in portable mode.
bool isPortable();
// Runs the Aseprite application. In GUI mode it's the top-level
// window, in console/scripting it just runs the specified
// scripts.
void initialize(const AppOptions& options);
void run();
tools::ToolBox* toolBox() const;
tools::Tool* activeTool() const;
tools::ActiveToolManager* activeToolManager() const;
RecentFiles* recentFiles() const;
MainWindow* mainWindow() const { return m_mainWindow; }
Workspace* workspace() const;
ContextBar* contextBar() const;
Timeline* timeline() const;
Preferences& preferences() const;
crash::DataRecovery* dataRecovery() const;
AppBrushes& brushes() {
ASSERT(m_brushes.get());
return *m_brushes;
}
void showNotification(INotificationDelegate* del);
// This can be called from a non-UI thread.
void showBackupNotification(bool state);
void updateDisplayTitleBar();
InputChain& inputChain();
// App Signals
obs::signal<void()> Exit;
obs::signal<void()> PaletteChange;
private:
typedef std::vector<std::string> FileList;
class CoreModules;
class Modules;
static App* m_instance;
base::UniquePtr<ui::UISystem> m_uiSystem;
CoreModules* m_coreModules;
Modules* m_modules;
LegacyModules* m_legacy;
bool m_isGui;
bool m_isShell;
base::UniquePtr<MainWindow> m_mainWindow;
FileList m_files;
base::UniquePtr<DocumentExporter> m_exporter;
base::UniquePtr<AppBrushes> m_brushes;
BackupIndicator* m_backupIndicator;
base::mutex m_backupIndicatorMutex;
};
void app_refresh_screen();
void app_rebuild_documents_tabs();
PixelFormat app_get_current_pixel_format();
void app_default_statusbar_message();
int app_get_color_to_clear_layer(doc::Layer* layer);
} // namespace app
#endif