UFO: Alien Invasion
ui_node_panel.h
Go to the documentation of this file.
1
5/*
6Copyright (C) 2002-2022 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
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
43struct uiBehaviour_t;
44
45typedef enum {
54
56 LAYOUT_ENSURE_32BIT = 0x7FFFFFFF
58
59typedef 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
90 LAYOUTALIGN_ENSURE_32BIT = 0x7FFFFFFF
92
97#define UI_GET_VERTICAL_ALIGN(align) ((align >= LAYOUTALIGN_SPECIAL)?LAYOUTALIGN_NONE:(LAYOUTALIGN_V_MASK & align))
102#define UI_GET_HORIZONTAL_ALIGN(align) ((align >= LAYOUTALIGN_SPECIAL)?LAYOUTALIGN_NONE:(LAYOUTALIGN_H_MASK & align))
103
107typedef struct {
116
117void UI_Panel_SetBackgroundByName(uiNode_t* node, const char* name);
118
119void UI_RegisterPanelNode(uiBehaviour_t* behaviour);
120void UI_StarLayout(uiNode_t* node);
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 getClientPosition(uiNode_t const *node, vec2_t position) override
bool onMouseLongPress(uiNode_t *node, int x, int y, int button) override
Send mouse event when a pressed mouse button is dragged.
void draw(uiNode_t *node) override
Handles Button draw.
void onPropertyChanged(uiNode_t *node, const value_t *property) override
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)
void onMouseUp(uiNode_t *node, int x, int y, int button) override
bool onScroll(uiNode_t *node, int deltaX, int deltaY) override
Handle mouse wheel scrolling.
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.
void onCapturedMouseMove(uiNode_t *node, int x, int y) override
void doLayout(uiNode_t *node) override
Call to update the node layout. This common code revalidates the node tree.
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition: r_gl.h:110
extradata for the panel node
panelLayout_t layout
uiSprite_t * background
abstractScrollableExtraData_t super
node behaviour, how a node work
Definition: ui_behaviour.h:39
Atomic structure used to define most of the UI.
Definition: ui_nodes.h:80
vec_t vec2_t[2]
Definition: ufotypes.h:38
base code for scrollable node
static int startY
static int startX
void UI_Panel_SetBackgroundByName(uiNode_t *node, const char *name)
void UI_StarLayout(uiNode_t *node)
Do a star layout with child according to there num.
void UI_RegisterPanelNode(uiBehaviour_t *behaviour)
layoutAlign_t
Definition: ui_node_panel.h:59
@ LAYOUTALIGN_BOTTOMLEFT
Definition: ui_node_panel.h:79
@ LAYOUTALIGN_V_BOTTOM
Definition: ui_node_panel.h:70
@ LAYOUTALIGN_LEFT
Definition: ui_node_panel.h:76
@ LAYOUTALIGN_TOPRIGHT
Definition: ui_node_panel.h:75
@ LAYOUTALIGN_V_MASK
Definition: ui_node_panel.h:67
@ LAYOUTALIGN_V_TOP
Definition: ui_node_panel.h:68
@ LAYOUTALIGN_V_MIDDLE
Definition: ui_node_panel.h:69
@ LAYOUTALIGN_ENSURE_32BIT
Definition: ui_node_panel.h:90
@ LAYOUTALIGN_TOPLEFT
Definition: ui_node_panel.h:73
@ LAYOUTALIGN_BOTTOM
Definition: ui_node_panel.h:80
@ LAYOUTALIGN_RIGHT
Definition: ui_node_panel.h:78
@ LAYOUTALIGN_NONE
Definition: ui_node_panel.h:60
@ LAYOUTALIGN_H_RIGHT
Definition: ui_node_panel.h:66
@ LAYOUTALIGN_H_MASK
Definition: ui_node_panel.h:63
@ LAYOUTALIGN_H_LEFT
Definition: ui_node_panel.h:64
@ LAYOUTALIGN_H_MIDDLE
Definition: ui_node_panel.h:65
@ LAYOUTALIGN_SPECIAL
Definition: ui_node_panel.h:84
@ LAYOUTALIGN_BOTTOMRIGHT
Definition: ui_node_panel.h:81
@ LAYOUTALIGN_MAX
Definition: ui_node_panel.h:89
@ LAYOUTALIGN_TOP
Definition: ui_node_panel.h:74
@ LAYOUTALIGN_FILL
Definition: ui_node_panel.h:87
@ LAYOUTALIGN_MIDDLE
Definition: ui_node_panel.h:77
panelLayout_t
Definition: ui_node_panel.h:45
@ LAYOUT_COLUMN
Definition: ui_node_panel.h:53
@ LAYOUT_PACK
Definition: ui_node_panel.h:50
@ LAYOUT_LEFT_RIGHT_FLOW
Definition: ui_node_panel.h:48
@ LAYOUT_CLIENT
Definition: ui_node_panel.h:52
@ LAYOUT_ENSURE_32BIT
Definition: ui_node_panel.h:56
@ LAYOUT_BORDER
Definition: ui_node_panel.h:49
@ LAYOUT_TOP_DOWN_FLOW
Definition: ui_node_panel.h:47
@ LAYOUT_MAX
Definition: ui_node_panel.h:55
@ LAYOUT_NONE
Definition: ui_node_panel.h:46
@ LAYOUT_STAR
Definition: ui_node_panel.h:51