Freeciv-3.3: /fast/freeciv/nightly/main/client/gui-sdl3/widget.h Source File

Freeciv-3.3

Loading...
Searching...
No Matches
widget.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14/**********************************************************************
15 widget.h - description
16 -------------------
17 begin : June 30 2002
18 copyright : (C) 2002 by Rafał Bursig
19 email : Rafał Bursig <bursig@poczta.fm>
20**********************************************************************/
21
22#ifndef FC__WIDGET_H
23#define FC__WIDGET_H
24
25/* utility */
26#include "fc_types.h"
27
28/* gui-sdl3 */
29#include "gui_main.h"
30#include "gui_string.h"
31
32#ifdef GUI_SDL3_SMALL_SCREEN
33#define WINDOW_TITLE_HEIGHT 10
34#else
35#define WINDOW_TITLE_HEIGHT 20
36#endif
37
38#define MAX_ID 0xFFFF
39
40/* Widget Types */
41 enum widget_type { /* allow 64 widgets type */
42 WT_BUTTON = 4, /* Button with Text (not use !!!)
43 ( can be transparent ) */
44 WT_I_BUTTON = 8, /* Button with TEXT and ICON
45 ( static; can't be transp. ) */
46 WT_TI_BUTTON = 12, /* Button with TEXT and ICON
47 (themed; can't be transp. ) */
48 WT_EDIT = 16, /* edit field */
49 WT_ICON = 20, /* flat Button from 4 - state icon */
50 WT_VSCROLLBAR = 24, /* bugy */
51 WT_HSCROLLBAR = 28, /* bugy */
52 WT_WINDOW = 32,
53 WT_T_LABEL = 36, /* text label with theme background */
54 WT_I_LABEL = 40, /* text label with icon */
55 WT_TI_LABEL = 44, /* text label with icon and theme background.
56 NOTE: Not DEFINED- don't use
57 ( can't be transp. ) */
58 WT_CHECKBOX = 48, /* checkbox. */
59 WT_TCHECKBOX = 52, /* text label with checkbox. */
60 WT_ICON2 = 56, /* flat Button from 1 - state icon */
61 WT_T2_LABEL = 60,
62 WT_COMBO = 64
63};
64
65/* Widget FLAGS -> allowed 20 flags */
66/* default: ICON_CENTER_Y, ICON_ON_LEFT */
67 enum widget_flag {
68 WF_HIDDEN = (1<<10),
69 /* widget->gfx may be freed together with the widget */
70 WF_FREE_GFX = (1<<11),
71 /* widget->theme may be freed together with the widget*/
72 WF_FREE_THEME = (1<<12),
73 /* widget->theme2 may be freed together with the widget*/
74 WF_FREE_THEME2 = (1<<13),
75 /* widget->string may be freed together with the widget*/
76 WF_FREE_STRING = (1<<14),
77 /* widget->data may be freed together with the widget*/
78 WF_FREE_DATA = (1<<15),
79 /* widget->private_data may be freed together with the widget*/
80 WF_FREE_PRIVATE_DATA = (1<<16),
81 WF_ICON_ABOVE_TEXT = (1<<17),
82 WF_ICON_UNDER_TEXT = (1<<18),
83 WF_ICON_CENTER = (1<<19),
84 WF_ICON_CENTER_RIGHT = (1<<20),
85 WF_RESTORE_BACKGROUND = (1<<21),
86 WF_DRAW_FRAME_AROUND_WIDGET = (1<<22),
87 WF_DRAW_TEXT_LABEL_WITH_SPACE = (1<<23),
88 WF_WIDGET_HAS_INFO_LABEL = (1<<24),
89 WF_SELECT_WITHOUT_BAR = (1<<25),
90 WF_PASSWD_EDIT = (1<<26),
91 WF_EDIT_LOOP = (1<<27)
92};
93
94/* Widget states */
95 enum widget_state {
96 FC_WS_NORMAL = 0,
97 FC_WS_SELECTED = 1,
98 FC_WS_PRESSED = 2,
99 FC_WS_DISABLED = 3
100};
101
102struct container {
103 int id0;
104 int id1;
105 int value;
106};
107
108struct small_dialog;
109struct advanced_dialog;
110struct checkbox;
111
112struct widget {
113 struct widget *next;
114 struct widget *prev;
115
116 struct gui_layer *dst; /* destination buffer layer */
117
118 SDL_Surface *theme;
119 SDL_Surface *theme2; /* Icon or theme2 */
120 SDL_Surface *gfx; /* saved background */
121 utf8_str *string_utf8;
122 utf8_str *info_label; /* optional info label. */
123
124 /* data/information/transport pointers */
125 union {
126 const struct strvec *vector;
127 struct container *cont;
128 struct city *city;
129 struct unit *unit;
130 struct player *player;
131 struct tile *tile;
132 struct widget *widget;
133 void *ptr;
134 } data;
135
136 union {
137 struct checkbox *cbox;
138 struct small_dialog *small_dlg;
139 struct advanced_dialog *adv_dlg;
140 void *ptr;
141 } private_data;
142
143 Uint32 state_types_flags; /* "packed" widget info */
144
145 SDL_Rect size; /* size.w and size.h are the size of widget
146 size.x and size.y are the draw positions
147 (relative to dst) */
148
149 SDL_Rect area; /* position (relative to dst) and size of the
150 area the widget resides in (or, for
151 WT_WINDOW, the client area inside it) */
152
153 SDL_Keycode key; /* key aliased with this widget */
154 Uint16 mod; /* SHIFT, CTRL, ALT, etc */
155 Uint16 id; /* id in widget list */
156
157 int (*action) (struct widget *); /* default callback action */
158
159 void (*set_area) (struct widget *pwidget, SDL_Rect area);
160 void (*set_position) (struct widget *pwidget, int x, int y);
161 void (*resize) (struct widget *pwidget, int w, int h);
162 void (*draw_frame) (struct widget *pwidget);
163 int (*redraw) (struct widget *pwidget);
164 void (*mark_dirty) (struct widget *pwidget);
165 void (*flush) (struct widget *pwidget);
166 void (*undraw) (struct widget *pwidget);
167 void (*select) (struct widget *pwidget);
168 void (*unselect) (struct widget *pwidget);
169 void (*press) (struct widget *pwidget);
170 void (*destroy) (struct widget *pwidget);
171};
172
173/* Struct of basic window group dialog ( without scrollbar ) */
174struct small_dialog {
175 struct widget *begin_widget_list;
176 struct widget *end_widget_list; /* window */
177};
178
179/* Struct of advanced window group dialog ( with scrollbar ) */
180struct advanced_dialog {
181 struct widget *begin_widget_list;
182 struct widget *end_widget_list; /* window */
183
184 struct widget *begin_active_widget_list;
185 struct widget *end_active_widget_list;
186 struct widget *active_widget_list; /* first seen widget */
187 struct scroll_bar *scroll;
188};
189
190 enum scan_direction {
191 SCAN_FORWARD,
192 SCAN_BACKWARD
193};
194
195void add_to_gui_list(Uint16 id, struct widget *gui);
196void del_widget_pointer_from_gui_list(struct widget *gui);
197void widget_add_as_prev(struct widget *new_widget, struct widget *add_dock);
198
199bool is_this_widget_first_on_list(struct widget *gui);
200void move_widget_to_front_of_gui_list(struct widget *gui);
201
202void del_gui_list(struct widget *gui_list);
203void del_main_list(void);
204
205struct widget *find_next_widget_at_pos(struct widget *start_widget, int x, int y);
206struct widget *find_next_widget_for_key(struct widget *start_widget, SDL_Keysym key);
207
208struct widget *get_widget_pointer_from_id(const struct widget *gui_list,
209 Uint16 id,
210 enum scan_direction direction);
211
212struct widget *get_widget_pointer_from_main_list(Uint16 id);
213
214#define set_action(id, action_callback) \
215 get_widget_pointer_from_main_list(id)->action = action_callback
216
217#define set_key(id, keyb) \
218 get_widget_pointer_from_main_list(id)->key = keyb
219
220#define set_mod(id, mod) \
221 get_widget_pointer_from_main_list(id)->mod = mod
222
223#define enable(id) \
224do { \
225 struct widget *____gui = get_widget_pointer_from_main_list(id); \
226 set_wstate(____gui, FC_WS_NORMAL); \
227} while (FALSE)
228
229#define disable(id) \
230do { \
231 struct widget *____gui = get_widget_pointer_from_main_list(id); \
232 set_wstate(____gui , FC_WS_DISABLED); \
233} while (FALSE)
234
235#define show(id) \
236 clear_wflag( get_widget_pointer_from_main_list(id), WF_HIDDEN)
237
238#define hide(id) \
239 set_wflag(get_widget_pointer_from_main_list(id), WF_HIDDEN)
240
241void widget_selected_action(struct widget *pwidget);
242 Uint16 widget_pressed_action(struct widget *pwidget);
243
244void unselect_widget_action(void);
245
246#define draw_widget_info_label() redraw_widget_info_label(NULL);
247void redraw_widget_info_label(SDL_Rect *area);
248
249/* Widget */
250void set_wstate(struct widget *pwidget, enum widget_state state);
251enum widget_state get_wstate(const struct widget *pwidget);
252
253void set_wtype(struct widget *pwidget, enum widget_type type);
254enum widget_type get_wtype(const struct widget *pwidget);
255
256void set_wflag(struct widget *pwidget, enum widget_flag flag);
257void clear_wflag(struct widget *pwidget, enum widget_flag flag);
258
259enum widget_flag get_wflags(const struct widget *pwidget);
260
261 static inline void widget_set_area(struct widget *pwidget, SDL_Rect area)
262{
263 pwidget->set_area(pwidget, area);
264}
265
266 static inline void widget_set_position(struct widget *pwidget, int x, int y)
267{
268 pwidget->set_position(pwidget, x, y);
269}
270
271 static inline void widget_resize(struct widget *pwidget, int w, int h)
272{
273 pwidget->resize(pwidget, w, h);
274}
275
276 static inline int widget_redraw(struct widget *pwidget)
277{
278 return pwidget->redraw(pwidget);
279}
280
281 static inline void widget_draw_frame(struct widget *pwidget)
282{
283 pwidget->draw_frame(pwidget);
284}
285
286 static inline void widget_mark_dirty(struct widget *pwidget)
287{
288 pwidget->mark_dirty(pwidget);
289}
290
291 static inline void widget_flush(struct widget *pwidget)
292{
293 pwidget->flush(pwidget);
294}
295
296 static inline void widget_undraw(struct widget *pwidget)
297{
298 pwidget->undraw(pwidget);
299}
300
301void widget_free(struct widget **gui);
302
303void refresh_widget_background(struct widget *pwidget);
304
305#define FREEWIDGET(pwidget) \
306do { \
307 widget_free(&pwidget); \
308} while (FALSE)
309
310#define draw_frame_inside_widget_on_surface(pwidget , pdest) \
311do { \
312 draw_frame(pdest, pwidget->size.x, pwidget->size.y, pwidget->size.w, pwidget->size.h); \
313} while (FALSE);
314
315#define draw_frame_inside_widget(pwidget) \
316 draw_frame_inside_widget_on_surface(pwidget , pwidget->dst->surface)
317
318#define draw_frame_around_widget_on_surface(pwidget , pdest) \
319do { \
320 draw_frame(pdest, pwidget->size.x - ptheme->FR_Left->w, pwidget->size.y - ptheme->FR_Top->h, \
321 pwidget->size.w + ptheme->FR_Left->w + ptheme->FR_Right->w,\
322 pwidget->size.h + ptheme->FR_Top->h + ptheme->FR_Bottom->h); \
323} while (FALSE);
324
325#define draw_frame_around_widget(pwidget) \
326 draw_frame_around_widget_on_surface(pwidget, pwidget->dst->surface)
327
328/* Group */
329 Uint16 redraw_group(const struct widget *begin_group_widget_list,
330 const struct widget *end_group_widget_list,
331 int add_to_update);
332
333void undraw_group(struct widget *begin_group_widget_list,
334 struct widget *end_group_widget_list);
335
336void set_new_group_start_pos(const struct widget *begin_group_widget_list,
337 const struct widget *end_group_widget_list,
338 Sint16 Xrel, Sint16 Yrel);
339void del_group_of_widgets_from_gui_list(struct widget *begin_group_widget_list,
340 struct widget *end_group_widget_list);
341void move_group_to_front_of_gui_list(struct widget *begin_group_widget_list,
342 struct widget *end_group_widget_list);
343
344void set_group_state(struct widget *begin_group_widget_list,
345 struct widget *end_group_widget_list, enum widget_state state);
346
347void show_group(struct widget *begin_group_widget_list,
348 struct widget *end_group_widget_list);
349
350void hide_group(struct widget *begin_group_widget_list,
351 struct widget *end_group_widget_list);
352
353void group_set_area(struct widget *begin_group_widget_list,
354 struct widget *end_group_widget_list,
355 SDL_Rect area);
356
357/* Window Group */
358void popdown_window_group_dialog(struct widget *begin_group_widget_list,
359 struct widget *end_group_widget_list);
360
361bool select_window_group_dialog(struct widget *begin_widget_list,
362 struct widget *pwindow);
363bool move_window_group_dialog(struct widget *begin_group_widget_list,
364 struct widget *end_group_widget_list);
365void move_window_group(struct widget *begin_widget_list, struct widget *pwindow);
366
367int setup_vertical_widgets_position(int step,
368 Sint16 start_x, Sint16 start_y,
369 Uint16 w, Uint16 h,
370 struct widget *begin, struct widget *end);
371
372#define del_widget_from_gui_list(__gui) \
373do { \
374 del_widget_pointer_from_gui_list(__gui); \
375 FREEWIDGET(__gui); \
376} while (FALSE)
377
378#define del_ID_from_gui_list(id) \
379do { \
380 struct widget *___ptmp = get_widget_pointer_from_main_list(id); \
381 del_widget_pointer_from_gui_list(___ptmp); \
382 FREEWIDGET(___ptmp); \
383} while (FALSE)
384
385#define move_ID_to_front_of_gui_list(id) \
386 move_widget_to_front_of_gui_list( \
387 get_widget_pointer_from_main_list(id))
388
389#define del_group(begin_group_widget_list, end_group_widget_list) \
390do { \
391 del_group_of_widgets_from_gui_list(begin_group_widget_list, \
392 end_group_widget_list); \
393 begin_group_widget_list = NULL; \
394 end_group_widget_list = NULL; \
395} while (FALSE)
396
397#define enable_group(begin_group_widget_list, end_group_widget_list) \
398 set_group_state(begin_group_widget_list, \
399 end_group_widget_list, FC_WS_NORMAL)
400
401#define disable_group(begin_group_widget_list, end_group_widget_list) \
402 set_group_state(begin_group_widget_list, end_group_widget_list, \
403 FC_WS_DISABLED)
404
405/* Advanced Dialog */
406bool add_widget_to_vertical_scroll_widget_list(struct advanced_dialog *dlg,
407 struct widget *new_widget,
408 struct widget *add_dock, bool dir,
409 Sint16 start_x, Sint16 start_y)
410 fc__attribute((nonnull (2)));
411
412bool del_widget_from_vertical_scroll_widget_list(struct advanced_dialog *dlg,
413 struct widget *pwidget)
414 fc__attribute((nonnull (2)));
415
416/* Misc */
417 SDL_Surface *create_bcgnd_surf(SDL_Surface *ptheme, enum widget_state state,
418 Uint16 width, Uint16 height);
419void draw_frame(SDL_Surface *pdest, Sint16 start_x, Sint16 start_y,
420 Uint16 w, Uint16 h);
421
422#include "widget_button.h"
423#include "widget_checkbox.h"
424#include "widget_combo.h"
425#include "widget_edit.h"
426#include "widget_icon.h"
427#include "widget_label.h"
428#include "widget_scrollbar.h"
429#include "widget_window.h"
430
431#endif /* FC__WIDGET_H */
height
struct canvas int int struct sprite int int int int height
Definition canvas_g.h:44
width
struct canvas int int struct sprite int int int width
Definition canvas_g.h:44
incite_cost
char * incite_cost
Definition comments.c:74
fc_types.h
type
GType type
Definition repodlgs.c:1313
widget_set_position
static void widget_set_position(struct widget *pwidget, int x, int y)
Definition widget.h:266
find_next_widget_for_key
struct widget * find_next_widget_for_key(struct widget *start_widget, SDL_Keysym key)
Definition widget.c:252
del_widget_pointer_from_gui_list
void del_widget_pointer_from_gui_list(struct widget *gui)
Definition widget.c:622
set_new_group_start_pos
void set_new_group_start_pos(const struct widget *begin_group_widget_list, const struct widget *end_group_widget_list, Sint16 Xrel, Sint16 Yrel)
Definition widget.c:774
widget_pressed_action
Uint16 widget_pressed_action(struct widget *pwidget)
Definition widget.c:296
set_group_state
void set_group_state(struct widget *begin_group_widget_list, struct widget *end_group_widget_list, enum widget_state state)
Definition widget.c:898
move_group_to_front_of_gui_list
void move_group_to_front_of_gui_list(struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
Definition widget.c:812
widget_state
widget_state
Definition widget.h:95
FC_WS_DISABLED
@ FC_WS_DISABLED
Definition widget.h:99
FC_WS_NORMAL
@ FC_WS_NORMAL
Definition widget.h:96
FC_WS_PRESSED
@ FC_WS_PRESSED
Definition widget.h:98
FC_WS_SELECTED
@ FC_WS_SELECTED
Definition widget.h:97
clear_wflag
void clear_wflag(struct widget *pwidget, enum widget_flag flag)
Definition widget_core.c:62
add_to_gui_list
void add_to_gui_list(Uint16 id, struct widget *gui)
Definition widget.c:586
add_widget_to_vertical_scroll_widget_list
bool add_widget_to_vertical_scroll_widget_list(struct advanced_dialog *dlg, struct widget *new_widget, struct widget *add_dock, bool dir, Sint16 start_x, Sint16 start_y) fc__attribute((nonnull(2)))
Definition widget_scrollbar.c:1146
widget_selected_action
void widget_selected_action(struct widget *pwidget)
Definition widget.c:443
get_widget_pointer_from_main_list
struct widget * get_widget_pointer_from_main_list(Uint16 id)
Definition widget.c:578
scan_direction
scan_direction
Definition widget.h:190
SCAN_BACKWARD
@ SCAN_BACKWARD
Definition widget.h:192
SCAN_FORWARD
@ SCAN_FORWARD
Definition widget.h:191
widget_free
void widget_free(struct widget **gui)
Definition widget_core.c:94
del_group_of_widgets_from_gui_list
void del_group_of_widgets_from_gui_list(struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
Definition widget.c:863
del_widget_from_vertical_scroll_widget_list
bool del_widget_from_vertical_scroll_widget_list(struct advanced_dialog *dlg, struct widget *pwidget) fc__attribute((nonnull(2)))
Definition widget_scrollbar.c:1344
widget_draw_frame
static void widget_draw_frame(struct widget *pwidget)
Definition widget.h:281
move_window_group_dialog
bool move_window_group_dialog(struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
Definition widget.c:1016
find_next_widget_at_pos
struct widget * find_next_widget_at_pos(struct widget *start_widget, int x, int y)
Definition widget.c:222
widget_mark_dirty
static void widget_mark_dirty(struct widget *pwidget)
Definition widget.h:286
widget_flush
static void widget_flush(struct widget *pwidget)
Definition widget.h:291
refresh_widget_background
void refresh_widget_background(struct widget *pwidget)
Definition widget.c:1151
del_gui_list
void del_gui_list(struct widget *gui_list)
Definition widget.c:699
redraw_widget_info_label
void redraw_widget_info_label(SDL_Rect *area)
Definition widget.c:467
get_wflags
enum widget_flag get_wflags(const struct widget *pwidget)
Definition widget_core.c:86
draw_frame
void draw_frame(SDL_Surface *pdest, Sint16 start_x, Sint16 start_y, Uint16 w, Uint16 h)
Definition widget.c:1114
set_wstate
void set_wstate(struct widget *pwidget, enum widget_state state)
Definition widget_core.c:36
show_group
void show_group(struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
Definition widget.c:934
unselect_widget_action
void unselect_widget_action(void)
Definition widget.c:418
get_wstate
enum widget_state get_wstate(const struct widget *pwidget)
Definition widget_core.c:70
hide_group
void hide_group(struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
Definition widget.c:915
widget_undraw
static void widget_undraw(struct widget *pwidget)
Definition widget.h:296
widget_flag
widget_flag
Definition widget.h:67
WF_FREE_GFX
@ WF_FREE_GFX
Definition widget.h:70
WF_EDIT_LOOP
@ WF_EDIT_LOOP
Definition widget.h:91
WF_ICON_CENTER
@ WF_ICON_CENTER
Definition widget.h:83
WF_PASSWD_EDIT
@ WF_PASSWD_EDIT
Definition widget.h:90
WF_WIDGET_HAS_INFO_LABEL
@ WF_WIDGET_HAS_INFO_LABEL
Definition widget.h:88
WF_DRAW_FRAME_AROUND_WIDGET
@ WF_DRAW_FRAME_AROUND_WIDGET
Definition widget.h:86
WF_ICON_ABOVE_TEXT
@ WF_ICON_ABOVE_TEXT
Definition widget.h:81
WF_FREE_DATA
@ WF_FREE_DATA
Definition widget.h:78
WF_ICON_CENTER_RIGHT
@ WF_ICON_CENTER_RIGHT
Definition widget.h:84
WF_FREE_PRIVATE_DATA
@ WF_FREE_PRIVATE_DATA
Definition widget.h:80
WF_FREE_THEME2
@ WF_FREE_THEME2
Definition widget.h:74
WF_FREE_STRING
@ WF_FREE_STRING
Definition widget.h:76
WF_SELECT_WITHOUT_BAR
@ WF_SELECT_WITHOUT_BAR
Definition widget.h:89
WF_RESTORE_BACKGROUND
@ WF_RESTORE_BACKGROUND
Definition widget.h:85
WF_HIDDEN
@ WF_HIDDEN
Definition widget.h:68
WF_FREE_THEME
@ WF_FREE_THEME
Definition widget.h:72
WF_DRAW_TEXT_LABEL_WITH_SPACE
@ WF_DRAW_TEXT_LABEL_WITH_SPACE
Definition widget.h:87
WF_ICON_UNDER_TEXT
@ WF_ICON_UNDER_TEXT
Definition widget.h:82
is_this_widget_first_on_list
bool is_this_widget_first_on_list(struct widget *gui)
Definition widget.c:657
get_widget_pointer_from_id
struct widget * get_widget_pointer_from_id(const struct widget *gui_list, Uint16 id, enum scan_direction direction)
Definition widget.c:552
widget_add_as_prev
void widget_add_as_prev(struct widget *new_widget, struct widget *add_dock)
Definition widget.c:602
widget_redraw
static int widget_redraw(struct widget *pwidget)
Definition widget.h:276
widget_resize
static void widget_resize(struct widget *pwidget, int w, int h)
Definition widget.h:271
undraw_group
void undraw_group(struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
Definition widget.c:754
del_main_list
void del_main_list(void)
Definition widget.c:691
create_bcgnd_surf
SDL_Surface * create_bcgnd_surf(SDL_Surface *ptheme, enum widget_state state, Uint16 width, Uint16 height)
Definition widget.c:78
select_window_group_dialog
bool select_window_group_dialog(struct widget *begin_widget_list, struct widget *pwindow)
Definition widget.c:998
group_set_area
void group_set_area(struct widget *begin_group_widget_list, struct widget *end_group_widget_list, SDL_Rect area)
Definition widget.c:953
setup_vertical_widgets_position
int setup_vertical_widgets_position(int step, Sint16 start_x, Sint16 start_y, Uint16 w, Uint16 h, struct widget *begin, struct widget *end)
Definition widget.c:1051
set_wtype
void set_wtype(struct widget *pwidget, enum widget_type type)
Definition widget_core.c:45
widget_set_area
static void widget_set_area(struct widget *pwidget, SDL_Rect area)
Definition widget.h:261
get_wtype
enum widget_type get_wtype(const struct widget *pwidget)
Definition widget_core.c:78
move_widget_to_front_of_gui_list
void move_widget_to_front_of_gui_list(struct widget *gui)
Definition widget.c:667
redraw_group
Uint16 redraw_group(const struct widget *begin_group_widget_list, const struct widget *end_group_widget_list, int add_to_update)
Definition widget.c:720
set_wflag
void set_wflag(struct widget *pwidget, enum widget_flag flag)
Definition widget_core.c:54
popdown_window_group_dialog
void popdown_window_group_dialog(struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
Definition widget.c:983
widget_type
widget_type
Definition widget.h:41
WT_TI_BUTTON
@ WT_TI_BUTTON
Definition widget.h:46
WT_VSCROLLBAR
@ WT_VSCROLLBAR
Definition widget.h:50
WT_T2_LABEL
@ WT_T2_LABEL
Definition widget.h:61
WT_WINDOW
@ WT_WINDOW
Definition widget.h:52
WT_TI_LABEL
@ WT_TI_LABEL
Definition widget.h:55
WT_EDIT
@ WT_EDIT
Definition widget.h:48
WT_HSCROLLBAR
@ WT_HSCROLLBAR
Definition widget.h:51
WT_TCHECKBOX
@ WT_TCHECKBOX
Definition widget.h:59
WT_T_LABEL
@ WT_T_LABEL
Definition widget.h:53
WT_COMBO
@ WT_COMBO
Definition widget.h:62
WT_CHECKBOX
@ WT_CHECKBOX
Definition widget.h:58
WT_BUTTON
@ WT_BUTTON
Definition widget.h:42
WT_I_BUTTON
@ WT_I_BUTTON
Definition widget.h:44
WT_ICON2
@ WT_ICON2
Definition widget.h:60
WT_I_LABEL
@ WT_I_LABEL
Definition widget.h:54
WT_ICON
@ WT_ICON
Definition widget.h:49
move_window_group
void move_window_group(struct widget *begin_widget_list, struct widget *pwindow)
Definition widget.c:1039
gui_string.h
widget_button.h
widget_checkbox.h
widget_combo.h
widget_edit.h
widget_icon.h
widget_label.h
widget_scrollbar.h
widget_window.h
gui_main.h
gui
static mpgui * gui
Definition mpgui_qt.cpp:52
step
int step
Definition specpq.h:92
y
struct sprite int int y
Definition sprite_g.h:31
x
struct sprite int x
Definition sprite_g.h:31
action
Definition actions.h:106
advanced_dialog
Definition widget.h:180
advanced_dialog::begin_active_widget_list
struct widget * begin_active_widget_list
Definition widget.h:184
advanced_dialog::end_widget_list
struct widget * end_widget_list
Definition widget.h:182
advanced_dialog::end_active_widget_list
struct widget * end_active_widget_list
Definition widget.h:185
advanced_dialog::active_widget_list
struct widget * active_widget_list
Definition widget.h:186
advanced_dialog::scroll
struct scroll_bar * scroll
Definition widget.h:187
advanced_dialog::begin_widget_list
struct widget * begin_widget_list
Definition widget.h:181
checkbox
Definition widget_checkbox.h:17
city
Definition city.h:320
container
Definition widget.h:102
container::id1
int id1
Definition widget.h:104
container::id0
int id0
Definition widget.h:103
container::value
int value
Definition widget.h:105
gui_layer
Definition graphics.h:227
player
Definition player.h:249
scroll_bar
Definition widget_scrollbar.h:20
small_dialog
Definition widget.h:174
small_dialog::begin_widget_list
struct widget * begin_widget_list
Definition widget.h:175
small_dialog::end_widget_list
struct widget * end_widget_list
Definition widget.h:176
strvec
Definition string_vector.c:29
tile
Definition tile.h:50
unit
Definition unit.h:140
utf8_str
Definition gui_string.h:52
widget
Definition widget.h:112
widget::data
union widget::@216 data
widget::ptr
void * ptr
Definition widget.h:133
widget::unselect
void(* unselect)(struct widget *pwidget)
Definition widget.h:168
widget::key
SDL_Keycode key
Definition widget.h:153
widget::cbox
struct checkbox * cbox
Definition widget.h:137
widget::set_area
void(* set_area)(struct widget *pwidget, SDL_Rect area)
Definition widget.h:159
widget::draw_frame
void(* draw_frame)(struct widget *pwidget)
Definition widget.h:162
widget::set_position
void(* set_position)(struct widget *pwidget, int x, int y)
Definition widget.h:160
widget::theme
SDL_Surface * theme
Definition widget.h:118
widget::press
void(* press)(struct widget *pwidget)
Definition widget.h:169
widget::resize
void(* resize)(struct widget *pwidget, int w, int h)
Definition widget.h:161
widget::theme2
SDL_Surface * theme2
Definition widget.h:119
widget::private_data
union widget::@217 private_data
widget::flush
void(* flush)(struct widget *pwidget)
Definition widget.h:165
widget::prev
struct widget * prev
Definition widget.h:114
widget::redraw
int(* redraw)(struct widget *pwidget)
Definition widget.h:163
widget::small_dlg
struct small_dialog * small_dlg
Definition widget.h:138
widget::dst
struct gui_layer * dst
Definition widget.h:116
widget::mod
Uint16 mod
Definition widget.h:154
widget::mark_dirty
void(* mark_dirty)(struct widget *pwidget)
Definition widget.h:164
widget::adv_dlg
struct advanced_dialog * adv_dlg
Definition widget.h:139
widget::string_utf8
utf8_str * string_utf8
Definition widget.h:121
widget::state_types_flags
Uint32 state_types_flags
Definition widget.h:143
widget::area
SDL_Rect area
Definition widget.h:149
widget::undraw
void(* undraw)(struct widget *pwidget)
Definition widget.h:166
widget::gfx
SDL_Surface * gfx
Definition widget.h:120
widget::next
struct widget * next
Definition widget.h:113
widget::destroy
void(* destroy)(struct widget *pwidget)
Definition widget.h:170
widget::info_label
utf8_str * info_label
Definition widget.h:122
widget::select
void(* select)(struct widget *pwidget)
Definition widget.h:167
widget::id
Uint16 id
Definition widget.h:155
widget::size
SDL_Rect size
Definition widget.h:145
fc__attribute
#define fc__attribute(x)
Definition support.h:99