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

Freeciv-3.3

Loading...
Searching...
No Matches
inteldlg.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/* 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 "fcintl.h"
27#include "log.h"
28
29/* common */
30#include "government.h"
31#include "nation.h"
32#include "research.h"
33
34/* client */
35#include "client_main.h"
36#include "spaceshipdlg_g.h"
37
38/* gui-sdl2 */
39#include "graphics.h"
40#include "gui_id.h"
41#include "gui_main.h"
42#include "gui_tilespec.h"
43#include "mapview.h"
44#include "repodlgs.h"
45#include "sprite.h"
46#include "widget.h"
47
48#include "inteldlg.h"
49
50struct intel_dialog {
51 struct player *pplayer;
52 struct advanced_dialog *pdialog;
53 int pos_x, pos_y;
54};
55
56#define SPECLIST_TAG dialog
57#define SPECLIST_TYPE struct intel_dialog
58#include "speclist.h"
59
60#define dialog_list_iterate(dialoglist, pdialog) \
61 TYPED_LIST_ITERATE(struct intel_dialog, dialoglist, pdialog)
62#define dialog_list_iterate_end LIST_ITERATE_END
63
64 static struct dialog_list *dialog_list;
65static struct intel_dialog *create_intel_dialog(struct player *p);
66
67/**********************************************************************/
70 void intel_dialog_init(void)
71{
72 dialog_list = dialog_list_new();
73}
74
75/**********************************************************************/
78 void intel_dialog_done(void)
79{
80 dialog_list_destroy(dialog_list);
81}
82
83/**********************************************************************/
86 static struct intel_dialog *get_intel_dialog(struct player *pplayer)
87{
88 dialog_list_iterate(dialog_list, pdialog) {
89 if (pdialog->pplayer == pplayer) {
90 return pdialog;
91 }
92 } dialog_list_iterate_end;
93
94 return NULL;
95}
96
97/**********************************************************************/
100 static int intel_window_dlg_callback(struct widget *pwindow)
101{
102 if (PRESSED_EVENT(main_data.event)) {
103 struct intel_dialog *selected_dialog = get_intel_dialog(pwindow->data.player);
104
105 move_window_group(selected_dialog->pdialog->begin_widget_list, pwindow);
106 }
107
108 return -1;
109}
110
111/**********************************************************************/
114 static int tech_callback(struct widget *pwidget)
115{
116 /* get tech help - PORT ME */
117 return -1;
118}
119
120/**********************************************************************/
123 static int spaceship_callback(struct widget *pwidget)
124{
125 if (PRESSED_EVENT(main_data.event)) {
126 struct player *pplayer = pwidget->data.player;
127
128 popdown_intel_dialog(pplayer);
129 popup_spaceship_dialog(pplayer);
130 }
131
132 return -1;
133}
134
135/**********************************************************************/
138 static int exit_intel_dlg_callback(struct widget *pwidget)
139{
140 if (PRESSED_EVENT(main_data.event)) {
141 popdown_intel_dialog(pwidget->data.player);
142 flush_dirty();
143 }
144
145 return -1;
146}
147
148/**********************************************************************/
151 void close_intel_dialog(struct player *p)
152{
153 popdown_intel_dialog(p);
154}
155
156/**********************************************************************/
159 static struct intel_dialog *create_intel_dialog(struct player *pplayer)
160{
161 struct intel_dialog *pdialog = fc_calloc(1, sizeof(struct intel_dialog));
162
163 pdialog->pplayer = pplayer;
164
165 pdialog->pdialog = fc_calloc(1, sizeof(struct advanced_dialog));
166
167 pdialog->pos_x = 0;
168 pdialog->pos_y = 0;
169
170 dialog_list_prepend(dialog_list, pdialog);
171
172 return pdialog;
173}
174
175/**********************************************************************/
178 void popup_intel_dialog(struct player *p)
179{
180 struct intel_dialog *pdialog = get_intel_dialog(p);
181
182 if (pdialog == NULL) {
183 create_intel_dialog(p);
184 } else {
185 /* Bring existing dialog to front */
186 select_window_group_dialog(pdialog->pdialog->begin_widget_list,
187 pdialog->pdialog->end_widget_list);
188 }
189
190 update_intel_dialog(p);
191}
192
193/**********************************************************************/
196 void popdown_intel_dialog(struct player *p)
197{
198 struct intel_dialog *pdialog = get_intel_dialog(p);
199
200 if (pdialog) {
201 popdown_window_group_dialog(pdialog->pdialog->begin_widget_list,
202 pdialog->pdialog->end_widget_list);
203
204 dialog_list_remove(dialog_list, pdialog);
205
206 FC_FREE(pdialog->pdialog->scroll);
207 FC_FREE(pdialog->pdialog);
208 FC_FREE(pdialog);
209 }
210}
211
212/**********************************************************************/
215 void popdown_intel_dialogs(void)
216{
217 dialog_list_iterate(dialog_list, pdialog) {
218 popdown_intel_dialog(pdialog->pplayer);
219 } dialog_list_iterate_end;
220}
221
222/**********************************************************************/
226 void update_intel_dialog(struct player *p)
227{
228 const struct research *mresearch, *presearch;
229 struct intel_dialog *pdialog = get_intel_dialog(p);
230 struct widget *pwindow = NULL, *buf = NULL, *last;
231 SDL_Surface *logo = NULL, *tmp_surf = NULL;
232 SDL_Surface *text1, *info, *text2 = NULL, *text3 = NULL;
233 utf8_str *pstr;
234 SDL_Rect dst;
235 char cbuf[2560], plr_buf[4 * MAX_LEN_NAME];
236 int ntech = 0, count = 0, col;
237 int nwonder = 0;
238 struct city *pcapital;
239 SDL_Rect area;
240 struct research *research;
241
242 if (pdialog) {
243 /* save window position and delete old content */
244 if (pdialog->pdialog->end_widget_list) {
245 pdialog->pos_x = pdialog->pdialog->end_widget_list->size.x;
246 pdialog->pos_y = pdialog->pdialog->end_widget_list->size.y;
247
248 popdown_window_group_dialog(pdialog->pdialog->begin_widget_list,
249 pdialog->pdialog->end_widget_list);
250 }
251
252 pstr = create_utf8_from_char_fonto(_("Foreign Intelligence Report"),
253 FONTO_ATTENTION);
254 pstr->style |= TTF_STYLE_BOLD;
255
256 pwindow = create_window_skeleton(NULL, pstr, 0);
257
258 pwindow->action = intel_window_dlg_callback;
259 set_wstate(pwindow , FC_WS_NORMAL);
260 pwindow->data.player = p;
261
262 add_to_gui_list(ID_WINDOW, pwindow);
263 pdialog->pdialog->end_widget_list = pwindow;
264
265 area = pwindow->area;
266
267 /* ---------- */
268 /* Exit button */
269 buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
270 WF_WIDGET_HAS_INFO_LABEL
271 | WF_RESTORE_BACKGROUND);
272 buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"),
273 FONTO_ATTENTION);
274 area.w = MAX(area.w, buf->size.w + adj_size(10));
275 buf->action = exit_intel_dlg_callback;
276 set_wstate(buf, FC_WS_NORMAL);
277 buf->data.player = p;
278 buf->key = SDLK_ESCAPE;
279
280 add_to_gui_list(ID_BUTTON, buf);
281 /* ---------- */
282
283 logo = get_nation_flag_surface(nation_of_player(p));
284
285 {
286 double zoom = DEFAULT_ZOOM * 60.0 / logo->h;
287
288 text1 = zoomSurface(logo, zoom, zoom, 1);
289 }
290
291 logo = text1;
292
293 buf = create_icon2(logo, pwindow->dst,
294 WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL
295 | WF_FREE_THEME);
296 buf->action = spaceship_callback;
297 set_wstate(buf, FC_WS_NORMAL);
298 buf->data.player = p;
299 fc_snprintf(cbuf, sizeof(cbuf),
300 _("Intelligence Information about the %s Spaceship"),
301 nation_adjective_for_player(p));
302 buf->info_label = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION);
303
304 add_to_gui_list(ID_ICON, buf);
305
306 /* ---------- */
307 fc_snprintf(cbuf, sizeof(cbuf),
308 _("Intelligence Information for the %s Empire"),
309 nation_adjective_for_player(p));
310
311 pstr = create_utf8_from_char_fonto(cbuf, FONTO_HEADING);
312 pstr->style |= TTF_STYLE_BOLD;
313 pstr->bgcol = (SDL_Color) {0, 0, 0, 0};
314
315 text1 = create_text_surf_from_utf8(pstr);
316 area.w = MAX(area.w, text1->w + adj_size(20));
317 area.h += text1->h + adj_size(20);
318
319 /* ---------- */
320
321 pcapital = player_primary_capital(p);
322 research = research_get(p);
323 change_fonto_utf8(pstr, FONTO_DEFAULT);
324 pstr->style &= ~TTF_STYLE_BOLD;
325
326 /* FIXME: these should use common gui code, and avoid duplication! */
327 if (client_is_global_observer() || team_has_embassy(client_player()->team, p)) {
328 switch (research->researching) {
329 case A_UNKNOWN:
330 case A_UNSET:
331 fc_snprintf(cbuf, sizeof(cbuf),
332 _("Ruler: %s Government: %s\n"
333 "Capital: %s Gold: %d\n"
334 "Tax: %d%% Science: %d%% Luxury: %d%%\n"
335 "Researching: %s\n"
336 "Culture: %d"),
337 ruler_title_for_player(p, plr_buf, sizeof(plr_buf)),
338 government_name_for_player(p),
339 /* TRANS: "unknown" location */
340 NULL != pcapital ? city_name_get(pcapital) : _("(Unknown)"),
341 p->economic.gold, p->economic.tax,
342 p->economic.science, p->economic.luxury,
343 research->researching == A_UNSET ? _("(none)") : _("(Unknown)"),
344 p->client.culture);
345 break;
346 default:
347 fc_snprintf(cbuf, sizeof(cbuf),
348 _("Ruler: %s Government: %s\n"
349 "Capital: %s Gold: %d\n"
350 "Tax: %d%% Science: %d%% Luxury: %d%%\n"
351 "Researching: %s(%d/%d)\n"
352 "Culture: %d"),
353 ruler_title_for_player(p, plr_buf, sizeof(plr_buf)),
354 government_name_for_player(p),
355 /* TRANS: "unknown" location */
356 NULL != pcapital ? city_name_get(pcapital) : _("(Unknown)"),
357 p->economic.gold, p->economic.tax, p->economic.science,
358 p->economic.luxury,
359 research_advance_name_translation(research,
360 research->researching),
361 research->bulbs_researched,
362 research->client.researching_cost, p->client.culture);
363 break;
364 };
365 } else {
366 fc_snprintf(cbuf, sizeof(cbuf),
367 _("Ruler: %s Government: %s\n"
368 "Capital: %s Gold: %d\n"
369 "Tax rates unknown\n"
370 "Researching: (Unknown)\n"
371 "Culture: (Unknown)"),
372 ruler_title_for_player(p, plr_buf, sizeof(plr_buf)),
373 government_name_for_player(p),
374 /* TRANS: "unknown" location */
375 NULL != pcapital ? city_name_get(pcapital) : _("(Unknown)"),
376 p->economic.gold);
377 }
378
379 copy_chars_to_utf8_str(pstr, cbuf);
380 info = create_text_surf_from_utf8(pstr);
381 area.w = MAX(area.w, logo->w + adj_size(10) + info->w + adj_size(20));
382
383 /* ---------- */
384 tmp_surf = get_tech_icon(A_FIRST);
385 col = area.w / (tmp_surf->w + adj_size(4));
386 FREESURFACE(tmp_surf);
387 ntech = 0;
388 last = buf;
389 mresearch = research_get(client_player());
390 presearch = research_get(p);
391 advance_index_iterate(A_FIRST, i) {
392 if (TECH_KNOWN == research_invention_state(presearch, i)
393 && research_invention_reachable(mresearch, i)
394 && TECH_KNOWN != research_invention_state(mresearch, i)) {
395
396 buf = create_icon2(get_tech_icon(i), pwindow->dst,
397 WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL
398 | WF_FREE_THEME);
399 buf->action = tech_callback;
400 set_wstate(buf, FC_WS_NORMAL);
401
402 buf->info_label
403 = create_utf8_from_char_fonto(advance_name_translation
404 (advance_by_number(i)),
405 FONTO_ATTENTION);
406
407 add_to_gui_list(ID_ICON, buf);
408
409 if (ntech > ((2 * col) - 1)) {
410 set_wflag(buf, WF_HIDDEN);
411 }
412
413 ntech++;
414 }
415 } advance_index_iterate_end;
416
417 pdialog->pdialog->begin_widget_list = buf;
418
419 if (ntech > 0) {
420 pdialog->pdialog->end_active_widget_list = last->prev;
421 pdialog->pdialog->begin_active_widget_list = pdialog->pdialog->begin_widget_list;
422 if (ntech > 2 * col) {
423 pdialog->pdialog->active_widget_list = pdialog->pdialog->end_active_widget_list;
424 count = create_vertical_scrollbar(pdialog->pdialog, col, 2, TRUE, TRUE);
425 area.h += (2 * buf->size.h + adj_size(10));
426 } else {
427 count = 0;
428 if (ntech > col) {
429 area.h += buf->size.h;
430 }
431 area.h += (adj_size(10) + buf->size.h);
432 }
433
434 area.w = MAX(area.w, col * buf->size.w + count);
435
436 fc_snprintf(cbuf, sizeof(cbuf), _("Their techs that we don't have :"));
437 copy_chars_to_utf8_str(pstr, cbuf);
438 pstr->style |= TTF_STYLE_BOLD;
439 text2 = create_text_surf_from_utf8(pstr);
440 }
441
442 nwonder = 0;
443 cbuf[0] = '\0';
444 improvement_iterate(impr) {
445 if (is_wonder(impr)) {
446 const char *cityname;
447 const char *notes = NULL;
448
449 if (wonder_is_built(p, impr)) {
450 struct city *wcity = city_from_wonder(p, impr);
451
452 if (wcity != NULL) {
453 cityname = city_name_get(wcity);
454 } else {
455 cityname = _("(unknown city)");
456 }
457 if (improvement_obsolete(p, impr, NULL)) {
458 notes = _(" (obsolete)");
459 }
460 } else if (wonder_is_lost(p, impr)) {
461 cityname = _("(lost)");
462 } else {
463 continue;
464 }
465
466 cat_snprintf(cbuf, sizeof(cbuf), "%s: %s%s\n",
467 improvement_name_translation(impr), cityname,
468 notes != NULL ? notes : "");
469
470 nwonder++;
471 }
472 } improvement_iterate_end;
473
474 if (nwonder > 0) {
475 copy_chars_to_utf8_str(pstr, cbuf);
476 text3 = create_text_surf_from_utf8(pstr);
477 area.h += MAX(logo->h + adj_size(20), info->h + text3->h + adj_size(20));
478 } else {
479 area.h += MAX(logo->h + adj_size(20), info->h + adj_size(20));
480 }
481
482 FREEUTF8STR(pstr);
483
484 resize_window(pwindow, NULL, NULL,
485 (pwindow->size.w - pwindow->area.w) + area.w,
486 (pwindow->size.h - pwindow->area.h) + area.h);
487
488 area = pwindow->area;
489
490 /* ------------------------ */
491 widget_set_position(pwindow,
492 (pdialog->pos_x) ? (pdialog->pos_x) : ((main_window_width() - pwindow->size.w) / 2),
493 (pdialog->pos_y) ? (pdialog->pos_y) : ((main_window_height() - pwindow->size.h) / 2));
494
495 /* exit button */
496 buf = pwindow->prev;
497 buf->size.x = area.x + area.w - buf->size.w - 1;
498 buf->size.y = pwindow->size.y + adj_size(2);
499
500 dst.x = area.x + (area.w - text1->w) / 2;
501 dst.y = area.y + adj_size(8);
502
503 alphablit(text1, NULL, pwindow->theme, &dst, 255);
504 dst.y += text1->h + adj_size(10);
505 FREESURFACE(text1);
506
507 /* spaceship button */
508 buf = buf->prev;
509 dst.x = area.x + (area.w - (buf->size.w + adj_size(10) + info->w)) / 2;
510 buf->size.x = dst.x;
511 buf->size.y = dst.y;
512
513 dst.x += buf->size.w + adj_size(10);
514 alphablit(info, NULL, pwindow->theme, &dst, 255);
515 dst.y += info->h + adj_size(10);
516 FREESURFACE(info);
517
518 /* --------------------- */
519
520 if (ntech > 0) {
521 dst.x = area.x + adj_size(5);
522 alphablit(text2, NULL, pwindow->theme, &dst, 255);
523 dst.y += text2->h + adj_size(2);
524 FREESURFACE(text2);
525 }
526
527 if (nwonder > 0) {
528 dst.x = area.x + adj_size(5);
529 alphablit(text3, NULL, pwindow->theme, &dst, 255);
530 dst.y += text3->h + adj_size(2);
531 FREESURFACE(text3);
532 }
533
534 if (ntech > 0 || nwonder > 0) {
535 setup_vertical_widgets_position(col, area.x, dst.y, 0, 0,
536 pdialog->pdialog->begin_active_widget_list,
537 pdialog->pdialog->end_active_widget_list);
538
539 if (pdialog->pdialog->scroll) {
540 setup_vertical_scrollbar_area(pdialog->pdialog->scroll,
541 area.x + area.w, dst.y,
542 area.h - (dst.y + 1), TRUE);
543 }
544 }
545
546 redraw_group(pdialog->pdialog->begin_widget_list, pdialog->pdialog->end_widget_list, 0);
547 widget_mark_dirty(pwindow);
548
549 flush_dirty();
550 }
551}
city_name_get
const char * city_name_get(const struct city *pcity)
Definition city.c:1133
client_is_global_observer
bool client_is_global_observer(void)
Definition client_main.c:1353
client_main.h
client_player
#define client_player()
Definition client_main.h:106
incite_cost
char * incite_cost
Definition comments.c:74
current_theme
QString current_theme
Definition fc_client.cpp:64
MAX_LEN_NAME
#define MAX_LEN_NAME
Definition fc_types.h:66
fcintl.h
_
#define _(String)
Definition fcintl.h:67
ruler_title_for_player
const char * ruler_title_for_player(const struct player *pplayer, char *buf, size_t buf_len)
Definition government.c:391
government_name_for_player
const char * government_name_for_player(const struct player *pplayer)
Definition government.c:154
government.h
popup_intel_dialog
void popup_intel_dialog(struct player *p)
Definition inteldlg.c:167
get_intel_dialog
static struct intel_dialog * get_intel_dialog(struct player *pplayer)
Definition inteldlg.c:138
close_intel_dialog
void close_intel_dialog(struct player *p)
Definition inteldlg.c:223
dialog_list_iterate_end
#define dialog_list_iterate_end
Definition inteldlg.c:93
dialog_list_iterate
#define dialog_list_iterate(dialoglist, pdialog)
Definition inteldlg.c:91
intel_dialog_done
void intel_dialog_done(void)
Definition inteldlg.c:128
dialog_list
static struct dialog_list * dialog_list
Definition inteldlg.c:111
intel_dialog_init
void intel_dialog_init(void)
Definition inteldlg.c:119
create_intel_dialog
static struct intel_dialog * create_intel_dialog(struct player *p)
Definition inteldlg.c:244
update_intel_dialog
void update_intel_dialog(struct player *p)
Definition inteldlg.c:462
flush_dirty
void flush_dirty(void)
Definition mapview.c:468
popup_spaceship_dialog
void popup_spaceship_dialog(struct player *pplayer)
Definition spaceshipdlg.c:146
main_window_width
int main_window_width(void)
Definition graphics.c:685
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
DEFAULT_ZOOM
#define DEFAULT_ZOOM
Definition graphics.h:198
FREESURFACE
#define FREESURFACE(ptr)
Definition graphics.h:322
ID_BUTTON
@ ID_BUTTON
Definition gui_id.h:29
ID_ICON
@ ID_ICON
Definition gui_id.h:33
ID_WINDOW
@ ID_WINDOW
Definition gui_id.h:30
adj_size
#define adj_size(size)
Definition gui_main.h:141
PRESSED_EVENT
#define PRESSED_EVENT(event)
Definition gui_main.h:71
copy_chars_to_utf8_str
utf8_str * copy_chars_to_utf8_str(utf8_str *pstr, const char *pchars)
Definition gui_string.c:251
create_text_surf_from_utf8
SDL_Surface * create_text_surf_from_utf8(utf8_str *pstr)
Definition gui_string.c:425
change_fonto_utf8
void change_fonto_utf8(utf8_str *pstr, enum font_origin origin)
Definition gui_string.c:584
FREEUTF8STR
#define FREEUTF8STR(pstr)
Definition gui_string.h:93
FONTO_HEADING
@ FONTO_HEADING
Definition gui_string.h:69
FONTO_DEFAULT
@ FONTO_DEFAULT
Definition gui_string.h:65
FONTO_ATTENTION
@ FONTO_ATTENTION
Definition gui_string.h:67
create_utf8_from_char_fonto
#define create_utf8_from_char_fonto(string_in, fonto)
Definition gui_string.h:108
get_tech_icon
SDL_Surface * get_tech_icon(Tech_type_id tech)
Definition gui_tilespec.c:429
get_nation_flag_surface
static SDL_Surface * get_nation_flag_surface(const struct nation_type *pnation)
Definition gui_tilespec.h:227
popdown_intel_dialog
void popdown_intel_dialog(struct player *p)
Definition inteldlg.c:196
intel_window_dlg_callback
static int intel_window_dlg_callback(struct widget *pwindow)
Definition inteldlg.c:100
popdown_intel_dialogs
void popdown_intel_dialogs(void)
Definition inteldlg.c:215
tech_callback
static int tech_callback(struct widget *pwidget)
Definition inteldlg.c:114
spaceship_callback
static int spaceship_callback(struct widget *pwidget)
Definition inteldlg.c:123
exit_intel_dlg_callback
static int exit_intel_dlg_callback(struct widget *pwidget)
Definition inteldlg.c:138
add_to_gui_list
void add_to_gui_list(Uint16 id, struct widget *gui)
Definition widget.c:586
select_window_group_dialog
bool select_window_group_dialog(struct widget *begin_widget_list, struct widget *pwindow)
Definition widget.c:998
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
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
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
move_window_group
void move_window_group(struct widget *begin_widget_list, struct widget *pwindow)
Definition widget.c:1039
widget_set_position
static void widget_set_position(struct widget *pwidget, int x, int y)
Definition widget.h:266
FC_WS_NORMAL
@ FC_WS_NORMAL
Definition widget.h:96
widget_mark_dirty
static void widget_mark_dirty(struct widget *pwidget)
Definition widget.h:286
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
set_wflag
void set_wflag(struct widget *pwidget, enum widget_flag flag)
Definition widget_core.c:54
create_themeicon
struct widget * create_themeicon(SDL_Surface *icon_theme, struct gui_layer *pdest, Uint32 flags)
Definition widget_icon.c:212
create_icon2
struct widget * create_icon2(SDL_Surface *icon, struct gui_layer *pdest, Uint32 flags)
Definition widget_icon.c:337
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:567
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:486
resize_window
bool 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
gui_id.h
gui_tilespec.h
widget.h
graphics.h
gui_main.h
inteldlg.h
mapview.h
repodlgs.h
sprite.h
wonder_is_lost
bool wonder_is_lost(const struct player *pplayer, const struct impr_type *pimprove)
Definition improvement.c:863
wonder_is_built
bool wonder_is_built(const struct player *pplayer, const struct impr_type *pimprove)
Definition improvement.c:876
city_from_wonder
struct city * city_from_wonder(const struct player *pplayer, const struct impr_type *pimprove)
Definition improvement.c:891
is_wonder
bool is_wonder(const struct impr_type *pimprove)
Definition improvement.c:343
improvement_obsolete
bool improvement_obsolete(const struct player *pplayer, const struct impr_type *pimprove, const struct city *pcity)
Definition improvement.c:411
improvement_name_translation
const char * improvement_name_translation(const struct impr_type *pimprove)
Definition improvement.c:243
improvement_iterate_end
#define improvement_iterate_end
Definition improvement.h:205
improvement_iterate
#define improvement_iterate(_p)
Definition improvement.h:199
log.h
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:169
nation_of_player
struct nation_type * nation_of_player(const struct player *pplayer)
Definition nation.c:444
nation.h
team_has_embassy
bool team_has_embassy(const struct team *pteam, const struct player *tgt_player)
Definition player.c:220
player_primary_capital
struct city * player_primary_capital(const struct player *pplayer)
Definition player.c:1337
research_invention_reachable
bool research_invention_reachable(const struct research *presearch, const Tech_type_id tech)
Definition research.c:668
research_advance_name_translation
const char * research_advance_name_translation(const struct research *presearch, Tech_type_id tech)
Definition research.c:273
research_get
struct research * research_get(const struct player *pplayer)
Definition research.c:128
research_invention_state
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
Definition research.c:619
research.h
MAX
#define MAX(x, y)
Definition shared.h:54
spaceshipdlg_g.h
speclist.h
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
city
Definition city.h:320
intel_dialog
Definition inteldlg.c:78
intel_dialog::pos_x
int pos_x
Definition inteldlg.c:53
intel_dialog::pdialog
struct advanced_dialog * pdialog
Definition inteldlg.c:52
intel_dialog::pos_y
int pos_y
Definition inteldlg.c:53
intel_dialog::pplayer
struct player * pplayer
Definition inteldlg.c:79
player_economic::luxury
int luxury
Definition player.h:66
player_economic::science
int science
Definition player.h:65
player_economic::tax
int tax
Definition player.h:64
player_economic::gold
int gold
Definition player.h:63
player
Definition player.h:249
player::client
struct player::@70::@73 client
player::economic
struct player_economic economic
Definition player.h:284
player::culture
int culture
Definition player.h:367
research
Definition research.h:39
research::researching
Tech_type_id researching
Definition research.h:52
research::client
struct research::@76::@78 client
research::researching_cost
int researching_cost
Definition research.h:96
research::bulbs_researched
int bulbs_researched
Definition research.h:53
sdl2_data::event
SDL_Event event
Definition graphics.h:217
team
Definition team.c:40
utf8_str
Definition gui_string.h:52
widget
Definition widget.h:112
widget::theme
SDL_Surface * theme
Definition widget.h:118
widget::player
struct player * player
Definition widget.h:130
widget::prev
struct widget * prev
Definition widget.h:114
widget::dst
struct gui_layer * dst
Definition widget.h:116
widget::action
int(* action)(struct widget *)
Definition widget.h:157
widget::area
SDL_Rect area
Definition widget.h:149
widget::size
SDL_Rect size
Definition widget.h:145
widget::data
union widget::@217 data
fc_snprintf
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:960
cat_snprintf
int cat_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:986
TRUE
#define TRUE
Definition support.h:46
advance_by_number
struct advance * advance_by_number(const Tech_type_id atype)
Definition tech.c:107
advance_name_translation
const char * advance_name_translation(const struct advance *padvance)
Definition tech.c:300
advance_index_iterate_end
#define advance_index_iterate_end
Definition tech.h:249
A_FIRST
#define A_FIRST
Definition tech.h:44
A_UNSET
#define A_UNSET
Definition tech.h:48
A_UNKNOWN
#define A_UNKNOWN
Definition tech.h:49
advance_index_iterate
#define advance_index_iterate(_start, _index)
Definition tech.h:245