7 #ifndef CAFU_GUISYS_GUI_HPP_INCLUDED
8 #define CAFU_GUISYS_GUI_HPP_INCLUDED
10 #include "MaterialSystem/MaterialManagerImpl.hpp"
11 #include "Templates/Pointer.hpp"
12 #include "TypeSys.hpp"
17 namespace cf {
class UniScriptStateT; }
18 namespace MatSys {
class RenderMaterialT; }
37 const float VIRTUAL_SCREEN_SIZE_X=640.0f;
38 const float VIRTUAL_SCREEN_SIZE_Y=480.0f;
83 void LoadScript(
const std::string& ScriptName,
int Flags = 0);
110 void Activate(
bool doActivate=
true);
125 void GetMousePos(
float& MousePosX_,
float& MousePosY_)
const;
128 void SetMousePos(
float MousePosX_,
float MousePosY_);
148 void Render(
bool zLayerCoating=
false)
const;
182 std::string ScriptName;
184 const bool m_IsOwnScriptSt;
189 GuiResourcesT& m_GuiResources;
201 float m_MouseCursorSize;
209 static int Activate(lua_State* LuaState);
210 static int Close(lua_State* LuaState);
212 static int SetFullCover(lua_State* LuaState);
215 static int SetMouseMat(lua_State* LuaState);
216 static int SetMouseIsShown(lua_State* LuaState);
217 static int CreateNew(lua_State* LuaState);
218 static int SetFocus(lua_State* LuaState);
220 static int SetRootWindow(lua_State* LuaState);
221 static int Init(lua_State* LuaState);
222 static int toString(lua_State* LuaState);
224 static const luaL_Reg MethodsList[];
225 static const char* DocClass;
bool GetIsFullCover() const
Returns whether this GUI is fullscreen and fully opaque, i.e. whether this GUI covers everything unde...
Definition: GuiImpl.hpp:122
void ObsoleteForceKill()
A method that is needed when the obsolete, deprecated ctor above is used.
Definition: GuiImpl.cpp:288
bool ProcessDeviceEvent(const CaKeyboardEventT &KE)
Processes a keyboard event by forwarding it to the window that currently has the input focus...
Definition: GuiImpl.cpp:453
void Render(bool zLayerCoating=false) const
Renders this GUI.
Definition: GuiImpl.cpp:410
This class represents a surface render material.
Definition: RenderMaterial.hpp:25
bool GetIsInteractive() const
Returns whether this GUI is interactive (reacts to device events) or not. This is of important mainly...
Definition: GuiImpl.hpp:119
~GuiImplT()
The destructor.
Definition: GuiImpl.cpp:267
This class implements smart (reference-counted) pointers.
Definition: Pointer.hpp:43
UniScriptStateT & GetScriptState()
Returns the script state of this GUI.
Definition: GuiImpl.hpp:101
bool IsMouseShown() const
Returns whether this GUI shows a mouse cursor.
Definition: GuiImpl.hpp:140
void LoadScript(const std::string &ScriptName, int Flags=0)
Assigns the given GUI to the global "gui" and loads the given script in order to initialize it...
Definition: GuiImpl.cpp:128
IntrusivePtrT< WindowT > GetFocusWindow() const
Returns the window in this GUI that has the keyboard input focus.
Definition: GuiImpl.cpp:343
void SetMouseCursorSize(float s)
Sets the size of the mouse cursor.
Definition: GuiImpl.hpp:134
This struct describes a mouse event.
Definition: OpenGLWindow.hpp:185
void Activate(bool doActivate=true)
Activates or deactivates this GUI.
Definition: GuiImpl.cpp:349
void DistributeClockTickEvents(float t)
"Creates" a time tick event for each window of the GUI (no matter whether its currently visible (show...
Definition: GuiImpl.cpp:550
const MaterialManagerImplT & GetMaterialManager() const
Returns the material manager instance of this GUI.
Definition: GuiImpl.hpp:86
float GetMouseCursorSize() const
Returns the size of the mouse cursor.
Definition: GuiImpl.hpp:131
This class manages the type infos.
Definition: TypeSys.hpp:145
InitFlagsT
Flags for initializing a GUI from a script.
Definition: GuiImpl.hpp:49
This class implements the MaterialManagerI interface.
Definition: MaterialManagerImpl.hpp:23
This class implements a Graphical User Interface (GUI).
Definition: GuiImpl.hpp:42
GuiResourcesT & GetGuiResources() const
Returns the resource provider for fonts and models that are used in this GUI.
Definition: GuiImpl.hpp:95
This struct describes a keyboard event.
Definition: OpenGLWindow.hpp:20
A class that is thrown on GUI initialization errors.
Definition: GuiImpl.hpp:233
const std::string & GetScriptName() const
Returns the name of the script file of this GUI.
Definition: GuiImpl.cpp:331
bool GetIsActive() const
Returns whether this GUI is active or not. This is of importance mainly for the GuiMan, which doesn't send us events and doesn't draw us if we're not active.
Definition: GuiImpl.hpp:113
Whether the GUI is instantiated in the GUI Editor. If set, only the static data will be loaded...
Definition: GuiImpl.hpp:52
IntrusivePtrT< WindowT > GetRootWindow() const
Returns the root window of this GUI.
Definition: GuiImpl.cpp:337
void SetShowMouse(bool ShowMouse_)
Sets whether this GUI shows a mouse cursor.
Definition: GuiImpl.cpp:404
MatSys::RenderMaterialT * GetDefaultRM() const
Returns the default RenderMaterialT that should be used for borders and backgrounds if no other mater...
Definition: GuiImpl.cpp:319
static void InitScriptState(UniScriptStateT &ScriptState)
Initializes the given script state for use with GuiImplT instances.
Definition: GuiImpl.cpp:58
MatSys::RenderMaterialT * GetPointerRM() const
Returns the (default) RenderMaterialT for the mouse pointer.
Definition: GuiImpl.cpp:325
void SetInteractive(bool IsInteractive_=true)
Sets whether this GUI is interactive or not. See GetIsInteractive() for additional information...
Definition: GuiImpl.cpp:364
This class represents the state of a script: the underlying Lua state, pending coroutines, metatables for C++ class hierarchies, etc.
Definition: UniScriptState.hpp:214
GuiImplT(UniScriptStateT &ScriptState, GuiResourcesT &GuiRes)
Constructor for creating a window hierarchy (=="a GUI") from the GUI script file GuiScriptName.
Definition: GuiImpl.cpp:79
Definition: TypeSys.hpp:52
Definition: TypeSys.hpp:57
void GetMousePos(float &MousePosX_, float &MousePosY_) const
Returns the position of the mouse cursor.
Definition: GuiImpl.cpp:370
This class keeps type information (about an entity class that occurs in the game).
Definition: TypeSys.hpp:79
Normally, the GuiScriptName parameter to the GuiImplT ctor is a filename. If this is set...
Definition: GuiImpl.hpp:51
void SetMousePos(float MousePosX_, float MousePosY_)
Sets the position of the mouse cursor.
Definition: GuiImpl.cpp:377
A base class for objects that are reference-counted with IntrusivePtrTs.
Definition: Pointer.hpp:13
This class manages and provides resources (fonts and models) for GuiImplT instances.
Definition: GuiResources.hpp:26