Freeciv-3.3: /fast/freeciv/nightly/main/client/gui-sdl2/widget_label.c Source File

Freeciv-3.3

Loading...
Searching...
No Matches
widget_label.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 2006 - The Freeciv Project
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/* SDL2 */
19#ifdef SDL2_PLAIN_INCLUDE
20#include <SDL.h>
21#else /* SDL2_PLAIN_INCLUDE */
22#include <SDL2/SDL.h>
23#endif /* SDL2_PLAIN_INCLUDE */
24
25/* utility */
26#include "log.h"
27#include "mem.h"
28
29/* client/gui-sdl2 */
30#include "colors.h"
31#include "graphics.h"
32#include "themespec.h"
33
34#include "widget.h"
35#include "widget_p.h"
36
37 static int (*baseclass_redraw)(struct widget *pwidget);
38
39/**********************************************************************/
42 static inline int redraw_themelabel2(struct widget *label)
43{
44 SDL_Rect src = {0,0, label->size.w, label->size.h};
45 SDL_Rect dst = {label->size.x, label->size.y, 0, 0};
46/*
47 if (!label) {
48 return -3;
49 }
50*/
51 if (get_wstate(label) == FC_WS_SELECTED) {
52 src.y = label->size.h;
53 }
54
55 return alphablit(label->theme, &src, label->dst->surface, &dst, 255);
56}
57
58/**********************************************************************/
61 static int redraw_label(struct widget *label)
62{
63 int ret;
64 SDL_Rect area = label->size;
65 SDL_Color bar_color = *get_theme_color(COLOR_THEME_LABEL_BAR);
66 SDL_Color backup_color = {0, 0, 0, 0};
67
68 ret = (*baseclass_redraw)(label);
69 if (ret != 0) {
70 return ret;
71 }
72
73 if (get_wtype(label) == WT_T2_LABEL) {
74 return redraw_themelabel2(label);
75 }
76
77 /* redraw selected bar */
78 if (get_wstate(label) == FC_WS_SELECTED) {
79 if (get_wflags(label) & WF_SELECT_WITHOUT_BAR) {
80 if (label->string_utf8 != NULL) {
81 backup_color = label->string_utf8->fgcol;
82 label->string_utf8->fgcol = bar_color;
83 if (label->string_utf8->style & TTF_STYLE_BOLD) {
84 label->string_utf8->style |= TTF_STYLE_UNDERLINE;
85 } else {
86 label->string_utf8->style |= TTF_STYLE_BOLD;
87 }
88 }
89 } else {
90 fill_rect_alpha(label->dst->surface, &area, &bar_color);
91 }
92 }
93
94 /* redraw icon label */
95 ret = redraw_iconlabel(label);
96
97 if ((get_wstate(label) == FC_WS_SELECTED) && (label->string_utf8 != NULL)) {
98 if (get_wflags(label) & WF_SELECT_WITHOUT_BAR) {
99 if (label->string_utf8->style & TTF_STYLE_UNDERLINE) {
100 label->string_utf8->style &= ~TTF_STYLE_UNDERLINE;
101 } else {
102 label->string_utf8->style &= ~TTF_STYLE_BOLD;
103 }
104 label->string_utf8->fgcol = backup_color;
105 } else {
106 if (label->string_utf8->render == 3) {
107 label->string_utf8->bgcol = backup_color;
108 }
109 }
110 }
111
112 return ret;
113}
114
115/**********************************************************************/
118 void remake_label_size(struct widget *label)
119{
120 SDL_Surface *icon = label->theme;
121 utf8_str *text = label->string_utf8;
122 Uint32 flags = get_wflags(label);
123 SDL_Rect buf = { 0, 0, 0, 0 };
124 Uint16 w = 0, h = 0, space;
125
126 if (flags & WF_DRAW_TEXT_LABEL_WITH_SPACE) {
127 space = adj_size(10);
128 } else {
129 space = 0;
130 }
131
132 if (text != NULL) {
133 bool without_box = ((get_wflags(label) & WF_SELECT_WITHOUT_BAR) == WF_SELECT_WITHOUT_BAR);
134 bool bold = TRUE;
135
136 if (without_box) {
137 bold = ((text->style & TTF_STYLE_BOLD) == TTF_STYLE_BOLD);
138 text->style |= TTF_STYLE_BOLD;
139 }
140
141 utf8_str_size(text, &buf);
142
143 if (without_box && !bold) {
144 text->style &= ~TTF_STYLE_BOLD;
145 }
146
147 w = MAX(w, buf.w + space);
148 h = MAX(h, buf.h);
149 }
150
151 if (icon) {
152 if (text != NULL) {
153 if ((flags & WF_ICON_UNDER_TEXT) || (flags & WF_ICON_ABOVE_TEXT)) {
154 w = MAX(w, icon->w + space);
155 h = MAX(h, buf.h + icon->h + adj_size(3));
156 } else {
157 if (flags & WF_ICON_CENTER) {
158 w = MAX(w, icon->w + space);
159 h = MAX(h, icon->h);
160 } else {
161 w = MAX(w, buf.w + icon->w + adj_size(5) + space);
162 h = MAX(h, icon->h);
163 }
164 }
165 /* text */
166 } else {
167 w = MAX(w, icon->w + space);
168 h = MAX(h, icon->h);
169 }
170 }
171
172 /* icon */
173 label->size.w = w;
174 label->size.h = h;
175}
176
177/**********************************************************************/
180 struct widget *create_themelabel(SDL_Surface *icon, struct gui_layer *pdest,
181 utf8_str *pstr, Uint16 w, Uint16 h,
182 Uint32 flags)
183{
184 struct widget *label = NULL;
185
186 if (icon == NULL && pstr == NULL) {
187 return NULL;
188 }
189
190 label = widget_new();
191 label->theme = icon;
192 label->string_utf8 = pstr;
193 set_wflag(label,
194 (WF_ICON_CENTER | WF_FREE_STRING | WF_FREE_GFX |
195 WF_RESTORE_BACKGROUND | flags));
196 set_wstate(label, FC_WS_DISABLED);
197 set_wtype(label, WT_T_LABEL);
198 label->mod = KMOD_NONE;
199 label->dst = pdest;
200
201 baseclass_redraw = label->redraw;
202 label->redraw = redraw_label;
203
204 remake_label_size(label);
205
206 label->size.w = MAX(label->size.w, w);
207 label->size.h = MAX(label->size.h, h);
208
209 return label;
210}
211
212/**********************************************************************/
215 struct widget *create_iconlabel(SDL_Surface *icon, struct gui_layer *pdest,
216 utf8_str *pstr, Uint32 flags)
217{
218 struct widget *icon_label = NULL;
219
220 icon_label = widget_new();
221
222 icon_label->theme = icon;
223 icon_label->string_utf8 = pstr;
224 set_wflag(icon_label, WF_FREE_STRING | WF_FREE_GFX | flags);
225 set_wstate(icon_label, FC_WS_DISABLED);
226 set_wtype(icon_label, WT_I_LABEL);
227 icon_label->mod = KMOD_NONE;
228 icon_label->dst = pdest;
229
230 baseclass_redraw = icon_label->redraw;
231 icon_label->redraw = redraw_label;
232
233 remake_label_size(icon_label);
234
235 return icon_label;
236}
237
238/**********************************************************************/
241 struct widget *create_themelabel2(SDL_Surface *icon, struct gui_layer *pdest,
242 utf8_str *pstr, Uint16 w, Uint16 h,
243 Uint32 flags)
244{
245 struct widget *label = NULL;
246 SDL_Surface *ptheme = NULL;
247 SDL_Rect area;
248 SDL_Color store = {0, 0, 0, 0};
249 SDL_Color bg_color = *get_theme_color(COLOR_THEME_THEMELABEL2_BG);
250 Uint32 colorkey;
251
252 if (icon == NULL && pstr == NULL) {
253 return NULL;
254 }
255
256 label = widget_new();
257 label->theme = icon;
258 label->string_utf8 = pstr;
259 set_wflag(label, (WF_FREE_THEME | WF_FREE_STRING | WF_FREE_GFX | flags));
260 set_wstate(label, FC_WS_DISABLED);
261 set_wtype(label, WT_T2_LABEL);
262 label->mod = KMOD_NONE;
263 baseclass_redraw = label->redraw;
264 label->redraw = redraw_label;
265
266 remake_label_size(label);
267
268 label->size.w = MAX(label->size.w, w);
269 label->size.h = MAX(label->size.h, h);
270
271 ptheme = create_surf(label->size.w, label->size.h * 2, SDL_SWSURFACE);
272
273 colorkey = SDL_MapRGBA(ptheme->format, pstr->bgcol.r,
274 pstr->bgcol.g, pstr->bgcol.b, pstr->bgcol.a);
275 SDL_FillRect(ptheme, NULL, colorkey);
276
277 label->size.x = 0;
278 label->size.y = 0;
279 area = label->size;
280 label->dst = gui_layer_new(0, 0, ptheme);
281
282 /* normal */
283 redraw_iconlabel(label);
284
285 /* selected */
286 area.x = 0;
287 area.y = label->size.h;
288
289 if (flags & WF_RESTORE_BACKGROUND) {
290 SDL_FillRect(ptheme, &area, map_rgba(ptheme->format, bg_color));
291 store = pstr->bgcol;
292 SDL_GetRGBA(getpixel(ptheme, area.x , area.y), ptheme->format,
293 &pstr->bgcol.r, &pstr->bgcol.g,
294 &pstr->bgcol.b, &pstr->bgcol.a);
295 } else {
296 fill_rect_alpha(ptheme, &area, &bg_color);
297 }
298
299 label->size.y = label->size.h;
300 redraw_iconlabel(label);
301
302 if (flags & WF_RESTORE_BACKGROUND) {
303 pstr->bgcol = store;
304 }
305
306 label->size.x = 0;
307 label->size.y = 0;
308 if (flags & WF_FREE_THEME) {
309 FREESURFACE(label->theme);
310 }
311 label->theme = ptheme;
312 FC_FREE(label->dst);
313 label->dst = pdest;
314
315 return label;
316}
317
318/**********************************************************************/
321 struct widget *convert_iconlabel_to_themeiconlabel2(struct widget *icon_label)
322{
323 SDL_Rect start, area;
324 SDL_Color store = {0, 0, 0, 0};
325 SDL_Color bg_color = *get_theme_color(COLOR_THEME_THEMELABEL2_BG);
326 Uint32 colorkey, flags = get_wflags(icon_label);
327 SDL_Surface *pdest;
328 SDL_Surface *ptheme = create_surf(icon_label->size.w,
329 icon_label->size.h * 2, SDL_SWSURFACE);
330
331 colorkey = SDL_MapRGBA(ptheme->format,
332 icon_label->string_utf8->bgcol.r,
333 icon_label->string_utf8->bgcol.g,
334 icon_label->string_utf8->bgcol.b,
335 icon_label->string_utf8->bgcol.a);
336 SDL_FillRect(ptheme, NULL, colorkey);
337
338 start = icon_label->size;
339 icon_label->size.x = 0;
340 icon_label->size.y = 0;
341 area = start;
342 pdest = icon_label->dst->surface;
343 icon_label->dst->surface = ptheme;
344
345 /* normal */
346 redraw_iconlabel(icon_label);
347
348 /* selected */
349 area.x = 0;
350 area.y = icon_label->size.h;
351
352 if (flags & WF_RESTORE_BACKGROUND) {
353 SDL_FillRect(ptheme, &area, map_rgba(ptheme->format, bg_color));
354 store = icon_label->string_utf8->bgcol;
355 SDL_GetRGBA(getpixel(ptheme, area.x , area.y), ptheme->format,
356 &icon_label->string_utf8->bgcol.r,
357 &icon_label->string_utf8->bgcol.g,
358 &icon_label->string_utf8->bgcol.b,
359 &icon_label->string_utf8->bgcol.a);
360 } else {
361 fill_rect_alpha(ptheme, &area, &bg_color);
362 }
363
364 icon_label->size.y = icon_label->size.h;
365 redraw_iconlabel(icon_label);
366
367 if (flags & WF_RESTORE_BACKGROUND) {
368 icon_label->string_utf8->bgcol = store;
369 }
370
371 icon_label->size = start;
372 if (flags & WF_FREE_THEME) {
373 FREESURFACE(icon_label->theme);
374 }
375 icon_label->theme = ptheme;
376 if (flags & WF_FREE_STRING) {
377 FREEUTF8STR(icon_label->string_utf8);
378 }
379 icon_label->dst->surface = pdest;
380 set_wtype(icon_label, WT_T2_LABEL);
381
382 icon_label->redraw = redraw_label;
383
384 return icon_label;
385}
386
387#if 0
388/**********************************************************************/
391static int redraw_themelabel(struct widget *label)
392{
393 int ret;
394 Sint16 x, y;
395 SDL_Surface *text = NULL;
396
397 if (!label) {
398 return -3;
399 }
400
401 if ((text = create_text_surf_from_utf8(label->string_utf8)) == NULL) {
402 return (-4);
403 }
404
405 if (label->string_utf8->style & SF_CENTER) {
406 x = (label->size.w - text->w) / 2;
407 } else {
408 if (label->string_utf8->style & SF_CENTER_RIGHT) {
409 x = label->size.w - text->w - adj_size(5);
410 } else {
411 x = adj_size(5);
412 }
413 }
414
415 y = (label->size.h - text->h) / 2;
416
417 /* redraw theme */
418 if (label->theme) {
419 ret = blit_entire_src(label->theme, label->dst->surface, label->size.x, label->size.y);
420 if (ret) {
421 return ret;
422 }
423 }
424
425 ret = blit_entire_src(text, label->dst->surface, label->size.x + x, label->size.y + y);
426
427 FREESURFACE(text);
428
429 return ret;
430}
431#endif /* 0 */
432
433/**********************************************************************/
436 int redraw_iconlabel(struct widget *label)
437{
438 int space, ret = 0; /* FIXME: possibly uninitialized */
439 Sint16 x, xI, yI;
440 Sint16 y = 0; /* FIXME: possibly uninitialized */
441 SDL_Surface *text;
442 SDL_Rect dst;
443 Uint32 flags;
444
445 if (!label) {
446 return -3;
447 }
448
449 SDL_SetClipRect(label->dst->surface, &label->size);
450
451 flags = get_wflags(label);
452
453 if (flags & WF_DRAW_TEXT_LABEL_WITH_SPACE) {
454 space = adj_size(5);
455 } else {
456 space = 0;
457 }
458
459 text = create_text_surf_from_utf8(label->string_utf8);
460
461 if (label->theme) { /* Icon */
462 if (text) {
463 if (flags & WF_ICON_CENTER_RIGHT) {
464 xI = label->size.w - label->theme->w - space;
465 } else {
466 if (flags & WF_ICON_CENTER) {
467 xI = (label->size.w - label->theme->w) / 2;
468 } else {
469 xI = space;
470 }
471 }
472
473 if (flags & WF_ICON_ABOVE_TEXT) {
474 yI = 0;
475 y = label->theme->h + adj_size(3)
476 + (label->size.h - (label->theme->h + adj_size(3)) - text->h) / 2;
477 } else {
478 if (flags & WF_ICON_UNDER_TEXT) {
479 y = (label->size.h - (label->theme->h + adj_size(3)) - text->h) / 2;
480 yI = y + text->h + adj_size(3);
481 } else {
482 yI = (label->size.h - label->theme->h) / 2;
483 y = (label->size.h - text->h) / 2;
484 }
485 }
486 /* text */
487 } else {
488#if 0
489 yI = (label->size.h - label->theme->h) / 2;
490 xI = (label->size.w - label->theme->w) / 2;
491#endif /* 0 */
492 yI = 0;
493 xI = space;
494 }
495
496 dst.x = label->size.x + xI;
497 dst.y = label->size.y + yI;
498
499 ret = alphablit(label->theme, NULL, label->dst->surface, &dst, 255);
500
501 if (ret) {
502 return ret - 10;
503 }
504 }
505
506 if (text) {
507 if (label->theme) { /* Icon */
508 if (!(flags & WF_ICON_ABOVE_TEXT) && !(flags & WF_ICON_UNDER_TEXT)) {
509 if (flags & WF_ICON_CENTER_RIGHT) {
510 if (label->string_utf8->style & SF_CENTER) {
511 x = (label->size.w - (label->theme->w + 5 + space) -
512 text->w) / 2;
513 } else {
514 if (label->string_utf8->style & SF_CENTER_RIGHT) {
515 x = label->size.w - (label->theme->w + 5 + space) - text->w;
516 } else {
517 x = space;
518 }
519 }
520 /* WF_ICON_CENTER_RIGHT */
521 } else {
522 if (flags & WF_ICON_CENTER) {
523 /* text is blit on icon */
524 goto alone;
525 } else { /* WF_ICON_CENTER_LEFT */
526 if (label->string_utf8->style & SF_CENTER) {
527 x = space + label->theme->w + adj_size(5) + ((label->size.w -
528 (space +
529 label->theme->w + adj_size(5)) -
530 text->w) / 2);
531 } else {
532 if (label->string_utf8->style & SF_CENTER_RIGHT) {
533 x = label->size.w - text->w - space;
534 } else {
535 x = space + label->theme->w + adj_size(5);
536 }
537 }
538 } /* WF_ICON_CENTER_LEFT */
539 }
540 /* !WF_ICON_ABOVE_TEXT && !WF_ICON_UNDER_TEXT */
541 } else {
542 goto alone;
543 }
544 /* label->theme == Icon */
545 } else {
546 y = (label->size.h - text->h) / 2;
547
548 alone:
549 if (label->string_utf8->style & SF_CENTER) {
550 x = (label->size.w - text->w) / 2;
551 } else {
552 if (label->string_utf8->style & SF_CENTER_RIGHT) {
553 x = label->size.w - text->w - space;
554 } else {
555 x = space;
556 }
557 }
558 }
559
560 dst.x = label->size.x + x;
561 dst.y = label->size.y + y;
562
563 ret = alphablit(text, NULL, label->dst->surface, &dst, 255);
564 FREESURFACE(text);
565 }
566
567 SDL_SetClipRect(label->dst->surface, NULL);
568
569 return ret;
570}
571
572/**********************************************************************/
575 int draw_label(struct widget *label, Sint16 start_x, Sint16 start_y)
576{
577 label->size.x = start_x;
578 label->size.y = start_y;
579
580 return redraw_label(label);
581}
bold
static QString bold(QString text)
Definition citydlg.cpp:3853
incite_cost
char * incite_cost
Definition comments.c:74
get_theme_color
SDL_Color * get_theme_color(enum theme_color themecolor)
Definition colors.c:47
getpixel
Uint32 getpixel(SDL_Surface *surf, Sint16 x, Sint16 y)
Definition graphics.c:430
fill_rect_alpha
int fill_rect_alpha(SDL_Surface *surf, SDL_Rect *prect, SDL_Color *pcolor)
Definition graphics.c:865
gui_layer_new
struct gui_layer * gui_layer_new(int x, int y, SDL_Surface *surface)
Definition graphics.c:66
alphablit
int alphablit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect, unsigned char alpha_mod)
Definition graphics.c:199
blit_entire_src
int blit_entire_src(SDL_Surface *psrc, SDL_Surface *pdest, Sint16 dest_x, Sint16 dest_y)
Definition graphics.c:417
create_surf
SDL_Surface * create_surf(int width, int height, Uint32 flags)
Definition graphics.c:351
FREESURFACE
#define FREESURFACE(ptr)
Definition graphics.h:322
map_rgba
#define map_rgba(format, color)
Definition graphics.h:315
adj_size
#define adj_size(size)
Definition gui_main.h:141
utf8_str_size
void utf8_str_size(utf8_str *pstr, SDL_Rect *fill)
Definition gui_string.c:106
create_text_surf_from_utf8
SDL_Surface * create_text_surf_from_utf8(utf8_str *pstr)
Definition gui_string.c:425
FREEUTF8STR
#define FREEUTF8STR(pstr)
Definition gui_string.h:93
SF_CENTER
#define SF_CENTER
Definition gui_string.h:40
SF_CENTER_RIGHT
#define SF_CENTER_RIGHT
Definition gui_string.h:41
COLOR_THEME_LABEL_BAR
@ COLOR_THEME_LABEL_BAR
Definition themecolors.h:33
COLOR_THEME_THEMELABEL2_BG
@ COLOR_THEME_THEMELABEL2_BG
Definition themecolors.h:39
FC_WS_DISABLED
@ FC_WS_DISABLED
Definition widget.h:99
FC_WS_SELECTED
@ FC_WS_SELECTED
Definition widget.h:97
get_wflags
enum widget_flag get_wflags(const struct widget *pwidget)
Definition widget_core.c:86
set_wstate
void set_wstate(struct widget *pwidget, enum widget_state state)
Definition widget_core.c:36
get_wstate
enum widget_state get_wstate(const struct widget *pwidget)
Definition widget_core.c:70
WF_FREE_GFX
@ WF_FREE_GFX
Definition widget.h:70
WF_ICON_CENTER
@ WF_ICON_CENTER
Definition widget.h:83
WF_ICON_ABOVE_TEXT
@ WF_ICON_ABOVE_TEXT
Definition widget.h:81
WF_ICON_CENTER_RIGHT
@ WF_ICON_CENTER_RIGHT
Definition widget.h:84
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_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
set_wtype
void set_wtype(struct widget *pwidget, enum widget_type type)
Definition widget_core.c:45
get_wtype
enum widget_type get_wtype(const struct widget *pwidget)
Definition widget_core.c:78
set_wflag
void set_wflag(struct widget *pwidget, enum widget_flag flag)
Definition widget_core.c:54
WT_T2_LABEL
@ WT_T2_LABEL
Definition widget.h:61
WT_T_LABEL
@ WT_T_LABEL
Definition widget.h:53
WT_I_LABEL
@ WT_I_LABEL
Definition widget.h:54
widget_new
struct widget * widget_new(void)
Definition widget_core.c:252
remake_label_size
void remake_label_size(struct widget *label)
Definition widget_label.c:118
redraw_iconlabel
int redraw_iconlabel(struct widget *label)
Definition widget_label.c:436
convert_iconlabel_to_themeiconlabel2
struct widget * convert_iconlabel_to_themeiconlabel2(struct widget *icon_label)
Definition widget_label.c:321
create_themelabel
struct widget * create_themelabel(SDL_Surface *icon, struct gui_layer *pdest, utf8_str *pstr, Uint16 w, Uint16 h, Uint32 flags)
Definition widget_label.c:180
draw_label
int draw_label(struct widget *label, Sint16 start_x, Sint16 start_y)
Definition widget_label.c:575
baseclass_redraw
static int(* baseclass_redraw)(struct widget *pwidget)
Definition widget_label.c:37
create_themelabel2
struct widget * create_themelabel2(SDL_Surface *icon, struct gui_layer *pdest, utf8_str *pstr, Uint16 w, Uint16 h, Uint32 flags)
Definition widget_label.c:241
create_iconlabel
struct widget * create_iconlabel(SDL_Surface *icon, struct gui_layer *pdest, utf8_str *pstr, Uint32 flags)
Definition widget_label.c:215
redraw_themelabel2
static int redraw_themelabel2(struct widget *label)
Definition widget_label.c:42
redraw_label
static int redraw_label(struct widget *label)
Definition widget_label.c:61
themespec.h
widget.h
widget_p.h
colors.h
graphics.h
log.h
mem.h
FC_FREE
#define FC_FREE(ptr)
Definition mem.h:41
MAX
#define MAX(x, y)
Definition shared.h:54
y
struct sprite int int y
Definition sprite_g.h:31
x
struct sprite int x
Definition sprite_g.h:31
gui_layer
Definition graphics.h:227
gui_layer::surface
SDL_Surface * surface
Definition graphics.h:229
utf8_str
Definition gui_string.h:52
utf8_str::style
Uint8 style
Definition gui_string.h:53
utf8_str::bgcol
SDL_Color bgcol
Definition gui_string.h:58
utf8_str::fgcol
SDL_Color fgcol
Definition gui_string.h:57
utf8_str::render
Uint8 render
Definition gui_string.h:54
widget
Definition widget.h:112
widget::theme
SDL_Surface * theme
Definition widget.h:118
widget::redraw
int(* redraw)(struct widget *pwidget)
Definition widget.h:163
widget::dst
struct gui_layer * dst
Definition widget.h:116
widget::mod
Uint16 mod
Definition widget.h:154
widget::string_utf8
utf8_str * string_utf8
Definition widget.h:121
widget::area
SDL_Rect area
Definition widget.h:149
widget::size
SDL_Rect size
Definition widget.h:145
TRUE
#define TRUE
Definition support.h:46