Freeciv-3.2
Loading...
Searching...
No Matches
cityrep.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/* SDL3 */
19#include <SDL3/SDL.h>
20
21/* utility */
22#include "fcintl.h"
23#include "log.h"
24
25/* common */
26#include "game.h"
27
28/* client */
29#include "client_main.h"
30
31/* gui-sdl3 */
32#include "citydlg.h"
33#include "cma_fe.h"
34#include "colors.h"
35#include "graphics.h"
36#include "gui_id.h"
37#include "gui_main.h"
38#include "gui_tilespec.h"
39#include "mapctrl.h"
40#include "mapview.h"
41#include "repodlgs.h"
42#include "sprite.h"
43#include "themespec.h"
44#include "widget.h"
45#include "wldlg.h"
46
47#include "cityrep.h"
48
49static struct advanced_dialog *city_rep = NULL;
50
52
53/* ==================================================================== */
54
55/**********************************************************************/
70
71/**********************************************************************/
74static int city_report_windows_callback(struct widget *pwindow)
75{
78 }
79
80 return -1;
81}
82
83/**********************************************************************/
86static int exit_city_report_callback(struct widget *pwidget)
87{
90 }
91
92 return -1;
93}
94
95/**********************************************************************/
99{
101 popup_city_dialog(pwidget->data.city);
102 }
103
104 return -1;
105}
106
107/**********************************************************************/
111{
114 }
115
116 return -1;
117}
118
119/**********************************************************************/
123{
126 }
127
128 return -1;
129}
130
131/**********************************************************************/
135{
137 struct city *pcity = game_city_by_number(MAX_ID - pwidget->id);
138
139 /* state is changed before enter this function */
140 if (!get_checkbox_state(pwidget)) {
141 cma_release_city(pcity);
143 } else {
145 }
146 }
147
148 return -1;
149}
150
151#if 0
152/**********************************************************************/
155static int info_city_report_callback(struct widget *pwidget)
156{
158 set_wstate(pwidget, FC_WS_NORMAL);
160 widget_redraw(pwidget);
161 widget_mark_dirty(pwidget);
163 }
164
165 return -1;
166}
167#endif /* 0 */
168
169#define COL 17
170
171/**********************************************************************/
175{
176 SDL_Color bg_color = {255, 255, 255, 136};
177
178 struct widget *pbuf = NULL;
179 struct widget *pwindow, *last;
180 utf8_str *pstr;
181 SDL_Surface *text1, *text2, *text3, *units_icon, *cma_icon, *text4;
183 int togrow, w = 0 , count, ww = 0, hh = 0, name_w = 0, prod_w = 0, h;
184 char cbuf[128];
185 const char *name;
188
189 if (city_rep) {
192 } else {
193 city_rep = fc_calloc(1, sizeof(struct advanced_dialog));
194 }
195
196 fc_snprintf(cbuf, sizeof(cbuf), _("size"));
198 pstr->style |= SF_CENTER;
200
201 fc_snprintf(cbuf, sizeof(cbuf), _("time\nto grow"));
204
205 fc_snprintf(cbuf, sizeof(cbuf), _("City Name"));
208 name_w = text3->w + adj_size(6);
209
210 fc_snprintf(cbuf, sizeof(cbuf), _("Production"));
214 prod_w = text4->w;
216
217 units_icon = create_icon_from_theme(current_theme->units_icon, 0);
218 cma_icon = create_icon_from_theme(current_theme->cma_icon, 0);
219
220 /* --------------- */
222 pstr->style |= TTF_STYLE_BOLD;
223
224 pwindow = create_window_skeleton(NULL, pstr, 0);
225 city_rep->end_widget_list = pwindow;
226 set_wstate(pwindow, FC_WS_NORMAL);
228
229 add_to_gui_list(ID_WINDOW, pwindow);
230
231 area = pwindow->area;
232
233 /* ------------------------- */
234 /* Exit button */
235 pbuf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
237 pbuf->info_label = create_utf8_from_char_fonto(_("Close Dialog"),
241 pbuf->key = SDLK_ESCAPE;
242
244
245/* FIXME: Not implemented yet */
246#if 0
247 /* ------------------------- */
248 pbuf = create_themeicon(current_theme->info_icon, pwindow->dst,
250 pbuf->info_label = create_utf8_from_char_fonto(_("Information Report"),
252/*
253 pbuf->action = info_city_report_callback;
254 set_wstate(pbuf, FC_WS_NORMAL);
255*/
257 /* -------- */
258 pbuf = create_themeicon(current_theme->happy_icon, pwindow->dst,
260 pbuf->info_label = create_utf8_from_char_fonto(_("Happiness Report"),
262/*
263 pbuf->action = happy_city_report_callback;
264 set_wstate(pbuf, FC_WS_NORMAL);
265*/
267 /* -------- */
268 pbuf = create_themeicon(current_theme->army_icon, pwindow->dst,
270
271 pbuf->info_label = create_utf8_from_char_fonto(_("Garrison Report"),
273/*
274 pbuf->action = army_city_dlg_callback;
275 set_wstate(pbuf, FC_WS_NORMAL);
276*/
278 /* -------- */
279 pbuf = create_themeicon(current_theme->support_icon, pwindow->dst,
281 pbuf->info_label = create_utf8_from_char_fonto(_("Maintenance Report"),
283/*
284 pbuf->action = supported_unit_city_dlg_callback;
285 set_wstate(pbuf, FC_WS_NORMAL);
286*/
288 /* ------------------------ */
289#endif /* 0 */
290
291 last = pbuf;
292 count = 0;
295 pstr->style |= TTF_STYLE_BOLD;
296 pbuf = create_iconlabel(NULL, pwindow->dst, pstr,
298
299 if (city_unhappy(pcity)) {
300 pbuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_CITYDLG_TRADE);
301 } else {
302 if (city_celebrating(pcity)) {
303 pbuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_CITYDLG_CELEB);
304 } else {
305 if (city_happy(pcity)) {
306 pbuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_CITYDLG_HAPPY);
307 }
308 }
309 }
310
313 pbuf->data.city = pcity;
314 if (count > 13 * COL) {
316 }
317 hh = pbuf->size.h;
318 name_w = MAX(pbuf->size.w, name_w);
319 add_to_gui_list(MAX_ID - pcity->id, pbuf);
320
321 /* ----------- */
322 fc_snprintf(cbuf, sizeof(cbuf), "%d", city_size_get(pcity));
324 pstr->style |= SF_CENTER;
325 pbuf = create_iconlabel(NULL, pwindow->dst, pstr,
327 if (count > 13 * COL) {
329 }
330 hh = MAX(hh, pbuf->size.h);
331 pbuf->size.w = text1->w + adj_size(8);
332 add_to_gui_list(MAX_ID - pcity->id, pbuf);
333
334 /* ----------- */
335 pbuf = create_checkbox(pwindow->dst,
338 if (count > 13 * COL) {
340 }
341 hh = MAX(hh, pbuf->size.h);
342 fc_assert(MAX_ID > pcity->id);
343 add_to_gui_list(MAX_ID - pcity->id, pbuf);
346
347 /* ----------- */
348 fc_snprintf(cbuf, sizeof(cbuf), "%d",
349 pcity->prod[O_FOOD] - pcity->surplus[O_FOOD]);
351 pstr->style |= SF_CENTER;
353 pbuf = create_iconlabel(NULL, pwindow->dst, pstr,
355 if (count > 13 * COL) {
357 }
358 hh = MAX(hh, pbuf->size.h);
359 pbuf->size.w = icons->big_food->w + adj_size(6);
360 add_to_gui_list(MAX_ID - pcity->id, pbuf);
361
362 /* ----------- */
363 fc_snprintf(cbuf, sizeof(cbuf), "%d", pcity->surplus[O_FOOD]);
365 pstr->style |= SF_CENTER;
367 pbuf = create_iconlabel(NULL, pwindow->dst, pstr,
369 if (count > 13 * COL) {
371 }
372 hh = MAX(hh, pbuf->size.h);
373 pbuf->size.w = icons->big_food_corr->w + adj_size(6);
374 add_to_gui_list(MAX_ID - pcity->id, pbuf);
375
376 /* ----------- */
377 togrow = city_turns_to_grow(pcity);
378 switch (togrow) {
379 case 0:
380 fc_snprintf(cbuf, sizeof(cbuf), "#");
381 break;
382 case FC_INFINITY:
383 fc_snprintf(cbuf, sizeof(cbuf), "--");
384 break;
385 default:
386 fc_snprintf(cbuf, sizeof(cbuf), "%d", togrow);
387 break;
388 }
389
391 pstr->style |= SF_CENTER;
392 if (togrow < 0) {
393 pstr->fgcol.r = 255;
394 }
395 pbuf = create_iconlabel(NULL, pwindow->dst, pstr,
397 if (count > 13 * COL) {
399 }
400 hh = MAX(hh, pbuf->size.h);
401 pbuf->size.w = text2->w + adj_size(6);
402 add_to_gui_list(MAX_ID - pcity->id, pbuf);
403
404 /* ----------- */
405 fc_snprintf(cbuf, sizeof(cbuf), "%d", pcity->surplus[O_TRADE]);
407 pstr->style |= SF_CENTER;
409 pbuf = create_iconlabel(NULL, pwindow->dst, pstr,
411 if (count > 13 * COL) {
413 }
414 hh = MAX(hh, pbuf->size.h);
415 pbuf->size.w = icons->big_trade->w + adj_size(6);
416 add_to_gui_list(MAX_ID - pcity->id, pbuf);
417
418 /* ----------- */
419 fc_snprintf(cbuf, sizeof(cbuf), "%d", pcity->waste[O_TRADE]);
421 pstr->style |= SF_CENTER;
422 pbuf = create_iconlabel(NULL, pwindow->dst, pstr,
424 if (count > 13 * COL) {
426 }
427 hh = MAX(hh, pbuf->size.h);
428 pbuf->size.w = icons->big_trade_corr->w + adj_size(6);
429 add_to_gui_list(MAX_ID - pcity->id, pbuf);
430
431 /* ----------- */
432 fc_snprintf(cbuf, sizeof(cbuf), "%d", pcity->surplus[O_GOLD]);
434 pstr->style |= SF_CENTER;
436 pbuf = create_iconlabel(NULL, pwindow->dst, pstr,
438 if (count > 13 * COL) {
440 }
441 hh = MAX(hh, pbuf->size.h);
442 pbuf->size.w = icons->big_coin->w + adj_size(6);
443 add_to_gui_list(MAX_ID - pcity->id, pbuf);
444
445 /* ----------- */
446 fc_snprintf(cbuf, sizeof(cbuf), "%d", pcity->prod[O_SCIENCE]);
448 pstr->style |= SF_CENTER;
450 pbuf = create_iconlabel(NULL, pwindow->dst, pstr,
452 if (count > 13 * COL) {
454 }
455 hh = MAX(hh, pbuf->size.h);
456 pbuf->size.w = icons->big_colb->w + adj_size(6);
457 add_to_gui_list(MAX_ID - pcity->id, pbuf);
458
459 /* ----------- */
460 fc_snprintf(cbuf, sizeof(cbuf), "%d", pcity->prod[O_LUXURY]);
462 pstr->style |= SF_CENTER;
464 pbuf = create_iconlabel(NULL, pwindow->dst, pstr,
466 if (count > 13 * COL) {
468 }
469 hh = MAX(hh, pbuf->size.h);
470 pbuf->size.w = icons->big_luxury->w + adj_size(6);
471 add_to_gui_list(MAX_ID - pcity->id, pbuf);
472
473 /* ----------- */
474 fc_snprintf(cbuf, sizeof(cbuf), "%d",
475 pcity->prod[O_SHIELD] + pcity->waste[O_SHIELD]);
477 pstr->style |= SF_CENTER;
479 pbuf = create_iconlabel(NULL, pwindow->dst, pstr,
481 if (count > 13 * COL) {
483 }
484 hh = MAX(hh, pbuf->size.h);
485 pbuf->size.w = icons->big_shield->w + adj_size(6);
486 add_to_gui_list(MAX_ID - pcity->id, pbuf);
487
488 /* ----------- */
489 fc_snprintf(cbuf, sizeof(cbuf), "%d", pcity->waste[O_SHIELD]);
491 pstr->style |= SF_CENTER;
492 pbuf = create_iconlabel(NULL, pwindow->dst, pstr,
494 if (count > 13 * COL) {
496 }
497 hh = MAX(hh, pbuf->size.h);
498 pbuf->size.w = icons->big_shield_corr->w + adj_size(6);
499 add_to_gui_list(MAX_ID - pcity->id, pbuf);
500
501 /* ----------- */
502 fc_snprintf(cbuf, sizeof(cbuf), "%d",
503 pcity->prod[O_SHIELD] + pcity->waste[O_SHIELD] - pcity->surplus[O_SHIELD]);
505 pstr->style |= SF_CENTER;
507 pbuf = create_iconlabel(NULL, pwindow->dst, pstr,
509 if (count > 13 * COL) {
511 }
512 hh = MAX(hh, pbuf->size.h);
513 pbuf->size.w = units_icon->w + adj_size(6);
514 add_to_gui_list(MAX_ID - pcity->id, pbuf);
515
516 /* ----------- */
517 fc_snprintf(cbuf, sizeof(cbuf), "%d", pcity->surplus[O_SHIELD]);
519 pstr->style |= SF_CENTER;
521 pbuf = create_iconlabel(NULL, pwindow->dst, pstr,
523 if (count > 13 * COL) {
525 }
526 hh = MAX(hh, pbuf->size.h);
527 pbuf->size.w = icons->big_shield_surplus->w + adj_size(6);
528 add_to_gui_list(MAX_ID - pcity->id, pbuf);
529
530 /* ----------- */
531 if (VUT_UTYPE == pcity->production.kind) {
532 const struct unit_type *punittype = pcity->production.value.utype;
533
536 adj_size(36), adj_size(24), 1,
537 TRUE, TRUE);
540 } else {
541 const struct impr_type *pimprove = pcity->production.value.building;
542
543 logo = resize_surface_box(get_building_surface(pcity->production.value.building),
544 adj_size(36), adj_size(24), 1,
545 TRUE, TRUE);
546 togrow = impr_build_shield_cost(pcity, pimprove);
548 }
549
550 if (!worklist_is_empty(&(pcity->worklist))) {
551 dst.x = logo->w - icons->worklist->w;
552 dst.y = 0;
553 alphablit(icons->worklist, NULL, logo, &dst, 255);
554 fc_snprintf(cbuf, sizeof(cbuf), "%s\n(%d/%d)\n%s",
555 name, pcity->shield_stock, togrow, _("worklist"));
556 } else {
557 fc_snprintf(cbuf, sizeof(cbuf), "%s\n(%d/%d)%s",
558 name, pcity->shield_stock, togrow,
559 pcity->shield_stock > togrow ? _("\nfinished"): "" );
560 }
561
562 /* Info string */
564 pstr->style |= SF_CENTER;
565
567 if (togrow == 999) {
568 fc_snprintf(cbuf, sizeof(cbuf), "%s", _("never"));
569 } else {
570 fc_snprintf(cbuf, sizeof(cbuf), "%d %s",
571 togrow, PL_("turn", "turns", togrow));
572 }
573
574 pbuf = create_icon2(logo, pwindow->dst,
576 | WF_FREE_THEME);
577 pbuf->info_label = pstr;
578 if (count > 13 * COL) {
580 }
581 hh = MAX(hh, pbuf->size.h);
582 add_to_gui_list(MAX_ID - pcity->id, pbuf);
585 pbuf->data.city = pcity;
586
588 pstr->style |= SF_CENTER;
590 pbuf = create_iconlabel(NULL, pwindow->dst, pstr,
592 if (count > 13 * COL) {
594 }
595 hh = MAX(hh, pbuf->size.h);
596 prod_w = MAX(prod_w, pbuf->size.w);
597 add_to_gui_list(MAX_ID - pcity->id, pbuf);
598 pbuf->data.city = pcity;
600 if (city_can_buy(pcity)) {
602 }
603
604 count += COL;
606
607 h = hh;
609
610 /* Setup window width */
611 area.w = name_w + adj_size(6) + text1->w + adj_size(8) + cma_icon->w
612 + (icons->big_food->w + adj_size(6)) * 10 + text2->w + adj_size(6)
613 + units_icon->w + adj_size(6) + prod_w + adj_size(170);
614
615 if (count) {
618 if (count > 14 * COL) {
620 if (city_rep->scroll) {
621 city_rep->scroll->count = count;
622 }
624 area.w += ww;
625 area.h = 14 * (hh + adj_size(2));
626 } else {
627 area.h = (count / COL) * (hh + adj_size(2));
628 }
629 }
630
631 area.h += text2->h + adj_size(6);
632 area.w += adj_size(2);
633
635 resize_window(pwindow, logo, NULL,
636 (pwindow->size.w - pwindow->area.w) + area.w,
637 (pwindow->size.h - pwindow->area.h) + area.h);
639
640#if 0
641 logo = SDL_DisplayFormat(pwindow->theme);
642 FREESURFACE(pwindow->theme);
643 pwindow->theme = logo;
644 logo = NULL;
645#endif /* 0 */
646
647 area = pwindow->area;
648
649 widget_set_position(pwindow,
650 (main_window_width() - pwindow->size.w) / 2,
651 (main_window_height() - pwindow->size.h) / 2);
652
653 /* Exit button */
654 pbuf = pwindow->prev;
655 pbuf->size.x = area.x + area.w - pbuf->size.w - 1;
656 pbuf->size.y = pwindow->size.y + adj_size(2);
657
658/* FIXME: not implemented yet */
659#if 0
660 /* Info button */
661 pbuf = pbuf->prev;
662 pbuf->size.x = area.x + area.w - pbuf->size.w - adj_size(5);
663 pbuf->size.y = area.y + area.h - pbuf->size.h - adj_size(5);
664
665 /* Happy button */
666 pbuf = pbuf->prev;
667 pbuf->size.x = pbuf->next->size.x - adj_size(5) - pbuf->size.w;
668 pbuf->size.y = pbuf->next->size.y;
669
670 /* Army button */
671 pbuf = pbuf->prev;
672 pbuf->size.x = pbuf->next->size.x - adj_size(5) - pbuf->size.w;
673 pbuf->size.y = pbuf->next->size.y;
674
675 /* Supported button */
676 pbuf = pbuf->prev;
677 pbuf->size.x = pbuf->next->size.x - adj_size(5) - pbuf->size.w;
678 pbuf->size.y = pbuf->next->size.y;
679#endif /* 0 */
680
681 /* Cities background and labels */
682 dst.x = area.x + adj_size(2);
683 dst.y = area.y + 1;
684 dst.w = (name_w + adj_size(6)) + (text1->w + adj_size(8)) + adj_size(5);
685 dst.h = area.h - adj_size(2);
686 fill_rect_alpha(pwindow->theme, &dst, &bg_color);
687
688 create_frame(pwindow->theme,
689 dst.x , dst.y, dst.w, dst.h - 1,
691
692 dst.y += (text2->h - text3->h) / 2;
693 dst.x += ((name_w + adj_size(6)) - text3->w) / 2;
694 alphablit(text3, NULL, pwindow->theme, &dst, 255);
696
697 /* City size background and label */
698 dst.x = area.x + adj_size(5) + name_w + adj_size(5 + 4);
699 alphablit(text1, NULL, pwindow->theme, &dst, 255);
700 ww = text1->w;
702
703 /* CMA icon */
704 dst.x += (ww + adj_size(9));
705 dst.y = area.y + 1 + (text2->h - cma_icon->h) / 2;
706 alphablit(cma_icon, NULL, pwindow->theme, &dst, 255);
707 ww = cma_icon->w;
708 FREESURFACE(cma_icon);
709
710 /* -------------- */
711 /* Populations food upkeep background and label */
712 dst.x += (ww + 1);
713 dst.y = area.y + 1;
714 w = dst.x + adj_size(2);
715 dst.w = (icons->big_food->w + adj_size(6)) + adj_size(10)
716 + (icons->big_food_surplus->w + adj_size(6)) + adj_size(10)
717 + text2->w + adj_size(6 + 2);
718 dst.h = area.h - adj_size(2);
719 fill_rect_alpha(pwindow->theme, &dst,
721
722 create_frame(pwindow->theme,
723 dst.x, dst.y, dst.w, dst.h - 1,
725
726 dst.y = area.y + 1 + (text2->h - icons->big_food->h) / 2;
727 dst.x += adj_size(5);
728 alphablit(icons->big_food, NULL, pwindow->theme, &dst, 255);
729
730 /* Food surplus icon */
731 w += (icons->big_food->w + adj_size(6)) + adj_size(10);
732 dst.x = w + adj_size(3);
733 alphablit(icons->big_food_surplus, NULL, pwindow->theme, &dst, 255);
734
735 /* To grow label */
736 w += (icons->big_food_surplus->w + adj_size(6)) + adj_size(10);
737 dst.x = w + adj_size(3);
738 dst.y = area.y + 1;
739 alphablit(text2, NULL, pwindow->theme, &dst, 255);
740 hh = text2->h;
741 ww = text2->w;
743 /* -------------- */
744
745 /* Trade, corruptions, gold, science, luxury income background and label */
746 dst.x = w + (ww + adj_size(8));
747 dst.y = area.y + 1;
748 w = dst.x + adj_size(2);
749 dst.w = (icons->big_trade->w + adj_size(6)) + adj_size(10) +
750 (icons->big_trade_corr->w + adj_size(6)) + adj_size(10) +
751 (icons->big_coin->w + adj_size(6)) + adj_size(10) +
752 (icons->big_colb->w + adj_size(6)) + adj_size(10) +
753 (icons->big_luxury->w + adj_size(6)) + adj_size(4);
754 dst.h = area.h - adj_size(2);
755
756 fill_rect_alpha(pwindow->theme, &dst,
758
759 create_frame(pwindow->theme,
760 dst.x , dst.y, dst.w, dst.h - 1,
762
763 dst.y = area.y + 1 + (hh - icons->big_trade->h) / 2;
764 dst.x += adj_size(5);
765 alphablit(icons->big_trade, NULL, pwindow->theme, &dst, 255);
766
767 w += (icons->big_trade->w + adj_size(6)) + adj_size(10);
768 dst.x = w + adj_size(3);
769 alphablit(icons->big_trade_corr, NULL, pwindow->theme, &dst, 255);
770
771 w += (icons->big_food_corr->w + adj_size(6)) + adj_size(10);
772 dst.x = w + adj_size(3);
773 alphablit(icons->big_coin, NULL, pwindow->theme, &dst, 255);
774
775 w += (icons->big_coin->w + adj_size(6)) + adj_size(10);
776 dst.x = w + adj_size(3);
777 alphablit(icons->big_colb, NULL, pwindow->theme, &dst, 255);
778
779 w += (icons->big_colb->w + adj_size(6)) + adj_size(10);
780 dst.x = w + adj_size(3);
781 alphablit(icons->big_luxury, NULL, pwindow->theme, &dst, 255);
782 /* --------------------- */
783
784 /* Total productions, waste, support, shields surplus background and label */
785 w += (icons->big_luxury->w + adj_size(6)) + adj_size(4);
786 dst.x = w;
787 w += adj_size(2);
788 dst.y = area.y + 1;
789 dst.w = (icons->big_shield->w + adj_size(6)) + adj_size(10) +
790 (icons->big_shield_corr->w + adj_size(6)) + adj_size(10) +
791 (units_icon->w + adj_size(6)) + adj_size(10) +
793 dst.h = area.h - adj_size(2);
794
795 fill_rect_alpha(pwindow->theme, &dst,
797
798 create_frame(pwindow->theme,
799 dst.x , dst.y, dst.w, dst.h - 1,
801
802 dst.y = area.y + 1 + (hh - icons->big_shield->h) / 2;
803 dst.x += adj_size(5);
804 alphablit(icons->big_shield, NULL, pwindow->theme, &dst, 255);
805
806 w += (icons->big_shield->w + adj_size(6)) + adj_size(10);
807 dst.x = w + adj_size(3);
808 alphablit(icons->big_shield_corr, NULL, pwindow->theme, &dst, 255);
809
810 w += (icons->big_shield_corr->w + adj_size(6)) + adj_size(10);
811 dst.x = w + adj_size(3);
812 dst.y = area.y + 1 + (hh - units_icon->h) / 2;
813 alphablit(units_icon, NULL, pwindow->theme, &dst, 255);
814
815 w += (units_icon->w + adj_size(6)) + adj_size(10);
816 FREESURFACE(units_icon);
817 dst.x = w + adj_size(3);
818 dst.y = area.y + 1 + (hh - icons->big_shield_surplus->h) / 2;
819 alphablit(icons->big_shield_surplus, NULL, pwindow->theme, &dst, 255);
820 /* ------------------------------- */
821
822 w += (icons->big_shield_surplus->w + adj_size(6)) + adj_size(10);
823 dst.x = w;
824 dst.y = area.y + 1;
825 dst.w = adj_size(36) + adj_size(5) + prod_w;
826 dst.h = hh + adj_size(2);
827
828 fill_rect_alpha(pwindow->theme, &dst,
830
831 create_frame(pwindow->theme,
832 dst.x , dst.y, dst.w, dst.h - 1,
834
835 dst.y = area.y + 1 + (hh - text4->h) / 2;
836 dst.x += (dst.w - text4->w) / 2;
837 alphablit(text4, NULL, pwindow->theme, &dst, 255);
839
840 if (count) {
841 int start_x = area.x + adj_size(5);
842 int start_y = area.y + hh + adj_size(3);
843
844 h += adj_size(2);
845 pbuf = pbuf->prev;
846
847 while (TRUE) {
848
849 /* City name */
850 pbuf->size.x = start_x;
851 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
852 pbuf->size.w = name_w;
853
854 /* City size */
855 pbuf = pbuf->prev;
856 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w + adj_size(5);
857 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
858
859 /* CMA */
860 pbuf = pbuf->prev;
861 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w + adj_size(6);
862 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
863
864 /* Food cons. */
865 pbuf = pbuf->prev;
866 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w + adj_size(6);
867 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
868
869 /* Food surplus */
870 pbuf = pbuf->prev;
871 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w + adj_size(10);
872 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
873
874 /* Time to grow */
875 pbuf = pbuf->prev;
876 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w + adj_size(10);
877 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
878
879 /* Trade */
880 pbuf = pbuf->prev;
881 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w + adj_size(5);
882 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
883
884 /* Trade corruptions */
885 pbuf = pbuf->prev;
886 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w + adj_size(10);
887 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
888
889 /* Net gold income */
890 pbuf = pbuf->prev;
891 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w + adj_size(10);
892 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
893
894 /* Science income */
895 pbuf = pbuf->prev;
896 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w + adj_size(10);
897 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
898
899 /* Luxuries income */
900 pbuf = pbuf->prev;
901 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w + adj_size(10);
902 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
903
904 /* Total production */
905 pbuf = pbuf->prev;
906 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w + adj_size(6);
907 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
908
909 /* Waste */
910 pbuf = pbuf->prev;
911 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w + adj_size(10);
912 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
913
914 /* Units support */
915 pbuf = pbuf->prev;
916 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w + adj_size(10);
917 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
918
919 /* Production surplus */
920 pbuf = pbuf->prev;
921 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w + adj_size(10);
922 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
923
924 /* Currently build */
925 /* Icon */
926 pbuf = pbuf->prev;
927 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w + adj_size(10);
928 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
929
930 /* Label */
931 pbuf = pbuf->prev;
932 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w + adj_size(5);
933 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
934 pbuf->size.w = prod_w;
935
936 start_y += h;
938 break;
939 }
940 pbuf = pbuf->prev;
941 }
942
943 if (city_rep->scroll) {
945 area.x + area.w, area.y,
946 area.h, TRUE);
947 }
948
949 }
950
951 /* ----------------------------------- */
953 widget_mark_dirty(pwindow);
954 flush_dirty();
955}
956
957/**********************************************************************/
960static struct widget *real_city_report_dialog_update_city(struct widget *pwidget,
961 struct city *pcity)
962{
963 char cbuf[64];
964 const char *name;
965 int togrow;
968
969 /* city name status */
970 if (city_unhappy(pcity)) {
972 } else {
973 if (city_celebrating(pcity)) {
975 } else {
976 if (city_happy(pcity)) {
978 }
979 }
980 }
981
982 /* city size */
983 pwidget = pwidget->prev;
984 fc_snprintf(cbuf, sizeof(cbuf), "%d", city_size_get(pcity));
986
987 /* cma check box */
988 pwidget = pwidget->prev;
989 if (cma_is_city_under_agent(pcity, NULL) != get_checkbox_state(pwidget)) {
990 toggle_checkbox(pwidget);
991 }
992
993 /* food consumptions */
994 pwidget = pwidget->prev;
995 fc_snprintf(cbuf, sizeof(cbuf), "%d",
996 pcity->prod[O_FOOD] - pcity->surplus[O_FOOD]);
998
999 /* food surplus */
1000 pwidget = pwidget->prev;
1001 fc_snprintf(cbuf, sizeof(cbuf), "%d", pcity->surplus[O_FOOD]);
1003
1004 /* time to grow */
1005 pwidget = pwidget->prev;
1006 togrow = city_turns_to_grow(pcity);
1007 switch (togrow) {
1008 case 0:
1009 fc_snprintf(cbuf, sizeof(cbuf), "#");
1010 break;
1011 case FC_INFINITY:
1012 fc_snprintf(cbuf, sizeof(cbuf), "--");
1013 break;
1014 default:
1015 fc_snprintf(cbuf, sizeof(cbuf), "%d", togrow);
1016 break;
1017 }
1019
1020 if (togrow < 0) {
1021 pwidget->string_utf8->fgcol.r = 255;
1022 } else {
1023 pwidget->string_utf8->fgcol.r = 0;
1024 }
1025
1026 /* trade production */
1027 pwidget = pwidget->prev;
1028 fc_snprintf(cbuf, sizeof(cbuf), "%d", pcity->surplus[O_TRADE]);
1030
1031 /* corruptions */
1032 pwidget = pwidget->prev;
1033 fc_snprintf(cbuf, sizeof(cbuf), "%d", pcity->waste[O_TRADE]);
1035
1036 /* gold surplus */
1037 pwidget = pwidget->prev;
1038 fc_snprintf(cbuf, sizeof(cbuf), "%d", pcity->surplus[O_GOLD]);
1040
1041 /* science income */
1042 pwidget = pwidget->prev;
1043 fc_snprintf(cbuf, sizeof(cbuf), "%d", pcity->prod[O_SCIENCE]);
1045
1046 /* lugury income */
1047 pwidget = pwidget->prev;
1048 fc_snprintf(cbuf, sizeof(cbuf), "%d", pcity->prod[O_LUXURY]);
1050
1051 /* total production */
1052 pwidget = pwidget->prev;
1053 fc_snprintf(cbuf, sizeof(cbuf), "%d",
1054 pcity->prod[O_SHIELD] + pcity->waste[O_SHIELD]);
1056
1057 /* waste */
1058 pwidget = pwidget->prev;
1059 fc_snprintf(cbuf, sizeof(cbuf), "%d", pcity->waste[O_SHIELD]);
1061
1062 /* units support */
1063 pwidget = pwidget->prev;
1064 fc_snprintf(cbuf, sizeof(cbuf), "%d", pcity->prod[O_SHIELD] +
1065 pcity->waste[O_SHIELD] - pcity->surplus[O_SHIELD]);
1067
1068 /* production income */
1069 pwidget = pwidget->prev;
1070 fc_snprintf(cbuf, sizeof(cbuf), "%d", pcity->surplus[O_SHIELD]);
1072
1073 /* change production */
1074 if (VUT_UTYPE == pcity->production.kind) {
1075 const struct unit_type *punittype = pcity->production.value.utype;
1076
1078 adj_size(36), adj_size(24), 1);
1081 } else {
1082 const struct impr_type *pimprove = pcity->production.value.building;
1083
1085 adj_size(36), adj_size(24), 1);
1086 togrow = impr_build_shield_cost(pcity, pimprove);
1088 }
1089
1090 if (!worklist_is_empty(&(pcity->worklist))) {
1091 dst.x = logo->w - icons->worklist->w;
1092 dst.y = 0;
1093 alphablit(icons->worklist, NULL, logo, &dst, 255);
1094 fc_snprintf(cbuf, sizeof(cbuf), "%s\n(%d/%d)\n%s",
1095 name, pcity->shield_stock, togrow, _("worklist"));
1096 } else {
1097 fc_snprintf(cbuf, sizeof(cbuf), "%s\n(%d/%d)",
1098 name, pcity->shield_stock, togrow);
1099 }
1100
1101 pwidget = pwidget->prev;
1103 FREESURFACE(pwidget->theme);
1104 pwidget->theme = logo;
1105
1106 /* hurry productions */
1107 pwidget = pwidget->prev;
1109 if (togrow == 999) {
1110 fc_snprintf(cbuf, sizeof(cbuf), "%s", _("never"));
1111 } else {
1112 fc_snprintf(cbuf, sizeof(cbuf), "%d %s",
1113 togrow, PL_("turn", "turns", togrow));
1114 }
1115
1117
1118 return pwidget->prev;
1119}
1120
1121/* ======================================================================== */
1122
1123/**********************************************************************/
1127{
1128 return (city_rep != NULL);
1129}
1130
1131/**********************************************************************/
1136{
1137 if (!city_rep) {
1139 }
1140}
1141
1142/**********************************************************************/
1146{
1147 if (city_rep) {
1148 struct widget *pwidget;
1149 int count;
1150
1151 /* find if the lists are identical (if not then rebuild all) */
1152 pwidget = city_rep->end_active_widget_list; /* name of first city */
1154 if (pcity->id == MAX_ID - pwidget->id) {
1155 count = COL;
1156
1157 while (count) {
1158 count--;
1159 pwidget = pwidget->prev;
1160 }
1161 } else {
1163
1164 return;
1165 }
1167
1168 /* check it there are some city widgets left on list */
1169 if (pwidget && pwidget->next != city_rep->begin_active_widget_list) {
1171 return;
1172 }
1173
1174 /* update widget city list (widget list is the same that city list) */
1177 pwidget = real_city_report_dialog_update_city(pwidget, pcity);
1179
1180 /* -------------------------------------- */
1183
1184 flush_dirty();
1185 }
1186}
1187
1188/**********************************************************************/
1192{
1193 if (city_rep && pcity) {
1195
1196 while (pcity->id != MAX_ID - buf->id
1198 buf = buf->prev;
1199 }
1200
1203 return;
1204 }
1206
1207 /* -------------------------------------- */
1210
1211 flush_dirty();
1212 }
1213}
1214
1215/**********************************************************************/
1221{
1222 log_debug("hilite_cities_from_canvas : PORT ME");
1223}
1224
1225/**********************************************************************/
1228void toggle_city_hilite(struct city *pcity, bool on_off)
1229{
1230 log_debug("toggle_city_hilite : PORT ME");
1231}
const char * city_name_get(const struct city *pcity)
Definition city.c:1137
int city_production_turns_to_build(const struct city *pcity, bool include_shield_stock)
Definition city.c:820
bool city_unhappy(const struct city *pcity)
Definition city.c:1626
bool city_celebrating(const struct city *pcity)
Definition city.c:1645
bool city_happy(const struct city *pcity)
Definition city.c:1614
int city_turns_to_grow(const struct city *pcity)
Definition city.c:1996
#define city_list_iterate(citylist, pcity)
Definition city.h:508
static citizens city_size_get(const struct city *pcity)
Definition city.h:569
#define city_list_iterate_end
Definition city.h:510
bool city_can_buy(const struct city *pcity)
void popup_city_dialog(struct city *pcity)
void city_report_dialog_update_city(struct city *pcity)
struct civclient client
bool cma_is_city_under_agent(const struct city *pcity, struct cm_parameter *parameter)
Definition cma_core.c:552
void cma_release_city(struct city *pcity)
Definition cma_core.c:542
char * incite_cost
Definition comments.c:75
QString current_theme
Definition fc_client.cpp:65
@ O_SHIELD
Definition fc_types.h:101
@ O_FOOD
Definition fc_types.h:101
@ O_TRADE
Definition fc_types.h:101
@ O_SCIENCE
Definition fc_types.h:101
@ O_LUXURY
Definition fc_types.h:101
@ O_GOLD
Definition fc_types.h:101
#define PL_(String1, String2, n)
Definition fcintl.h:71
#define _(String)
Definition fcintl.h:67
struct city * game_city_by_number(int id)
Definition game.c:107
void real_city_report_dialog_update(void *unused)
Definition cityrep.c:1458
void real_city_report_update_city(struct city *pcity)
Definition cityrep.c:1493
void toggle_city_hilite(struct city *pcity, bool on_off)
Definition cityrep.c:2093
void hilite_cities_from_canvas(void)
Definition cityrep.c:2070
void city_report_dialog_popdown(void)
Definition cityrep.c:312
void city_report_dialog_popup(bool raise)
Definition cityrep.c:292
void flush_dirty(void)
Definition mapview.c:468
void popup_hurry_production_dialog(struct city *pcity, SDL_Surface *pdest)
Definition citydlg.c:1176
static int exit_city_report_callback(struct widget *pwidget)
Definition cityrep.c:90
static int popup_worklist_from_city_report_callback(struct widget *pwidget)
Definition cityrep.c:114
static int popup_citydlg_from_city_report_callback(struct widget *pwidget)
Definition cityrep.c:102
static int city_report_windows_callback(struct widget *pwindow)
Definition cityrep.c:78
static struct advanced_dialog * city_rep
Definition cityrep.c:53
static struct widget * real_city_report_dialog_update_city(struct widget *pwidget, struct city *pcity)
Definition cityrep.c:964
static int popup_cma_from_city_report_callback(struct widget *pwidget)
Definition cityrep.c:138
static int popup_buy_production_from_city_report_callback(struct widget *pwidget)
Definition cityrep.c:126
#define COL
Definition cityrep.c:173
static void real_info_city_report_dialog_update(void)
Definition cityrep.c:178
bool is_city_report_open(void)
Definition cityrep.c:1130
void popup_city_cma_dialog(struct city *pcity)
Definition cma_fe.c:891
SDL_Color * get_theme_color(enum theme_color themecolor)
Definition colors.c:47
SDL_Color * get_game_color(enum color_std stdcolor)
Definition colors.c:55
SDL_Surface * resize_surface(const SDL_Surface *psrc, Uint16 new_width, Uint16 new_height, int smooth)
Definition graphics.c:1237
int main_window_width(void)
Definition graphics.c:685
int fill_rect_alpha(SDL_Surface *surf, SDL_Rect *prect, SDL_Color *pcolor)
Definition graphics.c:865
int alphablit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect, unsigned char alpha_mod)
Definition graphics.c:199
struct sdl2_data main_data
Definition graphics.c:57
void create_frame(SDL_Surface *dest, Sint16 left, Sint16 top, Sint16 width, Sint16 height, SDL_Color *pcolor)
Definition graphics.c:1348
int main_window_height(void)
Definition graphics.c:693
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:1257
#define FREESURFACE(ptr)
Definition graphics.h:322
@ ID_BUTTON
Definition gui_id.h:29
@ ID_WINDOW
Definition gui_id.h:30
struct widget * selected_widget
Definition widget.c:48
#define adj_size(size)
Definition gui_main.h:141
#define PRESSED_EVENT(event)
Definition gui_main.h:71
utf8_str * copy_chars_to_utf8_str(utf8_str *pstr, const char *pchars)
Definition gui_string.c:251
SDL_Surface * create_text_surf_from_utf8(utf8_str *pstr)
Definition gui_string.c:425
#define FREEUTF8STR(pstr)
Definition gui_string.h:93
#define SF_CENTER
Definition gui_string.h:40
@ FONTO_DEFAULT
Definition gui_string.h:65
@ FONTO_ATTENTION
Definition gui_string.h:67
#define create_utf8_from_char_fonto(string_in, fonto)
Definition gui_string.h:108
struct city_icon * icons
static SDL_Surface * get_building_surface(const struct impr_type *pimprove)
static SDL_Surface * get_unittype_surface(const struct unit_type *punittype, enum direction8 facing)
void enable_and_redraw_find_city_button(void)
Definition mapctrl.c:2235
SDL_Surface * theme_get_background(const struct theme *t, enum theme_background background)
@ BACKGROUND_CITYREP
@ COLOR_THEME_CITYDLG_CELEB
Definition themecolors.h:47
@ COLOR_THEME_CITYREP_FRAME
Definition themecolors.h:70
@ COLOR_THEME_CITYDLG_LUX
Definition themecolors.h:59
@ COLOR_THEME_CITYDLG_TRADE
Definition themecolors.h:67
@ COLOR_THEME_CITYDLG_PROD
Definition themecolors.h:61
@ COLOR_THEME_CITYDLG_SUPPORT
Definition themecolors.h:66
@ COLOR_THEME_CITYREP_FOODSTOCK
Definition themecolors.h:69
@ COLOR_THEME_CITYREP_TEXT
Definition themecolors.h:72
@ COLOR_THEME_CITYDLG_HAPPY
Definition themecolors.h:56
@ COLOR_THEME_CITYDLG_SCIENCE
Definition themecolors.h:62
@ COLOR_THEME_CITYREP_TRADE
Definition themecolors.h:73
@ COLOR_THEME_CITYDLG_GOLD
Definition themecolors.h:53
@ COLOR_THEME_CITYREP_PROD
Definition themecolors.h:71
@ COLOR_THEME_CITYDLG_FOOD_SURPLUS
Definition themecolors.h:51
struct theme * active_theme
Definition themespec.c:154
void add_to_gui_list(Uint16 id, struct widget *gui)
Definition widget.c:586
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
void popdown_window_group_dialog(struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
Definition widget.c:983
void move_window_group(struct widget *begin_widget_list, struct widget *pwindow)
Definition widget.c:1039
static void widget_set_position(struct widget *pwidget, int x, int y)
Definition widget.h:266
#define MAX_ID
Definition widget.h:38
@ FC_WS_NORMAL
Definition widget.h:96
static void widget_mark_dirty(struct widget *pwidget)
Definition widget.h:286
void set_wstate(struct widget *pwidget, enum widget_state state)
Definition widget_core.c:36
@ WF_WIDGET_HAS_INFO_LABEL
Definition widget.h:88
@ WF_SELECT_WITHOUT_BAR
Definition widget.h:89
@ WF_RESTORE_BACKGROUND
Definition widget.h:85
@ WF_HIDDEN
Definition widget.h:68
@ WF_FREE_THEME
Definition widget.h:72
static int widget_redraw(struct widget *pwidget)
Definition widget.h:276
void set_wflag(struct widget *pwidget, enum widget_flag flag)
Definition widget_core.c:54
void toggle_checkbox(struct widget *cbox)
bool get_checkbox_state(struct widget *cbox)
struct widget * create_checkbox(struct gui_layer *pdest, bool state, Uint32 flags)
struct widget * create_themeicon(SDL_Surface *icon_theme, struct gui_layer *pdest, Uint32 flags)
struct widget * create_icon2(SDL_Surface *icon, struct gui_layer *pdest, Uint32 flags)
SDL_Surface * create_icon_from_theme(SDL_Surface *icon_theme, Uint8 state)
struct widget * create_iconlabel(SDL_Surface *icon, struct gui_layer *pdest, utf8_str *pstr, Uint32 flags)
void setup_vertical_scrollbar_area(struct scroll_bar *scroll, Sint16 start_x, Sint16 start_y, Uint16 height, bool swap_start_x)
Uint32 create_vertical_scrollbar(struct advanced_dialog *dlg, Uint8 step, Uint8 active, bool create_scrollbar, bool create_buttons)
bool resize_window(struct widget *pwindow, SDL_Surface *bcgd, SDL_Color *pcolor, Uint16 new_w, Uint16 new_h)
struct widget * create_window_skeleton(struct gui_layer *pdest, utf8_str *title, Uint32 flags)
void popup_worklist_editor(struct city *pcity, struct global_worklist *gwl)
Definition wldlg.c:1055
int impr_build_shield_cost(const struct city *pcity, const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
const char * name
Definition inputfile.c:127
#define fc_assert(condition)
Definition log.h:176
#define log_debug(message,...)
Definition log.h:115
#define fc_calloc(n, esz)
Definition mem.h:38
#define FC_FREE(ptr)
Definition mem.h:41
#define FC_INFINITY
Definition shared.h:36
#define MAX(x, y)
Definition shared.h:54
struct widget * begin_active_widget_list
Definition widget.h:184
struct widget * end_widget_list
Definition widget.h:182
struct widget * end_active_widget_list
Definition widget.h:185
struct widget * active_widget_list
Definition widget.h:186
struct scroll_bar * scroll
Definition widget.h:187
struct widget * begin_widget_list
Definition widget.h:181
SDL_Surface * big_trade_corr
SDL_Surface * big_shield_corr
SDL_Surface * big_trade
SDL_Surface * big_shield
SDL_Surface * big_luxury
SDL_Surface * big_colb
SDL_Surface * big_food
SDL_Surface * big_coin
SDL_Surface * big_food_corr
SDL_Surface * big_food_surplus
SDL_Surface * worklist
SDL_Surface * big_shield_surplus
Definition city.h:320
int surplus[O_LAST]
Definition city.h:355
int id
Definition city.h:326
int waste[O_LAST]
Definition city.h:356
struct worklist worklist
Definition city.h:401
struct universal production
Definition city.h:396
int shield_stock
Definition city.h:368
int prod[O_LAST]
Definition city.h:358
struct connection conn
Definition client_main.h:96
struct player * playing
Definition connection.h:151
struct city_list * cities
Definition player.h:279
SDL_Event event
Definition graphics.h:217
enum universals_n kind
Definition fc_types.h:902
universals_u value
Definition fc_types.h:901
SDL_Color fgcol
Definition gui_string.h:57
union widget::@194 data
SDL_Surface * theme
Definition widget.h:118
struct widget * prev
Definition widget.h:114
struct gui_layer * dst
Definition widget.h:116
struct city * city
Definition widget.h:128
utf8_str * string_utf8
Definition widget.h:121
int(* action)(struct widget *)
Definition widget.h:157
SDL_Rect area
Definition widget.h:149
struct widget * next
Definition widget.h:113
utf8_str * info_label
Definition widget.h:122
Uint16 id
Definition widget.h:155
SDL_Rect size
Definition widget.h:145
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:974
#define TRUE
Definition support.h:46
const struct unit_type * utype
Definition fc_types.h:721
const struct impr_type * building
Definition fc_types.h:714
int utype_build_shield_cost(const struct city *pcity, const struct player *pplayer, const struct unit_type *punittype)
Definition unittype.c:1438
const char * utype_name_translation(const struct unit_type *punittype)
Definition unittype.c:1560
bool worklist_is_empty(const struct worklist *pwl)
Definition worklist.c:66