TDME2 1.9.121
|
#include <tdme/gui/nodes/GUINode.h>
Public Member Functions | |
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 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... | |
Protected Member Functions | |
GUINode (GUIScreenNode *screenNode, GUIParentNode *parentNode, const string &id, GUINode_Flow *flow, const GUINode_Alignments &alignments, const GUINode_RequestedConstraints &requestedConstraints, const GUIColor &backgroundColor, const string &backgroundImage, const GUINode_Scale9Grid &backgroundImageScale9Grid, const GUIColor &backgroundImageEffectColorMul, const GUIColor &backgroundImageEffectColorAdd, const GUINode_Border &border, const GUINode_Padding &padding, const GUINodeConditions &showOn, const GUINodeConditions &hideOn) | |
Public constructor. More... | |
virtual | ~GUINode () |
Destructor. More... | |
virtual bool | isContentNode ()=0 |
virtual void | setLeft (int left) |
Set computed left. More... | |
virtual void | setTop (int top) |
Set computed top. More... | |
virtual void | layout () |
Layout. More... | |
virtual void | computeContentAlignment () |
Do content alignment. More... | |
int | layoutConstraintPixel (GUINode_RequestedConstraints_RequestedConstraintsType *type, int autoValue, int parentValue, int value) |
Layout constraint. More... | |
bool | checkConditions () |
Check if conditions are met. More... | |
void | onSetConditions (const vector< string > &conditions) |
On set condition. More... | |
bool | haveActiveOutEffect () |
Determine if we have a out effect active. More... | |
bool | shouldRender () |
Determine if to render. More... | |
void | _scrollToNodeX (GUIParentNode *toNode=nullptr) |
Scroll to node X. More... | |
void | _scrollToNodeY (GUIParentNode *toNode=nullptr) |
Scroll to node Y. More... | |
Static Protected Member Functions | |
static GUINode_RequestedConstraints_RequestedConstraintsType * | getRequestedConstraintsType (const string &constraint, GUINode_RequestedConstraints_RequestedConstraintsType *defaultConstraintsType) |
Get requested constraints type. More... | |
static int | getRequestedConstraintsValue (const string &constraint, int defaultConstraintsValue) |
Get requested constraints value. More... | |
static int | getRequestedPixelValue (const string &value, int defaultValue) |
Get requested pixel value. More... | |
Protected Attributes | |
GUIScreenNode * | screenNode { nullptr } |
GUIParentNode * | parentNode { nullptr } |
string | id |
GUINode_Alignments | alignments |
GUINode_RequestedConstraints | requestedConstraints |
GUINode_ComputedConstraints | computedConstraints |
GUIColor | backgroundColor |
Texture * | backgroundTexture { nullptr } |
int | backgroundTextureId |
GUINode_Scale9Grid | backgroundImageScale9Grid |
GUIColor | backgroundImageEffectColorMul |
GUIColor | backgroundImageEffectColorAdd |
GUINode_Padding | padding |
GUINode_Border | border |
GUINodeConditions | showOn |
GUINodeConditions | hideOn |
GUINodeController * | controller { nullptr } |
unordered_map< string, GUIEffect * > | effects |
int | guiEffectOffsetX |
int | guiEffectOffsetY |
bool | conditionsMet |
bool | layouted |
bool | haveOutEffect |
vector< string > | lastConditions |
GUIEffectState * | effectState { nullptr } |
Private Member Functions | |
void | cfDetermineElementNodeDependencies (vector< string > &elementNodeDependencies) |
Determine element node dependencies. More... | |
void | cfParse (const string &term, string &function, vector< string > &arguments) |
Parse condition function term. More... | |
bool | cfCall (GUIElementNode *elementNode, const string &function, const vector< string > &arguments) |
Call condition function with arguments. More... | |
void | cfCallDetermineElementNodeDependencies (const string &function, const vector< string > &arguments, vector< string > &elementNodeDependencies) |
Determine element node dependencies - Call condition function with arguments. More... | |
bool | cfEmpty (const vector< string > &arguments) |
Condition function: empty. More... | |
bool | cfHasCondition (GUIElementNode *elementNode, const vector< string > &arguments) |
Condition function: has condition. More... | |
void | cfHasConditionDetermineElementNodeDependencies (const vector< string > &arguments, vector< string > &elementNodeDependencies) |
Determine element node dependencies - Condition function: has condition. More... | |
Private Attributes | |
GUINode_Flow * | flow |
Friends | |
class | tdme::gui::GUI |
class | GUIElementNode |
class | GUIImageNode |
class | GUILayerNode |
class | GUILayoutNode |
class | GUIParentNode |
class | GUIScreenNode |
class | GUITableNode |
class | GUITableCellNode |
class | GUITableRowNode |
class | GUIHorizontalScrollbarInternalController |
class | GUIVerticalScrollbarInternalController |
class | GUIInputInternalController |
class | GUINodeConditions |
class | GUINode_Flow |
class | GUINode_AlignmentHorizontal |
class | GUINode_AlignmentVertical |
class | GUINode_RequestedConstraints |
class | GUINode_RequestedConstraints_RequestedConstraintsType |
|
protected |
Public constructor.
screenNode | screen node |
parentNode | parent node |
id | id |
flow | flow |
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 |
showOn | show on |
hideOn | hide on |
Definition at line 85 of file GUINode.cpp.
|
protectedvirtual |
Destructor.
Definition at line 135 of file GUINode.cpp.
|
protected |
Scroll to node X.
toNode | stop at node to node |
Definition at line 1084 of file GUINode.cpp.
|
protected |
Scroll to node Y.
toNode | stop at node to node |
Definition at line 1106 of file GUINode.cpp.
void addEffect | ( | const string & | id, |
GUIEffect * | effect | ||
) |
Add effect, effect already registered with the is will be removed.
id | id |
effect | effect |
Definition at line 1344 of file GUINode.cpp.
|
virtual |
|
private |
Call condition function with arguments.
elementNode | element node to work with |
function | function to be called |
arguments | function arguments |
Definition at line 1255 of file GUINode.cpp.
|
private |
Determine element node dependencies - Call condition function with arguments.
function | function to be called |
arguments | function arguments |
elementNodeDependencies | element node dependencies |
Definition at line 1270 of file GUINode.cpp.
|
private |
Determine element node dependencies.
elementNodeDependencies | element node dependencies |
Definition at line 1192 of file GUINode.cpp.
|
private |
Condition function: empty.
arguments | arguments Argument should look like 'test', "test", '', "", 123, 0, 123.4, 0.0 for now Arguments or OR connected |
Definition at line 1321 of file GUINode.cpp.
|
private |
Condition function: has condition.
elementNode | element node to work with |
arguments | arguments Format of arguments: [elementid.]condition Arguments or OR connected |
Definition at line 1285 of file GUINode.cpp.
|
private |
Determine element node dependencies - Condition function: has condition.
arguments | arguments Format of arguments: [elementid.]condition Arguments or OR connected |
Definition at line 1305 of file GUINode.cpp.
|
private |
Parse condition function term.
term | term |
function | function |
arguments | function arguments |
Definition at line 1211 of file GUINode.cpp.
|
protected |
|
protectedvirtual |
Do content alignment.
Reimplemented in GUIStyledTextNode.
Definition at line 205 of file GUINode.cpp.
float computeParentChildrenRenderOffsetXTotal | ( | ) |
Definition at line 951 of file GUINode.cpp.
float computeParentChildrenRenderOffsetYTotal | ( | ) |
Definition at line 962 of file GUINode.cpp.
|
static |
Create alignments.
horizontal | horizontal |
vertical | vertical |
Definition at line 260 of file GUINode.cpp.
|
static |
Create border.
allBorder | all border |
left | left |
top | top |
right | right |
bottom | bottom |
allBorderColor | all border color |
leftColor | left color |
topColor | top color |
rightColor | right color |
bottomColor | bottom color |
Definition at line 345 of file GUINode.cpp.
|
static |
|
static |
|
static |
Create padding.
allPadding | all padding |
left | left |
top | top |
right | right |
bottom | bottom |
Definition at line 367 of file GUINode.cpp.
|
static |
Create requested constraints.
left | left |
top | top |
width | width |
height | height |
factor | factor |
Definition at line 268 of file GUINode.cpp.
|
static |
Create scale 9 grid.
all | all |
left | left |
top | top |
right | right |
bottom | bottom |
Definition at line 381 of file GUINode.cpp.
|
virtual |
Determine mouse event nodes.
event | event |
floatingNode | if node is floating node |
eventNodeIds | event node ids |
eventFloatingNodeIds | event floating node ids |
Reimplemented in GUIPanelNode, GUIParentNode, and GUIScreenNode.
Definition at line 1062 of file GUINode.cpp.
|
virtual |
Dispose node.
Reimplemented in GUIFrameBufferNode, GUIGradientNode, GUIImageNode, GUIInputInternalNode, GUIParentNode, GUISpaceNode, GUIStyledTextNode, GUITextNode, GUITextureBaseNode, and GUITextureNode.
Definition at line 460 of file GUINode.cpp.
|
static |
Dump node.
node | node to dump |
depth | depth |
indent | indention |
depthIdx | depth index |
Definition at line 1133 of file GUINode.cpp.
|
static |
Dump parent nodes.
node | node to dump from |
indent | indention |
Definition at line 1165 of file GUINode.cpp.
|
virtual |
Definition at line 168 of file GUINode.cpp.
|
virtual |
Definition at line 159 of file GUINode.cpp.
|
inline |
|
inline |
|
inline |
|
pure virtual |
Implemented in GUIGradientNode, GUIHorizontalScrollbarInternalNode, GUIInputInternalNode, GUILayerNode, GUILayoutNode, GUIScreenNode, GUISpaceNode, GUIStyledTextNode, GUITableNode, GUITableRowNode, GUITextNode, GUITextureBaseNode, and GUIVerticalScrollbarInternalNode.
|
pure virtual |
Implemented in GUIGradientNode, GUIHorizontalScrollbarInternalNode, GUIInputInternalNode, GUILayerNode, GUILayoutNode, GUIScreenNode, GUISpaceNode, GUIStyledTextNode, GUITableNode, GUITableRowNode, GUITextNode, GUITextureBaseNode, and GUIVerticalScrollbarInternalNode.
|
inline |
GUIEffect * getEffect | ( | const string & | id | ) |
|
inline |
void getEventNodePosition | ( | GUIMouseEvent * | event, |
Vector2 & | position | ||
) |
Get event position clamped to node constraints TODO: use Vector2 instead of array<float, 2>
event | event |
position | position clamped to node constraints |
Definition at line 1040 of file GUINode.cpp.
void getEventOffNodeRelativePosition | ( | GUIMouseEvent * | event, |
Vector2 & | position | ||
) |
Get event off node relative position TODO: use Vector2 instead of array<float, 2>
event | event |
position | (will return x = 0 if in node on x axis, will return x < 0 (-pixel) if on the left of element, x > 0 (+pixel) if on the right of element, y behaves analogous to x) |
Definition at line 1014 of file GUINode.cpp.
|
inline |
|
inline |
const string getHierarchicalId | ( | ) |
Definition at line 148 of file GUINode.cpp.
|
pure virtual |
Implemented in GUIElementNode, GUIFrameBufferNode, GUIGradientNode, GUIHorizontalScrollbarInternalNode, GUIImageNode, GUIInputInternalNode, GUILayerNode, GUILayoutNode, GUIPanelNode, GUIScreenNode, GUISpaceNode, GUIStyledTextNode, GUITableCellNode, GUITableNode, GUITableRowNode, GUITextNode, GUITextureNode, GUIVerticalScrollbarInternalNode, and GUITextureBaseNode.
|
inline |
GUIParentNode * getParentControllerNode | ( | ) |
Definition at line 1053 of file GUINode.cpp.
|
inline |
Get color.
color | color |
defaultColor | default color |
tdme::gui::GUIParserException |
Definition at line 331 of file GUINode.cpp.
|
staticprotected |
Get requested constraints type.
constraint | constraint |
defaultConstraintsType | default constraints type |
Definition at line 286 of file GUINode.cpp.
|
staticprotected |
Get requested constraints value.
constraint | constraint |
defaultConstraintsValue | default constraints value |
Definition at line 304 of file GUINode.cpp.
|
staticprotected |
Get requested pixel value.
value | value |
defaultValue | default value |
Definition at line 322 of file GUINode.cpp.
|
inline |
|
inline |
|
protected |
Determine if we have a out effect active.
Definition at line 1484 of file GUINode.cpp.
|
inline |
|
protectedpure virtual |
Implemented in GUIElementNode, GUIGradientNode, GUIHorizontalScrollbarInternalNode, GUIInputInternalNode, GUILayerNode, GUILayoutNode, GUIScreenNode, GUISpaceNode, GUIStyledTextNode, GUITableNode, GUITableRowNode, GUITextNode, GUITextureBaseNode, and GUIVerticalScrollbarInternalNode.
bool isEventBelongingToNode | ( | GUIMouseEvent * | event | ) |
Is event belonging to node.
event | event |
Definition at line 1008 of file GUINode.cpp.
bool isEventBelongingToNode | ( | GUIMouseEvent * | event, |
Vector2 & | position | ||
) |
Is event belonging to node.
event | event |
position |
Definition at line 973 of file GUINode.cpp.
|
protectedvirtual |
Layout.
Reimplemented in GUILayerNode, GUIParentNode, and GUIScreenNode.
Definition at line 189 of file GUINode.cpp.
|
protected |
Layout constraint.
type | type |
autoValue | auto value |
parentValue | parent value |
value | value |
Definition at line 237 of file GUINode.cpp.
|
virtual |
Layout on demand.
Definition at line 471 of file GUINode.cpp.
|
protected |
void removeEffect | ( | const string & | id | ) |
|
virtual |
Render.
guiRenderer | gui renderer |
floatingNodes | floating nodes |
Reimplemented in GUIGradientNode, GUIHorizontalScrollbarInternalNode, GUIInputInternalNode, GUIParentNode, GUIScreenNode, GUISpaceNode, GUIStyledTextNode, GUITextNode, GUITextureBaseNode, and GUIVerticalScrollbarInternalNode.
Definition at line 508 of file GUINode.cpp.
void scrollToNodeX | ( | GUIParentNode * | toNode = nullptr | ) |
Scroll to node X.
toNode | stop at node to node |
Definition at line 1125 of file GUINode.cpp.
void scrollToNodeY | ( | GUIParentNode * | toNode = nullptr | ) |
Scroll to node Y.
toNode | stop at node to node |
Definition at line 1129 of file GUINode.cpp.
void setBackgroundImage | ( | const string & | backgroundImage | ) |
Set background image.
backgroundImage | background image |
Definition at line 1332 of file GUINode.cpp.
|
virtual |
Set conditions met for this node and its subnodes.
Reimplemented in GUIParentNode.
Definition at line 466 of file GUINode.cpp.
void setController | ( | GUINodeController * | controller | ) |
Set up node controller.
controller | controller |
Definition at line 1074 of file GUINode.cpp.
|
inline |
|
inline |
|
protectedvirtual |
Set computed left.
left | left |
Reimplemented in GUILayerNode, GUILayoutNode, GUITableNode, and GUITableRowNode.
Definition at line 177 of file GUINode.cpp.
|
protectedvirtual |
Set computed top.
top | top |
Reimplemented in GUILayerNode, GUILayoutNode, GUITableNode, and GUITableRowNode.
Definition at line 183 of file GUINode.cpp.
|
inlineprotected |
|
virtual |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
private |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |