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.
themes.cpp File Reference
#include "themes.h"
#include <qstylefactory.h>
#include <Strings/components/3rdparty/rapidxml/rapidxml.hpp>
#include <Strings/components/utils/io/io.h>
#include <Strings/components/utils/string/string.h>
#include <Strings/components/classes/events/events.h>
#include <Strings/components/classes/events/editor_events/EditorThemeChange/EditorThemeChange.h>
#include <Strings/components/logger/logger.h>
#include <fstream>
#include "components/editor_data/editor_data.h"
+ Include dependency graph for themes.cpp:

Functions

bool load_xml_theme (rapidxml::xml_document<> *theme_document, std::string folder_path, std::string xml_file_path, BlamEditorThemeType theme_type)
 Loads a theme from an XML file. More...
 
bool load_themes_in_folder (std::string theme_dir, BlamEditorThemeType theme_type)
 Loads all XML themes in a given directory. More...
 

Variables

std::vector< BlamEditorThemethemes
 The current list of loaded themes. More...
 
int active_theme_index = -1
 The index of the currently active theme. More...
 

Function Documentation

◆ load_themes_in_folder()

bool load_themes_in_folder ( std::string  theme_dir,
BlamEditorThemeType  theme_type 
)

Loads all XML themes in a given directory.

Parameters
theme_dir- The directory to read themes from.
theme_type- The type of theme being loaded.
Returns
true if all themes were loades successfully, otherwise returns false.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ load_xml_theme()

bool load_xml_theme ( rapidxml::xml_document<> *  theme_document,
std::string  folder_path,
std::string  xml_file_path,
BlamEditorThemeType  theme_type 
)

Loads a theme from an XML file.

Parameters
theme_document- The xml document to read theme information from.
folder_path- The root folder of the theme. Used for log messages, and is written in place of {theme_root} in the stylesheet.
xml_file_path- The path to the theme's XML file.
theme_type- The type of theme being loaded.
Returns
true if the theme was loaded successfully, otherwise returns false.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ active_theme_index

int active_theme_index = -1

The index of the currently active theme.

◆ themes

std::vector<BlamEditorTheme> themes

The current list of loaded themes.