UFO: Alien Invasion
Doxygen documentation generating
ui_node_data.cpp
Go to the documentation of this file.
1 
13 /*
14 Copyright (C) 2002-2023 UFO: Alien Invasion.
15 
16 This program is free software; you can redistribute it and/or
17 modify it under the terms of the GNU General Public License
18 as published by the Free Software Foundation; either version 2
19 of the License, or (at your option) any later version.
20 
21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 
25 See the GNU General Public License for more details.
26 
27 You should have received a copy of the GNU General Public License
28 along with this program; if not, write to the Free Software
29 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 
31 */
32 
33 #include "../ui_nodes.h"
34 #include "../ui_parse.h"
35 #include "../ui_behaviour.h"
36 #include "ui_node_data.h"
37 #include "ui_node_abstractnode.h"
38 
39 #include "../../client.h"
40 
41 #include "../../../common/scripts_lua.h"
42 
43 #define EXTRADATA_TYPE dataExtraData_t
44 #define EXTRADATA(node) UI_EXTRADATA(node, EXTRADATA_TYPE)
45 #define EXTRADATACONST(node) UI_EXTRADATACONST(node, EXTRADATA_TYPE)
46 
48 {
49  behaviour->name = "data";
50  behaviour->isVirtual = true;
51  behaviour->extraDataSize = sizeof(EXTRADATA_TYPE);
52  behaviour->manager = UINodePtr(new uiDataNode());
53  behaviour->lua_SWIG_typeinfo = UI_SWIG_TypeQuery("uiDataNode_t *");
54 
55  /* Store a string into the node.
56  * @note you should note store a cvar ref
57  * @todo use a REF_STRING when it is possible
58  */
59  UI_RegisterOveridedNodeProperty(behaviour, "string");
60 
61  /* Store a float number into the node. */
62  UI_RegisterExtradataNodeProperty(behaviour, "number", V_FLOAT, EXTRADATA_TYPE, number);
63 
64  /* Store a integer number into the node. */
65  UI_RegisterExtradataNodeProperty(behaviour, "integer", V_INT, EXTRADATA_TYPE, integer);
66 }
intptr_t extraDataSize
Definition: ui_behaviour.h:54
UINodePtr manager
Definition: ui_behaviour.h:43
#define UI_RegisterExtradataNodeProperty(BEHAVIOUR, NAME, TYPE, EXTRADATATYPE, ATTRIBUTE)
Initialize a property from extradata of node.
Definition: ui_behaviour.h:109
SharedPtr< uiNode > UINodePtr
#define UI_RegisterOveridedNodeProperty(BEHAVIOUR, NAME)
Initialize a property which override an inherited property. It is yet only used for the documentation...
Definition: ui_behaviour.h:117
#define EXTRADATA_TYPE
void * UI_SWIG_TypeQuery(const char *name)
This function queries the SWIG type table for a type information structure. It is used in combination...
void UI_RegisterDataNode(uiBehaviour_t *behaviour)
Definition: scripts.h:52
void * lua_SWIG_typeinfo
Definition: ui_behaviour.h:57
const char * name
Definition: ui_behaviour.h:41
node behaviour, how a node work
Definition: ui_behaviour.h:39