SDOM - Simple SDL Document Object Model
A lightweight, extensible Document Object Model for SDL-based applications.
Loading...
Searching...
No Matches
SDOM_Utils.hpp
Go to the documentation of this file.
1// SDOM_Utility.hpp
2// #include <SDOM/SDOM.hpp>
3// #include <SDOM/SDOM_Core.hpp>
4// #include <SDOM/SDOM_Factory.hpp>
5// #include <SDOM/SDOM_CLR.hpp>
6
7#pragma once
8
9namespace SDOM
10{
11 class Stage;
12
13 void quit();
14 void shutdown();
15 Core& getCore();
16 Factory& getFactory();
17 Stage* getStage();
18 DisplayHandle getStageHandle();
19 SDL_Renderer* getRenderer();
20 SDL_Window* getWindow();
21 SDL_Texture* getTexture();
22
23 sol::state& getLua();
24
25
26 // helper function to extract SDL_Color from Lua table
27 SDL_Color parseColor(const sol::object& colorObj);
28
29 // helper function to normalize anchor point strings
30 std::string normalizeAnchorString(const std::string& s);
31
32 // helper function to validate anchor point strings
33 bool validateAnchorPointString(const std::string& anchorString);
34
35 // helper function to validate anchor point assignments in a config table
36 bool validateAnchorAssignments(const sol::table& config);
37
38 // helper function to print a message box to the terminal
39 void printMessageBox(const std::string& title, const std::string& message,
40 const std::string& file /* = "" */, int line /* = -1 */,
41 const std::string& colorTitle /* = CLR::RED */,
42 const std::string& colorMsg /* = CLR::WHITE */,
43 const std::string& colorBorder /* = CLR::BROWN */);
44
45 void showWarning(const std::string& message, const std::string& file, int line);
46} // namespace SDOM
Contains all core classes and utilities for the SDOM library.
Definition lua_BindHelpers.hpp:7
void shutdown()
Definition SDOM_Utils.cpp:15
sol::state & getLua()
Definition SDOM_Utils.cpp:24
bool validateAnchorPointString(const std::string &anchorString)
Definition SDOM_Utils.cpp:107
Core & getCore()
Definition SDOM_Utils.cpp:16
SDL_Renderer * getRenderer()
Definition SDOM_Utils.cpp:20
SDL_Window * getWindow()
Definition SDOM_Utils.cpp:21
DisplayHandle getStageHandle()
Definition SDOM_Utils.cpp:19
void showWarning(const std::string &message, const std::string &file, int line)
Definition SDOM_Utils.cpp:215
void quit()
Definition SDOM_Utils.cpp:14
SDL_Color parseColor(const sol::object &colorObj)
Definition SDOM_Utils.cpp:27
bool validateAnchorAssignments(const sol::table &config)
Definition SDOM_Utils.cpp:161
Factory & getFactory()
Definition SDOM_Utils.cpp:17
SDL_Texture * getTexture()
Definition SDOM_Utils.cpp:22
std::string normalizeAnchorString(const std::string &s)
Definition SDOM_Utils.cpp:52
void printMessageBox(const std::string &title, const std::string &message, const std::string &file, int line, const std::string &colorTitle, const std::string &colorMsg, const std::string &colorBorder)
Definition SDOM_Utils.cpp:181
Stage * getStage()
Definition SDOM_Utils.cpp:18