TDME2 1.9.121
GUIScreenNode.cpp
Go to the documentation of this file.
2
3#include <algorithm>
4#include <map>
5#include <string>
6#include <unordered_map>
7#include <unordered_set>
8
9#include <tdme/tdme.h>
27#include <tdme/gui/GUI.h>
30
31using std::map;
32using std::remove;
33using std::reverse;
34using std::string;
35using std::to_string;
36using std::unordered_map;
37using std::unordered_set;
38
55using tdme::gui::GUI;
58
59GUIScreenNode::GUIScreenNode(
60 const string& fileName,
61 const string& applicationRootPathName,
62 const string& applicationSubPathName,
63 const string& id,
64 GUINode_Flow* flow,
65 GUIParentNode_Overflow* overflowX,
66 GUIParentNode_Overflow* overflowY,
67 const GUINode_Alignments& alignments,
68 const GUINode_RequestedConstraints& requestedConstraints,
69 const GUIColor& backgroundColor,
70 const string& backgroundImage,
71 const GUINode_Scale9Grid& backgroundImageScale9Grid,
72 const GUIColor& backgroundImageEffectColorMul,
73 const GUIColor& backgroundImageEffectColorAdd,
74 const GUINode_Border& border,
75 const GUINode_Padding& padding,
76 const GUIScreenNode_SizeConstraints& sizeConstraints,
77 const GUINodeConditions& showOn,
78 const GUINodeConditions& hideOn,
79 bool scrollable,
80 bool popUp
81):
82 GUIParentNode(this, nullptr, id, flow, overflowX, overflowY, alignments, requestedConstraints, backgroundColor, backgroundImage, backgroundImageScale9Grid, backgroundImageEffectColorMul, backgroundImageEffectColorAdd, border, padding, showOn, hideOn)
83{
84 this->fileName = fileName;
85 this->applicationRootPathName = applicationRootPathName;
86 this->applicationSubPathName = applicationSubPathName;
87 this->sizeConstraints = sizeConstraints;
88 this->gui = nullptr;
89 this->nodeCounter = 0;
90 this->screenWidth = 0;
91 this->screenHeight = 0;
92 this->inputEventHandler = nullptr;
93 this->screenNode = this;
94 this->parentNode = nullptr;
95 this->visible = true;
96 this->popUp = popUp;
97}
98
100 // remove sub nodes
101 for (auto i = 0; i < subNodes.size(); i++) {
103 }
104 subNodes.clear();
105
106 // dispose
108}
109
111{
112 return gui;
113}
114
116{
117 this->gui = gui;
118}
119
121{
122 if (this->visible == visible) return;
123 this->visible = visible;
124 if (gui != nullptr &&
125 ((visible == false && gui->getFocussedNode() != nullptr && gui->getFocussedNode()->getScreenNode() == this) ||
126 visible == true)) {
127 //
129 }
130 //
131 if (gui != nullptr) gui->applyRenderScreensChange();
132}
133
135{
136 this->popUp = popUp;
137}
138
139const vector<GUINode*>& GUIScreenNode::getFloatingNodes()
140{
141 return floatingNodes;
142}
143
145{
146 return false;
147}
148
150{
151 return -1;
152}
153
155{
156 return -1;
157}
158
160{
161 for (auto i = 0; i < subNodes.size(); i++) {
162 subNodes[i]->layout();
163 }
165 for (auto i = 0; i < childControllerNodes.size(); i++) {
166 auto node = childControllerNodes[i];
167 auto controller = node->getController();
168 if (controller != nullptr && node->layouted == true) {
170 }
171 }
172 layouted = true;
173}
174
176 {
177 auto _node = node;
178 while (_node != nullptr) {
179 if (_node->conditionsMet == false) {
180 return nullptr;
181 }
182 _node = _node->parentNode;
183 }
184 }
185
186 // first step, make sure all parents up to screen node are layouted
187 auto _node = node;
188 auto __node = node;
189 __node = __node->parentNode;
190 while (_node != nullptr) {
191 if (_node->layouted == false) __node = _node;
192 _node = _node->parentNode;
193 }
194 _node = __node;
195
196 // invalidate all nodes from node to _node
197 for (__node = node; __node != _node; __node = __node->parentNode) {
198 __node->layouted = false;
199 }
200
201 // find a node that is a valid base for layouting from
202 while (
203 _node->parentNode != nullptr &&
204 // auto depends on its children dimensions, so do relayout the parent
205 ((_node->requestedConstraints.leftType == GUINode_RequestedConstraints_RequestedConstraintsType::AUTO ||
206 _node->requestedConstraints.topType == GUINode_RequestedConstraints_RequestedConstraintsType::AUTO ||
207 _node->requestedConstraints.widthType == GUINode_RequestedConstraints_RequestedConstraintsType::AUTO ||
208 _node->requestedConstraints.heightType == GUINode_RequestedConstraints_RequestedConstraintsType::AUTO) ||
209 // percent depend on its parent dimensions so make sure its already layouted
210 (_node->layouted == false &&
211 (_node->requestedConstraints.leftType == GUINode_RequestedConstraints_RequestedConstraintsType::PERCENT ||
212 _node->requestedConstraints.topType == GUINode_RequestedConstraints_RequestedConstraintsType::PERCENT ||
213 _node->requestedConstraints.widthType == GUINode_RequestedConstraints_RequestedConstraintsType::PERCENT ||
214 _node->requestedConstraints.heightType == GUINode_RequestedConstraints_RequestedConstraintsType::PERCENT)) ||
215 // star depend on its parent dimensions, so make sure its already layouted
216 (_node->layouted == false &&
217 (_node->requestedConstraints.leftType == GUINode_RequestedConstraints_RequestedConstraintsType::STAR ||
218 _node->requestedConstraints.topType == GUINode_RequestedConstraints_RequestedConstraintsType::STAR ||
219 _node->requestedConstraints.widthType == GUINode_RequestedConstraints_RequestedConstraintsType::STAR ||
220 _node->requestedConstraints.heightType == GUINode_RequestedConstraints_RequestedConstraintsType::STAR)))) {
221 _node->layouted = false;
222 _node = _node->parentNode;
223 }
224
225 //
226 _node->layouted = false;
227
228 //
229 auto parentNode = dynamic_cast<GUIParentNode*>(_node);
231
232 //
233 return _node;
234}
235
237 // invalidate layouts and mark nodes that are required to start layouting with
238 // in a map with hierarchical id which gets sorted from root -> child node
239 map<string, GUINode*> nodesToForceLayout;
240 for (auto& nodeId: invalidateLayoutNodeIds) {
241 auto node = getNodeById(nodeId);
242 if (node == nullptr) continue;
243 auto layoutNode = forceInvalidateLayout(node);
244 if (layoutNode == nullptr) continue;
245 nodesToForceLayout[layoutNode->getHierarchicalId()] = layoutNode;
246 }
247 //
249 // force layouts
250 for (auto& nodesToForceLayoutIt: nodesToForceLayout) {
251 // check if parent node was layouted in this layout sequence already
252 auto parentNodeLayouted = false;
253 auto node = nodesToForceLayoutIt.second;
254 auto _node = node->parentNode;
255 // check if node's parent nodes were layouted
256 while (_node != nullptr) {
257 if (nodesToForceLayout.find(_node->getHierarchicalId()) != nodesToForceLayout.end()) {
258 parentNodeLayouted = true;
259 break;
260 }
261 _node = _node->parentNode;
262 }
263 // jup, skip
264 if (parentNodeLayouted == true) continue;
265 // otherwise layout
266 forceLayout(node);
267 }
268}
269
271{
272 // do the magic
273 if (dynamic_cast<GUIParentNode*>(node) != nullptr) {
274 auto parentNode = required_dynamic_cast<GUIParentNode*>(node);
275 parentNode->layouted = true;
279 for (auto i = 0; i < childControllerNodes.size(); i++) {
280 auto childNode = childControllerNodes[i];
281 auto childController = childNode->getController();
282 if (childController != nullptr) childController->postLayout();
283 }
284 } else {
285 node->layout();
286 node->getScreenNode()->layoutSubNodes();
288 auto nodeController = node->getController();
289 if (nodeController != nullptr) nodeController->postLayout();
290 }
291}
292
294 for (auto& scrollToNodeX: scrollToNodesX) {
295 auto node = getNodeById(scrollToNodeX.node);
296 auto toNode = scrollToNodeX.toNode.empty() == true?nullptr:dynamic_cast<GUIParentNode*>(getNodeById(scrollToNodeX.toNode));
297 if (node != nullptr) node->_scrollToNodeX(toNode);
298 }
299 scrollToNodesX.clear();
300 for (auto& scrollToNodeY: scrollToNodesY) {
301 auto node = getNodeById(scrollToNodeY.node);
302 auto toNode = scrollToNodeY.toNode.empty() == true?nullptr:dynamic_cast<GUIParentNode*>(getNodeById(scrollToNodeY.toNode));
303 if (node != nullptr) node->_scrollToNodeY(toNode);
304 }
305 scrollToNodesY.clear();
306}
307
308void GUIScreenNode::setScreenSize(int width, int height)
309{
310 this->screenWidth = width;
311 this->screenHeight = height;
313 this->requestedConstraints.width = width;
315 this->requestedConstraints.height = height;
316 this->computedConstraints.left = 0;
317 this->computedConstraints.top = 0;
318 this->computedConstraints.width = width;
319 this->computedConstraints.height = height;
320 this->layouted = false;
321}
322
323
325{
326 return "screen";
327}
328
330{
331 // if node does exist do not insert it and return
332 if (nodesById.find(node->id) != nodesById.end()) {
333 return false;
334 }
335 // otherwise go
336 nodesById[node->id] = node;
337
338 // add to floating nodes
339 if (node->flow == GUINode_Flow::FLOATING) floatingNodes.push_back(node);
340
341 return true;
342}
343
344void GUIScreenNode::removeNodeById(const string& nodeId, bool resetScrollOffsets) {
345 auto node = getNodeById(nodeId);
346 if (node == nullptr) {
347 Console::println("GUIScreenNode::removeNodeById(): node not found: " + nodeId);
348 return;
349 }
350 if (node->parentNode != nullptr) node->parentNode->removeSubNode(node, resetScrollOffsets);
351 removeNode(node);
352}
353
355{
356 {
357 auto elementNodeToNodeMappingIt = elementNodeToNodeMapping.find(node->getId());
358 if (elementNodeToNodeMappingIt != elementNodeToNodeMapping.end()) {
359 elementNodeToNodeMapping.erase(elementNodeToNodeMappingIt);
360 }
361 }
362 {
363 for (auto& elementNodeToNodeMappingIt: elementNodeToNodeMapping) {
364 elementNodeToNodeMappingIt.second.erase(node->getId());
365 }
366 }
367 if (dynamic_cast<GUIParentNode*>(node) != nullptr) {
368 auto parentNode = required_dynamic_cast<GUIParentNode*>(node);
369 for (auto i = 0; i < parentNode->subNodes.size(); i++) {
371 }
372 parentNode->subNodes.clear();
373 }
374 nodesById.erase(node->id);
375 tickNodesById.erase(node->getId());
376 floatingNodes.erase(remove(floatingNodes.begin(), floatingNodes.end(), node), floatingNodes.end());
377 node->dispose();
378 delete node;
379 return true;
380}
381
383{
384 guiRenderer->initScreen(this);
386 if (hasEffects() == true) applyEffects(guiRenderer);
387 GUIParentNode::render(guiRenderer);
388 if (hasEffects() == true) undoEffects(guiRenderer);
389 guiRenderer->doneScreen();
390}
391
393{
394 guiRenderer->initScreen(this);
395 for (auto i = 0; i < floatingNodes.size(); i++) {
396 auto floatingNode = floatingNodes[i];
397 auto skipFloatingNode = false;
398 auto _floatingNode = floatingNode;
399 do {
400 if (_floatingNode->conditionsMet == false) {
401 skipFloatingNode = true;
402 break;
403 }
404 _floatingNode = _floatingNode->parentNode;
405 } while (_floatingNode != nullptr);
406 if (skipFloatingNode == true) continue;
407 guiRenderer->setRenderAreaLeft(GUIRenderer::SCREEN_LEFT);
408 guiRenderer->setRenderAreaTop(GUIRenderer::SCREEN_TOP);
409 guiRenderer->setRenderAreaRight(GUIRenderer::SCREEN_RIGHT);
410 guiRenderer->setRenderAreaBottom(GUIRenderer::SCREEN_BOTTOM);
411 floatingNodes[i]->render(guiRenderer);
412 }
413 guiRenderer->doneScreen();
414}
415
416void GUIScreenNode::determineFocussedNodes(GUIParentNode* parentNode, vector<GUIElementNode*>& focusableNodes)
417{
418 if (parentNode->conditionsMet == false) {
419 return;
420 }
421 if (dynamic_cast<GUIElementNode*>(parentNode) != nullptr) {
422 auto parentElementNode = required_dynamic_cast<GUIElementNode*>(parentNode);
423 if (parentElementNode->focusable == true && (parentElementNode->getController() == nullptr || parentElementNode->getController()->isDisabled() == false)) {
424 focusableNodes.push_back(required_dynamic_cast<GUIElementNode*>(parentNode));
425 }
426 }
427 for (auto i = 0; i < parentNode->subNodes.size(); i++) {
428 auto subNode = parentNode->subNodes[i];
429 if (dynamic_cast<GUIParentNode*>(subNode) != nullptr) {
430 determineFocussedNodes(required_dynamic_cast<GUIParentNode*>(subNode), focusableNodes);
431 }
432 }
433}
434
435void GUIScreenNode::determineMouseEventNodes(GUIMouseEvent* event, bool floatingNode, unordered_set<string>& eventNodeIds, unordered_set<string>& eventFloatingNodeIds)
436{
437 for (auto i = 0; i < floatingNodes.size(); i++) {
438 floatingNodes[i]->determineMouseEventNodes(event, floatingNode == true || flow == GUINode_Flow::FLOATING, eventNodeIds, eventFloatingNodeIds);
439 }
440 GUIParentNode::determineMouseEventNodes(event, floatingNode, eventNodeIds, eventFloatingNodeIds);
441}
442
444{
445 removeActionListener(listener);
446 actionListener.push_back(listener);
447}
448
450{
451 actionListener.erase(std::remove(actionListener.begin(), actionListener.end(), listener), actionListener.end());
452}
453
455{
456 return inputEventHandler;
457}
458
460{
461 this->inputEventHandler = inputEventHandler;
462}
463
465{
466 for (auto i = 0; i < actionListener.size(); i++) {
467 actionListener[i]->onActionPerformed(type, node);
468 }
469}
470
472{
473 removeChangeListener(listener);
474 changeListener.push_back(listener);
475}
476
478{
479 changeListener.erase(std::remove(changeListener.begin(), changeListener.end(), listener), changeListener.end());
480}
481
483{
485 for (auto i = 0; i < changeListener.size(); i++) {
486 changeListener[i]->onValueChanged(node);
487 }
488}
489
491{
492 removeMouseOverListener(listener);
493 mouseOverListener.push_back(listener);
494}
495
497{
498 mouseOverListener.erase(std::remove(mouseOverListener.begin(), mouseOverListener.end(), listener), mouseOverListener.end());
499}
500
502{
503 for (auto i = 0; i < mouseOverListener.size(); i++) {
504 mouseOverListener[i]->onMouseOver(node);
505 }
506}
507
510 contextMenuRequestListener.push_back(listener);
511}
512
515}
516
518 for (auto i = 0; i < contextMenuRequestListener.size(); i++) {
519 contextMenuRequestListener[i]->onContextMenuRequested(node, mouseX, mouseY);
520 }
521}
522
524{
525 removeFocusListener(listener);
526 focusListener.push_back(listener);
527}
528
530{
531 focusListener.erase(std::remove(focusListener.begin(), focusListener.end(), listener), focusListener.end());
532}
533
535 for (auto i = 0; i < focusListener.size(); i++) {
536 focusListener[i]->onFocus(node);
537 }
538}
539
541 for (auto i = 0; i < focusListener.size(); i++) {
542 focusListener[i]->onUnfocus(node);
543 }
544}
545
547 auto now = Time::getCurrentMillis();
548 vector<int64_t> timedExpressionsToRemove;
549 for (auto& timedExpressionIt: timedExpressions) {
550 if (now >= timedExpressionIt.first) {
551 timedExpressionsToRemove.push_back(timedExpressionIt.first);
552 GUIElementNode::executeExpression(this, timedExpressionIt.second);
553 }
554 }
555 for (auto& timedExpressionToRemove: timedExpressionsToRemove) {
556 timedExpressions.erase(timedExpressionToRemove);
557 }
558 auto _tickNodesById = tickNodesById;
559 for (auto tickNodesByIdIt: _tickNodesById) {
560 auto node = tickNodesByIdIt.second;
561 if (node->controller != nullptr) node->controller->tick();
562 }
563}
564
565void GUIScreenNode::getValues(unordered_map<string, MutableString>& values)
566{
567 values.clear();
569 for (auto i = 0; i < childControllerNodes.size(); i++) {
570 auto childControllerNode = childControllerNodes[i];
571 if (dynamic_cast<GUIElementNode*>(childControllerNode) != nullptr == false)
572 continue;
573
574 auto guiElementNode = required_dynamic_cast<GUIElementNode*>(childControllerNode);
575 auto guiElementNodeController = guiElementNode->getController();
576 if (guiElementNodeController->hasValue()) {
577 auto& name = guiElementNode->getName();
578 auto& value = guiElementNodeController->getValue();
579 auto currentValueIt = values.find(name);
580 if (currentValueIt == values.end() || currentValueIt->second.size() == 0) {
581 values[name] = value;
582 }
583 }
584 }
585}
586
587void GUIScreenNode::setValues(const unordered_map<string, MutableString>& values)
588{
590 for (auto i = 0; i < childControllerNodes.size(); i++) {
591 auto childControllerNode = childControllerNodes[i];
592 if (dynamic_cast<GUIElementNode*>(childControllerNode) != nullptr == false)
593 continue;
594
595 auto guiElementNode = required_dynamic_cast<GUIElementNode*>(childControllerNode);
596 auto guiElementNodeController = guiElementNode->getController();
597 if (guiElementNodeController->hasValue()) {
598 auto name = guiElementNode->getName();
599 auto newValueIt = values.find(name);
600 if (newValueIt == values.end())
601 continue;
602 guiElementNodeController->setValue(newValueIt->second);
603 }
604 }
605}
606
607GUIScreenNode_SizeConstraints GUIScreenNode::createSizeConstraints(const string& minWidth, const string& minHeight, const string& maxWidth, const string& maxHeight)
608{
610 constraints.minWidth = minWidth.empty() == true?-1:Integer::parse(minWidth);
611 constraints.minHeight = minHeight.empty() == true?-1:Integer::parse(minHeight);
612 constraints.maxWidth = maxWidth.empty() == true?-1:Integer::parse(maxWidth);
613 constraints.maxHeight = maxHeight.empty() == true?-1:Integer::parse(maxHeight);
614 return constraints;
615}
GUI module class.
Definition: GUI.h:66
GUIElementNode * getFocussedNode()
Definition: GUI.cpp:316
void applyRenderScreensChange()
Render screens change.
Definition: GUI.cpp:921
void invalidateFocussedNode()
Invalidate focussed node.
Definition: GUI.cpp:289
void executeOnChangeExpression()
Execute on change expression.
static void executeExpression(GUIScreenNode *screenNode, const string &expression)
Execute expression.
GUI element node conditions.
GUI node controller base class.
virtual void postLayout()=0
Post layout event.
static STATIC_DLL_IMPEXT GUINode_Flow * FLOATING
Definition: GUINode_Flow.h:31
static STATIC_DLL_IMPEXT GUINode_RequestedConstraints_RequestedConstraintsType * PERCENT
static STATIC_DLL_IMPEXT GUINode_RequestedConstraints_RequestedConstraintsType * STAR
static STATIC_DLL_IMPEXT GUINode_RequestedConstraints_RequestedConstraintsType * PIXEL
static STATIC_DLL_IMPEXT GUINode_RequestedConstraints_RequestedConstraintsType * AUTO
GUI node base class.
Definition: GUINode.h:63
GUINodeController * controller
Definition: GUINode.h:162
virtual void layoutOnDemand()
Layout on demand.
Definition: GUINode.cpp:471
void _scrollToNodeX(GUIParentNode *toNode=nullptr)
Scroll to node X.
Definition: GUINode.cpp:1084
virtual void computeContentAlignment()
Do content alignment.
Definition: GUINode.cpp:205
GUIParentNode * parentNode
Definition: GUINode.h:147
void _scrollToNodeY(GUIParentNode *toNode=nullptr)
Scroll to node Y.
Definition: GUINode.cpp:1106
virtual void undoEffects(GUIRenderer *guiRenderer)
Undo effects.
Definition: GUINode.cpp:503
GUINode_ComputedConstraints computedConstraints
Definition: GUINode.h:151
GUIScreenNode * screenNode
Definition: GUINode.h:146
GUINode_RequestedConstraints requestedConstraints
Definition: GUINode.h:150
const string & getId()
Definition: GUINode.h:329
virtual void dispose()
Dispose node.
Definition: GUINode.cpp:460
virtual void applyEffects(GUIRenderer *guiRenderer)
Apply effects.
Definition: GUINode.cpp:478
GUIScreenNode * getScreenNode()
Definition: GUINode.h:315
virtual void layout()
Layout.
Definition: GUINode.cpp:189
GUINode_Flow * flow
Definition: GUINode.h:85
GUINodeController * getController()
Definition: GUINode.h:586
GUI parent node base class thats supporting child nodes.
Definition: GUIParentNode.h:43
void getChildControllerNodes(vector< GUINode * > &childControllerNodes, bool requireConditionsMet=false)
Get child controller nodes.
void determineMouseEventNodes(GUIMouseEvent *event, bool floatingNode, unordered_set< string > &eventNodeIds, unordered_set< string > &eventFloatingNodeIds) override
Determine mouse event nodes.
void render(GUIRenderer *guiRenderer) override
Render.
virtual void layoutSubNodes()
Layout sub nodes.
vector< GUINode * > subNodes
Definition: GUIParentNode.h:63
void invalidateRenderCaches()
Invalidate render caches.
GUI screen node that represents a screen that can be rendered via GUI system.
Definition: GUIScreenNode.h:57
GUIInputEventHandler * inputEventHandler
Definition: GUIScreenNode.h:81
void delegateUnfocus(GUIElementNode *node)
Delegate unfocus event.
void setInputEventHandler(GUIInputEventHandler *inputEventHandler)
Set input event handler.
const string getNodeType() override
void determineFocussedNodes(GUIParentNode *parentNode, vector< GUIElementNode * > &focusableNodes)
Determine focussed nodes.
void setVisible(bool visible)
Set visible.
bool removeNode(GUINode *node)
Add node.
void scrollToNodeX(const string &node, const string &toNode)
Register deferred scroll to node X.
void scrollToNodeY(const string &node, const string &toNode)
Register deferred scroll to node Y.
GUIInputEventHandler * getInputEventHandler()
unordered_map< string, GUINode * > tickNodesById
Definition: GUIScreenNode.h:74
void addContextMenuRequestListener(GUIContextMenuRequestListener *listener)
Add context menu request listener.
vector< GUIMouseOverListener * > mouseOverListener
Definition: GUIScreenNode.h:78
vector< GUINode * > childControllerNodes
Definition: GUIScreenNode.h:82
void scrollToNodes()
Scroll to nodes.
void addChangeListener(GUIChangeListener *listener)
Add change listener.
void removeContextMenuRequestListener(GUIContextMenuRequestListener *listener)
Remove context menu request listener.
void setPopUp(bool popUp)
Set pop up.
GUINode * getNodeById(const string &nodeId)
Get GUI node by id.
vector< GUIChangeListener * > changeListener
Definition: GUIScreenNode.h:77
void setValues(const unordered_map< string, MutableString > &values)
Set values.
GUINode * forceInvalidateLayout(GUINode *node)
Actually do the invalidate layout.
void removeChangeListener(GUIChangeListener *listener)
Remove change listener.
void removeNodeById(const string &nodeId, bool resetScrollOffsets)
Remove GUI node by id.
void layout() override
Layout.
void delegateFocus(GUIElementNode *node)
Delegate focus event.
void removeActionListener(GUIActionListener *listener)
Remove action listener.
void removeFocusListener(GUIFocusListener *listener)
Remove focus listener.
void removeMouseOverListener(GUIMouseOverListener *listener)
Remove mouse over listener.
void delegateMouseOver(GUIElementNode *node)
Delegate mouse over event.
void delegateValueChanged(GUIElementNode *node)
Delegate value changed.
vector< GUIFocusListener * > focusListener
Definition: GUIScreenNode.h:80
static GUIScreenNode_SizeConstraints createSizeConstraints(const string &minWidth, const string &minHeight, const string &maxWidth, const string &maxHeight)
Create size constraints.
void tick()
Calls registered tick nodes controller tick method.
void addMouseOverListener(GUIMouseOverListener *listener)
Add mouse over listener.
void renderFloatingNodes(GUIRenderer *guiRenderer)
Render floating nodes.
void determineMouseEventNodes(GUIMouseEvent *event, bool floatingNode, unordered_set< string > &eventNodeIds, unordered_set< string > &eventFloatingNodeIds) override
Determine mouse event nodes.
GUIScreenNode_SizeConstraints sizeConstraints
Definition: GUIScreenNode.h:83
vector< ScrollToNodeStruct > scrollToNodesY
Definition: GUIScreenNode.h:98
void setScreenSize(int width, int height)
Set screen size.
void delegateActionPerformed(GUIActionListenerType type, GUIElementNode *node)
Delegate action performed.
void getValues(unordered_map< string, MutableString > &values)
Get values.
vector< GUIActionListener * > actionListener
Definition: GUIScreenNode.h:76
void render(GUIRenderer *guiRenderer) override
Render screen.
void addActionListener(GUIActionListener *listener)
Add action listener.
unordered_map< string, GUINode * > nodesById
Definition: GUIScreenNode.h:73
vector< GUINode * > floatingNodes
Definition: GUIScreenNode.h:75
bool addNode(GUINode *node)
Add node.
void invalidateLayouts()
Actually do the nodes marked for layout invalidation.
unordered_map< int64_t, string > timedExpressions
Definition: GUIScreenNode.h:90
unordered_map< string, unordered_set< string > > elementNodeToNodeMapping
Definition: GUIScreenNode.h:85
void setGUI(GUI *gui)
Set GUI.
void delegateContextMenuRequest(GUIElementNode *node, int mouseX, int mouseY)
Delegate mouse over event.
vector< ScrollToNodeStruct > scrollToNodesX
Definition: GUIScreenNode.h:97
void addFocusListener(GUIFocusListener *listener)
Add focus listener.
unordered_set< string > invalidateLayoutNodeIds
Definition: GUIScreenNode.h:84
void forceLayout(GUINode *node)
Force layout node content (e.g.
vector< GUIContextMenuRequestListener * > contextMenuRequestListener
Definition: GUIScreenNode.h:79
const vector< GUINode * > & getFloatingNodes()
void setRenderAreaLeft(float renderAreaLeft)
Set up render area left.
Definition: GUIRenderer.h:241
void initScreen(GUIScreenNode *screenNode)
Init screen.
void setRenderAreaRight(float renderAreaRight)
Set up render area right.
Definition: GUIRenderer.h:287
void setRenderAreaTop(float renderAreaTop)
Set up render area top.
Definition: GUIRenderer.h:264
void setRenderAreaBottom(float renderAreaBottom)
Set up render area bottom.
Definition: GUIRenderer.h:310
Integer class.
Definition: Integer.h:26
Mutable string class.
Definition: MutableString.h:16
GUI action listener interface.
GUI change listener interface.
GUI focus listener interface.
GUI input event handler interface.
GUI node border entity.
GUI node padding entity.
GUINode_RequestedConstraints_RequestedConstraintsType * widthType
GUINode_RequestedConstraints_RequestedConstraintsType * heightType
GUI node scale 9 grid entity.