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

Freeciv-3.1

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