24#include <gdk/gdkkeysyms.h>
102static gint
cmp_func(gconstpointer a_p, gconstpointer b_p);
146 gtk_list_store_set(store, iter,
165 || !gtk_combo_box_get_active_iter(combo, &iter)) {
169 gtk_tree_model_get(gtk_combo_box_get_model(combo), &iter,
186 for (
itree_begin(gtk_combo_box_get_model(combo), &iter);
189 if (iter_tech == tech) {
191 gtk_combo_box_set_active_iter(combo, &iter.
it);
196 log_error(
"%s(): Tech %d not found in the combo.", __FUNCTION__, tech);
206 GtkEventController *controller = GTK_EVENT_CONTROLLER(gesture);
207 GtkWidget *w = gtk_event_controller_get_widget(controller);
208 struct reqtree *
reqtree = g_object_get_data(G_OBJECT(w),
"reqtree");
221 case TECH_PREREQS_KNOWN:
243 GtkEventController *controller = GTK_EVENT_CONTROLLER(gesture);
244 GtkWidget *w = gtk_event_controller_get_widget(controller);
245 struct reqtree *
reqtree = g_object_get_data(G_OBJECT(w),
"reqtree");
273 int rtwidth, rtheight;
274 GtkAdjustment *hadjustment;
275 GtkAdjustment *vadjustment;
276 gint hadjustment_value;
277 gint vadjustment_value;
285 gtk_widget_set_size_request(GTK_WIDGET(
widget), rtwidth, rtheight);
287 vp = GTK_VIEWPORT(gtk_widget_get_parent(GTK_WIDGET(
widget)));
288 hadjustment = gtk_scrollable_get_hadjustment(GTK_SCROLLABLE(vp));
289 vadjustment = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(vp));
291 hadjustment_value = (gint)gtk_adjustment_get_value(hadjustment);
292 vadjustment_value = (gint)gtk_adjustment_get_value(vadjustment);
294 cairo_translate(cr, -hadjustment_value, -vadjustment_value);
308 GtkEventController *controller;
311 diagram = gtk_drawing_area_new();
312 gtk_drawing_area_set_draw_func(GTK_DRAWING_AREA(diagram),
315 controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
316 g_signal_connect(controller,
"released",
318 gtk_widget_add_controller(diagram, controller);
319 gesture = gtk_gesture_click_new();
320 gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), 3);
321 controller = GTK_EVENT_CONTROLLER(gesture);
322 g_signal_connect(controller,
"released",
324 gtk_widget_add_controller(diagram, controller);
353 GtkViewport *vp = GTK_VIEWPORT(gtk_widget_get_parent(diagram));
357 reqtree = g_object_get_data(G_OBJECT(diagram),
"reqtree");
360 GtkAdjustment *adjust = NULL;
363 adjust = gtk_scrollable_get_hadjustment(GTK_SCROLLABLE(vp));
364 value = (gtk_adjustment_get_lower(adjust)
365 + gtk_adjustment_get_upper(adjust)
366 - gtk_adjustment_get_page_size(adjust)) /
width * x;
367 gtk_adjustment_set_value(adjust, value);
369 adjust = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(vp));
370 value = (gtk_adjustment_get_lower(adjust)
371 + gtk_adjustment_get_upper(adjust)
372 - gtk_adjustment_get_page_size(adjust)) /
height * y;
373 gtk_adjustment_set_value(adjust, value);
387 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
397 gtk_widget_queue_draw(GTK_WIDGET(preport->
drawing_area));
403static gint
cmp_func(gconstpointer a_p, gconstpointer b_p)
405 const gchar *a_str, *b_str;
406 gint a = GPOINTER_TO_INT(a_p), b = GPOINTER_TO_INT(b_p);
422 GList *sorting_list, *
item;
434 gtk_widget_queue_draw(GTK_WIDGET(preport->
drawing_area));
441 gtk_progress_bar_set_fraction(preport->
progress_bar, pct);
443 gtk_widget_queue_resize(GTK_WIDGET(preport->
progress_bar));
446 store = GTK_LIST_STORE(gtk_combo_box_get_model(preport->
reachable_techs));
447 gtk_list_store_clear(store);
453 sorting_list = g_list_prepend(sorting_list, GINT_TO_POINTER(i));
457 if (sorting_list != NULL) {
460 gtk_list_store_append(store, &iter);
466 sorting_list = g_list_sort(sorting_list,
cmp_func);
468 tech = GPOINTER_TO_INT(
item->data);
469 gtk_list_store_append(store, &iter);
477 g_list_free(sorting_list);
483 gtk_list_store_append(store, &iter);
494 store = GTK_LIST_STORE(gtk_combo_box_get_model(preport->
reachable_goals));
495 gtk_list_store_clear(store);
507 sorting_list = g_list_prepend(sorting_list, GINT_TO_POINTER(i));
511 if (sorting_list != NULL) {
513 gtk_list_store_append(store, &iter);
519 sorting_list = g_list_sort(sorting_list,
cmp_func);
521 tech = GPOINTER_TO_INT(
item->data);
522 gtk_list_store_append(store, &iter);
530 g_list_free(sorting_list);
535 gtk_list_store_append(store, &iter);
564 if (gtk_check_button_get_active(GTK_CHECK_BUTTON(data))) {
599 if (gtk_check_button_get_active(GTK_CHECK_BUTTON(data))) {
616 GtkWidget *frame, *table, *help_button, *show_all_button, *sw, *w;
619 GtkCellRenderer *renderer;
630 group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
632 w = gtk_label_new(NULL);
637 frame = gtk_frame_new(
_(
"Researching"));
640 table = gtk_grid_new();
641 gtk_grid_set_column_spacing(GTK_GRID(table), 4);
642 gtk_frame_set_child(GTK_FRAME(frame), table);
644 help_button = gtk_check_button_new_with_label(
_(
"Help"));
645 gtk_grid_attach(GTK_GRID(table), help_button, 5, 0, 1, 1);
648 w = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
649 gtk_size_group_add_widget(group, w);
650 g_object_unref(G_OBJECT(store));
651 renderer = gtk_cell_renderer_text_new();
652 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(w), renderer,
TRUE);
653 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(w), renderer,
"text",
658 gtk_grid_attach(GTK_GRID(table), w, 0, 0, 1, 1);
661 w = gtk_progress_bar_new();
662 gtk_widget_set_hexpand(w,
TRUE);
663 gtk_progress_bar_set_show_text(GTK_PROGRESS_BAR(w),
TRUE);
664 gtk_grid_attach(GTK_GRID(table), w, 2, 0, 1, 1);
665 gtk_widget_set_size_request(w, -1, 25);
669 frame = gtk_frame_new(
_(
"Goal"));
672 table = gtk_grid_new();
673 gtk_grid_set_column_spacing(GTK_GRID(table), 4);
674 gtk_frame_set_child(GTK_FRAME(frame), table);
677 w = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
678 gtk_size_group_add_widget(group, w);
679 g_object_unref(G_OBJECT(store));
680 renderer = gtk_cell_renderer_text_new();
681 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(w), renderer,
TRUE);
682 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(w), renderer,
"text",
684 renderer = gtk_cell_renderer_text_new();
685 gtk_cell_layout_pack_end(GTK_CELL_LAYOUT(w), renderer,
FALSE);
686 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(w), renderer,
"text",
691 gtk_grid_attach(GTK_GRID(table), w, 0, 0, 1, 1);
694 w = gtk_label_new(NULL);
695 gtk_widget_set_hexpand(w,
TRUE);
696 gtk_grid_attach(GTK_GRID(table), w, 2, 0, 1, 1);
697 gtk_widget_set_size_request(w, -1, 25);
702 show_all_button = gtk_toggle_button_new_with_label(
_(
"Show all"));
703 gtk_grid_attach(GTK_GRID(table), show_all_button, 5, 0, 1, 1);
704 g_signal_connect(show_all_button,
"toggled",
711 sw = gtk_scrolled_window_new();
712 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
713 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
717 gtk_widget_set_hexpand(w,
TRUE);
718 gtk_widget_set_vexpand(w,
TRUE);
719 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), w);
724 gtk_widget_queue_draw(GTK_WIDGET(preport->
drawing_area));
725 g_object_unref(group);
741 memset(preport, 0,
sizeof(*preport));
755 if (NULL != presearch
864 return Q_(
"?Building or Unit type:Name");
866 return _(
"Redundant");
891 GtkTreeSelection *selection;
905 selection = gtk_tree_view_get_selection(preport->
tree_view);
906 if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
907 gtk_tree_model_get(model, &iter,
ERD_COL_CID, &selected, -1);
912 model = gtk_tree_view_get_model(preport->
tree_view);
913 store = GTK_LIST_STORE(model);
914 gtk_list_store_clear(store);
918 &building_total, &tax);
926 gtk_list_store_append(store, &iter);
927 gtk_list_store_set(store, &iter,
938 g_object_unref(G_OBJECT(pix));
939 if (selected ==
id) {
941 gtk_tree_selection_select_iter(selection, &iter);
951 direction8_invalid());
955 gtk_list_store_append(store, &iter);
956 gtk_list_store_set(store, &iter,
967 g_object_unref(G_OBJECT(pix));
968 if (selected ==
id) {
970 gtk_tree_selection_select_iter(selection, &iter);
975 fc_snprintf(buf,
sizeof(buf),
_(
"Income: %d Total Costs: %d"),
976 tax, building_total + unit_total);
977 gtk_label_set_text(preport->
label, buf);
988 GtkTreeSelection *selection = gtk_tree_view_get_selection(preport->
tree_view);
1007 || !gtk_tree_selection_get_selected(selection, &model, &iter)) {
1011 gtk_tree_model_get(model, &iter,
ERD_COL_CID, &
id, -1);
1014 switch (selected.
kind) {
1015 case VUT_IMPROVEMENT:
1024 gtk_tree_model_get(model, &iter,
1030 shell = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL
1031 | GTK_DIALOG_DESTROY_WITH_PARENT,
1032 GTK_MESSAGE_QUESTION,
1036 ?
_(
"Do you really wish to sell "
1037 "every redundant %s (%d total)?")
1039 :
_(
"Do you really wish to sell "
1040 "every %s (%d total)?"),
1044 gtk_window_set_title(GTK_WINDOW(
shell),
_(
"Sell Improvements"));
1049 gtk_window_destroy(GTK_WINDOW(
shell));
1059 gtk_tree_model_get(model, &iter,
ERD_COL_COUNT, &count, -1);
1061 shell = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL
1062 | GTK_DIALOG_DESTROY_WITH_PARENT,
1063 GTK_MESSAGE_QUESTION,
1066 _(
"Do you really wish to disband "
1067 "every %s (%d total)?"),
1071 gtk_window_set_title(GTK_WINDOW(
shell),
_(
"Disband Units"));
1076 gtk_window_destroy(GTK_WINDOW(
shell));
1084 if (
'\0' != buf[0]) {
1085 shell = gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
1086 GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
1089 g_signal_connect(
shell,
"response", G_CALLBACK(gtk_window_destroy),
1091 gtk_window_set_title(GTK_WINDOW(
shell),
_(
"Sell-Off: Results"));
1092 gtk_window_present(GTK_WINDOW(
shell));
1103 GtkTreeModel *model;
1107 && gtk_tree_selection_get_selected(selection, &model, &iter)) {
1111 gtk_tree_model_get(model, &iter,
ERD_COL_CID, &
id, -1);
1113 switch (selected.
kind) {
1114 case VUT_IMPROVEMENT:
1121 can_sell && redundant > 0);
1150 GtkWidget *
view, *sw, *label, *button;
1151 GtkListStore *store;
1152 GtkTreeSelection *selection;
1161 sw = gtk_scrolled_window_new();
1162 gtk_widget_set_halign(sw, GTK_ALIGN_CENTER);
1163 gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw),
TRUE);
1164 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
1165 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
1169 view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
1170 gtk_widget_set_vexpand(
view,
TRUE);
1171 g_object_unref(store);
1172 gtk_widget_set_name(
view,
"small_font");
1173 gtk_tree_view_columns_autosize(GTK_TREE_VIEW(
view));
1174 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw),
view);
1177 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(
view));
1178 g_signal_connect(selection,
"changed",
1182 GtkCellRenderer *renderer;
1183 GtkTreeViewColumn *col;
1184 GType
type = gtk_tree_model_get_column_type(GTK_TREE_MODEL(store), i);
1186 if (GDK_TYPE_PIXBUF ==
type) {
1187 renderer = gtk_cell_renderer_pixbuf_new();
1188 col = gtk_tree_view_column_new_with_attributes(
title, renderer,
1191 }
else if (G_TYPE_BOOLEAN ==
type) {
1192 renderer = gtk_cell_renderer_toggle_new();
1193 col = gtk_tree_view_column_new_with_attributes(
title, renderer,
1198 renderer = gtk_cell_renderer_text_new();
1201 col = gtk_tree_view_column_new_with_attributes(
title, renderer,
1207 col = gtk_tree_view_column_new_with_attributes(
title, renderer,
1213 g_object_set(G_OBJECT(renderer),
"xalign", 1.0, NULL);
1214 gtk_tree_view_column_set_alignment(col, 1.0);
1217 gtk_tree_view_append_column(GTK_TREE_VIEW(
view), col);
1220 label = gtk_label_new(NULL);
1222 gtk_widget_set_margin_start(label, 5);
1223 gtk_widget_set_margin_end(label, 5);
1224 gtk_widget_set_margin_top(label, 5);
1225 gtk_widget_set_margin_bottom(label, 5);
1226 preport->
label = GTK_LABEL(label);
1229 GTK_RESPONSE_CLOSE);
1233 gtk_widget_set_sensitive(button,
FALSE);
1237 gtk_widget_set_sensitive(button,
FALSE);
1241 gtk_widget_set_sensitive(button,
FALSE);
1264 memset(preport, 0,
sizeof(*preport));
1339static const struct {
1346 { G_TYPE_STRING,
N_(
"Unit Type"),
1348 { G_TYPE_BOOLEAN,
N_(
"?Upgradable unit [short]:U"),
1353 { G_TYPE_INT,
N_(
"In-Prog"),
1354 N_(
"In progress"),
TRUE, -1 },
1355 { G_TYPE_INT,
N_(
"Active"),
1357 { G_TYPE_INT,
N_(
"Shield"),
1358 N_(
"Total shield upkeep"),
TRUE, -1 },
1359 { G_TYPE_INT,
N_(
"Food"),
1360 N_(
"Total food upkeep"),
TRUE, -1 },
1361 { G_TYPE_INT,
N_(
"Gold"),
1362 N_(
"Total gold upkeep"),
TRUE, -1 },
1363 { G_TYPE_STRING,
" ",
1366 { G_TYPE_INT, NULL },
1367 { G_TYPE_BOOLEAN, NULL },
1368 { G_TYPE_BOOLEAN, NULL },
1369 { G_TYPE_INT, NULL }
1400 struct urd_info unit_totals;
1401 struct urd_info *info;
1402 int total_upgradable_count = 0;
1403 GtkTreeSelection *selection;
1404 GtkTreeModel *model;
1405 GtkListStore *store;
1411 memset(unit_array,
'\0',
sizeof(unit_array));
1412 memset(&unit_totals,
'\0',
sizeof(unit_totals));
1428 info->active_count++;
1431 if (VUT_UTYPE == pcity->production.kind) {
1433 info = unit_array +
utype_index(pcity->production.value.utype);
1437 num_units =
MAX(num_units, 1);
1438 info->building_count += num_units;
1444 selection = gtk_tree_view_get_selection(preport->
tree_view);
1445 if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
1452 model = gtk_tree_view_get_model(preport->
tree_view);
1453 store = GTK_LIST_STORE(model);
1454 gtk_list_store_clear(store);
1460 info = unit_array + utype_id;
1462 if (0 == info->active_count && 0 == info->building_count) {
1469 gtk_list_store_append(store, &iter);
1470 gtk_list_store_set(store, &iter,
1485 if (selected == utype_id) {
1487 gtk_tree_selection_select_iter(selection, &iter);
1491 unit_totals.active_count += info->active_count;
1493 unit_totals.upkeep[o] += info->upkeep[o];
1495 unit_totals.building_count += info->building_count;
1497 total_upgradable_count += info->active_count;
1502 gtk_list_store_append(store, &iter);
1503 gtk_list_store_set(store, &iter,
1518 if (selected ==
U_LAST) {
1520 gtk_tree_selection_select_iter(selection, &iter);
1531 GtkTreeModel *model;
1536 if (gtk_tree_selection_get_selected(selection, &model, &it)) {
1539 gtk_tree_model_get(model, &it,
1543 if (0 < active_count) {
1548 if (NULL == utype) {
1568 struct unit *best_candidate = NULL;
1583 if (dist < best_dist) {
1584 best_candidate =
punit;
1591 return best_candidate;
1603 GtkTreeSelection *selection;
1604 GtkTreeModel *model;
1617 selection = gtk_tree_view_get_selection(preport->
tree_view);
1618 if (gtk_tree_selection_get_selected(selection, &model, &it)) {
1647 "Treasury contains %d gold.",
1651 shell = gtk_message_dialog_new(NULL,
1653 | GTK_DIALOG_DESTROY_WITH_PARENT,
1654 GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
1657 PL_(
"Upgrade as many %s to %s as possible "
1658 "for %d gold each?\n%s",
1659 "Upgrade as many %s to %s as possible "
1660 "for %d gold each?\n%s", price),
1666 gtk_window_set_title(GTK_WINDOW(
shell),
_(
"Upgrade Obsolete Units"));
1672 gtk_window_destroy(GTK_WINDOW(
shell));
1681 GtkWidget *
view, *sw, *button;
1682 GtkListStore *store;
1683 GtkTreeSelection *selection;
1684 GtkTreeViewColumn *col = NULL;
1692 sw = gtk_scrolled_window_new();
1693 gtk_widget_set_halign(sw, GTK_ALIGN_CENTER);
1694 gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw),
TRUE);
1695 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
1696 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
1700 view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
1701 gtk_widget_set_vexpand(
view,
TRUE);
1702 g_object_unref(store);
1703 gtk_widget_set_name(
view,
"small_font");
1704 gtk_tree_view_columns_autosize(GTK_TREE_VIEW(
view));
1705 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw),
view);
1708 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(
view));
1709 g_signal_connect(selection,
"changed",
1713 GtkCellRenderer *renderer;
1718 gtk_widget_set_tooltip_text(header,
1721 gtk_widget_show(header);
1722 col = gtk_tree_view_column_new();
1723 gtk_tree_view_column_set_widget(col, header);
1725 gtk_tree_view_column_set_alignment(col, 1.0);
1727 gtk_tree_view_append_column(GTK_TREE_VIEW(
view), col);
1732 renderer = gtk_cell_renderer_toggle_new();
1733 gtk_tree_view_column_pack_start(col, renderer,
FALSE);
1734 gtk_tree_view_column_add_attribute(col, renderer,
"active", i);
1736 renderer = gtk_cell_renderer_text_new();
1737 gtk_tree_view_column_pack_start(col, renderer,
TRUE);
1738 gtk_tree_view_column_add_attribute(col, renderer,
"text", i);
1739 gtk_tree_view_column_add_attribute(col, renderer,
1744 gtk_tree_view_column_add_attribute(col, renderer,
"visible",
1749 g_object_set(G_OBJECT(renderer),
"xalign", 1.0, NULL);
1754 GTK_RESPONSE_CLOSE);
1758 gtk_widget_set_sensitive(button,
FALSE);
1762 gtk_widget_set_sensitive(button,
FALSE);
1784 memset(preport, 0,
sizeof(*preport));
1830 GtkListStore *
store;
1854 return _(
"Player\n");
1856 return _(
"Nation\n");
1858 return _(
"Score\n");
1874 GType col_types[col_num];
1875 GtkListStore *
store;
1876 GtkTreeViewColumn *col;
1882 while ((col = gtk_tree_view_get_column(preport->
tree_view, 0))) {
1883 gtk_tree_view_remove_column(preport->
tree_view, col);
1892 col_types[i] = G_TYPE_INT;
1894 store = gtk_list_store_newv(col_num, col_types);
1895 gtk_tree_view_set_model(preport->
tree_view, GTK_TREE_MODEL(
store));
1896 g_object_unref(G_OBJECT(
store));
1899 for (i = 0; (guint)i < col_num; i++) {
1900 GtkCellRenderer *renderer;
1902 const char *attribute;
1904 if (GDK_TYPE_PIXBUF == col_types[i]) {
1905 renderer = gtk_cell_renderer_pixbuf_new();
1906 attribute =
"pixbuf";
1908 renderer = gtk_cell_renderer_text_new();
1918 if (
title != NULL) {
1919 col = gtk_tree_view_column_new_with_attributes(
Q_(
title), renderer,
1920 attribute, i, NULL);
1921 gtk_tree_view_append_column(preport->
tree_view, col);
1922 if (GDK_TYPE_PIXBUF != col_types[i]) {
1923 gtk_tree_view_column_set_sort_column_id(col, i);
1928 gtk_tree_view_set_tooltip_column(GTK_TREE_VIEW(preport->
tree_view),
1947 gtk_list_store_append(preport->
store, &iter);
1948 gtk_list_store_set(preport->
store, &iter,
1955 gtk_list_store_set(preport->
store, &iter,
1972 GtkWidget *sw, *
view;
1982 sw = gtk_scrolled_window_new();
1983 gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw),
TRUE);
1984 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
1985 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
1988 view = gtk_tree_view_new();
1989 gtk_widget_set_name(
view,
"small_font");
1990 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw),
view);
1994 gtk_widget_set_hexpand(GTK_WIDGET(
view),
TRUE);
1995 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 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 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)
gint blocking_dialog(GtkWidget *dlg)
void gui_dialog_add_content_widget(struct gui_dialog *dlg, GtkWidget *wdg)
static gboolean science_diagram_left_button_up(GtkGestureClick *gesture, int n_press, double x, double y)
static gboolean science_diagram_right_button_up(GtkGestureClick *gesture, int n_press, double x, double y)
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
GtkDrawingArea * drawing_area
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