UFO: Alien Invasion
Loading...
Searching...
No Matches
ui_input.cpp
Go to the documentation of this file.
1
4
5/*
6Copyright (C) 2002-2025 UFO: Alien Invasion.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23*/
24
25#include "ui_main.h"
26#include "ui_internal.h"
27#include "ui_actions.h"
28#include "ui_input.h"
29#include "ui_internal.h"
30#include "ui_nodes.h"
31#include "ui_node.h"
32#include "ui_parse.h"
33#include "ui_draw.h"
34#include "ui_dragndrop.h"
35#include "ui_timer.h"
36
37#include "../input/cl_keys.h"
38#include "../input/cl_input.h"
39#include "../cl_shared.h"
44
49
57
62
67
77
82
87
92
97
101#define UI_STARTDRAG_ALREADY_SENT -1
102
107#define LONGPRESS_DELAY 800
108
113
114
122{
123#if 0
124 if (IN_GetMouseSpace() != MS_UI)
125 return false;
126
127 if (UI_GetMouseCapture())
128 return false;
129
130 if (focusNode) {
131 if (focusNode->onClick) {
133 }
135 focusNode = nullptr;
136 return true;
137 }
138#endif
139 return false;
140}
141
142#if 0
147static uiNode_t* UI_GetNextActionNode (uiNode_t* node)
148{
149 if (node)
150 node = node->next;
151 while (node) {
152 if (UI_CheckVisibility(node) && !node->invis
153 && ((node->onClick && node->onMouseEnter) || node->onMouseEnter))
154 return node;
155 node = node->next;
156 }
157 return nullptr;
158}
159#endif
160
167static bool UI_FocusNextActionNode (void)
168{
169#if 0
170 static int i = UI_MAX_WINDOWSTACK + 1; /* to cycle between all windows */
171
172 if (IN_GetMouseSpace() != MS_UI)
173 return false;
174
175 if (UI_GetMouseCapture())
176 return false;
177
178 if (i >= ui_global.windowStackPos)
180
181 assert(i >= 0);
182
183 if (focusNode) {
184 uiNode_t* node = UI_GetNextActionNode(focusNode);
185 if (node)
186 return UI_FocusSetNode(node);
187 }
188
189 while (i < ui_global.windowStackPos) {
190 uiNode_t* window;
191 window = ui_global.windowStack[i++];
192 if (UI_FocusSetNode(UI_GetNextActionNode(window->firstChild)))
193 return true;
194 }
196
197 /* no node to focus */
199#endif
200 return false;
201}
202
207{
208 uiNode_t* tmp;
209 assert(node);
210 if (node == focusNode)
211 return;
212
213 /* invalidate the data before calling the event */
214 tmp = focusNode;
215 focusNode = nullptr;
216
217 /* lost the focus */
218 if (tmp) {
220 }
221
222 /* get the focus */
223 focusNode = node;
225}
226
230bool UI_HasFocus (const uiNode_t* node)
231{
232 return node == focusNode;
233}
234
241void UI_RemoveFocus (void)
242{
243 uiNode_t* tmp;
244
245 if (UI_GetMouseCapture())
246 return;
247
248 if (!focusNode)
249 return;
250
251 /* invalidate the data before calling the event */
252 tmp = focusNode;
253 focusNode = nullptr;
254
255 /* callback the lost of the focus */
257}
258
260{
261 uiKeyBinding_t* result;
262 if (ui_global.numKeyBindings >= UI_MAX_KEYBINDING)
263 Com_Error(ERR_FATAL, "UI_AllocStaticKeyBinding: UI_MAX_KEYBINDING hit");
264
265 result = &ui_global.keyBindings[ui_global.numKeyBindings];
266 ui_global.numKeyBindings++;
267
268 OBJZERO(*result);
269 return result;
270}
271
273{
274 return ui_global.numKeyBindings;
275}
276
278{
279 return &ui_global.keyBindings[index];
280}
281
306static void UI_SetKeyBindingEx (const char* path, int key, const char* description, bool inherited)
307{
308 uiNode_t* node;
309 const value_t* property = nullptr;
310
311 UI_ReadNodePath(path, nullptr, nullptr, &node, &property);
312 if (node == nullptr) {
313 Com_Printf("UI_SetKeyBinding: node \"%s\" not found.\n", path);
314 return;
315 }
316
317 if (property != nullptr && property->type != V_UI_NODEMETHOD)
318 Com_Error(ERR_FATAL, "UI_SetKeyBinding: Only node and method are supported. Property @%s not found in path \"%s\".", property->string, path);
319
320 /* init and link the keybinding */
322 binding->node = node;
323 binding->property = property;
324 binding->key = key;
325 binding->inherited = inherited;
326 node->key = binding;
327
328 if (Q_strnull(description))
329 Com_Printf("Warning: Empty description for UI keybinding: %s (%s)\n", path, Key_KeynumToString(key));
330 else
331 binding->description = Mem_PoolStrDup(description, ui_dynPool, 0);
332
334
335 /* search and update windows that extend node->root */
336 for (int windowId = 0; windowId < ui_global.numWindows; windowId++) {
337 uiNode_t* window = ui_global.windows[windowId];
338
339 /* skip windows which are not direct extends of the main window */
340 if (window->super != node->root)
341 continue;
342
343 /* create a new patch from the new windows */
344 char newPath[256];
345 newPath[0] = '\0';
346 Q_strcat(newPath, sizeof(newPath), "%s%s", window->name, path + strlen(node->root->name));
347 UI_SetKeyBindingEx(newPath, key, description, true);
348 }
349}
350
362void UI_SetKeyBinding (const char* path, int key, const char* description)
363{
364 UI_SetKeyBindingEx(path, key, description, false);
365}
366
370static bool UI_KeyPressedInWindow (uiNode_t* window, unsigned int key, unsigned int unicode)
371{
372 uiNode_t* node;
373 const uiKeyBinding_t* binding;
374
375 /* search requested key binding */
377 if (!binding) {
378 /* no binding found, perhaps a lua event handler is attached to this window */
379 UI_Node_KeyPressed (window, key, unicode);
380 return false;
381 }
382
383 /* check node visibility */
384 node = binding->node;
385 while (node) {
386 if (node->disabled || node->invis)
387 return false;
388 node = node->parent;
389 }
390
391 /* execute event */
392 node = binding->node;
393 if (binding->property == nullptr)
394 UI_Node_Activate(node);
395 else if (binding->property->type == V_UI_NODEMETHOD) {
396 uiCallContext_t newContext;
397 uiNodeMethod_t func = (uiNodeMethod_t) binding->property->ofs;
398 newContext.source = node;
399 newContext.useCmdParam = false;
400 func(node, &newContext);
401 } else
402 Com_Printf("UI_KeyPressedInWindow: @%s not supported.", binding->property->string);
403
404 return true;
405}
406
413bool UI_KeyRelease (unsigned int key, unsigned short unicode)
414{
415 /* translate event into the node with focus */
416 if (focusNode) {
418 }
419
420 return false;
421}
422
430bool UI_KeyPressed (unsigned int key, unsigned short unicode)
431{
432 if (UI_DNDIsDragging()) {
433 if (key == K_ESCAPE) {
434 UI_DNDAbort();
435 return true;
436 }
437 return false;
438 }
439
441 && selActor && CL_ActorFireModeActivated(selActor->actorMode)) {
442 /* Cancel firing with Escape, needed for Android, where right mouse click is bound to multitouch, which is non-obvious */
444 return true;
445 }
446
447 /* translate event into the node with focus */
448 /* note: this is not executed if the top node is a modal window, see code below */
449 if (focusNode) {
451 return true;
452 }
453 }
454
455 /* else use common behaviour */
456 switch (key) {
457 case K_TAB:
459 return true;
460 break;
461 case K_ENTER:
462 case K_KP_ENTER:
464 return true;
465 break;
466 case K_ESCAPE:
467 if (UI_GetMouseCapture() != nullptr) {
469 return true;
470 }
472 return true;
473 }
474
475 int lastWindowId = UI_GetLastFullScreenWindow();
476 if (lastWindowId < 0)
477 return false;
478
479 /* check "active" window from top to down */
480 for (int windowId = ui_global.windowStackPos - 1; windowId >= lastWindowId; windowId--) {
481 uiNode_t* window = ui_global.windowStack[windowId];
482 if (!window)
483 return false;
484 if (UI_KeyPressedInWindow(window, key, unicode))
485 return true;
486 if (UI_WindowIsModal(window))
487 break;
488 }
489
490 return false;
491}
492
497{
500 if (UI_DNDIsDragging())
501 UI_DNDAbort();
502}
503
509{
510 return capturedNode;
511}
512
517{
518 assert(capturedNode == nullptr);
519 assert(node != nullptr);
520 capturedNode = node;
521}
522
527{
528 uiNode_t* tmp = capturedNode;
529
530 if (capturedNode == nullptr)
531 return;
532
533 capturedNode = nullptr;
536}
537
538void UI_ResetInput (void)
539{
540 hoveredNode = nullptr;
541 oldHoveredNode = nullptr;
542 focusNode = nullptr;
543 capturedNode = nullptr;
544 pressedNode = nullptr;
545 longPressTimer = nullptr;
546}
547
553{
554 return hoveredNode;
555}
556
561{
562 oldMousePosX = -1;
563 oldMousePosY = -1;
564}
565
570{
571 /* is hovered node no more draw */
574
579 return true;
580 }
581
582 return false;
583}
584
588void UI_MouseMove (int x, int y)
589{
590 if (UI_DNDIsDragging())
591 return;
592
593 if (pressedNode && !capturedNode) {
596 int dist = abs(pressedNodeLocationX - x) + abs(pressedNodeLocationY - y);
597 if (dist > 4) {
598 uiNode_t* node = pressedNode;
599 while (node) {
601 break;
602 node = node->parent;
603 }
605 }
606 }
607 }
608
609 /* send the captured move mouse event */
610 if (capturedNode) {
612 return;
613 }
614
616
617 /* update houvered node by sending messages */
619 uiNode_t* commonNode = hoveredNode;
620 uiNode_t* node;
621
622 /* search the common node */
623 while (commonNode) {
624 node = oldHoveredNode;
625 while (node) {
626 if (node == commonNode)
627 break;
628 node = node->parent;
629 }
630 if (node != nullptr)
631 break;
632 commonNode = commonNode->parent;
633 }
634
635 /* send 'leave' event from old node to common node */
636 node = oldHoveredNode;
637 while (node != commonNode) {
638 UI_Node_MouseLeave(node);
639 node = node->parent;
640 }
641 if (oldHoveredNode)
642 oldHoveredNode->state = false;
643
644 /* send 'enter' event from common node to new node */
645 while (commonNode != hoveredNode) {
647 node = hoveredNode;
648 while (node->parent != commonNode)
649 node = node->parent;
650 commonNode = node;
651 UI_Node_MouseEnter(node);
652 }
653 if (hoveredNode) {
654 hoveredNode->state = true;
655 UI_Node_MouseEnter(node);
656 }
657 }
658
660
661 /* send the move event */
662 if (hoveredNode)
664}
665
666#define UI_IsMouseInvalidate() (oldMousePosX == -1)
667
675static void UI_LeftClick (int x, int y)
676{
678 return;
679
680 /* send it to the captured mouse node */
681 if (capturedNode) {
683 return;
684 }
685
686 /* if we click outside a dropdown window, we close it */
690 if (!pressedNode && ui_global.windowStackPos != 0) {
691 uiNode_t* window = ui_global.windowStack[ui_global.windowStackPos - 1];
692 if (UI_WindowIsDropDown(window)) {
693 UI_PopWindow();
694 }
695 }
696
697 const bool disabled = (pressedNode == nullptr) || (pressedNode->disabled) || (pressedNode->parent && pressedNode->parent->disabled);
698 if (!disabled) {
700 }
701}
702
710static void UI_RightClick (int x, int y)
711{
713 return;
714
715 /* send it to the captured mouse node */
716 if (capturedNode) {
718 return;
719 }
720
721 const bool disabled = (pressedNode == nullptr) || (pressedNode->disabled) || (pressedNode->parent && pressedNode->parent->disabled);
722 if (!disabled) {
724 }
725}
726
732static void UI_MiddleClick (int x, int y)
733{
735 return;
736
737 /* send it to the captured mouse node */
738 if (capturedNode) {
740 return;
741 }
742
743 const bool disabled = (pressedNode == nullptr) || (pressedNode->disabled) || (pressedNode->parent && pressedNode->parent->disabled);
744 if (!disabled) {
746 }
747}
748
756void UI_MouseScroll (int deltaX, int deltaY)
757{
758 uiNode_t* node;
759
760 /* send it to the captured mouse node */
761 if (capturedNode) {
762 UI_Node_Scroll(capturedNode, deltaX, deltaY);
763 return;
764 }
765
766 node = hoveredNode;
767
768 while (node) {
769 if (UI_Node_Scroll(node, deltaX, deltaY)) {
770 break;
771 }
772 node = node->parent;
773 }
774}
775
780{
782
783 /* make sure the event still make sense */
784 if (pressedNode == nullptr)
785 return;
786
787 uiNode_t* node = pressedNode;
788 while (node) {
790 break;
791 node = node->parent;
792 }
793}
794
801void UI_MouseDown (int x, int y, int button)
802{
803 /* disable old long click event */
804 if (longPressTimer)
806
807 uiNode_t* node;
808
809 /* captured or hover node */
811
812 if (node != nullptr) {
814 UI_Node_MouseDown(node, x, y, button);
815 }
816
817 /* select clickableNode on button up, and detect multipress button */
818 if (pressedNode == nullptr) {
819 pressedNode = node;
822 pressedNodeButton = button;
824 if (longPressTimer == nullptr) {
826 }
828 } else {
829 pressedNode = nullptr;
830 }
831}
832
839void UI_MouseUp (int x, int y, int button)
840{
841 /* disable long click event */
842 if (longPressTimer)
844
845 /* send click event */
847 if (pressedNode || capturedNode) {
848 switch (button) {
849 case K_MOUSE1:
850 UI_LeftClick(x, y);
851 break;
852 case K_MOUSE2:
853 UI_RightClick(x, y);
854 break;
855 case K_MOUSE3:
856 UI_MiddleClick(x, y);
857 break;
858 }
859 }
860
861 /* captured or hovered node */
862 uiNode_t* node = nullptr;
863 if (capturedNode) {
864 node = capturedNode;
865 } else if (pressedNode == hoveredNode) {
866 node = hoveredNode;
867 }
868
869 pressedNode = nullptr;
870 if (node == nullptr)
871 return;
872
873 UI_Node_MouseUp(node, x, y, button);
874}
void CL_ActorSetMode(le_t *actor, actorModes_t actorMode)
Definition cl_actor.cpp:835
bool CL_ActorFireModeActivated(const actorModes_t mode)
Checks whether we are in fire mode or node.
le_t * selActor
Definition cl_actor.cpp:49
bool CL_BattlescapeRunning(void)
Check whether we already have actors spawned on the battlefield.
int mousePosY
Definition cl_input.cpp:76
unsigned int key
Definition cl_input.cpp:64
static int oldMousePosX
Definition cl_input.cpp:77
unsigned short unicode
Definition cl_input.cpp:65
int mousePosX
Definition cl_input.cpp:76
static int oldMousePosY
Definition cl_input.cpp:77
External (non-keyboard) input devices.
#define IN_GetMouseSpace()
Definition cl_input.h:48
@ MS_UI
Definition cl_input.h:33
const char * Key_KeynumToString(int keynum)
Convert a given keynum to string.
Definition cl_keys.cpp:485
Header file for keyboard handler.
@ K_ENTER
Definition cl_keys.h:40
@ K_MOUSE2
Definition cl_keys.h:47
@ K_MOUSE1
Definition cl_keys.h:46
@ K_ESCAPE
Definition cl_keys.h:42
@ K_MOUSE3
Definition cl_keys.h:48
@ K_KP_ENTER
Definition cl_keys.h:69
@ K_TAB
Definition cl_keys.h:39
@ M_MOVE
Share stuff between the different cgame implementations.
void Com_Error(int code, const char *fmt,...)
Definition common.cpp:459
void Com_Printf(const char *const fmt,...)
Definition common.cpp:428
#define ERR_FATAL
Definition common.h:210
#define Mem_PoolStrDup(in, pool, tagNum)
Definition mem.h:50
QGL_EXTERN GLuint index
Definition r_gl.h:110
QGL_EXTERN GLint i
Definition r_gl.h:113
bool Q_strnull(const char *string)
Definition shared.h:138
#define OBJZERO(obj)
Definition shared.h:178
void Q_strcat(char *dest, size_t destsize, const char *format,...)
Safely (without overflowing the destination buffer) concatenates two strings.
Definition shared.cpp:475
Contain the context of the calling of a function.
Definition ui_actions.h:208
uiNode_t * source
Definition ui_actions.h:210
Atomic structure used to define most of the UI.
Definition ui_nodes.h:80
bool disabled
Definition ui_nodes.h:102
uiNode_t const * super
Definition ui_nodes.h:84
uiNode_t * firstChild
Definition ui_nodes.h:89
bool invis
Definition ui_nodes.h:101
uiNode_t * next
Definition ui_nodes.h:91
uiNode_t * parent
Definition ui_nodes.h:92
struct uiKeyBinding_s * key
Definition ui_nodes.h:100
char name[MAX_VAR]
Definition ui_nodes.h:82
struct uiAction_s * onClick
Definition ui_nodes.h:135
struct uiAction_s * onMouseEnter
Definition ui_nodes.h:139
uiNode_t * root
Definition ui_nodes.h:93
void UI_ExecuteEventActions(uiNode_t *source, const uiAction_t *firstAction)
void(* uiNodeMethod_t)(uiNode_t *node, const struct uiCallContext_s *context)
Signature of a function to bind a node method.
bool UI_DNDIsDragging(void)
Return true if we are dragging something.
void UI_DNDAbort(void)
Drop the object at the current position.
static bool UI_FocusExecuteActionNode(void)
Execute the current focused action node.
Definition ui_input.cpp:121
static int pressedNodeLocationX
X position of the mouse when pressedNode != nullptr.
Definition ui_input.cpp:86
static bool UI_FocusNextActionNode(void)
Set the focus to the next action node.
Definition ui_input.cpp:167
static void UI_RightClick(int x, int y)
Definition ui_input.cpp:710
bool UI_CheckMouseMove(void)
Call mouse move only if the mouse position change.
Definition ui_input.cpp:569
void UI_SetMouseCapture(uiNode_t *node)
Captured the mouse into a node.
Definition ui_input.cpp:516
void UI_RequestFocus(uiNode_t *node)
request the focus for a node
Definition ui_input.cpp:206
#define UI_STARTDRAG_ALREADY_SENT
Value of pressedNodeLocationX when event already sent.
Definition ui_input.cpp:101
static bool UI_KeyPressedInWindow(uiNode_t *window, unsigned int key, unsigned int unicode)
Check if a key binding exists for a window and execute it.
Definition ui_input.cpp:370
uiNode_t * UI_GetHoveredNode(void)
Get the current hovered node.
Definition ui_input.cpp:552
void UI_MouseUp(int x, int y, int button)
Called when we are in UI mode and up a mouse button.
Definition ui_input.cpp:839
#define UI_IsMouseInvalidate()
Definition ui_input.cpp:666
void UI_MouseScroll(int deltaX, int deltaY)
Called when we are in UI mode and scroll via mousewheel.
Definition ui_input.cpp:756
static uiTimer_t * longPressTimer
Timer used to manage long press event.
Definition ui_input.cpp:112
static void UI_LongPressCallback(uiNode_t *, uiTimer_t *timer)
Definition ui_input.cpp:779
static int pressedNodeButton
Button pressed when pressedNode != nullptr.
Definition ui_input.cpp:96
void UI_SetKeyBinding(const char *path, int key, const char *description)
Set a binding from a key to a node to active.
Definition ui_input.cpp:362
void UI_RemoveFocus(void)
Definition ui_input.cpp:241
static uiNode_t * oldHoveredNode
save the previous hovered node
Definition ui_input.cpp:61
static int pressedNodeLocationY
Y position of the mouse when pressedNode != nullptr.
Definition ui_input.cpp:91
void UI_ReleaseInput(void)
Release all captured input (keyboard or mouse).
Definition ui_input.cpp:496
uiNode_t * UI_GetMouseCapture(void)
Return the captured node.
Definition ui_input.cpp:508
#define LONGPRESS_DELAY
Value of the delay to wait before sending a long press event This value is used for Qt 4....
Definition ui_input.cpp:107
static void UI_SetKeyBindingEx(const char *path, int key, const char *description, bool inherited)
Set a binding from a key to a node to active.
Definition ui_input.cpp:306
static void UI_MiddleClick(int x, int y)
Definition ui_input.cpp:732
uiKeyBinding_t * UI_GetKeyBindingByIndex(int index)
Definition ui_input.cpp:277
bool UI_HasFocus(const uiNode_t *node)
check if a node got the focus
Definition ui_input.cpp:230
void UI_ResetInput(void)
Definition ui_input.cpp:538
static uiKeyBinding_t * UI_AllocStaticKeyBinding(void)
Definition ui_input.cpp:259
static uiNode_t * hoveredNode
save the current hovered node (first node under the mouse)
Definition ui_input.cpp:56
void UI_MouseDown(int x, int y, int button)
Called when we are in UI mode and down a mouse button.
Definition ui_input.cpp:801
void UI_InvalidateMouse(void)
Force to invalidate the mouse position and then to update hover nodes...
Definition ui_input.cpp:560
static uiNode_t * pressedNode
Store node which receive a mouse down event.
Definition ui_input.cpp:81
void UI_MouseMove(int x, int y)
Is called every time the mouse position change.
Definition ui_input.cpp:588
static uiNode_t * focusNode
save the node with the focus
Definition ui_input.cpp:48
bool UI_KeyPressed(unsigned int key, unsigned short unicode)
Called by the client when the user type a key.
Definition ui_input.cpp:430
int UI_GetKeyBindingCount(void)
Definition ui_input.cpp:272
static void UI_LeftClick(int x, int y)
Is called every time one clicks on a window/screen. Then checks if anything needs to be executed in t...
Definition ui_input.cpp:675
bool UI_KeyRelease(unsigned int key, unsigned short unicode)
Called by the client when the user released a key.
Definition ui_input.cpp:413
void UI_MouseRelease(void)
Release the captured node.
Definition ui_input.cpp:526
static uiNode_t * capturedNode
save the captured node
Definition ui_input.cpp:76
#define UI_MAX_KEYBINDING
Definition ui_input.h:30
Internal data use by the UI package.
memPool_t * ui_dynPool
Definition ui_main.cpp:41
uiGlobal_t ui_global
Definition ui_main.cpp:38
#define UI_MAX_WINDOWSTACK
Definition ui_internal.h:31
bool UI_Node_KeyReleased(uiNode_t *node, unsigned int key, unsigned short unicode)
Definition ui_node.cpp:353
void UI_Node_FocusLost(uiNode_t *node)
Definition ui_node.cpp:341
void UI_Node_Activate(uiNode_t *node)
Definition ui_node.cpp:271
void UI_Node_FocusGained(uiNode_t *node)
Definition ui_node.cpp:335
bool UI_Node_KeyPressed(uiNode_t *node, unsigned int key, unsigned short unicode)
Definition ui_node.cpp:347
void UI_Node_MouseUp(uiNode_t *node, int x, int y, int button)
Definition ui_node.cpp:164
void UI_Node_MouseDown(uiNode_t *node, int x, int y, int button)
Definition ui_node.cpp:158
void UI_Node_MouseLeave(uiNode_t *node)
Definition ui_node.cpp:176
void UI_Node_MouseMove(uiNode_t *node, int x, int y)
Definition ui_node.cpp:152
bool UI_Node_Scroll(uiNode_t *node, int deltaX, int deltaY)
Definition ui_node.cpp:146
void UI_Node_MouseEnter(uiNode_t *node)
Definition ui_node.cpp:170
bool UI_Node_MouseLongPress(uiNode_t *node, int x, int y, int button)
Definition ui_node.cpp:182
void UI_Node_CapturedMouseMove(uiNode_t *node, int x, int y)
Definition ui_node.cpp:194
void UI_Node_CapturedMouseLost(uiNode_t *node)
Definition ui_node.cpp:200
void UI_Node_LeftClick(uiNode_t *node, int x, int y)
Definition ui_node.cpp:128
bool UI_Node_StartDragging(uiNode_t *node, int startX, int startY, int currentX, int currentY, int button)
Definition ui_node.cpp:188
void UI_Node_RightClick(uiNode_t *node, int x, int y)
Definition ui_node.cpp:134
void UI_Node_MiddleClick(uiNode_t *node, int x, int y)
Definition ui_node.cpp:140
C interface to allow to access to cpp node code.
bool UI_WindowIsModal(uiNode_t const *const node)
True if the window is a modal.
void UI_WindowNodeRegisterKeyBinding(uiNode_t *node, uiKeyBinding_t *binding)
Add a key binding to a window node. Window node store key bindings for his node child.
uiKeyBinding_t * UI_WindowNodeGetKeyBinding(uiNode_t const *const node, unsigned int key)
Search a a key binding from a window node. Window node store key bindings for his node child.
bool UI_WindowIsDropDown(uiNode_t const *const node)
True if the window is a drop down.
const uiKeyBinding_t * binding
bool UI_CheckVisibility(uiNode_t *node)
Check the if conditions for a given node.
Definition ui_nodes.cpp:152
void UI_ReadNodePath(const char *path, const uiNode_t *relativeNode, const uiNode_t *iterationNode, uiNode_t **resultNode, const value_t **resultProperty, value_t *luaMethod)
Read a path and return every we can use (node and property).
Definition ui_nodes.cpp:219
uiNode_t * UI_GetNodeAtPosition(int x, int y)
Return the first visible node at a position.
Definition ui_nodes.cpp:527
#define V_UI_NODEMETHOD
Definition ui_parse.h:61
void UI_TimerStop(uiTimer_t *timer)
Stop a timer.
Definition ui_timer.cpp:163
uiTimer_t * UI_AllocTimer(uiNode_t *node, int firstDelay, timerCallback_t callback)
Allocate a new time for a node.
Definition ui_timer.cpp:123
void UI_TimerStart(uiTimer_t *timer)
Restart a timer.
Definition ui_timer.cpp:150
void UI_MoveWindowOnTop(uiNode_t *window)
Move the window on top of compatible windows. "Compatible" mean non full screen windows,...
int UI_GetLastFullScreenWindow(void)
Returns the ID of the last fullscreen ID. Before this, window should be hidden.
void UI_PopWindow(bool all)
Pops a window from the window stack.
void UI_PopWindowWithEscKey(void)