Elaztek Developer Hub
Blamite Game Engine - Keystone  00402.09.29.23.0627.blamite
A library that enables the use of Qt in Blamite's editing tools.
utils.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <qgraphicsview.h>
5 
6 #include "api/keystone_api.h"
8 
9 #ifndef KEYSTONE
10 #define KEYSTONE
11 #endif
12 
17 {
24  KEYSTONE void SetGraphicsViewImage(QGraphicsView* graphics_view, std::string image_path, Qt::AspectRatioMode aspect_ratio_mode);
25 
35  KEYSTONE KeystoneDialogResult ShowErrorDialog(bool allow_safemode, bool allow_continue, std::string text);
36 
37  KEYSTONE KeystoneDialogResult ShowMessageBox(std::string message);
38 
39  KEYSTONE KeystoneDialogResult ShowMessageBox(std::string title, std::string message);
40 
41  KEYSTONE KeystoneDialogResult ShowMessageBox(std::string title, std::string message, KeystoneMessageBoxType type);
42 
43  KEYSTONE KeystoneDialogResult ShowMessageBox(std::string title, std::string message, KeystoneMessageBoxType type, KeystoneMessageBoxButtons buttons);
44 
45  KEYSTONE uint32_t ConvertQtVirtKeyToSDLVirtKey(int key);
46 
47  KEYSTONE uint32_t ConvertQtVirtKeyToSDLScancode(int key);
48 
49  KEYSTONE bool IsPointWithinGeometry(QWidget* widget, QPoint point);
50 
52 
53  KEYSTONE void PokeStylesheet(QWidget* widget);
54 }
editor_data.h
add_scancode
void add_scancode(int qt_key, int sdl_key)
Definition: utils.cpp:22
BlamEditorWindowType::Tool
@ Tool
The editor window is the GUI for Tool (see tool_gui_window).
KeystoneDialogResult
KeystoneDialogResult
Enumerator containing all possible generic dialog results.
Definition: keystone_api.h:30
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).
error_dialog.h
BlamEditorWindow::GetApplicationTitle
std::string GetApplicationTitle()
Definition: BlamEditorWindow.cpp:406
KeystoneMessageBoxButtons
KeystoneMessageBoxButtons
Enumerator containing different possible button combinations.
Definition: qt_message_box.h:23
KeystoneMessageBoxButtons::Ok
@ Ok
Dialog is shown with an [OK] button.
BlamKeystone::Utils::GetDefaultApplicationIcon
KEYSTONE QIcon GetDefaultApplicationIcon()
Definition: utils.cpp:324
BlamKeystone::Utils::ConvertQtVirtKeyToSDLScancode
KEYSTONE uint32_t ConvertQtVirtKeyToSDLScancode(int key)
Definition: utils.cpp:256
BlamKeystone::Utils::ShowMessageBox
KEYSTONE KeystoneDialogResult ShowMessageBox(std::string message)
Definition: utils.cpp:279
qt_virtual_key_conversions
std::map< int, int > qt_virtual_key_conversions
Definition: utils.cpp:14
BlamEditorWindowType::Guerilla
@ Guerilla
The editor window is the main window for Guerilla (see guerilla_window).
KeystoneMessageBoxType
KeystoneMessageBoxType
Enumerator containing different possible message box types, primarily used to control the icon that i...
Definition: qt_message_box.h:10
utils.h
keystone_api.h
BlamKeystone::Themes::GetActiveTheme
KEYSTONE BlamEditorTheme * GetActiveTheme()
Retrieves the currently selected theme.
Definition: themes.cpp:335
qt_message_box.h
BlamKeystone::EditorData::GetMainEditorWindow
KEYSTONE BlamEditorWindow * GetMainEditorWindow()
Retrieves the main editor window.
Definition: editor_data.cpp:32
load_scancode_conversions
void load_scancode_conversions()
Definition: utils.cpp:125
BlamKeystone::Utils::IsPointWithinGeometry
KEYSTONE bool IsPointWithinGeometry(QWidget *widget, QPoint point)
Definition: utils.cpp:309
KeystoneMessageBoxType::None
@ None
The dialog will not contain an icon.
qt_message_box::GetResult
KeystoneDialogResult GetResult()
Retrieves the dialog result.
Definition: qt_message_box.cpp:167
load_virtkey_conversions
void load_virtkey_conversions()
Definition: utils.cpp:27
add_virt_key
void add_virt_key(int qt_key, int sdl_key)
Definition: utils.cpp:17
qt_scancode_conversions
std::map< int, int > qt_scancode_conversions
Definition: utils.cpp:15
BlamKeystone::Utils::PokeStylesheet
KEYSTONE void PokeStylesheet(QWidget *widget)
Definition: utils.cpp:355
KEYSTONE
#define KEYSTONE
Definition: utils.h:10
BlamEditorWindow
Interface class that all main editing tool windows inherit from.
Definition: BlamEditorWindow.h:48
ErrorDialog
GUI for the Qt-based error dialog box.
Definition: error_dialog.h:12
BlamKeystone::Utils::ShowErrorDialog
KEYSTONE KeystoneDialogResult ShowErrorDialog(bool allow_safemode, bool allow_continue, std::string text)
Shows an error dialog that allows the user to continue execution, continue in 'safe mode',...
Definition: utils.cpp:271
BlamKeystone::Utils
General-purpose utilities for use within Keystone.
Definition: utils.h:16
BlamKeystone::Utils::SetGraphicsViewImage
KEYSTONE void SetGraphicsViewImage(QGraphicsView *graphics_view, std::string image_path, Qt::AspectRatioMode aspect_ratio_mode)
Applies an image to a graphics view, without the need for extra scene/pixmap management.
Definition: utils.cpp:221
BlamKeystone::Utils::ConvertQtVirtKeyToSDLVirtKey
KEYSTONE uint32_t ConvertQtVirtKeyToSDLVirtKey(int key)
Definition: utils.cpp:241
BlamEditorWindowType::Foundry
@ Foundry
The editor window is the main window for Foundry (see foundry_main_window).
qt_message_box
A basic message box dialog.
Definition: qt_message_box.h:39
ErrorDialog::GetResult
KeystoneDialogResult GetResult()
Retrieves the result of the dialog.
Definition: error_dialog.cpp:21