Freeciv-3.2: /fast/freeciv/nightly/S3_2/client/gui-gtk-3.22/inteldlg.c Source File

Freeciv-3.2

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#include <stdio.h>
19#include <stdlib.h>
20
21#include <gtk/gtk.h>
22
23/* utility */
24#include "fcintl.h"
25#include "log.h"
26#include "shared.h"
27#include "support.h"
28
29/* common */
30#include "government.h"
31#include "nation.h"
32#include "packets.h"
33#include "player.h"
34#include "research.h"
35
36/* client */
37#include "client_main.h"
38#include "options.h"
39
40/* client/gui-gtk-3.22 */
41#include "gui_main.h"
42#include "gui_stuff.h"
43#include "mapview.h"
44
45#include "inteldlg.h"
46
47/******************************************************************/
48 static const char *table_text[] = {
49 N_("Ruler:"),
50 N_("Government:"),
51 N_("Capital:"),
52 N_("Gold:"),
53 NULL,
54 N_("Tax:"),
55 N_("Science:"),
56 N_("Luxury:"),
57 NULL,
58 N_("Researching:"),
59 N_("Culture:")
60};
61
62 enum table_label {
63 LABEL_RULER,
64 LABEL_GOVERNMENT,
65 LABEL_CAPITAL,
66 LABEL_GOLD,
67 LABEL_SEP1,
68 LABEL_TAX,
69 LABEL_SCIENCE,
70 LABEL_LUXURY,
71 LABEL_SEP2,
72 LABEL_RESEARCHING,
73 LABEL_CULTURE,
74 LABEL_LAST
75};
76
77/******************************************************************/
78 struct intel_dialog {
79 struct player *pplayer;
80 GtkWidget *shell;
81
82 GtkTreeStore *diplstates;
83 GtkListStore *techs;
84 GtkWidget *table_labels[LABEL_LAST];
85};
86
87#define SPECLIST_TAG dialog
88#define SPECLIST_TYPE struct intel_dialog
89#include "speclist.h"
90
91#define dialog_list_iterate(dialoglist, pdialog) \
92 TYPED_LIST_ITERATE(struct intel_dialog, dialoglist, pdialog)
93#define dialog_list_iterate_end LIST_ITERATE_END
94
95 struct intel_wonder_dialog {
96 struct player *pplayer;
97 GtkWidget *shell;
98
99 GtkListStore *wonders;
100 GtkWidget *rule;
101};
102
103#define SPECLIST_TAG wonder_dialog
104#define SPECLIST_TYPE struct intel_wonder_dialog
105#include "speclist.h"
106
107#define wonder_dialog_list_iterate(dialoglist, pdialog) \
108 TYPED_LIST_ITERATE(struct intel_wonder_dialog, dialoglist, pdialog)
109#define wonder_dialog_list_iterate_end LIST_ITERATE_END
110
111 static struct dialog_list *dialog_list;
112static struct intel_dialog *create_intel_dialog(struct player *p);
113 static struct wonder_dialog_list *wonder_dialogs;
114static struct intel_wonder_dialog *create_intel_wonder_dialog(struct player *p);
115
116/**********************************************************************/
119 void intel_dialog_init(void)
120{
121 dialog_list = dialog_list_new();
122 wonder_dialogs = wonder_dialog_list_new();
123}
124
125/**********************************************************************/
128 void intel_dialog_done(void)
129{
130 dialog_list_destroy(dialog_list);
131 wonder_dialog_list_destroy(wonder_dialogs);
132}
133
134/**********************************************************************/
138 static struct intel_dialog *get_intel_dialog(struct player *pplayer)
139{
140 dialog_list_iterate(dialog_list, pdialog) {
141 if (pdialog->pplayer == pplayer) {
142 return pdialog;
143 }
144 } dialog_list_iterate_end;
145
146 return NULL;
147}
148
149/**********************************************************************/
153 static struct intel_wonder_dialog *get_intel_wonder_dialog(struct player *pplayer)
154{
155 wonder_dialog_list_iterate(wonder_dialogs, pdialog) {
156 if (pdialog->pplayer == pplayer) {
157 return pdialog;
158 }
159 } wonder_dialog_list_iterate_end;
160
161 return NULL;
162}
163
164/**********************************************************************/
167 void popup_intel_dialog(struct player *p)
168{
169 struct intel_dialog *pdialog;
170
171 if (!(pdialog = get_intel_dialog(p))) {
172 pdialog = create_intel_dialog(p);
173 }
174
175 update_intel_dialog(p);
176
177 gtk_window_present(GTK_WINDOW(pdialog->shell));
178}
179
180/**********************************************************************/
183 void popup_intel_wonder_dialog(struct player *p)
184{
185 struct intel_wonder_dialog *pdialog;
186
187 if (!(pdialog = get_intel_wonder_dialog(p))) {
188 pdialog = create_intel_wonder_dialog(p);
189 }
190
191 update_intel_wonder_dialog(p);
192
193 gtk_window_present(GTK_WINDOW(pdialog->shell));
194}
195
196/**********************************************************************/
199 static void intel_destroy_callback(GtkWidget *w, gpointer data)
200{
201 struct intel_dialog *pdialog = (struct intel_dialog *)data;
202
203 dialog_list_remove(dialog_list, pdialog);
204
205 free(pdialog);
206}
207
208/**********************************************************************/
211 static void intel_wonder_destroy_callback(GtkWidget *w, gpointer data)
212{
213 struct intel_wonder_dialog *pdialog = (struct intel_wonder_dialog *)data;
214
215 wonder_dialog_list_remove(wonder_dialogs, pdialog);
216
217 free(pdialog);
218}
219
220/**********************************************************************/
223 void close_intel_dialog(struct player *p)
224{
225 struct intel_dialog *pdialog = get_intel_dialog(p);
226
227 intel_destroy_callback(NULL, pdialog);
228}
229
230/**********************************************************************/
233 void close_intel_wonder_dialog(struct player *p)
234{
235 struct intel_wonder_dialog *pdialog = get_intel_wonder_dialog(p);
236
237 intel_wonder_destroy_callback(NULL, pdialog);
238}
239
240/**********************************************************************/
244 static struct intel_dialog *create_intel_dialog(struct player *p)
245{
246 struct intel_dialog *pdialog;
247
248 GtkWidget *shell, *notebook, *label, *sw, *view, *table;
249 GtkCellRenderer *rend;
250 GtkTreeViewColumn *col;
251 int i;
252
253 pdialog = fc_malloc(sizeof(*pdialog));
254 pdialog->pplayer = p;
255
256 shell = gtk_dialog_new_with_buttons(NULL,
257 NULL,
258 0,
259 _("_Close"),
260 GTK_RESPONSE_CLOSE,
261 NULL);
262 pdialog->shell = shell;
263 gtk_window_set_default_size(GTK_WINDOW(shell), 350, 350);
264 setup_dialog(shell, toplevel);
265 gtk_dialog_set_default_response(GTK_DIALOG(shell), GTK_RESPONSE_CLOSE);
266
267 g_signal_connect(shell, "destroy",
268 G_CALLBACK(intel_destroy_callback), pdialog);
269 g_signal_connect(shell, "response",
270 G_CALLBACK(gtk_widget_destroy), NULL);
271
272 notebook = gtk_notebook_new();
273 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_BOTTOM);
274 gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(shell))), notebook);
275
276 /* overview tab. */
277 table = gtk_grid_new();
278 g_object_set(table, "margin", 6, NULL);
279
280 gtk_grid_set_row_spacing(GTK_GRID(table), 2);
281 gtk_grid_set_column_spacing(GTK_GRID(table), 12);
282
283 /* TRANS: Overview tab of foreign intelligence report dialog */
284 label = gtk_label_new_with_mnemonic(_("_Overview"));
285 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table, label);
286
287 for (i = 0; i < ARRAY_SIZE(table_text); i++) {
288 if (table_text[i]) {
289 label = gtk_label_new(_(table_text[i]));
290 gtk_widget_set_halign(label, GTK_ALIGN_START);
291 gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
292 gtk_grid_attach(GTK_GRID(table), label, 0, i, 1, 1);
293
294 label = gtk_label_new(NULL);
295 pdialog->table_labels[i] = label;
296 gtk_widget_set_halign(label, GTK_ALIGN_START);
297 gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
298 gtk_grid_attach(GTK_GRID(table), label, 1, i, 1, 1);
299 } else {
300 pdialog->table_labels[i] = NULL;
301 }
302 }
303
304 /* diplomacy tab. */
305 pdialog->diplstates = gtk_tree_store_new(1, G_TYPE_STRING);
306
307 view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(pdialog->diplstates));
308 g_object_set(view, "margin", 6, NULL);
309 gtk_widget_set_hexpand(view, TRUE);
310 gtk_widget_set_vexpand(view, TRUE);
311 g_object_unref(pdialog->diplstates);
312 gtk_container_set_border_width(GTK_CONTAINER(view), 6);
313 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE);
314
315 rend = gtk_cell_renderer_text_new();
316 col = gtk_tree_view_column_new_with_attributes(NULL, rend,
317 "text", 0, NULL);
318 gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
319
320 gtk_tree_view_expand_all(GTK_TREE_VIEW(view));
321
322 sw = gtk_scrolled_window_new(NULL,NULL);
323 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
324 GTK_SHADOW_ETCHED_IN);
325 gtk_container_add(GTK_CONTAINER(sw), view);
326
327 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
328 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
329
330 label = gtk_label_new_with_mnemonic(_("_Diplomacy"));
331 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), sw, label);
332
333 /* techs tab. */
334 pdialog->techs = gtk_list_store_new(2, G_TYPE_BOOLEAN, G_TYPE_STRING);
335 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(pdialog->techs),
336 1, GTK_SORT_ASCENDING);
337
338 view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(pdialog->techs));
339 g_object_set(view, "margin", 6, NULL);
340 gtk_widget_set_hexpand(view, TRUE);
341 gtk_widget_set_vexpand(view, TRUE);
342 g_object_unref(pdialog->techs);
343 gtk_container_set_border_width(GTK_CONTAINER(view), 6);
344 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE);
345
346 rend = gtk_cell_renderer_toggle_new();
347 col = gtk_tree_view_column_new_with_attributes(NULL, rend,
348 "active", 0, NULL);
349 gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
350
351 rend = gtk_cell_renderer_text_new();
352 col = gtk_tree_view_column_new_with_attributes(NULL, rend,
353 "text", 1, NULL);
354 gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
355
356 sw = gtk_scrolled_window_new(NULL,NULL);
357 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
358 GTK_SHADOW_ETCHED_IN);
359 gtk_container_add(GTK_CONTAINER(sw), view);
360
361 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
362 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
363
364 label = gtk_label_new_with_mnemonic(_("_Techs"));
365 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), sw, label);
366
367 gtk_widget_show_all(gtk_dialog_get_content_area(GTK_DIALOG(shell)));
368
369 dialog_list_prepend(dialog_list, pdialog);
370
371 return pdialog;
372}
373
374/**********************************************************************/
378 static struct intel_wonder_dialog *create_intel_wonder_dialog(struct player *p)
379{
380 struct intel_wonder_dialog *pdialog;
381 GtkWidget *shell, *sw, *view;
382 GtkCellRenderer *rend;
383 GtkWidget *box;
384
385 pdialog = fc_malloc(sizeof(*pdialog));
386 pdialog->pplayer = p;
387
388 shell = gtk_dialog_new_with_buttons(NULL,
389 NULL,
390 0,
391 _("_Close"),
392 GTK_RESPONSE_CLOSE,
393 NULL);
394 pdialog->shell = shell;
395 gtk_window_set_default_size(GTK_WINDOW(shell), 350, 350);
396 setup_dialog(shell, toplevel);
397 gtk_dialog_set_default_response(GTK_DIALOG(shell), GTK_RESPONSE_CLOSE);
398
399 g_signal_connect(shell, "destroy",
400 G_CALLBACK(intel_wonder_destroy_callback), pdialog);
401 g_signal_connect(shell, "response",
402 G_CALLBACK(gtk_widget_destroy), NULL);
403
404
405 pdialog->rule = gtk_label_new("-");
406
407 /* columns: 0 - wonder name, 1 - location (city/unknown/lost),
408 * 2 - strikethrough (for lost or obsolete),
409 * 3 - font weight (great wonders in bold) */
410 pdialog->wonders = gtk_list_store_new(4, G_TYPE_STRING,
411 G_TYPE_STRING,
412 G_TYPE_BOOLEAN,
413 G_TYPE_INT);
414 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(pdialog->wonders),
415 3, GTK_SORT_DESCENDING);
416 view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(pdialog->wonders));
417 g_object_set(view, "margin", 6, NULL);
418 gtk_widget_set_hexpand(view, TRUE);
419 gtk_widget_set_vexpand(view, TRUE);
420 g_object_unref(pdialog->wonders);
421 gtk_container_set_border_width(GTK_CONTAINER(view), 6);
422 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE);
423
424 rend = gtk_cell_renderer_text_new();
425 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), -1, NULL,
426 rend, "text", 0,
427 "strikethrough", 2,
428 "weight", 3,
429 NULL);
430
431 rend = gtk_cell_renderer_text_new();
432 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), -1, NULL,
433 rend, "text", 1,
434 NULL);
435
436 sw = gtk_scrolled_window_new(NULL, NULL);
437 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
438 GTK_SHADOW_ETCHED_IN);
439 box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
440 gtk_container_add(GTK_CONTAINER(box), pdialog->rule);
441 gtk_container_add(GTK_CONTAINER(box), view);
442 gtk_container_add(GTK_CONTAINER(sw), box);
443
444 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
445 GTK_POLICY_AUTOMATIC,
446 GTK_POLICY_AUTOMATIC);
447
448 gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(shell))),
449 sw);
450
451 gtk_widget_show_all(gtk_dialog_get_content_area(GTK_DIALOG(shell)));
452
453 wonder_dialog_list_prepend(wonder_dialogs, pdialog);
454
455 return pdialog;
456}
457
458/**********************************************************************/
462 void update_intel_dialog(struct player *p)
463{
464 struct intel_dialog *pdialog = get_intel_dialog(p);
465
466 if (pdialog) {
467 const struct research *mresearch, *presearch;
468 GtkTreeIter diplstates[DS_LAST];
469 int i;
470 bool global_observer = client_is_global_observer();
471 struct player *me = client_player();
472 bool embassy_knowledge = global_observer || team_has_embassy(me->team, p);
473 bool trade_knowledge = global_observer || p == me || could_intel_with_player(me, p);
474
475 /* window title. */
476 gchar *title = g_strdup_printf(_("Foreign Intelligence: %s Empire"),
477 nation_adjective_for_player(p));
478 gtk_window_set_title(GTK_WINDOW(pdialog->shell), title);
479 g_free(title);
480
481 /* diplomacy tab. */
482 gtk_tree_store_clear(pdialog->diplstates);
483
484 for (i = 0; i < ARRAY_SIZE(diplstates); i++) {
485 GtkTreeIter it;
486 GValue v = { 0, };
487
488 gtk_tree_store_append(pdialog->diplstates, &it, NULL);
489 g_value_init(&v, G_TYPE_STRING);
490 g_value_set_static_string(&v, diplstate_type_translated_name(i));
491 gtk_tree_store_set_value(pdialog->diplstates, &it, 0, &v);
492 g_value_unset(&v);
493 diplstates[i] = it;
494 }
495
496 players_iterate(other) {
497 const struct player_diplstate *state;
498 GtkTreeIter it;
499 GValue v = { 0, };
500
501 if (other == p || !other->is_alive) {
502 continue;
503 }
504 state = player_diplstate_get(p, other);
505 gtk_tree_store_append(pdialog->diplstates, &it,
506 &diplstates[state->type]);
507 g_value_init(&v, G_TYPE_STRING);
508 g_value_set_static_string(&v, player_name(other));
509 gtk_tree_store_set_value(pdialog->diplstates, &it, 0, &v);
510 g_value_unset(&v);
511 } players_iterate_end;
512
513 /* techs tab. */
514 gtk_list_store_clear(pdialog->techs);
515
516 mresearch = research_get(client_player());
517 presearch = research_get(p);
518 advance_index_iterate(A_FIRST, advi) {
519 if (research_invention_state(presearch, advi) == TECH_KNOWN) {
520 GtkTreeIter it;
521
522 gtk_list_store_append(pdialog->techs, &it);
523
524 gtk_list_store_set(pdialog->techs, &it,
525 0, research_invention_state(mresearch, advi)
526 != TECH_KNOWN,
527 1, research_advance_name_translation(presearch,
528 advi),
529 -1);
530 }
531 } advance_index_iterate_end;
532
533 /* table labels. */
534 for (i = 0; i < ARRAY_SIZE(pdialog->table_labels); i++) {
535 if (pdialog->table_labels[i]) {
536 struct city *pcity;
537 gchar *buf = NULL;
538 char tbuf[256];
539
540 switch (i) {
541 case LABEL_RULER:
542 ruler_title_for_player(p, tbuf, sizeof(tbuf));
543 buf = g_strdup(tbuf);
544 break;
545 case LABEL_GOVERNMENT:
546 if (trade_knowledge) {
547 buf = g_strdup(government_name_for_player(p));
548 } else {
549 buf = g_strdup(_("(Unknown)"));
550 }
551 break;
552 case LABEL_CAPITAL:
553 pcity = player_primary_capital(p);
554 /* TRANS: "unknown" location */
555 buf = g_strdup((!pcity) ? _("(Unknown)") : city_name_get(pcity));
556 break;
557 case LABEL_GOLD:
558 if (trade_knowledge) {
559 buf = g_strdup_printf("%d", p->economic.gold);
560 } else {
561 buf = g_strdup(_("(Unknown)"));
562 }
563 break;
564 case LABEL_TAX:
565 if (embassy_knowledge) {
566 buf = g_strdup_printf("%d%%", p->economic.tax);
567 } else {
568 buf = g_strdup(_("(Unknown)"));
569 }
570 break;
571 case LABEL_SCIENCE:
572 if (embassy_knowledge) {
573 buf = g_strdup_printf("%d%%", p->economic.science);
574 } else {
575 buf = g_strdup(_("(Unknown)"));
576 }
577 break;
578 case LABEL_LUXURY:
579 if (embassy_knowledge) {
580 buf = g_strdup_printf("%d%%", p->economic.luxury);
581 } else {
582 buf = g_strdup(_("(Unknown)"));
583 }
584 break;
585 case LABEL_RESEARCHING:
586 {
587 struct research *research = research_get(p);
588
589 switch (research->researching) {
590 case A_UNKNOWN:
591 /* TRANS: "Unknown" advance/technology */
592 buf = g_strdup(_("(Unknown)"));
593 break;
594 case A_UNSET:
595 if (embassy_knowledge) {
596 /* TRANS: missing value */
597 buf = g_strdup(_("(none)"));
598 } else {
599 buf = g_strdup(_("(Unknown)"));
600 }
601 break;
602 default:
603 buf = g_strdup_printf("%s(%d/%d)",
604 research_advance_name_translation
605 (research, research->researching),
606 research->bulbs_researched,
607 research->client.researching_cost);
608 break;
609 }
610 break;
611 }
612 case LABEL_CULTURE:
613 if (embassy_knowledge) {
614 buf = g_strdup_printf("%d", p->client.culture);
615 } else {
616 buf = g_strdup(_("(Unknown)"));
617 }
618 break;
619 }
620
621 if (buf) {
622 gtk_label_set_text(GTK_LABEL(pdialog->table_labels[i]), buf);
623 g_free(buf);
624 }
625 }
626 }
627 }
628
629 /* Update also wonders list dialog */
630 update_intel_wonder_dialog(p);
631}
632
633/**********************************************************************/
636 void update_intel_wonder_dialog(struct player *p)
637{
638 struct intel_wonder_dialog *pdialog = get_intel_wonder_dialog(p);
639
640 if (pdialog != NULL) {
641 gchar *title = g_strdup_printf(_("Wonders of %s Empire"),
642 nation_adjective_for_player(p));
643 const char *rule = NULL;
644
645 gtk_window_set_title(GTK_WINDOW(pdialog->shell), title);
646 g_free(title);
647
648 switch (game.info.small_wonder_visibility) {
649 case WV_ALWAYS:
650 rule = _("All Wonders are known");
651 break;
652 case WV_NEVER:
653 rule = _("Small Wonders not known");
654 break;
655 case WV_EMBASSY:
656 rule = _("Small Wonders visible if we have an embassy");
657 break;
658 }
659
660 gtk_label_set_text(GTK_LABEL(pdialog->rule), rule);
661
662 gtk_list_store_clear(pdialog->wonders);
663
664 improvement_iterate(impr) {
665 if (is_wonder(impr)) {
666 GtkTreeIter it;
667 const char *cityname;
668 bool is_lost = FALSE;
669
670 if (wonder_is_built(p, impr)) {
671 struct city *pcity = city_from_wonder(p, impr);
672 if (pcity) {
673 cityname = city_name_get(pcity);
674 } else {
675 cityname = _("(unknown city)");
676 }
677 if (improvement_obsolete(p, impr, NULL)) {
678 is_lost = TRUE;
679 }
680 } else if (wonder_is_lost(p, impr)) {
681 cityname = _("(lost)");
682 is_lost = TRUE;
683 } else {
684 continue;
685 }
686
687 gtk_list_store_append(pdialog->wonders, &it);
688 gtk_list_store_set(pdialog->wonders, &it,
689 0, improvement_name_translation(impr),
690 1, cityname,
691 2, is_lost,
692 /* font weight: great wonders in bold */
693 3, is_great_wonder(impr) ? 700 : 400,
694 -1);
695 }
696 } improvement_iterate_end;
697 }
698}
city_name_get
const char * city_name_get(const struct city *pcity)
Definition city.c:1128
client_is_global_observer
bool client_is_global_observer(void)
Definition client_main.c:1345
client_main.h
client_player
#define client_player()
Definition client_main.h:106
incite_cost
char * incite_cost
Definition comments.c:74
could_intel_with_player
bool could_intel_with_player(const struct player *pplayer, const struct player *aplayer)
Definition diptreaty.c:84
fcintl.h
_
#define _(String)
Definition fcintl.h:67
N_
#define N_(String)
Definition fcintl.h:69
game
struct civ_game game
Definition game.c:62
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
toplevel
GtkWidget * toplevel
Definition gui_main.c:125
setup_dialog
void setup_dialog(GtkWidget *shell, GtkWidget *parent)
Definition gui_stuff.c:287
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
intel_wonder_destroy_callback
static void intel_wonder_destroy_callback(GtkWidget *w, gpointer data)
Definition inteldlg.c:211
close_intel_wonder_dialog
void close_intel_wonder_dialog(struct player *p)
Definition inteldlg.c:233
get_intel_wonder_dialog
static struct intel_wonder_dialog * get_intel_wonder_dialog(struct player *pplayer)
Definition inteldlg.c:153
close_intel_dialog
void close_intel_dialog(struct player *p)
Definition inteldlg.c:223
wonder_dialog_list_iterate_end
#define wonder_dialog_list_iterate_end
Definition inteldlg.c:109
table_text
static const char * table_text[]
Definition inteldlg.c:48
update_intel_wonder_dialog
void update_intel_wonder_dialog(struct player *p)
Definition inteldlg.c:636
intel_destroy_callback
static void intel_destroy_callback(GtkWidget *w, gpointer data)
Definition inteldlg.c:199
wonder_dialog_list_iterate
#define wonder_dialog_list_iterate(dialoglist, pdialog)
Definition inteldlg.c:107
dialog_list_iterate_end
#define dialog_list_iterate_end
Definition inteldlg.c:93
popup_intel_wonder_dialog
void popup_intel_wonder_dialog(struct player *p)
Definition inteldlg.c:183
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
wonder_dialogs
static struct wonder_dialog_list * wonder_dialogs
Definition inteldlg.c:113
table_label
table_label
Definition inteldlg.c:62
LABEL_GOLD
@ LABEL_GOLD
Definition inteldlg.c:66
LABEL_GOVERNMENT
@ LABEL_GOVERNMENT
Definition inteldlg.c:64
LABEL_SEP2
@ LABEL_SEP2
Definition inteldlg.c:71
LABEL_LUXURY
@ LABEL_LUXURY
Definition inteldlg.c:70
LABEL_SCIENCE
@ LABEL_SCIENCE
Definition inteldlg.c:69
LABEL_RULER
@ LABEL_RULER
Definition inteldlg.c:63
LABEL_CULTURE
@ LABEL_CULTURE
Definition inteldlg.c:73
LABEL_CAPITAL
@ LABEL_CAPITAL
Definition inteldlg.c:65
LABEL_RESEARCHING
@ LABEL_RESEARCHING
Definition inteldlg.c:72
LABEL_TAX
@ LABEL_TAX
Definition inteldlg.c:68
LABEL_SEP1
@ LABEL_SEP1
Definition inteldlg.c:67
LABEL_LAST
@ LABEL_LAST
Definition inteldlg.c:74
create_intel_wonder_dialog
static struct intel_wonder_dialog * create_intel_wonder_dialog(struct player *p)
Definition inteldlg.c:378
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
shell
static struct gui_dialog * shell
Definition messagedlg.c:39
title
const char * title
Definition repodlgs.c:1314
gui_stuff.h
gui_main.h
inteldlg.h
mapview.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
is_great_wonder
bool is_great_wonder(const struct impr_type *pimprove)
Definition improvement.c:772
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_malloc
#define fc_malloc(sz)
Definition mem.h:34
nation_adjective_for_player
const char * nation_adjective_for_player(const struct player *pplayer)
Definition nation.c:169
nation.h
options.h
packets.h
player_name
const char * player_name(const struct player *pplayer)
Definition player.c:895
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
player_diplstate_get
struct player_diplstate * player_diplstate_get(const struct player *plr1, const struct player *plr2)
Definition player.c:324
player.h
players_iterate_end
#define players_iterate_end
Definition player.h:537
players_iterate
#define players_iterate(_pplayer)
Definition player.h:532
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
shared.h
ARRAY_SIZE
#define ARRAY_SIZE(x)
Definition shared.h:85
speclist.h
city
Definition city.h:320
civ_game::info
struct packet_game_info info
Definition game.h:89
intel_dialog
Definition inteldlg.c:78
intel_dialog::shell
GtkWidget * shell
Definition inteldlg.c:80
intel_dialog::diplstates
GtkTreeStore * diplstates
Definition inteldlg.c:82
intel_dialog::techs
GtkListStore * techs
Definition inteldlg.c:83
intel_dialog::pdialog
struct advanced_dialog * pdialog
Definition inteldlg.c:52
intel_dialog::pplayer
struct player * pplayer
Definition inteldlg.c:79
intel_dialog::table_labels
GtkWidget * table_labels[LABEL_LAST]
Definition inteldlg.c:84
intel_wonder_dialog
Definition inteldlg.c:95
intel_wonder_dialog::pplayer
struct player * pplayer
Definition inteldlg.c:96
intel_wonder_dialog::rule
GtkWidget * rule
Definition inteldlg.c:100
intel_wonder_dialog::wonders
GtkListStore * wonders
Definition inteldlg.c:99
intel_wonder_dialog::shell
GtkWidget * shell
Definition inteldlg.c:97
packet_game_info::small_wonder_visibility
enum wonder_visib_type small_wonder_visibility
Definition packets_gen.h:251
player_diplstate
Definition player.h:196
player_diplstate::type
enum diplstate_type type
Definition player.h:197
player_economic::luxury
int luxury
Definition player.h:64
player_economic::science
int science
Definition player.h:63
player_economic::tax
int tax
Definition player.h:62
player_economic::gold
int gold
Definition player.h:61
player
Definition player.h:247
player::diplstates
const struct player_diplstate ** diplstates
Definition player.h:276
player::is_alive
bool is_alive
Definition player.h:266
player::client
struct player::@70::@73 client
player::economic
struct player_economic economic
Definition player.h:282
player::culture
int culture
Definition player.h:365
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
view
Definition mapview_common.h:36
support.h
TRUE
#define TRUE
Definition support.h:46
FALSE
#define FALSE
Definition support.h:47
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