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

Freeciv-3.1

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
97struct 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_nations_callback(GtkMenuItem *item, gpointer data);
160static void help_connecting_callback(GtkMenuItem *item, gpointer data);
161static void help_controls_callback(GtkMenuItem *item, gpointer data);
162static void help_cma_callback(GtkMenuItem *item, gpointer data);
163static void help_chatline_callback(GtkMenuItem *item, gpointer data);
164static void help_worklist_editor_callback(GtkMenuItem *item, gpointer data);
165static void help_language_callback(GtkMenuItem *item, gpointer data);
166static void help_copying_callback(GtkMenuItem *item, gpointer data);
167static void help_about_callback(GtkMenuItem *item, gpointer data);
168static void save_options_on_exit_callback(GtkCheckMenuItem *item,
169 gpointer data);
170static void edit_mode_callback(GtkCheckMenuItem *item, gpointer data);
171static void show_city_outlines_callback(GtkCheckMenuItem *item,
172 gpointer data);
173static void show_city_output_callback(GtkCheckMenuItem *item, gpointer data);
174static void show_map_grid_callback(GtkCheckMenuItem *item, gpointer data);
175static void show_national_borders_callback(GtkCheckMenuItem *item,
176 gpointer data);
177static void show_native_tiles_callback(GtkCheckMenuItem *item,
178 gpointer data);
179static void show_city_full_bar_callback(GtkCheckMenuItem *item,
180 gpointer data);
181static void show_city_names_callback(GtkCheckMenuItem *item, gpointer data);
182static void show_city_growth_callback(GtkCheckMenuItem *item, gpointer data);
183static void show_city_productions_callback(GtkCheckMenuItem *item,
184 gpointer data);
185static void show_city_buy_cost_callback(GtkCheckMenuItem *item,
186 gpointer data);
187static void show_city_trade_routes_callback(GtkCheckMenuItem *item,
188 gpointer data);
189static void show_terrain_callback(GtkCheckMenuItem *item, gpointer data);
190static void show_coastline_callback(GtkCheckMenuItem *item, gpointer data);
191static void show_road_rails_callback(GtkCheckMenuItem *item, gpointer data);
192static void show_irrigation_callback(GtkCheckMenuItem *item, gpointer data);
193static void show_mine_callback(GtkCheckMenuItem *item, gpointer data);
194static void show_bases_callback(GtkCheckMenuItem *item, gpointer data);
195static void show_resources_callback(GtkCheckMenuItem *item, gpointer data);
196static void show_huts_callback(GtkCheckMenuItem *item, gpointer data);
197static void show_pollution_callback(GtkCheckMenuItem *item, gpointer data);
198static void show_cities_callback(GtkCheckMenuItem *item, gpointer data);
199static void show_units_callback(GtkCheckMenuItem *item, gpointer data);
200static void show_unit_solid_bg_callback(GtkCheckMenuItem *item,
201 gpointer data);
202static void show_unit_shields_callback(GtkCheckMenuItem *item,
203 gpointer data);
204static void show_stack_size_callback(GtkCheckMenuItem *item,
205 gpointer data);
206static void show_focus_unit_callback(GtkCheckMenuItem *item, gpointer data);
207static void show_fog_of_war_callback(GtkCheckMenuItem *item, gpointer data);
208static void full_screen_callback(GtkCheckMenuItem *item, gpointer data);
209static void recalc_borders_callback(GtkMenuItem *item, gpointer data);
210static void toggle_fog_callback(GtkMenuItem *item, gpointer data);
211static void scenario_properties_callback(GtkMenuItem *item, gpointer data);
212static void save_scenario_callback(GtkMenuItem *item, gpointer data);
213static void center_view_callback(GtkMenuItem *item, gpointer data);
214static void report_economy_callback(GtkMenuItem *item, gpointer data);
215static void report_research_callback(GtkMenuItem *item, gpointer data);
216static void multiplier_callback(GtkMenuItem *item, gpointer data);
217static void report_spaceship_callback(GtkMenuItem *item, gpointer data);
218static void report_achievements_callback(GtkMenuItem *item, gpointer data);
219static void government_callback(GtkMenuItem *item, gpointer data);
220static void tax_rate_callback(GtkMenuItem *item, gpointer data);
221static void select_single_callback(GtkMenuItem *item, gpointer data);
222static void select_all_on_tile_callback(GtkMenuItem *item, gpointer data);
223static void select_same_type_tile_callback(GtkMenuItem *item, gpointer data);
224static void select_same_type_cont_callback(GtkMenuItem *item, gpointer data);
225static void select_same_type_callback(GtkMenuItem *item, gpointer data);
226static void select_dialog_callback(GtkMenuItem *item, gpointer data);
227static void rally_dialog_callback(GtkMenuItem *item, gpointer data);
228static void infra_dialog_callback(GtkMenuItem *item, gpointer data);
229static void unit_wait_callback(GtkMenuItem *item, gpointer data);
230static void unit_done_callback(GtkMenuItem *item, gpointer data);
231static void unit_goto_callback(GtkMenuItem *item, gpointer data);
232static void unit_goto_city_callback(GtkMenuItem *item, gpointer data);
233static void unit_return_callback(GtkMenuItem *item, gpointer data);
234static void unit_explore_callback(GtkMenuItem *item, gpointer data);
235static void unit_patrol_callback(GtkMenuItem *item, gpointer data);
236static void unit_sentry_callback(GtkMenuItem *item, gpointer data);
237static void unit_unsentry_callback(GtkMenuItem *item, gpointer data);
238static void unit_board_callback(GtkMenuItem *item, gpointer data);
239static void unit_deboard_callback(GtkMenuItem *item, gpointer data);
240static void unit_unload_transporter_callback(GtkMenuItem *item,
241 gpointer data);
242static void unit_homecity_callback(GtkMenuItem *item, gpointer data);
243static void unit_upgrade_callback(GtkMenuItem *item, gpointer data);
244static void unit_convert_callback(GtkMenuItem *item, gpointer data);
245static void unit_disband_callback(GtkMenuItem *item, gpointer data);
246static void build_city_callback(GtkMenuItem *item, gpointer data);
247static void auto_settle_callback(GtkMenuItem *item, gpointer data);
248static void build_road_callback(GtkMenuItem *item, gpointer data);
249static void build_irrigation_callback(GtkMenuItem *item, gpointer data);
250static void cultivate_callback(GtkMenuItem *item, gpointer data);
251static void build_mine_callback(GtkMenuItem *item, gpointer data);
252static void plant_callback(GtkMenuItem *item, gpointer data);
253static void connect_road_callback(GtkMenuItem *item, gpointer data);
254static void connect_rail_callback(GtkMenuItem *item, gpointer data);
255static void connect_maglev_callback(GtkMenuItem *item, gpointer data);
256static void connect_irrigation_callback(GtkMenuItem *item, gpointer data);
257static void transform_terrain_callback(GtkMenuItem *item, gpointer data);
258static void clean_pollution_callback(GtkMenuItem *item, gpointer data);
259static void clean_fallout_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 _Five 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_NATIONS", N_("About Nations"), 0, 0,
410 G_CALLBACK(help_nations_callback), MGROUP_SAFE },
411 { "HELP_CONNECTING", N_("Connecting"), 0, 0,
412 G_CALLBACK(help_connecting_callback), MGROUP_SAFE },
413 { "HELP_CONTROLS", N_("Controls"), 0, 0,
414 G_CALLBACK(help_controls_callback), MGROUP_SAFE },
415 { "HELP_CMA", N_("Citizen Governor"), 0, 0,
416 G_CALLBACK(help_cma_callback), MGROUP_SAFE },
417 { "HELP_CHATLINE", N_("Chatline"), 0, 0,
418 G_CALLBACK(help_chatline_callback), MGROUP_SAFE },
419 { "HELP_WORKLIST_EDITOR", N_("Worklist Editor"), 0, 0,
420 G_CALLBACK(help_worklist_editor_callback), MGROUP_SAFE },
421 { "HELP_LANGUAGES", N_("Languages"), 0, 0,
422 G_CALLBACK(help_language_callback), MGROUP_SAFE },
423 { "HELP_COPYING", N_("Copying"), 0, 0,
424 G_CALLBACK(help_copying_callback), MGROUP_SAFE },
425 { "HELP_ABOUT", N_("About Freeciv"), 0, 0,
426 G_CALLBACK(help_about_callback), MGROUP_SAFE },
427 { "SAVE_OPTIONS_ON_EXIT", N_("Save Options on _Exit"), 0, 0,
428 G_CALLBACK(save_options_on_exit_callback), MGROUP_SAFE },
429 { "EDIT_MODE", N_("_Editing Mode"), GDK_KEY_e, GDK_CONTROL_MASK,
430 G_CALLBACK(edit_mode_callback), MGROUP_SAFE },
431 { "SHOW_CITY_OUTLINES", N_("Cit_y Outlines"), GDK_KEY_y, GDK_CONTROL_MASK,
432 G_CALLBACK(show_city_outlines_callback), MGROUP_SAFE },
433 { "SHOW_CITY_OUTPUT", N_("City Output"), GDK_KEY_v, GDK_CONTROL_MASK,
434 G_CALLBACK(show_city_output_callback), MGROUP_SAFE },
435 { "SHOW_MAP_GRID", N_("Map _Grid"), GDK_KEY_g, GDK_CONTROL_MASK,
436 G_CALLBACK(show_map_grid_callback), MGROUP_SAFE },
437 { "SHOW_NATIONAL_BORDERS", N_("National _Borders"), GDK_KEY_b, GDK_CONTROL_MASK,
438 G_CALLBACK(show_national_borders_callback), MGROUP_SAFE },
439 { "SHOW_NATIVE_TILES", N_("Native Tiles"), GDK_KEY_n, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
440 G_CALLBACK(show_native_tiles_callback), MGROUP_SAFE },
441 { "SHOW_CITY_FULL_BAR", N_("City Full Bar"), 0, 0,
442 G_CALLBACK(show_city_full_bar_callback), MGROUP_SAFE },
443 { "SHOW_CITY_NAMES", N_("City _Names"), GDK_KEY_n, GDK_CONTROL_MASK,
444 G_CALLBACK(show_city_names_callback), MGROUP_SAFE },
445 { "SHOW_CITY_GROWTH", N_("City G_rowth"), GDK_KEY_o, GDK_CONTROL_MASK,
446 G_CALLBACK(show_city_growth_callback), MGROUP_SAFE },
447 { "SHOW_CITY_PRODUCTIONS", N_("City _Production"), GDK_KEY_p, GDK_CONTROL_MASK,
448 G_CALLBACK(show_city_productions_callback), MGROUP_SAFE },
449 { "SHOW_CITY_BUY_COST", N_("City Buy Cost"), 0, 0,
450 G_CALLBACK(show_city_buy_cost_callback), MGROUP_SAFE },
451 { "SHOW_CITY_TRADE_ROUTES", N_("City Tra_deroutes"), GDK_KEY_d, GDK_CONTROL_MASK,
452 G_CALLBACK(show_city_trade_routes_callback), MGROUP_SAFE },
453 { "SHOW_TERRAIN", N_("_Terrain"), 0, 0,
454 G_CALLBACK(show_terrain_callback), MGROUP_SAFE },
455 { "SHOW_COASTLINE", N_("C_oastline"), 0, 0,
456 G_CALLBACK(show_coastline_callback), MGROUP_SAFE },
457 { "SHOW_PATHS", N_("_Paths"), 0, 0,
458 G_CALLBACK(show_road_rails_callback), MGROUP_SAFE },
459 { "SHOW_IRRIGATION", N_("_Irrigation"), 0, 0,
460 G_CALLBACK(show_irrigation_callback), MGROUP_SAFE },
461 { "SHOW_MINES", N_("_Mines"), 0, 0,
462 G_CALLBACK(show_mine_callback), MGROUP_SAFE },
463 { "SHOW_BASES", N_("_Bases"), 0, 0,
464 G_CALLBACK(show_bases_callback), MGROUP_SAFE },
465 { "SHOW_RESOURCES", N_("_Resources"), 0, 0,
466 G_CALLBACK(show_resources_callback), MGROUP_SAFE },
467 { "SHOW_HUTS", N_("_Huts"), 0, 0,
468 G_CALLBACK(show_huts_callback), MGROUP_SAFE },
469 { "SHOW_POLLUTION", N_("Po_llution & Fallout"), 0, 0,
470 G_CALLBACK(show_pollution_callback), MGROUP_SAFE },
471 { "SHOW_CITIES", N_("Citi_es"), 0, 0,
472 G_CALLBACK(show_cities_callback), MGROUP_SAFE },
473 { "SHOW_UNITS", N_("_Units"), 0, 0,
474 G_CALLBACK(show_units_callback), MGROUP_SAFE },
475 { "SHOW_UNIT_SOLID_BG", N_("Unit Solid Background"), 0, 0,
476 G_CALLBACK(show_unit_solid_bg_callback), MGROUP_SAFE },
477 { "SHOW_UNIT_SHIELDS", N_("Unit shields"), 0, 0,
478 G_CALLBACK(show_unit_shields_callback), MGROUP_SAFE },
479 { "SHOW_STACK_SIZE", N_("Unit Stack Size"),
480 GDK_KEY_plus, GDK_CONTROL_MASK,
481 G_CALLBACK(show_stack_size_callback), MGROUP_SAFE },
482 { "SHOW_FOCUS_UNIT", N_("Focu_s Unit"), 0, 0,
483 G_CALLBACK(show_focus_unit_callback), MGROUP_SAFE },
484 { "SHOW_FOG_OF_WAR", N_("Fog of _War"), 0, 0,
485 G_CALLBACK(show_fog_of_war_callback), MGROUP_SAFE },
486 { "FULL_SCREEN", N_("_Fullscreen"), GDK_KEY_Return, GDK_MOD1_MASK,
487 G_CALLBACK(full_screen_callback), MGROUP_SAFE },
488
489 { "RECALC_BORDERS", N_("Recalculate _Borders"), 0, 0,
490 G_CALLBACK(recalc_borders_callback), MGROUP_EDIT },
491 { "TOGGLE_FOG", N_("Toggle Fog of _War"), GDK_KEY_w,
492 GDK_CONTROL_MASK | GDK_SHIFT_MASK,
493 G_CALLBACK(toggle_fog_callback), MGROUP_EDIT },
494 { "SCENARIO_PROPERTIES", N_("Game/Scenario Properties"), 0, 0,
495 G_CALLBACK(scenario_properties_callback), MGROUP_EDIT },
496 { "SAVE_SCENARIO", N_("Save Scenario"), 0, 0,
497 G_CALLBACK(save_scenario_callback), MGROUP_EDIT },
498
499 { "CENTER_VIEW", N_("_Center View"), GDK_KEY_c, 0,
500 G_CALLBACK(center_view_callback), MGROUP_PLAYER },
501 { "REPORT_ECONOMY", N_("_Economy"), GDK_KEY_F5, 0,
502 G_CALLBACK(report_economy_callback), MGROUP_PLAYER },
503 { "REPORT_RESEARCH", N_("_Research"), GDK_KEY_F6, 0,
504 G_CALLBACK(report_research_callback), MGROUP_PLAYER },
505 { "POLICIES", N_("_Policies..."),
506 GDK_KEY_p, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
507 G_CALLBACK(multiplier_callback), MGROUP_PLAYER },
508 { "REPORT_SPACESHIP", N_("_Spaceship"), GDK_KEY_F12, 0,
509 G_CALLBACK(report_spaceship_callback), MGROUP_PLAYER },
510 { "REPORT_ACHIEVEMENTS", N_("_Achievements"), GDK_KEY_asterisk, 0,
511 G_CALLBACK(report_achievements_callback), MGROUP_PLAYER },
512
513 { "MENU_SELECT", N_("_Select"), 0, 0, NULL, MGROUP_UNIT },
514 { "MENU_UNIT", N_("_Unit"), 0, 0, NULL, MGROUP_UNIT },
515 { "MENU_WORK", N_("_Work"), 0, 0, NULL, MGROUP_UNIT },
516 { "MENU_COMBAT", N_("_Combat"), 0, 0, NULL, MGROUP_UNIT },
517 { "MENU_BUILD_BASE", N_("Build _Base"), 0, 0, NULL, MGROUP_UNIT },
518 { "MENU_BUILD_PATH", N_("Build _Path"), 0, 0, NULL, MGROUP_UNIT },
519 { "SELECT_SINGLE", N_("_Single Unit (Unselect Others)"), GDK_KEY_z, 0,
520 G_CALLBACK(select_single_callback), MGROUP_UNIT },
521 { "SELECT_ALL_ON_TILE", N_("_All On Tile"), GDK_KEY_v, 0,
522 G_CALLBACK(select_all_on_tile_callback), MGROUP_UNIT },
523 { "SELECT_SAME_TYPE_TILE", N_("Same Type on _Tile"),
524 GDK_KEY_v, GDK_SHIFT_MASK,
525 G_CALLBACK(select_same_type_tile_callback), MGROUP_UNIT },
526 { "SELECT_SAME_TYPE_CONT", N_("Same Type on _Continent"),
527 GDK_KEY_c, GDK_SHIFT_MASK,
528 G_CALLBACK(select_same_type_cont_callback), MGROUP_UNIT },
529 { "SELECT_SAME_TYPE", N_("Same Type _Everywhere"), GDK_KEY_x, GDK_SHIFT_MASK,
530 G_CALLBACK(select_same_type_callback), MGROUP_UNIT },
531 { "SELECT_DLG", N_("Unit Selection Dialog"), 0, 0,
532 G_CALLBACK(select_dialog_callback), MGROUP_UNIT },
533 { "UNIT_WAIT", N_("_Wait"), GDK_KEY_w, 0,
534 G_CALLBACK(unit_wait_callback), MGROUP_UNIT },
535 { "UNIT_DONE", N_("_Done"), GDK_KEY_space, 0,
536 G_CALLBACK(unit_done_callback), MGROUP_UNIT },
537 { "UNIT_GOTO", N_("_Go to"), GDK_KEY_g, 0,
538 G_CALLBACK(unit_goto_callback), MGROUP_UNIT },
539 { "MENU_GOTO_AND", N_("Go to a_nd..."), 0, 0, NULL, MGROUP_UNIT },
540 { "UNIT_GOTO_CITY", N_("Go _to/Airlift to City..."), GDK_KEY_t, 0,
541 G_CALLBACK(unit_goto_city_callback), MGROUP_UNIT },
542 { "UNIT_RETURN", N_("_Return to Nearest City"), GDK_KEY_g, GDK_SHIFT_MASK,
543 G_CALLBACK(unit_return_callback), MGROUP_UNIT },
544 { "UNIT_EXPLORE", N_("Auto E_xplore"), GDK_KEY_x, 0,
545 G_CALLBACK(unit_explore_callback), MGROUP_UNIT },
546 { "UNIT_PATROL", N_("_Patrol"), GDK_KEY_q, 0,
547 G_CALLBACK(unit_patrol_callback), MGROUP_UNIT },
548 { "UNIT_SENTRY", N_("_Sentry"), GDK_KEY_s, 0,
549 G_CALLBACK(unit_sentry_callback), MGROUP_UNIT },
550 { "UNIT_UNSENTRY", N_("Uns_entry All On Tile"), GDK_KEY_s, GDK_SHIFT_MASK,
551 G_CALLBACK(unit_unsentry_callback), MGROUP_UNIT },
552 { "UNIT_BOARD", N_("_Load"), GDK_KEY_l, 0,
553 G_CALLBACK(unit_board_callback), MGROUP_UNIT },
554 { "UNIT_DEBOARD", N_("_Unload"), GDK_KEY_u, 0,
555 G_CALLBACK(unit_deboard_callback), MGROUP_UNIT },
556 { "UNIT_UNLOAD_TRANSPORTER", N_("U_nload All From Transporter"),
557 GDK_KEY_t, GDK_SHIFT_MASK,
558 G_CALLBACK(unit_unload_transporter_callback), MGROUP_UNIT },
559 { "UNIT_HOMECITY", N_("Set _Home City"), GDK_KEY_h, 0,
560 G_CALLBACK(unit_homecity_callback), MGROUP_UNIT },
561 { "UNIT_UPGRADE", N_("Upgr_ade"), GDK_KEY_u, GDK_SHIFT_MASK,
562 G_CALLBACK(unit_upgrade_callback), MGROUP_UNIT },
563 { "UNIT_CONVERT", N_("C_onvert"), GDK_KEY_o, GDK_SHIFT_MASK,
564 G_CALLBACK(unit_convert_callback), MGROUP_UNIT },
565 { "UNIT_DISBAND", N_("_Disband"), GDK_KEY_d, GDK_SHIFT_MASK,
566 G_CALLBACK(unit_disband_callback), MGROUP_UNIT },
567 { "BUILD_CITY", N_("_Build City"), GDK_KEY_b, 0,
568 G_CALLBACK(build_city_callback), MGROUP_UNIT },
569 { "AUTO_SETTLER", N_("_Auto Settler"), GDK_KEY_a, 0,
570 G_CALLBACK(auto_settle_callback), MGROUP_UNIT },
571 { "BUILD_ROAD", N_("Build _Road"), GDK_KEY_r, 0,
572 G_CALLBACK(build_road_callback), MGROUP_UNIT },
573 { "BUILD_IRRIGATION", N_("Build _Irrigation"), GDK_KEY_i, 0,
574 G_CALLBACK(build_irrigation_callback), MGROUP_UNIT },
575 { "CULTIVATE", N_("Cultivate"), GDK_KEY_i, GDK_SHIFT_MASK,
576 G_CALLBACK(cultivate_callback), MGROUP_UNIT },
577 { "BUILD_MINE", N_("Build _Mine"), GDK_KEY_m, 0,
578 G_CALLBACK(build_mine_callback), MGROUP_UNIT },
579 { "PLANT", N_("Plant"), GDK_KEY_m, GDK_SHIFT_MASK,
580 G_CALLBACK(plant_callback), MGROUP_UNIT },
581 { "CONNECT_ROAD", N_("Connect With Roa_d"), GDK_KEY_r, GDK_CONTROL_MASK,
582 G_CALLBACK(connect_road_callback), MGROUP_UNIT },
583 { "CONNECT_RAIL", N_("Connect With Rai_l"), GDK_KEY_l, GDK_CONTROL_MASK,
584 G_CALLBACK(connect_rail_callback), MGROUP_UNIT },
585 { "CONNECT_MAGLEV", N_("Connect With _Maglev"), GDK_KEY_m, GDK_CONTROL_MASK,
586 G_CALLBACK(connect_maglev_callback), MGROUP_UNIT },
587 { "CONNECT_IRRIGATION", N_("Connect With Irri_gation"),
588 GDK_KEY_i, GDK_CONTROL_MASK,
589 G_CALLBACK(connect_irrigation_callback), MGROUP_UNIT },
590 { "TRANSFORM_TERRAIN", N_("Transf_orm Terrain"), GDK_KEY_o, 0,
591 G_CALLBACK(transform_terrain_callback), MGROUP_UNIT },
592 { "CLEAN_POLLUTION", N_("Clean _Pollution"), GDK_KEY_p, 0,
593 G_CALLBACK(clean_pollution_callback), MGROUP_UNIT },
594 { "CLEAN_FALLOUT", N_("Clean _Nuclear Fallout"), GDK_KEY_n, 0,
595 G_CALLBACK(clean_fallout_callback), MGROUP_UNIT },
596 { "FORTIFY", N_("Fortify"), GDK_KEY_f, 0,
597 G_CALLBACK(fortify_callback), MGROUP_UNIT },
598 { "BUILD_FORTRESS", N_("Build Fortress"), GDK_KEY_f, GDK_SHIFT_MASK,
599 G_CALLBACK(build_fortress_callback), MGROUP_UNIT },
600 { "BUILD_AIRBASE", N_("Build Airbase"), GDK_KEY_e, GDK_SHIFT_MASK,
601 G_CALLBACK(build_airbase_callback), MGROUP_UNIT },
602 { "DO_PARADROP", N_("P_aradrop"), GDK_KEY_j, 0,
603 G_CALLBACK(do_paradrop_callback), MGROUP_UNIT },
604 { "DO_PILLAGE", N_("_Pillage"), GDK_KEY_p, GDK_SHIFT_MASK,
605 G_CALLBACK(do_pillage_callback), MGROUP_UNIT },
606 { "DIPLOMAT_ACTION", N_("_Do..."), GDK_KEY_d, 0,
607 G_CALLBACK(diplomat_action_callback), MGROUP_UNIT },
608
609 { "MENU_GOVERNMENT", N_("_Government"), 0, 0,
610 NULL, MGROUP_PLAYING },
611 { "TAX_RATE", N_("_Tax Rates..."), GDK_KEY_t, GDK_CONTROL_MASK,
612 G_CALLBACK(tax_rate_callback), MGROUP_PLAYING },
613 { "START_REVOLUTION", N_("_Revolution..."),
614 GDK_KEY_g, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
615 G_CALLBACK(government_callback), MGROUP_PLAYING },
616 { NULL }
617};
618
619static struct menu_entry_info *menu_entry_info_find(const char *key);
620
621/************************************************************************/
624 static void clear_chat_logs_callback(GtkMenuItem *item, gpointer data)
625{
626 clear_output_window();
627}
628
629/************************************************************************/
632 static void save_chat_logs_callback(GtkMenuItem *item, gpointer data)
633{
634 log_output_window();
635}
636
637/************************************************************************/
640 static void local_options_callback(GtkMenuItem *item, gpointer data)
641{
642 option_dialog_popup(_("Set local options"), client_optset);
643}
644
645/************************************************************************/
648 static void message_options_callback(GtkMenuItem *item, gpointer data)
649{
650 popup_messageopt_dialog();
651}
652
653/************************************************************************/
656 static void server_options_callback(GtkMenuItem *item, gpointer data)
657{
658 option_dialog_popup(_("Game Settings"), server_optset);
659}
660
661/************************************************************************/
664 static void save_options_callback(GtkMenuItem *item, gpointer data)
665{
666 options_save(NULL);
667}
668
669/************************************************************************/
672 static void reload_tileset_callback(GtkMenuItem *item, gpointer data)
673{
674 tilespec_reread(NULL, TRUE, 1.0);
675}
676
677/************************************************************************/
680 static void save_game_callback(GtkMenuItem *item, gpointer data)
681{
682 send_save_game(NULL);
683}
684
685/************************************************************************/
688 static void save_game_as_callback(GtkMenuItem *item, gpointer data)
689{
690 save_game_dialog_popup();
691}
692
693/************************************************************************/
696 static void save_mapimg_callback(GtkMenuItem *item, gpointer data)
697{
698 mapimg_client_save(NULL);
699}
700
701/************************************************************************/
704 static void save_mapimg_as_callback(GtkMenuItem *item, gpointer data)
705{
706 save_mapimg_dialog_popup();
707}
708
709/************************************************************************/
713 static void leave_local_game_response(GtkWidget *dialog, gint response)
714{
715 gtk_widget_destroy(dialog);
716 if (response == GTK_RESPONSE_OK) {
717 /* It might be killed already */
718 if (client.conn.used) {
719 /* It will also kill the server */
720 disconnect_from_server();
721 }
722 }
723}
724
725/************************************************************************/
728 static void leave_callback(GtkMenuItem *item, gpointer data)
729{
730 if (is_server_running()) {
731 GtkWidget* dialog =
732 gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_WARNING,
733 GTK_BUTTONS_OK_CANCEL,
734 _("Leaving a local game will end it!"));
735 setup_dialog(dialog, toplevel);
736 gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE);
737 g_signal_connect(dialog, "response",
738 G_CALLBACK(leave_local_game_response), NULL);
739 gtk_window_present(GTK_WINDOW(dialog));
740 } else {
741 disconnect_from_server();
742 }
743}
744
745/************************************************************************/
748 static void quit_callback(GtkMenuItem *item, gpointer data)
749{
750 popup_quit_dialog();
751}
752
753/************************************************************************/
756 static void find_city_callback(GtkMenuItem *item, gpointer data)
757{
758 popup_find_dialog();
759}
760
761/************************************************************************/
764 static void worklists_callback(GtkMenuItem *item, gpointer data)
765{
766 popup_worklists_report();
767}
768
769/************************************************************************/
772 static void map_view_callback(GtkMenuItem *item, gpointer data)
773{
774 map_canvas_focus();
775}
776
777/************************************************************************/
780 static void report_nations_callback(GtkMenuItem *item, gpointer data)
781{
782 popup_players_dialog(TRUE);
783}
784
785/************************************************************************/
788 static void report_wow_callback(GtkMenuItem *item, gpointer data)
789{
790 send_report_request(REPORT_WONDERS_OF_THE_WORLD);
791}
792
793/************************************************************************/
796 static void report_top_cities_callback(GtkMenuItem *item, gpointer data)
797{
798 send_report_request(REPORT_TOP_5_CITIES);
799}
800
801/************************************************************************/
804 static void report_messages_callback(GtkMenuItem *item, gpointer data)
805{
806 meswin_dialog_popup(TRUE);
807}
808
809/************************************************************************/
812 static void client_lua_script_callback(GtkMenuItem *item, gpointer data)
813{
814 luaconsole_dialog_popup(TRUE);
815}
816
817/************************************************************************/
820 static void report_demographic_callback(GtkMenuItem *item, gpointer data)
821{
822 send_report_request(REPORT_DEMOGRAPHIC);
823}
824
825/************************************************************************/
828 static void report_achievements_callback(GtkMenuItem *item, gpointer data)
829{
830 send_report_request(REPORT_ACHIEVEMENTS);
831}
832
833/************************************************************************/
836 static void help_language_callback(GtkMenuItem *item, gpointer data)
837{
838 popup_help_dialog_string(HELP_LANGUAGES_ITEM);
839}
840
841/************************************************************************/
844 static void help_policies_callback(GtkMenuItem *item, gpointer data)
845{
846 popup_help_dialog_string(HELP_MULTIPLIER_ITEM);
847}
848
849/************************************************************************/
852 static void help_connecting_callback(GtkMenuItem *item, gpointer data)
853{
854 popup_help_dialog_string(HELP_CONNECTING_ITEM);
855}
856
857/************************************************************************/
860 static void help_controls_callback(GtkMenuItem *item, gpointer data)
861{
862 popup_help_dialog_string(HELP_CONTROLS_ITEM);
863}
864
865/************************************************************************/
868 static void help_chatline_callback(GtkMenuItem *item, gpointer data)
869{
870 popup_help_dialog_string(HELP_CHATLINE_ITEM);
871}
872
873/************************************************************************/
876 static void help_worklist_editor_callback(GtkMenuItem *item, gpointer data)
877{
878 popup_help_dialog_string(HELP_WORKLIST_EDITOR_ITEM);
879}
880
881/************************************************************************/
884 static void help_cma_callback(GtkMenuItem *item, gpointer data)
885{
886 popup_help_dialog_string(HELP_CMA_ITEM);
887}
888
889/************************************************************************/
892 static void bg_select0_callback(GtkMenuItem *item, gpointer data)
893{
894 key_unit_select_battlegroup(0, FALSE);
895}
896
897/************************************************************************/
900 static void bg_assign0_callback(GtkMenuItem *item, gpointer data)
901{
902 key_unit_assign_battlegroup(0, FALSE);
903}
904
905/************************************************************************/
908 static void bg_append0_callback(GtkMenuItem *item, gpointer data)
909{
910 key_unit_assign_battlegroup(0, TRUE);
911}
912
913/************************************************************************/
916 static void bg_select1_callback(GtkMenuItem *item, gpointer data)
917{
918 key_unit_select_battlegroup(1, FALSE);
919}
920
921/************************************************************************/
924 static void bg_assign1_callback(GtkMenuItem *item, gpointer data)
925{
926 key_unit_assign_battlegroup(1, FALSE);
927}
928
929/************************************************************************/
932 static void bg_append1_callback(GtkMenuItem *item, gpointer data)
933{
934 key_unit_assign_battlegroup(1, TRUE);
935}
936
937/************************************************************************/
940 static void bg_select2_callback(GtkMenuItem *item, gpointer data)
941{
942 key_unit_select_battlegroup(2, FALSE);
943}
944
945/************************************************************************/
948 static void bg_assign2_callback(GtkMenuItem *item, gpointer data)
949{
950 key_unit_assign_battlegroup(2, FALSE);
951}
952
953/************************************************************************/
956 static void bg_append2_callback(GtkMenuItem *item, gpointer data)
957{
958 key_unit_assign_battlegroup(2, TRUE);
959}
960
961/************************************************************************/
964 static void bg_select3_callback(GtkMenuItem *item, gpointer data)
965{
966 key_unit_select_battlegroup(3, FALSE);
967}
968
969/************************************************************************/
972 static void bg_assign3_callback(GtkMenuItem *item, gpointer data)
973{
974 key_unit_assign_battlegroup(3, FALSE);
975}
976
977/************************************************************************/
980 static void bg_append3_callback(GtkMenuItem *item, gpointer data)
981{
982 key_unit_assign_battlegroup(3, TRUE);
983}
984
985/************************************************************************/
988 static void help_overview_callback(GtkMenuItem *item, gpointer data)
989{
990 popup_help_dialog_string(HELP_OVERVIEW_ITEM);
991}
992
993/************************************************************************/
996 static void help_playing_callback(GtkMenuItem *item, gpointer data)
997{
998 popup_help_dialog_string(HELP_PLAYING_ITEM);
999}
1000
1001/************************************************************************/
1004 static void help_ruleset_callback(GtkMenuItem *item, gpointer data)
1005{
1006 popup_help_dialog_string(HELP_RULESET_ITEM);
1007}
1008
1009/************************************************************************/
1012 static void help_tileset_callback(GtkMenuItem *item, gpointer data)
1013{
1014 popup_help_dialog_string(HELP_TILESET_ITEM);
1015}
1016
1017/************************************************************************/
1020 static void help_economy_callback(GtkMenuItem *item, gpointer data)
1021{
1022 popup_help_dialog_string(HELP_ECONOMY_ITEM);
1023}
1024
1025/************************************************************************/
1028 static void help_cities_callback(GtkMenuItem *item, gpointer data)
1029{
1030 popup_help_dialog_string(HELP_CITIES_ITEM);
1031}
1032
1033/************************************************************************/
1036 static void help_improvements_callback(GtkMenuItem *item, gpointer data)
1037{
1038 popup_help_dialog_string(HELP_IMPROVEMENTS_ITEM);
1039}
1040
1041/************************************************************************/
1044 static void help_units_callback(GtkMenuItem *item, gpointer data)
1045{
1046 popup_help_dialog_string(HELP_UNITS_ITEM);
1047}
1048
1049/************************************************************************/
1052 static void help_combat_callback(GtkMenuItem *item, gpointer data)
1053{
1054 popup_help_dialog_string(HELP_COMBAT_ITEM);
1055}
1056
1057/************************************************************************/
1060 static void help_zoc_callback(GtkMenuItem *item, gpointer data)
1061{
1062 popup_help_dialog_string(HELP_ZOC_ITEM);
1063}
1064
1065/************************************************************************/
1068 static void help_tech_callback(GtkMenuItem *item, gpointer data)
1069{
1070 popup_help_dialog_string(HELP_TECHS_ITEM);
1071}
1072
1073/************************************************************************/
1076 static void help_terrain_callback(GtkMenuItem *item, gpointer data)
1077{
1078 popup_help_dialog_string(HELP_TERRAIN_ITEM);
1079}
1080
1081/************************************************************************/
1084 static void help_wonders_callback(GtkMenuItem *item, gpointer data)
1085{
1086 popup_help_dialog_string(HELP_WONDERS_ITEM);
1087}
1088
1089/************************************************************************/
1092 static void help_government_callback(GtkMenuItem *item, gpointer data)
1093{
1094 popup_help_dialog_string(HELP_GOVERNMENT_ITEM);
1095}
1096
1097/************************************************************************/
1100 static void help_diplomacy_callback(GtkMenuItem *item, gpointer data)
1101{
1102 popup_help_dialog_string(HELP_DIPLOMACY_ITEM);
1103}
1104
1105/************************************************************************/
1108 static void help_space_race_callback(GtkMenuItem *item, gpointer data)
1109{
1110 popup_help_dialog_string(HELP_SPACE_RACE_ITEM);
1111}
1112
1113/************************************************************************/
1116 static void help_nations_callback(GtkMenuItem *item, gpointer data)
1117{
1118 popup_help_dialog_string(HELP_NATIONS_ITEM);
1119}
1120
1121/************************************************************************/
1124 static void help_copying_callback(GtkMenuItem *item, gpointer data)
1125{
1126 popup_help_dialog_string(HELP_COPYING_ITEM);
1127}
1128
1129/************************************************************************/
1132 static void help_about_callback(GtkMenuItem *item, gpointer data)
1133{
1134 popup_help_dialog_string(HELP_ABOUT_ITEM);
1135}
1136
1137/************************************************************************/
1140 static void save_options_on_exit_callback(GtkCheckMenuItem *item,
1141 gpointer data)
1142{
1143 gui_options.save_options_on_exit = gtk_check_menu_item_get_active(item);
1144}
1145
1146/************************************************************************/
1149 static void edit_mode_callback(GtkCheckMenuItem *item, gpointer data)
1150{
1151 if (game.info.is_edit_mode ^ gtk_check_menu_item_get_active(item)) {
1152 key_editor_toggle();
1153 /* Unreachable techs in reqtree on/off */
1154 science_report_dialog_popdown();
1155 }
1156}
1157
1158/************************************************************************/
1161 static void show_city_outlines_callback(GtkCheckMenuItem *item,
1162 gpointer data)
1163{
1164 if (gui_options.draw_city_outlines ^ gtk_check_menu_item_get_active(item)) {
1165 key_city_outlines_toggle();
1166 }
1167}
1168
1169/************************************************************************/
1172 static void show_city_output_callback(GtkCheckMenuItem *item,
1173 gpointer data)
1174{
1175 if (gui_options.draw_city_output ^ gtk_check_menu_item_get_active(item)) {
1176 key_city_output_toggle();
1177 }
1178}
1179
1180/************************************************************************/
1183 static void show_map_grid_callback(GtkCheckMenuItem *item,
1184 gpointer data)
1185{
1186 if (gui_options.draw_map_grid ^ gtk_check_menu_item_get_active(item)) {
1187 key_map_grid_toggle();
1188 }
1189}
1190
1191/************************************************************************/
1194 static void show_national_borders_callback(GtkCheckMenuItem *item,
1195 gpointer data)
1196{
1197 if (gui_options.draw_borders ^ gtk_check_menu_item_get_active(item)) {
1198 key_map_borders_toggle();
1199 }
1200}
1201
1202/************************************************************************/
1205 static void show_native_tiles_callback(GtkCheckMenuItem *item,
1206 gpointer data)
1207{
1208 if (gui_options.draw_native ^ gtk_check_menu_item_get_active(item)) {
1209 key_map_native_toggle();
1210 }
1211}
1212
1213/************************************************************************/
1216 static void show_city_full_bar_callback(GtkCheckMenuItem *item,
1217 gpointer data)
1218{
1219 if (gui_options.draw_full_citybar ^ gtk_check_menu_item_get_active(item)) {
1220 key_city_full_bar_toggle();
1221 view_menu_update_sensitivity();
1222 }
1223}
1224
1225/************************************************************************/
1228 static void show_city_names_callback(GtkCheckMenuItem *item,
1229 gpointer data)
1230{
1231 if (gui_options.draw_city_names ^ gtk_check_menu_item_get_active(item)) {
1232 key_city_names_toggle();
1233 view_menu_update_sensitivity();
1234 }
1235}
1236
1237/************************************************************************/
1240 static void show_city_growth_callback(GtkCheckMenuItem *item,
1241 gpointer data)
1242{
1243 if (gui_options.draw_city_growth ^ gtk_check_menu_item_get_active(item)) {
1244 key_city_growth_toggle();
1245 }
1246}
1247
1248/************************************************************************/
1251 static void show_city_productions_callback(GtkCheckMenuItem *item,
1252 gpointer data)
1253{
1254 if (gui_options.draw_city_productions ^ gtk_check_menu_item_get_active(item)) {
1255 key_city_productions_toggle();
1256 view_menu_update_sensitivity();
1257 }
1258}
1259
1260/************************************************************************/
1263 static void show_city_buy_cost_callback(GtkCheckMenuItem *item,
1264 gpointer data)
1265{
1266 if (gui_options.draw_city_buycost ^ gtk_check_menu_item_get_active(item)) {
1267 key_city_buycost_toggle();
1268 }
1269}
1270
1271/************************************************************************/
1274 static void show_city_trade_routes_callback(GtkCheckMenuItem *item,
1275 gpointer data)
1276{
1277 if (gui_options.draw_city_trade_routes ^ gtk_check_menu_item_get_active(item)) {
1278 key_city_trade_routes_toggle();
1279 }
1280}
1281
1282/************************************************************************/
1285 static void show_terrain_callback(GtkCheckMenuItem *item, gpointer data)
1286{
1287 if (gui_options.draw_terrain ^ gtk_check_menu_item_get_active(item)) {
1288 key_terrain_toggle();
1289 view_menu_update_sensitivity();
1290 }
1291}
1292
1293/************************************************************************/
1296 static void show_coastline_callback(GtkCheckMenuItem *item, gpointer data)
1297{
1298 if (gui_options.draw_coastline ^ gtk_check_menu_item_get_active(item)) {
1299 key_coastline_toggle();
1300 }
1301}
1302
1303/************************************************************************/
1306 static void show_road_rails_callback(GtkCheckMenuItem *item, gpointer data)
1307{
1308 if (gui_options.draw_roads_rails ^ gtk_check_menu_item_get_active(item)) {
1309 key_roads_rails_toggle();
1310 }
1311}
1312
1313/************************************************************************/
1316 static void show_irrigation_callback(GtkCheckMenuItem *item, gpointer data)
1317{
1318 if (gui_options.draw_irrigation ^ gtk_check_menu_item_get_active(item)) {
1319 key_irrigation_toggle();
1320 }
1321}
1322
1323/************************************************************************/
1326 static void show_mine_callback(GtkCheckMenuItem *item, gpointer data)
1327{
1328 if (gui_options.draw_mines ^ gtk_check_menu_item_get_active(item)) {
1329 key_mines_toggle();
1330 }
1331}
1332
1333/************************************************************************/
1336 static void show_bases_callback(GtkCheckMenuItem *item, gpointer data)
1337{
1338 if (gui_options.draw_fortress_airbase ^ gtk_check_menu_item_get_active(item)) {
1339 key_bases_toggle();
1340 }
1341}
1342
1343/************************************************************************/
1346 static void show_resources_callback(GtkCheckMenuItem *item, gpointer data)
1347{
1348 if (gui_options.draw_specials ^ gtk_check_menu_item_get_active(item)) {
1349 key_resources_toggle();
1350 }
1351}
1352
1353/************************************************************************/
1356 static void show_huts_callback(GtkCheckMenuItem *item, gpointer data)
1357{
1358 if (gui_options.draw_huts ^ gtk_check_menu_item_get_active(item)) {
1359 key_huts_toggle();
1360 }
1361}
1362
1363/************************************************************************/
1366 static void show_pollution_callback(GtkCheckMenuItem *item, gpointer data)
1367{
1368 if (gui_options.draw_pollution ^ gtk_check_menu_item_get_active(item)) {
1369 key_pollution_toggle();
1370 }
1371}
1372
1373/************************************************************************/
1376 static void show_cities_callback(GtkCheckMenuItem *item, gpointer data)
1377{
1378 if (gui_options.draw_cities ^ gtk_check_menu_item_get_active(item)) {
1379 key_cities_toggle();
1380 }
1381}
1382
1383/************************************************************************/
1386 static void show_units_callback(GtkCheckMenuItem *item, gpointer data)
1387{
1388 if (gui_options.draw_units ^ gtk_check_menu_item_get_active(item)) {
1389 key_units_toggle();
1390 view_menu_update_sensitivity();
1391 }
1392}
1393
1394/************************************************************************/
1397 static void show_unit_solid_bg_callback(GtkCheckMenuItem *item,
1398 gpointer data)
1399{
1400 if (gui_options.solid_color_behind_units ^ gtk_check_menu_item_get_active(item)) {
1401 key_unit_solid_bg_toggle();
1402 }
1403}
1404
1405/************************************************************************/
1408 static void show_unit_shields_callback(GtkCheckMenuItem *item,
1409 gpointer data)
1410{
1411 if (gui_options.draw_unit_shields ^ gtk_check_menu_item_get_active(item)) {
1412 key_unit_shields_toggle();
1413 }
1414}
1415
1416/************************************************************************/
1419 static void show_stack_size_callback(GtkCheckMenuItem *item,
1420 gpointer data)
1421{
1422 if (gui_options.draw_unit_stack_size ^ gtk_check_menu_item_get_active(item)) {
1423 key_unit_stack_size_toggle();
1424 }
1425}
1426
1427/************************************************************************/
1430 static void show_focus_unit_callback(GtkCheckMenuItem *item, gpointer data)
1431{
1432 if (gui_options.draw_focus_unit ^ gtk_check_menu_item_get_active(item)) {
1433 key_focus_unit_toggle();
1434 view_menu_update_sensitivity();
1435 }
1436}
1437
1438/************************************************************************/
1441 static void show_fog_of_war_callback(GtkCheckMenuItem *item, gpointer data)
1442{
1443 if (gui_options.draw_fog_of_war ^ gtk_check_menu_item_get_active(item)) {
1444 key_fog_of_war_toggle();
1445 view_menu_update_sensitivity();
1446 }
1447}
1448
1449/************************************************************************/
1452 static void full_screen_callback(GtkCheckMenuItem *item, gpointer data)
1453{
1454 if (GUI_GTK_OPTION(fullscreen) ^ gtk_check_menu_item_get_active(item)) {
1455 GUI_GTK_OPTION(fullscreen) ^= 1;
1456
1457 fullscreen_opt_refresh(NULL);
1458 }
1459}
1460
1461/************************************************************************/
1464 static void recalc_borders_callback(GtkMenuItem *item, gpointer data)
1465{
1466 key_editor_recalculate_borders();
1467}
1468
1469/************************************************************************/
1472 static void toggle_fog_callback(GtkMenuItem *item, gpointer data)
1473{
1474 key_editor_toggle_fogofwar();
1475}
1476
1477/************************************************************************/
1480 static void scenario_properties_callback(GtkMenuItem *item, gpointer data)
1481{
1482 struct property_editor *pe;
1483
1484 pe = editprop_get_property_editor();
1485 property_editor_reload(pe, OBJTYPE_GAME);
1486 property_editor_popup(pe, OBJTYPE_GAME);
1487}
1488
1489/************************************************************************/
1492 static void save_scenario_callback(GtkMenuItem *item, gpointer data)
1493{
1494 save_scenario_dialog_popup();
1495}
1496
1497/************************************************************************/
1500 static void select_single_callback(GtkMenuItem *item, gpointer data)
1501{
1502 request_unit_select(get_units_in_focus(), SELTYPE_SINGLE, SELLOC_TILE);
1503}
1504
1505/************************************************************************/
1508 static void select_all_on_tile_callback(GtkMenuItem *item, gpointer data)
1509{
1510 request_unit_select(get_units_in_focus(), SELTYPE_ALL, SELLOC_TILE);
1511}
1512
1513/************************************************************************/
1516 static void select_same_type_tile_callback(GtkMenuItem *item, gpointer data)
1517{
1518 request_unit_select(get_units_in_focus(), SELTYPE_SAME, SELLOC_TILE);
1519}
1520
1521/************************************************************************/
1524 static void select_same_type_cont_callback(GtkMenuItem *item, gpointer data)
1525{
1526 request_unit_select(get_units_in_focus(), SELTYPE_SAME, SELLOC_CONT);
1527}
1528
1529/************************************************************************/
1532 static void select_same_type_callback(GtkMenuItem *item, gpointer data)
1533{
1534 request_unit_select(get_units_in_focus(), SELTYPE_SAME, SELLOC_WORLD);
1535}
1536
1537/************************************************************************/
1540 static void select_dialog_callback(GtkMenuItem *item, gpointer data)
1541{
1542 unit_select_dialog_popup(NULL);
1543}
1544
1545/************************************************************************/
1548 static void rally_dialog_callback(GtkMenuItem *item, gpointer data)
1549{
1550 rally_dialog_popup();
1551}
1552
1553/************************************************************************/
1556 static void infra_dialog_callback(GtkMenuItem *item, gpointer data)
1557{
1558 infra_dialog_popup();
1559}
1560
1561/************************************************************************/
1564 static void unit_wait_callback(GtkMenuItem *item, gpointer data)
1565{
1566 key_unit_wait();
1567}
1568
1569/************************************************************************/
1572 static void unit_done_callback(GtkMenuItem *item, gpointer data)
1573{
1574 key_unit_done();
1575}
1576
1577/************************************************************************/
1580 static void unit_goto_callback(GtkMenuItem *item, gpointer data)
1581{
1582 key_unit_goto();
1583}
1584
1585/************************************************************************/
1588 static void unit_goto_and_callback(GtkMenuItem *item, gpointer data)
1589{
1590 int sub_target = NO_TARGET;
1591 struct action *paction = g_object_get_data(G_OBJECT(item), "end_action");
1592
1593 fc_assert_ret(paction != NULL);
1594
1595 switch (action_get_sub_target_kind(paction)) {
1596 case ASTK_BUILDING:
1597 {
1598 struct impr_type *pbuilding = g_object_get_data(G_OBJECT(item),
1599 "end_building");
1600 fc_assert_ret(pbuilding != NULL);
1601 sub_target = improvement_number(pbuilding);
1602 }
1603 break;
1604 case ASTK_TECH:
1605 {
1606 struct advance *ptech = g_object_get_data(G_OBJECT(item),
1607 "end_tech");
1608 fc_assert_ret(ptech != NULL);
1609 sub_target = advance_number(ptech);
1610 }
1611 break;
1612 case ASTK_EXTRA:
1613 case ASTK_EXTRA_NOT_THERE:
1614 {
1615 struct extra_type *pextra = g_object_get_data(G_OBJECT(item),
1616 "end_extra");
1617 fc_assert_ret(pextra != NULL);
1618 sub_target = extra_number(pextra);
1619 }
1620 break;
1621 case ASTK_NONE:
1622 sub_target = NO_TARGET;
1623 break;
1624 case ASTK_COUNT:
1625 /* Should not exits */
1626 fc_assert(action_get_sub_target_kind(paction) != ASTK_COUNT);
1627 break;
1628 }
1629
1630 request_unit_goto(ORDER_PERFORM_ACTION, paction->id, sub_target);
1631}
1632
1633/************************************************************************/
1636 static void unit_goto_city_callback(GtkMenuItem *item, gpointer data)
1637{
1638 if (get_num_units_in_focus() > 0) {
1639 popup_goto_dialog();
1640 }
1641}
1642
1643/************************************************************************/
1646 static void unit_return_callback(GtkMenuItem *item, gpointer data)
1647{
1648 unit_list_iterate(get_units_in_focus(), punit) {
1649 request_unit_return(punit);
1650 } unit_list_iterate_end;
1651}
1652
1653/************************************************************************/
1656 static void unit_explore_callback(GtkMenuItem *item, gpointer data)
1657{
1658 key_unit_auto_explore();
1659}
1660
1661/************************************************************************/
1664 static void unit_patrol_callback(GtkMenuItem *item, gpointer data)
1665{
1666 key_unit_patrol();
1667}
1668
1669/************************************************************************/
1672 static void unit_sentry_callback(GtkMenuItem *item, gpointer data)
1673{
1674 key_unit_sentry();
1675}
1676
1677/************************************************************************/
1680 static void unit_unsentry_callback(GtkMenuItem *item, gpointer data)
1681{
1682 key_unit_wakeup_others();
1683}
1684
1685/************************************************************************/
1688 static void unit_board_callback(GtkMenuItem *item, gpointer data)
1689{
1690 unit_list_iterate(get_units_in_focus(), punit) {
1691 request_transport(punit, unit_tile(punit));
1692 } unit_list_iterate_end;
1693}
1694
1695/************************************************************************/
1698 static void unit_deboard_callback(GtkMenuItem *item, gpointer data)
1699{
1700 unit_list_iterate(get_units_in_focus(), punit) {
1701 request_unit_unload(punit);
1702 } unit_list_iterate_end;
1703}
1704
1705/************************************************************************/
1708 static void unit_unload_transporter_callback(GtkMenuItem *item,
1709 gpointer data)
1710{
1711 key_unit_unload_all();
1712}
1713
1714/************************************************************************/
1717 static void unit_homecity_callback(GtkMenuItem *item, gpointer data)
1718{
1719 key_unit_homecity();
1720}
1721
1722/************************************************************************/
1725 static void unit_upgrade_callback(GtkMenuItem *item, gpointer data)
1726{
1727 popup_upgrade_dialog(get_units_in_focus());
1728}
1729
1730/************************************************************************/
1733 static void unit_convert_callback(GtkMenuItem *item, gpointer data)
1734{
1735 key_unit_convert();
1736}
1737
1738/************************************************************************/
1741 static void unit_disband_callback(GtkMenuItem *item, gpointer data)
1742{
1743 popup_disband_dialog(get_units_in_focus());
1744}
1745
1746/************************************************************************/
1749 static void build_city_callback(GtkMenuItem *item, gpointer data)
1750{
1751 unit_list_iterate(get_units_in_focus(), punit) {
1752 /* FIXME: this can provide different items for different units...
1753 * not good! */
1754 /* Enable the button for adding to a city in all cases, so we
1755 get an eventual error message from the server if we try. */
1756 if (unit_can_add_or_build_city(punit)) {
1757 request_unit_build_city(punit);
1758 } else if (utype_can_do_action(unit_type_get(punit),
1759 ACTION_HELP_WONDER)) {
1760 request_unit_caravan_action(punit, ACTION_HELP_WONDER);
1761 }
1762 } unit_list_iterate_end;
1763}
1764
1765/************************************************************************/
1768 static void auto_settle_callback(GtkMenuItem *action, gpointer data)
1769{
1770 key_unit_auto_settle();
1771}
1772
1773/************************************************************************/
1776 static void build_road_callback(GtkMenuItem *action, gpointer data)
1777{
1778 unit_list_iterate(get_units_in_focus(), punit) {
1779 /* FIXME: this can provide different actions for different units...
1780 * not good! */
1781 struct extra_type *tgt = next_extra_for_tile(unit_tile(punit),
1782 EC_ROAD,
1783 unit_owner(punit),
1784 punit);
1785 bool building_road = FALSE;
1786
1787 if (tgt != NULL
1788 && can_unit_do_activity_targeted_client(punit, ACTIVITY_GEN_ROAD, tgt)) {
1789 request_new_unit_activity_targeted(punit, ACTIVITY_GEN_ROAD, tgt);
1790 building_road = TRUE;
1791 }
1792
1793 if (!building_road && unit_can_est_trade_route_here(punit)) {
1794 request_unit_caravan_action(punit, ACTION_TRADE_ROUTE);
1795 }
1796 } unit_list_iterate_end;
1797}
1798
1799/************************************************************************/
1802 static void build_irrigation_callback(GtkMenuItem *action, gpointer data)
1803{
1804 key_unit_irrigate();
1805}
1806
1807/************************************************************************/
1810 static void cultivate_callback(GtkMenuItem *action, gpointer data)
1811{
1812 key_unit_cultivate();
1813}
1814
1815/************************************************************************/
1818 static void build_mine_callback(GtkMenuItem *action, gpointer data)
1819{
1820 key_unit_mine();
1821}
1822
1823/************************************************************************/
1826 static void plant_callback(GtkMenuItem *action, gpointer data)
1827{
1828 key_unit_plant();
1829}
1830
1831/************************************************************************/
1834 static void connect_road_callback(GtkMenuItem *action, gpointer data)
1835{
1836 struct road_type *proad = road_by_gui_type(ROAD_GUI_ROAD);
1837
1838 if (proad != NULL) {
1839 struct extra_type *tgt;
1840
1841 tgt = road_extra_get(proad);
1842
1843 key_unit_connect(ACTIVITY_GEN_ROAD, tgt);
1844 }
1845}
1846
1847/************************************************************************/
1850 static void connect_rail_callback(GtkMenuItem *action, gpointer data)
1851{
1852 struct road_type *prail = road_by_gui_type(ROAD_GUI_RAILROAD);
1853
1854 if (prail != NULL) {
1855 struct extra_type *tgt;
1856
1857 tgt = road_extra_get(prail);
1858
1859 key_unit_connect(ACTIVITY_GEN_ROAD, tgt);
1860 }
1861}
1862
1863/************************************************************************/
1866 static void connect_maglev_callback(GtkMenuItem *action, gpointer data)
1867{
1868 struct road_type *pmaglev = road_by_gui_type(ROAD_GUI_MAGLEV);
1869
1870 if (pmaglev != NULL) {
1871 struct extra_type *tgt;
1872
1873 tgt = road_extra_get(pmaglev);
1874
1875 key_unit_connect(ACTIVITY_GEN_ROAD, tgt);
1876 }
1877}
1878
1879/************************************************************************/
1882 static void connect_irrigation_callback(GtkMenuItem *action, gpointer data)
1883{
1884 struct extra_type_list *extras = extra_type_list_by_cause(EC_IRRIGATION);
1885
1886 if (extra_type_list_size(extras) > 0) {
1887 struct extra_type *pextra;
1888
1889 pextra = extra_type_list_get(extra_type_list_by_cause(EC_IRRIGATION), 0);
1890
1891 key_unit_connect(ACTIVITY_IRRIGATE, pextra);
1892 }
1893}
1894
1895/************************************************************************/
1898 static void transform_terrain_callback(GtkMenuItem *action, gpointer data)
1899{
1900 key_unit_transform();
1901}
1902
1903/************************************************************************/
1906 static void clean_pollution_callback(GtkMenuItem *action, gpointer data)
1907{
1908 unit_list_iterate(get_units_in_focus(), punit) {
1909 struct extra_type *pextra;
1910
1911 pextra = prev_extra_in_tile(unit_tile(punit), ERM_CLEANPOLLUTION,
1912 unit_owner(punit), punit);
1913
1914 if (pextra != NULL) {
1915 request_new_unit_activity_targeted(punit, ACTIVITY_POLLUTION, pextra);
1916 }
1917 } unit_list_iterate_end;
1918}
1919
1920/************************************************************************/
1923 static void clean_fallout_callback(GtkMenuItem *action, gpointer data)
1924{
1925 key_unit_fallout();
1926}
1927
1928/************************************************************************/
1931 static void build_fortress_callback(GtkMenuItem *action, gpointer data)
1932{
1933 key_unit_fortress();
1934}
1935
1936/************************************************************************/
1939 static void fortify_callback(GtkMenuItem *action, gpointer data)
1940{
1941 unit_list_iterate(get_units_in_focus(), punit) {
1942 request_unit_fortify(punit);
1943 } unit_list_iterate_end;
1944}
1945
1946/************************************************************************/
1949 static void build_airbase_callback(GtkMenuItem *action, gpointer data)
1950{
1951 key_unit_airbase();
1952}
1953
1954/************************************************************************/
1957 static void do_paradrop_callback(GtkMenuItem *action, gpointer data)
1958{
1959 key_unit_paradrop();
1960}
1961
1962/************************************************************************/
1965 static void do_pillage_callback(GtkMenuItem *action, gpointer data)
1966{
1967 key_unit_pillage();
1968}
1969
1970/************************************************************************/
1973 static void diplomat_action_callback(GtkMenuItem *action, gpointer data)
1974{
1975 key_unit_action_select_tgt();
1976}
1977
1978/************************************************************************/
1981 static void tax_rate_callback(GtkMenuItem *action, gpointer data)
1982{
1983 popup_rates_dialog();
1984}
1985
1986/************************************************************************/
1989 static void multiplier_callback(GtkMenuItem *action, gpointer data)
1990{
1991 popup_multiplier_dialog();
1992}
1993
1994/************************************************************************/
1997 static void government_callback(GtkMenuItem *item, gpointer data)
1998{
1999 popup_revolution_dialog((struct government *) data);
2000}
2001
2002/************************************************************************/
2005 static void base_callback(GtkMenuItem *item, gpointer data)
2006{
2007 struct extra_type *pextra = data;
2008
2009 unit_list_iterate(get_units_in_focus(), punit) {
2010 request_new_unit_activity_targeted(punit, ACTIVITY_BASE, pextra);
2011 } unit_list_iterate_end;
2012}
2013
2014/************************************************************************/
2017 static void road_callback(GtkMenuItem *item, gpointer data)
2018{
2019 struct extra_type *pextra = data;
2020
2021 unit_list_iterate(get_units_in_focus(), punit) {
2022 request_new_unit_activity_targeted(punit, ACTIVITY_GEN_ROAD,
2023 pextra);
2024 } unit_list_iterate_end;
2025}
2026
2027/************************************************************************/
2030 static void center_view_callback(GtkMenuItem *action, gpointer data)
2031{
2032 center_on_unit();
2033}
2034
2035/************************************************************************/
2038 static void report_units_callback(GtkMenuItem *action, gpointer data)
2039{
2040 units_report_dialog_popup(TRUE);
2041}
2042
2043/************************************************************************/
2046 static void report_cities_callback(GtkMenuItem *action, gpointer data)
2047{
2048 city_report_dialog_popup(TRUE);
2049}
2050
2051/************************************************************************/
2054 static void report_economy_callback(GtkMenuItem *action, gpointer data)
2055{
2056 economy_report_dialog_popup(TRUE);
2057}
2058
2059/************************************************************************/
2062 static void report_research_callback(GtkMenuItem *action, gpointer data)
2063{
2064 science_report_dialog_popup(TRUE);
2065}
2066
2067/************************************************************************/
2070 static void report_spaceship_callback(GtkMenuItem *action, gpointer data)
2071{
2072 if (NULL != client.conn.playing) {
2073 popup_spaceship_dialog(client.conn.playing);
2074 }
2075}
2076
2077/************************************************************************/
2080 static void menu_entry_init(GtkBuildable *item)
2081{
2082 const char *key = gtk_buildable_get_name(item);
2083 struct menu_entry_info *info = menu_entry_info_find(key);
2084
2085 if (info != NULL) {
2086 gtk_menu_item_set_label(GTK_MENU_ITEM(item),
2087 Q_(info->name));
2088 gtk_menu_item_set_use_underline(GTK_MENU_ITEM(item), TRUE);
2089 if (info->cb != NULL) {
2090 g_signal_connect(item, "activate", info->cb, NULL);
2091 }
2092
2093 if (info->accel != 0) {
2094 const char *path = gtk_menu_item_get_accel_path(GTK_MENU_ITEM(item));
2095
2096 if (path == NULL) {
2097 char buf[512];
2098
2099 fc_snprintf(buf, sizeof(buf), "<MENU>/%s", key);
2100 gtk_menu_item_set_accel_path(GTK_MENU_ITEM(item), buf);
2101 path = buf; /* Not NULL, but not usable either outside this block */
2102 }
2103
2104 if (path != NULL) {
2105 gtk_accel_map_add_entry(gtk_menu_item_get_accel_path(GTK_MENU_ITEM(item)),
2106 info->accel, info->accel_mod);
2107 }
2108 }
2109
2110 return;
2111 }
2112
2113 /* temporary naming solution */
2114 gtk_menu_item_set_label(GTK_MENU_ITEM(item), key);
2115}
2116
2117/************************************************************************/
2120 static const gchar *get_ui_filename(void)
2121{
2122 static char filename[256];
2123 const char *name;
2124
2125 if ((name = getenv("FREECIV_MENUS"))
2126 || (name = fileinfoname(get_data_dirs(), "gtk3.22_menus.xml"))) {
2127 sz_strlcpy(filename, name);
2128 } else {
2129 log_error("Gtk menus: file definition not found");
2130 filename[0] = '\0';
2131 }
2132
2133 log_verbose("ui menu file is \"%s\".", filename);
2134 return filename;
2135}
2136
2137/************************************************************************/
2140GtkWidget *setup_menus(GtkWidget *window)
2141{
2142 GtkWidget *menubar = NULL;
2143 GError *error = NULL;
2144
2145 ui_builder = gtk_builder_new();
2146 if (!gtk_builder_add_from_file(ui_builder, get_ui_filename(), &error)) {
2147 log_error("Gtk menus: %s", error->message);
2148 g_error_free(error);
2149 } else {
2150 GSList *entries;
2151 GSList *next;
2152
2153 entries = gtk_builder_get_objects(ui_builder);
2154 next = entries;
2155
2156 while (next != NULL) {
2157 GObject *obj = next->data;
2158
2159 if (GTK_IS_MENU_ITEM(obj)) {
2160 if (!GTK_IS_SEPARATOR_MENU_ITEM(obj)) {
2161 menu_entry_init(GTK_BUILDABLE(obj));
2162 }
2163 } else if (GTK_IS_MENU(obj)) {
2164 const char *key = gtk_buildable_get_name(GTK_BUILDABLE(obj));
2165
2166 if (key[0] == '<') {
2167 GtkAccelGroup *ac_group = gtk_menu_get_accel_group(GTK_MENU(obj));
2168
2169 if (ac_group == NULL) {
2170 ac_group = gtk_accel_group_new();
2171 gtk_menu_set_accel_group(GTK_MENU(obj), ac_group);
2172 }
2173
2174 gtk_window_add_accel_group(GTK_WINDOW(window), ac_group);
2175
2176 gtk_menu_set_accel_path(GTK_MENU(obj), key);
2177 }
2178 }
2179
2180 next = next->next;
2181 }
2182
2183 g_slist_free(entries);
2184
2185 menubar = GTK_WIDGET(gtk_builder_get_object(ui_builder, "MENU"));
2186 gtk_widget_set_visible(menubar, TRUE);
2187 gtk_widget_show_all(menubar);
2188 }
2189
2190#ifndef FREECIV_DEBUG
2191 menu_entry_set_visible("RELOAD_TILESET", FALSE, FALSE);
2192#endif /* FREECIV_DEBUG */
2193
2194 return menubar;
2195}
2196
2197/************************************************************************/
2200 static struct menu_entry_info *menu_entry_info_find(const char *key)
2201{
2202 int i;
2203
2204 for (i = 0; menu_entries[i].key != NULL; i++) {
2205 if (!strcmp(key, menu_entries[i].key)) {
2206 return &(menu_entries[i]);
2207 }
2208 }
2209
2210 return NULL;
2211}
2212
2213/************************************************************************/
2216 static void menu_entry_set_active(const char *key,
2217 gboolean is_active)
2218{
2219 GtkCheckMenuItem *item = GTK_CHECK_MENU_ITEM(gtk_builder_get_object(ui_builder, key));
2220
2221 if (item != NULL) {
2222 gtk_check_menu_item_set_active(item, is_active);
2223 }
2224}
2225
2226/************************************************************************/
2229 static void menu_entry_set_sensitive(const char *key,
2230 gboolean is_sensitive)
2231{
2232 GtkWidget *item = GTK_WIDGET(gtk_builder_get_object(ui_builder, key));
2233
2234 if (item != NULL) {
2235 gtk_widget_set_sensitive(item, is_sensitive);
2236 }
2237}
2238
2239/************************************************************************/
2242 static void menu_entry_group_set_sensitive(enum menu_entry_grouping group,
2243 gboolean is_sensitive)
2244{
2245 int i;
2246
2247 for (i = 0; menu_entries[i].key != NULL; i++) {
2248 if (menu_entries[i].grouping == group || group == MGROUP_ALL) {
2249 menu_entry_set_sensitive(menu_entries[i].key, is_sensitive);
2250 }
2251 }
2252}
2253
2254/************************************************************************/
2257#ifndef FREECIV_DEBUG
2258 static void menu_entry_set_visible(const char *key,
2259 gboolean is_visible,
2260 gboolean is_sensitive)
2261{
2262 GtkWidget *item = GTK_WIDGET(gtk_builder_get_object(ui_builder, key));
2263
2264 if (item != NULL) {
2265 gtk_widget_set_visible(item, is_visible);
2266 gtk_widget_set_sensitive(item, is_sensitive);
2267 }
2268}
2269#endif /* FREECIV_DEBUG */
2270
2271/************************************************************************/
2274 static void menus_rename(const char *key,
2275 const gchar *new_label)
2276{
2277 GtkWidget *item = GTK_WIDGET(gtk_builder_get_object(ui_builder, key));
2278
2279 if (item != NULL) {
2280 gtk_menu_item_set_label(GTK_MENU_ITEM(item), new_label);
2281 }
2282}
2283
2284/************************************************************************/
2287 static GtkMenu *find_menu(const char *key)
2288{
2289 return GTK_MENU(gtk_builder_get_object(ui_builder, key));
2290}
2291
2292/************************************************************************/
2295 static void view_menu_update_sensitivity(void)
2296{
2297 /* The "full" city bar (i.e. the new way of drawing the
2298 * city name), can draw the city growth even without drawing
2299 * the city name. But the old method cannot. */
2300 if (gui_options.draw_full_citybar) {
2301 menu_entry_set_sensitive("SHOW_CITY_GROWTH", TRUE);
2302 menu_entry_set_sensitive("SHOW_CITY_TRADE_ROUTES", TRUE);
2303 } else {
2304 menu_entry_set_sensitive("SHOW_CITY_GROWTH", gui_options.draw_city_names);
2305 menu_entry_set_sensitive("SHOW_CITY_TRADE_ROUTES",
2306 gui_options.draw_city_names);
2307 }
2308
2309 menu_entry_set_sensitive("SHOW_CITY_BUY_COST",
2310 gui_options.draw_city_productions);
2311 menu_entry_set_sensitive("SHOW_COASTLINE", !gui_options.draw_terrain);
2312 menu_entry_set_sensitive("SHOW_UNIT_SOLID_BG",
2313 gui_options.draw_units || gui_options.draw_focus_unit);
2314 menu_entry_set_sensitive("SHOW_UNIT_SHIELDS",
2315 gui_options.draw_units || gui_options.draw_focus_unit);
2316 menu_entry_set_sensitive("SHOW_STACK_SIZE",
2317 gui_options.draw_units || gui_options.draw_focus_unit);
2318 menu_entry_set_sensitive("SHOW_FOCUS_UNIT", !gui_options.draw_units);
2319}
2320
2321/************************************************************************/
2327 static const char *get_tile_change_menu_text(struct tile *ptile,
2328 enum unit_activity activity)
2329{
2330 struct tile *newtile = tile_virtual_new(ptile);
2331 const char *text;
2332
2333 tile_apply_activity(newtile, activity, NULL);
2334 text = tile_get_info_text(newtile, FALSE, 0);
2335 tile_virtual_destroy(newtile);
2336 return text;
2337}
2338
2339/************************************************************************/
2342 void real_menus_update(void)
2343{
2344 struct unit_list *punits = NULL;
2345 bool units_all_same_tile = TRUE, units_all_same_type = TRUE;
2346 GtkMenu *menu;
2347 char acttext[128], irrtext[128], mintext[128], transtext[128];
2348 char cultext[128], plantext[128];
2349 struct terrain *pterrain;
2350 bool conn_possible;
2351 struct road_type *proad;
2352 struct extra_type_list *extras;
2353
2354 if (ui_builder == NULL || !can_client_change_view()) {
2355 return;
2356 }
2357
2358 if (get_num_units_in_focus() > 0) {
2359 const struct tile *ptile = NULL;
2360 const struct unit_type *ptype = NULL;
2361 punits = get_units_in_focus();
2362 unit_list_iterate(punits, punit) {
2363 fc_assert((ptile==NULL) == (ptype==NULL));
2364 if (ptile || ptype) {
2365 if (unit_tile(punit) != ptile) {
2366 units_all_same_tile = FALSE;
2367 }
2368 if (unit_type_get(punit) != ptype) {
2369 units_all_same_type = FALSE;
2370 }
2371 } else {
2372 ptile = unit_tile(punit);
2373 ptype = unit_type_get(punit);
2374 }
2375 } unit_list_iterate_end;
2376 }
2377
2378 menu_entry_group_set_sensitive(MGROUP_EDIT, editor_is_active());
2379 menu_entry_group_set_sensitive(MGROUP_PLAYING, can_client_issue_orders()
2380 && !editor_is_active());
2381 menu_entry_group_set_sensitive(MGROUP_UNIT, can_client_issue_orders()
2382 && !editor_is_active() && punits != NULL);
2383
2384 menu_entry_set_active("EDIT_MODE", game.info.is_edit_mode);
2385 menu_entry_set_sensitive("EDIT_MODE",
2386 can_conn_enable_editing(&client.conn));
2387 editgui_refresh();
2388 menu_entry_set_sensitive("RALLY_DLG", can_client_issue_orders());
2389 menu_entry_set_sensitive("INFRA_DLG", terrain_control.infrapoints);
2390
2391 {
2392 char road_buf[500];
2393
2394 proad = road_by_gui_type(ROAD_GUI_ROAD);
2395 if (proad != NULL) {
2396 /* TRANS: Connect with some road type (Road/Railroad) */
2397 snprintf(road_buf, sizeof(road_buf), _("Connect With %s"),
2398 extra_name_translation(road_extra_get(proad)));
2399 menus_rename("CONNECT_ROAD", road_buf);
2400 }
2401
2402 proad = road_by_gui_type(ROAD_GUI_RAILROAD);
2403 if (proad != NULL) {
2404 snprintf(road_buf, sizeof(road_buf), _("Connect With %s"),
2405 extra_name_translation(road_extra_get(proad)));
2406 menus_rename("CONNECT_RAIL", road_buf);
2407 }
2408
2409 proad = road_by_gui_type(ROAD_GUI_MAGLEV);
2410 if (proad != NULL) {
2411 snprintf(road_buf, sizeof(road_buf), _("Connect With %s"),
2412 extra_name_translation(road_extra_get(proad)));
2413 menus_rename("CONNECT_MAGLEV", road_buf);
2414 }
2415 }
2416
2417 if (!can_client_issue_orders()) {
2418 return;
2419 }
2420
2421 /* Set government sensitivity. */
2422 if ((menu = find_menu("<MENU>/GOVERNMENT"))) {
2423 GList *list, *iter;
2424 struct government *pgov;
2425
2426 list = gtk_container_get_children(GTK_CONTAINER(menu));
2427 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2428 pgov = g_object_get_data(G_OBJECT(iter->data), "government");
2429 if (NULL != pgov) {
2430 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
2431 can_change_to_government(client_player(),
2432 pgov));
2433 } else {
2434 /* Revolution without target government */
2435 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
2436 untargeted_revolution_allowed());
2437 }
2438 }
2439 g_list_free(list);
2440 }
2441
2442 if (!punits) {
2443 return;
2444 }
2445
2446 /* Remaining part of this function: Update Unit, Work, and Combat menus */
2447
2448 /* Set base sensitivity. */
2449 if ((menu = find_menu("<MENU>/BUILD_BASE"))) {
2450 GList *list, *iter;
2451 struct extra_type *pextra;
2452
2453 list = gtk_container_get_children(GTK_CONTAINER(menu));
2454 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2455 pextra = g_object_get_data(G_OBJECT(iter->data), "base");
2456 if (NULL != pextra) {
2457 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
2458 can_units_do_activity_targeted_client(punits,
2459 ACTIVITY_BASE,
2460 pextra));
2461 }
2462 }
2463 g_list_free(list);
2464 }
2465
2466 /* Set road sensitivity. */
2467 if ((menu = find_menu("<MENU>/BUILD_PATH"))) {
2468 GList *list, *iter;
2469 struct extra_type *pextra;
2470
2471 list = gtk_container_get_children(GTK_CONTAINER(menu));
2472 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2473 pextra = g_object_get_data(G_OBJECT(iter->data), "road");
2474 if (NULL != pextra) {
2475 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
2476 can_units_do_activity_targeted_client(punits,
2477 ACTIVITY_GEN_ROAD,
2478 pextra));
2479 }
2480 }
2481 g_list_free(list);
2482 }
2483
2484 /* Set Go to and... action visibility. */
2485 if ((menu = find_menu("<MENU>/GOTO_AND"))) {
2486 GList *list, *iter;
2487 struct action *paction;
2488
2489 bool can_do_something = FALSE;
2490
2491 /* Enable a menu item if it is theoretically possible that one of the
2492 * selected units can perform it. Checking if the action can be performed
2493 * at the current tile is pointless since it should be performed at the
2494 * target tile. */
2495 list = gtk_container_get_children(GTK_CONTAINER(menu));
2496 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2497 paction = g_object_get_data(G_OBJECT(iter->data), "end_action");
2498 if (NULL != paction) {
2499 if (units_can_do_action(get_units_in_focus(),
2500 paction->id, TRUE)) {
2501 gtk_widget_set_visible(GTK_WIDGET(iter->data), TRUE);
2502 gtk_widget_set_sensitive(GTK_WIDGET(iter->data), TRUE);
2503 can_do_something = TRUE;
2504 } else {
2505 gtk_widget_set_visible(GTK_WIDGET(iter->data), FALSE);
2506 gtk_widget_set_sensitive(GTK_WIDGET(iter->data), FALSE);
2507 }
2508 }
2509 }
2510 g_list_free(list);
2511
2512 /* Only sensitive if an action may be possible. */
2513 menu_entry_set_sensitive("MENU_GOTO_AND", can_do_something);
2514 }
2515
2516 /* Enable the button for adding to a city in all cases, so we
2517 * get an eventual error message from the server if we try. */
2518 menu_entry_set_sensitive("BUILD_CITY",
2519 (can_units_do(punits, unit_can_add_or_build_city)
2520 || can_units_do(punits, unit_can_help_build_wonder_here)));
2521 menu_entry_set_sensitive("BUILD_ROAD",
2522 (can_units_do_any_road(&(wld.map), punits)
2523 || can_units_do(punits,
2524 unit_can_est_trade_route_here)));
2525 menu_entry_set_sensitive("BUILD_IRRIGATION",
2526 can_units_do_activity_client(punits, ACTIVITY_IRRIGATE));
2527 menu_entry_set_sensitive("CULTIVATE",
2528 can_units_do_activity_client(punits, ACTIVITY_CULTIVATE));
2529 menu_entry_set_sensitive("BUILD_MINE",
2530 can_units_do_activity_client(punits, ACTIVITY_MINE));
2531 menu_entry_set_sensitive("PLANT",
2532 can_units_do_activity_client(punits, ACTIVITY_PLANT));
2533 menu_entry_set_sensitive("TRANSFORM_TERRAIN",
2534 can_units_do_activity_client(punits, ACTIVITY_TRANSFORM));
2535 menu_entry_set_sensitive("FORTIFY",
2536 can_units_do_activity_client(punits,
2537 ACTIVITY_FORTIFYING));
2538 menu_entry_set_sensitive("BUILD_FORTRESS",
2539 can_units_do_base_gui(punits, BASE_GUI_FORTRESS));
2540 menu_entry_set_sensitive("BUILD_AIRBASE",
2541 can_units_do_base_gui(punits, BASE_GUI_AIRBASE));
2542 menu_entry_set_sensitive("CLEAN_POLLUTION",
2543 can_units_do_activity_client(punits, ACTIVITY_POLLUTION));
2544 menu_entry_set_sensitive("CLEAN_FALLOUT",
2545 can_units_do_activity_client(punits, ACTIVITY_FALLOUT));
2546 menu_entry_set_sensitive("UNIT_SENTRY",
2547 can_units_do_activity_client(punits, ACTIVITY_SENTRY));
2548 menu_entry_set_sensitive("DO_PARADROP",
2549 can_units_do_on_map(&(wld.map), punits, can_unit_paradrop));
2550 /* FIXME: should conditionally rename "Pillage" to "Pillage..." in cases where
2551 * selecting the command results in a dialog box listing options of what to pillage */
2552 menu_entry_set_sensitive("DO_PILLAGE",
2553 can_units_do_activity_client(punits, ACTIVITY_PILLAGE));
2554 menu_entry_set_sensitive("UNIT_DISBAND",
2555 units_can_do_action(punits, ACTION_DISBAND_UNIT,
2556 TRUE));
2557 menu_entry_set_sensitive("UNIT_UPGRADE",
2558 units_can_upgrade(&(wld.map), punits));
2559 /* "UNIT_CONVERT" dealt with below */
2560 menu_entry_set_sensitive("UNIT_HOMECITY",
2561 can_units_do(punits, can_unit_change_homecity));
2562 menu_entry_set_sensitive("UNIT_UNLOAD_TRANSPORTER",
2563 units_are_occupied(punits));
2564 menu_entry_set_sensitive("UNIT_BOARD",
2565 units_can_load(punits));
2566 menu_entry_set_sensitive("UNIT_DEBOARD",
2567 units_can_unload(punits));
2568 menu_entry_set_sensitive("UNIT_UNSENTRY",
2569 units_have_activity_on_tile(punits,
2570 ACTIVITY_SENTRY));
2571 menu_entry_set_sensitive("AUTO_SETTLER",
2572 can_units_do(punits, can_unit_do_autosettlers));
2573 menu_entry_set_sensitive("UNIT_EXPLORE",
2574 can_units_do_activity_client(punits, ACTIVITY_EXPLORE));
2575
2576 proad = road_by_gui_type(ROAD_GUI_ROAD);
2577 if (proad != NULL) {
2578 struct extra_type *tgt;
2579
2580 tgt = road_extra_get(proad);
2581
2582 conn_possible = can_units_do_connect(punits, ACTIVITY_GEN_ROAD, tgt);
2583 } else {
2584 conn_possible = FALSE;
2585 }
2586 menu_entry_set_sensitive("CONNECT_ROAD", conn_possible);
2587
2588 proad = road_by_gui_type(ROAD_GUI_RAILROAD);
2589 if (proad != NULL) {
2590 struct extra_type *tgt;
2591
2592 tgt = road_extra_get(proad);
2593
2594 conn_possible = can_units_do_connect(punits, ACTIVITY_GEN_ROAD, tgt);
2595 } else {
2596 conn_possible = FALSE;
2597 }
2598 menu_entry_set_sensitive("CONNECT_RAIL", conn_possible);
2599
2600 proad = road_by_gui_type(ROAD_GUI_MAGLEV);
2601 if (proad != NULL) {
2602 struct extra_type *tgt;
2603
2604 tgt = road_extra_get(proad);
2605
2606 conn_possible = can_units_do_connect(punits, ACTIVITY_GEN_ROAD, tgt);
2607 } else {
2608 conn_possible = FALSE;
2609 }
2610 menu_entry_set_sensitive("CONNECT_MAGLEV", conn_possible);
2611
2612 extras = extra_type_list_by_cause(EC_IRRIGATION);
2613
2614 if (extra_type_list_size(extras) > 0) {
2615 struct extra_type *tgt;
2616
2617 tgt = extra_type_list_get(extras, 0);
2618 conn_possible = can_units_do_connect(punits, ACTIVITY_IRRIGATE, tgt);
2619 } else {
2620 conn_possible = FALSE;
2621 }
2622 menu_entry_set_sensitive("CONNECT_IRRIGATION", conn_possible);
2623
2624 menu_entry_set_sensitive("DIPLOMAT_ACTION",
2625 units_can_do_action(punits, ACTION_ANY, TRUE));
2626
2627 if (units_can_do_action(punits, ACTION_HELP_WONDER, TRUE)) {
2628 menus_rename("BUILD_CITY",
2629 action_get_ui_name_mnemonic(ACTION_HELP_WONDER, "_"));
2630 } else {
2631 bool city_on_tile = FALSE;
2632
2633 /* FIXME: this overloading doesn't work well with multiple focus
2634 * units. */
2635 unit_list_iterate(punits, punit) {
2636 if (tile_city(unit_tile(punit))) {
2637 city_on_tile = TRUE;
2638 break;
2639 }
2640 } unit_list_iterate_end;
2641
2642 if (city_on_tile && units_can_do_action(punits, ACTION_JOIN_CITY,
2643 TRUE)) {
2644 menus_rename("BUILD_CITY",
2645 action_get_ui_name_mnemonic(ACTION_JOIN_CITY, "_"));
2646 } else {
2647 /* refresh default order */
2648 menus_rename("BUILD_CITY",
2649 action_get_ui_name_mnemonic(ACTION_FOUND_CITY, "_"));
2650 }
2651 }
2652
2653 if (units_can_do_action(punits, ACTION_TRADE_ROUTE, TRUE)) {
2654 menus_rename("BUILD_ROAD",
2655 action_get_ui_name_mnemonic(ACTION_TRADE_ROUTE, "_"));
2656 } else if (units_have_type_flag(punits, UTYF_SETTLERS, TRUE)) {
2657 char road_item[500];
2658 struct extra_type *pextra = NULL;
2659
2660 /* FIXME: this overloading doesn't work well with multiple focus
2661 * units. */
2662 unit_list_iterate(punits, punit) {
2663 pextra = next_extra_for_tile(unit_tile(punit), EC_ROAD,
2664 unit_owner(punit), punit);
2665 if (pextra != NULL) {
2666 break;
2667 }
2668 } unit_list_iterate_end;
2669
2670 if (pextra != NULL) {
2671 /* TRANS: Build road of specific type (Road/Railroad/Maglev) */
2672 snprintf(road_item, sizeof(road_item), _("Build %s"),
2673 extra_name_translation(pextra));
2674 menus_rename("BUILD_ROAD", road_item);
2675 }
2676 } else {
2677 menus_rename("BUILD_ROAD", _("Build _Road"));
2678 }
2679
2680 if (units_all_same_type) {
2681 struct unit *punit = unit_list_get(punits, 0);
2682 const struct unit_type *to_unittype =
2683 can_upgrade_unittype(client_player(), unit_type_get(punit));
2684 if (to_unittype) {
2685 /* TRANS: %s is a unit type. */
2686 fc_snprintf(acttext, sizeof(acttext), _("Upgr_ade to %s"),
2687 utype_name_translation(
2688 can_upgrade_unittype(client_player(),
2689 unit_type_get(punit))));
2690 } else {
2691 acttext[0] = '\0';
2692 }
2693 } else {
2694 acttext[0] = '\0';
2695 }
2696 if ('\0' != acttext[0]) {
2697 menus_rename("UNIT_UPGRADE", acttext);
2698 } else {
2699 menus_rename("UNIT_UPGRADE", _("Upgr_ade"));
2700 }
2701
2702 if (units_can_convert(&(wld.map), punits)) {
2703 menu_entry_set_sensitive("UNIT_CONVERT", TRUE);
2704 if (units_all_same_type) {
2705 struct unit *punit = unit_list_get(punits, 0);
2706
2707 /* TRANS: %s is a unit type. */
2708 fc_snprintf(acttext, sizeof(acttext), _("C_onvert to %s"),
2709 utype_name_translation(unit_type_get(punit)->converted_to));
2710 } else {
2711 acttext[0] = '\0';
2712 }
2713 } else {
2714 menu_entry_set_sensitive("UNIT_CONVERT", FALSE);
2715 acttext[0] = '\0';
2716 }
2717 if ('\0' != acttext[0]) {
2718 menus_rename("UNIT_CONVERT", acttext);
2719 } else {
2720 menus_rename("UNIT_CONVERT", _("C_onvert"));
2721 }
2722
2723 if (units_all_same_tile) {
2724 struct unit *first = unit_list_get(punits, 0);
2725
2726 pterrain = tile_terrain(unit_tile(first));
2727
2728 if (units_have_type_flag(punits, UTYF_SETTLERS, TRUE)) {
2729 struct extra_type *pextra = NULL;
2730
2731 /* FIXME: this overloading doesn't work well with multiple focus
2732 * units. */
2733 unit_list_iterate(punits, punit) {
2734 pextra = next_extra_for_tile(unit_tile(punit), EC_IRRIGATION,
2735 unit_owner(punit), punit);
2736 if (pextra != NULL) {
2737 break;
2738 }
2739 } unit_list_iterate_end;
2740
2741 if (pextra != NULL) {
2742 /* TRANS: Build irrigation of specific type */
2743 snprintf(irrtext, sizeof(irrtext), _("Build %s"),
2744 extra_name_translation(pextra));
2745 } else {
2746 sz_strlcpy(irrtext, _("Build _Irrigation"));
2747 }
2748 } else {
2749 sz_strlcpy(irrtext, _("Build _Irrigation"));
2750 }
2751
2752 if (pterrain->cultivate_result != T_NONE) {
2753 fc_snprintf(cultext, sizeof(cultext), _("Change to %s"),
2754 get_tile_change_menu_text(unit_tile(first),
2755 ACTIVITY_CULTIVATE));
2756 } else {
2757 sz_strlcpy(cultext, _("_Cultivate"));
2758 }
2759
2760 if (units_have_type_flag(punits, UTYF_SETTLERS, TRUE)) {
2761 struct extra_type *pextra = NULL;
2762
2763 /* FIXME: this overloading doesn't work well with multiple focus
2764 * units. */
2765 unit_list_iterate(punits, punit) {
2766 pextra = next_extra_for_tile(unit_tile(punit), EC_MINE,
2767 unit_owner(punit), punit);
2768 if (pextra != NULL) {
2769 break;
2770 }
2771 } unit_list_iterate_end;
2772
2773 if (pextra != NULL) {
2774 /* TRANS: Build mine of specific type */
2775 snprintf(mintext, sizeof(mintext), _("Build %s"),
2776 extra_name_translation(pextra));
2777 } else {
2778 sz_strlcpy(mintext, _("Build _Mine"));
2779 }
2780 } else {
2781 sz_strlcpy(mintext, _("Build _Mine"));
2782 }
2783
2784 if (pterrain->plant_result != T_NONE) {
2785 fc_snprintf(plantext, sizeof(plantext), _("Change to %s"),
2786 get_tile_change_menu_text(unit_tile(first), ACTIVITY_PLANT));
2787 } else {
2788 sz_strlcpy(plantext, _("_Plant"));
2789 }
2790
2791 if (pterrain->transform_result != T_NONE
2792 && pterrain->transform_result != pterrain) {
2793 fc_snprintf(transtext, sizeof(transtext), _("Transf_orm to %s"),
2794 get_tile_change_menu_text(unit_tile(first),
2795 ACTIVITY_TRANSFORM));
2796 } else {
2797 sz_strlcpy(transtext, _("Transf_orm Terrain"));
2798 }
2799 } else {
2800 sz_strlcpy(irrtext, _("Build _Irrigation"));
2801 sz_strlcpy(cultext, _("_Cultivate"));
2802 sz_strlcpy(mintext, _("Build _Mine"));
2803 sz_strlcpy(plantext, _("_Plant"));
2804 sz_strlcpy(transtext, _("Transf_orm Terrain"));
2805 }
2806
2807 menus_rename("BUILD_IRRIGATION", irrtext);
2808 menus_rename("CULTIVATE", cultext);
2809 menus_rename("BUILD_MINE", mintext);
2810 menus_rename("PLANT", plantext);
2811 menus_rename("TRANSFORM_TERRAIN", transtext);
2812
2813 menus_rename("UNIT_HOMECITY",
2814 action_get_ui_name_mnemonic(ACTION_HOME_CITY, "_"));
2815}
2816
2817/************************************************************************/
2820 static void menu_unit_goto_and_add_accel(GtkWidget *item, action_id act_id,
2821 const guint accel_key,
2822 const GdkModifierType accel_mods)
2823{
2824 const char *path = gtk_menu_item_get_accel_path(GTK_MENU_ITEM(item));
2825
2826 if (path == NULL) {
2827 char buf[MAX_LEN_NAME + strlen("<MENU>/GOTO_AND/")];
2828
2829 fc_snprintf(buf, sizeof(buf), "<MENU>/GOTO_AND/%s",
2830 action_id_rule_name(act_id));
2831 gtk_menu_item_set_accel_path(GTK_MENU_ITEM(item), buf);
2832 path = buf; /* Not NULL, but not usable either outside this block */
2833 }
2834
2835 if (path != NULL) {
2836 gtk_accel_map_add_entry(gtk_menu_item_get_accel_path(GTK_MENU_ITEM(item)),
2837 accel_key, accel_mods);
2838 }
2839}
2840
2841/************************************************************************/
2844 static void menu_remove_previous_entries(GtkMenu *menu)
2845{
2846 GList *list, *iter;
2847 GtkWidget *sub_menu;
2848
2849 list = gtk_container_get_children(GTK_CONTAINER(menu));
2850 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2851 if ((sub_menu = gtk_menu_item_get_submenu(iter->data)) != NULL) {
2852 menu_remove_previous_entries(GTK_MENU(sub_menu));
2853 gtk_widget_destroy(sub_menu);
2854 }
2855 gtk_widget_destroy(GTK_WIDGET(iter->data));
2856 }
2857 g_list_free(list);
2858}
2859
2860/************************************************************************/
2864 void real_menus_init(void)
2865{
2866 GtkMenu *menu;
2867
2868 if (ui_builder == NULL) {
2869 return;
2870 }
2871
2872 menu_entry_set_sensitive("GAME_SAVE_AS",
2873 can_client_access_hack()
2874 && C_S_RUNNING <= client_state());
2875 menu_entry_set_sensitive("GAME_SAVE",
2876 can_client_access_hack()
2877 && C_S_RUNNING <= client_state());
2878
2879 menu_entry_set_active("SAVE_OPTIONS_ON_EXIT",
2880 gui_options.save_options_on_exit);
2881 menu_entry_set_sensitive("SERVER_OPTIONS", client.conn.established);
2882
2883 menu_entry_set_sensitive("LEAVE",
2884 client.conn.established);
2885
2886 if (!can_client_change_view()) {
2887 menu_entry_group_set_sensitive(MGROUP_ALL, FALSE);
2888
2889 return;
2890 }
2891
2892 menus_rename("BUILD_FORTRESS", Q_(terrain_control.gui_type_base0));
2893 menus_rename("BUILD_AIRBASE", Q_(terrain_control.gui_type_base1));
2894
2895 if ((menu = find_menu("<MENU>/GOVERNMENT"))) {
2896 GList *list, *iter;
2897 GtkWidget *item;
2898 char buf[256];
2899
2900 /* Remove previous government entries. */
2901 list = gtk_container_get_children(GTK_CONTAINER(menu));
2902 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2903 if (g_object_get_data(G_OBJECT(iter->data), "government") != NULL
2904 || GTK_IS_SEPARATOR_MENU_ITEM(iter->data)) {
2905 gtk_widget_destroy(GTK_WIDGET(iter->data));
2906 }
2907 }
2908 g_list_free(list);
2909
2910 /* Add new government entries. */
2911 item = gtk_separator_menu_item_new();
2912 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
2913 gtk_widget_show(item);
2914
2915 governments_iterate(g) {
2916 if (g != game.government_during_revolution) {
2917 /* TRANS: %s is a government name */
2918 fc_snprintf(buf, sizeof(buf), _("%s..."),
2919 government_name_translation(g));
2920 item = gtk_menu_item_new_with_label(buf);
2921 g_object_set_data(G_OBJECT(item), "government", g);
2922 g_signal_connect(item, "activate",
2923 G_CALLBACK(government_callback), g);
2924 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
2925 gtk_widget_show(item);
2926 }
2927 } governments_iterate_end;
2928 }
2929
2930 if ((menu = find_menu("<MENU>/BUILD_BASE"))) {
2931 GList *list, *iter;
2932 GtkWidget *item;
2933
2934 /* Remove previous base entries. */
2935 list = gtk_container_get_children(GTK_CONTAINER(menu));
2936 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2937 gtk_widget_destroy(GTK_WIDGET(iter->data));
2938 }
2939 g_list_free(list);
2940
2941 /* Add new base entries. */
2942 extra_type_by_cause_iterate(EC_BASE, pextra) {
2943 if (pextra->buildable) {
2944 item = gtk_menu_item_new_with_label(extra_name_translation(pextra));
2945 g_object_set_data(G_OBJECT(item), "base", pextra);
2946 g_signal_connect(item, "activate", G_CALLBACK(base_callback), pextra);
2947 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
2948 gtk_widget_show(item);
2949 }
2950 } extra_type_by_cause_iterate_end;
2951 }
2952
2953 if ((menu = find_menu("<MENU>/BUILD_PATH"))) {
2954 GList *list, *iter;
2955 GtkWidget *item;
2956
2957 /* Remove previous road entries. */
2958 list = gtk_container_get_children(GTK_CONTAINER(menu));
2959 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2960 gtk_widget_destroy(GTK_WIDGET(iter->data));
2961 }
2962 g_list_free(list);
2963
2964 /* Add new road entries. */
2965 extra_type_by_cause_iterate(EC_ROAD, pextra) {
2966 if (pextra->buildable) {
2967 item = gtk_menu_item_new_with_label(extra_name_translation(pextra));
2968 g_object_set_data(G_OBJECT(item), "road", pextra);
2969 g_signal_connect(item, "activate", G_CALLBACK(road_callback), pextra);
2970 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
2971 gtk_widget_show(item);
2972 }
2973 } extra_type_by_cause_iterate_end;
2974 }
2975
2976 /* Initialize the Go to and... actions. */
2977 if ((menu = find_menu("<MENU>/GOTO_AND"))) {
2978 GtkWidget *item;
2979 int tgt_kind_group;
2980
2981 /* Remove previous action entries. */
2982 menu_remove_previous_entries(menu);
2983
2984 /* Add the new action entries grouped by target kind. */
2985 for (tgt_kind_group = 0; tgt_kind_group < ATK_COUNT; tgt_kind_group++) {
2986 action_iterate(act_id) {
2987 struct action *paction = action_by_number(act_id);
2988
2989 if (action_id_get_actor_kind(act_id) != AAK_UNIT) {
2990 /* This action isn't performed by a unit. */
2991 continue;
2992 }
2993
2994 if (action_id_get_target_kind(act_id) != tgt_kind_group) {
2995 /* Wrong group. */
2996 continue;
2997 }
2998
2999 /* Create and add the menu item. It will be hidden or shown based on
3000 * unit type. */
3001 item = gtk_menu_item_new_with_mnemonic(
3002 action_get_ui_name_mnemonic(act_id, "_"));
3003 g_object_set_data(G_OBJECT(item), "end_action", paction);
3004
3005 if (action_id_has_complex_target(act_id)) {
3006 GtkWidget *sub_target_menu = gtk_menu_new();
3007
3008#define CREATE_SUB_ITEM(_sub_target_, _sub_target_key_, _sub_target_name_) \
3009 GtkWidget *sub_item = gtk_menu_item_new_with_label(_sub_target_name_); \
3010 g_object_set_data(G_OBJECT(sub_item), "end_action", paction); \
3011 g_object_set_data(G_OBJECT(sub_item), _sub_target_key_, _sub_target_); \
3012 g_signal_connect(sub_item, "activate", \
3013 G_CALLBACK(unit_goto_and_callback), paction); \
3014 gtk_menu_shell_append(GTK_MENU_SHELL(sub_target_menu), sub_item); \
3015 gtk_widget_show(sub_item);
3016
3017 switch (action_get_sub_target_kind(paction)) {
3018 case ASTK_BUILDING:
3019 improvement_iterate(pimpr) {
3020 CREATE_SUB_ITEM(pimpr, "end_building",
3021 improvement_name_translation(pimpr));
3022 } improvement_iterate_end;
3023 break;
3024 case ASTK_TECH:
3025 advance_iterate(A_FIRST, ptech) {
3026 CREATE_SUB_ITEM(ptech, "end_tech",
3027 advance_name_translation(ptech));
3028 } advance_iterate_end;
3029 break;
3030 case ASTK_EXTRA:
3031 case ASTK_EXTRA_NOT_THERE:
3032 extra_type_iterate(pextra) {
3033 if (!(action_creates_extra(paction, pextra)
3034 || action_removes_extra(paction, pextra))) {
3035 /* Not relevant */
3036 continue;
3037 }
3038 CREATE_SUB_ITEM(pextra, "end_extra",
3039 extra_name_translation(pextra));
3040 } extra_type_iterate_end;
3041 break;
3042 case ASTK_NONE:
3043 /* Should not be here. */
3044 fc_assert(action_get_sub_target_kind(paction) != ASTK_NONE);
3045 break;
3046 case ASTK_COUNT:
3047 /* Should not exits */
3048 fc_assert(action_get_sub_target_kind(paction) != ASTK_COUNT);
3049 break;
3050 }
3051
3052#undef CREATE_SUB_ITEM
3053
3054 gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), sub_target_menu);
3055 } else {
3056 g_signal_connect(item, "activate",
3057 G_CALLBACK(unit_goto_and_callback), paction);
3058
3059#define ADD_OLD_ACCELERATOR(wanted_action_id, accel_key, accel_mods) \
3060 if (act_id == wanted_action_id) { \
3061 menu_unit_goto_and_add_accel(item, act_id, accel_key, accel_mods); \
3062 }
3063
3064 /* Add the keyboard shortcuts for "Go to and..." menu items that
3065 * existed independently before the "Go to and..." menu arrived.
3066 */
3067 ADD_OLD_ACCELERATOR(ACTION_FOUND_CITY, GDK_KEY_b, GDK_SHIFT_MASK);
3068 ADD_OLD_ACCELERATOR(ACTION_JOIN_CITY, GDK_KEY_j, GDK_SHIFT_MASK);
3069 ADD_OLD_ACCELERATOR(ACTION_NUKE, GDK_KEY_n, GDK_SHIFT_MASK);
3070 }
3071
3072 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
3073 gtk_widget_show(item);
3074 } action_iterate_end;
3075 }
3076 }
3077
3078 menu_entry_group_set_sensitive(MGROUP_SAFE, TRUE);
3079 menu_entry_group_set_sensitive(MGROUP_PLAYER, client_has_player());
3080
3081 menu_entry_set_sensitive("TAX_RATE",
3082 game.info.changable_tax
3083 && can_client_issue_orders());
3084 menu_entry_set_sensitive("POLICIES",
3085 multiplier_count() > 0);
3086
3087 menu_entry_set_active("SHOW_CITY_OUTLINES",
3088 gui_options.draw_city_outlines);
3089 menu_entry_set_active("SHOW_CITY_OUTPUT",
3090 gui_options.draw_city_output);
3091 menu_entry_set_active("SHOW_MAP_GRID",
3092 gui_options.draw_map_grid);
3093 menu_entry_set_active("SHOW_NATIONAL_BORDERS",
3094 gui_options.draw_borders);
3095 menu_entry_set_sensitive("SHOW_NATIONAL_BORDERS",
3096 BORDERS_DISABLED != game.info.borders);
3097 menu_entry_set_active("SHOW_NATIVE_TILES",
3098 gui_options.draw_native);
3099 menu_entry_set_active("SHOW_CITY_FULL_BAR",
3100 gui_options.draw_full_citybar);
3101 menu_entry_set_active("SHOW_CITY_NAMES",
3102 gui_options.draw_city_names);
3103 menu_entry_set_active("SHOW_CITY_GROWTH",
3104 gui_options.draw_city_growth);
3105 menu_entry_set_active("SHOW_CITY_PRODUCTIONS",
3106 gui_options.draw_city_productions);
3107 menu_entry_set_active("SHOW_CITY_BUY_COST",
3108 gui_options.draw_city_buycost);
3109 menu_entry_set_active("SHOW_CITY_TRADE_ROUTES",
3110 gui_options.draw_city_trade_routes);
3111 menu_entry_set_active("SHOW_TERRAIN",
3112 gui_options.draw_terrain);
3113 menu_entry_set_active("SHOW_COASTLINE",
3114 gui_options.draw_coastline);
3115 menu_entry_set_active("SHOW_PATHS",
3116 gui_options.draw_roads_rails);
3117 menu_entry_set_active("SHOW_IRRIGATION",
3118 gui_options.draw_irrigation);
3119 menu_entry_set_active("SHOW_MINES",
3120 gui_options.draw_mines);
3121 menu_entry_set_active("SHOW_BASES",
3122 gui_options.draw_fortress_airbase);
3123 menu_entry_set_active("SHOW_RESOURCES",
3124 gui_options.draw_specials);
3125 menu_entry_set_active("SHOW_HUTS",
3126 gui_options.draw_huts);
3127 menu_entry_set_active("SHOW_POLLUTION",
3128 gui_options.draw_pollution);
3129 menu_entry_set_active("SHOW_CITIES",
3130 gui_options.draw_cities);
3131 menu_entry_set_active("SHOW_UNITS",
3132 gui_options.draw_units);
3133 menu_entry_set_active("SHOW_UNIT_SOLID_BG",
3134 gui_options.solid_color_behind_units);
3135 menu_entry_set_active("SHOW_UNIT_SHIELDS",
3136 gui_options.draw_unit_shields);
3137 menu_entry_set_active("SHOW_STACK_SIZE",
3138 gui_options.draw_unit_stack_size);
3139 menu_entry_set_active("SHOW_FOCUS_UNIT",
3140 gui_options.draw_focus_unit);
3141 menu_entry_set_active("SHOW_FOG_OF_WAR",
3142 gui_options.draw_fog_of_war);
3143
3144 view_menu_update_sensitivity();
3145
3146 menu_entry_set_active("FULL_SCREEN", GUI_GTK_OPTION(fullscreen));
3147}
3148
3149/**************************************************************************
3150 Free resources allocated by the menu system.
3151**************************************************************************/
3152 void menus_free(void)
3153{
3154 if (ui_builder != NULL) {
3155 g_object_unref(ui_builder);
3156 ui_builder = NULL;
3157 }
3158}
action_removes_extra
bool action_removes_extra(const struct action *paction, const struct extra_type *pextra)
Definition actions.c:2312
action_id_rule_name
const char * action_id_rule_name(action_id act_id)
Definition actions.c:1899
action_get_sub_target_kind
enum action_sub_target_kind action_get_sub_target_kind(const struct action *paction)
Definition actions.c:1751
action_creates_extra
bool action_creates_extra(const struct action *paction, const struct extra_type *pextra)
Definition actions.c:2224
action_get_ui_name_mnemonic
const char * action_get_ui_name_mnemonic(action_id act_id, const char *mnemonic)
Definition actions.c:1918
action_by_number
static struct action * action_by_number(action_id act_id)
Definition actions.h:638
action_iterate_end
#define action_iterate_end
Definition actions.h:472
action_id_get_actor_kind
#define action_id_get_actor_kind(act_id)
Definition actions.h:651
action_iterate
#define action_iterate(_act_)
Definition actions.h:467
ACTION_ANY
#define ACTION_ANY
Definition actions.h:290
action_id_get_target_kind
#define action_id_get_target_kind(act_id)
Definition actions.h:655
action_id_has_complex_target
#define action_id_has_complex_target(act_id)
Definition actions.h:673
entries
struct @124::my_agent entries[MAX_AGENTS]
client
struct civclient client
Definition client_main.c:149
client_state
enum client_states client_state(void)
Definition client_main.c:1029
send_report_request
void send_report_request(enum report_type type)
Definition client_main.c:839
can_client_issue_orders
bool can_client_issue_orders(void)
Definition client_main.c:1265
client_has_player
bool client_has_player(void)
Definition client_main.c:1365
can_client_change_view
bool can_client_change_view(void)
Definition client_main.c:1313
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:1224
list
static struct fc_sockaddr_list * list
Definition clinet.c:102
disconnect_from_server
void disconnect_from_server(void)
Definition clinet.c:305
clinet.h
send_save_game
void send_save_game(const char *filename)
Definition connectdlg_common.c:741
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:520
key_coastline_toggle
void key_coastline_toggle(void)
Definition control.c:3803
key_irrigation_toggle
void key_irrigation_toggle(void)
Definition control.c:3819
key_unit_sentry
void key_unit_sentry(void)
Definition control.c:3607
key_city_output_toggle
void key_city_output_toggle(void)
Definition control.c:3704
request_unit_return
void request_unit_return(struct unit *punit)
Definition control.c:1521
request_unit_fortify
void request_unit_fortify(struct unit *punit)
Definition control.c:2213
key_editor_recalculate_borders
void key_editor_recalculate_borders(void)
Definition control.c:3923
key_roads_rails_toggle
void key_roads_rails_toggle(void)
Definition control.c:3811
request_unit_caravan_action
void request_unit_caravan_action(struct unit *punit, action_id action)
Definition control.c:2121
key_focus_unit_toggle
void key_focus_unit_toggle(void)
Definition control.c:3899
key_unit_auto_explore
void key_unit_auto_explore(void)
Definition control.c:3383
key_unit_auto_settle
void key_unit_auto_settle(void)
Definition control.c:3396
key_unit_connect
void key_unit_connect(enum unit_activity activity, struct extra_type *tgt)
Definition control.c:3189
key_city_full_bar_toggle
void key_city_full_bar_toggle(void)
Definition control.c:3736
key_bases_toggle
void key_bases_toggle(void)
Definition control.c:3835
key_map_native_toggle
void key_map_native_toggle(void)
Definition control.c:3728
key_resources_toggle
void key_resources_toggle(void)
Definition control.c:3843
request_unit_goto
void request_unit_goto(enum unit_orders last_order, action_id act_id, int sub_tgt_id)
Definition control.c:1103
key_unit_paradrop
void key_unit_paradrop(void)
Definition control.c:3293
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:3891
key_city_productions_toggle
void key_city_productions_toggle(void)
Definition control.c:3770
key_unit_plant
void key_unit_plant(void)
Definition control.c:3529
key_unit_fortress
void key_unit_fortress(void)
Definition control.c:3438
key_unit_mine
void key_unit_mine(void)
Definition control.c:3521
key_unit_pillage
void key_unit_pillage(void)
Definition control.c:3541
request_unit_unload
void request_unit_unload(struct unit *pcargo)
Definition control.c:2092
key_editor_toggle_fogofwar
void key_editor_toggle_fogofwar(void)
Definition control.c:3932
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:1837
key_unit_irrigate
void key_unit_irrigate(void)
Definition control.c:3501
request_unit_build_city
void request_unit_build_city(struct unit *punit)
Definition control.c:1714
key_unit_unload_all
void key_unit_unload_all(void)
Definition control.c:3323
key_cities_toggle
void key_cities_toggle(void)
Definition control.c:3867
key_city_outlines_toggle
void key_city_outlines_toggle(void)
Definition control.c:3696
key_unit_homecity
void key_unit_homecity(void)
Definition control.c:3455
key_unit_patrol
void key_unit_patrol(void)
Definition control.c:3301
key_unit_solid_bg_toggle
void key_unit_solid_bg_toggle(void)
Definition control.c:3883
key_terrain_toggle
void key_terrain_toggle(void)
Definition control.c:3795
key_unit_wakeup_others
void key_unit_wakeup_others(void)
Definition control.c:3356
key_unit_stack_size_toggle
void key_unit_stack_size_toggle(void)
Definition control.c:3787
key_huts_toggle
void key_huts_toggle(void)
Definition control.c:3851
key_fog_of_war_toggle
void key_fog_of_war_toggle(void)
Definition control.c:3907
key_unit_wait
void key_unit_wait(void)
Definition control.c:3348
key_units_toggle
void key_units_toggle(void)
Definition control.c:3875
key_unit_select_battlegroup
void key_unit_select_battlegroup(int battlegroup, bool append)
Definition control.c:3670
key_map_grid_toggle
void key_map_grid_toggle(void)
Definition control.c:3712
key_pollution_toggle
void key_pollution_toggle(void)
Definition control.c:3859
key_city_growth_toggle
void key_city_growth_toggle(void)
Definition control.c:3753
key_unit_action_select_tgt
void key_unit_action_select_tgt(void)
Definition control.c:3220
key_unit_fallout
void key_unit_fallout(void)
Definition control.c:3418
key_city_buycost_toggle
void key_city_buycost_toggle(void)
Definition control.c:3762
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:3619
key_unit_done
void key_unit_done(void)
Definition control.c:3277
key_city_trade_routes_toggle
void key_city_trade_routes_toggle(void)
Definition control.c:3779
key_city_names_toggle
void key_city_names_toggle(void)
Definition control.c:3744
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:1590
key_unit_airbase
void key_unit_airbase(void)
Definition control.c:3366
key_unit_goto
void key_unit_goto(void)
Definition control.c:3285
key_unit_convert
void key_unit_convert(void)
Definition control.c:3408
key_editor_toggle
void key_editor_toggle(void)
Definition control.c:3915
key_unit_assign_battlegroup
void key_unit_assign_battlegroup(int battlegroup, bool append)
Definition control.c:3631
key_unit_cultivate
void key_unit_cultivate(void)
Definition control.c:3509
key_mines_toggle
void key_mines_toggle(void)
Definition control.c:3827
key_map_borders_toggle
void key_map_borders_toggle(void)
Definition control.c:3720
control.h
can_unit_do_activity_targeted_client
#define can_unit_do_activity_targeted_client(_punit_, _act_, _tgt_)
Definition control.h:42
can_units_do_activity_targeted_client
#define can_units_do_activity_targeted_client(_punits_, _act_, _tgt_)
Definition control.h:46
can_units_do_activity_client
#define can_units_do_activity_client(_punits_, _act_)
Definition control.h:44
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:73
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:740
extra_number
int extra_number(const struct extra_type *pextra)
Definition extras.c:153
extra_type_list_by_cause
struct extra_type_list * extra_type_list_by_cause(enum extra_cause cause)
Definition extras.c:241
prev_extra_in_tile
struct extra_type * prev_extra_in_tile(const struct tile *ptile, enum extra_rmcause rmcause, const struct player *pplayer, const struct unit *punit)
Definition extras.c:765
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:186
extra_type_iterate
#define extra_type_iterate(_p)
Definition extras.h:291
extra_type_iterate_end
#define extra_type_iterate_end
Definition extras.h:297
extra_type_by_cause_iterate_end
#define extra_type_by_cause_iterate_end
Definition extras.h:315
extra_type_by_cause_iterate
#define extra_type_by_cause_iterate(_cause, _extra)
Definition extras.h:309
NO_TARGET
#define NO_TARGET
Definition fc_types.h:324
action_id
int action_id
Definition fc_types.h:359
MAX_LEN_NAME
#define MAX_LEN_NAME
Definition fc_types.h:66
BORDERS_DISABLED
@ BORDERS_DISABLED
Definition fc_types.h:891
fcintl.h
Q_
#define Q_(String)
Definition fcintl.h:70
_
#define _(String)
Definition fcintl.h:67
N_
#define N_(String)
Definition fcintl.h:69
game
struct civ_game game
Definition game.c:57
wld
struct world wld
Definition game.c:58
game.h
government_name_translation
const char * government_name_translation(const struct government *pgovern)
Definition government.c:142
untargeted_revolution_allowed
bool untargeted_revolution_allowed(void)
Definition government.c:564
can_change_to_government
bool can_change_to_government(struct player *pplayer, const struct government *gov)
Definition government.c:165
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:928
clear_output_window
void clear_output_window(void)
Definition chatline.c:943
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:382
popup_upgrade_dialog
void popup_upgrade_dialog(struct unit_list *punits)
Definition dialogs.c:1444
popup_disband_dialog
void popup_disband_dialog(struct unit_list *punits)
Definition dialogs.c:1482
editgui_refresh
void editgui_refresh(void)
Definition editgui.c:1795
property_editor_popup
void property_editor_popup(struct property_editor *pe, enum editor_object_type objtype)
Definition editprop.c:6232
editprop_get_property_editor
struct property_editor * editprop_get_property_editor(void)
Definition editprop.c:6185
property_editor_reload
void property_editor_reload(struct property_editor *pe, enum editor_object_type objtype)
Definition editprop.c:6322
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:257
fullscreen_opt_refresh
void fullscreen_opt_refresh(struct option *poption)
Definition gui_main.c:2238
map_canvas_focus
gboolean map_canvas_focus(void)
Definition gui_main.c:366
toplevel
GtkWidget * toplevel
Definition gui_main.c:124
popup_quit_dialog
void popup_quit_dialog(void)
Definition gui_main.c:2154
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:281
popup_help_dialog_string
void popup_help_dialog_string(const char *item)
Definition helpdlg.c:211
luaconsole_dialog_popup
void luaconsole_dialog_popup(bool raise)
Definition luaconsole.c:126
center_on_unit
void center_on_unit(void)
Definition mapctrl.c:490
save_mapimg_callback
static void save_mapimg_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:687
show_national_borders_callback
static void show_national_borders_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1185
show_focus_unit_callback
static void show_focus_unit_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1421
setup_menus
GtkWidget * setup_menus(GtkWidget *window)
Definition menu.c:2115
auto_settle_callback
static void auto_settle_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1743
help_connecting_callback
static void help_connecting_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:843
menus_rename
static void menus_rename(const char *key, const gchar *new_label)
Definition menu.c:2249
help_combat_callback
static void help_combat_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1043
menu_entry_group_set_sensitive
static void menu_entry_group_set_sensitive(enum menu_entry_grouping group, gboolean is_sensitive)
Definition menu.c:2217
help_ruleset_callback
static void help_ruleset_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:995
select_single_callback
static void select_single_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1491
unit_unload_transporter_callback
static void unit_unload_transporter_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1683
bg_assign1_callback
static void bg_assign1_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:915
bg_append3_callback
static void bg_append3_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:971
help_government_callback
static void help_government_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1083
report_achievements_callback
static void report_achievements_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:819
show_fog_of_war_callback
static void show_fog_of_war_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1432
help_zoc_callback
static void help_zoc_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1051
show_city_productions_callback
static void show_city_productions_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1242
do_pillage_callback
static void do_pillage_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1940
bg_select0_callback
static void bg_select0_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:883
menu_remove_previous_entries
static void menu_remove_previous_entries(GtkMenu *menu)
Definition menu.c:2816
client_lua_script_callback
static void client_lua_script_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:803
bg_select2_callback
static void bg_select2_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:931
show_city_names_callback
static void show_city_names_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1219
help_space_race_callback
static void help_space_race_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1099
help_tileset_callback
static void help_tileset_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1003
help_playing_callback
static void help_playing_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:987
plant_callback
static void plant_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1801
menu_entries
static struct menu_entry_info menu_entries[]
Definition menu.c:264
base_callback
static void base_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1980
help_economy_callback
static void help_economy_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1011
unit_sentry_callback
static void unit_sentry_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1647
center_view_callback
static void center_view_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2005
unit_explore_callback
static void unit_explore_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1631
build_mine_callback
static void build_mine_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1793
quit_callback
static void quit_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:739
unit_return_callback
static void unit_return_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1621
ui_builder
static GtkBuilder * ui_builder
Definition menu.c:76
show_city_trade_routes_callback
static void show_city_trade_routes_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1265
show_road_rails_callback
static void show_road_rails_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1297
transform_terrain_callback
static void transform_terrain_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1873
help_wonders_callback
static void help_wonders_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1075
find_menu
static GtkMenu * find_menu(const char *key)
Definition menu.c:2262
show_terrain_callback
static void show_terrain_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1276
show_city_growth_callback
static void show_city_growth_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1231
show_stack_size_callback
static void show_stack_size_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1410
get_ui_filename
static const gchar * get_ui_filename(void)
Definition menu.c:2095
multiplier_callback
static void multiplier_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1964
help_terrain_callback
static void help_terrain_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1067
save_game_callback
static void save_game_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:671
show_unit_solid_bg_callback
static void show_unit_solid_bg_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1388
show_coastline_callback
static void show_coastline_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1287
toggle_fog_callback
static void toggle_fog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1463
show_city_full_bar_callback
static void show_city_full_bar_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1207
edit_mode_callback
static void edit_mode_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1140
help_chatline_callback
static void help_chatline_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:859
menus_free
void menus_free(void)
Definition menu.c:3138
connect_road_callback
static void connect_road_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1809
bg_append2_callback
static void bg_append2_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:947
help_overview_callback
static void help_overview_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:979
save_game_as_callback
static void save_game_as_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:679
help_diplomacy_callback
static void help_diplomacy_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1091
show_units_callback
static void show_units_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1377
show_irrigation_callback
static void show_irrigation_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1307
show_map_grid_callback
static void show_map_grid_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1174
help_improvements_callback
static void help_improvements_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1027
bg_append1_callback
static void bg_append1_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:923
recalc_borders_callback
static void recalc_borders_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1455
find_city_callback
static void find_city_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:747
report_nations_callback
static void report_nations_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:771
report_demographic_callback
static void report_demographic_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:811
help_worklist_editor_callback
static void help_worklist_editor_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:867
help_cities_callback
static void help_cities_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1019
leave_local_game_response
static void leave_local_game_response(GtkWidget *dialog, gint response)
Definition menu.c:704
help_language_callback
static void help_language_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:827
show_mine_callback
static void show_mine_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1317
server_options_callback
static void server_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:647
bg_append0_callback
static void bg_append0_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:899
leave_callback
static void leave_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:719
select_same_type_cont_callback
static void select_same_type_cont_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1515
unit_convert_callback
static void unit_convert_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1708
select_dialog_callback
static void select_dialog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1531
show_huts_callback
static void show_huts_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1347
report_wow_callback
static void report_wow_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:779
menu_entry_set_active
static void menu_entry_set_active(const char *key, gboolean is_active)
Definition menu.c:2191
unit_upgrade_callback
static void unit_upgrade_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1700
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:2792
help_tech_callback
static void help_tech_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1059
unit_goto_callback
static void unit_goto_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1555
build_city_callback
static void build_city_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1724
bg_select3_callback
static void bg_select3_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:955
clean_pollution_callback
static void clean_pollution_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1881
unit_patrol_callback
static void unit_patrol_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1639
real_menus_init
void real_menus_init(void)
Definition menu.c:2836
menu_entry_grouping
menu_entry_grouping
Definition menu.c:90
MGROUP_ALL
@ MGROUP_ALL
Definition menu.c:91
MGROUP_PLAYING
@ MGROUP_PLAYING
Definition menu.c:90
MGROUP_PLAYER
@ MGROUP_PLAYER
Definition menu.c:91
MGROUP_SAFE
@ MGROUP_SAFE
Definition menu.c:90
MGROUP_EDIT
@ MGROUP_EDIT
Definition menu.c:90
MGROUP_UNIT
@ MGROUP_UNIT
Definition menu.c:91
help_about_callback
static void help_about_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1123
bg_assign0_callback
static void bg_assign0_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:891
build_road_callback
static void build_road_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1751
local_options_callback
static void local_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:631
show_cities_callback
static void show_cities_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1367
unit_homecity_callback
static void unit_homecity_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1692
menu_entry_set_sensitive
static void menu_entry_set_sensitive(const char *key, gboolean is_sensitive)
Definition menu.c:2204
show_pollution_callback
static void show_pollution_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1357
save_options_callback
static void save_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:655
save_mapimg_as_callback
static void save_mapimg_as_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:695
worklists_callback
static void worklists_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:755
connect_maglev_callback
static void connect_maglev_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1841
full_screen_callback
static void full_screen_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1443
report_top_cities_callback
static void report_top_cities_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:787
help_controls_callback
static void help_controls_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:851
select_same_type_callback
static void select_same_type_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1523
connect_rail_callback
static void connect_rail_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1825
unit_wait_callback
static void unit_wait_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1539
get_tile_change_menu_text
static const char * get_tile_change_menu_text(struct tile *ptile, enum unit_activity activity)
Definition menu.c:2302
build_airbase_callback
static void build_airbase_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1924
report_cities_callback
static void report_cities_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2021
help_cma_callback
static void help_cma_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:875
message_options_callback
static void message_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:639
tax_rate_callback
static void tax_rate_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1956
unit_goto_city_callback
static void unit_goto_city_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1611
menu_entry_info_find
static struct menu_entry_info * menu_entry_info_find(const char *key)
Definition menu.c:2175
bg_select1_callback
static void bg_select1_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:907
government_callback
static void government_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1972
report_economy_callback
static void report_economy_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2029
report_messages_callback
static void report_messages_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:795
do_paradrop_callback
static void do_paradrop_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1932
show_bases_callback
static void show_bases_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1327
select_same_type_tile_callback
static void select_same_type_tile_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1507
unit_unsentry_callback
static void unit_unsentry_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1655
save_options_on_exit_callback
static void save_options_on_exit_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1131
show_native_tiles_callback
static void show_native_tiles_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1196
menu_entry_init
static void menu_entry_init(GtkBuildable *item)
Definition menu.c:2055
show_unit_shields_callback
static void show_unit_shields_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1399
reload_tileset_callback
static void reload_tileset_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:663
scenario_properties_callback
static void scenario_properties_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1471
clear_chat_logs_callback
static void clear_chat_logs_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:615
unit_deboard_callback
static void unit_deboard_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1673
help_policies_callback
static void help_policies_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:835
unit_done_callback
static void unit_done_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1547
help_nations_callback
static void help_nations_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1107
unit_goto_and_callback
static void unit_goto_and_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1563
show_city_output_callback
static void show_city_output_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1163
show_city_outlines_callback
static void show_city_outlines_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1152
save_scenario_callback
static void save_scenario_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1483
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:1115
cultivate_callback
static void cultivate_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1785
save_chat_logs_callback
static void save_chat_logs_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:623
real_menus_update
void real_menus_update(void)
Definition menu.c:2317
report_spaceship_callback
static void report_spaceship_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2045
select_all_on_tile_callback
static void select_all_on_tile_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1499
show_city_buy_cost_callback
static void show_city_buy_cost_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1254
build_fortress_callback
static void build_fortress_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1906
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:2270
clean_fallout_callback
static void clean_fallout_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1898
unit_board_callback
static void unit_board_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1663
menu_entry_set_visible
static void menu_entry_set_visible(const char *key, gboolean is_visible, gboolean is_sensitive)
Definition menu.c:2233
fortify_callback
static void fortify_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1914
bg_assign3_callback
static void bg_assign3_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:963
show_resources_callback
static void show_resources_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1337
connect_irrigation_callback
static void connect_irrigation_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1857
build_irrigation_callback
static void build_irrigation_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1777
bg_assign2_callback
static void bg_assign2_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:939
report_units_callback
static void report_units_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2013
road_callback
static void road_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1992
unit_disband_callback
static void unit_disband_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1716
help_units_callback
static void help_units_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1035
report_research_callback
static void report_research_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2037
diplomat_action_callback
static void diplomat_action_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1948
map_view_callback
static void map_view_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:763
popup_messageopt_dialog
void popup_messageopt_dialog(void)
Definition messagedlg.c:51
meswin_dialog_popup
void meswin_dialog_popup(bool raise)
Definition messagewin.c:416
option_dialog_popup
void option_dialog_popup(const char *name, const struct option_set *poptset)
Definition optiondlg.c:979
save_mapimg_dialog_popup
void save_mapimg_dialog_popup(void)
Definition pages.c:3549
mapimg_client_save
void mapimg_client_save(const char *filename)
Definition pages.c:3568
save_game_dialog_popup
void save_game_dialog_popup(void)
Definition pages.c:3485
save_scenario_dialog_popup
void save_scenario_dialog_popup(void)
Definition pages.c:3520
popup_players_dialog
void popup_players_dialog(bool raise)
Definition plrdlg.c:91
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:1242
units_report_dialog_popup
void units_report_dialog_popup(bool raise)
Definition repodlgs.c:1765
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:286
infra_dialog_popup
void infra_dialog_popup(void)
Definition infradlg.c:85
rally_dialog_callback
static void rally_dialog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1548
infra_dialog_callback
static void infra_dialog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1556
rally_dialog_popup
void rally_dialog_popup(void)
Definition rallypointdlg.c:66
editgui.h
editprop.h
gamedlgs.h
gui_stuff.h
infradlg.h
rallypointdlg.h
unitselect.h
chatline.h
cityrep.h
popup_revolution_dialog
void popup_revolution_dialog(void)
Definition dialogs.c:109
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_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:182
improvement_name_translation
const char * improvement_name_translation(const struct impr_type *pimprove)
Definition improvement.c:241
improvement_iterate_end
#define improvement_iterate_end
Definition improvement.h:211
improvement_iterate
#define improvement_iterate(_p)
Definition improvement.h:205
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:69
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:4009
client_optset
const struct option_set * client_optset
Definition options.c:1255
options_save
void options_save(option_save_log_callback log_cb)
Definition options.c:6053
gui_options
struct client_options gui_options
Definition options.c:71
options.h
REPORT_WONDERS_OF_THE_WORLD
@ REPORT_WONDERS_OF_THE_WORLD
Definition packets.h:74
REPORT_DEMOGRAPHIC
@ REPORT_DEMOGRAPHIC
Definition packets.h:76
REPORT_TOP_5_CITIES
@ REPORT_TOP_5_CITIES
Definition packets.h:75
REPORT_ACHIEVEMENTS
@ REPORT_ACHIEVEMENTS
Definition packets.h:77
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:1094
get_data_dirs
const struct strvec * get_data_dirs(void)
Definition shared.c:886
shared.h
action
Definition actions.h:379
action::id
action_id id
Definition actions.h:380
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:207
client_options::draw_specials
bool draw_specials
Definition options.h:199
client_options::draw_city_output
bool draw_city_output
Definition options.h:186
client_options::draw_city_names
bool draw_city_names
Definition options.h:188
client_options::draw_city_productions
bool draw_city_productions
Definition options.h:190
client_options::draw_mines
bool draw_mines
Definition options.h:197
client_options::draw_borders
bool draw_borders
Definition options.h:206
client_options::draw_fortress_airbase
bool draw_fortress_airbase
Definition options.h:198
client_options::draw_city_buycost
bool draw_city_buycost
Definition options.h:191
client_options::draw_unit_stack_size
bool draw_unit_stack_size
Definition options.h:210
client_options::draw_irrigation
bool draw_irrigation
Definition options.h:196
client_options::draw_terrain
bool draw_terrain
Definition options.h:193
client_options::draw_units
bool draw_units
Definition options.h:203
client_options::draw_fog_of_war
bool draw_fog_of_war
Definition options.h:205
client_options::draw_city_trade_routes
bool draw_city_trade_routes
Definition options.h:192
client_options::draw_unit_shields
bool draw_unit_shields
Definition options.h:209
client_options::draw_cities
bool draw_cities
Definition options.h:202
client_options::save_options_on_exit
bool save_options_on_exit
Definition options.h:121
client_options::draw_map_grid
bool draw_map_grid
Definition options.h:187
client_options::draw_city_growth
bool draw_city_growth
Definition options.h:189
client_options::draw_huts
bool draw_huts
Definition options.h:200
client_options::draw_focus_unit
bool draw_focus_unit
Definition options.h:204
client_options::draw_city_outlines
bool draw_city_outlines
Definition options.h:185
client_options::draw_coastline
bool draw_coastline
Definition options.h:194
client_options::draw_full_citybar
bool draw_full_citybar
Definition options.h:208
client_options::draw_roads_rails
bool draw_roads_rails
Definition options.h:195
client_options::draw_pollution
bool draw_pollution
Definition options.h:201
client_options::solid_color_behind_units
bool solid_color_behind_units
Definition options.h:142
connection::established
bool established
Definition connection.h:145
connection::playing
struct player * playing
Definition connection.h:156
connection::used
bool used
Definition connection.h:144
extra_type
Definition extras.h:85
extra_type::data
struct extra_type::@24 data
government
Definition government.h:52
impr_type
Definition improvement.h:68
item
Definition climisc.h:80
menu_entry_info
Definition menu.c:96
menu_entry_info::accel_mod
GdkModifierType accel_mod
Definition menu.c:100
menu_entry_info::accel
guint accel
Definition menu.c:99
menu_entry_info::key
const char * key
Definition menu.c:97
menu_entry_info::grouping
enum menu_entry_grouping grouping
Definition menu.c:102
menu_entry_info::cb
GCallback cb
Definition menu.c:101
menu_entry_info::name
const char * name
Definition menu.c:98
packet_game_info::borders
enum borders_mode borders
Definition packets_gen.h:133
packet_game_info::changable_tax
bool changable_tax
Definition packets_gen.h:141
packet_game_info::is_edit_mode
bool is_edit_mode
Definition packets_gen.h:185
property_editor
Definition editprop.c:644
road_type
Definition road.h:75
terrain
Definition terrain.h:176
terrain::cultivate_result
struct terrain * cultivate_result
Definition terrain.h:203
terrain::plant_result
struct terrain * plant_result
Definition terrain.h:206
terrain::transform_result
struct terrain * transform_result
Definition terrain.h:217
tile
Definition tile.h:49
unit_type
Definition unittype.h:481
unit
Definition unit.h:138
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:969
support.h
sz_strlcpy
#define sz_strlcpy(dest, src)
Definition support.h:161
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:290
advance_number
Tech_type_id advance_number(const struct advance *padvance)
Definition tech.c:98
advance_iterate
#define advance_iterate(_start, _p)
Definition tech.h:264
A_FIRST
#define A_FIRST
Definition tech.h:44
advance_iterate_end
#define advance_iterate_end
Definition tech.h:270
T_NONE
#define T_NONE
Definition terrain.h:56
tile_virtual_destroy
void tile_virtual_destroy(struct tile *vtile)
Definition tile.c:1018
tile_apply_activity
bool tile_apply_activity(struct tile *ptile, Activity_type_id act, struct extra_type *tgt)
Definition tile.c:658
tile_virtual_new
struct tile * tile_virtual_new(const struct tile *ptile)
Definition tile.c:966
tile_get_info_text
const char * tile_get_info_text(const struct tile *ptile, bool include_nuisances, int linebreaks)
Definition tile.c:756
tile_city
struct city * tile_city(const struct tile *ptile)
Definition tile.c:83
tile_terrain
#define tile_terrain(_tile)
Definition tile.h:109
tilespec_reread
bool tilespec_reread(const char *new_tileset_name, bool game_fully_initialized, float scale)
Definition tilespec.c:1299
tilespec.h
can_unit_change_homecity
bool can_unit_change_homecity(const struct unit *punit)
Definition unit.c:464
unit_can_est_trade_route_here
bool unit_can_est_trade_route_here(const struct unit *punit)
Definition unit.c:289
unit_can_add_or_build_city
bool unit_can_add_or_build_city(const struct unit *punit)
Definition unit.c:430
can_unit_do_autosettlers
bool can_unit_do_autosettlers(const struct unit *punit)
Definition unit.c:583
unit_can_help_build_wonder_here
bool unit_can_help_build_wonder_here(const struct unit *punit)
Definition unit.c:263
can_unit_paradrop
bool can_unit_paradrop(const struct civ_map *nmap, const struct unit *punit)
Definition unit.c:827
unit.h
unit_tile
#define unit_tile(_pu)
Definition unit.h:388
ORDER_PERFORM_ACTION
@ ORDER_PERFORM_ACTION
Definition unit.h:47
unit_owner
#define unit_owner(_pu)
Definition unit.h:387
units_can_convert
bool units_can_convert(const struct civ_map *nmap, const struct unit_list *punits)
Definition unitlist.c:353
units_are_occupied
bool units_are_occupied(const struct unit_list *punits)
Definition unitlist.c:277
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:184
can_units_do_any_road
bool can_units_do_any_road(const struct civ_map *nmap, const struct unit_list *punits)
Definition unitlist.c:165
units_can_upgrade
bool units_can_upgrade(const struct civ_map *nmap, const struct unit_list *punits)
Definition unitlist.c:338
units_can_unload
bool units_can_unload(const struct unit_list *punits)
Definition unitlist.c:305
units_have_activity_on_tile
bool units_have_activity_on_tile(const struct unit_list *punits, enum unit_activity activity)
Definition unitlist.c:322
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:206
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:243
units_can_load
bool units_can_load(const struct unit_list *punits)
Definition unitlist.c:291
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:1755
utype_name_translation
const char * utype_name_translation(const struct unit_type *punittype)
Definition unittype.c:1612
utype_can_do_action
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
Definition unittype.c:443