UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ui_windows.h
Go to the documentation of this file.
1 
5 /*
6 Copyright (C) 2002-2020 UFO: Alien Invasion.
7 
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12 
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 
17 See the GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 
23 */
24 
25 #pragma once
26 
27 #include "../../common/common.h"
28 
29 /* prototype */
30 struct uiNode_t;
31 struct uiCallContext_s;
32 
33 /* module initialization */
34 void UI_InitWindows(void);
35 
36 /* window stack */
38 uiNode_t* UI_PushWindow(const char* name, const char* parentName = nullptr, linkedList_t* params = nullptr);
39 void UI_InitStack(const char* activeWindow, const char* mainWindow);
40 void UI_PopWindow(bool all = false);
41 void UI_PopWindowWithEscKey(void);
42 void UI_CloseWindow(const char* name);
44 int UI_CompleteWithWindow(const char* partial, const char** match);
45 bool UI_IsWindowOnStack(const char* name);
46 bool UI_IsMouseOnWindow(void);
47 void UI_InvalidateStack(void);
48 void UI_InsertWindow(uiNode_t* window);
49 void UI_RemoveWindow(uiNode_t* window);
50 void UI_MoveWindowOnTop(uiNode_t* window);
51 
52 /* deprecated */
53 const char* UI_GetActiveWindowName(void);
54 
56 void UI_SetNewWindowPos(uiNode_t* window, int x, int y);
57 uiNode_t* UI_GetWindow(const char* name);
void UI_InvalidateStack(void)
Invalidate all windows of the current stack.
Definition: ui_windows.cpp:593
void UI_InitStack(const char *activeWindow, const char *mainWindow)
Init the stack to start with a window, and have an alternative window with ESC.
Definition: ui_windows.cpp:354
void UI_PopWindowWithEscKey(void)
Definition: ui_windows.cpp:483
void UI_InsertWindow(uiNode_t *window)
Add a new window to the list of all windows.
Definition: ui_windows.cpp:616
void UI_PopWindow(bool all=false)
Pops a window from the window stack.
Definition: ui_windows.cpp:452
void UI_InitWindows(void)
Definition: ui_windows.cpp:747
bool UI_IsMouseOnWindow(void)
Check if a point is over a window from the stack.
Definition: ui_windows.cpp:538
uiNode_t * UI_PushWindow(const char *name, const char *parentName=nullptr, linkedList_t *params=nullptr)
Push a window onto the window stack.
Definition: ui_windows.cpp:170
linkedList_t * params
Definition: ui_actions.h:215
Atomic structure used to define most of the UI.
Definition: ui_nodes.h:80
bool UI_IsWindowOnStack(const char *name)
Check if a named window is on the stack if active windows.
Definition: ui_windows.cpp:373
Contain the context of the calling of a function.
Definition: ui_actions.h:208
void UI_RemoveWindow(uiNode_t *window)
Removes a window from the list of all windows.
Definition: ui_windows.cpp:644
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition: r_gl.h:110
void UI_CloseWindow(const char *name)
Definition: ui_windows.cpp:435
void UI_MoveWindowOnTop(uiNode_t *window)
Move the window on top of compatible windows. "Compatible" mean non full screen windows, and windows with the same window parent.
Definition: ui_windows.cpp:74
int UI_CompleteWithWindow(const char *partial, const char **match)
Complete function for ui_push.
Definition: ui_windows.cpp:211
int UI_GetLastFullScreenWindow(void)
Returns the ID of the last fullscreen ID. Before this, window should be hidden.
Definition: ui_windows.cpp:55
void UI_SetNewWindowPos(uiNode_t *window, int x, int y)
Sets new x and y coordinates for a given window.
Definition: ui_windows.cpp:606
uiNode_t * UI_GetActiveWindow(void)
Returns the current active window from the window stack or nullptr if there is none.
Definition: ui_windows.cpp:516
const char * UI_GetActiveWindowName(void)
Returns the name of the current window.
Definition: ui_windows.cpp:526
uiNode_t * UI_GetWindow(const char *name)
Searches all windows for the specified one.
Definition: ui_windows.cpp:567