UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ui_node_panel.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 
28 
30  void draw(uiNode_t* node) override;
31  void onLoaded(uiNode_t* node) override;
32  void onLoading(uiNode_t* node) override;
33  void doLayout(uiNode_t* node) override;
34  void getClientPosition(uiNode_t const* node, vec2_t position) override;
35  void onPropertyChanged(uiNode_t* node, const value_t* property) override;
36  bool onScroll(uiNode_t* node, int deltaX, int deltaY) override;
37  void onMouseUp(uiNode_t* node, int x, int y, int button) override;
38  bool onMouseLongPress(uiNode_t* node, int x, int y, int button) override;
39  bool onStartDragging(uiNode_t* node, int startX, int startY, int currentX, int currentY, int button) override;
40  void onCapturedMouseMove(uiNode_t* node, int x, int y) override;
41 };
42 
43 struct uiBehaviour_t;
44 
45 typedef enum {
54 
56  LAYOUT_ENSURE_32BIT = 0x7FFFFFFF
58 
59 typedef enum {
61 
62  /* vertical and horizontal flag bits */
71 
72  /* common alignment */
82 
83  /* special align, everything bigger 0x10 */
85 
86  /* pack and star layout manager only */
88 
92 
97 #define UI_GET_VERTICAL_ALIGN(align) ((align >= LAYOUTALIGN_SPECIAL)?LAYOUTALIGN_NONE:(LAYOUTALIGN_V_MASK & align))
98 
102 #define UI_GET_HORIZONTAL_ALIGN(align) ((align >= LAYOUTALIGN_SPECIAL)?LAYOUTALIGN_NONE:(LAYOUTALIGN_H_MASK & align))
103 
107 typedef struct {
116 
117 void UI_Panel_SetBackgroundByName(uiNode_t* node, const char* name);
118 
119 void UI_RegisterPanelNode(uiBehaviour_t* behaviour);
120 void UI_StarLayout(uiNode_t* node);
void onPropertyChanged(uiNode_t *node, const value_t *property) override
static int startX
void draw(uiNode_t *node) override
Handles Button draw.
void doLayout(uiNode_t *node) override
Call to update the node layout. This common code revalidates the node tree.
void UI_StarLayout(uiNode_t *node)
Do a star layout with child according to there num.
void UI_RegisterPanelNode(uiBehaviour_t *behaviour)
panelLayout_t
Definition: ui_node_panel.h:45
bool onMouseLongPress(uiNode_t *node, int x, int y, int button) override
Send mouse event when a pressed mouse button is dragged.
abstractScrollableExtraData_t super
void onLoaded(uiNode_t *node) override
Handled after the end of the load of the node from script (all data and/or child are set) ...
bool onScroll(uiNode_t *node, int deltaX, int deltaY) override
Handle mouse wheel scrolling.
static int startY
void onLoading(uiNode_t *node) override
Handled after the end of the load of the node from script (all data and/or child are set) ...
void onCapturedMouseMove(uiNode_t *node, int x, int y) override
void onMouseUp(uiNode_t *node, int x, int y, int button) override
panelLayout_t layout
bool onStartDragging(uiNode_t *node, int startX, int startY, int currentX, int currentY, int button) override
Send mouse event when a pressed mouse button is dragged.
Atomic structure used to define most of the UI.
Definition: ui_nodes.h:80
base code for scrollable node
void UI_Panel_SetBackgroundByName(uiNode_t *node, const char *name)
node behaviour, how a node work
Definition: ui_behaviour.h:39
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition: r_gl.h:110
vec_t vec2_t[2]
Definition: ufotypes.h:38
void getClientPosition(uiNode_t const *node, vec2_t position) override
layoutAlign_t
Definition: ui_node_panel.h:59
uiSprite_t * background
extradata for the panel node