Elaztek Developer Hub
Blamite Game Engine - Keystone  00386.06.16.23.0646.blamite
A library that enables the use of Qt in Blamite's editing tools.
BlamEditorWindow.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 #include <HEKGuerilla/components/tags/tags.h>
6 #include <Strings/components/settings/config/config.h>
7 #include <qmainwindow.h>
8 
13 
14 #ifndef KEYSTONE
15 #define KEYSTONE
16 #endif
17 
22 {
23  MDI,
24  Tabs
25 };
26 
34 {
35  Tool,
36  Sapien,
37  Guerilla,
38  Foundry,
40 };
41 
48 class BlamEditorWindow : public QMainWindow
49 {
50 private:
51 
56 
57 public:
58 
60 
62  QTabWidget* tab_area = nullptr;
63 
64  std::vector<BlamEditorToolWindow*> open_tool_windows = std::vector<BlamEditorToolWindow*>();
65  std::vector<BlamEditorDocument*> open_documents = std::vector<BlamEditorDocument*>();
66 
67  BlamConfigurationFile* config = nullptr;
68 
75 
79  void SetupWindow();
80 
87 
93  virtual void OnThemeChange(BlamEditorTheme* new_theme);
94 
101  bool OpenDocument(std::string file_path, BlamTagTreeNode* tree_node, BlamEditorDocumentType doctype);
102 
108  void OpenDocument(BlamEditorDocument* document);
109 
115  void CloseDocument(int index);
116 
122  void CloseDocument(BlamEditorDocument* document);
123 
127  void CloseAllDocuments();
128 
132  void SaveAllDocuments();
133 
143  bool OpenToolWindow(BlamEditorToolWindowType tool_type, Qt::DockWidgetArea position);
144 
154 
161 
165  void CloseAllToolWindows();
166 
174 
183 
185 
190 
191  void UpdateDefaultIcon();
192 
193  std::string GetApplicationTitle();
194 };
BlamEditorToolWindow
Base class for all editor tool windows.
Definition: BlamEditorToolWindow.h:37
BlamEditorDocument_Tag
Class representing a Tag document.
Definition: tag.h:15
BlamEditorDocument_GameWindow
Class representing a Game Window "document".
Definition: game_window.h:18
editor_data.h
BlamEditorDocument::parent_window
BlamEditorWindow * parent_window
The parent window that owns this document.
Definition: BlamEditorDocument.h:47
BlamEditorWindow::GetActiveDocument
BlamEditorDocument * GetActiveDocument()
Get the current active document.
Definition: BlamEditorWindow.cpp:343
BlamEditorDocument_TagDesigner
Class representing a Tag Designer "document".
Definition: tag_designer.h:18
BlamEditorDocumentType::GameWindow
@ GameWindow
Special document type used for the Game Viewport window.
SkinnableMdiArea.h
BlamEditorWindowType::Tool
@ Tool
The editor window is the GUI for Tool (see tool_gui_window).
BlamEditorWindowType
BlamEditorWindowType
Enumerator used to identify the type of the main editor window.
Definition: BlamEditorWindow.h:33
BlamWorkspaceLayoutType::Tabs
@ Tabs
Sub-windows will be organized using tabs, similar to more modern editing tools.
BlamEditorToolWindow.h
BlamEditorTheme::ApplyVariant
bool ApplyVariant(std::string variant_name)
Applies a specified theme variant to the application.
Definition: BlamEditorTheme.cpp:78
BlamEditorWindow::workspace_type
BlamWorkspaceLayoutType workspace_type
The layout type the window is currently using.
Definition: BlamEditorWindow.h:59
BlamEditorToolWindow::OnToolOpen
virtual void OnToolOpen()
Called when the tool window is being opened.
Definition: BlamEditorToolWindow.h:86
BlamEditorWindow::GetEditorWindowType
BlamEditorWindowType GetEditorWindowType()
Retrieves the type of the editor window.
Definition: BlamEditorWindow.cpp:89
BlamEditorWindowType::Sapien
@ Sapien
The editor window is the main window for Sapien (see sapien_main_window).
BlamEditorDocumentWidget::document
BlamEditorDocument * document
The document associated with this widget.
Definition: BlamEditorDocument.h:156
BlamEditorWindow::GetApplicationTitle
std::string GetApplicationTitle()
Definition: BlamEditorWindow.cpp:406
BlamEditorWindow::open_documents
std::vector< BlamEditorDocument * > open_documents
The list of open documents.
Definition: BlamEditorWindow.h:65
BlamEditorDocumentType
BlamEditorDocumentType
Enumerator containing all possible editor document types.
Definition: BlamEditorDocument.h:23
themes.h
BlamEditorWindow::SetupWindow
void SetupWindow()
Prepares the main window layout.
Definition: BlamEditorWindow.cpp:21
BlamEditorWindow::BlamEditorWindow
BlamEditorWindow(BlamEditorWindowType window_type)
Constructs a new editor window.
Definition: BlamEditorWindow.cpp:16
BlamEditorTheme
Class representing a Blamite Editor Theme.
Definition: themes.h:47
BlamEditorDocument.h
BlamEditorWindowType::Guerilla
@ Guerilla
The editor window is the main window for Guerilla (see guerilla_window).
SkinnableMdiArea
Wrapper class around a QMdiArea, made to simplify skinning.
Definition: SkinnableMdiArea.h:20
BlamEditorTheme::GetVariants
std::vector< BlamEditorThemeVariant > GetVariants()
Retrieves the list of theme variants.
Definition: BlamEditorTheme.cpp:153
explorer_bar.h
BlamWorkspaceLayoutType
BlamWorkspaceLayoutType
Enumerator used to specify the workspace layout method that an application should use.
Definition: BlamEditorWindow.h:21
BlamEditorDocumentType::TagDesigner
@ TagDesigner
Special document type used for the Tag Designer window.
BlamEditorWindow.h
BlamEditorDocumentType::Tag
@ Tag
Indicates the document represents a tag file.
BlamEditorToolWindowType
BlamEditorToolWindowType
Enumerator containing all possible editor tool window types.
Definition: BlamEditorToolWindow.h:21
BlamKeystone::EditorData::GetToolWindow
KEYSTONE BlamEditorToolWindow * GetToolWindow(BlamEditorToolWindowType type)
Retrieves a desired tool window.
Definition: editor_data.cpp:37
BlamEditorWindow::CloseToolWindow
void CloseToolWindow(BlamEditorToolWindowType tool_type)
Closes the specified tool window.
Definition: BlamEditorWindow.cpp:275
BlamKeystone::Themes::GetActiveTheme
KEYSTONE BlamEditorTheme * GetActiveTheme()
Retrieves the currently selected theme.
Definition: themes.cpp:335
BlamEditorWindow::UpdateDefaultIcon
void UpdateDefaultIcon()
Definition: BlamEditorWindow.cpp:372
BlamEditorTheme::ApplyTheme
bool ApplyTheme()
Applies this theme to the application.
Definition: BlamEditorTheme.cpp:37
BlamEditorWindow::config
BlamConfigurationFile * config
The configuration file for this editor window.
Definition: BlamEditorWindow.h:67
BlamWorkspaceLayoutType::MDI
@ MDI
Sub-windows will be organized using MDI (Multiple Document Interface).
BlamEditorDocumentWidget
Class acting as a simple interface to allow for easy retrieval of the active document.
Definition: BlamEditorDocument.h:153
BlamEditorWindow::IsToolWindowOpen
bool IsToolWindowOpen(BlamEditorToolWindowType tool_type)
Checks if a given tool window type is open.
Definition: BlamEditorWindow.cpp:317
BlamEditorWindow::OpenToolWindow
bool OpenToolWindow(BlamEditorToolWindowType tool_type, Qt::DockWidgetArea position)
Opens the specified tool window within the main window.
Definition: BlamEditorWindow.cpp:235
BlamEditorToolWindow::GetDockWidgetArea
Qt::DockWidgetArea GetDockWidgetArea()
Definition: BlamEditorToolWindow.cpp:113
tag_designer.h
BlamEditorWindow::open_tool_windows
std::vector< BlamEditorToolWindow * > open_tool_windows
The list of open tool windows.
Definition: BlamEditorWindow.h:64
BlamKeystone::Themes::GetTheme
KEYSTONE BlamEditorTheme * GetTheme(std::string name)
Retrieves a theme.
Definition: themes.cpp:320
BlamEditorWindow::OnThemeChange
virtual void OnThemeChange(BlamEditorTheme *new_theme)
Called when the active theme is changed.
Definition: BlamEditorWindow.cpp:94
BlamEditorDocument
Interface class that any types of editor documents inherit from.
Definition: BlamEditorDocument.h:37
BlamEditorWindow::CloseAllDocuments
void CloseAllDocuments()
Closes all open documents.
Definition: BlamEditorWindow.cpp:216
BlamEditorWindow::tab_area
QTabWidget * tab_area
The tab widget used for documents. Only set when using Tab layout.
Definition: BlamEditorWindow.h:62
BlamEditorWindow::mdi_area
SkinnableMdiArea * mdi_area
The MDI area used for documents. Only set when using MDI layout.
Definition: BlamEditorWindow.h:61
BlamEditorDocument::Show
void Show()
Shows the document within the parent window.
Definition: BlamEditorDocument.cpp:21
BlamEditorDocument::loaded
bool loaded
Whether or not the document was able to be successfully loaded.
Definition: BlamEditorDocument.h:51
BlamEditorWindow
Interface class that all main editing tool windows inherit from.
Definition: BlamEditorWindow.h:48
BlamEditorDocumentType::Unspecified
@ Unspecified
Indicates the document type is unspecified or invalid.
BlamEditorWindow::CloseAllToolWindows
void CloseAllToolWindows()
Closes all tool windows.
Definition: BlamEditorWindow.cpp:294
tag.h
BlamEditorWindow::ToggleToolWindow
void ToggleToolWindow(BlamEditorToolWindowType tool_type)
Toggles the specified tool window.
Definition: BlamEditorWindow.cpp:305
BlamEditorWindow::SaveAllDocuments
void SaveAllDocuments()
Attempts to save all open documents.
Definition: BlamEditorWindow.cpp:227
BlamEditorDocument::Close
virtual bool Close()
Closes the document and releases any resources being used by it.
Definition: BlamEditorDocument.cpp:77
BlamEditorWindow::OpenDocument
bool OpenDocument(std::string file_path, BlamTagTreeNode *tree_node, BlamEditorDocumentType doctype)
Attempts to open the specified document in the main window.
Definition: BlamEditorWindow.cpp:99
BlamEditorWindow::CloseDocument
void CloseDocument(int index)
Attempts to close the specified document.
Definition: BlamEditorWindow.cpp:203
BlamEditorWindowType::Foundry
@ Foundry
The editor window is the main window for Foundry (see foundry_main_window).
BlamEditorWindow::GetToolWindow
BlamEditorToolWindow * GetToolWindow(BlamEditorToolWindowType tool_type)
Definition: BlamEditorWindow.cpp:330
BlamEditorToolWindow::OnToolClose
virtual void OnToolClose()
Called when the tool window is being closed.
Definition: BlamEditorToolWindow.h:91
output.h
tag_designer
Class representing the Tag Designer.
Definition: tag_designer.h:24
game_window.h
BlamEditorWindowType::Unspecified
@ Unspecified
Indicates that the editor window type is unknown. This should never happen.
BlamKeystone::EditorData::GetDocumentTypeConfiguration
KEYSTONE BlamConfigurationFile * GetDocumentTypeConfiguration(BlamEditorDocumentType type)
Attempts to locate the configuration file for the specified document type.
Definition: document_config.cpp:107