UFO: Alien Invasion
Loading...
Searching...
No Matches
ui_parse.h
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#pragma once
26
28
29struct uiNode_t;
30struct uiAction_s;
31struct value_s;
32
33bool UI_ParseWindow(const char* type, const char* name, const char** text);
34bool UI_ParseComponent(const char* type, const char* name, const char** text);
35bool UI_ParseSprite(const char* name, const char** text);
36bool UI_ParseUIModel(const char* name, const char** text);
37float UI_GetReferenceFloat(uiNode_t const* node, const void* ref);
38const char* UI_GetReferenceString(uiNode_t const* node, const char* ref) __attribute__ ((warn_unused_result));
39const value_t* UI_FindPropertyByName(const value_t* propertyList, const char* name) __attribute__ ((warn_unused_result));
40char* UI_AllocStaticString(const char* string, int size) __attribute__ ((warn_unused_result));
41float* UI_AllocStaticFloat(int count) __attribute__ ((warn_unused_result));
42vec4_t* UI_AllocStaticColor(int count) __attribute__ ((warn_unused_result));
43struct uiAction_s* UI_AllocStaticAction(void) __attribute__ ((warn_unused_result));
44bool UI_InitRawActionValue(struct uiAction_s* action, uiNode_t* node, const struct value_s* property, const char* string);
45
46bool UI_TokenIsReserved (const char* name);
47bool 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)
63
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)
#define __attribute__(x)
Definition cxx.h:37
voidpf void uLong size
Definition ioapi.h:42
QGL_EXTERN GLuint count
Definition r_gl.h:99
QGL_EXTERN GLint GLenum type
Definition r_gl.h:94
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition r_gl.h:110
Header for script parsing functions.
Atomic structure used to define most of the UI.
Definition ui_nodes.h:80
vec_t vec4_t[4]
Definition ufotypes.h:40
float * UI_AllocStaticFloat(int count) __attribute__((warn_unused_result))
Allocate a float into the UI static memory.
Definition ui_parse.cpp:171
bool UI_InitRawActionValue(struct uiAction_s *action, uiNode_t *node, const struct value_s *property, const char *string)
bool UI_ParseWindow(const char *type, const char *name, const char **text)
Parse a window.
struct uiAction_s * UI_AllocStaticAction(void) __attribute__((warn_unused_result))
Allocate an action.
Definition ui_parse.cpp:221
float UI_GetReferenceFloat(uiNode_t const *node, const void *ref)
Returns the value of the reference variable.
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
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
bool UI_ParseSprite(const char *name, const char **text)
const char * UI_GetReferenceString(uiNode_t const *node, const char *ref) __attribute__((warn_unused_result))
bool UI_ParseUIModel(const char *name, const char **text)
parses the models.ufo and all files where UI models (menu_model) are defined
bool UI_TokenIsName(const char *name, bool isQuoted)
Definition ui_parse.cpp:126
vec4_t * UI_AllocStaticColor(int count) __attribute__((warn_unused_result))
Allocate a color into the UI static memory.
Definition ui_parse.cpp:187
bool UI_ParseComponent(const char *type, const char *name, const char **text)
Parse a component.
bool UI_TokenIsReserved(const char *name)
Definition ui_parse.cpp:82