Freeciv-3.3: /fast/freeciv/nightly/main/client/gui-gtk-3.22/menu.c Source File

Freeciv-3.3

Loading...
Searching...
No Matches
menu.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 <stdlib.h>
19
20#include <gtk/gtk.h>
21
22/* utility */
23#include "fcintl.h"
24#include "log.h"
25#include "shared.h"
26#include "support.h"
27
28/* common */
29#include "game.h"
30#include "government.h"
31#include "road.h"
32#include "unit.h"
33
34/* client */
35#include "client_main.h"
36#include "clinet.h"
37#include "connectdlg_common.h"
38#include "control.h"
39#include "mapview_common.h"
40#include "options.h"
41#include "tilespec.h"
42
43/* client/gui-gtk-3.22 */
44#include "chatline.h"
45#include "cityrep.h"
46#include "dialogs.h"
47#include "editgui.h"
48#include "editprop.h"
49#include "finddlg.h"
50#include "gamedlgs.h"
51#include "gotodlg.h"
52#include "gui_main.h"
53#include "gui_stuff.h"
54#include "helpdlg.h"
55#include "infradlg.h"
56#include "luaconsole.h"
57#include "mapctrl.h" /* center_on_unit(). */
58#include "messagedlg.h"
59#include "messagewin.h"
60#include "optiondlg.h"
61#include "pages.h"
62#include "plrdlg.h"
63#include "rallypointdlg.h"
64#include "ratesdlg.h"
65#include "repodlgs.h"
66#include "sprite.h"
67#include "spaceshipdlg.h"
68#include "unitselect.h"
69#include "wldlg.h"
70
71#include "menu.h"
72
73#ifndef GTK_STOCK_EDIT
74#define GTK_STOCK_EDIT NULL
75#endif
76
77 static GtkBuilder *ui_builder = NULL;
78
79static void menu_entry_set_active(const char *key,
80 gboolean is_active);
81static void menu_entry_set_sensitive(const char *key,
82 gboolean is_sensitive);
83#ifndef FREECIV_DEBUG
84static void menu_entry_set_visible(const char *key,
85 gboolean is_visible,
86 gboolean is_sensitive);
87#endif /* FREECIV_DEBUG */
88
89static void view_menu_update_sensitivity(void);
90
91 enum menu_entry_grouping { MGROUP_SAFE, MGROUP_EDIT, MGROUP_PLAYING,
92 MGROUP_UNIT, MGROUP_PLAYER, MGROUP_ALL };
93
94static void menu_entry_group_set_sensitive(enum menu_entry_grouping group,
95 gboolean is_sensitive);
96
97 struct menu_entry_info {
98 const char *key;
99 const char *name;
100 guint accel;
101 GdkModifierType accel_mod;
102 GCallback cb;
103 enum menu_entry_grouping grouping;
104};
105
106static void clear_chat_logs_callback(GtkMenuItem *item, gpointer data);
107static void save_chat_logs_callback(GtkMenuItem *item, gpointer data);
108static void local_options_callback(GtkMenuItem *item, gpointer data);
109static void message_options_callback(GtkMenuItem *item, gpointer data);
110static void server_options_callback(GtkMenuItem *item, gpointer data);
111static void save_options_callback(GtkMenuItem *item, gpointer data);
112static void reload_tileset_callback(GtkMenuItem *item, gpointer data);
113static void save_game_callback(GtkMenuItem *item, gpointer data);
114static void save_game_as_callback(GtkMenuItem *item, gpointer data);
115static void save_mapimg_callback(GtkMenuItem *item, gpointer data);
116static void save_mapimg_as_callback(GtkMenuItem *item, gpointer data);
117static void find_city_callback(GtkMenuItem *item, gpointer data);
118static void worklists_callback(GtkMenuItem *item, gpointer data);
119static void client_lua_script_callback(GtkMenuItem *item, gpointer data);
120static void leave_callback(GtkMenuItem *item, gpointer data);
121static void quit_callback(GtkMenuItem *item, gpointer data);
122static void map_view_callback(GtkMenuItem *item, gpointer data);
123static void report_units_callback(GtkMenuItem *item, gpointer data);
124static void report_nations_callback(GtkMenuItem *item, gpointer data);
125static void report_cities_callback(GtkMenuItem *item, gpointer data);
126static void report_wow_callback(GtkMenuItem *item, gpointer data);
127static void report_top_cities_callback(GtkMenuItem *item, gpointer data);
128static void report_messages_callback(GtkMenuItem *item, gpointer data);
129static void report_demographic_callback(GtkMenuItem *item, gpointer data);
130static void bg_select0_callback(GtkMenuItem *item, gpointer data);
131static void bg_assign0_callback(GtkMenuItem *item, gpointer data);
132static void bg_append0_callback(GtkMenuItem *item, gpointer data);
133static void bg_select1_callback(GtkMenuItem *item, gpointer data);
134static void bg_assign1_callback(GtkMenuItem *item, gpointer data);
135static void bg_append1_callback(GtkMenuItem *item, gpointer data);
136static void bg_select2_callback(GtkMenuItem *item, gpointer data);
137static void bg_assign2_callback(GtkMenuItem *item, gpointer data);
138static void bg_append2_callback(GtkMenuItem *item, gpointer data);
139static void bg_select3_callback(GtkMenuItem *item, gpointer data);
140static void bg_assign3_callback(GtkMenuItem *item, gpointer data);
141static void bg_append3_callback(GtkMenuItem *item, gpointer data);
142static void help_overview_callback(GtkMenuItem *item, gpointer data);
143static void help_playing_callback(GtkMenuItem *item, gpointer data);
144static void help_policies_callback(GtkMenuItem *item, gpointer data);
145static void help_terrain_callback(GtkMenuItem *item, gpointer data);
146static void help_economy_callback(GtkMenuItem *item, gpointer data);
147static void help_cities_callback(GtkMenuItem *item, gpointer data);
148static void help_improvements_callback(GtkMenuItem *item, gpointer data);
149static void help_wonders_callback(GtkMenuItem *item, gpointer data);
150static void help_units_callback(GtkMenuItem *item, gpointer data);
151static void help_combat_callback(GtkMenuItem *item, gpointer data);
152static void help_zoc_callback(GtkMenuItem *item, gpointer data);
153static void help_government_callback(GtkMenuItem *item, gpointer data);
154static void help_diplomacy_callback(GtkMenuItem *item, gpointer data);
155static void help_tech_callback(GtkMenuItem *item, gpointer data);
156static void help_space_race_callback(GtkMenuItem *item, gpointer data);
157static void help_ruleset_callback(GtkMenuItem *item, gpointer data);
158static void help_tileset_callback(GtkMenuItem *item, gpointer data);
159static void help_musicset_callback(GtkMenuItem *item, gpointer data);
160static void help_nations_callback(GtkMenuItem *item, gpointer data);
161static void help_connecting_callback(GtkMenuItem *item, gpointer data);
162static void help_controls_callback(GtkMenuItem *item, gpointer data);
163static void help_cma_callback(GtkMenuItem *item, gpointer data);
164static void help_chatline_callback(GtkMenuItem *item, gpointer data);
165static void help_worklist_editor_callback(GtkMenuItem *item, gpointer data);
166static void help_language_callback(GtkMenuItem *item, gpointer data);
167static void help_copying_callback(GtkMenuItem *item, gpointer data);
168static void help_about_callback(GtkMenuItem *item, gpointer data);
169static void save_options_on_exit_callback(GtkCheckMenuItem *item,
170 gpointer data);
171static void edit_mode_callback(GtkCheckMenuItem *item, gpointer data);
172static void show_city_outlines_callback(GtkCheckMenuItem *item,
173 gpointer data);
174static void show_city_output_callback(GtkCheckMenuItem *item, gpointer data);
175static void show_map_grid_callback(GtkCheckMenuItem *item, gpointer data);
176static void show_national_borders_callback(GtkCheckMenuItem *item,
177 gpointer data);
178static void show_native_tiles_callback(GtkCheckMenuItem *item,
179 gpointer data);
180static void show_city_full_bar_callback(GtkCheckMenuItem *item,
181 gpointer data);
182static void show_city_names_callback(GtkCheckMenuItem *item, gpointer data);
183static void show_city_growth_callback(GtkCheckMenuItem *item, gpointer data);
184static void show_city_productions_callback(GtkCheckMenuItem *item,
185 gpointer data);
186static void show_city_buy_cost_callback(GtkCheckMenuItem *item,
187 gpointer data);
188static void show_city_trade_routes_callback(GtkCheckMenuItem *item,
189 gpointer data);
190static void show_terrain_callback(GtkCheckMenuItem *item, gpointer data);
191static void show_coastline_callback(GtkCheckMenuItem *item, gpointer data);
192static void show_paths_callback(GtkCheckMenuItem *item, gpointer data);
193static void show_irrigation_callback(GtkCheckMenuItem *item, gpointer data);
194static void show_mine_callback(GtkCheckMenuItem *item, gpointer data);
195static void show_bases_callback(GtkCheckMenuItem *item, gpointer data);
196static void show_resources_callback(GtkCheckMenuItem *item, gpointer data);
197static void show_huts_callback(GtkCheckMenuItem *item, gpointer data);
198static void show_pollution_callback(GtkCheckMenuItem *item, gpointer data);
199static void show_cities_callback(GtkCheckMenuItem *item, gpointer data);
200static void show_units_callback(GtkCheckMenuItem *item, gpointer data);
201static void show_unit_solid_bg_callback(GtkCheckMenuItem *item,
202 gpointer data);
203static void show_unit_shields_callback(GtkCheckMenuItem *item,
204 gpointer data);
205static void show_stack_size_callback(GtkCheckMenuItem *item,
206 gpointer data);
207static void show_focus_unit_callback(GtkCheckMenuItem *item, gpointer data);
208static void show_fog_of_war_callback(GtkCheckMenuItem *item, gpointer data);
209static void full_screen_callback(GtkCheckMenuItem *item, gpointer data);
210static void recalc_borders_callback(GtkMenuItem *item, gpointer data);
211static void toggle_fog_callback(GtkMenuItem *item, gpointer data);
212static void scenario_properties_callback(GtkMenuItem *item, gpointer data);
213static void save_scenario_callback(GtkMenuItem *item, gpointer data);
214static void center_view_callback(GtkMenuItem *item, gpointer data);
215static void report_economy_callback(GtkMenuItem *item, gpointer data);
216static void report_research_callback(GtkMenuItem *item, gpointer data);
217static void multiplier_callback(GtkMenuItem *item, gpointer data);
218static void report_spaceship_callback(GtkMenuItem *item, gpointer data);
219static void report_achievements_callback(GtkMenuItem *item, gpointer data);
220static void government_callback(GtkMenuItem *item, gpointer data);
221static void tax_rate_callback(GtkMenuItem *item, gpointer data);
222static void select_single_callback(GtkMenuItem *item, gpointer data);
223static void select_all_on_tile_callback(GtkMenuItem *item, gpointer data);
224static void select_same_type_tile_callback(GtkMenuItem *item, gpointer data);
225static void select_same_type_cont_callback(GtkMenuItem *item, gpointer data);
226static void select_same_type_callback(GtkMenuItem *item, gpointer data);
227static void select_dialog_callback(GtkMenuItem *item, gpointer data);
228static void rally_dialog_callback(GtkMenuItem *item, gpointer data);
229static void infra_dialog_callback(GtkMenuItem *item, gpointer data);
230static void unit_wait_callback(GtkMenuItem *item, gpointer data);
231static void unit_done_callback(GtkMenuItem *item, gpointer data);
232static void unit_goto_callback(GtkMenuItem *item, gpointer data);
233static void unit_goto_city_callback(GtkMenuItem *item, gpointer data);
234static void unit_return_callback(GtkMenuItem *item, gpointer data);
235static void unit_explore_callback(GtkMenuItem *item, gpointer data);
236static void unit_patrol_callback(GtkMenuItem *item, gpointer data);
237static void unit_sentry_callback(GtkMenuItem *item, gpointer data);
238static void unit_unsentry_callback(GtkMenuItem *item, gpointer data);
239static void unit_board_callback(GtkMenuItem *item, gpointer data);
240static void unit_deboard_callback(GtkMenuItem *item, gpointer data);
241static void unit_unload_transporter_callback(GtkMenuItem *item,
242 gpointer data);
243static void unit_homecity_callback(GtkMenuItem *item, gpointer data);
244static void unit_upgrade_callback(GtkMenuItem *item, gpointer data);
245static void unit_convert_callback(GtkMenuItem *item, gpointer data);
246static void unit_disband_callback(GtkMenuItem *item, gpointer data);
247static void build_city_callback(GtkMenuItem *item, gpointer data);
248static void auto_work_callback(GtkMenuItem *item, gpointer data);
249static void build_road_callback(GtkMenuItem *item, gpointer data);
250static void build_irrigation_callback(GtkMenuItem *item, gpointer data);
251static void cultivate_callback(GtkMenuItem *item, gpointer data);
252static void build_mine_callback(GtkMenuItem *item, gpointer data);
253static void plant_callback(GtkMenuItem *item, gpointer data);
254static void connect_road_callback(GtkMenuItem *item, gpointer data);
255static void connect_rail_callback(GtkMenuItem *item, gpointer data);
256static void connect_maglev_callback(GtkMenuItem *item, gpointer data);
257static void connect_irrigation_callback(GtkMenuItem *item, gpointer data);
258static void transform_terrain_callback(GtkMenuItem *item, gpointer data);
259static void clean_nuisance_callback(GtkMenuItem *item, gpointer data);
260static void fortify_callback(GtkMenuItem *item, gpointer data);
261static void build_fortress_callback(GtkMenuItem *item, gpointer data);
262static void build_airbase_callback(GtkMenuItem *item, gpointer data);
263static void do_paradrop_callback(GtkMenuItem *item, gpointer data);
264static void do_pillage_callback(GtkMenuItem *item, gpointer data);
265static void diplomat_action_callback(GtkMenuItem *item, gpointer data);
266
267 static struct menu_entry_info menu_entries[] =
268{
269 { "MENU_GAME", N_("_Game"), 0, 0, NULL, MGROUP_SAFE },
270 { "MENU_OPTIONS", N_("_Options"), 0, 0, NULL, MGROUP_SAFE },
271 { "MENU_EDIT", N_("_Edit"), 0, 0, NULL, MGROUP_SAFE },
272 { "MENU_VIEW", N_("?verb:_View"), 0, 0, NULL, MGROUP_SAFE },
273 { "MENU_IMPROVEMENTS", N_("_Improvements"), 0, 0,
274 NULL, MGROUP_SAFE },
275 { "MENU_CIVILIZATION", N_("C_ivilization"), 0, 0,
276 NULL, MGROUP_SAFE },
277 { "MENU_BATTLE_GROUPS", N_("_Battle Groups"), 0, 0,
278 NULL, MGROUP_PLAYING },
279 { "MENU_HELP", N_("_Help"), 0, 0, NULL, MGROUP_SAFE },
280 { "CLEAR_CHAT_LOGS", N_("_Clear Chat Log"), 0, 0,
281 G_CALLBACK(clear_chat_logs_callback), MGROUP_SAFE },
282 { "SAVE_CHAT_LOGS", N_("Save Chat _Log"), 0, 0,
283 G_CALLBACK(save_chat_logs_callback), MGROUP_SAFE },
284 { "LOCAL_OPTIONS", N_("_Local Client"), 0, 0,
285 G_CALLBACK(local_options_callback), MGROUP_SAFE },
286 { "MESSAGE_OPTIONS", N_("_Message"), 0, 0,
287 G_CALLBACK(message_options_callback), MGROUP_SAFE },
288 { "SERVER_OPTIONS", N_("_Remote Server"), 0, 0,
289 G_CALLBACK(server_options_callback), MGROUP_SAFE },
290 { "SAVE_OPTIONS", N_("Save Options _Now"), 0, 0,
291 G_CALLBACK(save_options_callback), MGROUP_SAFE },
292 { "RELOAD_TILESET", N_("_Reload Tileset"),
293 GDK_KEY_r, GDK_MOD1_MASK | GDK_CONTROL_MASK,
294 G_CALLBACK(reload_tileset_callback), MGROUP_SAFE },
295 { "GAME_SAVE", N_("_Save Game"), GDK_KEY_s, GDK_CONTROL_MASK,
296 G_CALLBACK(save_game_callback), MGROUP_SAFE },
297 { "GAME_SAVE_AS", N_("Save Game _As..."), 0, 0,
298 G_CALLBACK(save_game_as_callback), MGROUP_SAFE },
299 { "MAPIMG_SAVE", N_("Save Map _Image"), 0, 0,
300 G_CALLBACK(save_mapimg_callback), MGROUP_SAFE },
301 { "MAPIMG_SAVE_AS", N_("Save _Map Image As..."), 0, 0,
302 G_CALLBACK(save_mapimg_as_callback), MGROUP_SAFE },
303 { "LEAVE", N_("_Leave"), 0, 0, G_CALLBACK(leave_callback), MGROUP_SAFE },
304 { "QUIT", N_("_Quit"), GDK_KEY_q, GDK_CONTROL_MASK,
305 G_CALLBACK(quit_callback), MGROUP_SAFE },
306 { "FIND_CITY", N_("_Find City"), GDK_KEY_f, GDK_CONTROL_MASK,
307 G_CALLBACK(find_city_callback), MGROUP_SAFE },
308 { "WORKLISTS", N_("Work_lists"),
309 GDK_KEY_l, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
310 G_CALLBACK(worklists_callback), MGROUP_SAFE },
311 { "RALLY_DLG", N_("Rally point dialog"),
312 GDK_KEY_r, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
313 G_CALLBACK(rally_dialog_callback), MGROUP_SAFE },
314 { "INFRA_DLG", N_("Infra dialog"),
315 GDK_KEY_f, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
316 G_CALLBACK(infra_dialog_callback), MGROUP_SAFE },
317 { "CLIENT_LUA_SCRIPT", N_("Client _Lua Script"), 0, 0,
318 G_CALLBACK(client_lua_script_callback), MGROUP_SAFE },
319 { "MAP_VIEW", N_("?noun:_View"), GDK_KEY_F1, 0,
320 G_CALLBACK(map_view_callback), MGROUP_SAFE },
321 { "REPORT_UNITS", N_("_Units"), GDK_KEY_F2, 0,
322 G_CALLBACK(report_units_callback), MGROUP_SAFE },
323 { "REPORT_NATIONS", N_("_Nations"), GDK_KEY_F3, 0,
324 G_CALLBACK(report_nations_callback), MGROUP_SAFE },
325 { "REPORT_CITIES", N_("_Cities"), GDK_KEY_F4, 0,
326 G_CALLBACK(report_cities_callback), MGROUP_SAFE },
327 { "REPORT_WOW", N_("_Wonders of the World"), GDK_KEY_F7, 0,
328 G_CALLBACK(report_wow_callback), MGROUP_SAFE },
329 { "REPORT_TOP_CITIES", N_("Top Cities"), GDK_KEY_F8, 0,
330 G_CALLBACK(report_top_cities_callback), MGROUP_SAFE },
331 { "REPORT_MESSAGES", N_("_Messages"), GDK_KEY_F9, 0,
332 G_CALLBACK(report_messages_callback), MGROUP_SAFE },
333 { "REPORT_DEMOGRAPHIC", N_("_Demographics"), GDK_KEY_F11, 0,
334 G_CALLBACK(report_demographic_callback), MGROUP_SAFE },
335
336 /* Battle Groups menu */
337 /* Note that user view: 1 - 4, internal: 0 - 3 */
338 { "BATTLE_GROUP_SELECT_0", N_("Select Battle Group 1"),
339 GDK_KEY_F1, GDK_SHIFT_MASK,
340 G_CALLBACK(bg_select0_callback), MGROUP_SAFE },
341 { "BATTLE_GROUP_ASSIGN_0", N_("Assign Battle Group 1"),
342 GDK_KEY_F1, GDK_CONTROL_MASK,
343 G_CALLBACK(bg_assign0_callback), MGROUP_SAFE },
344 { "BATTLE_GROUP_APPEND_0", N_("Append to Battle Group 1"),
345 GDK_KEY_F1, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
346 G_CALLBACK(bg_append0_callback), MGROUP_SAFE },
347 { "BATTLE_GROUP_SELECT_1", N_("Select Battle Group 2"),
348 GDK_KEY_F2, GDK_SHIFT_MASK,
349 G_CALLBACK(bg_select1_callback), MGROUP_SAFE },
350 { "BATTLE_GROUP_ASSIGN_1", N_("Assign Battle Group 2"),
351 GDK_KEY_F2, GDK_CONTROL_MASK,
352 G_CALLBACK(bg_assign1_callback), MGROUP_SAFE },
353 { "BATTLE_GROUP_APPEND_1", N_("Append to Battle Group 2"),
354 GDK_KEY_F2, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
355 G_CALLBACK(bg_append1_callback), MGROUP_SAFE },
356 { "BATTLE_GROUP_SELECT_2", N_("Select Battle Group 3"),
357 GDK_KEY_F3, GDK_SHIFT_MASK,
358 G_CALLBACK(bg_select2_callback), MGROUP_SAFE },
359 { "BATTLE_GROUP_ASSIGN_2", N_("Assign Battle Group 3"),
360 GDK_KEY_F3, GDK_CONTROL_MASK,
361 G_CALLBACK(bg_assign2_callback), MGROUP_SAFE },
362 { "BATTLE_GROUP_APPEND_2", N_("Append to Battle Group 3"),
363 GDK_KEY_F3, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
364 G_CALLBACK(bg_append2_callback), MGROUP_SAFE },
365 { "BATTLE_GROUP_SELECT_3", N_("Select Battle Group 4"),
366 GDK_KEY_F4, GDK_SHIFT_MASK,
367 G_CALLBACK(bg_select3_callback), MGROUP_SAFE },
368 { "BATTLE_GROUP_ASSIGN_3", N_("Assign Battle Group 4"),
369 GDK_KEY_F4, GDK_CONTROL_MASK,
370 G_CALLBACK(bg_assign3_callback), MGROUP_SAFE },
371 { "BATTLE_GROUP_APPEND_3", N_("Append to Battle Group 4"),
372 GDK_KEY_F4, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
373 G_CALLBACK(bg_append3_callback), MGROUP_SAFE },
374
375 { "HELP_OVERVIEW", N_("?help:Overview"), 0, 0,
376 G_CALLBACK(help_overview_callback), MGROUP_SAFE },
377 { "HELP_PLAYING", N_("Strategy and Tactics"), 0, 0,
378 G_CALLBACK(help_playing_callback), MGROUP_SAFE },
379 { "HELP_POLICIES", N_("Policies"), 0, 0,
380 G_CALLBACK(help_policies_callback), MGROUP_SAFE },
381 { "HELP_TERRAIN", N_("Terrain"), 0, 0,
382 G_CALLBACK(help_terrain_callback), MGROUP_SAFE },
383 { "HELP_ECONOMY", N_("Economy"), 0, 0,
384 G_CALLBACK(help_economy_callback), MGROUP_SAFE },
385 { "HELP_CITIES", N_("Cities"), 0, 0,
386 G_CALLBACK(help_cities_callback), MGROUP_SAFE },
387 { "HELP_IMPROVEMENTS", N_("City Improvements"), 0, 0,
388 G_CALLBACK(help_improvements_callback), MGROUP_SAFE },
389 { "HELP_WONDERS", N_("Wonders of the World"), 0, 0,
390 G_CALLBACK(help_wonders_callback), MGROUP_SAFE },
391 { "HELP_UNITS", N_("Units"), 0, 0,
392 G_CALLBACK(help_units_callback), MGROUP_SAFE },
393 { "HELP_COMBAT", N_("Combat"), 0, 0,
394 G_CALLBACK(help_combat_callback), MGROUP_SAFE },
395 { "HELP_ZOC", N_("Zones of Control"), 0, 0,
396 G_CALLBACK(help_zoc_callback), MGROUP_SAFE },
397 { "HELP_GOVERNMENT", N_("Government"), 0, 0,
398 G_CALLBACK(help_government_callback), MGROUP_SAFE },
399 { "HELP_DIPLOMACY", N_("Diplomacy"), 0, 0,
400 G_CALLBACK(help_diplomacy_callback), MGROUP_SAFE },
401 { "HELP_TECH", N_("Technology"), 0, 0,
402 G_CALLBACK(help_tech_callback), MGROUP_SAFE },
403 { "HELP_SPACE_RACE", N_("Space Race"), 0, 0,
404 G_CALLBACK(help_space_race_callback), MGROUP_SAFE },
405 { "HELP_RULESET", N_("About Current Ruleset"), 0, 0,
406 G_CALLBACK(help_ruleset_callback), MGROUP_SAFE },
407 { "HELP_TILESET", N_("About Current Tileset"), 0, 0,
408 G_CALLBACK(help_tileset_callback), MGROUP_SAFE },
409 { "HELP_MUSICSET", N_("About Current Musicset"), 0, 0,
410 G_CALLBACK(help_musicset_callback), MGROUP_SAFE },
411 { "HELP_NATIONS", N_("About Nations"), 0, 0,
412 G_CALLBACK(help_nations_callback), MGROUP_SAFE },
413 { "HELP_CONNECTING", N_("Connecting"), 0, 0,
414 G_CALLBACK(help_connecting_callback), MGROUP_SAFE },
415 { "HELP_CONTROLS", N_("Controls"), 0, 0,
416 G_CALLBACK(help_controls_callback), MGROUP_SAFE },
417 { "HELP_CMA", N_("Citizen Governor"), 0, 0,
418 G_CALLBACK(help_cma_callback), MGROUP_SAFE },
419 { "HELP_CHATLINE", N_("Chatline"), 0, 0,
420 G_CALLBACK(help_chatline_callback), MGROUP_SAFE },
421 { "HELP_WORKLIST_EDITOR", N_("Worklist Editor"), 0, 0,
422 G_CALLBACK(help_worklist_editor_callback), MGROUP_SAFE },
423 { "HELP_LANGUAGES", N_("Languages"), 0, 0,
424 G_CALLBACK(help_language_callback), MGROUP_SAFE },
425 { "HELP_COPYING", N_("Copying"), 0, 0,
426 G_CALLBACK(help_copying_callback), MGROUP_SAFE },
427 { "HELP_ABOUT", N_("About Freeciv"), 0, 0,
428 G_CALLBACK(help_about_callback), MGROUP_SAFE },
429 { "SAVE_OPTIONS_ON_EXIT", N_("Save Options on _Exit"), 0, 0,
430 G_CALLBACK(save_options_on_exit_callback), MGROUP_SAFE },
431 { "EDIT_MODE", N_("_Editing Mode"), GDK_KEY_e, GDK_CONTROL_MASK,
432 G_CALLBACK(edit_mode_callback), MGROUP_SAFE },
433 { "SHOW_CITY_OUTLINES", N_("Cit_y Outlines"), GDK_KEY_y, GDK_CONTROL_MASK,
434 G_CALLBACK(show_city_outlines_callback), MGROUP_SAFE },
435 { "SHOW_CITY_OUTPUT", N_("City Output"), GDK_KEY_v, GDK_CONTROL_MASK,
436 G_CALLBACK(show_city_output_callback), MGROUP_SAFE },
437 { "SHOW_MAP_GRID", N_("Map _Grid"), GDK_KEY_g, GDK_CONTROL_MASK,
438 G_CALLBACK(show_map_grid_callback), MGROUP_SAFE },
439 { "SHOW_NATIONAL_BORDERS", N_("National _Borders"), GDK_KEY_b, GDK_CONTROL_MASK,
440 G_CALLBACK(show_national_borders_callback), MGROUP_SAFE },
441 { "SHOW_NATIVE_TILES", N_("Native Tiles"), GDK_KEY_n, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
442 G_CALLBACK(show_native_tiles_callback), MGROUP_SAFE },
443 { "SHOW_CITY_FULL_BAR", N_("City Full Bar"), 0, 0,
444 G_CALLBACK(show_city_full_bar_callback), MGROUP_SAFE },
445 { "SHOW_CITY_NAMES", N_("City _Names"), GDK_KEY_n, GDK_CONTROL_MASK,
446 G_CALLBACK(show_city_names_callback), MGROUP_SAFE },
447 { "SHOW_CITY_GROWTH", N_("City G_rowth"), GDK_KEY_o, GDK_CONTROL_MASK,
448 G_CALLBACK(show_city_growth_callback), MGROUP_SAFE },
449 { "SHOW_CITY_PRODUCTIONS", N_("City _Production"), GDK_KEY_p, GDK_CONTROL_MASK,
450 G_CALLBACK(show_city_productions_callback), MGROUP_SAFE },
451 { "SHOW_CITY_BUY_COST", N_("City Buy Cost"), 0, 0,
452 G_CALLBACK(show_city_buy_cost_callback), MGROUP_SAFE },
453 { "SHOW_CITY_TRADE_ROUTES", N_("City Tra_deroutes"), GDK_KEY_d, GDK_CONTROL_MASK,
454 G_CALLBACK(show_city_trade_routes_callback), MGROUP_SAFE },
455 { "SHOW_TERRAIN", N_("_Terrain"), 0, 0,
456 G_CALLBACK(show_terrain_callback), MGROUP_SAFE },
457 { "SHOW_COASTLINE", N_("C_oastline"), 0, 0,
458 G_CALLBACK(show_coastline_callback), MGROUP_SAFE },
459 { "SHOW_PATHS", N_("_Paths"), 0, 0,
460 G_CALLBACK(show_paths_callback), MGROUP_SAFE },
461 { "SHOW_IRRIGATION", N_("_Irrigation"), 0, 0,
462 G_CALLBACK(show_irrigation_callback), MGROUP_SAFE },
463 { "SHOW_MINES", N_("_Mines"), 0, 0,
464 G_CALLBACK(show_mine_callback), MGROUP_SAFE },
465 { "SHOW_BASES", N_("_Bases"), 0, 0,
466 G_CALLBACK(show_bases_callback), MGROUP_SAFE },
467 { "SHOW_RESOURCES", N_("_Resources"), 0, 0,
468 G_CALLBACK(show_resources_callback), MGROUP_SAFE },
469 { "SHOW_HUTS", N_("_Huts"), 0, 0,
470 G_CALLBACK(show_huts_callback), MGROUP_SAFE },
471 { "SHOW_POLLUTION", N_("Po_llution & Fallout"), 0, 0,
472 G_CALLBACK(show_pollution_callback), MGROUP_SAFE },
473 { "SHOW_CITIES", N_("Citi_es"), 0, 0,
474 G_CALLBACK(show_cities_callback), MGROUP_SAFE },
475 { "SHOW_UNITS", N_("_Units"), 0, 0,
476 G_CALLBACK(show_units_callback), MGROUP_SAFE },
477 { "SHOW_UNIT_SOLID_BG", N_("Unit Solid Background"), 0, 0,
478 G_CALLBACK(show_unit_solid_bg_callback), MGROUP_SAFE },
479 { "SHOW_UNIT_SHIELDS", N_("Unit shields"), 0, 0,
480 G_CALLBACK(show_unit_shields_callback), MGROUP_SAFE },
481 { "SHOW_STACK_SIZE", N_("Unit Stack Size"),
482 GDK_KEY_plus, GDK_CONTROL_MASK,
483 G_CALLBACK(show_stack_size_callback), MGROUP_SAFE },
484 { "SHOW_FOCUS_UNIT", N_("Focu_s Unit"), 0, 0,
485 G_CALLBACK(show_focus_unit_callback), MGROUP_SAFE },
486 { "SHOW_FOG_OF_WAR", N_("Fog of _War"), 0, 0,
487 G_CALLBACK(show_fog_of_war_callback), MGROUP_SAFE },
488 { "FULL_SCREEN", N_("_Fullscreen"), GDK_KEY_Return, GDK_MOD1_MASK,
489 G_CALLBACK(full_screen_callback), MGROUP_SAFE },
490
491 { "RECALC_BORDERS", N_("Recalculate _Borders"), 0, 0,
492 G_CALLBACK(recalc_borders_callback), MGROUP_EDIT },
493 { "TOGGLE_FOG", N_("Toggle Fog of _War"), GDK_KEY_w,
494 GDK_CONTROL_MASK | GDK_SHIFT_MASK,
495 G_CALLBACK(toggle_fog_callback), MGROUP_EDIT },
496 { "SCENARIO_PROPERTIES", N_("Game/Scenario Properties"), 0, 0,
497 G_CALLBACK(scenario_properties_callback), MGROUP_EDIT },
498 { "SAVE_SCENARIO", N_("Save Scenario"), 0, 0,
499 G_CALLBACK(save_scenario_callback), MGROUP_EDIT },
500
501 { "CENTER_VIEW", N_("_Center View"), GDK_KEY_c, 0,
502 G_CALLBACK(center_view_callback), MGROUP_PLAYER },
503 { "REPORT_ECONOMY", N_("_Economy"), GDK_KEY_F5, 0,
504 G_CALLBACK(report_economy_callback), MGROUP_PLAYER },
505 { "REPORT_RESEARCH", N_("_Research"), GDK_KEY_F6, 0,
506 G_CALLBACK(report_research_callback), MGROUP_PLAYER },
507 { "POLICIES", N_("_Policies..."),
508 GDK_KEY_p, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
509 G_CALLBACK(multiplier_callback), MGROUP_PLAYER },
510 { "REPORT_SPACESHIP", N_("_Spaceship"), GDK_KEY_F12, 0,
511 G_CALLBACK(report_spaceship_callback), MGROUP_PLAYER },
512 { "REPORT_ACHIEVEMENTS", N_("_Achievements"), GDK_KEY_asterisk, 0,
513 G_CALLBACK(report_achievements_callback), MGROUP_PLAYER },
514
515 { "MENU_SELECT", N_("_Select"), 0, 0, NULL, MGROUP_UNIT },
516 { "MENU_UNIT", N_("_Unit"), 0, 0, NULL, MGROUP_UNIT },
517 { "MENU_WORK", N_("_Work"), 0, 0, NULL, MGROUP_UNIT },
518 { "MENU_COMBAT", N_("_Combat"), 0, 0, NULL, MGROUP_UNIT },
519 { "MENU_BUILD_BASE", N_("Build _Base"), 0, 0, NULL, MGROUP_UNIT },
520 { "MENU_BUILD_PATH", N_("Build _Path"), 0, 0, NULL, MGROUP_UNIT },
521 { "MENU_CLEAN", N_("_Clean Nuisance"), 0, 0, NULL, MGROUP_UNIT },
522 { "SELECT_SINGLE", N_("_Single Unit (Unselect Others)"), GDK_KEY_z, 0,
523 G_CALLBACK(select_single_callback), MGROUP_UNIT },
524 { "SELECT_ALL_ON_TILE", N_("_All On Tile"), GDK_KEY_v, 0,
525 G_CALLBACK(select_all_on_tile_callback), MGROUP_UNIT },
526 { "SELECT_SAME_TYPE_TILE", N_("Same Type on _Tile"),
527 GDK_KEY_v, GDK_SHIFT_MASK,
528 G_CALLBACK(select_same_type_tile_callback), MGROUP_UNIT },
529 { "SELECT_SAME_TYPE_CONT", N_("Same Type on _Continent"),
530 GDK_KEY_c, GDK_SHIFT_MASK,
531 G_CALLBACK(select_same_type_cont_callback), MGROUP_UNIT },
532 { "SELECT_SAME_TYPE", N_("Same Type _Everywhere"), GDK_KEY_x, GDK_SHIFT_MASK,
533 G_CALLBACK(select_same_type_callback), MGROUP_UNIT },
534 { "SELECT_DLG", N_("Unit Selection Dialog"), 0, 0,
535 G_CALLBACK(select_dialog_callback), MGROUP_UNIT },
536 { "UNIT_WAIT", N_("_Wait"), GDK_KEY_w, 0,
537 G_CALLBACK(unit_wait_callback), MGROUP_UNIT },
538 { "UNIT_DONE", N_("_Done"), GDK_KEY_space, 0,
539 G_CALLBACK(unit_done_callback), MGROUP_UNIT },
540 { "UNIT_GOTO", N_("_Go to"), GDK_KEY_g, 0,
541 G_CALLBACK(unit_goto_callback), MGROUP_UNIT },
542 { "MENU_GOTO_AND", N_("Go to a_nd..."), 0, 0, NULL, MGROUP_UNIT },
543 { "UNIT_GOTO_CITY", N_("Go _to/Airlift to City..."), GDK_KEY_t, 0,
544 G_CALLBACK(unit_goto_city_callback), MGROUP_UNIT },
545 { "UNIT_RETURN", N_("_Return to Nearest City"), GDK_KEY_g, GDK_SHIFT_MASK,
546 G_CALLBACK(unit_return_callback), MGROUP_UNIT },
547 { "UNIT_EXPLORE", N_("Auto E_xplore"), GDK_KEY_x, 0,
548 G_CALLBACK(unit_explore_callback), MGROUP_UNIT },
549 { "UNIT_PATROL", N_("_Patrol"), GDK_KEY_q, 0,
550 G_CALLBACK(unit_patrol_callback), MGROUP_UNIT },
551 { "UNIT_SENTRY", N_("_Sentry"), GDK_KEY_s, 0,
552 G_CALLBACK(unit_sentry_callback), MGROUP_UNIT },
553 { "UNIT_UNSENTRY", N_("Uns_entry All On Tile"), GDK_KEY_s, GDK_SHIFT_MASK,
554 G_CALLBACK(unit_unsentry_callback), MGROUP_UNIT },
555 { "UNIT_BOARD", N_("_Load"), GDK_KEY_l, 0,
556 G_CALLBACK(unit_board_callback), MGROUP_UNIT },
557 { "UNIT_DEBOARD", N_("_Unload"), GDK_KEY_u, 0,
558 G_CALLBACK(unit_deboard_callback), MGROUP_UNIT },
559 { "UNIT_UNLOAD_TRANSPORTER", N_("U_nload All From Transporter"),
560 GDK_KEY_t, GDK_SHIFT_MASK,
561 G_CALLBACK(unit_unload_transporter_callback), MGROUP_UNIT },
562 { "UNIT_HOMECITY", N_("Set _Home City"), GDK_KEY_h, 0,
563 G_CALLBACK(unit_homecity_callback), MGROUP_UNIT },
564 { "UNIT_UPGRADE", N_("Upgr_ade"), GDK_KEY_u, GDK_SHIFT_MASK,
565 G_CALLBACK(unit_upgrade_callback), MGROUP_UNIT },
566 { "UNIT_CONVERT", N_("C_onvert"), GDK_KEY_o, GDK_SHIFT_MASK,
567 G_CALLBACK(unit_convert_callback), MGROUP_UNIT },
568 { "UNIT_DISBAND", N_("_Disband"), GDK_KEY_d, GDK_SHIFT_MASK,
569 G_CALLBACK(unit_disband_callback), MGROUP_UNIT },
570 { "BUILD_CITY", N_("_Build City"), GDK_KEY_b, 0,
571 G_CALLBACK(build_city_callback), MGROUP_UNIT },
572 { "AUTO_WORKER", N_("_Auto Worker"), GDK_KEY_a, 0,
573 G_CALLBACK(auto_work_callback), MGROUP_UNIT },
574 { "BUILD_ROAD", N_("Build _Road"), GDK_KEY_r, 0,
575 G_CALLBACK(build_road_callback), MGROUP_UNIT },
576 { "BUILD_IRRIGATION", N_("Build _Irrigation"), GDK_KEY_i, 0,
577 G_CALLBACK(build_irrigation_callback), MGROUP_UNIT },
578 { "CULTIVATE", N_("Cultivate"), GDK_KEY_i, GDK_SHIFT_MASK,
579 G_CALLBACK(cultivate_callback), MGROUP_UNIT },
580 { "BUILD_MINE", N_("Build _Mine"), GDK_KEY_m, 0,
581 G_CALLBACK(build_mine_callback), MGROUP_UNIT },
582 { "PLANT", N_("Plant"), GDK_KEY_m, GDK_SHIFT_MASK,
583 G_CALLBACK(plant_callback), MGROUP_UNIT },
584 { "CONNECT_ROAD", N_("Connect With Roa_d"), GDK_KEY_r, GDK_CONTROL_MASK,
585 G_CALLBACK(connect_road_callback), MGROUP_UNIT },
586 { "CONNECT_RAIL", N_("Connect With Rai_l"), GDK_KEY_l, GDK_CONTROL_MASK,
587 G_CALLBACK(connect_rail_callback), MGROUP_UNIT },
588 { "CONNECT_MAGLEV", N_("Connect With _Maglev"), GDK_KEY_m, GDK_CONTROL_MASK,
589 G_CALLBACK(connect_maglev_callback), MGROUP_UNIT },
590 { "CONNECT_IRRIGATION", N_("Connect With Irri_gation"),
591 GDK_KEY_i, GDK_CONTROL_MASK,
592 G_CALLBACK(connect_irrigation_callback), MGROUP_UNIT },
593 { "TRANSFORM_TERRAIN", N_("Transf_orm Terrain"), GDK_KEY_o, 0,
594 G_CALLBACK(transform_terrain_callback), MGROUP_UNIT },
595 { "CLEAN", N_("_Clean"), GDK_KEY_p, 0,
596 G_CALLBACK(clean_nuisance_callback), MGROUP_UNIT },
597 { "FORTIFY", N_("Fortify"), GDK_KEY_f, 0,
598 G_CALLBACK(fortify_callback), MGROUP_UNIT },
599 { "BUILD_FORTRESS", N_("Build Fortress"), GDK_KEY_f, GDK_SHIFT_MASK,
600 G_CALLBACK(build_fortress_callback), MGROUP_UNIT },
601 { "BUILD_AIRBASE", N_("Build Airbase"), GDK_KEY_e, GDK_SHIFT_MASK,
602 G_CALLBACK(build_airbase_callback), MGROUP_UNIT },
603 { "DO_PARADROP", N_("P_aradrop"), GDK_KEY_j, 0,
604 G_CALLBACK(do_paradrop_callback), MGROUP_UNIT },
605 { "DO_PILLAGE", N_("_Pillage"), GDK_KEY_p, GDK_SHIFT_MASK,
606 G_CALLBACK(do_pillage_callback), MGROUP_UNIT },
607 { "DIPLOMAT_ACTION", N_("_Do..."), GDK_KEY_d, 0,
608 G_CALLBACK(diplomat_action_callback), MGROUP_UNIT },
609
610 { "MENU_GOVERNMENT", N_("_Government"), 0, 0,
611 NULL, MGROUP_PLAYING },
612 { "TAX_RATE", N_("_Tax Rates..."), GDK_KEY_t, GDK_CONTROL_MASK,
613 G_CALLBACK(tax_rate_callback), MGROUP_PLAYING },
614 { "START_REVOLUTION", N_("_Revolution..."),
615 GDK_KEY_g, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
616 G_CALLBACK(government_callback), MGROUP_PLAYING },
617 { NULL }
618};
619
620static struct menu_entry_info *menu_entry_info_find(const char *key);
621
622/************************************************************************/
625 static void clear_chat_logs_callback(GtkMenuItem *item, gpointer data)
626{
627 clear_output_window();
628}
629
630/************************************************************************/
633 static void save_chat_logs_callback(GtkMenuItem *item, gpointer data)
634{
635 log_output_window();
636}
637
638/************************************************************************/
641 static void local_options_callback(GtkMenuItem *item, gpointer data)
642{
643 option_dialog_popup(_("Set local options"), client_optset);
644}
645
646/************************************************************************/
649 static void message_options_callback(GtkMenuItem *item, gpointer data)
650{
651 popup_messageopt_dialog();
652}
653
654/************************************************************************/
657 static void server_options_callback(GtkMenuItem *item, gpointer data)
658{
659 option_dialog_popup(_("Game Settings"), server_optset);
660}
661
662/************************************************************************/
665 static void save_options_callback(GtkMenuItem *item, gpointer data)
666{
667 options_save(NULL);
668}
669
670/************************************************************************/
673 static void reload_tileset_callback(GtkMenuItem *item, gpointer data)
674{
675 tilespec_reread(NULL, TRUE, 1.0);
676}
677
678/************************************************************************/
681 static void save_game_callback(GtkMenuItem *item, gpointer data)
682{
683 send_save_game(NULL);
684}
685
686/************************************************************************/
689 static void save_game_as_callback(GtkMenuItem *item, gpointer data)
690{
691 save_game_dialog_popup();
692}
693
694/************************************************************************/
697 static void save_mapimg_callback(GtkMenuItem *item, gpointer data)
698{
699 mapimg_client_save(NULL);
700}
701
702/************************************************************************/
705 static void save_mapimg_as_callback(GtkMenuItem *item, gpointer data)
706{
707 save_mapimg_dialog_popup();
708}
709
710/************************************************************************/
714 static void leave_local_game_response(GtkWidget *dialog, gint response)
715{
716 gtk_widget_destroy(dialog);
717 if (response == GTK_RESPONSE_OK) {
718 /* It might be killed already */
719 if (client.conn.used) {
720 /* It will also kill the server */
721 disconnect_from_server(TRUE);
722 }
723 }
724}
725
726/************************************************************************/
729 static void leave_callback(GtkMenuItem *item, gpointer data)
730{
731 if (is_server_running()) {
732 GtkWidget* dialog =
733 gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_WARNING,
734 GTK_BUTTONS_OK_CANCEL,
735 _("Leaving a local game will end it!"));
736 setup_dialog(dialog, toplevel);
737 gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE);
738 g_signal_connect(dialog, "response",
739 G_CALLBACK(leave_local_game_response), NULL);
740 gtk_window_present(GTK_WINDOW(dialog));
741 } else {
742 disconnect_from_server(TRUE);
743 }
744}
745
746/************************************************************************/
749 static void quit_callback(GtkMenuItem *item, gpointer data)
750{
751 popup_quit_dialog();
752}
753
754/************************************************************************/
757 static void find_city_callback(GtkMenuItem *item, gpointer data)
758{
759 popup_find_dialog();
760}
761
762/************************************************************************/
765 static void worklists_callback(GtkMenuItem *item, gpointer data)
766{
767 popup_worklists_report();
768}
769
770/************************************************************************/
773 static void map_view_callback(GtkMenuItem *item, gpointer data)
774{
775 map_canvas_focus();
776}
777
778/************************************************************************/
781 static void report_nations_callback(GtkMenuItem *item, gpointer data)
782{
783 popup_players_dialog(TRUE);
784}
785
786/************************************************************************/
789 static void report_wow_callback(GtkMenuItem *item, gpointer data)
790{
791 if (GUI_GTK_OPTION(message_chat_location) == GUI_GTK_MSGCHAT_MERGED) {
792 send_report_request(REPORT_WONDERS_OF_THE_WORLD_LONG);
793 } else {
794 send_report_request(REPORT_WONDERS_OF_THE_WORLD);
795 }
796}
797
798/************************************************************************/
801 static void report_top_cities_callback(GtkMenuItem *item, gpointer data)
802{
803 send_report_request(REPORT_TOP_CITIES);
804}
805
806/************************************************************************/
809 static void report_messages_callback(GtkMenuItem *item, gpointer data)
810{
811 meswin_dialog_popup(TRUE);
812}
813
814/************************************************************************/
817 static void client_lua_script_callback(GtkMenuItem *item, gpointer data)
818{
819 luaconsole_dialog_popup(TRUE);
820}
821
822/************************************************************************/
825 static void report_demographic_callback(GtkMenuItem *item, gpointer data)
826{
827 send_report_request(REPORT_DEMOGRAPHIC);
828}
829
830/************************************************************************/
833 static void report_achievements_callback(GtkMenuItem *item, gpointer data)
834{
835 send_report_request(REPORT_ACHIEVEMENTS);
836}
837
838/************************************************************************/
841 static void help_language_callback(GtkMenuItem *item, gpointer data)
842{
843 popup_help_dialog_string(HELP_LANGUAGES_ITEM);
844}
845
846/************************************************************************/
849 static void help_policies_callback(GtkMenuItem *item, gpointer data)
850{
851 popup_help_dialog_string(HELP_MULTIPLIER_ITEM);
852}
853
854/************************************************************************/
857 static void help_connecting_callback(GtkMenuItem *item, gpointer data)
858{
859 popup_help_dialog_string(HELP_CONNECTING_ITEM);
860}
861
862/************************************************************************/
865 static void help_controls_callback(GtkMenuItem *item, gpointer data)
866{
867 popup_help_dialog_string(HELP_CONTROLS_ITEM);
868}
869
870/************************************************************************/
873 static void help_chatline_callback(GtkMenuItem *item, gpointer data)
874{
875 popup_help_dialog_string(HELP_CHATLINE_ITEM);
876}
877
878/************************************************************************/
881 static void help_worklist_editor_callback(GtkMenuItem *item, gpointer data)
882{
883 popup_help_dialog_string(HELP_WORKLIST_EDITOR_ITEM);
884}
885
886/************************************************************************/
889 static void help_cma_callback(GtkMenuItem *item, gpointer data)
890{
891 popup_help_dialog_string(HELP_CMA_ITEM);
892}
893
894/************************************************************************/
897 static void bg_select0_callback(GtkMenuItem *item, gpointer data)
898{
899 key_unit_select_battlegroup(0, FALSE);
900}
901
902/************************************************************************/
905 static void bg_assign0_callback(GtkMenuItem *item, gpointer data)
906{
907 key_unit_assign_battlegroup(0, FALSE);
908}
909
910/************************************************************************/
913 static void bg_append0_callback(GtkMenuItem *item, gpointer data)
914{
915 key_unit_assign_battlegroup(0, TRUE);
916}
917
918/************************************************************************/
921 static void bg_select1_callback(GtkMenuItem *item, gpointer data)
922{
923 key_unit_select_battlegroup(1, FALSE);
924}
925
926/************************************************************************/
929 static void bg_assign1_callback(GtkMenuItem *item, gpointer data)
930{
931 key_unit_assign_battlegroup(1, FALSE);
932}
933
934/************************************************************************/
937 static void bg_append1_callback(GtkMenuItem *item, gpointer data)
938{
939 key_unit_assign_battlegroup(1, TRUE);
940}
941
942/************************************************************************/
945 static void bg_select2_callback(GtkMenuItem *item, gpointer data)
946{
947 key_unit_select_battlegroup(2, FALSE);
948}
949
950/************************************************************************/
953 static void bg_assign2_callback(GtkMenuItem *item, gpointer data)
954{
955 key_unit_assign_battlegroup(2, FALSE);
956}
957
958/************************************************************************/
961 static void bg_append2_callback(GtkMenuItem *item, gpointer data)
962{
963 key_unit_assign_battlegroup(2, TRUE);
964}
965
966/************************************************************************/
969 static void bg_select3_callback(GtkMenuItem *item, gpointer data)
970{
971 key_unit_select_battlegroup(3, FALSE);
972}
973
974/************************************************************************/
977 static void bg_assign3_callback(GtkMenuItem *item, gpointer data)
978{
979 key_unit_assign_battlegroup(3, FALSE);
980}
981
982/************************************************************************/
985 static void bg_append3_callback(GtkMenuItem *item, gpointer data)
986{
987 key_unit_assign_battlegroup(3, TRUE);
988}
989
990/************************************************************************/
993 static void help_overview_callback(GtkMenuItem *item, gpointer data)
994{
995 popup_help_dialog_string(HELP_OVERVIEW_ITEM);
996}
997
998/************************************************************************/
1001 static void help_playing_callback(GtkMenuItem *item, gpointer data)
1002{
1003 popup_help_dialog_string(HELP_PLAYING_ITEM);
1004}
1005
1006/************************************************************************/
1009 static void help_ruleset_callback(GtkMenuItem *item, gpointer data)
1010{
1011 popup_help_dialog_string(HELP_RULESET_ITEM);
1012}
1013
1014/************************************************************************/
1017 static void help_tileset_callback(GtkMenuItem *item, gpointer data)
1018{
1019 popup_help_dialog_string(HELP_TILESET_ITEM);
1020}
1021
1022/************************************************************************/
1025 static void help_musicset_callback(GtkMenuItem *item, gpointer data)
1026{
1027 popup_help_dialog_string(HELP_MUSICSET_ITEM);
1028}
1029
1030/************************************************************************/
1033 static void help_economy_callback(GtkMenuItem *item, gpointer data)
1034{
1035 popup_help_dialog_string(HELP_ECONOMY_ITEM);
1036}
1037
1038/************************************************************************/
1041 static void help_cities_callback(GtkMenuItem *item, gpointer data)
1042{
1043 popup_help_dialog_string(HELP_CITIES_ITEM);
1044}
1045
1046/************************************************************************/
1049 static void help_improvements_callback(GtkMenuItem *item, gpointer data)
1050{
1051 popup_help_dialog_string(HELP_IMPROVEMENTS_ITEM);
1052}
1053
1054/************************************************************************/
1057 static void help_units_callback(GtkMenuItem *item, gpointer data)
1058{
1059 popup_help_dialog_string(HELP_UNITS_ITEM);
1060}
1061
1062/************************************************************************/
1065 static void help_combat_callback(GtkMenuItem *item, gpointer data)
1066{
1067 popup_help_dialog_string(HELP_COMBAT_ITEM);
1068}
1069
1070/************************************************************************/
1073 static void help_zoc_callback(GtkMenuItem *item, gpointer data)
1074{
1075 popup_help_dialog_string(HELP_ZOC_ITEM);
1076}
1077
1078/************************************************************************/
1081 static void help_tech_callback(GtkMenuItem *item, gpointer data)
1082{
1083 popup_help_dialog_string(HELP_TECHS_ITEM);
1084}
1085
1086/************************************************************************/
1089 static void help_terrain_callback(GtkMenuItem *item, gpointer data)
1090{
1091 popup_help_dialog_string(HELP_TERRAIN_ITEM);
1092}
1093
1094/************************************************************************/
1097 static void help_wonders_callback(GtkMenuItem *item, gpointer data)
1098{
1099 popup_help_dialog_string(HELP_WONDERS_ITEM);
1100}
1101
1102/************************************************************************/
1105 static void help_government_callback(GtkMenuItem *item, gpointer data)
1106{
1107 popup_help_dialog_string(HELP_GOVERNMENT_ITEM);
1108}
1109
1110/************************************************************************/
1113 static void help_diplomacy_callback(GtkMenuItem *item, gpointer data)
1114{
1115 popup_help_dialog_string(HELP_DIPLOMACY_ITEM);
1116}
1117
1118/************************************************************************/
1121 static void help_space_race_callback(GtkMenuItem *item, gpointer data)
1122{
1123 popup_help_dialog_string(HELP_SPACE_RACE_ITEM);
1124}
1125
1126/************************************************************************/
1129 static void help_nations_callback(GtkMenuItem *item, gpointer data)
1130{
1131 popup_help_dialog_string(HELP_NATIONS_ITEM);
1132}
1133
1134/************************************************************************/
1137 static void help_copying_callback(GtkMenuItem *item, gpointer data)
1138{
1139 popup_help_dialog_string(HELP_COPYING_ITEM);
1140}
1141
1142/************************************************************************/
1145 static void help_about_callback(GtkMenuItem *item, gpointer data)
1146{
1147 popup_help_dialog_string(HELP_ABOUT_ITEM);
1148}
1149
1150/************************************************************************/
1153 static void save_options_on_exit_callback(GtkCheckMenuItem *item,
1154 gpointer data)
1155{
1156 gui_options.save_options_on_exit = gtk_check_menu_item_get_active(item);
1157}
1158
1159/************************************************************************/
1162 static void edit_mode_callback(GtkCheckMenuItem *item, gpointer data)
1163{
1164 if (game.info.is_edit_mode ^ gtk_check_menu_item_get_active(item)) {
1165 key_editor_toggle();
1166 /* Unreachable techs in reqtree on/off */
1167 science_report_dialog_popdown();
1168 }
1169}
1170
1171/************************************************************************/
1174 static void show_city_outlines_callback(GtkCheckMenuItem *item,
1175 gpointer data)
1176{
1177 if (gui_options.draw_city_outlines ^ gtk_check_menu_item_get_active(item)) {
1178 key_city_outlines_toggle();
1179 }
1180}
1181
1182/************************************************************************/
1185 static void show_city_output_callback(GtkCheckMenuItem *item,
1186 gpointer data)
1187{
1188 if (gui_options.draw_city_output ^ gtk_check_menu_item_get_active(item)) {
1189 key_city_output_toggle();
1190 }
1191}
1192
1193/************************************************************************/
1196 static void show_map_grid_callback(GtkCheckMenuItem *item,
1197 gpointer data)
1198{
1199 if (gui_options.draw_map_grid ^ gtk_check_menu_item_get_active(item)) {
1200 key_map_grid_toggle();
1201 }
1202}
1203
1204/************************************************************************/
1207 static void show_national_borders_callback(GtkCheckMenuItem *item,
1208 gpointer data)
1209{
1210 if (gui_options.draw_borders ^ gtk_check_menu_item_get_active(item)) {
1211 key_map_borders_toggle();
1212 }
1213}
1214
1215/************************************************************************/
1218 static void show_native_tiles_callback(GtkCheckMenuItem *item,
1219 gpointer data)
1220{
1221 if (gui_options.draw_native ^ gtk_check_menu_item_get_active(item)) {
1222 key_map_native_toggle();
1223 }
1224}
1225
1226/************************************************************************/
1229 static void show_city_full_bar_callback(GtkCheckMenuItem *item,
1230 gpointer data)
1231{
1232 if (gui_options.draw_full_citybar ^ gtk_check_menu_item_get_active(item)) {
1233 key_city_full_bar_toggle();
1234 view_menu_update_sensitivity();
1235 }
1236}
1237
1238/************************************************************************/
1241 static void show_city_names_callback(GtkCheckMenuItem *item,
1242 gpointer data)
1243{
1244 if (gui_options.draw_city_names ^ gtk_check_menu_item_get_active(item)) {
1245 key_city_names_toggle();
1246 view_menu_update_sensitivity();
1247 }
1248}
1249
1250/************************************************************************/
1253 static void show_city_growth_callback(GtkCheckMenuItem *item,
1254 gpointer data)
1255{
1256 if (gui_options.draw_city_growth ^ gtk_check_menu_item_get_active(item)) {
1257 key_city_growth_toggle();
1258 }
1259}
1260
1261/************************************************************************/
1264 static void show_city_productions_callback(GtkCheckMenuItem *item,
1265 gpointer data)
1266{
1267 if (gui_options.draw_city_productions ^ gtk_check_menu_item_get_active(item)) {
1268 key_city_productions_toggle();
1269 view_menu_update_sensitivity();
1270 }
1271}
1272
1273/************************************************************************/
1276 static void show_city_buy_cost_callback(GtkCheckMenuItem *item,
1277 gpointer data)
1278{
1279 if (gui_options.draw_city_buycost ^ gtk_check_menu_item_get_active(item)) {
1280 key_city_buycost_toggle();
1281 }
1282}
1283
1284/************************************************************************/
1287 static void show_city_trade_routes_callback(GtkCheckMenuItem *item,
1288 gpointer data)
1289{
1290 if (gui_options.draw_city_trade_routes ^ gtk_check_menu_item_get_active(item)) {
1291 key_city_trade_routes_toggle();
1292 }
1293}
1294
1295/************************************************************************/
1298 static void show_terrain_callback(GtkCheckMenuItem *item, gpointer data)
1299{
1300 if (gui_options.draw_terrain ^ gtk_check_menu_item_get_active(item)) {
1301 key_terrain_toggle();
1302 view_menu_update_sensitivity();
1303 }
1304}
1305
1306/************************************************************************/
1309 static void show_coastline_callback(GtkCheckMenuItem *item, gpointer data)
1310{
1311 if (gui_options.draw_coastline ^ gtk_check_menu_item_get_active(item)) {
1312 key_coastline_toggle();
1313 }
1314}
1315
1316/************************************************************************/
1319 static void show_paths_callback(GtkCheckMenuItem *item, gpointer data)
1320{
1321 if (gui_options.draw_paths ^ gtk_check_menu_item_get_active(item)) {
1322 key_paths_toggle();
1323 }
1324}
1325
1326/************************************************************************/
1329 static void show_irrigation_callback(GtkCheckMenuItem *item, gpointer data)
1330{
1331 if (gui_options.draw_irrigation ^ gtk_check_menu_item_get_active(item)) {
1332 key_irrigation_toggle();
1333 }
1334}
1335
1336/************************************************************************/
1339 static void show_mine_callback(GtkCheckMenuItem *item, gpointer data)
1340{
1341 if (gui_options.draw_mines ^ gtk_check_menu_item_get_active(item)) {
1342 key_mines_toggle();
1343 }
1344}
1345
1346/************************************************************************/
1349 static void show_bases_callback(GtkCheckMenuItem *item, gpointer data)
1350{
1351 if (gui_options.draw_fortress_airbase ^ gtk_check_menu_item_get_active(item)) {
1352 key_bases_toggle();
1353 }
1354}
1355
1356/************************************************************************/
1359 static void show_resources_callback(GtkCheckMenuItem *item, gpointer data)
1360{
1361 if (gui_options.draw_specials ^ gtk_check_menu_item_get_active(item)) {
1362 key_resources_toggle();
1363 }
1364}
1365
1366/************************************************************************/
1369 static void show_huts_callback(GtkCheckMenuItem *item, gpointer data)
1370{
1371 if (gui_options.draw_huts ^ gtk_check_menu_item_get_active(item)) {
1372 key_huts_toggle();
1373 }
1374}
1375
1376/************************************************************************/
1379 static void show_pollution_callback(GtkCheckMenuItem *item, gpointer data)
1380{
1381 if (gui_options.draw_pollution ^ gtk_check_menu_item_get_active(item)) {
1382 key_pollution_toggle();
1383 }
1384}
1385
1386/************************************************************************/
1389 static void show_cities_callback(GtkCheckMenuItem *item, gpointer data)
1390{
1391 if (gui_options.draw_cities ^ gtk_check_menu_item_get_active(item)) {
1392 key_cities_toggle();
1393 }
1394}
1395
1396/************************************************************************/
1399 static void show_units_callback(GtkCheckMenuItem *item, gpointer data)
1400{
1401 if (gui_options.draw_units ^ gtk_check_menu_item_get_active(item)) {
1402 key_units_toggle();
1403 view_menu_update_sensitivity();
1404 }
1405}
1406
1407/************************************************************************/
1410 static void show_unit_solid_bg_callback(GtkCheckMenuItem *item,
1411 gpointer data)
1412{
1413 if (gui_options.solid_color_behind_units ^ gtk_check_menu_item_get_active(item)) {
1414 key_unit_solid_bg_toggle();
1415 }
1416}
1417
1418/************************************************************************/
1421 static void show_unit_shields_callback(GtkCheckMenuItem *item,
1422 gpointer data)
1423{
1424 if (gui_options.draw_unit_shields ^ gtk_check_menu_item_get_active(item)) {
1425 key_unit_shields_toggle();
1426 }
1427}
1428
1429/************************************************************************/
1432 static void show_stack_size_callback(GtkCheckMenuItem *item,
1433 gpointer data)
1434{
1435 if (gui_options.draw_unit_stack_size ^ gtk_check_menu_item_get_active(item)) {
1436 key_unit_stack_size_toggle();
1437 }
1438}
1439
1440/************************************************************************/
1443 static void show_focus_unit_callback(GtkCheckMenuItem *item, gpointer data)
1444{
1445 if (gui_options.draw_focus_unit ^ gtk_check_menu_item_get_active(item)) {
1446 key_focus_unit_toggle();
1447 view_menu_update_sensitivity();
1448 }
1449}
1450
1451/************************************************************************/
1454 static void show_fog_of_war_callback(GtkCheckMenuItem *item, gpointer data)
1455{
1456 if (gui_options.draw_fog_of_war ^ gtk_check_menu_item_get_active(item)) {
1457 key_fog_of_war_toggle();
1458 view_menu_update_sensitivity();
1459 }
1460}
1461
1462/************************************************************************/
1465 static void full_screen_callback(GtkCheckMenuItem *item, gpointer data)
1466{
1467 if (GUI_GTK_OPTION(fullscreen) ^ gtk_check_menu_item_get_active(item)) {
1468 GUI_GTK_OPTION(fullscreen) ^= 1;
1469
1470 fullscreen_opt_refresh(NULL);
1471 }
1472}
1473
1474/************************************************************************/
1477 static void recalc_borders_callback(GtkMenuItem *item, gpointer data)
1478{
1479 key_editor_recalculate_borders();
1480}
1481
1482/************************************************************************/
1485 static void toggle_fog_callback(GtkMenuItem *item, gpointer data)
1486{
1487 key_editor_toggle_fogofwar();
1488}
1489
1490/************************************************************************/
1493 static void scenario_properties_callback(GtkMenuItem *item, gpointer data)
1494{
1495 struct property_editor *pe;
1496
1497 pe = editprop_get_property_editor();
1498 property_editor_reload(pe, OBJTYPE_GAME);
1499 property_editor_popup(pe, OBJTYPE_GAME);
1500}
1501
1502/************************************************************************/
1505 static void save_scenario_callback(GtkMenuItem *item, gpointer data)
1506{
1507 save_scenario_dialog_popup();
1508}
1509
1510/************************************************************************/
1513 static void select_single_callback(GtkMenuItem *item, gpointer data)
1514{
1515 request_unit_select(get_units_in_focus(), SELTYPE_SINGLE, SELLOC_TILE);
1516}
1517
1518/************************************************************************/
1521 static void select_all_on_tile_callback(GtkMenuItem *item, gpointer data)
1522{
1523 request_unit_select(get_units_in_focus(), SELTYPE_ALL, SELLOC_TILE);
1524}
1525
1526/************************************************************************/
1529 static void select_same_type_tile_callback(GtkMenuItem *item, gpointer data)
1530{
1531 request_unit_select(get_units_in_focus(), SELTYPE_SAME, SELLOC_TILE);
1532}
1533
1534/************************************************************************/
1537 static void select_same_type_cont_callback(GtkMenuItem *item, gpointer data)
1538{
1539 request_unit_select(get_units_in_focus(), SELTYPE_SAME, SELLOC_CONT);
1540}
1541
1542/************************************************************************/
1545 static void select_same_type_callback(GtkMenuItem *item, gpointer data)
1546{
1547 request_unit_select(get_units_in_focus(), SELTYPE_SAME, SELLOC_WORLD);
1548}
1549
1550/************************************************************************/
1553 static void select_dialog_callback(GtkMenuItem *item, gpointer data)
1554{
1555 unit_select_dialog_popup(NULL);
1556}
1557
1558/************************************************************************/
1561 static void rally_dialog_callback(GtkMenuItem *item, gpointer data)
1562{
1563 rally_dialog_popup();
1564}
1565
1566/************************************************************************/
1569 static void infra_dialog_callback(GtkMenuItem *item, gpointer data)
1570{
1571 infra_dialog_popup();
1572}
1573
1574/************************************************************************/
1577 static void unit_wait_callback(GtkMenuItem *item, gpointer data)
1578{
1579 key_unit_wait();
1580}
1581
1582/************************************************************************/
1585 static void unit_done_callback(GtkMenuItem *item, gpointer data)
1586{
1587 key_unit_done();
1588}
1589
1590/************************************************************************/
1593 static void unit_goto_callback(GtkMenuItem *item, gpointer data)
1594{
1595 key_unit_goto();
1596}
1597
1598/************************************************************************/
1601 static void unit_goto_and_callback(GtkMenuItem *item, gpointer data)
1602{
1603 int sub_target = NO_TARGET;
1604 struct action *paction = g_object_get_data(G_OBJECT(item), "end_action");
1605
1606 fc_assert_ret(paction != NULL);
1607
1608 switch (action_get_sub_target_kind(paction)) {
1609 case ASTK_BUILDING:
1610 {
1611 struct impr_type *pbuilding = g_object_get_data(G_OBJECT(item),
1612 "end_building");
1613 fc_assert_ret(pbuilding != NULL);
1614 sub_target = improvement_number(pbuilding);
1615 }
1616 break;
1617 case ASTK_TECH:
1618 {
1619 struct advance *ptech = g_object_get_data(G_OBJECT(item),
1620 "end_tech");
1621 fc_assert_ret(ptech != NULL);
1622 sub_target = advance_number(ptech);
1623 }
1624 break;
1625 case ASTK_EXTRA:
1626 case ASTK_EXTRA_NOT_THERE:
1627 {
1628 struct extra_type *pextra = g_object_get_data(G_OBJECT(item),
1629 "end_extra");
1630 fc_assert_ret(pextra != NULL);
1631 sub_target = extra_number(pextra);
1632 }
1633 break;
1634 case ASTK_NONE:
1635 sub_target = NO_TARGET;
1636 break;
1637 case ASTK_COUNT:
1638 /* Should not exits */
1639 fc_assert(action_get_sub_target_kind(paction) != ASTK_COUNT);
1640 break;
1641 }
1642
1643 request_unit_goto(ORDER_PERFORM_ACTION, paction->id, sub_target);
1644}
1645
1646/************************************************************************/
1649 static void unit_goto_city_callback(GtkMenuItem *item, gpointer data)
1650{
1651 if (get_num_units_in_focus() > 0) {
1652 popup_goto_dialog();
1653 }
1654}
1655
1656/************************************************************************/
1659 static void unit_return_callback(GtkMenuItem *item, gpointer data)
1660{
1661 unit_list_iterate(get_units_in_focus(), punit) {
1662 request_unit_return(punit);
1663 } unit_list_iterate_end;
1664}
1665
1666/************************************************************************/
1669 static void unit_explore_callback(GtkMenuItem *item, gpointer data)
1670{
1671 key_unit_auto_explore();
1672}
1673
1674/************************************************************************/
1677 static void unit_patrol_callback(GtkMenuItem *item, gpointer data)
1678{
1679 key_unit_patrol();
1680}
1681
1682/************************************************************************/
1685 static void unit_sentry_callback(GtkMenuItem *item, gpointer data)
1686{
1687 key_unit_sentry();
1688}
1689
1690/************************************************************************/
1693 static void unit_unsentry_callback(GtkMenuItem *item, gpointer data)
1694{
1695 key_unit_wakeup_others();
1696}
1697
1698/************************************************************************/
1701 static void unit_board_callback(GtkMenuItem *item, gpointer data)
1702{
1703 unit_list_iterate(get_units_in_focus(), punit) {
1704 request_transport(punit, unit_tile(punit));
1705 } unit_list_iterate_end;
1706}
1707
1708/************************************************************************/
1711 static void unit_deboard_callback(GtkMenuItem *item, gpointer data)
1712{
1713 unit_list_iterate(get_units_in_focus(), punit) {
1714 request_unit_unload(punit);
1715 } unit_list_iterate_end;
1716}
1717
1718/************************************************************************/
1721 static void unit_unload_transporter_callback(GtkMenuItem *item,
1722 gpointer data)
1723{
1724 key_unit_unload_all();
1725}
1726
1727/************************************************************************/
1730 static void unit_homecity_callback(GtkMenuItem *item, gpointer data)
1731{
1732 key_unit_homecity();
1733}
1734
1735/************************************************************************/
1738 static void unit_upgrade_callback(GtkMenuItem *item, gpointer data)
1739{
1740 popup_upgrade_dialog(get_units_in_focus());
1741}
1742
1743/************************************************************************/
1746 static void unit_convert_callback(GtkMenuItem *item, gpointer data)
1747{
1748 key_unit_convert();
1749}
1750
1751/************************************************************************/
1754 static void unit_disband_callback(GtkMenuItem *item, gpointer data)
1755{
1756 popup_disband_dialog(get_units_in_focus());
1757}
1758
1759/************************************************************************/
1762 static void build_city_callback(GtkMenuItem *item, gpointer data)
1763{
1764 unit_list_iterate(get_units_in_focus(), punit) {
1765 /* FIXME: this can provide different items for different units...
1766 * not good! */
1767 /* Enable the button for adding to a city in all cases, so we
1768 get an eventual error message from the server if we try. */
1769 if (unit_can_add_or_build_city(punit)) {
1770 request_unit_build_city(punit);
1771 } else if (utype_can_do_action(unit_type_get(punit),
1772 ACTION_HELP_WONDER)) {
1773 request_unit_caravan_action(punit, ACTION_HELP_WONDER);
1774 }
1775 } unit_list_iterate_end;
1776}
1777
1778/************************************************************************/
1781 static void auto_work_callback(GtkMenuItem *action, gpointer data)
1782{
1783 key_unit_auto_work();
1784}
1785
1786/************************************************************************/
1789 static void build_road_callback(GtkMenuItem *action, gpointer data)
1790{
1791 unit_list_iterate(get_units_in_focus(), punit) {
1792 /* FIXME: this can provide different actions for different units...
1793 * not good! */
1794 struct extra_type *tgt = next_extra_for_tile(unit_tile(punit),
1795 EC_ROAD,
1796 unit_owner(punit),
1797 punit);
1798 bool building_road = FALSE;
1799
1800 if (tgt != NULL
1801 && can_unit_do_activity_targeted_client(punit, ACTIVITY_GEN_ROAD, tgt)) {
1802 request_new_unit_activity_targeted(punit, ACTIVITY_GEN_ROAD, tgt);
1803 building_road = TRUE;
1804 }
1805
1806 if (!building_road && unit_can_est_trade_route_here(punit)) {
1807 request_unit_caravan_action(punit, ACTION_TRADE_ROUTE);
1808 }
1809 } unit_list_iterate_end;
1810}
1811
1812/************************************************************************/
1815 static void build_irrigation_callback(GtkMenuItem *action, gpointer data)
1816{
1817 key_unit_irrigate();
1818}
1819
1820/************************************************************************/
1823 static void cultivate_callback(GtkMenuItem *action, gpointer data)
1824{
1825 key_unit_cultivate();
1826}
1827
1828/************************************************************************/
1831 static void build_mine_callback(GtkMenuItem *action, gpointer data)
1832{
1833 key_unit_mine();
1834}
1835
1836/************************************************************************/
1839 static void plant_callback(GtkMenuItem *action, gpointer data)
1840{
1841 key_unit_plant();
1842}
1843
1844/************************************************************************/
1847 static void connect_road_callback(GtkMenuItem *action, gpointer data)
1848{
1849 struct road_type *proad = road_by_gui_type(ROAD_GUI_ROAD);
1850
1851 if (proad != NULL) {
1852 struct extra_type *tgt;
1853
1854 tgt = road_extra_get(proad);
1855
1856 key_unit_connect(ACTIVITY_GEN_ROAD, tgt);
1857 }
1858}
1859
1860/************************************************************************/
1863 static void connect_rail_callback(GtkMenuItem *action, gpointer data)
1864{
1865 struct road_type *prail = road_by_gui_type(ROAD_GUI_RAILROAD);
1866
1867 if (prail != NULL) {
1868 struct extra_type *tgt;
1869
1870 tgt = road_extra_get(prail);
1871
1872 key_unit_connect(ACTIVITY_GEN_ROAD, tgt);
1873 }
1874}
1875
1876/************************************************************************/
1879 static void connect_maglev_callback(GtkMenuItem *action, gpointer data)
1880{
1881 struct road_type *pmaglev = road_by_gui_type(ROAD_GUI_MAGLEV);
1882
1883 if (pmaglev != NULL) {
1884 struct extra_type *tgt;
1885
1886 tgt = road_extra_get(pmaglev);
1887
1888 key_unit_connect(ACTIVITY_GEN_ROAD, tgt);
1889 }
1890}
1891
1892/************************************************************************/
1895 static void connect_irrigation_callback(GtkMenuItem *action, gpointer data)
1896{
1897 struct extra_type_list *extras = extra_type_list_by_cause(EC_IRRIGATION);
1898
1899 if (extra_type_list_size(extras) > 0) {
1900 struct extra_type *pextra;
1901
1902 pextra = extra_type_list_get(extra_type_list_by_cause(EC_IRRIGATION), 0);
1903
1904 key_unit_connect(ACTIVITY_IRRIGATE, pextra);
1905 }
1906}
1907
1908/************************************************************************/
1911 static void transform_terrain_callback(GtkMenuItem *action, gpointer data)
1912{
1913 key_unit_transform();
1914}
1915
1916/************************************************************************/
1919 static void clean_nuisance_callback(GtkMenuItem *action, gpointer data)
1920{
1921 key_unit_clean();
1922}
1923
1924/************************************************************************/
1927 static void build_fortress_callback(GtkMenuItem *action, gpointer data)
1928{
1929 key_unit_fortress();
1930}
1931
1932/************************************************************************/
1935 static void fortify_callback(GtkMenuItem *action, gpointer data)
1936{
1937 unit_list_iterate(get_units_in_focus(), punit) {
1938 request_unit_fortify(punit);
1939 } unit_list_iterate_end;
1940}
1941
1942/************************************************************************/
1945 static void build_airbase_callback(GtkMenuItem *action, gpointer data)
1946{
1947 key_unit_airbase();
1948}
1949
1950/************************************************************************/
1953 static void do_paradrop_callback(GtkMenuItem *action, gpointer data)
1954{
1955 key_unit_paradrop();
1956}
1957
1958/************************************************************************/
1961 static void do_pillage_callback(GtkMenuItem *action, gpointer data)
1962{
1963 key_unit_pillage();
1964}
1965
1966/************************************************************************/
1969 static void diplomat_action_callback(GtkMenuItem *action, gpointer data)
1970{
1971 key_unit_action_select_tgt();
1972}
1973
1974/************************************************************************/
1977 static void tax_rate_callback(GtkMenuItem *action, gpointer data)
1978{
1979 popup_rates_dialog();
1980}
1981
1982/************************************************************************/
1985 static void multiplier_callback(GtkMenuItem *action, gpointer data)
1986{
1987 popup_multiplier_dialog();
1988}
1989
1990/************************************************************************/
1993 static void government_callback(GtkMenuItem *item, gpointer data)
1994{
1995 popup_revolution_dialog((struct government *) data);
1996}
1997
1998/************************************************************************/
2001 static void base_callback(GtkMenuItem *item, gpointer data)
2002{
2003 struct extra_type *pextra = data;
2004
2005 unit_list_iterate(get_units_in_focus(), punit) {
2006 request_new_unit_activity_targeted(punit, ACTIVITY_BASE, pextra);
2007 } unit_list_iterate_end;
2008}
2009
2010/************************************************************************/
2013 static void road_callback(GtkMenuItem *item, gpointer data)
2014{
2015 struct extra_type *pextra = data;
2016
2017 unit_list_iterate(get_units_in_focus(), punit) {
2018 request_new_unit_activity_targeted(punit, ACTIVITY_GEN_ROAD,
2019 pextra);
2020 } unit_list_iterate_end;
2021}
2022
2023/************************************************************************/
2026 static void clean_callback(GtkMenuItem *item, gpointer data)
2027{
2028 struct extra_type *pextra = data;
2029
2030 unit_list_iterate(get_units_in_focus(), punit) {
2031 if (can_unit_do_activity_targeted_client(punit, ACTIVITY_CLEAN, pextra)) {
2032 request_new_unit_activity_targeted(punit, ACTIVITY_CLEAN,
2033 pextra);
2034 }
2035 } unit_list_iterate_end;
2036}
2037
2038/************************************************************************/
2041 static void center_view_callback(GtkMenuItem *action, gpointer data)
2042{
2043 center_on_unit();
2044}
2045
2046/************************************************************************/
2049 static void report_units_callback(GtkMenuItem *action, gpointer data)
2050{
2051 units_report_dialog_popup(TRUE);
2052}
2053
2054/************************************************************************/
2057 static void report_cities_callback(GtkMenuItem *action, gpointer data)
2058{
2059 city_report_dialog_popup(TRUE);
2060}
2061
2062/************************************************************************/
2065 static void report_economy_callback(GtkMenuItem *action, gpointer data)
2066{
2067 economy_report_dialog_popup(TRUE);
2068}
2069
2070/************************************************************************/
2073 static void report_research_callback(GtkMenuItem *action, gpointer data)
2074{
2075 science_report_dialog_popup(TRUE);
2076}
2077
2078/************************************************************************/
2081 static void report_spaceship_callback(GtkMenuItem *action, gpointer data)
2082{
2083 if (NULL != client.conn.playing) {
2084 popup_spaceship_dialog(client.conn.playing);
2085 }
2086}
2087
2088/************************************************************************/
2091 static void menu_entry_init(GtkBuildable *item)
2092{
2093 const char *key = gtk_buildable_get_name(item);
2094 struct menu_entry_info *info = menu_entry_info_find(key);
2095
2096 if (info != NULL) {
2097 gtk_menu_item_set_label(GTK_MENU_ITEM(item),
2098 Q_(info->name));
2099 gtk_menu_item_set_use_underline(GTK_MENU_ITEM(item), TRUE);
2100 if (info->cb != NULL) {
2101 g_signal_connect(item, "activate", info->cb, NULL);
2102 }
2103
2104 if (info->accel != 0) {
2105 const char *path = gtk_menu_item_get_accel_path(GTK_MENU_ITEM(item));
2106
2107 if (path == NULL) {
2108 char buf[512];
2109
2110 fc_snprintf(buf, sizeof(buf), "<MENU>/%s", key);
2111 gtk_menu_item_set_accel_path(GTK_MENU_ITEM(item), buf);
2112 path = buf; /* Not NULL, but not usable either outside this block */
2113 }
2114
2115 if (path != NULL) {
2116 gtk_accel_map_add_entry(gtk_menu_item_get_accel_path(GTK_MENU_ITEM(item)),
2117 info->accel, info->accel_mod);
2118 }
2119 }
2120
2121 return;
2122 }
2123
2124 /* temporary naming solution */
2125 gtk_menu_item_set_label(GTK_MENU_ITEM(item), key);
2126}
2127
2128/************************************************************************/
2131 static const gchar *get_ui_filename(void)
2132{
2133 static char filename[256];
2134 const char *name;
2135
2136 if ((name = getenv("FREECIV_MENUS"))
2137 || (name = fileinfoname(get_data_dirs(), "gtk3.22_menus.xml"))) {
2138 sz_strlcpy(filename, name);
2139 } else {
2140 log_error("Gtk menus: file definition not found");
2141 filename[0] = '\0';
2142 }
2143
2144 log_verbose("ui menu file is \"%s\".", filename);
2145 return filename;
2146}
2147
2148/************************************************************************/
2151 GtkWidget *setup_menus(GtkWidget *window)
2152{
2153 GtkWidget *menubar = NULL;
2154 GError *error = NULL;
2155
2156 ui_builder = gtk_builder_new();
2157 if (!gtk_builder_add_from_file(ui_builder, get_ui_filename(), &error)) {
2158 log_error("Gtk menus: %s", error->message);
2159 g_error_free(error);
2160 } else {
2161 GSList *entries;
2162 GSList *next;
2163
2164 entries = gtk_builder_get_objects(ui_builder);
2165 next = entries;
2166
2167 while (next != NULL) {
2168 GObject *obj = next->data;
2169
2170 if (GTK_IS_MENU_ITEM(obj)) {
2171 if (!GTK_IS_SEPARATOR_MENU_ITEM(obj)) {
2172 menu_entry_init(GTK_BUILDABLE(obj));
2173 }
2174 } else if (GTK_IS_MENU(obj)) {
2175 const char *key = gtk_buildable_get_name(GTK_BUILDABLE(obj));
2176
2177 if (key[0] == '<') {
2178 GtkAccelGroup *ac_group = gtk_menu_get_accel_group(GTK_MENU(obj));
2179
2180 if (ac_group == NULL) {
2181 ac_group = gtk_accel_group_new();
2182 gtk_menu_set_accel_group(GTK_MENU(obj), ac_group);
2183 }
2184
2185 gtk_window_add_accel_group(GTK_WINDOW(window), ac_group);
2186
2187 gtk_menu_set_accel_path(GTK_MENU(obj), key);
2188 }
2189 }
2190
2191 next = next->next;
2192 }
2193
2194 g_slist_free(entries);
2195
2196 menubar = GTK_WIDGET(gtk_builder_get_object(ui_builder, "MENU"));
2197 gtk_widget_set_visible(menubar, TRUE);
2198 gtk_widget_show_all(menubar);
2199 }
2200
2201#ifndef FREECIV_DEBUG
2202 menu_entry_set_visible("RELOAD_TILESET", FALSE, FALSE);
2203#endif /* FREECIV_DEBUG */
2204
2205 return menubar;
2206}
2207
2208/************************************************************************/
2211 static struct menu_entry_info *menu_entry_info_find(const char *key)
2212{
2213 int i;
2214
2215 for (i = 0; menu_entries[i].key != NULL; i++) {
2216 if (!strcmp(key, menu_entries[i].key)) {
2217 return &(menu_entries[i]);
2218 }
2219 }
2220
2221 return NULL;
2222}
2223
2224/************************************************************************/
2227 static void menu_entry_set_active(const char *key,
2228 gboolean is_active)
2229{
2230 GtkCheckMenuItem *item = GTK_CHECK_MENU_ITEM(gtk_builder_get_object(ui_builder, key));
2231
2232 if (item != NULL) {
2233 gtk_check_menu_item_set_active(item, is_active);
2234 }
2235}
2236
2237/************************************************************************/
2240 static void menu_entry_set_sensitive(const char *key,
2241 gboolean is_sensitive)
2242{
2243 GtkWidget *item = GTK_WIDGET(gtk_builder_get_object(ui_builder, key));
2244
2245 if (item != NULL) {
2246 gtk_widget_set_sensitive(item, is_sensitive);
2247 }
2248}
2249
2250/************************************************************************/
2253 static void menu_entry_group_set_sensitive(enum menu_entry_grouping group,
2254 gboolean is_sensitive)
2255{
2256 int i;
2257
2258 for (i = 0; menu_entries[i].key != NULL; i++) {
2259 if (menu_entries[i].grouping == group || group == MGROUP_ALL) {
2260 menu_entry_set_sensitive(menu_entries[i].key, is_sensitive);
2261 }
2262 }
2263}
2264
2265/************************************************************************/
2268#ifndef FREECIV_DEBUG
2269 static void menu_entry_set_visible(const char *key,
2270 gboolean is_visible,
2271 gboolean is_sensitive)
2272{
2273 GtkWidget *item = GTK_WIDGET(gtk_builder_get_object(ui_builder, key));
2274
2275 if (item != NULL) {
2276 gtk_widget_set_visible(item, is_visible);
2277 gtk_widget_set_sensitive(item, is_sensitive);
2278 }
2279}
2280#endif /* FREECIV_DEBUG */
2281
2282/************************************************************************/
2285 static void menus_rename(const char *key,
2286 const gchar *new_label)
2287{
2288 GtkWidget *item = GTK_WIDGET(gtk_builder_get_object(ui_builder, key));
2289
2290 if (item != NULL) {
2291 gtk_menu_item_set_label(GTK_MENU_ITEM(item), new_label);
2292 }
2293}
2294
2295/************************************************************************/
2298 static GtkMenu *find_menu(const char *key)
2299{
2300 return GTK_MENU(gtk_builder_get_object(ui_builder, key));
2301}
2302
2303/************************************************************************/
2306 static void view_menu_update_sensitivity(void)
2307{
2308 /* The "full" city bar (i.e. the new way of drawing the
2309 * city name), can draw the city growth even without drawing
2310 * the city name. But the old method cannot. */
2311 if (gui_options.draw_full_citybar) {
2312 menu_entry_set_sensitive("SHOW_CITY_GROWTH", TRUE);
2313 menu_entry_set_sensitive("SHOW_CITY_TRADE_ROUTES", TRUE);
2314 } else {
2315 menu_entry_set_sensitive("SHOW_CITY_GROWTH", gui_options.draw_city_names);
2316 menu_entry_set_sensitive("SHOW_CITY_TRADE_ROUTES",
2317 gui_options.draw_city_names);
2318 }
2319
2320 menu_entry_set_sensitive("SHOW_CITY_BUY_COST",
2321 gui_options.draw_city_productions);
2322 menu_entry_set_sensitive("SHOW_COASTLINE", !gui_options.draw_terrain);
2323 menu_entry_set_sensitive("SHOW_UNIT_SOLID_BG",
2324 gui_options.draw_units || gui_options.draw_focus_unit);
2325 menu_entry_set_sensitive("SHOW_UNIT_SHIELDS",
2326 gui_options.draw_units || gui_options.draw_focus_unit);
2327 menu_entry_set_sensitive("SHOW_STACK_SIZE",
2328 gui_options.draw_units || gui_options.draw_focus_unit);
2329 menu_entry_set_sensitive("SHOW_FOCUS_UNIT", !gui_options.draw_units);
2330}
2331
2332/************************************************************************/
2338 static const char *get_tile_change_menu_text(struct tile *ptile,
2339 enum unit_activity activity)
2340{
2341 struct tile *newtile = tile_virtual_new(ptile);
2342 const char *text;
2343
2344 tile_apply_activity(newtile, activity, NULL);
2345 text = tile_get_info_text(newtile, FALSE, 0);
2346 tile_virtual_destroy(newtile);
2347 return text;
2348}
2349
2350/************************************************************************/
2353 void real_menus_update(void)
2354{
2355 struct unit_list *punits = NULL;
2356 bool units_all_same_tile = TRUE, units_all_same_type = TRUE;
2357 GtkMenu *menu;
2358 char acttext[128], irrtext[128], mintext[128], transtext[128];
2359 char cultext[128], plantext[128];
2360 struct terrain *pterrain;
2361 bool conn_possible;
2362 struct road_type *proad;
2363 struct extra_type_list *extras;
2364
2365 if (ui_builder == NULL || !can_client_change_view()) {
2366 return;
2367 }
2368
2369 if (get_num_units_in_focus() > 0) {
2370 const struct tile *ptile = NULL;
2371 const struct unit_type *ptype = NULL;
2372
2373 punits = get_units_in_focus();
2374 unit_list_iterate(punits, punit) {
2375 fc_assert((ptile == NULL) == (ptype == NULL));
2376
2377 if (ptile || ptype) {
2378 if (unit_tile(punit) != ptile) {
2379 units_all_same_tile = FALSE;
2380 }
2381 if (unit_type_get(punit) != ptype) {
2382 units_all_same_type = FALSE;
2383 }
2384 } else {
2385 ptile = unit_tile(punit);
2386 ptype = unit_type_get(punit);
2387 }
2388 } unit_list_iterate_end;
2389 }
2390
2391 menu_entry_group_set_sensitive(MGROUP_EDIT, editor_is_active());
2392 menu_entry_group_set_sensitive(MGROUP_PLAYING, can_client_issue_orders()
2393 && !editor_is_active());
2394 menu_entry_group_set_sensitive(MGROUP_UNIT, can_client_issue_orders()
2395 && !editor_is_active() && punits != NULL);
2396
2397 menu_entry_set_active("EDIT_MODE", game.info.is_edit_mode);
2398 menu_entry_set_sensitive("EDIT_MODE",
2399 can_conn_enable_editing(&client.conn));
2400 editgui_refresh();
2401 menu_entry_set_sensitive("RALLY_DLG", can_client_issue_orders());
2402 menu_entry_set_sensitive("INFRA_DLG", terrain_control.infrapoints);
2403
2404 {
2405 char road_buf[500];
2406
2407 proad = road_by_gui_type(ROAD_GUI_ROAD);
2408 if (proad != NULL) {
2409 /* TRANS: Connect with some road type (Road/Railroad) */
2410 snprintf(road_buf, sizeof(road_buf), _("Connect With %s"),
2411 extra_name_translation(road_extra_get(proad)));
2412 menus_rename("CONNECT_ROAD", road_buf);
2413 }
2414
2415 proad = road_by_gui_type(ROAD_GUI_RAILROAD);
2416 if (proad != NULL) {
2417 snprintf(road_buf, sizeof(road_buf), _("Connect With %s"),
2418 extra_name_translation(road_extra_get(proad)));
2419 menus_rename("CONNECT_RAIL", road_buf);
2420 }
2421
2422 proad = road_by_gui_type(ROAD_GUI_MAGLEV);
2423 if (proad != NULL) {
2424 snprintf(road_buf, sizeof(road_buf), _("Connect With %s"),
2425 extra_name_translation(road_extra_get(proad)));
2426 menus_rename("CONNECT_MAGLEV", road_buf);
2427 }
2428 }
2429
2430 {
2431 char top_cities_buf[128];
2432
2433 if (game.info.top_cities_count > 0) {
2434 fc_snprintf(top_cities_buf, sizeof(top_cities_buf),
2435 PL_("Top %d City", "Top %d Cities",
2436 game.info.top_cities_count),
2437 game.info.top_cities_count);
2438 menus_rename("REPORT_TOP_CITIES", top_cities_buf);
2439 } else {
2440 menus_rename("REPORT_TOP_CITIES", _("Top Cities"));
2441 }
2442
2443 menu_entry_set_sensitive("REPORT_TOP_CITIES", game.info.top_cities_count > 0);
2444 }
2445
2446 if (!can_client_issue_orders()) {
2447 return;
2448 }
2449
2450 /* Set government sensitivity. */
2451 if ((menu = find_menu("<MENU>/GOVERNMENT"))) {
2452 GList *list, *iter;
2453 struct government *pgov;
2454
2455 list = gtk_container_get_children(GTK_CONTAINER(menu));
2456 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2457 pgov = g_object_get_data(G_OBJECT(iter->data), "government");
2458 if (NULL != pgov) {
2459 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
2460 can_change_to_government(client_player(),
2461 pgov));
2462 } else {
2463 /* Revolution without target government */
2464 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
2465 untargeted_revolution_allowed());
2466 }
2467 }
2468 g_list_free(list);
2469 }
2470
2471 if (!punits) {
2472 return;
2473 }
2474
2475 /* Remaining part of this function: Update Unit, Work, and Combat menus */
2476
2477 /* Set base sensitivity. */
2478 if ((menu = find_menu("<MENU>/BUILD_BASE"))) {
2479 GList *list, *iter;
2480 struct extra_type *pextra;
2481
2482 list = gtk_container_get_children(GTK_CONTAINER(menu));
2483 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2484 pextra = g_object_get_data(G_OBJECT(iter->data), "base");
2485 if (NULL != pextra) {
2486 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
2487 can_units_do_activity_targeted_client(punits,
2488 ACTIVITY_BASE,
2489 pextra));
2490 }
2491 }
2492 g_list_free(list);
2493 }
2494
2495 /* Set road sensitivity. */
2496 if ((menu = find_menu("<MENU>/BUILD_PATH"))) {
2497 GList *list, *iter;
2498 struct extra_type *pextra;
2499
2500 list = gtk_container_get_children(GTK_CONTAINER(menu));
2501 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2502 pextra = g_object_get_data(G_OBJECT(iter->data), "road");
2503 if (NULL != pextra) {
2504 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
2505 can_units_do_activity_targeted_client(punits,
2506 ACTIVITY_GEN_ROAD,
2507 pextra));
2508 }
2509 }
2510 g_list_free(list);
2511 }
2512
2513 /* Set cleaning menu sensitivity. */
2514 if ((menu = find_menu("<MENU>/CLEAN"))) {
2515 GList *list, *iter;
2516 struct extra_type *pextra;
2517
2518 list = gtk_container_get_children(GTK_CONTAINER(menu));
2519 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2520 pextra = g_object_get_data(G_OBJECT(iter->data), "nuisance");
2521 if (NULL != pextra) {
2522 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
2523 can_units_do_activity_targeted_client(punits,
2524 ACTIVITY_CLEAN,
2525 pextra));
2526 }
2527 }
2528 g_list_free(list);
2529 }
2530
2531 /* Set Go to and... action visibility. */
2532 if ((menu = find_menu("<MENU>/GOTO_AND"))) {
2533 GList *list, *iter;
2534 struct action *paction;
2535
2536 bool can_do_something = FALSE;
2537
2538 /* Enable a menu item if it is theoretically possible that one of the
2539 * selected units can perform it. Checking if the action can be performed
2540 * at the current tile is pointless since it should be performed at the
2541 * target tile. */
2542 list = gtk_container_get_children(GTK_CONTAINER(menu));
2543 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2544 paction = g_object_get_data(G_OBJECT(iter->data), "end_action");
2545 if (NULL != paction) {
2546 if (units_can_do_action(get_units_in_focus(),
2547 paction->id, TRUE)) {
2548 gtk_widget_set_visible(GTK_WIDGET(iter->data), TRUE);
2549 gtk_widget_set_sensitive(GTK_WIDGET(iter->data), TRUE);
2550 can_do_something = TRUE;
2551 } else {
2552 gtk_widget_set_visible(GTK_WIDGET(iter->data), FALSE);
2553 gtk_widget_set_sensitive(GTK_WIDGET(iter->data), FALSE);
2554 }
2555 }
2556 }
2557 g_list_free(list);
2558
2559 /* Only sensitive if an action may be possible. */
2560 menu_entry_set_sensitive("MENU_GOTO_AND", can_do_something);
2561 }
2562
2563 /* Enable the button for adding to a city in all cases, so we
2564 * get an eventual error message from the server if we try. */
2565 menu_entry_set_sensitive("BUILD_CITY",
2566 (can_units_do(punits, unit_can_add_or_build_city)
2567 || can_units_do(punits, unit_can_help_build_wonder_here)));
2568 menu_entry_set_sensitive("BUILD_ROAD",
2569 (can_units_do_any_road(&(wld.map), punits)
2570 || can_units_do(punits,
2571 unit_can_est_trade_route_here)));
2572 menu_entry_set_sensitive("BUILD_IRRIGATION",
2573 can_units_do_activity_client(punits, ACTIVITY_IRRIGATE));
2574 menu_entry_set_sensitive("CULTIVATE",
2575 can_units_do_activity_client(punits, ACTIVITY_CULTIVATE));
2576 menu_entry_set_sensitive("BUILD_MINE",
2577 can_units_do_activity_client(punits, ACTIVITY_MINE));
2578 menu_entry_set_sensitive("PLANT",
2579 can_units_do_activity_client(punits, ACTIVITY_PLANT));
2580 menu_entry_set_sensitive("TRANSFORM_TERRAIN",
2581 can_units_do_activity_client(punits, ACTIVITY_TRANSFORM));
2582 menu_entry_set_sensitive("FORTIFY",
2583 can_units_do_activity_client(punits,
2584 ACTIVITY_FORTIFYING));
2585 menu_entry_set_sensitive("BUILD_FORTRESS",
2586 can_units_do_base_gui(punits, BASE_GUI_FORTRESS));
2587 menu_entry_set_sensitive("BUILD_AIRBASE",
2588 can_units_do_base_gui(punits, BASE_GUI_AIRBASE));
2589 menu_entry_set_sensitive("CLEAN",
2590 can_units_do_activity_client(punits, ACTIVITY_CLEAN));
2591 menu_entry_set_sensitive("UNIT_SENTRY",
2592 can_units_do_activity_client(punits, ACTIVITY_SENTRY));
2593 menu_entry_set_sensitive("DO_PARADROP",
2594 can_units_do_on_map(&(wld.map), punits, can_unit_paradrop));
2595 /* FIXME: should conditionally rename "Pillage" to "Pillage..." in cases
2596 * where selecting the command results in a dialog box listing options of
2597 * what to pillage */
2598 menu_entry_set_sensitive("DO_PILLAGE",
2599 can_units_do_activity_client(punits, ACTIVITY_PILLAGE));
2600 menu_entry_set_sensitive("UNIT_DISBAND",
2601 units_can_do_action(punits, ACTION_DISBAND_UNIT,
2602 TRUE));
2603 menu_entry_set_sensitive("UNIT_UPGRADE",
2604 units_can_upgrade(&(wld.map), punits));
2605 /* "UNIT_CONVERT" dealt with below */
2606 menu_entry_set_sensitive("UNIT_HOMECITY",
2607 can_units_do(punits, can_unit_change_homecity));
2608 menu_entry_set_sensitive("UNIT_UNLOAD_TRANSPORTER",
2609 units_are_occupied(punits));
2610 menu_entry_set_sensitive("UNIT_BOARD",
2611 units_can_load(punits));
2612 menu_entry_set_sensitive("UNIT_DEBOARD",
2613 units_can_unload(&(wld.map), punits));
2614 menu_entry_set_sensitive("UNIT_UNSENTRY",
2615 units_have_activity_on_tile(punits,
2616 ACTIVITY_SENTRY));
2617 menu_entry_set_sensitive("AUTO_WORKER",
2618 can_units_do(punits, can_unit_do_autoworker));
2619 menu_entry_set_sensitive("UNIT_EXPLORE",
2620 can_units_do_activity_client(punits, ACTIVITY_EXPLORE));
2621
2622 proad = road_by_gui_type(ROAD_GUI_ROAD);
2623 if (proad != NULL) {
2624 struct extra_type *tgt;
2625
2626 tgt = road_extra_get(proad);
2627
2628 conn_possible = can_units_do_connect(punits, ACTIVITY_GEN_ROAD, tgt);
2629 } else {
2630 conn_possible = FALSE;
2631 }
2632 menu_entry_set_sensitive("CONNECT_ROAD", conn_possible);
2633
2634 proad = road_by_gui_type(ROAD_GUI_RAILROAD);
2635 if (proad != NULL) {
2636 struct extra_type *tgt;
2637
2638 tgt = road_extra_get(proad);
2639
2640 conn_possible = can_units_do_connect(punits, ACTIVITY_GEN_ROAD, tgt);
2641 } else {
2642 conn_possible = FALSE;
2643 }
2644 menu_entry_set_sensitive("CONNECT_RAIL", conn_possible);
2645
2646 proad = road_by_gui_type(ROAD_GUI_MAGLEV);
2647 if (proad != NULL) {
2648 struct extra_type *tgt;
2649
2650 tgt = road_extra_get(proad);
2651
2652 conn_possible = can_units_do_connect(punits, ACTIVITY_GEN_ROAD, tgt);
2653 } else {
2654 conn_possible = FALSE;
2655 }
2656 menu_entry_set_sensitive("CONNECT_MAGLEV", conn_possible);
2657
2658 extras = extra_type_list_by_cause(EC_IRRIGATION);
2659
2660 if (extra_type_list_size(extras) > 0) {
2661 struct extra_type *tgt;
2662
2663 tgt = extra_type_list_get(extras, 0);
2664 conn_possible = can_units_do_connect(punits, ACTIVITY_IRRIGATE, tgt);
2665 } else {
2666 conn_possible = FALSE;
2667 }
2668 menu_entry_set_sensitive("CONNECT_IRRIGATION", conn_possible);
2669
2670 menu_entry_set_sensitive("DIPLOMAT_ACTION",
2671 units_can_do_action(punits, ACTION_ANY, TRUE));
2672
2673 if (units_can_do_action(punits, ACTION_HELP_WONDER, TRUE)) {
2674 menus_rename("BUILD_CITY",
2675 action_get_ui_name_mnemonic(ACTION_HELP_WONDER, "_"));
2676 } else {
2677 bool city_on_tile = FALSE;
2678
2679 /* FIXME: this overloading doesn't work well with multiple focus
2680 * units. */
2681 unit_list_iterate(punits, punit) {
2682 if (tile_city(unit_tile(punit))) {
2683 city_on_tile = TRUE;
2684 break;
2685 }
2686 } unit_list_iterate_end;
2687
2688 if (city_on_tile && units_can_do_action(punits, ACTION_JOIN_CITY,
2689 TRUE)) {
2690 menus_rename("BUILD_CITY",
2691 action_get_ui_name_mnemonic(ACTION_JOIN_CITY, "_"));
2692 } else {
2693 /* refresh default order */
2694 menus_rename("BUILD_CITY",
2695 action_get_ui_name_mnemonic(ACTION_FOUND_CITY, "_"));
2696 }
2697 }
2698
2699 if (units_can_do_action(punits, ACTION_TRADE_ROUTE, TRUE)) {
2700 menus_rename("BUILD_ROAD",
2701 action_get_ui_name_mnemonic(ACTION_TRADE_ROUTE, "_"));
2702 } else if (units_have_type_flag(punits, UTYF_WORKERS, TRUE)) {
2703 char road_item[500];
2704 struct extra_type *pextra = NULL;
2705
2706 /* FIXME: this overloading doesn't work well with multiple focus
2707 * units. */
2708 unit_list_iterate(punits, punit) {
2709 pextra = next_extra_for_tile(unit_tile(punit), EC_ROAD,
2710 unit_owner(punit), punit);
2711 if (pextra != NULL) {
2712 break;
2713 }
2714 } unit_list_iterate_end;
2715
2716 if (pextra != NULL) {
2717 /* TRANS: Build road of specific type (Road/Railroad/Maglev) */
2718 snprintf(road_item, sizeof(road_item), _("Build %s"),
2719 extra_name_translation(pextra));
2720 menus_rename("BUILD_ROAD", road_item);
2721 }
2722 } else {
2723 menus_rename("BUILD_ROAD", _("Build _Road"));
2724 }
2725
2726 if (units_all_same_type) {
2727 struct unit *punit = unit_list_get(punits, 0);
2728 const struct unit_type *to_unittype =
2729 can_upgrade_unittype(client_player(), unit_type_get(punit));
2730 if (to_unittype) {
2731 /* TRANS: %s is a unit type. */
2732 fc_snprintf(acttext, sizeof(acttext), _("Upgr_ade to %s"),
2733 utype_name_translation(
2734 can_upgrade_unittype(client_player(),
2735 unit_type_get(punit))));
2736 } else {
2737 acttext[0] = '\0';
2738 }
2739 } else {
2740 acttext[0] = '\0';
2741 }
2742 if ('\0' != acttext[0]) {
2743 menus_rename("UNIT_UPGRADE", acttext);
2744 } else {
2745 menus_rename("UNIT_UPGRADE", _("Upgr_ade"));
2746 }
2747
2748 if (units_can_convert(&(wld.map), punits)) {
2749 menu_entry_set_sensitive("UNIT_CONVERT", TRUE);
2750 if (units_all_same_type) {
2751 struct unit *punit = unit_list_get(punits, 0);
2752
2753 /* TRANS: %s is a unit type. */
2754 fc_snprintf(acttext, sizeof(acttext), _("C_onvert to %s"),
2755 utype_name_translation(unit_type_get(punit)->converted_to));
2756 } else {
2757 acttext[0] = '\0';
2758 }
2759 } else {
2760 menu_entry_set_sensitive("UNIT_CONVERT", FALSE);
2761 acttext[0] = '\0';
2762 }
2763 if ('\0' != acttext[0]) {
2764 menus_rename("UNIT_CONVERT", acttext);
2765 } else {
2766 menus_rename("UNIT_CONVERT", _("C_onvert"));
2767 }
2768
2769 if (units_all_same_tile) {
2770 struct unit *first = unit_list_get(punits, 0);
2771
2772 pterrain = tile_terrain(unit_tile(first));
2773
2774 if (units_have_type_flag(punits, UTYF_WORKERS, TRUE)) {
2775 struct extra_type *pextra = NULL;
2776
2777 /* FIXME: this overloading doesn't work well with multiple focus
2778 * units. */
2779 unit_list_iterate(punits, punit) {
2780 pextra = next_extra_for_tile(unit_tile(punit), EC_IRRIGATION,
2781 unit_owner(punit), punit);
2782 if (pextra != NULL) {
2783 break;
2784 }
2785 } unit_list_iterate_end;
2786
2787 if (pextra != NULL) {
2788 /* TRANS: Build irrigation of specific type */
2789 snprintf(irrtext, sizeof(irrtext), _("Build %s"),
2790 extra_name_translation(pextra));
2791 } else {
2792 sz_strlcpy(irrtext, _("Build _Irrigation"));
2793 }
2794 } else {
2795 sz_strlcpy(irrtext, _("Build _Irrigation"));
2796 }
2797
2798 if (pterrain->cultivate_result != T_NONE) {
2799 fc_snprintf(cultext, sizeof(cultext), _("Change to %s"),
2800 get_tile_change_menu_text(unit_tile(first),
2801 ACTIVITY_CULTIVATE));
2802 } else {
2803 sz_strlcpy(cultext, _("_Cultivate"));
2804 }
2805
2806 if (units_have_type_flag(punits, UTYF_WORKERS, TRUE)) {
2807 struct extra_type *pextra = NULL;
2808
2809 /* FIXME: this overloading doesn't work well with multiple focus
2810 * units. */
2811 unit_list_iterate(punits, punit) {
2812 pextra = next_extra_for_tile(unit_tile(punit), EC_MINE,
2813 unit_owner(punit), punit);
2814 if (pextra != NULL) {
2815 break;
2816 }
2817 } unit_list_iterate_end;
2818
2819 if (pextra != NULL) {
2820 /* TRANS: Build mine of specific type */
2821 snprintf(mintext, sizeof(mintext), _("Build %s"),
2822 extra_name_translation(pextra));
2823 } else {
2824 sz_strlcpy(mintext, _("Build _Mine"));
2825 }
2826 } else {
2827 sz_strlcpy(mintext, _("Build _Mine"));
2828 }
2829
2830 if (pterrain->plant_result != T_NONE) {
2831 fc_snprintf(plantext, sizeof(plantext), _("Change to %s"),
2832 get_tile_change_menu_text(unit_tile(first), ACTIVITY_PLANT));
2833 } else {
2834 sz_strlcpy(plantext, _("_Plant"));
2835 }
2836
2837 if (pterrain->transform_result != T_NONE
2838 && pterrain->transform_result != pterrain) {
2839 fc_snprintf(transtext, sizeof(transtext), _("Transf_orm to %s"),
2840 get_tile_change_menu_text(unit_tile(first),
2841 ACTIVITY_TRANSFORM));
2842 } else {
2843 sz_strlcpy(transtext, _("Transf_orm Terrain"));
2844 }
2845 } else {
2846 sz_strlcpy(irrtext, _("Build _Irrigation"));
2847 sz_strlcpy(cultext, _("_Cultivate"));
2848 sz_strlcpy(mintext, _("Build _Mine"));
2849 sz_strlcpy(plantext, _("_Plant"));
2850 sz_strlcpy(transtext, _("Transf_orm Terrain"));
2851 }
2852
2853 menus_rename("BUILD_IRRIGATION", irrtext);
2854 menus_rename("CULTIVATE", cultext);
2855 menus_rename("BUILD_MINE", mintext);
2856 menus_rename("PLANT", plantext);
2857 menus_rename("TRANSFORM_TERRAIN", transtext);
2858
2859 menus_rename("UNIT_HOMECITY",
2860 action_get_ui_name_mnemonic(ACTION_HOME_CITY, "_"));
2861}
2862
2863/************************************************************************/
2866 static void menu_unit_goto_and_add_accel(GtkWidget *item, action_id act_id,
2867 const guint accel_key,
2868 const GdkModifierType accel_mods)
2869{
2870 const char *path = gtk_menu_item_get_accel_path(GTK_MENU_ITEM(item));
2871
2872 if (path == NULL) {
2873 char buf[MAX_LEN_NAME + strlen("<MENU>/GOTO_AND/")];
2874
2875 fc_snprintf(buf, sizeof(buf), "<MENU>/GOTO_AND/%s",
2876 action_id_rule_name(act_id));
2877 gtk_menu_item_set_accel_path(GTK_MENU_ITEM(item), buf);
2878 path = buf; /* Not NULL, but not usable either outside this block */
2879 }
2880
2881 if (path != NULL) {
2882 gtk_accel_map_add_entry(gtk_menu_item_get_accel_path(GTK_MENU_ITEM(item)),
2883 accel_key, accel_mods);
2884 }
2885}
2886
2887/************************************************************************/
2890 static void menu_remove_previous_entries(GtkMenu *menu)
2891{
2892 GList *list, *iter;
2893 GtkWidget *sub_menu;
2894
2895 list = gtk_container_get_children(GTK_CONTAINER(menu));
2896 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2897 if ((sub_menu = gtk_menu_item_get_submenu(iter->data)) != NULL) {
2898 menu_remove_previous_entries(GTK_MENU(sub_menu));
2899 gtk_widget_destroy(sub_menu);
2900 }
2901 gtk_widget_destroy(GTK_WIDGET(iter->data));
2902 }
2903 g_list_free(list);
2904}
2905
2906/************************************************************************/
2910 void real_menus_init(void)
2911{
2912 GtkMenu *menu;
2913
2914 if (ui_builder == NULL) {
2915 return;
2916 }
2917
2918 menu_entry_set_sensitive("GAME_SAVE_AS",
2919 can_client_access_hack()
2920 && C_S_RUNNING <= client_state());
2921 menu_entry_set_sensitive("GAME_SAVE",
2922 can_client_access_hack()
2923 && C_S_RUNNING <= client_state());
2924
2925 menu_entry_set_active("SAVE_OPTIONS_ON_EXIT",
2926 gui_options.save_options_on_exit);
2927 menu_entry_set_sensitive("SERVER_OPTIONS", client.conn.established);
2928
2929 menu_entry_set_sensitive("LEAVE",
2930 client.conn.established);
2931
2932 if (!can_client_change_view()) {
2933 menu_entry_group_set_sensitive(MGROUP_ALL, FALSE);
2934
2935 return;
2936 }
2937
2938 menus_rename("BUILD_FORTRESS", Q_(terrain_control.gui_type_base0));
2939 menus_rename("BUILD_AIRBASE", Q_(terrain_control.gui_type_base1));
2940
2941 if ((menu = find_menu("<MENU>/GOVERNMENT"))) {
2942 GList *list, *iter;
2943 GtkWidget *item;
2944 char buf[256];
2945
2946 /* Remove previous government entries. */
2947 list = gtk_container_get_children(GTK_CONTAINER(menu));
2948 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2949 if (g_object_get_data(G_OBJECT(iter->data), "government") != NULL
2950 || GTK_IS_SEPARATOR_MENU_ITEM(iter->data)) {
2951 gtk_widget_destroy(GTK_WIDGET(iter->data));
2952 }
2953 }
2954 g_list_free(list);
2955
2956 /* Add new government entries. */
2957 item = gtk_separator_menu_item_new();
2958 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
2959 gtk_widget_show(item);
2960
2961 governments_iterate(g) {
2962 if (g != game.government_during_revolution) {
2963 /* TRANS: %s is a government name */
2964 fc_snprintf(buf, sizeof(buf), _("%s..."),
2965 government_name_translation(g));
2966 item = gtk_menu_item_new_with_label(buf);
2967 g_object_set_data(G_OBJECT(item), "government", g);
2968 g_signal_connect(item, "activate",
2969 G_CALLBACK(government_callback), g);
2970 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
2971 gtk_widget_show(item);
2972 }
2973 } governments_iterate_end;
2974 }
2975
2976 if ((menu = find_menu("<MENU>/BUILD_BASE"))) {
2977 GList *list, *iter;
2978 GtkWidget *item;
2979
2980 /* Remove previous base entries. */
2981 list = gtk_container_get_children(GTK_CONTAINER(menu));
2982 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2983 gtk_widget_destroy(GTK_WIDGET(iter->data));
2984 }
2985 g_list_free(list);
2986
2987 /* Add new base entries. */
2988 extra_type_by_cause_iterate(EC_BASE, pextra) {
2989 if (pextra->buildable) {
2990 item = gtk_menu_item_new_with_label(extra_name_translation(pextra));
2991 g_object_set_data(G_OBJECT(item), "base", pextra);
2992 g_signal_connect(item, "activate", G_CALLBACK(base_callback), pextra);
2993 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
2994 gtk_widget_show(item);
2995 }
2996 } extra_type_by_cause_iterate_end;
2997 }
2998
2999 if ((menu = find_menu("<MENU>/BUILD_PATH"))) {
3000 GList *list, *iter;
3001 GtkWidget *item;
3002
3003 /* Remove previous road entries. */
3004 list = gtk_container_get_children(GTK_CONTAINER(menu));
3005 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
3006 gtk_widget_destroy(GTK_WIDGET(iter->data));
3007 }
3008 g_list_free(list);
3009
3010 /* Add new road entries. */
3011 extra_type_by_cause_iterate(EC_ROAD, pextra) {
3012 if (pextra->buildable) {
3013 item = gtk_menu_item_new_with_label(extra_name_translation(pextra));
3014 g_object_set_data(G_OBJECT(item), "road", pextra);
3015 g_signal_connect(item, "activate", G_CALLBACK(road_callback), pextra);
3016 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
3017 gtk_widget_show(item);
3018 }
3019 } extra_type_by_cause_iterate_end;
3020 }
3021
3022 if ((menu = find_menu("<MENU>/CLEAN"))) {
3023 GList *list, *iter;
3024 GtkWidget *item;
3025
3026 /* Remove previous cleaning entries. */
3027 list = gtk_container_get_children(GTK_CONTAINER(menu));
3028 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
3029 gtk_widget_destroy(GTK_WIDGET(iter->data));
3030 }
3031 g_list_free(list);
3032
3033 /* Add new cleaning entries. */
3034 extra_type_by_rmcause_iterate(ERM_CLEAN, pextra) {
3035 item = gtk_menu_item_new_with_label(extra_name_translation(pextra));
3036 g_object_set_data(G_OBJECT(item), "nuisance", pextra);
3037 g_signal_connect(item, "activate", G_CALLBACK(clean_callback), pextra);
3038 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
3039 gtk_widget_show(item);
3040 } extra_type_by_rmcause_iterate_end;
3041 }
3042
3043 /* Initialize the Go to and... actions. */
3044 if ((menu = find_menu("<MENU>/GOTO_AND"))) {
3045 GtkWidget *item;
3046 int tgt_kind_group;
3047
3048 /* Remove previous action entries. */
3049 menu_remove_previous_entries(menu);
3050
3051 /* Add the new action entries grouped by target kind. */
3052 for (tgt_kind_group = 0; tgt_kind_group < ATK_COUNT; tgt_kind_group++) {
3053 action_noninternal_iterate(act_id) {
3054 struct action *paction = action_by_number(act_id);
3055
3056 if (action_id_get_actor_kind(act_id) != AAK_UNIT) {
3057 /* This action isn't performed by a unit. */
3058 continue;
3059 }
3060
3061 if (action_id_get_target_kind(act_id) != tgt_kind_group) {
3062 /* Wrong group. */
3063 continue;
3064 }
3065
3066 /* Create and add the menu item. It will be hidden or shown based on
3067 * unit type. */
3068 item = gtk_menu_item_new_with_mnemonic(
3069 action_get_ui_name_mnemonic(act_id, "_"));
3070 g_object_set_data(G_OBJECT(item), "end_action", paction);
3071
3072 if (action_id_has_complex_target(act_id)) {
3073 GtkWidget *sub_target_menu = gtk_menu_new();
3074
3075#define CREATE_SUB_ITEM(_sub_target_, _sub_target_key_, _sub_target_name_) \
3076 GtkWidget *sub_item = gtk_menu_item_new_with_label(_sub_target_name_); \
3077 g_object_set_data(G_OBJECT(sub_item), "end_action", paction); \
3078 g_object_set_data(G_OBJECT(sub_item), _sub_target_key_, _sub_target_); \
3079 g_signal_connect(sub_item, "activate", \
3080 G_CALLBACK(unit_goto_and_callback), paction); \
3081 gtk_menu_shell_append(GTK_MENU_SHELL(sub_target_menu), sub_item); \
3082 gtk_widget_show(sub_item);
3083
3084 switch (action_get_sub_target_kind(paction)) {
3085 case ASTK_BUILDING:
3086 improvement_iterate(pimpr) {
3087 CREATE_SUB_ITEM(pimpr, "end_building",
3088 improvement_name_translation(pimpr));
3089 } improvement_iterate_end;
3090 break;
3091 case ASTK_TECH:
3092 advance_iterate(ptech) {
3093 CREATE_SUB_ITEM(ptech, "end_tech",
3094 advance_name_translation(ptech));
3095 } advance_iterate_end;
3096 break;
3097 case ASTK_EXTRA:
3098 case ASTK_EXTRA_NOT_THERE:
3099 extra_type_iterate(pextra) {
3100 if (!actres_creates_extra(paction->result, pextra)
3101 && !actres_removes_extra(paction->result, pextra)) {
3102 /* Not relevant */
3103 continue;
3104 }
3105 CREATE_SUB_ITEM(pextra, "end_extra",
3106 extra_name_translation(pextra));
3107 } extra_type_iterate_end;
3108 break;
3109 case ASTK_NONE:
3110 /* Should not be here. */
3111 fc_assert(action_get_sub_target_kind(paction) != ASTK_NONE);
3112 break;
3113 case ASTK_COUNT:
3114 /* Should not exits */
3115 fc_assert(action_get_sub_target_kind(paction) != ASTK_COUNT);
3116 break;
3117 }
3118
3119#undef CREATE_SUB_ITEM
3120
3121 gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), sub_target_menu);
3122 } else {
3123 g_signal_connect(item, "activate",
3124 G_CALLBACK(unit_goto_and_callback), paction);
3125
3126#define ADD_OLD_ACCELERATOR(wanted_action_id, accel_key, accel_mods) \
3127 if (act_id == wanted_action_id) { \
3128 menu_unit_goto_and_add_accel(item, act_id, accel_key, accel_mods); \
3129 }
3130
3131 /* Add the keyboard shortcuts for "Go to and..." menu items that
3132 * existed independently before the "Go to and..." menu arrived.
3133 */
3134 ADD_OLD_ACCELERATOR(ACTION_FOUND_CITY, GDK_KEY_b, GDK_SHIFT_MASK);
3135 ADD_OLD_ACCELERATOR(ACTION_JOIN_CITY, GDK_KEY_j, GDK_SHIFT_MASK);
3136 ADD_OLD_ACCELERATOR(ACTION_NUKE, GDK_KEY_n, GDK_SHIFT_MASK);
3137 }
3138
3139 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
3140 gtk_widget_show(item);
3141 } action_noninternal_iterate_end;
3142 }
3143 }
3144
3145 menu_entry_group_set_sensitive(MGROUP_SAFE, TRUE);
3146 menu_entry_group_set_sensitive(MGROUP_PLAYER, client_has_player());
3147
3148 menu_entry_set_sensitive("TAX_RATE",
3149 game.info.changable_tax
3150 && can_client_issue_orders());
3151 menu_entry_set_sensitive("POLICIES",
3152 multiplier_count() > 0);
3153
3154 menu_entry_set_active("SHOW_CITY_OUTLINES",
3155 gui_options.draw_city_outlines);
3156 menu_entry_set_active("SHOW_CITY_OUTPUT",
3157 gui_options.draw_city_output);
3158 menu_entry_set_active("SHOW_MAP_GRID",
3159 gui_options.draw_map_grid);
3160 menu_entry_set_active("SHOW_NATIONAL_BORDERS",
3161 gui_options.draw_borders);
3162 menu_entry_set_sensitive("SHOW_NATIONAL_BORDERS",
3163 BORDERS_DISABLED != game.info.borders);
3164 menu_entry_set_active("SHOW_NATIVE_TILES",
3165 gui_options.draw_native);
3166 menu_entry_set_active("SHOW_CITY_FULL_BAR",
3167 gui_options.draw_full_citybar);
3168 menu_entry_set_active("SHOW_CITY_NAMES",
3169 gui_options.draw_city_names);
3170 menu_entry_set_active("SHOW_CITY_GROWTH",
3171 gui_options.draw_city_growth);
3172 menu_entry_set_active("SHOW_CITY_PRODUCTIONS",
3173 gui_options.draw_city_productions);
3174 menu_entry_set_active("SHOW_CITY_BUY_COST",
3175 gui_options.draw_city_buycost);
3176 menu_entry_set_active("SHOW_CITY_TRADE_ROUTES",
3177 gui_options.draw_city_trade_routes);
3178 menu_entry_set_active("SHOW_TERRAIN",
3179 gui_options.draw_terrain);
3180 menu_entry_set_active("SHOW_COASTLINE",
3181 gui_options.draw_coastline);
3182 menu_entry_set_active("SHOW_PATHS",
3183 gui_options.draw_paths);
3184 menu_entry_set_active("SHOW_IRRIGATION",
3185 gui_options.draw_irrigation);
3186 menu_entry_set_active("SHOW_MINES",
3187 gui_options.draw_mines);
3188 menu_entry_set_active("SHOW_BASES",
3189 gui_options.draw_fortress_airbase);
3190 menu_entry_set_active("SHOW_RESOURCES",
3191 gui_options.draw_specials);
3192 menu_entry_set_active("SHOW_HUTS",
3193 gui_options.draw_huts);
3194 menu_entry_set_active("SHOW_POLLUTION",
3195 gui_options.draw_pollution);
3196 menu_entry_set_active("SHOW_CITIES",
3197 gui_options.draw_cities);
3198 menu_entry_set_active("SHOW_UNITS",
3199 gui_options.draw_units);
3200 menu_entry_set_active("SHOW_UNIT_SOLID_BG",
3201 gui_options.solid_color_behind_units);
3202 menu_entry_set_active("SHOW_UNIT_SHIELDS",
3203 gui_options.draw_unit_shields);
3204 menu_entry_set_active("SHOW_STACK_SIZE",
3205 gui_options.draw_unit_stack_size);
3206 menu_entry_set_active("SHOW_FOCUS_UNIT",
3207 gui_options.draw_focus_unit);
3208 menu_entry_set_active("SHOW_FOG_OF_WAR",
3209 gui_options.draw_fog_of_war);
3210
3211 view_menu_update_sensitivity();
3212
3213 menu_entry_set_active("FULL_SCREEN", GUI_GTK_OPTION(fullscreen));
3214}
3215
3216/**************************************************************************
3217 Free resources allocated by the menu system.
3218**************************************************************************/
3219 void menus_free(void)
3220{
3221 if (ui_builder != NULL) {
3222 g_object_unref(ui_builder);
3223 ui_builder = NULL;
3224 }
3225}
action_id_rule_name
const char * action_id_rule_name(action_id act_id)
Definition actions.c:1204
action_get_sub_target_kind
enum action_sub_target_kind action_get_sub_target_kind(const struct action *paction)
Definition actions.c:1084
action_get_ui_name_mnemonic
const char * action_get_ui_name_mnemonic(action_id act_id, const char *mnemonic)
Definition actions.c:1223
action_noninternal_iterate_end
#define action_noninternal_iterate_end
Definition actions.h:231
action_by_number
static struct action * action_by_number(action_id act_id)
Definition actions.h:390
action_id_get_actor_kind
#define action_id_get_actor_kind(act_id)
Definition actions.h:403
ACTION_ANY
#define ACTION_ANY
Definition actions.h:52
action_noninternal_iterate
#define action_noninternal_iterate(_act_)
Definition actions.h:226
action_id_get_target_kind
#define action_id_get_target_kind(act_id)
Definition actions.h:407
action_id_has_complex_target
#define action_id_has_complex_target(act_id)
Definition actions.h:425
actres_removes_extra
bool actres_removes_extra(enum action_result result, const struct extra_type *pextra)
Definition actres.c:806
actres_creates_extra
bool actres_creates_extra(enum action_result result, const struct extra_type *pextra)
Definition actres.c:785
entries
struct @126::my_agent entries[MAX_AGENTS]
client
struct civclient client
Definition client_main.c:150
client_state
enum client_states client_state(void)
Definition client_main.c:1026
send_report_request
void send_report_request(enum report_type type)
Definition client_main.c:836
can_client_issue_orders
bool can_client_issue_orders(void)
Definition client_main.c:1264
client_has_player
bool client_has_player(void)
Definition client_main.c:1364
can_client_change_view
bool can_client_change_view(void)
Definition client_main.c:1312
client_main.h
client_player
#define client_player()
Definition client_main.h:106
C_S_RUNNING
@ C_S_RUNNING
Definition client_main.h:47
can_units_do_connect
bool can_units_do_connect(struct unit_list *punits, enum unit_activity activity, struct extra_type *tgt)
Definition climisc.c:1231
list
static struct fc_sockaddr_list * list
Definition clinet.c:102
disconnect_from_server
void disconnect_from_server(bool leaving_sound)
Definition clinet.c:306
clinet.h
incite_cost
char * incite_cost
Definition comments.c:74
REPORT_WONDERS_OF_THE_WORLD
@ REPORT_WONDERS_OF_THE_WORLD
Definition conn_types.h:50
REPORT_DEMOGRAPHIC
@ REPORT_DEMOGRAPHIC
Definition conn_types.h:53
REPORT_WONDERS_OF_THE_WORLD_LONG
@ REPORT_WONDERS_OF_THE_WORLD_LONG
Definition conn_types.h:51
REPORT_ACHIEVEMENTS
@ REPORT_ACHIEVEMENTS
Definition conn_types.h:54
REPORT_TOP_CITIES
@ REPORT_TOP_CITIES
Definition conn_types.h:52
send_save_game
void send_save_game(const char *filename)
Definition connectdlg_common.c:743
is_server_running
bool is_server_running(void)
Definition connectdlg_common.c:124
can_client_access_hack
bool can_client_access_hack(void)
Definition connectdlg_common.c:141
connectdlg_common.h
can_conn_enable_editing
bool can_conn_enable_editing(const struct connection *pconn)
Definition connection.c:521
key_coastline_toggle
void key_coastline_toggle(void)
Definition control.c:3923
key_irrigation_toggle
void key_irrigation_toggle(void)
Definition control.c:3939
key_unit_sentry
void key_unit_sentry(void)
Definition control.c:3727
key_city_output_toggle
void key_city_output_toggle(void)
Definition control.c:3824
request_unit_return
void request_unit_return(struct unit *punit)
Definition control.c:1526
request_unit_fortify
void request_unit_fortify(struct unit *punit)
Definition control.c:2324
key_editor_recalculate_borders
void key_editor_recalculate_borders(void)
Definition control.c:4043
request_unit_caravan_action
void request_unit_caravan_action(struct unit *punit, action_id action)
Definition control.c:2194
key_focus_unit_toggle
void key_focus_unit_toggle(void)
Definition control.c:4019
key_unit_auto_explore
void key_unit_auto_explore(void)
Definition control.c:3548
key_unit_connect
void key_unit_connect(enum unit_activity activity, struct extra_type *tgt)
Definition control.c:3346
key_city_full_bar_toggle
void key_city_full_bar_toggle(void)
Definition control.c:3856
key_bases_toggle
void key_bases_toggle(void)
Definition control.c:3955
key_map_native_toggle
void key_map_native_toggle(void)
Definition control.c:3848
key_resources_toggle
void key_resources_toggle(void)
Definition control.c:3963
request_unit_goto
void request_unit_goto(enum unit_orders last_order, action_id act_id, int sub_tgt_id)
Definition control.c:1104
key_unit_paradrop
void key_unit_paradrop(void)
Definition control.c:3450
get_units_in_focus
struct unit_list * get_units_in_focus(void)
Definition control.c:177
key_unit_shields_toggle
void key_unit_shields_toggle(void)
Definition control.c:4011
key_city_productions_toggle
void key_city_productions_toggle(void)
Definition control.c:3890
key_unit_plant
void key_unit_plant(void)
Definition control.c:3667
key_unit_fortress
void key_unit_fortress(void)
Definition control.c:3595
key_unit_mine
void key_unit_mine(void)
Definition control.c:3659
key_unit_pillage
void key_unit_pillage(void)
Definition control.c:3679
request_unit_unload
void request_unit_unload(struct unit *pcargo)
Definition control.c:2165
key_editor_toggle_fogofwar
void key_editor_toggle_fogofwar(void)
Definition control.c:4052
request_new_unit_activity_targeted
void request_new_unit_activity_targeted(struct unit *punit, enum unit_activity act, struct extra_type *tgt)
Definition control.c:1912
key_unit_irrigate
void key_unit_irrigate(void)
Definition control.c:3639
request_unit_build_city
void request_unit_build_city(struct unit *punit)
Definition control.c:1791
key_unit_unload_all
void key_unit_unload_all(void)
Definition control.c:3488
key_cities_toggle
void key_cities_toggle(void)
Definition control.c:3987
key_city_outlines_toggle
void key_city_outlines_toggle(void)
Definition control.c:3816
key_unit_homecity
void key_unit_homecity(void)
Definition control.c:3612
key_unit_patrol
void key_unit_patrol(void)
Definition control.c:3458
key_unit_solid_bg_toggle
void key_unit_solid_bg_toggle(void)
Definition control.c:4003
key_terrain_toggle
void key_terrain_toggle(void)
Definition control.c:3915
key_paths_toggle
void key_paths_toggle(void)
Definition control.c:3931
key_unit_wakeup_others
void key_unit_wakeup_others(void)
Definition control.c:3521
key_unit_stack_size_toggle
void key_unit_stack_size_toggle(void)
Definition control.c:3907
key_huts_toggle
void key_huts_toggle(void)
Definition control.c:3971
key_fog_of_war_toggle
void key_fog_of_war_toggle(void)
Definition control.c:4027
key_unit_wait
void key_unit_wait(void)
Definition control.c:3513
key_units_toggle
void key_units_toggle(void)
Definition control.c:3995
key_unit_select_battlegroup
void key_unit_select_battlegroup(int battlegroup, bool append)
Definition control.c:3790
key_map_grid_toggle
void key_map_grid_toggle(void)
Definition control.c:3832
key_pollution_toggle
void key_pollution_toggle(void)
Definition control.c:3979
key_city_growth_toggle
void key_city_growth_toggle(void)
Definition control.c:3873
key_unit_action_select_tgt
void key_unit_action_select_tgt(void)
Definition control.c:3377
key_city_buycost_toggle
void key_city_buycost_toggle(void)
Definition control.c:3882
get_num_units_in_focus
int get_num_units_in_focus(void)
Definition control.c:185
key_unit_transform
void key_unit_transform(void)
Definition control.c:3739
key_unit_done
void key_unit_done(void)
Definition control.c:3434
key_city_trade_routes_toggle
void key_city_trade_routes_toggle(void)
Definition control.c:3899
key_city_names_toggle
void key_city_names_toggle(void)
Definition control.c:3864
request_unit_select
void request_unit_select(struct unit_list *punits, enum unit_select_type_mode seltype, enum unit_select_location_mode selloc)
Definition control.c:1595
key_unit_auto_work
void key_unit_auto_work(void)
Definition control.c:3561
key_unit_airbase
void key_unit_airbase(void)
Definition control.c:3531
key_unit_goto
void key_unit_goto(void)
Definition control.c:3442
key_unit_convert
void key_unit_convert(void)
Definition control.c:3573
key_unit_clean
void key_unit_clean(void)
Definition control.c:3691
key_editor_toggle
void key_editor_toggle(void)
Definition control.c:4035
key_unit_assign_battlegroup
void key_unit_assign_battlegroup(int battlegroup, bool append)
Definition control.c:3751
key_unit_cultivate
void key_unit_cultivate(void)
Definition control.c:3647
key_mines_toggle
void key_mines_toggle(void)
Definition control.c:3947
key_map_borders_toggle
void key_map_borders_toggle(void)
Definition control.c:3840
control.h
can_unit_do_activity_targeted_client
#define can_unit_do_activity_targeted_client(_punit_, _act_, _tgt_)
Definition control.h:43
can_units_do_activity_targeted_client
#define can_units_do_activity_targeted_client(_punits_, _act_, _tgt_)
Definition control.h:47
can_units_do_activity_client
#define can_units_do_activity_client(_punits_, _act_)
Definition control.h:45
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 * punit
Definition dialogs_g.h:74
editor_is_active
bool editor_is_active(void)
Definition editor.c:346
OBJTYPE_GAME
@ OBJTYPE_GAME
Definition editor.h:31
next_extra_for_tile
struct extra_type * next_extra_for_tile(const struct tile *ptile, enum extra_cause cause, const struct player *pplayer, const struct unit *punit)
Definition extras.c:765
extra_number
int extra_number(const struct extra_type *pextra)
Definition extras.c:161
extra_type_list_by_cause
struct extra_type_list * extra_type_list_by_cause(enum extra_cause cause)
Definition extras.c:249
extras
static struct extra_type extras[MAX_EXTRA_TYPES]
Definition extras.c:31
extra_name_translation
const char * extra_name_translation(const struct extra_type *pextra)
Definition extras.c:194
extra_type_iterate
#define extra_type_iterate(_p)
Definition extras.h:315
extra_type_iterate_end
#define extra_type_iterate_end
Definition extras.h:321
extra_type_by_rmcause_iterate_end
#define extra_type_by_rmcause_iterate_end
Definition extras.h:358
extra_type_by_rmcause_iterate
#define extra_type_by_rmcause_iterate(_rmcause, _extra)
Definition extras.h:353
extra_type_by_cause_iterate_end
#define extra_type_by_cause_iterate_end
Definition extras.h:339
extra_type_by_cause_iterate
#define extra_type_by_cause_iterate(_cause, _extra)
Definition extras.h:333
NO_TARGET
#define NO_TARGET
Definition fc_types.h:358
action_id
int action_id
Definition fc_types.h:393
MAX_LEN_NAME
#define MAX_LEN_NAME
Definition fc_types.h:66
BORDERS_DISABLED
@ BORDERS_DISABLED
Definition fc_types.h:1047
fcintl.h
Q_
#define Q_(String)
Definition fcintl.h:70
PL_
#define PL_(String1, String2, n)
Definition fcintl.h:71
_
#define _(String)
Definition fcintl.h:67
N_
#define N_(String)
Definition fcintl.h:69
game
struct civ_game game
Definition game.c:62
wld
struct world wld
Definition game.c:63
game.h
government_name_translation
const char * government_name_translation(const struct government *pgovern)
Definition government.c:143
untargeted_revolution_allowed
bool untargeted_revolution_allowed(void)
Definition government.c:565
can_change_to_government
bool can_change_to_government(struct player *pplayer, const struct government *gov)
Definition government.c:166
government.h
governments_iterate
#define governments_iterate(NAME_pgov)
Definition government.h:120
governments_iterate_end
#define governments_iterate_end
Definition government.h:123
log_output_window
void log_output_window(void)
Definition chatline.c:929
clear_output_window
void clear_output_window(void)
Definition chatline.c:944
city_report_dialog_popup
void city_report_dialog_popup(bool raise)
Definition cityrep.c:292
unit_select_dialog_popup
void unit_select_dialog_popup(struct tile *ptile)
Definition dialogs.c:377
popup_upgrade_dialog
void popup_upgrade_dialog(struct unit_list *punits)
Definition dialogs.c:1435
popup_disband_dialog
void popup_disband_dialog(struct unit_list *punits)
Definition dialogs.c:1473
editgui_refresh
void editgui_refresh(void)
Definition editgui.c:1796
property_editor_popup
void property_editor_popup(struct property_editor *pe, enum editor_object_type objtype)
Definition editprop.c:6251
editprop_get_property_editor
struct property_editor * editprop_get_property_editor(void)
Definition editprop.c:6204
property_editor_reload
void property_editor_reload(struct property_editor *pe, enum editor_object_type objtype)
Definition editprop.c:6341
popup_find_dialog
void popup_find_dialog(void)
Definition finddlg.c:58
popup_multiplier_dialog
void popup_multiplier_dialog(void)
Definition gamedlgs.c:383
popup_rates_dialog
void popup_rates_dialog(void)
Definition gamedlgs.c:533
popup_goto_dialog
void popup_goto_dialog(void)
Definition gotodlg.c:258
fullscreen_opt_refresh
void fullscreen_opt_refresh(struct option *poption)
Definition gui_main.c:2455
map_canvas_focus
gboolean map_canvas_focus(void)
Definition gui_main.c:382
toplevel
GtkWidget * toplevel
Definition gui_main.c:125
popup_quit_dialog
void popup_quit_dialog(void)
Definition gui_main.c:2371
GUI_GTK_OPTION
#define GUI_GTK_OPTION(optname)
Definition gui_main.h:25
setup_dialog
void setup_dialog(GtkWidget *shell, GtkWidget *parent)
Definition gui_stuff.c:287
popup_help_dialog_string
void popup_help_dialog_string(const char *item)
Definition helpdlg.c:212
infra_dialog_popup
void infra_dialog_popup(void)
Definition infradlg.c:85
luaconsole_dialog_popup
void luaconsole_dialog_popup(bool raise)
Definition luaconsole.c:126
center_on_unit
void center_on_unit(void)
Definition mapctrl.c:496
save_mapimg_callback
static void save_mapimg_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:697
show_national_borders_callback
static void show_national_borders_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1207
show_focus_unit_callback
static void show_focus_unit_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1443
setup_menus
GtkWidget * setup_menus(GtkWidget *window)
Definition menu.c:2151
help_connecting_callback
static void help_connecting_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:857
menus_rename
static void menus_rename(const char *key, const gchar *new_label)
Definition menu.c:2285
help_combat_callback
static void help_combat_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1065
menu_entry_group_set_sensitive
static void menu_entry_group_set_sensitive(enum menu_entry_grouping group, gboolean is_sensitive)
Definition menu.c:2253
help_ruleset_callback
static void help_ruleset_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1009
select_single_callback
static void select_single_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1513
unit_unload_transporter_callback
static void unit_unload_transporter_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1721
bg_assign1_callback
static void bg_assign1_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:929
bg_append3_callback
static void bg_append3_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:985
help_government_callback
static void help_government_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1105
report_achievements_callback
static void report_achievements_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:833
show_fog_of_war_callback
static void show_fog_of_war_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1454
help_zoc_callback
static void help_zoc_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1073
show_city_productions_callback
static void show_city_productions_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1264
do_pillage_callback
static void do_pillage_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1961
bg_select0_callback
static void bg_select0_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:897
menu_remove_previous_entries
static void menu_remove_previous_entries(GtkMenu *menu)
Definition menu.c:2890
client_lua_script_callback
static void client_lua_script_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:817
bg_select2_callback
static void bg_select2_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:945
show_city_names_callback
static void show_city_names_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1241
help_space_race_callback
static void help_space_race_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1121
help_tileset_callback
static void help_tileset_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1017
help_playing_callback
static void help_playing_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1001
plant_callback
static void plant_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1839
menu_entries
static struct menu_entry_info menu_entries[]
Definition menu.c:267
base_callback
static void base_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2001
help_economy_callback
static void help_economy_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1033
clean_nuisance_callback
static void clean_nuisance_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1919
unit_sentry_callback
static void unit_sentry_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1685
center_view_callback
static void center_view_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2041
unit_explore_callback
static void unit_explore_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1669
build_mine_callback
static void build_mine_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1831
quit_callback
static void quit_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:749
unit_return_callback
static void unit_return_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1659
ui_builder
static GtkBuilder * ui_builder
Definition menu.c:77
show_city_trade_routes_callback
static void show_city_trade_routes_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1287
transform_terrain_callback
static void transform_terrain_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1911
help_wonders_callback
static void help_wonders_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1097
find_menu
static GtkMenu * find_menu(const char *key)
Definition menu.c:2298
show_terrain_callback
static void show_terrain_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1298
show_city_growth_callback
static void show_city_growth_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1253
show_stack_size_callback
static void show_stack_size_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1432
get_ui_filename
static const gchar * get_ui_filename(void)
Definition menu.c:2131
multiplier_callback
static void multiplier_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1985
help_terrain_callback
static void help_terrain_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1089
save_game_callback
static void save_game_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:681
show_unit_solid_bg_callback
static void show_unit_solid_bg_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1410
show_coastline_callback
static void show_coastline_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1309
toggle_fog_callback
static void toggle_fog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1485
show_city_full_bar_callback
static void show_city_full_bar_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1229
edit_mode_callback
static void edit_mode_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1162
help_chatline_callback
static void help_chatline_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:873
show_paths_callback
static void show_paths_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1319
menus_free
void menus_free(void)
Definition menu.c:3219
connect_road_callback
static void connect_road_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1847
bg_append2_callback
static void bg_append2_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:961
help_overview_callback
static void help_overview_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:993
save_game_as_callback
static void save_game_as_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:689
help_diplomacy_callback
static void help_diplomacy_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1113
show_units_callback
static void show_units_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1399
show_irrigation_callback
static void show_irrigation_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1329
show_map_grid_callback
static void show_map_grid_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1196
help_improvements_callback
static void help_improvements_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1049
bg_append1_callback
static void bg_append1_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:937
recalc_borders_callback
static void recalc_borders_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1477
find_city_callback
static void find_city_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:757
report_nations_callback
static void report_nations_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:781
report_demographic_callback
static void report_demographic_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:825
help_worklist_editor_callback
static void help_worklist_editor_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:881
help_cities_callback
static void help_cities_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1041
leave_local_game_response
static void leave_local_game_response(GtkWidget *dialog, gint response)
Definition menu.c:714
help_language_callback
static void help_language_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:841
show_mine_callback
static void show_mine_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1339
server_options_callback
static void server_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:657
bg_append0_callback
static void bg_append0_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:913
leave_callback
static void leave_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:729
select_same_type_cont_callback
static void select_same_type_cont_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1537
unit_convert_callback
static void unit_convert_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1746
select_dialog_callback
static void select_dialog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1553
show_huts_callback
static void show_huts_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1369
report_wow_callback
static void report_wow_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:789
menu_entry_set_active
static void menu_entry_set_active(const char *key, gboolean is_active)
Definition menu.c:2227
unit_upgrade_callback
static void unit_upgrade_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1738
menu_unit_goto_and_add_accel
static void menu_unit_goto_and_add_accel(GtkWidget *item, action_id act_id, const guint accel_key, const GdkModifierType accel_mods)
Definition menu.c:2866
help_tech_callback
static void help_tech_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1081
unit_goto_callback
static void unit_goto_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1593
clean_callback
static void clean_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2026
build_city_callback
static void build_city_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1762
bg_select3_callback
static void bg_select3_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:969
unit_patrol_callback
static void unit_patrol_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1677
real_menus_init
void real_menus_init(void)
Definition menu.c:2910
menu_entry_grouping
menu_entry_grouping
Definition menu.c:91
MGROUP_ALL
@ MGROUP_ALL
Definition menu.c:92
MGROUP_PLAYING
@ MGROUP_PLAYING
Definition menu.c:91
MGROUP_PLAYER
@ MGROUP_PLAYER
Definition menu.c:92
MGROUP_SAFE
@ MGROUP_SAFE
Definition menu.c:91
MGROUP_EDIT
@ MGROUP_EDIT
Definition menu.c:91
MGROUP_UNIT
@ MGROUP_UNIT
Definition menu.c:92
rally_dialog_callback
static void rally_dialog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1561
help_about_callback
static void help_about_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1145
bg_assign0_callback
static void bg_assign0_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:905
build_road_callback
static void build_road_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1789
local_options_callback
static void local_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:641
show_cities_callback
static void show_cities_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1389
unit_homecity_callback
static void unit_homecity_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1730
menu_entry_set_sensitive
static void menu_entry_set_sensitive(const char *key, gboolean is_sensitive)
Definition menu.c:2240
show_pollution_callback
static void show_pollution_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1379
save_options_callback
static void save_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:665
save_mapimg_as_callback
static void save_mapimg_as_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:705
worklists_callback
static void worklists_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:765
connect_maglev_callback
static void connect_maglev_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1879
full_screen_callback
static void full_screen_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1465
report_top_cities_callback
static void report_top_cities_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:801
help_controls_callback
static void help_controls_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:865
select_same_type_callback
static void select_same_type_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1545
connect_rail_callback
static void connect_rail_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1863
unit_wait_callback
static void unit_wait_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1577
get_tile_change_menu_text
static const char * get_tile_change_menu_text(struct tile *ptile, enum unit_activity activity)
Definition menu.c:2338
build_airbase_callback
static void build_airbase_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1945
report_cities_callback
static void report_cities_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2057
help_cma_callback
static void help_cma_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:889
infra_dialog_callback
static void infra_dialog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1569
message_options_callback
static void message_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:649
tax_rate_callback
static void tax_rate_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1977
help_musicset_callback
static void help_musicset_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1025
unit_goto_city_callback
static void unit_goto_city_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1649
menu_entry_info_find
static struct menu_entry_info * menu_entry_info_find(const char *key)
Definition menu.c:2211
bg_select1_callback
static void bg_select1_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:921
auto_work_callback
static void auto_work_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1781
government_callback
static void government_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1993
report_economy_callback
static void report_economy_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2065
report_messages_callback
static void report_messages_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:809
do_paradrop_callback
static void do_paradrop_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1953
show_bases_callback
static void show_bases_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1349
select_same_type_tile_callback
static void select_same_type_tile_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1529
unit_unsentry_callback
static void unit_unsentry_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1693
save_options_on_exit_callback
static void save_options_on_exit_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1153
show_native_tiles_callback
static void show_native_tiles_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1218
menu_entry_init
static void menu_entry_init(GtkBuildable *item)
Definition menu.c:2091
show_unit_shields_callback
static void show_unit_shields_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1421
reload_tileset_callback
static void reload_tileset_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:673
scenario_properties_callback
static void scenario_properties_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1493
clear_chat_logs_callback
static void clear_chat_logs_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:625
unit_deboard_callback
static void unit_deboard_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1711
help_policies_callback
static void help_policies_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:849
unit_done_callback
static void unit_done_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1585
help_nations_callback
static void help_nations_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1129
unit_goto_and_callback
static void unit_goto_and_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1601
show_city_output_callback
static void show_city_output_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1185
show_city_outlines_callback
static void show_city_outlines_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1174
save_scenario_callback
static void save_scenario_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1505
ADD_OLD_ACCELERATOR
#define ADD_OLD_ACCELERATOR(wanted_action_id, accel_key, accel_mods)
help_copying_callback
static void help_copying_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1137
cultivate_callback
static void cultivate_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1823
save_chat_logs_callback
static void save_chat_logs_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:633
real_menus_update
void real_menus_update(void)
Definition menu.c:2353
report_spaceship_callback
static void report_spaceship_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2081
select_all_on_tile_callback
static void select_all_on_tile_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1521
show_city_buy_cost_callback
static void show_city_buy_cost_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1276
build_fortress_callback
static void build_fortress_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1927
CREATE_SUB_ITEM
#define CREATE_SUB_ITEM(_sub_target_, _sub_target_key_, _sub_target_name_)
view_menu_update_sensitivity
static void view_menu_update_sensitivity(void)
Definition menu.c:2306
unit_board_callback
static void unit_board_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1701
menu_entry_set_visible
static void menu_entry_set_visible(const char *key, gboolean is_visible, gboolean is_sensitive)
Definition menu.c:2269
fortify_callback
static void fortify_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1935
bg_assign3_callback
static void bg_assign3_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:977
show_resources_callback
static void show_resources_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1359
connect_irrigation_callback
static void connect_irrigation_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1895
build_irrigation_callback
static void build_irrigation_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1815
bg_assign2_callback
static void bg_assign2_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:953
report_units_callback
static void report_units_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2049
road_callback
static void road_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2013
unit_disband_callback
static void unit_disband_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1754
help_units_callback
static void help_units_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1057
report_research_callback
static void report_research_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2073
diplomat_action_callback
static void diplomat_action_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1969
map_view_callback
static void map_view_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:773
popup_messageopt_dialog
void popup_messageopt_dialog(void)
Definition messagedlg.c:51
meswin_dialog_popup
void meswin_dialog_popup(bool raise)
Definition messagewin.c:417
option_dialog_popup
void option_dialog_popup(const char *name, const struct option_set *poptset)
Definition optiondlg.c:972
save_mapimg_dialog_popup
void save_mapimg_dialog_popup(void)
Definition pages.c:3535
mapimg_client_save
void mapimg_client_save(const char *filename)
Definition pages.c:3554
save_game_dialog_popup
void save_game_dialog_popup(void)
Definition pages.c:3471
save_scenario_dialog_popup
void save_scenario_dialog_popup(void)
Definition pages.c:3506
popup_players_dialog
void popup_players_dialog(bool raise)
Definition plrdlg.c:91
rally_dialog_popup
void rally_dialog_popup(void)
Definition rallypointdlg.c:66
science_report_dialog_popup
void science_report_dialog_popup(bool raise)
Definition repodlgs.c:716
economy_report_dialog_popup
void economy_report_dialog_popup(bool raise)
Definition repodlgs.c:1243
units_report_dialog_popup
void units_report_dialog_popup(bool raise)
Definition repodlgs.c:1768
science_report_dialog_popdown
void science_report_dialog_popdown(void)
Definition repodlgs.c:740
popup_spaceship_dialog
void popup_spaceship_dialog(struct player *pplayer)
Definition spaceshipdlg.c:146
request_transport
bool request_transport(struct unit *cargo, struct tile *ptile)
Definition transportdlg.c:82
popup_worklists_report
void popup_worklists_report(void)
Definition wldlg.c:287
editgui.h
editprop.h
gamedlgs.h
gui_stuff.h
infradlg.h
menu_entry_grouping
menu_entry_grouping
Definition menu.c:80
rallypointdlg.h
unitselect.h
chatline.h
cityrep.h
popup_revolution_dialog
void popup_revolution_dialog(void)
Definition dialogs.c:112
dialogs.h
finddlg.h
gotodlg.h
gui_main.h
helpdlg.h
luaconsole.h
mapctrl.h
menu.h
messagedlg.h
messagewin.h
optiondlg.h
pages.h
plrdlg.h
ratesdlg.h
repodlgs.h
spaceshipdlg.h
sprite.h
wldlg.h
HELP_MUSICSET_ITEM
#define HELP_MUSICSET_ITEM
HELP_CITIES_ITEM
#define HELP_CITIES_ITEM
HELP_TERRAIN_ITEM
#define HELP_TERRAIN_ITEM
HELP_LANGUAGES_ITEM
#define HELP_LANGUAGES_ITEM
HELP_CONNECTING_ITEM
#define HELP_CONNECTING_ITEM
HELP_TILESET_ITEM
#define HELP_TILESET_ITEM
HELP_CHATLINE_ITEM
#define HELP_CHATLINE_ITEM
HELP_RULESET_ITEM
#define HELP_RULESET_ITEM
HELP_GOVERNMENT_ITEM
#define HELP_GOVERNMENT_ITEM
HELP_ABOUT_ITEM
#define HELP_ABOUT_ITEM
HELP_MULTIPLIER_ITEM
#define HELP_MULTIPLIER_ITEM
HELP_PLAYING_ITEM
#define HELP_PLAYING_ITEM
HELP_IMPROVEMENTS_ITEM
#define HELP_IMPROVEMENTS_ITEM
HELP_UNITS_ITEM
#define HELP_UNITS_ITEM
HELP_ZOC_ITEM
#define HELP_ZOC_ITEM
HELP_WORKLIST_EDITOR_ITEM
#define HELP_WORKLIST_EDITOR_ITEM
HELP_WONDERS_ITEM
#define HELP_WONDERS_ITEM
HELP_COMBAT_ITEM
#define HELP_COMBAT_ITEM
HELP_SPACE_RACE_ITEM
#define HELP_SPACE_RACE_ITEM
HELP_COPYING_ITEM
#define HELP_COPYING_ITEM
HELP_OVERVIEW_ITEM
#define HELP_OVERVIEW_ITEM
HELP_NATIONS_ITEM
#define HELP_NATIONS_ITEM
HELP_TECHS_ITEM
#define HELP_TECHS_ITEM
HELP_DIPLOMACY_ITEM
#define HELP_DIPLOMACY_ITEM
HELP_ECONOMY_ITEM
#define HELP_ECONOMY_ITEM
HELP_CMA_ITEM
#define HELP_CMA_ITEM
HELP_CONTROLS_ITEM
#define HELP_CONTROLS_ITEM
improvement_number
Impr_type_id improvement_number(const struct impr_type *pimprove)
Definition improvement.c:184
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
name
const char * name
Definition inputfile.c:127
log.h
fc_assert_ret
#define fc_assert_ret(condition)
Definition log.h:191
log_verbose
#define log_verbose(message,...)
Definition log.h:109
fc_assert
#define fc_assert(condition)
Definition log.h:176
log_error
#define log_error(message,...)
Definition log.h:103
terrain_control
struct terrain_misc terrain_control
Definition map.c:68
mapview_common.h
multiplier_count
Multiplier_type_id multiplier_count(void)
Definition multipliers.c:88
server_optset
const struct option_set * server_optset
Definition options.c:4281
client_optset
const struct option_set * client_optset
Definition options.c:1315
options_save
void options_save(option_save_log_callback log_cb)
Definition options.c:6341
gui_options
struct client_options gui_options
Definition options.c:71
options.h
GUI_GTK_MSGCHAT_MERGED
@ GUI_GTK_MSGCHAT_MERGED
Definition options.h:69
road_extra_get
struct extra_type * road_extra_get(const struct road_type *proad)
Definition road.c:42
road_by_gui_type
struct road_type * road_by_gui_type(enum road_gui_type gui_type)
Definition road.c:180
road.h
grouping
static char * grouping
Definition shared.c:98
fileinfoname
const char * fileinfoname(const struct strvec *dirs, const char *filename)
Definition shared.c:1101
get_data_dirs
const struct strvec * get_data_dirs(void)
Definition shared.c:893
shared.h
action
Definition actions.h:106
advance
Definition tech.h:124
civ_game::info
struct packet_game_info info
Definition game.h:89
civ_game::government_during_revolution
struct government * government_during_revolution
Definition game.h:94
civclient::conn
struct connection conn
Definition client_main.h:96
client_options::draw_native
bool draw_native
Definition options.h:216
client_options::draw_specials
bool draw_specials
Definition options.h:208
client_options::draw_city_output
bool draw_city_output
Definition options.h:195
client_options::draw_city_names
bool draw_city_names
Definition options.h:197
client_options::draw_city_productions
bool draw_city_productions
Definition options.h:199
client_options::draw_mines
bool draw_mines
Definition options.h:206
client_options::draw_borders
bool draw_borders
Definition options.h:215
client_options::draw_fortress_airbase
bool draw_fortress_airbase
Definition options.h:207
client_options::draw_city_buycost
bool draw_city_buycost
Definition options.h:200
client_options::draw_unit_stack_size
bool draw_unit_stack_size
Definition options.h:219
client_options::draw_irrigation
bool draw_irrigation
Definition options.h:205
client_options::draw_terrain
bool draw_terrain
Definition options.h:202
client_options::draw_units
bool draw_units
Definition options.h:212
client_options::draw_fog_of_war
bool draw_fog_of_war
Definition options.h:214
client_options::draw_city_trade_routes
bool draw_city_trade_routes
Definition options.h:201
client_options::draw_unit_shields
bool draw_unit_shields
Definition options.h:218
client_options::draw_cities
bool draw_cities
Definition options.h:211
client_options::save_options_on_exit
bool save_options_on_exit
Definition options.h:125
client_options::draw_map_grid
bool draw_map_grid
Definition options.h:196
client_options::draw_city_growth
bool draw_city_growth
Definition options.h:198
client_options::draw_huts
bool draw_huts
Definition options.h:209
client_options::draw_focus_unit
bool draw_focus_unit
Definition options.h:213
client_options::draw_paths
bool draw_paths
Definition options.h:204
client_options::draw_city_outlines
bool draw_city_outlines
Definition options.h:194
client_options::draw_coastline
bool draw_coastline
Definition options.h:203
client_options::draw_full_citybar
bool draw_full_citybar
Definition options.h:217
client_options::draw_pollution
bool draw_pollution
Definition options.h:210
client_options::solid_color_behind_units
bool solid_color_behind_units
Definition options.h:150
connection::established
bool established
Definition connection.h:140
connection::playing
struct player * playing
Definition connection.h:151
connection::used
bool used
Definition connection.h:139
extra_type
Definition extras.h:88
extra_type::data
struct extra_type::@25 data
government
Definition government.h:52
impr_type
Definition improvement.h:50
item
Definition climisc.h:80
menu_entry_info
Definition menu.c:97
menu_entry_info::accel_mod
GdkModifierType accel_mod
Definition menu.c:101
menu_entry_info::accel
guint accel
Definition menu.c:100
menu_entry_info::key
const char * key
Definition menu.c:98
menu_entry_info::grouping
enum menu_entry_grouping grouping
Definition menu.c:103
menu_entry_info::cb
GCallback cb
Definition menu.c:102
menu_entry_info::name
const char * name
Definition menu.c:99
packet_game_info::borders
enum borders_mode borders
Definition packets_gen.h:135
packet_game_info::changable_tax
bool changable_tax
Definition packets_gen.h:144
packet_game_info::is_edit_mode
bool is_edit_mode
Definition packets_gen.h:191
packet_game_info::top_cities_count
int top_cities_count
Definition packets_gen.h:251
property_editor
Definition editprop.c:646
road_type
Definition road.h:71
terrain
Definition terrain.h:75
terrain::cultivate_result
struct terrain * cultivate_result
Definition terrain.h:108
terrain::plant_result
struct terrain * plant_result
Definition terrain.h:111
terrain::transform_result
struct terrain * transform_result
Definition terrain.h:122
tile
Definition tile.h:50
unit_type
Definition unittype.h:507
unit
Definition unit.h:140
world::map
struct civ_map map
Definition world_object.h:38
fc_snprintf
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:960
support.h
sz_strlcpy
#define sz_strlcpy(dest, src)
Definition support.h:189
TRUE
#define TRUE
Definition support.h:46
FALSE
#define FALSE
Definition support.h:47
advance_name_translation
const char * advance_name_translation(const struct advance *padvance)
Definition tech.c:300
advance_number
Tech_type_id advance_number(const struct advance *padvance)
Definition tech.c:98
advance_iterate
#define advance_iterate(_p)
Definition tech.h:276
advance_iterate_end
#define advance_iterate_end
Definition tech.h:277
T_NONE
#define T_NONE
Definition terrain.h:61
tile_virtual_destroy
void tile_virtual_destroy(struct tile *vtile)
Definition tile.c:1035
tile_apply_activity
bool tile_apply_activity(struct tile *ptile, Activity_type_id act, struct extra_type *tgt)
Definition tile.c:681
tile_virtual_new
struct tile * tile_virtual_new(const struct tile *ptile)
Definition tile.c:981
tile_get_info_text
const char * tile_get_info_text(const struct tile *ptile, bool include_nuisances, int linebreaks)
Definition tile.c:771
tile_city
struct city * tile_city(const struct tile *ptile)
Definition tile.c:83
tile_terrain
#define tile_terrain(_tile)
Definition tile.h:111
tilespec_reread
bool tilespec_reread(const char *new_tileset_name, bool game_fully_initialized, float scale)
Definition tilespec.c:1355
tilespec.h
can_unit_change_homecity
bool can_unit_change_homecity(const struct unit *punit)
Definition unit.c:505
unit_can_est_trade_route_here
bool unit_can_est_trade_route_here(const struct unit *punit)
Definition unit.c:286
unit_can_add_or_build_city
bool unit_can_add_or_build_city(const struct unit *punit)
Definition unit.c:474
unit_can_help_build_wonder_here
bool unit_can_help_build_wonder_here(const struct unit *punit)
Definition unit.c:261
can_unit_do_autoworker
bool can_unit_do_autoworker(const struct unit *punit)
Definition unit.c:626
can_unit_paradrop
bool can_unit_paradrop(const struct civ_map *nmap, const struct unit *punit)
Definition unit.c:843
unit.h
unit_tile
#define unit_tile(_pu)
Definition unit.h:397
ORDER_PERFORM_ACTION
@ ORDER_PERFORM_ACTION
Definition unit.h:48
unit_owner
#define unit_owner(_pu)
Definition unit.h:396
units_can_convert
bool units_can_convert(const struct civ_map *nmap, const struct unit_list *punits)
Definition unitlist.c:350
units_are_occupied
bool units_are_occupied(const struct unit_list *punits)
Definition unitlist.c:273
units_can_unload
bool units_can_unload(const struct civ_map *nmap, const struct unit_list *punits)
Definition unitlist.c:301
can_units_do_base_gui
bool can_units_do_base_gui(const struct unit_list *punits, enum base_gui_type base_gui)
Definition unitlist.c:180
can_units_do_any_road
bool can_units_do_any_road(const struct civ_map *nmap, const struct unit_list *punits)
Definition unitlist.c:161
units_can_upgrade
bool units_can_upgrade(const struct civ_map *nmap, const struct unit_list *punits)
Definition unitlist.c:335
units_have_activity_on_tile
bool units_have_activity_on_tile(const struct unit_list *punits, enum unit_activity activity)
Definition unitlist.c:319
units_have_type_flag
bool units_have_type_flag(const struct unit_list *punits, enum unit_type_flag_id flag, bool has_flag)
Definition unitlist.c:202
can_units_do
bool can_units_do(const struct unit_list *punits, bool(can_fn)(const struct unit *punit))
Definition unitlist.c:95
units_can_do_action
bool units_can_do_action(const struct unit_list *punits, action_id act_id, bool can_do)
Definition unitlist.c:239
units_can_load
bool units_can_load(const struct unit_list *punits)
Definition unitlist.c:287
can_units_do_on_map
bool can_units_do_on_map(const struct civ_map *nmap, const struct unit_list *punits, bool(can_fn)(const struct civ_map *nmap, const struct unit *punit))
Definition unitlist.c:111
unit_list_iterate
#define unit_list_iterate(unitlist, punit)
Definition unitlist.h:31
unit_list_iterate_end
#define unit_list_iterate_end
Definition unitlist.h:33
unit_type_get
const struct unit_type * unit_type_get(const struct unit *punit)
Definition unittype.c:123
can_upgrade_unittype
const struct unit_type * can_upgrade_unittype(const struct player *pplayer, const struct unit_type *punittype)
Definition unittype.c:1703
utype_name_translation
const char * utype_name_translation(const struct unit_type *punittype)
Definition unittype.c:1560
utype_can_do_action
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
Definition unittype.c:371