24#include <gdk/gdkkeysyms.h>
90 GdkEventButton *
event, gpointer data);
98static gint
cmp_func(gconstpointer a_p, gconstpointer b_p);
142 gtk_list_store_set(store, iter,
161 || !gtk_combo_box_get_active_iter(combo, &iter)) {
165 gtk_tree_model_get(gtk_combo_box_get_model(combo), &iter,
181 for (
itree_begin(gtk_combo_box_get_model(combo), &iter);
184 if (iter_tech == tech) {
186 gtk_combo_box_set_active_iter(combo, &iter.
it);
191 log_error(
"%s(): Tech %d not found in the combo.", __FUNCTION__, tech);
198 GdkEventButton *
event, gpointer data)
208 if (
event->button == 3) {
218 case TECH_PREREQS_KNOWN:
241 GtkAdjustment *hadjustment;
242 GtkAdjustment *vadjustment;
243 gint hadjustment_value;
244 gint vadjustment_value;
250 hadjustment = gtk_scrollable_get_hadjustment(GTK_SCROLLABLE(
widget));
251 vadjustment = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(
widget));
253 hadjustment_value = (gint)gtk_adjustment_get_value(hadjustment);
254 vadjustment_value = (gint)gtk_adjustment_get_value(vadjustment);
256 cairo_translate(cr, -hadjustment_value, -vadjustment_value);
274 diagram = gtk_layout_new(NULL, NULL);
275 gtk_widget_add_events(diagram,
276 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
277 | GDK_BUTTON2_MOTION_MASK | GDK_BUTTON3_MOTION_MASK);
278 g_signal_connect(diagram,
"draw",
280 g_signal_connect(diagram,
"button-release-event",
314 GtkScrolledWindow *sw = GTK_SCROLLED_WINDOW(gtk_widget_get_parent(diagram));
318 if (!GTK_IS_SCROLLED_WINDOW(sw)) {
322 reqtree = g_object_get_data(G_OBJECT(diagram),
"reqtree");
325 GtkAdjustment *adjust = NULL;
328 adjust = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(sw));
329 value = (gtk_adjustment_get_lower(adjust)
330 + gtk_adjustment_get_upper(adjust)
331 - gtk_adjustment_get_page_size(adjust)) /
width * x;
332 gtk_adjustment_set_value(adjust, value);
334 adjust = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(sw));
335 value = (gtk_adjustment_get_lower(adjust)
336 + gtk_adjustment_get_upper(adjust)
337 - gtk_adjustment_get_page_size(adjust)) /
height * y;
338 gtk_adjustment_set_value(adjust, value);
352 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
362 gtk_widget_queue_draw(GTK_WIDGET(preport->
drawing_area));
368static gint
cmp_func(gconstpointer a_p, gconstpointer b_p)
370 const gchar *a_str, *b_str;
371 gint a = GPOINTER_TO_INT(a_p), b = GPOINTER_TO_INT(b_p);
387 GList *sorting_list, *
item;
399 gtk_widget_queue_draw(GTK_WIDGET(preport->
drawing_area));
406 gtk_progress_bar_set_fraction(preport->
progress_bar, pct);
408 gtk_widget_queue_resize(GTK_WIDGET(preport->
progress_bar));
411 store = GTK_LIST_STORE(gtk_combo_box_get_model(preport->
reachable_techs));
412 gtk_list_store_clear(store);
418 sorting_list = g_list_prepend(sorting_list, GINT_TO_POINTER(i));
422 if (sorting_list != NULL) {
425 gtk_list_store_append(store, &iter);
431 sorting_list = g_list_sort(sorting_list,
cmp_func);
433 tech = GPOINTER_TO_INT(
item->data);
434 gtk_list_store_append(store, &iter);
442 g_list_free(sorting_list);
448 gtk_list_store_append(store, &iter);
459 store = GTK_LIST_STORE(gtk_combo_box_get_model(preport->
reachable_goals));
460 gtk_list_store_clear(store);
472 sorting_list = g_list_prepend(sorting_list, GINT_TO_POINTER(i));
476 if (sorting_list != NULL) {
478 gtk_list_store_append(store, &iter);
484 sorting_list = g_list_sort(sorting_list,
cmp_func);
486 tech = GPOINTER_TO_INT(
item->data);
487 gtk_list_store_append(store, &iter);
495 g_list_free(sorting_list);
500 gtk_list_store_append(store, &iter);
529 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(data))) {
564 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(data))) {
581 GtkWidget *frame, *table, *help_button, *show_all_button, *sw, *w;
585 GtkCellRenderer *renderer;
597 vbox = GTK_CONTAINER(preport->
shell->
vbox);
598 group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
600 w = gtk_label_new(NULL);
601 gtk_container_add(vbox, w);
605 frame = gtk_frame_new(
_(
"Researching"));
606 gtk_container_add(vbox, frame);
608 table = gtk_grid_new();
609 gtk_grid_set_column_spacing(GTK_GRID(table), 4);
610 gtk_container_add(GTK_CONTAINER(frame), table);
612 help_button = gtk_check_button_new_with_label(
_(
"Help"));
613 gtk_grid_attach(GTK_GRID(table), help_button, 5, 0, 1, 1);
616 w = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
617 gtk_size_group_add_widget(group, w);
618 g_object_unref(G_OBJECT(store));
619 renderer = gtk_cell_renderer_text_new();
620 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(w), renderer,
TRUE);
621 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(w), renderer,
"text",
626 gtk_grid_attach(GTK_GRID(table), w, 0, 0, 1, 1);
629 w = gtk_progress_bar_new();
630 gtk_widget_set_hexpand(w,
TRUE);
631 gtk_progress_bar_set_show_text(GTK_PROGRESS_BAR(w),
TRUE);
632 gtk_grid_attach(GTK_GRID(table), w, 2, 0, 1, 1);
633 gtk_widget_set_size_request(w, -1, 25);
637 frame = gtk_frame_new(
_(
"Goal"));
638 gtk_container_add(vbox, frame);
640 table = gtk_grid_new();
641 gtk_grid_set_column_spacing(GTK_GRID(table), 4);
642 gtk_container_add(GTK_CONTAINER(frame),table);
645 w = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
646 gtk_size_group_add_widget(group, w);
647 g_object_unref(G_OBJECT(store));
648 renderer = gtk_cell_renderer_text_new();
649 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(w), renderer,
TRUE);
650 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(w), renderer,
"text",
652 renderer = gtk_cell_renderer_text_new();
653 gtk_cell_layout_pack_end(GTK_CELL_LAYOUT(w), renderer,
FALSE);
654 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(w), renderer,
"text",
659 gtk_grid_attach(GTK_GRID(table), w, 0, 0, 1, 1);
662 w = gtk_label_new(NULL);
663 gtk_widget_set_hexpand(w,
TRUE);
664 gtk_grid_attach(GTK_GRID(table), w, 2, 0, 1, 1);
665 gtk_widget_set_size_request(w, -1, 25);
670 show_all_button = gtk_toggle_button_new_with_label(
_(
"Show all"));
671 gtk_grid_attach(GTK_GRID(table), show_all_button, 5, 0, 1, 1);
672 g_signal_connect(show_all_button,
"toggled",
679 sw = gtk_scrolled_window_new(NULL, NULL);
680 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
681 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
682 gtk_container_add(vbox, sw);
685 gtk_widget_set_hexpand(w,
TRUE);
686 gtk_widget_set_vexpand(w,
TRUE);
687 gtk_container_add(GTK_CONTAINER(sw), w);
692 gtk_widget_queue_draw(GTK_WIDGET(preport->
drawing_area));
693 g_object_unref(group);
709 memset(preport, 0,
sizeof(*preport));
723 if (NULL != presearch
832 return Q_(
"?Building or Unit type:Name");
834 return _(
"Redundant");
859 GtkTreeSelection *selection;
873 selection = gtk_tree_view_get_selection(preport->
tree_view);
874 if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
875 gtk_tree_model_get(model, &iter,
ERD_COL_CID, &selected, -1);
880 model = gtk_tree_view_get_model(preport->
tree_view);
881 store = GTK_LIST_STORE(model);
882 gtk_list_store_clear(store);
886 &building_total, &tax);
894 gtk_list_store_append(store, &iter);
895 gtk_list_store_set(store, &iter,
906 g_object_unref(G_OBJECT(pix));
907 if (selected ==
id) {
909 gtk_tree_selection_select_iter(selection, &iter);
919 direction8_invalid());
923 gtk_list_store_append(store, &iter);
924 gtk_list_store_set(store, &iter,
935 g_object_unref(G_OBJECT(pix));
936 if (selected ==
id) {
938 gtk_tree_selection_select_iter(selection, &iter);
943 fc_snprintf(buf,
sizeof(buf),
_(
"Income: %d Total Costs: %d"),
944 tax, building_total + unit_total);
945 gtk_label_set_text(preport->
label, buf);
956 GtkTreeSelection *selection = gtk_tree_view_get_selection(preport->
tree_view);
975 || !gtk_tree_selection_get_selected(selection, &model, &iter)) {
979 gtk_tree_model_get(model, &iter,
ERD_COL_CID, &
id, -1);
982 switch (selected.
kind) {
983 case VUT_IMPROVEMENT:
992 gtk_tree_model_get(model, &iter,
998 shell = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL
999 | GTK_DIALOG_DESTROY_WITH_PARENT,
1000 GTK_MESSAGE_QUESTION,
1004 ?
_(
"Do you really wish to sell "
1005 "every redundant %s (%d total)?")
1007 :
_(
"Do you really wish to sell "
1008 "every %s (%d total)?"),
1012 gtk_window_set_title(GTK_WINDOW(
shell),
_(
"Sell Improvements"));
1014 if (GTK_RESPONSE_YES == gtk_dialog_run(GTK_DIALOG(
shell))) {
1017 gtk_widget_destroy(
shell);
1026 gtk_tree_model_get(model, &iter,
ERD_COL_COUNT, &count, -1);
1028 shell = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL
1029 | GTK_DIALOG_DESTROY_WITH_PARENT,
1030 GTK_MESSAGE_QUESTION,
1033 _(
"Do you really wish to disband "
1034 "every %s (%d total)?"),
1038 gtk_window_set_title(GTK_WINDOW(
shell),
_(
"Disband Units"));
1040 if (GTK_RESPONSE_YES == gtk_dialog_run(GTK_DIALOG(
shell))) {
1043 gtk_widget_destroy(
shell);
1051 if (
'\0' != buf[0]) {
1052 shell = gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
1053 GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
1056 g_signal_connect(
shell,
"response", G_CALLBACK(gtk_widget_destroy),
1058 gtk_window_set_title(GTK_WINDOW(
shell),
_(
"Sell-Off: Results"));
1059 gtk_window_present(GTK_WINDOW(
shell));
1070 GtkTreeModel *model;
1074 && gtk_tree_selection_get_selected(selection, &model, &iter)) {
1078 gtk_tree_model_get(model, &iter,
ERD_COL_CID, &
id, -1);
1080 switch (selected.
kind) {
1081 case VUT_IMPROVEMENT:
1088 can_sell && redundant > 0);
1117 GtkWidget *
view, *sw, *label, *button;
1118 GtkListStore *store;
1119 GtkTreeSelection *selection;
1128 vbox = GTK_CONTAINER(preport->
shell->
vbox);
1130 sw = gtk_scrolled_window_new(NULL, NULL);
1131 gtk_widget_set_halign(sw, GTK_ALIGN_CENTER);
1132 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
1133 GTK_SHADOW_ETCHED_IN);
1134 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
1135 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
1136 gtk_container_add(GTK_CONTAINER(vbox), sw);
1139 view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
1140 gtk_widget_set_vexpand(
view,
TRUE);
1141 g_object_unref(store);
1142 gtk_widget_set_name(
view,
"small_font");
1143 gtk_tree_view_columns_autosize(GTK_TREE_VIEW(
view));
1144 gtk_container_add(GTK_CONTAINER(sw),
view);
1147 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(
view));
1148 g_signal_connect(selection,
"changed",
1152 GtkCellRenderer *renderer;
1153 GtkTreeViewColumn *col;
1154 GType
type = gtk_tree_model_get_column_type(GTK_TREE_MODEL(store), i);
1156 if (GDK_TYPE_PIXBUF ==
type) {
1157 renderer = gtk_cell_renderer_pixbuf_new();
1158 col = gtk_tree_view_column_new_with_attributes(
title, renderer,
1161 }
else if (G_TYPE_BOOLEAN ==
type) {
1162 renderer = gtk_cell_renderer_toggle_new();
1163 col = gtk_tree_view_column_new_with_attributes(
title, renderer,
1168 renderer = gtk_cell_renderer_text_new();
1171 col = gtk_tree_view_column_new_with_attributes(
title, renderer,
1177 col = gtk_tree_view_column_new_with_attributes(
title, renderer,
1183 g_object_set(G_OBJECT(renderer),
"xalign", 1.0, NULL);
1184 gtk_tree_view_column_set_alignment(col, 1.0);
1187 gtk_tree_view_append_column(GTK_TREE_VIEW(
view), col);
1190 label = gtk_label_new(NULL);
1191 gtk_container_add(vbox, label);
1192 gtk_widget_set_margin_start(label, 5);
1193 gtk_widget_set_margin_end(label, 5);
1194 gtk_widget_set_margin_top(label, 5);
1195 gtk_widget_set_margin_bottom(label, 5);
1196 preport->
label = GTK_LABEL(label);
1199 GTK_RESPONSE_CLOSE);
1203 gtk_widget_set_sensitive(button,
FALSE);
1207 gtk_widget_set_sensitive(button,
FALSE);
1211 gtk_widget_set_sensitive(button,
FALSE);
1235 memset(preport, 0,
sizeof(*preport));
1310static const struct {
1317 { G_TYPE_STRING,
N_(
"Unit Type"),
1319 { G_TYPE_BOOLEAN,
N_(
"?Upgradable unit [short]:U"),
1324 { G_TYPE_INT,
N_(
"In-Prog"),
1325 N_(
"In progress"),
TRUE, -1 },
1326 { G_TYPE_INT,
N_(
"Active"),
1328 { G_TYPE_INT,
N_(
"Shield"),
1329 N_(
"Total shield upkeep"),
TRUE, -1 },
1330 { G_TYPE_INT,
N_(
"Food"),
1331 N_(
"Total food upkeep"),
TRUE, -1 },
1332 { G_TYPE_INT,
N_(
"Gold"),
1333 N_(
"Total gold upkeep"),
TRUE, -1 },
1334 { G_TYPE_STRING,
" ",
1337 { G_TYPE_INT, NULL },
1338 { G_TYPE_BOOLEAN, NULL },
1339 { G_TYPE_BOOLEAN, NULL },
1340 { G_TYPE_INT, NULL }
1371 struct urd_info unit_totals;
1372 struct urd_info *info;
1373 int total_upgradable_count = 0;
1374 GtkTreeSelection *selection;
1375 GtkTreeModel *model;
1376 GtkListStore *store;
1382 memset(unit_array,
'\0',
sizeof(unit_array));
1383 memset(&unit_totals,
'\0',
sizeof(unit_totals));
1399 info->active_count++;
1402 if (VUT_UTYPE == pcity->production.kind) {
1404 info = unit_array +
utype_index(pcity->production.value.utype);
1408 num_units =
MAX(num_units, 1);
1409 info->building_count += num_units;
1415 selection = gtk_tree_view_get_selection(preport->
tree_view);
1416 if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
1423 model = gtk_tree_view_get_model(preport->
tree_view);
1424 store = GTK_LIST_STORE(model);
1425 gtk_list_store_clear(store);
1431 info = unit_array + utype_id;
1433 if (0 == info->active_count && 0 == info->building_count) {
1440 gtk_list_store_append(store, &iter);
1441 gtk_list_store_set(store, &iter,
1456 if (selected == utype_id) {
1458 gtk_tree_selection_select_iter(selection, &iter);
1462 unit_totals.active_count += info->active_count;
1464 unit_totals.upkeep[o] += info->upkeep[o];
1466 unit_totals.building_count += info->building_count;
1468 total_upgradable_count += info->active_count;
1473 gtk_list_store_append(store, &iter);
1474 gtk_list_store_set(store, &iter,
1489 if (selected ==
U_LAST) {
1491 gtk_tree_selection_select_iter(selection, &iter);
1502 GtkTreeModel *model;
1507 if (gtk_tree_selection_get_selected(selection, &model, &it)) {
1510 gtk_tree_model_get(model, &it,
1514 if (0 < active_count) {
1519 if (NULL == utype) {
1539 struct unit *best_candidate = NULL;
1554 if (dist < best_dist) {
1555 best_candidate =
punit;
1562 return best_candidate;
1574 GtkTreeSelection *selection;
1575 GtkTreeModel *model;
1588 selection = gtk_tree_view_get_selection(preport->
tree_view);
1589 if (gtk_tree_selection_get_selected(selection, &model, &it)) {
1618 "Treasury contains %d gold.",
1622 shell = gtk_message_dialog_new(NULL,
1624 | GTK_DIALOG_DESTROY_WITH_PARENT,
1625 GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
1628 PL_(
"Upgrade as many %s to %s as possible "
1629 "for %d gold each?\n%s",
1630 "Upgrade as many %s to %s as possible "
1631 "for %d gold each?\n%s", price),
1637 gtk_window_set_title(GTK_WINDOW(
shell),
_(
"Upgrade Obsolete Units"));
1639 if (GTK_RESPONSE_YES == gtk_dialog_run(GTK_DIALOG(
shell))) {
1643 gtk_widget_destroy(
shell);
1652 GtkWidget *
view, *sw, *button;
1653 GtkListStore *store;
1654 GtkTreeSelection *selection;
1656 GtkTreeViewColumn *col = NULL;
1663 vbox = GTK_CONTAINER(preport->
shell->
vbox);
1665 sw = gtk_scrolled_window_new(NULL,NULL);
1666 gtk_widget_set_halign(sw, GTK_ALIGN_CENTER);
1667 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
1668 GTK_SHADOW_ETCHED_IN);
1669 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
1670 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
1671 gtk_container_add(GTK_CONTAINER(vbox), sw);
1674 view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
1675 gtk_widget_set_vexpand(
view,
TRUE);
1676 g_object_unref(store);
1677 gtk_widget_set_name(
view,
"small_font");
1678 gtk_tree_view_columns_autosize(GTK_TREE_VIEW(
view));
1679 gtk_container_add(GTK_CONTAINER(sw),
view);
1682 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(
view));
1683 g_signal_connect(selection,
"changed",
1687 GtkCellRenderer *renderer;
1692 gtk_widget_set_tooltip_text(header,
1695 gtk_widget_show(header);
1696 col = gtk_tree_view_column_new();
1697 gtk_tree_view_column_set_widget(col, header);
1699 gtk_tree_view_column_set_alignment(col, 1.0);
1701 gtk_tree_view_append_column(GTK_TREE_VIEW(
view), col);
1706 renderer = gtk_cell_renderer_toggle_new();
1707 gtk_tree_view_column_pack_start(col, renderer,
FALSE);
1708 gtk_tree_view_column_add_attribute(col, renderer,
"active", i);
1710 renderer = gtk_cell_renderer_text_new();
1711 gtk_tree_view_column_pack_start(col, renderer,
TRUE);
1712 gtk_tree_view_column_add_attribute(col, renderer,
"text", i);
1713 gtk_tree_view_column_add_attribute(col, renderer,
1718 gtk_tree_view_column_add_attribute(col, renderer,
"visible",
1723 g_object_set(G_OBJECT(renderer),
"xalign", 1.0, NULL);
1728 GTK_RESPONSE_CLOSE);
1732 gtk_widget_set_sensitive(button,
FALSE);
1736 gtk_widget_set_sensitive(button,
FALSE);
1759 memset(preport, 0,
sizeof(*preport));
1805 GtkListStore *
store;
1829 return _(
"Player\n");
1831 return _(
"Nation\n");
1833 return _(
"Score\n");
1849 GType col_types[col_num];
1850 GtkListStore *
store;
1851 GtkTreeViewColumn *col;
1857 while ((col = gtk_tree_view_get_column(preport->
tree_view, 0))) {
1858 gtk_tree_view_remove_column(preport->
tree_view, col);
1867 col_types[i] = G_TYPE_INT;
1869 store = gtk_list_store_newv(col_num, col_types);
1870 gtk_tree_view_set_model(preport->
tree_view, GTK_TREE_MODEL(
store));
1871 g_object_unref(G_OBJECT(
store));
1874 for (i = 0; (guint)i < col_num; i++) {
1875 GtkCellRenderer *renderer;
1877 const char *attribute;
1879 if (GDK_TYPE_PIXBUF == col_types[i]) {
1880 renderer = gtk_cell_renderer_pixbuf_new();
1881 attribute =
"pixbuf";
1883 renderer = gtk_cell_renderer_text_new();
1893 if (
title != NULL) {
1894 col = gtk_tree_view_column_new_with_attributes(
Q_(
title), renderer,
1895 attribute, i, NULL);
1896 gtk_tree_view_append_column(preport->
tree_view, col);
1897 if (GDK_TYPE_PIXBUF != col_types[i]) {
1898 gtk_tree_view_column_set_sort_column_id(col, i);
1903 gtk_tree_view_set_tooltip_column(GTK_TREE_VIEW(preport->
tree_view),
1922 gtk_list_store_append(preport->
store, &iter);
1923 gtk_list_store_set(preport->
store, &iter,
1930 gtk_list_store_set(preport->
store, &iter,
1947 GtkWidget *sw, *
view;
1957 sw = gtk_scrolled_window_new(NULL, NULL);
1958 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
1959 GTK_SHADOW_ETCHED_IN);
1960 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
1961 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
1962 gtk_container_add(GTK_CONTAINER(preport->
shell->
vbox), sw);
1964 view = gtk_tree_view_new();
1965 gtk_widget_set_name(
view,
"small_font");
1966 gtk_container_add(GTK_CONTAINER(sw),
view);
1970 gtk_widget_set_hexpand(GTK_WIDGET(
view),
TRUE);
1971 gtk_widget_set_vexpand(GTK_WIDGET(
view),
TRUE);
bool action_ever_possible(action_id action)
struct canvas int int struct sprite int int int int height
struct canvas int int struct sprite int int int width
bool city_production_build_units(const struct city *pcity, bool add_production, int *num_units)
#define city_list_iterate(citylist, pcity)
#define output_type_iterate(output)
#define city_list_iterate_end
#define output_type_iterate_end
bool client_is_global_observer(void)
bool can_client_issue_orders(void)
bool client_has_player(void)
cid cid_encode_building(const struct impr_type *pimprove)
struct universal cid_decode(cid id)
cid cid_encode_unit(const struct unit_type *punittype)
bool can_conn_edit(const struct connection *pconn)
void unit_focus_set_and_select(struct unit *punit)
#define can_unit_do_activity_client(_punit_, _act_)
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
#define PL_(String1, String2, n)
#define FC_STATIC_CANVAS_INIT
void gtk_tree_view_focus(GtkTreeView *view)
void gui_dialog_destroy(struct gui_dialog *dlg)
void gui_dialog_present(struct gui_dialog *dlg)
void gui_dialog_set_default_response(struct gui_dialog *dlg, int response)
void itree_get(ITree *it,...)
void gui_dialog_raise(struct gui_dialog *dlg)
void gui_dialog_new(struct gui_dialog **pdlg, GtkNotebook *notebook, gpointer user_data, bool check_top)
void gui_dialog_response_set_callback(struct gui_dialog *dlg, GUI_DIALOG_RESPONSE_FUN fun)
void itree_begin(GtkTreeModel *model, ITree *it)
GtkWidget * gui_dialog_add_button(struct gui_dialog *dlg, const char *text, int response)
void gui_dialog_show_all(struct gui_dialog *dlg)
void gui_dialog_set_title(struct gui_dialog *dlg, const char *title)
void gui_dialog_set_default_size(struct gui_dialog *dlg, int width, int height)
void gui_dialog_alert(struct gui_dialog *dlg)
void itree_next(ITree *it)
void setup_dialog(GtkWidget *shell, GtkWidget *parent)
void gui_dialog_set_response_sensitive(struct gui_dialog *dlg, int response, bool setting)
GtkWidget * gui_dialog_get_toplevel(struct gui_dialog *dlg)
gboolean itree_end(ITree *it)
void popup_help_dialog_typed(const char *item, enum help_page_type htype)
static struct gui_dialog * shell
GdkPixbuf * get_flag(const struct nation_type *nation)
static struct endgame_report endgame_report
static void units_report_init(struct units_report *preport)
void units_report_dialog_popdown(void)
static GtkListStore * units_report_store_new(void)
void science_report_dialog_popup(bool raise)
static void science_report_store_set(GtkListStore *store, GtkTreeIter *iter, Tech_type_id tech)
static void economy_report_init(struct economy_report *preport)
static void science_report_update(struct science_report *preport)
static void units_report_update(struct units_report *preport)
static bool science_report_combo_get_active(GtkComboBox *combo, Tech_type_id *tech, char **name)
void endgame_report_dialog_start(const struct packet_endgame_report *packet)
static void science_diagram_center(GtkWidget *diagram, Tech_type_id tech)
static void endgame_report_update(struct endgame_report *preport, const struct packet_endgame_report *packet)
void real_units_report_dialog_update(void *unused)
void real_economy_report_dialog_update(void *unused)
void economy_report_dialog_popdown(void)
static gboolean science_diagram_update(GtkWidget *widget, cairo_t *cr, gpointer data)
static gboolean science_diagram_button_release_callback(GtkWidget *widget, GdkEventButton *event, gpointer data)
static const char * endgame_report_column_name(enum endgame_report_columns col)
void economy_report_dialog_popup(bool raise)
static void endgame_report_init(struct endgame_report *preport)
static void science_report_combo_set_active(GtkComboBox *combo, Tech_type_id tech)
static void science_diagram_data(GtkWidget *widget, bool show_all)
static void science_report_free(struct science_report *preport)
static bool science_report_no_combo_callback
static const struct @155 unit_report_columns[]
void units_report_dialog_popup(bool raise)
static void economy_report_command_callback(struct gui_dialog *pdialog, int response, gpointer data)
static void units_report_command_callback(struct gui_dialog *pdialog, int response, gpointer data)
static void units_report_selection_callback(GtkTreeSelection *selection, gpointer data)
static void economy_report_update(struct economy_report *preport)
void science_report_dialog_redraw(void)
static const char * economy_report_column_name(enum economy_report_columns col)
static GtkWidget * science_diagram_new(void)
static void science_report_show_all_callback(GtkComboBox *combo, gpointer data)
void science_report_dialog_popdown(void)
static GtkListStore * economy_report_store_new(void)
static struct unit * find_nearest_unit(const struct unit_type *utype, struct tile *ptile)
static gint cmp_func(gconstpointer a_p, gconstpointer b_p)
static void economy_report_selection_callback(GtkTreeSelection *selection, gpointer data)
static void science_report_goal_callback(GtkComboBox *combo, gpointer data)
static void economy_report_free(struct economy_report *preport)
static void science_report_init(struct science_report *preport)
static void science_report_current_callback(GtkComboBox *combo, gpointer data)
void real_science_report_dialog_update(void *unused)
static void units_report_free(struct units_report *preport)
static GtkListStore * science_report_store_new(void)
static void science_report_redraw(struct science_report *preport)
GdkPixbuf * sprite_get_pixbuf(struct sprite *sprite)
bool can_sell_building(const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
#define fc_assert_ret(condition)
#define fc_assert(condition)
#define log_error(message,...)
int sq_map_distance(const struct tile *tile0, const struct tile *tile1)
struct tile * get_center_tile_mapcanvas(void)
void center_tile_mapcanvas(const struct tile *ptile)
struct nation_type * nation_of_player(const struct player *pplayer)
int dsend_packet_player_tech_goal(struct connection *pc, int tech)
int dsend_packet_player_research(struct connection *pc, int tech)
int dsend_packet_unit_type_upgrade(struct connection *pc, Unit_type_id type)
const char * science_dialog_text(void)
struct player * player_by_number(const int player_id)
const char * player_name(const struct player *pplayer)
#define players_iterate_end
#define players_iterate(_pplayer)
void get_economy_report_units_data(struct unit_entry *entries, int *num_entries_used, int *total_cost)
void get_economy_report_data(struct improvement_entry *entries, int *num_entries_used, int *total_cost, int *total_income)
void sell_all_improvements(const struct impr_type *pimprove, bool redundant_only, char *message, size_t message_sz)
void disband_all_units(const struct unit_type *punittype, bool in_cities_only, char *message, size_t message_sz)
endgame_report_dialog_player
void draw_reqtree(struct reqtree *tree, struct canvas *pcanvas, int canvas_x, int canvas_y, int tt_x, int tt_y, int w, int h)
void get_reqtree_dimensions(struct reqtree *reqtree, int *width, int *height)
Tech_type_id get_tech_on_reqtree(struct reqtree *tree, int x, int y)
bool find_tech_on_reqtree(struct reqtree *tree, Tech_type_id tech, int *x, int *y, int *w, int *h)
void destroy_reqtree(struct reqtree *tree)
struct reqtree * create_reqtree(struct player *pplayer, bool show_all)
int research_goal_unknown_techs(const struct research *presearch, Tech_type_id goal)
bool research_invention_reachable(const struct research *presearch, const Tech_type_id tech)
bool research_future_next(const struct research *presearch)
const char * research_advance_name_translation(const struct research *presearch, Tech_type_id tech)
struct research * research_get(const struct player *pplayer)
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
struct gui_dialog * shell
struct gui_dialog * shell
enum gui_dialog_type type
char category_name[32][MAX_LEN_NAME]
struct research::research_invention inventions[A_ARRAY_SIZE]
struct gui_dialog * shell
GtkProgressBar * progress_bar
GtkComboBox * reachable_techs
GtkComboBox * reachable_goals
GtkWidget * button_show_all
enum unit_activity activity
struct unit::@80::@82 client
const struct unit_type * utype
enum unit_focus_status focus_status
enum server_side_agent ssa_controller
struct gui_dialog * shell
int fc_snprintf(char *str, size_t n, const char *format,...)
int fc_strcoll(const char *str0, const char *str1)
bool is_future_tech(Tech_type_id tech)
#define advance_index_iterate_end
#define advance_index_iterate(_start, _index)
const char * score_tooltip(const struct player *pplayer, int score)
const char * get_science_target_text(double *percent)
const char * get_science_goal_text(Tech_type_id goal)
struct sprite * get_building_sprite(const struct tileset *t, const struct impr_type *pimprove)
struct sprite * get_unittype_sprite(const struct tileset *t, const struct unit_type *punittype, enum direction8 facing)
bool tileset_is_fully_loaded(void)
const struct unit_type * utype
const struct impr_type * building
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const struct unit_type * unit_type_get(const struct unit *punit)
const struct unit_type * can_upgrade_unittype(const struct player *pplayer, const struct unit_type *punittype)
Unit_type_id utype_count(void)
struct unit_type * utype_by_number(const Unit_type_id id)
Unit_type_id utype_number(const struct unit_type *punittype)
Unit_type_id utype_index(const struct unit_type *punittype)
const char * utype_name_translation(const struct unit_type *punittype)
int unit_upgrade_price(const struct player *pplayer, const struct unit_type *from, const struct unit_type *to)
#define unit_type_iterate(_p)
#define unit_type_iterate_end