Elaztek Developer Hub
Blamite Game Engine - Keystone  00453.06.08.26.0624.blamite
A library that enables the use of Qt in Blamite's editing tools.
BlamEditorToolWindow.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <qdockwidget.h>
5 #include <Strings/components/settings/config/config.h>
6 
8 
9 #ifndef KEYSTONE
10 #define KEYSTONE
11 #endif
12 
13 class BlamEditorWindow;
14 
22 {
23  Output,
25  StyleEditor,
28  ToolWindow,
31 };
32 
39 class BlamEditorToolWindow : public QDockWidget
40 {
41 protected:
46 
50  Qt::DockWidgetArea dock_position = Qt::DockWidgetArea::LeftDockWidgetArea;
51 
52 public:
53 
54  std::string config_filename = "";
55  BlamConfigurationFile* config = nullptr;
56 
63 
68 
75 
79  void LoadConfig();
80 
86  virtual void OnThemeChange(BlamEditorTheme* new_theme) {};
87 
91  virtual void OnToolOpen() {};
92 
96  virtual void OnToolClose() {};
97 
103  void closeEvent(QCloseEvent* event);
104 
110  void OnDockAreaChanged(Qt::DockWidgetArea area);
111 
117  Qt::DockWidgetArea GetDockWidgetArea();
118 };
BlamEditorToolWindow
Base class for all editor tool windows.
Definition: BlamEditorToolWindow.h:39
editor_data.h
BlamEditorToolWindow::OnThemeChange
virtual void OnThemeChange(BlamEditorTheme *new_theme)
Called when the active theme is changed.
Definition: BlamEditorToolWindow.h:86
BlamEditorToolWindowType::Unspecified
@ Unspecified
Unspecified tool window type. Should generally be treated as an error.
BlamEditorToolWindow.h
BlamEditorToolWindow::OnToolOpen
virtual void OnToolOpen()
Called when the tool window is being opened.
Definition: BlamEditorToolWindow.h:91
BlamEditorToolWindow::dock_position
Qt::DockWidgetArea dock_position
The dock position of the tool window.
Definition: BlamEditorToolWindow.h:50
BlamEditorToolWindow::GetToolWindowType
BlamEditorToolWindowType GetToolWindowType()
Retrieves the type of tool window that this tool window represents.
Definition: BlamEditorToolWindow.cpp:28
BlamEditorToolWindowType::HierarchyView
@ HierarchyView
The hierarchy view, used to view objects within a scenario. Used in Sapien.
BlamEditorToolWindow::window_type
BlamEditorToolWindowType window_type
The tool window type.
Definition: BlamEditorToolWindow.h:45
themes.h
BlamKeystone::EditorData::GetEditorWindowType
KEYSTONE BlamEditorWindowType GetEditorWindowType()
Definition: editor_data.cpp:88
BlamEditorWindowType::Unspecified
@ Unspecified
Indicates that the editor window type is unknown. This should never happen.
BlamEditorToolWindowType::ExplorerClassic
@ ExplorerClassic
The classic Explorer Bar. Used in Guerilla.
BlamEditorWindowType::Sapien
@ Sapien
The editor window is the main window for Sapien (see #sapien_main_window).
BlamEditorTheme
Class representing a Blamite Editor Theme.
Definition: themes.h:45
BlamEditorToolWindow::closeEvent
void closeEvent(QCloseEvent *event)
Overrides the close event.
Definition: BlamEditorToolWindow.cpp:103
BlamEditorToolWindowType::ToolWindow
@ ToolWindow
The tool window, used to configure tool options. Used in Sapien.
BlamEditorToolWindow::~BlamEditorToolWindow
~BlamEditorToolWindow()
Releases a tool window.
Definition: BlamEditorToolWindow.cpp:17
BlamEditorWindow.h
BlamEditorToolWindowType
BlamEditorToolWindowType
Enumerator containing all possible editor tool window types.
Definition: BlamEditorToolWindow.h:21
BlamEditorWindow::CloseToolWindow
void CloseToolWindow(BlamEditorToolWindowType tool_type)
Closes the specified tool window.
Definition: BlamEditorWindow.cpp:354
BlamEditorToolWindowType::StyleEditor
@ StyleEditor
The style editor, used to test Qt5 stylesheet changes in real-time.
BlamEditorWindowType
BlamEditorWindowType
Enumerator used to identify the type of the main editor window.
Definition: keystone_api.h:53
BlamEditorToolWindow::LoadConfig
void LoadConfig()
Loads or creates the configuration file for this tool window.
Definition: BlamEditorToolWindow.cpp:33
BlamKeystone::EditorData::GetMainEditorWindow
KEYSTONE BlamEditorWindow * GetMainEditorWindow()
Retrieves the main editor window.
Definition: editor_data.cpp:35
BlamEditorToolWindow::GetDockWidgetArea
Qt::DockWidgetArea GetDockWidgetArea()
Retrieves the current dock widget area of the window.
Definition: BlamEditorToolWindow.cpp:114
BlamEditorToolWindow::config_filename
std::string config_filename
The name of the configuration filename.
Definition: BlamEditorToolWindow.h:54
BlamEditorToolWindow::OnDockAreaChanged
void OnDockAreaChanged(Qt::DockWidgetArea area)
Called when the dock area of the tool window is changed.
Definition: BlamEditorToolWindow.cpp:109
BlamEditorWindowType::Foundry
@ Foundry
The editor window is the main window for Foundry (see foundry_main_window).
BlamEditorWindow
Interface class that all main editing tool windows inherit from.
Definition: BlamEditorWindow.h:34
BlamEditorToolWindowType::SapienToolbar
@ SapienToolbar
Basic toolbar for sapien. Used to allow simpler object placement.
BlamEditorToolWindowType::Output
@ Output
The log output window.
BlamEditorToolWindowType::PropertiesPalette
@ PropertiesPalette
The properties palette, used to view object properties within a scenario. Used in Sapien.
BlamEditorToolWindow::BlamEditorToolWindow
BlamEditorToolWindow(BlamEditorToolWindowType _window_type)
Constructs a new tool window.
Definition: BlamEditorToolWindow.cpp:10
BlamEditorWindowType::Tool
@ Tool
The editor window is the GUI for Tool (see tool_gui_window).
BlamEditorToolWindow::OnToolClose
virtual void OnToolClose()
Called when the tool window is being closed.
Definition: BlamEditorToolWindow.h:96
BlamEditorToolWindow::config
BlamConfigurationFile * config
The configuration file for this tool window. Not always used.
Definition: BlamEditorToolWindow.h:55
BlamEditorWindowType::Guerilla
@ Guerilla
The editor window is the main window for Guerilla (see guerilla_window).