TDME2 1.9.121
|
GUI screen node that represents a screen that can be rendered via GUI system. More...
#include <tdme/gui/nodes/GUIScreenNode.h>
Classes | |
struct | ScrollToNodeStruct |
Public Member Functions | |
const string & | getFileName () |
const string & | getApplicationRootPathName () |
const string & | getApplicationSubPathName () |
GUI * | getGUI () |
void | setGUI (GUI *gui) |
Set GUI. More... | |
int | getScreenWidth () |
int | getScreenHeight () |
bool | isVisible () |
void | setVisible (bool visible) |
Set visible. More... | |
bool | isPopUp () |
void | setPopUp (bool popUp) |
Set pop up. More... | |
const vector< GUINode * > & | getFloatingNodes () |
void | scrollToNodeX (const string &node, const string &toNode) |
Register deferred scroll to node X. More... | |
void | scrollToNodeY (const string &node, const string &toNode) |
Register deferred scroll to node Y. More... | |
int | getContentWidth () override |
int | getContentHeight () override |
void | layout () override |
Layout. More... | |
void | invalidateLayout (GUINode *node) |
Mark a node to be invalidated regarding layout. More... | |
GUINode * | forceInvalidateLayout (GUINode *node) |
Actually do the invalidate layout. More... | |
void | invalidateLayouts () |
Actually do the nodes marked for layout invalidation. More... | |
void | forceLayout (GUINode *node) |
Force layout node content (e.g. More... | |
void | scrollToNodes () |
Scroll to nodes. More... | |
void | setScreenSize (int width, int height) |
Set screen size. More... | |
GUINode * | getNodeById (const string &nodeId) |
Get GUI node by id. More... | |
void | removeNodeById (const string &nodeId, bool resetScrollOffsets) |
Remove GUI node by id. More... | |
GUINode * | getInnerNodeById (const string &nodeId) |
Get inner GUI node by id. More... | |
const string | allocateNodeId () |
Allocate node id. More... | |
void | render (GUIRenderer *guiRenderer) override |
Render screen. More... | |
void | renderFloatingNodes (GUIRenderer *guiRenderer) |
Render floating nodes. More... | |
void | determineFocussedNodes (GUIParentNode *parentNode, vector< GUIElementNode * > &focusableNodes) |
Determine focussed nodes. More... | |
void | determineMouseEventNodes (GUIMouseEvent *event, bool floatingNode, unordered_set< string > &eventNodeIds, unordered_set< string > &eventFloatingNodeIds) override |
Determine mouse event nodes. More... | |
void | addActionListener (GUIActionListener *listener) |
Add action listener. More... | |
void | removeActionListener (GUIActionListener *listener) |
Remove action listener. More... | |
GUIInputEventHandler * | getInputEventHandler () |
void | setInputEventHandler (GUIInputEventHandler *inputEventHandler) |
Set input event handler. More... | |
void | delegateActionPerformed (GUIActionListenerType type, GUIElementNode *node) |
Delegate action performed. More... | |
void | addChangeListener (GUIChangeListener *listener) |
Add change listener. More... | |
void | removeChangeListener (GUIChangeListener *listener) |
Remove change listener. More... | |
void | delegateValueChanged (GUIElementNode *node) |
Delegate value changed. More... | |
void | addMouseOverListener (GUIMouseOverListener *listener) |
Add mouse over listener. More... | |
void | removeMouseOverListener (GUIMouseOverListener *listener) |
Remove mouse over listener. More... | |
void | delegateMouseOver (GUIElementNode *node) |
Delegate mouse over event. More... | |
void | addContextMenuRequestListener (GUIContextMenuRequestListener *listener) |
Add context menu request listener. More... | |
void | removeContextMenuRequestListener (GUIContextMenuRequestListener *listener) |
Remove context menu request listener. More... | |
void | delegateContextMenuRequest (GUIElementNode *node, int mouseX, int mouseY) |
Delegate mouse over event. More... | |
void | addFocusListener (GUIFocusListener *listener) |
Add focus listener. More... | |
void | removeFocusListener (GUIFocusListener *listener) |
Remove focus listener. More... | |
void | delegateFocus (GUIElementNode *node) |
Delegate focus event. More... | |
void | delegateUnfocus (GUIElementNode *node) |
Delegate unfocus event. More... | |
void | addTickNode (GUINode *node) |
Add tick node, registered node controllers will have a tick once per frame. More... | |
void | removeTickNode (GUINode *node) |
Remove tick node. More... | |
void | getValues (unordered_map< string, MutableString > &values) |
Get values. More... | |
void | setValues (const unordered_map< string, MutableString > &values) |
Set values. More... | |
GUIScreenNode_SizeConstraints & | getSizeConstraints () |
void | addTimedExpression (int64_t time, const string &expression) |
Add a timed expression. More... | |
void | addNodeElementNodeDependency (const string &elementNodeId, const string &nodeId) |
Add node to element node dependency. More... | |
![]() | |
void | clearSubNodes () |
Clear sub nodes. More... | |
void | replaceSubNodes (const string &xml, bool resetScrollOffsets) |
Replace sub nodes with given XML. More... | |
void | addSubNodes (const string &xml, bool resetScrollOffsets) |
Add sub nodes with given XML. More... | |
void | addSubNode (GUINode *node) |
Add sub node. More... | |
void | moveNodes (GUIParentNode *otherParentNode) |
Move children nodes from other parent node into this parent node. More... | |
GUIParentNode_Overflow * | getOverflowX () |
GUIParentNode_Overflow * | getOverflowY () |
float | getChildrenRenderOffsetX () |
void | setChildrenRenderOffsetX (float childrenRenderOffSetX) |
Set children render offset x. More... | |
float | getChildrenRenderOffsetY () |
void | setChildrenRenderOffsetY (float childrenRenderOffSetY) |
Set children render offset y. More... | |
void | getChildControllerNodes (vector< GUINode * > &childControllerNodes, bool requireConditionsMet=false) |
Get child controller nodes. More... | |
void | dispose () override |
Dispose node. More... | |
void | setConditionsMet () override |
Set conditions met for this node and its subnodes. More... | |
void | render (GUIRenderer *guiRenderer) override |
Render. More... | |
void | determineMouseEventNodes (GUIMouseEvent *event, bool floatingNode, unordered_set< string > &eventNodeIds, unordered_set< string > &eventFloatingNodeIds) override |
Determine mouse event nodes. More... | |
void | invalidateRenderCaches () |
Invalidate render caches. More... | |
![]() | |
GUIScreenNode * | getScreenNode () |
GUIParentNode * | getParentNode () |
const string & | getId () |
const string | getHierarchicalId () |
virtual const string | getNodeType ()=0 |
virtual int | getContentWidth ()=0 |
virtual int | getContentHeight ()=0 |
virtual int | getAutoWidth () |
virtual int | getAutoHeight () |
GUINode_Border & | getBorder () |
GUINode_Padding & | getPadding () |
GUINode_RequestedConstraints & | getRequestsConstraints () |
GUINode_ComputedConstraints & | getComputedConstraints () |
GUIColor & | getBackgroundColor () |
virtual void | dispose () |
Dispose node. More... | |
bool | isConditionsMet () |
Determine if conditions are set. More... | |
virtual void | setConditionsMet () |
Set conditions met for this node and its subnodes. More... | |
virtual void | layoutOnDemand () |
Layout on demand. More... | |
bool | hasEffects () |
virtual void | applyEffects (GUIRenderer *guiRenderer) |
Apply effects. More... | |
virtual void | undoEffects (GUIRenderer *guiRenderer) |
Undo effects. More... | |
virtual void | render (GUIRenderer *guiRenderer) |
Render. More... | |
float | computeParentChildrenRenderOffsetXTotal () |
float | computeParentChildrenRenderOffsetYTotal () |
bool | isEventBelongingToNode (GUIMouseEvent *event, Vector2 &position) |
Is event belonging to node. More... | |
bool | isEventBelongingToNode (GUIMouseEvent *event) |
Is event belonging to node. More... | |
void | getEventOffNodeRelativePosition (GUIMouseEvent *event, Vector2 &position) |
Get event off node relative position TODO: use Vector2 instead of array<float, 2> More... | |
void | getEventNodePosition (GUIMouseEvent *event, Vector2 &position) |
Get event position clamped to node constraints TODO: use Vector2 instead of array<float, 2> More... | |
GUIParentNode * | getParentControllerNode () |
virtual void | determineMouseEventNodes (GUIMouseEvent *event, bool floatingNode, unordered_set< string > &eventNodeIds, unordered_set< string > &eventFloatingNodeIds) |
Determine mouse event nodes. More... | |
GUINodeController * | getController () |
void | setController (GUINodeController *controller) |
Set up node controller. More... | |
void | scrollToNodeY (GUIParentNode *toNode=nullptr) |
Scroll to node Y. More... | |
void | scrollToNodeX (GUIParentNode *toNode=nullptr) |
Scroll to node X. More... | |
void | setBackgroundImage (const string &backgroundImage) |
Set background image. More... | |
int | getGUIEffectOffsetX () |
void | setGUIEffectOffsetX (int guiEffectOffsetX) |
Set GUI effect offset X. More... | |
int | getGUIEffectOffsetY () |
void | setGUIEffectOffsetY (int guiEffectOffsetY) |
Set GUI effect offset Y. More... | |
GUIEffectState * | getEffectState () |
GUIEffect * | getEffect (const string &id) |
Get effect. More... | |
void | addEffect (const string &id, GUIEffect *effect) |
Add effect, effect already registered with the is will be removed. More... | |
void | removeEffect (const string &id) |
Remove effect. More... | |
Static Public Member Functions | |
static GUIScreenNode_SizeConstraints | createSizeConstraints (const string &minWidth, const string &minHeight, const string &maxWidth, const string &maxHeight) |
Create size constraints. More... | |
![]() | |
static GUIParentNode_Overflow * | createOverflow (const string &overflow) |
Create over flow. More... | |
static GUINode_RequestedConstraints | createRequestedConstraints (const string &left, const string &top, const string &width, const string &height, int factor) |
Create requested constraints. More... | |
![]() | |
static GUINode_Alignments | createAlignments (const string &horizontal, const string &vertical) |
Create alignments. More... | |
static GUINode_RequestedConstraints | createRequestedConstraints (const string &left, const string &top, const string &width, const string &height, int factor) |
Create requested constraints. More... | |
static GUIColor | getRequestedColor (const string &color, const GUIColor &defaultColor) |
Get color. More... | |
static GUINode_Flow * | createFlow (const string &flow) |
Create flow. More... | |
static GUINode_Border | createBorder (const string &allBorder, const string &left, const string &top, const string &right, const string &bottom, const string &allBorderColor, const string &leftColor, const string &topColor, const string &rightColor, const string &bottomColor) |
Create border. More... | |
static GUINode_Padding | createPadding (const string &allPadding, const string &left, const string &top, const string &right, const string &bottom) |
Create padding. More... | |
static GUINode_Scale9Grid | createScale9Grid (const string &all, const string &left, const string &top, const string &right, const string &bottom) |
Create scale 9 grid. More... | |
static GUINodeConditions | createConditions (const string &conditions) |
Create conditions. More... | |
static void | dumpNode (GUINode *node, int depth=0, int indent=0, int depthIdx=0) |
Dump node. More... | |
static void | dumpParentNodes (GUINode *node, int indent=0) |
Dump parent nodes. More... | |
Private Member Functions | |
bool | addNode (GUINode *node) |
Add node. More... | |
bool | removeNode (GUINode *node) |
Add node. More... | |
void | tick () |
Calls registered tick nodes controller tick method. More... | |
Private Attributes | |
string | applicationRootPathName |
string | applicationSubPathName |
string | fileName |
GUI * | gui { nullptr } |
int | nodeCounter |
int | screenWidth |
int | screenHeight |
unordered_map< string, GUINode * > | nodesById |
unordered_map< string, GUINode * > | tickNodesById |
vector< GUINode * > | floatingNodes |
vector< GUIActionListener * > | actionListener |
vector< GUIChangeListener * > | changeListener |
vector< GUIMouseOverListener * > | mouseOverListener |
vector< GUIContextMenuRequestListener * > | contextMenuRequestListener |
vector< GUIFocusListener * > | focusListener |
GUIInputEventHandler * | inputEventHandler |
vector< GUINode * > | childControllerNodes |
GUIScreenNode_SizeConstraints | sizeConstraints |
unordered_set< string > | invalidateLayoutNodeIds |
unordered_map< string, unordered_set< string > > | elementNodeToNodeMapping |
bool | visible |
bool | popUp |
unordered_map< int64_t, string > | timedExpressions |
vector< ScrollToNodeStruct > | scrollToNodesX |
vector< ScrollToNodeStruct > | scrollToNodesY |
Friends | |
class | tdme::gui::GUI |
class | tdme::gui::GUIParser |
class | GUIElementNode |
class | GUINode |
class | GUINodeConditions |
class | GUIParentNode |
GUI screen node that represents a screen that can be rendered via GUI system.
Definition at line 55 of file GUIScreenNode.h.
|
protected |
Constructor @oaram fileName file name or complete file path.
applicationRootPath | application root path |
applicationSubPathName | application sub path name which is usually "engine" or "project" |
flow | flow |
overflowX | overflow x |
overflowY | overflow y |
alignments | alignments |
requestedConstraints | requested constraints |
backgroundColor | background color |
backgroundImage | background image |
backgroundImageScale9Grid | background image scale 9 grid |
backgroundImageEffectColorMul | background image effect color mul |
backgroundImageEffectColorAdd | background image effect color add |
border | border |
padding | padding |
sizeConstraints | size constraints |
showOn | show on |
hideOn | hide on |
scrollable | scrollable |
popUp | pop up |
tdme::gui::GUIParserException |
Definition at line 59 of file GUIScreenNode.cpp.
|
protected |
Destructor.
Definition at line 99 of file GUIScreenNode.cpp.
void addActionListener | ( | GUIActionListener * | listener | ) |
void addChangeListener | ( | GUIChangeListener * | listener | ) |
void addContextMenuRequestListener | ( | GUIContextMenuRequestListener * | listener | ) |
Add context menu request listener.
listener | listener |
Definition at line 508 of file GUIScreenNode.cpp.
void addFocusListener | ( | GUIFocusListener * | listener | ) |
void addMouseOverListener | ( | GUIMouseOverListener * | listener | ) |
Add mouse over listener.
listener | listener |
Definition at line 490 of file GUIScreenNode.cpp.
|
private |
|
inline |
Add node to element node dependency.
elementNodeId | element node id |
nodeId | node id that depends on element node condition changes |
Definition at line 566 of file GUIScreenNode.h.
|
inline |
Add tick node, registered node controllers will have a tick once per frame.
Definition at line 513 of file GUIScreenNode.h.
|
inline |
Add a timed expression.
time | time |
expression | expression |
Definition at line 557 of file GUIScreenNode.h.
|
inline |
|
static |
Create size constraints.
minWidth | min width |
minHeight | min height |
maxWidth | max width |
maxHeight | max height |
Definition at line 607 of file GUIScreenNode.cpp.
void delegateActionPerformed | ( | GUIActionListenerType | type, |
GUIElementNode * | node | ||
) |
Delegate action performed.
type | type |
node | node |
Definition at line 464 of file GUIScreenNode.cpp.
void delegateContextMenuRequest | ( | GUIElementNode * | node, |
int | mouseX, | ||
int | mouseY | ||
) |
Delegate mouse over event.
node | node |
mouseX | unscaled mouse X position |
mouseY | unscaled mouse Y position |
Definition at line 517 of file GUIScreenNode.cpp.
void delegateFocus | ( | GUIElementNode * | node | ) |
void delegateMouseOver | ( | GUIElementNode * | node | ) |
void delegateUnfocus | ( | GUIElementNode * | node | ) |
void delegateValueChanged | ( | GUIElementNode * | node | ) |
void determineFocussedNodes | ( | GUIParentNode * | parentNode, |
vector< GUIElementNode * > & | focusableNodes | ||
) |
Determine focussed nodes.
parentNode | parent node |
focusableNodes | focusable nodes |
Definition at line 416 of file GUIScreenNode.cpp.
|
overridevirtual |
Determine mouse event nodes.
event | event |
floatingNode | if node is floating node |
eventNodeIds | event node ids |
eventFloatingNodeIds | event floating node ids |
Reimplemented from GUIParentNode.
Definition at line 435 of file GUIScreenNode.cpp.
Actually do the invalidate layout.
node | node |
Definition at line 175 of file GUIScreenNode.cpp.
void forceLayout | ( | GUINode * | node | ) |
Force layout node content (e.g.
child nodes or content) without determining parent nodes to be layouted this does also does call layouted nodes post layout method
node | node |
Definition at line 270 of file GUIScreenNode.cpp.
|
inline |
Definition at line 111 of file GUIScreenNode.h.
|
inline |
Definition at line 118 of file GUIScreenNode.h.
|
overridevirtual |
|
overridevirtual |
|
inline |
Definition at line 104 of file GUIScreenNode.h.
const vector< GUINode * > & getFloatingNodes | ( | ) |
Definition at line 139 of file GUIScreenNode.cpp.
GUI * getGUI | ( | ) |
Definition at line 110 of file GUIScreenNode.cpp.
|
inline |
Get inner GUI node by id.
nodeId | nodeId |
Definition at line 365 of file GUIScreenNode.h.
GUIInputEventHandler * getInputEventHandler | ( | ) |
Definition at line 454 of file GUIScreenNode.cpp.
|
inline |
Get GUI node by id.
nodeId | nodeId |
Definition at line 345 of file GUIScreenNode.h.
|
overrideprotectedvirtual |
|
inline |
Definition at line 143 of file GUIScreenNode.h.
|
inline |
Definition at line 136 of file GUIScreenNode.h.
|
inline |
Definition at line 539 of file GUIScreenNode.h.
void getValues | ( | unordered_map< string, MutableString > & | values | ) |
|
inline |
Mark a node to be invalidated regarding layout.
node | node |
Definition at line 305 of file GUIScreenNode.h.
void invalidateLayouts | ( | ) |
Actually do the nodes marked for layout invalidation.
Definition at line 236 of file GUIScreenNode.cpp.
|
overrideprotectedvirtual |
|
inline |
Definition at line 163 of file GUIScreenNode.h.
|
inline |
Definition at line 150 of file GUIScreenNode.h.
|
overridevirtual |
void removeActionListener | ( | GUIActionListener * | listener | ) |
Remove action listener.
listener | listener |
Definition at line 449 of file GUIScreenNode.cpp.
void removeChangeListener | ( | GUIChangeListener * | listener | ) |
Remove change listener.
listener | listener |
Definition at line 477 of file GUIScreenNode.cpp.
void removeContextMenuRequestListener | ( | GUIContextMenuRequestListener * | listener | ) |
Remove context menu request listener.
listener | listener |
Definition at line 513 of file GUIScreenNode.cpp.
void removeFocusListener | ( | GUIFocusListener * | listener | ) |
Remove focus listener.
listener | listener |
Definition at line 529 of file GUIScreenNode.cpp.
void removeMouseOverListener | ( | GUIMouseOverListener * | listener | ) |
Remove mouse over listener.
listener | listener |
Definition at line 496 of file GUIScreenNode.cpp.
|
private |
void removeNodeById | ( | const string & | nodeId, |
bool | resetScrollOffsets | ||
) |
Remove GUI node by id.
nodeId | nodeId |
resetScrollOffsets | reset scroll offsets |
Definition at line 344 of file GUIScreenNode.cpp.
|
inline |
Remove tick node.
Definition at line 520 of file GUIScreenNode.h.
|
overridevirtual |
Render screen.
guiRenderer | gui renderer |
Reimplemented from GUIParentNode.
Definition at line 382 of file GUIScreenNode.cpp.
void renderFloatingNodes | ( | GUIRenderer * | guiRenderer | ) |
Render floating nodes.
guiRenderer | gui renderer |
Definition at line 392 of file GUIScreenNode.cpp.
void scrollToNodes | ( | ) |
Scroll to nodes.
Definition at line 293 of file GUIScreenNode.cpp.
|
inline |
Register deferred scroll to node X.
node | node |
toNode | to node |
Definition at line 183 of file GUIScreenNode.h.
|
inline |
Register deferred scroll to node Y.
node | node |
toNode | to node |
Definition at line 197 of file GUIScreenNode.h.
void setGUI | ( | GUI * | gui | ) |
void setInputEventHandler | ( | GUIInputEventHandler * | inputEventHandler | ) |
Set input event handler.
inputEventHandler | input event handler |
Definition at line 459 of file GUIScreenNode.cpp.
void setPopUp | ( | bool | popUp | ) |
void setScreenSize | ( | int | width, |
int | height | ||
) |
Set screen size.
width | width |
height | height |
Definition at line 308 of file GUIScreenNode.cpp.
void setValues | ( | const unordered_map< string, MutableString > & | values | ) |
void setVisible | ( | bool | visible | ) |
|
private |
Calls registered tick nodes controller tick method.
Definition at line 546 of file GUIScreenNode.cpp.
|
friend |
Definition at line 60 of file GUIScreenNode.h.
|
friend |
Definition at line 61 of file GUIScreenNode.h.
|
friend |
Definition at line 62 of file GUIScreenNode.h.
|
friend |
Definition at line 63 of file GUIScreenNode.h.
|
friend |
Definition at line 58 of file GUIScreenNode.h.
|
friend |
Definition at line 59 of file GUIScreenNode.h.
|
private |
Definition at line 76 of file GUIScreenNode.h.
|
private |
Definition at line 66 of file GUIScreenNode.h.
|
private |
Definition at line 67 of file GUIScreenNode.h.
|
private |
Definition at line 77 of file GUIScreenNode.h.
|
private |
Definition at line 82 of file GUIScreenNode.h.
|
private |
Definition at line 79 of file GUIScreenNode.h.
|
private |
Definition at line 85 of file GUIScreenNode.h.
|
private |
Definition at line 68 of file GUIScreenNode.h.
|
private |
Definition at line 75 of file GUIScreenNode.h.
|
private |
Definition at line 80 of file GUIScreenNode.h.
|
private |
Definition at line 69 of file GUIScreenNode.h.
|
private |
Definition at line 81 of file GUIScreenNode.h.
|
private |
Definition at line 84 of file GUIScreenNode.h.
|
private |
Definition at line 78 of file GUIScreenNode.h.
|
private |
Definition at line 70 of file GUIScreenNode.h.
|
private |
Definition at line 73 of file GUIScreenNode.h.
|
private |
Definition at line 88 of file GUIScreenNode.h.
|
private |
Definition at line 72 of file GUIScreenNode.h.
|
private |
Definition at line 71 of file GUIScreenNode.h.
|
private |
Definition at line 97 of file GUIScreenNode.h.
|
private |
Definition at line 98 of file GUIScreenNode.h.
|
private |
Definition at line 83 of file GUIScreenNode.h.
|
private |
Definition at line 74 of file GUIScreenNode.h.
|
private |
Definition at line 90 of file GUIScreenNode.h.
|
private |
Definition at line 87 of file GUIScreenNode.h.