Freeciv-3.1: /fast/freeciv/nightly/S3_1/client/gui-sdl2/gotodlg.c Source File

Freeciv-3.1

Loading...
Searching...
No Matches
gotodlg.c
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#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18#include <stdlib.h>
19
20/* SDL2 */
21#ifdef SDL2_PLAIN_INCLUDE
22#include <SDL.h>
23#else /* SDL2_PLAIN_INCLUDE */
24#include <SDL2/SDL.h>
25#endif /* SDL2_PLAIN_INCLUDE */
26
27/* utility */
28#include "bitvector.h"
29#include "fcintl.h"
30#include "log.h"
31
32/* common */
33#include "game.h"
34#include "fc_types.h" /* bv_player */
35#include "unitlist.h"
36
37/* client */
38#include "client_main.h"
39#include "control.h"
40#include "goto.h"
41
42/* gui-sdl2 */
43#include "colors.h"
44#include "graphics.h"
45#include "gui_id.h"
46#include "gui_main.h"
47#include "gui_tilespec.h"
48#include "mapview.h"
49#include "sprite.h"
50#include "widget.h"
51
52#include "gotodlg.h"
53
54 static struct advanced_dialog *goto_dlg = NULL;
55bv_player all_players;
56 static bool GOTO = TRUE;
57
58static void update_goto_dialog(void);
59
60/**********************************************************************/
63 static int goto_dialog_window_callback(struct widget *pwindow)
64{
65 if (PRESSED_EVENT(main_data.event)) {
66 move_window_group(goto_dlg->begin_widget_list, pwindow);
67 }
68
69 return -1;
70}
71
72/**********************************************************************/
75 static int exit_goto_dialog_callback(struct widget *pwidget)
76{
77 if (PRESSED_EVENT(main_data.event)) {
78 popdown_goto_airlift_dialog();
79 flush_dirty();
80 }
81
82 return -1;
83}
84
85/**********************************************************************/
88 static int toggle_goto_nations_cities_dialog_callback(struct widget *pwidget)
89{
90 if (PRESSED_EVENT(main_data.event)) {
91 int plr_id = player_index(player_by_number(MAX_ID - pwidget->id));
92
93 if (BV_ISSET(all_players, plr_id)) {
94 BV_CLR(all_players, plr_id);
95 } else {
96 BV_SET(all_players, plr_id);
97 }
98 update_goto_dialog();
99 }
100
101 return -1;
102}
103
104/**********************************************************************/
107 static int goto_city_callback(struct widget *pwidget)
108{
109 if (PRESSED_EVENT(main_data.event)) {
110 struct city *pdestcity = game_city_by_number(MAX_ID - pwidget->id);
111
112 if (pdestcity) {
113 struct unit *punit = head_of_units_in_focus();
114
115 if (punit) {
116 if (GOTO) {
117 send_goto_tile(punit, pdestcity->tile);
118 } else {
119 request_unit_airlift(punit, pdestcity);
120 }
121 }
122 }
123
124 popdown_goto_airlift_dialog();
125 flush_dirty();
126 }
127
128 return -1;
129}
130
131/**********************************************************************/
134 static void update_goto_dialog(void)
135{
136 struct widget *buf = NULL, *add_dock, *last;
137 SDL_Surface *logo = NULL;
138 utf8_str *pstr;
139 char cbuf[128];
140 int n = 0;
141 struct player *owner = NULL;
142
143 if (goto_dlg->end_active_widget_list) {
144 add_dock = goto_dlg->end_active_widget_list->next;
145 goto_dlg->begin_widget_list = add_dock;
146 del_group(goto_dlg->begin_active_widget_list,
147 goto_dlg->end_active_widget_list);
148 goto_dlg->active_widget_list = NULL;
149 } else {
150 add_dock = goto_dlg->begin_widget_list;
151 }
152
153 last = add_dock;
154
155 players_iterate(pplayer) {
156 if (!BV_ISSET(all_players, player_index(pplayer))) {
157 continue;
158 }
159
160 city_list_iterate(pplayer->cities, pcity) {
161
162 /* FIXME: Should use unit_can_airlift_to(). */
163 if (!GOTO && !pcity->airlift) {
164 continue;
165 }
166
167 fc_snprintf(cbuf, sizeof(cbuf), "%s (%d)", city_name_get(pcity),
168 city_size_get(pcity));
169
170 pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION);
171 pstr->style |= TTF_STYLE_BOLD;
172
173 if (!player_owns_city(owner, pcity)) {
174 logo = get_nation_flag_surface(nation_of_player(city_owner(pcity)));
175 logo = crop_visible_part_from_surface(logo);
176 }
177
178 buf = create_iconlabel(logo, goto_dlg->end_widget_list->dst, pstr,
179 (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE));
180
181 if (!player_owns_city(owner, pcity)) {
182 set_wflag(buf, WF_FREE_THEME);
183 owner = city_owner(pcity);
184 }
185
186 buf->string_utf8->fgcol =
187 *(get_player_color(tileset, city_owner(pcity))->color);
188 buf->action = goto_city_callback;
189
190 if (GOTO || pcity->airlift) {
191 set_wstate(buf, FC_WS_NORMAL);
192 }
193
194 fc_assert((MAX_ID - pcity->id) > 0);
195 buf->id = MAX_ID - pcity->id;
196
197 widget_add_as_prev(buf, add_dock);
198 add_dock = buf;
199
200 if (n > (goto_dlg->scroll->active - 1)) {
201 set_wflag(buf, WF_HIDDEN);
202 }
203
204 n++;
205 } city_list_iterate_end;
206 } players_iterate_end;
207
208 if (n > 0) {
209 goto_dlg->begin_widget_list = buf;
210
211 goto_dlg->begin_active_widget_list = goto_dlg->begin_widget_list;
212 goto_dlg->end_active_widget_list = last->prev;
213 goto_dlg->active_widget_list = goto_dlg->end_active_widget_list;
214 goto_dlg->scroll->count = n;
215
216 if (n > goto_dlg->scroll->active) {
217 show_scrollbar(goto_dlg->scroll);
218 goto_dlg->scroll->pscroll_bar->size.y = goto_dlg->end_widget_list->area.y +
219 goto_dlg->scroll->up_left_button->size.h;
220 goto_dlg->scroll->pscroll_bar->size.h = scrollbar_size(goto_dlg->scroll);
221 } else {
222 hide_scrollbar(goto_dlg->scroll);
223 }
224
225 setup_vertical_widgets_position(1,
226 goto_dlg->end_widget_list->area.x,
227 goto_dlg->end_widget_list->area.y,
228 goto_dlg->scroll->up_left_button->size.x -
229 goto_dlg->end_widget_list->area.x - adj_size(2),
230 0, goto_dlg->begin_active_widget_list,
231 goto_dlg->end_active_widget_list);
232
233 } else {
234 hide_scrollbar(goto_dlg->scroll);
235 }
236
237 /* Redraw */
238 redraw_group(goto_dlg->begin_widget_list, goto_dlg->end_widget_list, 0);
239 widget_flush(goto_dlg->end_widget_list);
240}
241
242/**********************************************************************/
245 static void popup_goto_airlift_dialog(void)
246{
247 SDL_Color bg_color = {0, 0, 0, 96};
248 struct widget *buf, *pwindow;
249 utf8_str *pstr;
250 SDL_Surface *flag, *enabled, *disabled;
251 SDL_Rect dst;
252 int i, col, block_x, x, y;
253 SDL_Rect area;
254
255 if (goto_dlg) {
256 return;
257 }
258
259 goto_dlg = fc_calloc(1, sizeof(struct advanced_dialog));
260
261 pstr = create_utf8_from_char_fonto(_("Select destination"),
262 FONTO_ATTENTION);
263 pstr->style |= TTF_STYLE_BOLD;
264
265 pwindow = create_window_skeleton(NULL, pstr, 0);
266
267 pwindow->action = goto_dialog_window_callback;
268 set_wstate(pwindow, FC_WS_NORMAL);
269
270 add_to_gui_list(ID_WINDOW, pwindow);
271 goto_dlg->end_widget_list = pwindow;
272
273 area = pwindow->area;
274
275 /* ---------- */
276 /* Create exit button */
277 buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
278 WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
279 buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"),
280 FONTO_ATTENTION);
281 buf->action = exit_goto_dialog_callback;
282 set_wstate(buf, FC_WS_NORMAL);
283 buf->key = SDLK_ESCAPE;
284 area.w = MAX(area.w, buf->size.w) + adj_size(10);
285
286 add_to_gui_list(ID_BUTTON, buf);
287
288 col = 0;
289 /* --------------------------------------------- */
290 players_iterate(pplayer) {
291 if (pplayer != client.conn.playing
292 && DS_NO_CONTACT == player_diplstate_get(client.conn.playing, pplayer)->type) {
293 continue;
294 }
295
296 flag = resize_surface_box(get_nation_flag_surface(pplayer->nation),
297 adj_size(30), adj_size(30), 1, TRUE, FALSE);
298
299 enabled = create_icon_theme_surf(flag);
300 fill_rect_alpha(flag, NULL, &bg_color);
301 disabled = create_icon_theme_surf(flag);
302 FREESURFACE(flag);
303
304 buf = create_checkbox(pwindow->dst,
305 BV_ISSET(all_players, player_index(pplayer)),
306 WF_FREE_THEME | WF_RESTORE_BACKGROUND
307 | WF_WIDGET_HAS_INFO_LABEL);
308 set_new_checkbox_theme(buf, enabled, disabled);
309
310 buf->info_label
311 = create_utf8_from_char_fonto(nation_adjective_for_player(pplayer),
312 FONTO_ATTENTION);
313 buf->info_label->style &= ~SF_CENTER;
314 set_wstate(buf, FC_WS_NORMAL);
315
316 buf->action = toggle_goto_nations_cities_dialog_callback;
317 add_to_gui_list(MAX_ID - player_number(pplayer), buf);
318 col++;
319 } players_iterate_end;
320
321 goto_dlg->begin_widget_list = buf;
322
323 create_vertical_scrollbar(goto_dlg, 1, adj_size(320) / adj_size(30), TRUE, TRUE);
324 hide_scrollbar(goto_dlg->scroll);
325
326 area.w = MAX(area.w, adj_size(300));
327 area.h = adj_size(320);
328
329 resize_window(pwindow, NULL, NULL,
330 (pwindow->size.w - pwindow->area.w) + area.w,
331 (pwindow->size.h - pwindow->area.h) + area.h);
332
333 /* background */
334 col = (col + 15) / 16; /* number of flag columns */
335
336 flag = resize_surface(current_theme->block,
337 (col * buf->size.w + (col - 1) * adj_size(5) + adj_size(10)),
338 area.h, 1);
339
340 block_x = dst.x = area.x + area.w - flag->w;
341 dst.y = area.y;
342 alphablit(flag, NULL, pwindow->theme, &dst, 255);
343 FREESURFACE(flag);
344
345 widget_set_position(pwindow,
346 (main_window_width() - pwindow->size.w) / 2,
347 (main_window_height() - pwindow->size.h) / 2);
348
349 /* exit button */
350 buf = pwindow->prev;
351 buf->size.x = area.x + area.w - buf->size.w - 1;
352 buf->size.y = pwindow->size.y + adj_size(2);
353
354 /* nations buttons */
355 buf = buf->prev;
356 i = 0;
357 x = block_x + adj_size(5);
358 y = area.y + adj_size(1);
359 fc_assert(col > 0);
360 if (col > 0) {
361 while (buf) {
362 buf->size.x = x;
363 buf->size.y = y;
364
365 if (!((i + 1) % col)) {
366 x = block_x + adj_size(5);
367 y += buf->size.h + adj_size(1);
368 } else {
369 x += buf->size.w + adj_size(5);
370 }
371
372 if (buf == goto_dlg->begin_widget_list) {
373 break;
374 }
375
376 i++;
377 buf = buf->prev;
378 }
379 }
380
381 setup_vertical_scrollbar_area(goto_dlg->scroll,
382 block_x, area.y,
383 area.h, TRUE);
384
385 update_goto_dialog();
386}
387
388
389/**********************************************************************/
392 void popup_goto_dialog(void)
393{
394 if (!can_client_issue_orders() || 0 == get_num_units_in_focus()) {
395 return;
396 }
397
398 BV_CLR_ALL(all_players);
399 BV_SET(all_players, player_index(client.conn.playing));
400 /* FIXME: Should we include allies in all_players */
401 popup_goto_airlift_dialog();
402}
403
404/**********************************************************************/
407 void popup_airlift_dialog(void)
408{
409 if (!can_client_issue_orders() || 0 == get_num_units_in_focus()) {
410 return;
411 }
412
413 BV_CLR_ALL(all_players);
414 BV_SET(all_players, player_index(client.conn.playing));
415 /* FIXME: Should we include allies in all_players */
416 GOTO = FALSE;
417 popup_goto_airlift_dialog();
418}
419
420/**********************************************************************/
423 void popdown_goto_airlift_dialog(void)
424{
425 if (goto_dlg) {
426 popdown_window_group_dialog(goto_dlg->begin_widget_list,
427 goto_dlg->end_widget_list);
428 FC_FREE(goto_dlg->scroll);
429 FC_FREE(goto_dlg);
430 }
431 GOTO = TRUE;
432}
n
#define n
Definition astring.c:77
bitvector.h
BV_CLR_ALL
#define BV_CLR_ALL(bv)
Definition bitvector.h:95
BV_SET
#define BV_SET(bv, bit)
Definition bitvector.h:81
BV_ISSET
#define BV_ISSET(bv, bit)
Definition bitvector.h:78
BV_CLR
#define BV_CLR(bv, bit)
Definition bitvector.h:86
city_name_get
const char * city_name_get(const struct city *pcity)
Definition city.c:1111
city_list_iterate
#define city_list_iterate(citylist, pcity)
Definition city.h:488
city_size_get
static citizens city_size_get(const struct city *pcity)
Definition city.h:549
city_owner
#define city_owner(_pcity_)
Definition city.h:543
city_list_iterate_end
#define city_list_iterate_end
Definition city.h:490
client
struct civclient client
Definition client_main.c:149
can_client_issue_orders
bool can_client_issue_orders(void)
Definition client_main.c:1265
client_main.h
get_player_color
struct color * get_player_color(const struct tileset *t, const struct player *pplayer)
Definition colors_common.c:125
request_unit_airlift
void request_unit_airlift(struct unit *punit, struct city *pcity)
Definition control.c:1512
head_of_units_in_focus
struct unit * head_of_units_in_focus(void)
Definition control.c:406
get_num_units_in_focus
int get_num_units_in_focus(void)
Definition control.c:185
control.h
punit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
Definition dialogs_g.h:73
current_theme
QString current_theme
Definition fc_client.cpp:65
fc_types.h
fcintl.h
_
#define _(String)
Definition fcintl.h:67
game_city_by_number
struct city * game_city_by_number(int id)
Definition game.c:102
game.h
send_goto_tile
bool send_goto_tile(struct unit *punit, struct tile *ptile)
Definition goto.c:1551
goto.h
owner
struct city * owner
Definition citydlg.c:219
popup_goto_dialog
void popup_goto_dialog(void)
Definition gotodlg.c:257
flush_dirty
void flush_dirty(void)
Definition mapview.c:450
popup_goto_airlift_dialog
static void popup_goto_airlift_dialog(void)
Definition gotodlg.c:245
popdown_goto_airlift_dialog
void popdown_goto_airlift_dialog(void)
Definition gotodlg.c:423
goto_dialog_window_callback
static int goto_dialog_window_callback(struct widget *pwindow)
Definition gotodlg.c:63
exit_goto_dialog_callback
static int exit_goto_dialog_callback(struct widget *pwidget)
Definition gotodlg.c:75
goto_city_callback
static int goto_city_callback(struct widget *pwidget)
Definition gotodlg.c:107
goto_dlg
static struct advanced_dialog * goto_dlg
Definition gotodlg.c:54
popup_airlift_dialog
void popup_airlift_dialog(void)
Definition gotodlg.c:407
all_players
bv_player all_players
Definition gotodlg.c:55
toggle_goto_nations_cities_dialog_callback
static int toggle_goto_nations_cities_dialog_callback(struct widget *pwidget)
Definition gotodlg.c:88
GOTO
static bool GOTO
Definition gotodlg.c:56
update_goto_dialog
static void update_goto_dialog(void)
Definition gotodlg.c:134
resize_surface
SDL_Surface * resize_surface(const SDL_Surface *psrc, Uint16 new_width, Uint16 new_height, int smooth)
Definition graphics.c:1236
main_window_width
int main_window_width(void)
Definition graphics.c:685
fill_rect_alpha
int fill_rect_alpha(SDL_Surface *surf, SDL_Rect *prect, SDL_Color *pcolor)
Definition graphics.c:865
crop_visible_part_from_surface
SDL_Surface * crop_visible_part_from_surface(SDL_Surface *psrc)
Definition graphics.c:1226
alphablit
int alphablit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect, unsigned char alpha_mod)
Definition graphics.c:199
main_data
struct sdl2_data main_data
Definition graphics.c:57
main_window_height
int main_window_height(void)
Definition graphics.c:693
resize_surface_box
SDL_Surface * resize_surface_box(const SDL_Surface *psrc, Uint16 new_width, Uint16 new_height, int smooth, bool scale_up, bool absolute_dimensions)
Definition graphics.c:1256
FREESURFACE
#define FREESURFACE(ptr)
Definition graphics.h:322
adj_size
#define adj_size(size)
Definition gui_main.h:138
PRESSED_EVENT
#define PRESSED_EVENT(event)
Definition gui_main.h:68
colors.h
gotodlg.h
graphics.h
gui_main.h
mapview.h
sprite.h
gui_id.h
ID_BUTTON
@ ID_BUTTON
Definition gui_id.h:29
ID_WINDOW
@ ID_WINDOW
Definition gui_id.h:30
FONTO_ATTENTION
@ FONTO_ATTENTION
Definition gui_string.h:66
create_utf8_from_char_fonto
#define create_utf8_from_char_fonto(string_in, fonto)
Definition gui_string.h:107
gui_tilespec.h
get_nation_flag_surface
static SDL_Surface * get_nation_flag_surface(const struct nation_type *pnation)
Definition gui_tilespec.h:228
log.h
fc_assert
#define fc_assert(condition)
Definition log.h:176
fc_calloc
#define fc_calloc(n, esz)
Definition mem.h:38
FC_FREE
#define FC_FREE(ptr)
Definition mem.h:41
nation_adjective_for_player
const char * nation_adjective_for_player(const struct player *pplayer)
Definition nation.c:168
nation_of_player
struct nation_type * nation_of_player(const struct player *pplayer)
Definition nation.c:443
player_by_number
struct player * player_by_number(const int player_id)
Definition player.c:840
player_number
int player_number(const struct player *pplayer)
Definition player.c:828
player_index
int player_index(const struct player *pplayer)
Definition player.c:820
player_diplstate_get
struct player_diplstate * player_diplstate_get(const struct player *plr1, const struct player *plr2)
Definition player.c:317
player_owns_city
bool player_owns_city(const struct player *pplayer, const struct city *pcity)
Definition player.c:255
players_iterate_end
#define players_iterate_end
Definition player.h:535
players_iterate
#define players_iterate(_pplayer)
Definition player.h:530
MAX
#define MAX(x, y)
Definition shared.h:54
advanced_dialog
Definition widget.h:180
advanced_dialog::active_widget_list
struct widget * active_widget_list
Definition widget.h:186
advanced_dialog::end_widget_list
struct widget * end_widget_list
Definition widget.h:182
advanced_dialog::begin_widget_list
struct widget * begin_widget_list
Definition widget.h:181
advanced_dialog::begin_active_widget_list
struct widget * begin_active_widget_list
Definition widget.h:184
advanced_dialog::end_active_widget_list
struct widget * end_active_widget_list
Definition widget.h:185
advanced_dialog::scroll
struct scroll_bar * scroll
Definition widget.h:187
city
Definition city.h:309
city::tile
struct tile * tile
Definition city.h:311
civclient::conn
struct connection conn
Definition client_main.h:96
color::color
GdkRGBA color
Definition colors.h:21
connection::playing
struct player * playing
Definition connection.h:156
player_diplstate::type
enum diplstate_type type
Definition player.h:201
player
Definition player.h:249
scroll_bar::up_left_button
struct widget * up_left_button
Definition widget_scrollbar.h:21
scroll_bar::pscroll_bar
struct widget * pscroll_bar
Definition widget_scrollbar.h:22
scroll_bar::active
Uint8 active
Definition widget_scrollbar.h:24
scroll_bar::count
Uint16 count
Definition widget_scrollbar.h:27
sdl2_data::event
SDL_Event event
Definition graphics.h:217
tileset
Definition tilespec.c:459
unit
Definition unit.h:138
utf8_str
Definition gui_string.h:52
utf8_str::style
Uint8 style
Definition gui_string.h:53
utf8_str::fgcol
SDL_Color fgcol
Definition gui_string.h:57
widget
Definition widget.h:112
widget::next
struct widget * next
Definition widget.h:113
widget::dst
struct gui_layer * dst
Definition widget.h:116
widget::prev
struct widget * prev
Definition widget.h:114
widget::action
int(* action)(struct widget *)
Definition widget.h:157
widget::cont
struct container * cont
Definition widget.h:127
widget::theme
SDL_Surface * theme
Definition widget.h:118
widget::string_utf8
utf8_str * string_utf8
Definition widget.h:121
widget::area
SDL_Rect area
Definition widget.h:149
widget::id
Uint16 id
Definition widget.h:155
widget::size
SDL_Rect size
Definition widget.h:145
fc_snprintf
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:969
TRUE
#define TRUE
Definition support.h:46
FALSE
#define FALSE
Definition support.h:47
unitlist.h
add_to_gui_list
void add_to_gui_list(Uint16 id, struct widget *gui)
Definition widget.c:585
widget_add_as_prev
void widget_add_as_prev(struct widget *new_widget, struct widget *add_dock)
Definition widget.c:601
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:1050
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:719
popdown_window_group_dialog
void popdown_window_group_dialog(struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
Definition widget.c:982
move_window_group
void move_window_group(struct widget *begin_widget_list, struct widget *pwindow)
Definition widget.c:1038
widget.h
widget_set_position
static void widget_set_position(struct widget *pwidget, int x, int y)
Definition widget.h:266
MAX_ID
#define MAX_ID
Definition widget.h:38
FC_WS_NORMAL
@ FC_WS_NORMAL
Definition widget.h:96
widget_flush
static void widget_flush(struct widget *pwidget)
Definition widget.h:291
set_wstate
void set_wstate(struct widget *pwidget, enum widget_state state)
Definition widget_core.c:36
WF_WIDGET_HAS_INFO_LABEL
@ WF_WIDGET_HAS_INFO_LABEL
Definition widget.h:88
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
set_wflag
void set_wflag(struct widget *pwidget, enum widget_flag flag)
Definition widget_core.c:54
del_group
#define del_group(begin_group_widget_list, end_group_widget_list)
Definition widget.h:389
set_new_checkbox_theme
int set_new_checkbox_theme(struct widget *cbox, SDL_Surface *true_surf, SDL_Surface *false_surf)
Definition widget_checkbox.c:195
create_checkbox
struct widget * create_checkbox(struct gui_layer *pdest, bool state, Uint32 flags)
Definition widget_checkbox.c:115
create_themeicon
struct widget * create_themeicon(SDL_Surface *icon_theme, struct gui_layer *pdest, Uint32 flags)
Definition widget_icon.c:208
create_icon_theme_surf
SDL_Surface * create_icon_theme_surf(SDL_Surface *icon)
Definition widget_icon.c:158
create_iconlabel
struct widget * create_iconlabel(SDL_Surface *icon, struct gui_layer *pdest, utf8_str *pstr, Uint32 flags)
Definition widget_label.c:215
setup_vertical_scrollbar_area
void setup_vertical_scrollbar_area(struct scroll_bar *scroll, Sint16 start_x, Sint16 start_y, Uint16 height, bool swap_start_x)
Definition widget_scrollbar.c:572
create_vertical_scrollbar
Uint32 create_vertical_scrollbar(struct advanced_dialog *dlg, Uint8 step, Uint8 active, bool create_scrollbar, bool create_buttons)
Definition widget_scrollbar.c:491
hide_scrollbar
#define hide_scrollbar(scrollbar)
Definition widget_scrollbar.h:36
show_scrollbar
#define show_scrollbar(scrollbar)
Definition widget_scrollbar.h:59
scrollbar_size
#define scrollbar_size(scroll)
Definition widget_scrollbar.h:32
resize_window
int resize_window(struct widget *pwindow, SDL_Surface *bcgd, SDL_Color *pcolor, Uint16 new_w, Uint16 new_h)
Definition widget_window.c:255
create_window_skeleton
struct widget * create_window_skeleton(struct gui_layer *pdest, utf8_str *title, Uint32 flags)
Definition widget_window.c:180