UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ui_parse.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/scripts.h"
28 
29 struct uiNode_t;
30 struct uiAction_s;
31 struct value_s;
32 
33 bool UI_ParseWindow(const char* type, const char* name, const char** text);
34 bool UI_ParseComponent(const char* type, const char* name, const char** text);
35 bool UI_ParseSprite(const char* name, const char** text);
36 bool UI_ParseUIModel(const char* name, const char** text);
37 float UI_GetReferenceFloat(uiNode_t const* node, const void* ref);
38 const char* UI_GetReferenceString(uiNode_t const* node, const char* ref) __attribute__ ((warn_unused_result));
39 const value_t* UI_FindPropertyByName(const value_t* propertyList, const char* name) __attribute__ ((warn_unused_result));
40 char* UI_AllocStaticString(const char* string, int size) __attribute__ ((warn_unused_result));
41 float* UI_AllocStaticFloat(int count) __attribute__ ((warn_unused_result));
42 vec4_t* UI_AllocStaticColor(int count) __attribute__ ((warn_unused_result));
43 struct uiAction_s* UI_AllocStaticAction(void) __attribute__ ((warn_unused_result));
44 bool UI_InitRawActionValue(struct uiAction_s* action, uiNode_t* node, const struct value_s* property, const char* string);
45 
46 bool UI_TokenIsReserved (const char* name);
47 bool UI_TokenIsName (const char* name, bool isQuoted);
48 
49 /* main special type */
51 #define V_UI_MASK 0x8F00
52 #define V_UI 0x8000
53 #define V_NOT_UI 0
54 #define V_UI_ACTION (V_UI + 0)
55 #define V_UI_EXCLUDERECT (V_UI + 1)
56 #define V_UI_SPRITEREF (V_UI + 3)
57 #define V_UI_IF (V_UI + 4)
58 #define V_UI_DATAID (V_UI + 5)
59 #define V_UI_CVAR (V_UI + 0x0100)
60 #define V_UI_REF (V_UI + 0x0200)
61 #define V_UI_NODEMETHOD (V_UI + 0x0400)
62 #define V_UI_NODEMETHOD_LUA (V_UI + 0x0800)
64 /* alias */
65 #define V_UI_ALIGN V_INT
66 
67 /* composite special type */
68 #define V_CVAR_OR_FLOAT (V_UI_CVAR + V_FLOAT)
69 #define V_CVAR_OR_STRING (V_UI_CVAR + V_STRING)
70 #define V_CVAR_OR_LONGSTRING (V_UI_CVAR + V_LONGSTRING)
71 #define V_REF_OF_STRING (V_UI_REF + V_STRING)
QGL_EXTERN GLint GLenum type
Definition: r_gl.h:94
char * UI_AllocStaticString(const char *string, int size) __attribute__((warn_unused_result))
Allocate a string into the UI static memory.
Definition: ui_parse.cpp:204
float UI_GetReferenceFloat(uiNode_t const *node, const void *ref)
Returns the value of the reference variable.
Definition: ui_parse.cpp:1434
bool UI_TokenIsName(const char *name, bool isQuoted)
Definition: ui_parse.cpp:126
bool UI_ParseWindow(const char *type, const char *name, const char **text)
Parse a window.
Definition: ui_parse.cpp:1336
vec4_t * UI_AllocStaticColor(int count) __attribute__((warn_unused_result))
Allocate a color into the UI static memory.
Definition: ui_parse.cpp:187
#define __attribute__(x)
Definition: cxx.h:37
GLsizei size
Definition: r_gl.h:152
bool UI_ParseSprite(const char *name, const char **text)
Definition: ui_parse.cpp:1213
Atomic structure used to define most of the UI.
Definition: ui_nodes.h:80
QGL_EXTERN GLuint count
Definition: r_gl.h:99
bool UI_ParseUIModel(const char *name, const char **text)
parses the models.ufo and all files where UI models (menu_model) are defined
Definition: ui_parse.cpp:1134
bool UI_InitRawActionValue(struct uiAction_s *action, uiNode_t *node, const struct value_s *property, const char *string)
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition: r_gl.h:110
bool UI_ParseComponent(const char *type, const char *name, const char **text)
Parse a component.
Definition: ui_parse.cpp:1261
bool UI_TokenIsReserved(const char *name)
Definition: ui_parse.cpp:82
float * UI_AllocStaticFloat(int count) __attribute__((warn_unused_result))
Allocate a float into the UI static memory.
Definition: ui_parse.cpp:171
struct uiAction_s * UI_AllocStaticAction(void) __attribute__((warn_unused_result))
Allocate an action.
Definition: ui_parse.cpp:221
Atomic element to store UI scripts The parser use this atom to translate script action into many tree...
Definition: ui_actions.h:144
const value_t * UI_FindPropertyByName(const value_t *propertyList, const char *name) __attribute__((warn_unused_result))
Find a value_t by name into a array of value_t.
Definition: ui_parse.cpp:154
const char * UI_GetReferenceString(uiNode_t const *node, const char *ref) __attribute__((warn_unused_result))
Definition: ui_parse.cpp:1406
vec_t vec4_t[4]
Definition: ufotypes.h:40