24#include <gdk/gdkkeysyms.h>
84static void races_response(GtkWidget *w, gint response, gpointer data);
90 GtkTreeModel *model, GtkTreePath *path,
91 gboolean selected, gpointer data);
106 GtkWidget *vgrid, *
label, *headline_label, *sw;
115 vgrid = gtk_grid_new();
116 gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
117 GTK_ORIENTATION_VERTICAL);
118 gtk_grid_set_row_spacing(GTK_GRID(vgrid), 2);
121 headline_label = gtk_label_new(
headline);
122 gtk_grid_attach(GTK_GRID(vgrid), headline_label, 0, grid_row++, 1, 1);
123 gtk_widget_set_name(headline_label,
"notify_label");
125 gtk_label_set_justify(GTK_LABEL(headline_label), GTK_JUSTIFY_LEFT);
126 gtk_widget_set_halign(headline_label, GTK_ALIGN_START);
127 gtk_widget_set_valign(headline_label, GTK_ALIGN_START);
129 sw = gtk_scrolled_window_new();
130 gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw),
TRUE);
131 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
132 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
136 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw),
label);
138 gtk_widget_set_name(
label,
"notify_label");
139 gtk_label_set_justify(GTK_LABEL(
label), GTK_JUSTIFY_LEFT);
140 gtk_widget_set_halign(
label, GTK_ALIGN_START);
141 gtk_widget_set_valign(
label, GTK_ALIGN_START);
143 gtk_grid_attach(GTK_GRID(vgrid), sw, 0, grid_row++, 1, 1);
159 struct city *pcity = NULL;
160 struct tile *ptile = g_object_get_data(G_OBJECT(w),
"tile");
179 gtk_window_destroy(GTK_WINDOW(w));
187 gtk_window_destroy(GTK_WINDOW(w));
196 const struct text_tag_list *tags,
203 _(
"_Close"), GTK_RESPONSE_CLOSE,
210 _(
"Goto _Location"), 1,
211 _(
"I_nspect City"), 2,
212 _(
"_Close"), GTK_RESPONSE_CLOSE,
216 _(
"Goto _Location"), 1,
217 _(
"_Close"), GTK_RESPONSE_CLOSE,
222 gtk_dialog_set_default_response(GTK_DIALOG(
shell), GTK_RESPONSE_CLOSE);
224 label = gtk_label_new(
lines);
225 gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(
shell))), label);
226 gtk_widget_show(label);
228 g_object_set_data(G_OBJECT(
shell),
"tile", ptile);
231 gtk_widget_show(
shell);
239 GtkWidget *
shell, *label;
241 shell = gtk_dialog_new();
244 gtk_dialog_set_default_response(GTK_DIALOG(
shell), GTK_RESPONSE_CLOSE);
246 label = gtk_label_new(
message);
247 gtk_label_set_selectable(GTK_LABEL(label), 1);
249 gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(
shell))), label);
250 gtk_widget_show(label);
252 gtk_dialog_add_button(GTK_DIALOG(
shell),
_(
"_Close"),GTK_RESPONSE_CLOSE);
256 gtk_widget_show(
shell);
266 if (response == GTK_RESPONSE_YES) {
274 gtk_window_destroy(GTK_WINDOW(w));
283 static GtkWidget *
shell = NULL;
287 shell = gtk_message_dialog_new(NULL,
291 _(
"You say you wanna revolution?"));
292 gtk_window_set_title(GTK_WINDOW(
shell),
_(
"Revolution!"));
295 g_signal_connect(
shell,
"destroy",
298 g_signal_connect(
shell,
"response",
301 gtk_window_present(GTK_WINDOW(
shell));
314 if (arg == GTK_RESPONSE_YES) {
315 int au_id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(dlg),
319 int tgt_id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(dlg),
323 if (
actor && tgt_extra) {
329 gtk_window_destroy(GTK_WINDOW(dlg));
339 bv_extras alternative;
355 BV_SET(alternative, what);
360 _(
"What To Pillage"),
362 _(
"Looking for target extra:"),
364 _(
"Select what to pillage:"),
399 if (nation == -1 ||
list == NULL) {
402 GtkTreeModel *model = gtk_tree_view_get_model(
list);
404 GtkTreePath *path = NULL;
406 gtk_tree_model_get_iter_first(model, &iter);
410 gtk_tree_model_get(model, &iter, 0, &nation_of_row, -1);
411 if (nation == nation_of_row) {
412 path = gtk_tree_model_get_path(model, &iter);
415 }
while (gtk_tree_model_iter_next(model, &iter));
429 GtkTreeView *
list = GTK_TREE_VIEW(tab_list);
430 GtkTreeSelection *select = gtk_tree_view_get_selection(GTK_TREE_VIEW(
list));
438 if (!gtk_tree_selection_path_is_selected(select, path)) {
440 gtk_tree_view_set_cursor(
list, path, NULL,
FALSE);
442 gtk_tree_view_scroll_to_cell(
list, path, NULL,
FALSE, 0, 0);
447 GtkTreePath *cursorpath;
453 gtk_tree_view_get_cursor(
list, &cursorpath, NULL);
456 if (!cursorpath || gtk_tree_selection_get_selected(select, NULL, NULL)) {
457 cursorpath = gtk_tree_path_new_first();
458 gtk_tree_view_set_cursor(
list, cursorpath, NULL,
FALSE);
460 gtk_tree_selection_unselect_all(select);
461 gtk_tree_path_free(cursorpath);
463 gtk_tree_path_free(path);
490 GtkListStore *model =
491 GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(
races_leader)));
494 gtk_list_store_clear(model);
501 gtk_list_store_insert_with_values(model, &iter, i, 0,
leader_name, -1);
514 const char *leadername,
bool is_male,
517 GtkEntryBuffer *buffer = gtk_entry_get_buffer(GTK_ENTRY(gtk_combo_box_get_child(GTK_COMBO_BOX(
races_leader))));
528 gtk_entry_buffer_set_text(buffer, leadername, -1);
530 gtk_check_button_set_active(GTK_CHECK_BUTTON(
races_sex[is_male]),
533 int idx =
fc_rand(nation_leader_list_size(
536 gtk_combo_box_set_active(GTK_COMBO_BOX(
races_leader), idx);
549 if (i >= 0 && i < style_id) {
556 path = gtk_tree_path_new();
557 gtk_tree_path_append_index(path, j);
560 gtk_tree_path_free(path);
569 gtk_text_buffer_set_text(
races_text, buf, -1);
574 gtk_dialog_set_response_sensitive(GTK_DIALOG(
races_shell),
575 GTK_RESPONSE_ACCEPT,
TRUE);
579 gtk_entry_buffer_set_text(buffer,
"", -1);
581 gtk_check_button_set_active(GTK_CHECK_BUTTON(
races_sex[0]),
TRUE);
584 GtkTreeSelection* select
587 gtk_tree_selection_unselect_all(select);
595 gtk_dialog_set_response_sensitive(GTK_DIALOG(
races_shell),
596 GTK_RESPONSE_ACCEPT,
FALSE);
612 GtkWidget *sw = NULL;
613 GtkListStore *store = NULL;
614 GtkWidget *
list = NULL;
621 GValue value = { 0, };
634 GtkTreeSelection *select;
635 GtkCellRenderer *render;
636 GtkTreeViewColumn *column;
638 store = gtk_list_store_new(4, G_TYPE_INT, G_TYPE_BOOLEAN,
639 GDK_TYPE_PIXBUF, G_TYPE_STRING);
640 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store),
641 3, GTK_SORT_ASCENDING);
643 list = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
646 gtk_tree_view_set_search_column(GTK_TREE_VIEW(
list), 3);
647 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(
list),
FALSE);
648 g_object_unref(store);
650 select = gtk_tree_view_get_selection(GTK_TREE_VIEW(
list));
656 sw = gtk_scrolled_window_new();
657 gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw),
TRUE);
658 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
659 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
660 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw),
list);
662 render = gtk_cell_renderer_pixbuf_new();
663 column = gtk_tree_view_column_new_with_attributes(
"Flag", render,
665 gtk_tree_view_append_column(GTK_TREE_VIEW(
list), column);
666 render = gtk_cell_renderer_text_new();
667 column = gtk_tree_view_column_new_with_attributes(
"Nation", render,
668 "text", 3,
"strikethrough", 1, NULL);
669 gtk_tree_view_append_column(GTK_TREE_VIEW(
list), column);
672 gtk_list_store_append(store, &it);
674 used = (pnation->player != NULL && pnation->player !=
races_player);
675 gtk_list_store_set(store, &it, 0,
nation_number(pnation), 1, used, -1);
678 gtk_list_store_set(store, &it, 2,
img, -1);
682 g_value_init(&value, G_TYPE_STRING);
684 gtk_list_store_set_value(store, &it, 3, &value);
685 g_value_unset(&value);
697 GtkWidget *nation_list;
698 GtkWidget *group_name_label;
711 gtk_notebook_append_page(GTK_NOTEBOOK(
races_notebook), nation_list,
720 group_name_label = gtk_label_new(
_(
"All"));
721 gtk_notebook_append_page(GTK_NOTEBOOK(
races_notebook), nation_list,
739 tab = gtk_notebook_get_current_page(GTK_NOTEBOOK(
races_notebook));
772 while (gtk_notebook_get_n_pages(GTK_NOTEBOOK(
races_notebook)) > 0) {
787 for (i = 0; i < groupidx; i++) {
819 if (gtk_combo_box_get_active_iter(b, &iter)) {
823 gtk_tree_model_get(gtk_combo_box_get_model(b), &iter,
846 GtkWidget *hgrid, *table;
847 GtkWidget *frame, *label, *combo;
853 GtkCellRenderer *render;
854 GtkTreeViewColumn *column;
865 title =
_(
"What Nation Will You Be?");
884 gtk_window_set_default_size(GTK_WINDOW(
shell), -1, 590);
886 frame = gtk_frame_new(
_(
"Select a nation"));
887 gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(
shell))), frame);
889 hgrid = gtk_grid_new();
890 gtk_grid_set_column_spacing(GTK_GRID(hgrid), 18);
891 gtk_widget_set_margin_start(hgrid, 3);
892 gtk_widget_set_margin_end(hgrid, 3);
893 gtk_widget_set_margin_top(hgrid, 3);
894 gtk_widget_set_margin_bottom(hgrid, 3);
896 gtk_frame_set_child(GTK_FRAME(frame), hgrid);
900 GtkWidget* nation_selection_list = gtk_grid_new();
904 gtk_grid_set_row_spacing(GTK_GRID(nation_selection_list), 2);
911 GtkListStore *sets_model = gtk_list_store_new(4, G_TYPE_STRING,
915 GtkCellRenderer *renderer;
932 "<b>%s</b> (%d nations)", num_nations),
933 escaped, num_nations);
945 int len = strcspn(p,
"\n");
947 if (p[
len] ==
'\n') {
950 escaped = g_markup_escape_text(p,
len);
957 gtk_list_store_insert_with_values(sets_model, NULL, -1,
968 = gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(sets_model));
969 g_object_unref(G_OBJECT(sets_model));
976 gtk_editable_set_editable(GTK_EDITABLE(
entry),
FALSE);
983 renderer = gtk_cell_renderer_text_new();
988 renderer,
"markup", 1, NULL);
1002 label = g_object_new(GTK_TYPE_LABEL,
1003 "use-underline",
TRUE,
1004 "label",
_(
"_Nation Set:"),
1011 gtk_grid_attach(GTK_GRID(nation_selection_list), label,
1018 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(
races_notebook), GTK_POS_LEFT);
1024 bool show_groups =
FALSE;
1035 label = g_object_new(GTK_TYPE_LABEL,
1036 "use-underline",
TRUE,
1037 "label",
_(
"Nation _Groups:"),
1042 gtk_grid_attach(GTK_GRID(nation_selection_list), label,
1051 gtk_grid_attach(GTK_GRID(hgrid), nation_selection_list, grid_col++, 0, 1, 1);
1055 notebook = gtk_notebook_new();
1056 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_BOTTOM);
1057 gtk_grid_attach(GTK_GRID(hgrid), notebook, grid_col++, 0, 1, 1);
1060 label = gtk_label_new_with_mnemonic(
_(
"_Properties"));
1063 g_signal_connect(table,
"destroy",
1065 gtk_widget_set_margin_bottom(table, 6);
1066 gtk_widget_set_margin_end(table, 6);
1067 gtk_widget_set_margin_start(table, 6);
1068 gtk_widget_set_margin_top(table, 6);
1069 gtk_grid_set_row_spacing(GTK_GRID(table), 2);
1070 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table, label);
1074 GtkListStore *model = gtk_list_store_new(1, G_TYPE_STRING);
1076 combo = gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(model));
1077 gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(combo), 0);
1078 g_object_unref(G_OBJECT(model));
1081 label = g_object_new(GTK_TYPE_LABEL,
1082 "use-underline",
TRUE,
1083 "mnemonic-widget", GTK_COMBO_BOX(combo),
1084 "label",
_(
"_Leader:"),
1088 gtk_widget_set_margin_bottom(label, 6);
1089 gtk_widget_set_margin_end(label, 12);
1090 gtk_grid_attach(GTK_GRID(table), label, 0, 0, 1, 2);
1091 gtk_grid_attach(GTK_GRID(table), combo, 1, 0, 2, 1);
1093 cmd = gtk_check_button_new_with_mnemonic(
_(
"_Female"));
1094 gtk_widget_set_margin_bottom(cmd, 6);
1096 gtk_grid_attach(GTK_GRID(table), cmd, 1, 1, 1, 1);
1099 cmd = gtk_check_button_new_with_mnemonic(
_(
"_Male"));
1100 gtk_check_button_set_group(GTK_CHECK_BUTTON(cmd),
1101 GTK_CHECK_BUTTON(group));
1102 gtk_widget_set_margin_bottom(cmd, 6);
1104 gtk_grid_attach(GTK_GRID(table), cmd, 2, 1, 1, 1);
1107 store = gtk_list_store_new(3, G_TYPE_INT,
1108 GDK_TYPE_PIXBUF, G_TYPE_STRING);
1110 list = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
1111 gtk_widget_set_hexpand(
list,
TRUE);
1112 gtk_widget_set_vexpand(
list,
TRUE);
1114 g_object_unref(store);
1115 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(
list),
FALSE);
1116 g_signal_connect(gtk_tree_view_get_selection(GTK_TREE_VIEW(
list)),
"changed",
1119 sw = gtk_scrolled_window_new();
1120 gtk_widget_set_margin_top(sw, 6);
1121 gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw),
TRUE);
1122 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
1123 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
1124 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw),
list);
1125 gtk_grid_attach(GTK_GRID(table), sw, 1, 2, 2, 2);
1127 label = g_object_new(GTK_TYPE_LABEL,
1128 "use-underline",
TRUE,
1129 "mnemonic-widget",
list,
1130 "label",
_(
"City _Styles:"),
1134 gtk_widget_set_margin_top(label, 6);
1135 gtk_widget_set_margin_end(label, 12);
1136 gtk_grid_attach(GTK_GRID(table), label, 0, 2, 1, 1);
1138 render = gtk_cell_renderer_pixbuf_new();
1139 column = gtk_tree_view_column_new_with_attributes(NULL, render,
1141 gtk_tree_view_append_column(GTK_TREE_VIEW(
list), column);
1142 render = gtk_cell_renderer_text_new();
1143 column = gtk_tree_view_column_new_with_attributes(NULL, render,
1145 gtk_tree_view_append_column(GTK_TREE_VIEW(
list), column);
1156 gtk_list_store_append(store, &it);
1161 gtk_list_store_set(store, &it, 0, i, 1,
img, 2,
1163 g_object_unref(
img);
1168 label = gtk_label_new_with_mnemonic(
_(
"_Description"));
1170 text = gtk_text_view_new();
1171 gtk_widget_set_margin_bottom(text, 6);
1172 gtk_widget_set_margin_end(text, 6);
1173 gtk_widget_set_margin_start(text, 6);
1174 gtk_widget_set_margin_top(text, 6);
1175 gtk_widget_set_hexpand(text,
TRUE);
1176 gtk_widget_set_vexpand(text,
TRUE);
1177 races_text = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
1178 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
1179 gtk_text_view_set_editable(GTK_TEXT_VIEW(text),
FALSE);
1180 gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(text),
FALSE);
1181 gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 6);
1182 gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 6);
1184 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), text, label);
1187 g_signal_connect(
shell,
"destroy",
1189 g_signal_connect(
shell,
"response",
1192 g_signal_connect(GTK_COMBO_BOX(
races_leader),
"changed",
1195 g_signal_connect(
races_sex[0],
"toggled",
1197 g_signal_connect(
races_sex[1],
"toggled",
1201 gtk_dialog_set_default_response(GTK_DIALOG(
shell), GTK_RESPONSE_CANCEL);
1205 gtk_dialog_set_response_sensitive(GTK_DIALOG(
shell), GTK_RESPONSE_NO,
1209 gtk_widget_show(gtk_dialog_get_content_area(GTK_DIALOG(
shell)));
1270 GtkTreeModel *model = gtk_tree_view_get_model(
list);
1271 GtkTreeSelection* select = gtk_tree_view_get_selection(
list);
1276 if (gtk_tree_model_get_iter_first(model, &it)) {
1281 gtk_tree_model_get(model, &it, 0, &nation_no, -1);
1287 gtk_list_store_set(GTK_LIST_STORE(model), &it, 1, chosen, -1);
1289 }
while (gtk_tree_model_iter_next(model, &it));
1293 if (gtk_tree_selection_get_selected(select, &model, &it)) {
1294 gtk_tree_model_get(model, &it, 1, &chosen, -1);
1297 gtk_tree_selection_unselect_all(select);
1309 GtkTreeModel *model;
1312 if (gtk_tree_selection_get_selected(select, &model, &it)) {
1316 gtk_tree_model_get(model, &it, 0, &newnation, 1, &chosen, -1);
1342 gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(gtk_combo_box_get_child(GTK_COMBO_BOX(
races_leader)))));
1365 GtkTreeModel *model, GtkTreePath *path,
1366 gboolean selected, gpointer data)
1371 gtk_tree_model_get_iter(model, &it, path);
1372 gtk_tree_model_get(model, &it, 1, &chosen, -1);
1373 return (!chosen || selected);
1381 GtkTreeModel *model;
1384 if (gtk_tree_selection_get_selected(select, &model, &it)) {
1396 if (response == GTK_RESPONSE_ACCEPT) {
1414 s = gtk_entry_buffer_get_text(gtk_entry_get_buffer(
1415 GTK_ENTRY(gtk_combo_box_get_child(GTK_COMBO_BOX(
races_leader)))));
1419 if (strlen(s) == 0) {
1428 }
else if (response == GTK_RESPONSE_NO) {
1443 GtkWidget *
widget = gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(gesture));
1446 "rate_button")),
FALSE);
1457 GtkWidget *
widget = gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(gesture));
1460 "rate_button")),
TRUE);
1473 if (!punits || unit_list_size(punits) == 0) {
1478 shell = gtk_message_dialog_new(NULL, 0,
1479 GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
1481 gtk_window_set_title(GTK_WINDOW(
shell),
_(
"Upgrade Unit!"));
1483 g_signal_connect(
shell,
"response", G_CALLBACK(gtk_window_destroy),
1485 gtk_window_present(GTK_WINDOW(
shell));
1487 shell = gtk_message_dialog_new(NULL, 0,
1488 GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
1490 gtk_window_set_title(GTK_WINDOW(
shell),
_(
"Upgrade Obsolete Units"));
1492 gtk_dialog_set_default_response(GTK_DIALOG(
shell), GTK_RESPONSE_YES);
1500 gtk_window_destroy(GTK_WINDOW(
shell));
1512 if (!punits || unit_list_size(punits) == 0) {
1517 shell = gtk_message_dialog_new(NULL, 0,
1518 GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
1520 gtk_window_set_title(GTK_WINDOW(
shell),
_(
"Disband Units"));
1522 g_signal_connect(
shell,
"response", G_CALLBACK(gtk_window_destroy),
1524 gtk_window_present(GTK_WINDOW(
shell));
1526 shell = gtk_message_dialog_new(NULL, 0,
1527 GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
1529 gtk_window_set_title(GTK_WINDOW(
shell),
_(
"Disband Units"));
1531 gtk_dialog_set_default_response(GTK_DIALOG(
shell), GTK_RESPONSE_YES);
1541 gtk_window_destroy(GTK_WINDOW(
shell));
1563 if (NULL != padvance
1581 dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
1582 GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
1583 _(
"Tileset \"%s\" problem, "
1584 "it's probably incompatible with "
1585 "the ruleset:\n%s"),
1588 dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
1589 GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
1590 _(
"Tileset problem, "
1591 "it's probably incompatible with "
1592 "the ruleset:\n%s"),
1600 gtk_window_destroy(GTK_WINDOW(dialog));
1619 int attacker_hp,
int defender_hp,
1620 bool make_att_veteran,
bool make_def_veteran)
void astr_free(struct astring *astr)
void astr_set(struct astring *astr, const char *format,...)
void astr_add(struct astring *astr, const char *format,...)
static const char * astr_str(const struct astring *astr) fc__attribute((nonnull(1)))
void output_window_append(const struct ft_color color, const char *featured_text)
const char * city_style_name_translation(const int style)
#define city_owner(_pcity_)
void popup_city_dialog(struct city *pcity)
enum client_states client_state(void)
void common_taxrates_callback(int idx, bool reverse)
static struct fc_sockaddr_list * list
void request_unit_disband(struct unit *punit)
void request_new_unit_activity_targeted(struct unit *punit, enum unit_activity act, struct extra_type *tgt)
void request_unit_upgrade(struct unit *punit)
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 int const struct action *paction show_tileset_error
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit * actor
const char const char * headline
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 int const struct action *paction bool fatal
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
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 int const struct action *paction bool const char * tset_name
#define MAX_NUM_NATION_GROUPS
#define PL_(String1, String2, n)
const struct ft_color ftc_client
struct unit * game_unit_by_number(int id)
static GtkWidget * races_properties
static gboolean races_selection_func(GtkTreeSelection *select, GtkTreeModel *model, GtkTreePath *path, gboolean selected, gpointer data)
static GtkWidget * races_shell
static void select_nation(int nation, const char *leadername, bool is_male, int style_id)
static void sync_tabs_to_nation(int nation)
static GtkWidget * races_style_list
static void revolution_response(GtkWidget *w, gint response, gpointer data)
static void races_leader_callback(void)
static int selected_style
static void create_nation_selection_lists(void)
static int is_showing_pillage_dialog
static void create_races_dialog(struct player *pplayer)
static GtkWidget * races_leader
static GtkWidget * races_nation_list[MAX_NUM_NATION_GROUPS+1]
static void populate_leader_list(void)
void unit_select_dialog_popup(struct tile *ptile)
void popup_upgrade_dialog(struct unit_list *punits)
void races_update_pickable(bool nationset_change)
static void notify_connect_msg_response(GtkWidget *w, gint response)
static void races_sex_callback(GtkWidget *w, gpointer data)
static void pillage_callback(GtkWidget *dlg, gint arg)
void popup_notify_goto_dialog(const char *headline, const char *lines, const struct text_tag_list *tags, struct tile *ptile)
void show_tech_gained_dialog(Tech_type_id tech)
static GtkWidget * races_sex[2]
void popup_races_dialog(struct player *pplayer)
void popup_disband_dialog(struct unit_list *punits)
static GtkTreePath * path_to_nation_on_list(Nation_type_id nation, GtkTreeView *list)
void popdown_races_dialog(void)
static int selected_nation
static GtkWidget * races_notebook
void popup_pillage_dialog(struct unit *punit, bv_extras extras)
static void races_response(GtkWidget *w, gint response, gpointer data)
static void notify_goto_response(GtkWidget *w, gint response)
static void races_nation_callback(GtkTreeSelection *select, gpointer data)
void popup_connect_msg(const char *headline, const char *message)
bool handmade_scenario_warning(void)
void unit_select_dialog_update_real(void *unused)
static void nationset_callback(GtkComboBox *b, gpointer data)
void races_toggles_set_sensitive(void)
static void races_style_callback(GtkTreeSelection *select, gpointer data)
void popup_combat_info(int attacker_unit_id, int defender_unit_id, int attacker_hp, int defender_hp, bool make_att_veteran, bool make_def_veteran)
struct player * races_player
static GtkWidget * nationsets_chooser
static GtkTextBuffer * races_text
void nationset_sync_to_server(const char *nationset)
gboolean taxrates_callback(GtkWidget *w, GdkEventButton *ev, gpointer data)
static GtkWidget * create_list_of_nations_in_group(struct nation_group *group, int index)
static void select_nation_on_tab(GtkWidget *tab_list, int nation)
void popdown_all_game_dialogs(void)
struct property_editor * editprop_get_property_editor(void)
void property_editor_popdown(struct property_editor *pe)
GtkWidget * bottom_notebook
#define GUI_GTK_OPTION(optname)
void gui_dialog_present(struct gui_dialog *dlg)
void gui_dialog_new(struct gui_dialog **pdlg, GtkNotebook *notebook, gpointer user_data, bool check_top)
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_destroy_all(void)
void setup_dialog(GtkWidget *shell, GtkWidget *parent)
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)
void free_sprite(struct sprite *s)
GdkPixbuf * sprite_get_pixbuf(struct sprite *sprite)
struct sprite * crop_blankspace(struct sprite *s)
void unit_select_dialog_popup_main(struct tile *ptile, bool create)
void unit_select_dialog_popdown(void)
void blank_max_unit_size(void)
gboolean reverse_taxrates_callback(GtkGestureClick *gesture, int n_press, double x, double y)
gint blocking_dialog(GtkWidget *dlg)
void gui_dialog_add_content_widget(struct gui_dialog *dlg, GtkWidget *wdg)
void widget_destroyed(GtkWidget *wdg, void *data)
static char * leader_name
void popup_revolution_dialog(void)
void helptext_nation(char *buf, size_t bufsz, struct nation_type *pnation, const char *user_text)
#define fc_assert(condition)
#define fc_assert_action(condition, action)
void center_tile_mapcanvas(const struct tile *ptile)
Nation_type_id nation_number(const struct nation_type *pnation)
struct nation_leader * nation_leader_by_name(const struct nation_type *pnation, const char *name)
bool nation_leader_is_male(const struct nation_leader *pleader)
const char * nation_adjective_translation(const struct nation_type *pnation)
struct nation_type * nation_by_number(const Nation_type_id nation)
int nation_set_index(const struct nation_set *pset)
bool is_nation_pickable(const struct nation_type *nation)
const struct nation_leader_list * nation_leaders(const struct nation_type *pnation)
const char * nation_set_name_translation(const struct nation_set *pset)
bool is_nation_playable(const struct nation_type *nation)
bool nation_is_in_group(const struct nation_type *pnation, const struct nation_group *pgroup)
bool nation_is_in_set(const struct nation_type *pnation, const struct nation_set *pset)
const char * nation_set_description(const struct nation_set *pset)
const char * nation_group_name_translation(const struct nation_group *pgroup)
int nation_set_count(void)
struct nation_group * nation_group_by_number(int id)
struct nation_set * nation_set_by_rule_name(const char *name)
bool is_nation_group_hidden(struct nation_group *pgroup)
struct nation_set * nation_set_by_setting_value(const char *setting)
const char * nation_leader_name(const struct nation_leader *pleader)
int nation_group_count(void)
const char * nation_set_rule_name(const struct nation_set *pset)
struct nation_style * style_of_nation(const struct nation_type *pnation)
#define nation_leader_list_iterate(leaderlist, pleader)
#define nation_sets_iterate_end
#define nation_sets_iterate(NAME_pset)
#define nations_iterate_end
#define nations_iterate(NAME_pnation)
#define nation_leader_list_iterate_end
#define nation_groups_iterate(NAME_pgroup)
#define nation_groups_iterate_end
const struct option_set * server_optset
bool option_str_set(struct option *poption, const char *str)
const char * option_str_get(const struct option *poption)
struct client_options gui_options
struct option * optset_option_by_name(const struct option_set *poptset, const char *name)
@ GUI_POPUP_TECH_HELP_RULESET
@ GUI_POPUP_TECH_HELP_ENABLED
int dsend_packet_nation_select_req(struct connection *pc, int player_no, Nation_type_id nation_no, bool is_male, const char *name, int style)
void start_revolution(void)
void set_government_choice(struct government *government)
int player_number(const struct player *pplayer)
const char * player_name(const struct player *pplayer)
struct packet_ruleset_control control
bool center_when_popup_city
struct nation_type * nation
struct nation_style * style
int style_number(const struct nation_style *pstyle)
int basic_city_style_for_style(struct nation_style *pstyle)
#define styles_iterate(_p)
#define styles_iterate_end
int fc_break_lines(char *str, size_t desired_len)
const char * advance_name_translation(const struct advance *padvance)
struct advance * valid_advance_by_number(const Tech_type_id id)
struct extra_type * get_preferred_pillage(bv_extras extras)
bool get_units_upgrade_info(char *buf, size_t bufsz, struct unit_list *punits)
bool get_units_disband_info(char *buf, size_t bufsz, struct unit_list *punits)
struct city * tile_city(const struct tile *ptile)
struct sprite * get_sample_city_sprite(const struct tileset *t, int style_idx)
bool unit_can_do_action(const struct unit *punit, const action_id act_id)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end