/
main_window.h
131 lines (110 loc) · 3.54 KB
/
main_window.h
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
// Aseprite
// Copyright (C) 2001-2017 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
#ifndef APP_UI_MAIN_WINDOW_H_INCLUDED
#define APP_UI_MAIN_WINDOW_H_INCLUDED
#pragma once
#include "app/ui/tabs.h"
#include "ui/window.h"
#include "main_window.xml.h"
namespace ui {
class Splitter;
}
namespace app {
#ifdef ENABLE_UPDATER
class CheckUpdateDelegate;
#endif
class BrowserView;
class ColorBar;
class ContextBar;
class DevConsoleView;
class DocumentView;
class HomeView;
class INotificationDelegate;
class MainMenuBar;
class Notifications;
class PreviewEditorWindow;
class StatusBar;
class Timeline;
class Workspace;
class WorkspaceTabs;
namespace crash {
class DataRecovery;
}
class MainWindow : public app::gen::MainWindow
, public TabsDelegate {
public:
enum Mode {
NormalMode,
ContextBarAndTimelineMode,
EditorOnlyMode
};
MainWindow();
~MainWindow();
MainMenuBar* getMenuBar() { return m_menuBar; }
ContextBar* getContextBar() { return m_contextBar; }
WorkspaceTabs* getTabsBar() { return m_tabsBar; }
Timeline* getTimeline() { return m_timeline; }
Workspace* getWorkspace() { return m_workspace; }
PreviewEditorWindow* getPreviewEditor() { return m_previewEditor; }
#ifdef ENABLE_UPDATER
CheckUpdateDelegate* getCheckUpdateDelegate();
#endif
void start();
void reloadMenus();
void showNotification(INotificationDelegate* del);
void showHomeOnOpen();
void showHome();
bool isHomeSelected();
void showDevConsole();
void showBrowser(const std::string& filename);
Mode getMode() const { return m_mode; }
void setMode(Mode mode);
bool getTimelineVisibility() const;
void setTimelineVisibility(bool visible);
void popTimeline();
void showDataRecovery(crash::DataRecovery* dataRecovery);
// TabsDelegate implementation.
bool isTabModified(Tabs* tabs, TabView* tabView) override;
bool canCloneTab(Tabs* tabs, TabView* tabView) override;
void onSelectTab(Tabs* tabs, TabView* tabView) override;
void onCloseTab(Tabs* tabs, TabView* tabView) override;
void onCloneTab(Tabs* tabs, TabView* tabView, int pos) override;
void onContextMenuTab(Tabs* tabs, TabView* tabView) override;
void onTabsContainerDoubleClicked(Tabs* tabs) override;
void onMouseOverTab(Tabs* tabs, TabView* tabView) override;
DropViewPreviewResult onFloatingTab(Tabs* tabs, TabView* tabView, const gfx::Point& pos) override;
void onDockingTab(Tabs* tabs, TabView* tabView) override;
DropTabResult onDropTab(Tabs* tabs, TabView* tabView, const gfx::Point& pos, bool clone) override;
protected:
bool onProcessMessage(ui::Message* msg) override;
void onInitTheme(ui::InitThemeEvent& ev) override;
void onSaveLayout(ui::SaveLayoutEvent& ev) override;
void onResize(ui::ResizeEvent& ev) override;
void onActiveViewChange();
private:
DocumentView* getDocView();
HomeView* getHomeView();
void configureWorkspaceLayout();
MainMenuBar* m_menuBar;
ContextBar* m_contextBar;
StatusBar* m_statusBar;
ColorBar* m_colorBar;
ui::Widget* m_toolBar;
WorkspaceTabs* m_tabsBar;
Mode m_mode;
Timeline* m_timeline;
Workspace* m_workspace;
PreviewEditorWindow* m_previewEditor;
HomeView* m_homeView;
Notifications* m_notifications;
INotificationDelegate* m_scalePanic;
BrowserView* m_browserView;
#ifdef ENABLE_SCRIPTING
DevConsoleView* m_devConsoleView;
#endif
};
}
#endif