Freeciv-3.3
Loading...
Searching...
No Matches
menu.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18#include <stdlib.h>
19
20#include <gtk/gtk.h>
21
22/* utility */
23#include "fcintl.h"
24#include "log.h"
25#include "shared.h"
26#include "support.h"
27
28/* common */
29#include "game.h"
30#include "government.h"
31#include "road.h"
32#include "unit.h"
33
34/* client */
35#include "client_main.h"
36#include "clinet.h"
37#include "connectdlg_common.h"
38#include "control.h"
39#include "mapview_common.h"
40#include "options.h"
41#include "tilespec.h"
42
43/* client/gui-gtk-5.0 */
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
74static bool menus_built = FALSE;
75
77
79
82
90
91struct menu_entry_info {
92 const char *key;
93 const char *name;
94 const char *action;
95 const char *accl;
97 void (*toggle)(GSimpleAction *act, GVariant *value, gpointer data);
98 bool state; /* Only for toggle actions */
99};
100
103static GMenuItem *create_toggle_menu_item_for_key(const char *key);
104
105/* Menu entry callbacks */
107 GVariant *parameter,
108 gpointer data);
110 GVariant *parameter,
111 gpointer data);
113 GVariant *parameter,
114 gpointer data);
116 GVariant *parameter,
117 gpointer data);
119 GVariant *parameter,
120 gpointer data);
122 GVariant *parameter,
123 gpointer data);
125 GVariant *parameter,
126 gpointer data);
128 GVariant *parameter,
129 gpointer data);
131 GVariant *parameter,
132 gpointer data);
133
134#ifdef FREECIV_DEBUG
136 GVariant *parameter,
137 gpointer data);
138#endif /* FREECIV_DEBUG */
139
141 GVariant *parameter,
142 gpointer data);
144 GVariant *parameter,
145 gpointer data);
147 GVariant *parameter,
148 gpointer data);
150 GVariant *parameter,
151 gpointer data);
153 GVariant *parameter,
154 gpointer data);
156 GVariant *parameter,
157 gpointer data);
159 GVariant *parameter,
160 gpointer data);
162 GVariant *parameter,
163 gpointer data);
165 GVariant *parameter,
166 gpointer data);
168 GVariant *parameter,
169 gpointer data);
171 GVariant *parameter,
172 gpointer data);
174 GVariant *parameter,
175 gpointer data);
177 GVariant *parameter,
178 gpointer data);
180 GVariant *parameter,
181 gpointer data);
183 GVariant *parameter,
184 gpointer data);
186 GVariant *parameter,
187 gpointer data);
189 GVariant *parameter,
190 gpointer data);
192 GVariant *parameter,
193 gpointer data);
195 GVariant *parameter,
196 gpointer data);
198 GVariant *parameter,
199 gpointer data);
201 GVariant *parameter,
202 gpointer data);
204 GVariant *parameter,
205 gpointer data);
207 GVariant *parameter,
208 gpointer data);
210 GVariant *parameter,
211 gpointer data);
213 GVariant *parameter,
214 gpointer data);
216 GVariant *parameter,
217 gpointer data);
219 GVariant *parameter,
220 gpointer data);
222 GVariant *parameter,
223 gpointer data);
225 GVariant *parameter,
226 gpointer data);
228 GVariant *parameter,
229 gpointer data);
231 GVariant *parameter,
232 gpointer data);
234 GVariant *parameter,
235 gpointer data);
237 GVariant *parameter,
238 gpointer data);
240 GVariant *parameter,
241 gpointer data);
243 GVariant *parameter,
244 gpointer data);
246 GVariant *parameter,
247 gpointer data);
249 GVariant *parameter,
250 gpointer data);
252 GVariant *parameter,
253 gpointer data);
255 GVariant *parameter,
256 gpointer data);
258 GVariant *parameter,
259 gpointer data);
261 GVariant *parameter,
262 gpointer data);
264 GVariant *parameter,
265 gpointer data);
267 GVariant *parameter,
268 gpointer data);
270 GVariant *parameter,
271 gpointer data);
273 GVariant *parameter,
274 gpointer data);
276 GVariant *parameter,
277 gpointer data);
279 GVariant *parameter,
280 gpointer data);
282 GVariant *parameter,
283 gpointer data);
285 GVariant *parameter,
286 gpointer data);
288 GVariant *parameter,
289 gpointer data);
291 GVariant *parameter,
292 gpointer data);
294 GVariant *parameter,
295 gpointer data);
297 GVariant *parameter,
298 gpointer data);
300 GVariant *parameter,
301 gpointer data);
303 GVariant *parameter,
304 gpointer data);
306 GVariant *parameter,
307 gpointer data);
309 GVariant *parameter,
310 gpointer data);
312 GVariant *parameter,
313 gpointer data);
315 GVariant *parameter,
316 gpointer data);
318 GVariant *parameter,
319 gpointer data);
321 GVariant *parameter,
322 gpointer data);
324 GVariant *parameter,
325 gpointer data);
327 GVariant *parameter,
328 gpointer data);
330 GVariant *parameter,
331 gpointer data);
333 GVariant *parameter,
334 gpointer data);
336 GVariant *parameter,
337 gpointer data);
339 GVariant *parameter,
340 gpointer data);
342 GVariant *parameter,
343 gpointer data);
345 GVariant *parameter,
346 gpointer data);
348 GVariant *parameter,
349 gpointer data);
351 GVariant *parameter,
352 gpointer data);
354 GVariant *parameter,
355 gpointer data);
357 GVariant *parameter,
358 gpointer data);
360 GVariant *parameter,
361 gpointer data);
363 GVariant *parameter,
364 gpointer data);
366 GVariant *parameter,
367 gpointer data);
369 GVariant *parameter,
370 gpointer data);
372 GVariant *parameter,
373 gpointer data);
375 GVariant *parameter,
376 gpointer data);
378 GVariant *parameter,
379 gpointer data);
380
382 GVariant *parameter,
383 gpointer data);
385 GVariant *parameter,
386 gpointer data);
388 GVariant *parameter,
389 gpointer data);
391 GVariant *parameter,
392 gpointer data);
394 GVariant *parameter,
395 gpointer data);
397 GVariant *parameter,
398 gpointer data);
400 GVariant *parameter,
401 gpointer data);
403 GVariant *parameter,
404 gpointer data);
406 GVariant *parameter,
407 gpointer data);
409 GVariant *parameter,
410 gpointer data);
412 GVariant *parameter,
413 gpointer data);
415 GVariant *parameter,
416 gpointer data);
418 GVariant *parameter,
419 gpointer data);
421 GVariant *parameter,
422 gpointer data);
424 GVariant *parameter,
425 gpointer data);
427 GVariant *parameter,
428 gpointer data);
430 GVariant *parameter,
431 gpointer data);
433 GVariant *parameter,
434 gpointer data);
436 GVariant *parameter,
437 gpointer data);
439 GVariant *parameter,
440 gpointer data);
442 GVariant *parameter,
443 gpointer data);
445 GVariant *parameter,
446 gpointer data);
448 GVariant *parameter,
449 gpointer data);
451 GVariant *parameter,
452 gpointer data);
454 GVariant *parameter,
455 gpointer data);
457 GVariant *parameter,
458 gpointer data);
460 GVariant *parameter,
461 gpointer data);
463 GVariant *parameter,
464 gpointer data);
466 GVariant *parameter,
467 gpointer data);
469 GVariant *parameter,
470 gpointer data);
472 GVariant *parameter,
473 gpointer data);
475 GVariant *parameter,
476 gpointer data);
478 GVariant *parameter,
479 gpointer data);
480
482 GVariant *parameter,
483 gpointer data);
485 GVariant *parameter,
486 gpointer data);
488 GVariant *parameter,
489 gpointer data);
491 GVariant *parameter,
492 gpointer data);
494 GVariant *parameter,
495 gpointer data);
497 GVariant *parameter,
498 gpointer data);
500 GVariant *parameter,
501 gpointer data);
503 GVariant *parameter,
504 gpointer data);
506 GVariant *parameter,
507 gpointer data);
509 GVariant *parameter,
510 gpointer data);
512 GVariant *parameter,
513 gpointer data);
515 GVariant *parameter,
516 gpointer data);
518 GVariant *parameter,
519 gpointer data);
521 GVariant *parameter,
522 gpointer data);
523
525 GVariant *parameter,
526 gpointer data);
528 GVariant *parameter,
529 gpointer data);
531 GVariant *parameter,
532 gpointer data);
533
535{
536 /* Game menu */
537 { "CLEAR_CHAT_LOGS", N_("_Clear Chat Log"),
538 "clear_chat", NULL, MGROUP_SAFE,
539 NULL, FALSE },
540 { "SAVE_CHAT_LOGS", N_("Save Chat _Log"),
541 "save_chat", NULL, MGROUP_SAFE,
542 NULL, FALSE },
543
544 { "LOCAL_OPTIONS", N_("_Local Client"),
545 "local_options", NULL, MGROUP_SAFE,
546 NULL, FALSE },
547 { "MESSAGE_OPTIONS", N_("_Message"),
548 "message_options", NULL, MGROUP_SAFE,
549 NULL, FALSE },
550 { "SERVER_OPTIONS", N_("_Remote Server"),
551 "server_options", NULL, MGROUP_SAFE,
552 NULL, FALSE },
553 { "SAVE_OPTIONS", N_("Save Options _Now"),
554 "save_options", NULL, MGROUP_SAFE,
555 NULL, FALSE },
556 { "SAVE_OPTIONS_ON_EXIT", N_("Save Options on _Exit"),
557 "save_options_on_exit", NULL, MGROUP_SAFE,
559
560#ifdef FREECIV_DEBUG
561 { "RELOAD_TILESET", N_("_Reload Tileset"),
562 "reload_tileset", "<ctrl><alt>r", MGROUP_SAFE,
563 NULL, FALSE },
564#endif /* FREECIV_DEBUG */
565
566 { "GAME_SAVE", N_("_Save Game"),
567 "game_save", "<ctrl>s", MGROUP_SAFE,
568 NULL, FALSE },
569 { "GAME_SAVE_AS", N_("Save Game _As..."),
570 "game_save_as", NULL, MGROUP_SAFE,
571 NULL, FALSE },
572 { "MAPIMG_SAVE", N_("Save Map _Image"),
573 "save_mapimg", NULL, MGROUP_SAFE,
574 NULL, FALSE },
575 { "MAPIMG_SAVE_AS", N_("Save _Map Image As..."),
576 "save_mapimg_as", NULL, MGROUP_SAFE,
577 NULL, FALSE },
578 { "LEAVE", N_("_Leave"),
579 "leave", NULL, MGROUP_SAFE,
580 NULL, FALSE },
581 { "QUIT", N_("_Quit"),
582 "quit", "<ctrl>q", MGROUP_SAFE,
583 NULL, FALSE },
584
585 /* Edit menu */
586 { "FIND_CITY", N_("_Find City"),
587 "find_city", "<ctrl>f", MGROUP_SAFE,
588 NULL, FALSE },
589 { "WORKLISTS", N_("Work_lists"),
590 "worklists", "<ctrl><shift>l", MGROUP_SAFE,
591 NULL, FALSE },
592 { "RALLY_DLG", N_("Rally point dialog"),
593 "rally_dlg", "<ctrl><shift>r", MGROUP_SAFE,
594 NULL, FALSE },
595 { "INFRA_DLG", N_("Infra dialog"),
596 "infra_dlg", "<ctrl><shift>f", MGROUP_SAFE,
597 NULL, FALSE },
598 { "EDIT_MODE", N_("_Editing Mode"),
599 "edit_mode", "<ctrl>e", MGROUP_SAFE,
601 { "TOGGLE_FOG", N_("Toggle Fog of _War"),
602 "toggle_fog", "<ctrl><shift>w", MGROUP_EDIT,
604 { "SCENARIO_PROPERTIES", N_("Game/Scenario Properties"),
605 "scenario_props", NULL, MGROUP_EDIT,
606 NULL, FALSE },
607 { "SCENARIO_SAVE", N_("Save Scenario"),
608 "scenario_save", NULL, MGROUP_EDIT,
609 NULL, FALSE },
610 { "CLIENT_LUA_SCRIPT", N_("Client _Lua Script"),
611 "lua_script", NULL, MGROUP_SAFE,
612 NULL, FALSE },
613
614 /* View menu */
615 { "SHOW_CITY_OUTLINES", N_("Cit_y Outlines"),
616 "show_city_outlines", "<ctrl>y", MGROUP_SAFE,
618 { "SHOW_CITY_OUTPUT", N_("City Output"),
619 "show_city_output", "<ctrl>v", MGROUP_SAFE,
621 { "SHOW_MAP_GRID", N_("Map _Grid"),
622 "show_map_grid", "<ctrl>g", MGROUP_SAFE,
624 { "SHOW_NAT_BORDERS", N_("National _Borders"),
625 "show_nat_borders", "<ctrl>b", MGROUP_SAFE,
627 { "SHOW_NATIVE_TILES", N_("Native Tiles"),
628 "show_native_tiles", "<ctrl><shift>n", MGROUP_SAFE,
630 { "SHOW_CITY_FULL_BAR", N_("City Full Bar"),
631 "show_city_full_bar", NULL, MGROUP_SAFE,
633 { "SHOW_CITY_NAMES", N_("City _Names"),
634 "show_city_names", "<ctrl>n", MGROUP_SAFE,
636 { "SHOW_CITY_GROWTH", N_("City G_rowth"),
637 "show_city_growth", "<ctrl>o", MGROUP_SAFE,
639 { "SHOW_CITY_PRODUCTIONS", N_("City _Production"),
640 "show_city_productions", "<ctrl>p", MGROUP_SAFE,
642 { "SHOW_CITY_BUY_COST", N_("City Buy Cost"),
643 "show_city_buy_cost", NULL, MGROUP_SAFE,
645 { "SHOW_CITY_TRADE_ROUTES", N_("City Tra_deroutes"),
646 "show_trade_routes", "<ctrl>d", MGROUP_SAFE,
648 { "SHOW_TERRAIN", N_("_Terrain"),
649 "show_terrain", NULL, MGROUP_SAFE,
651 { "SHOW_COASTLINE", N_("C_oastline"),
652 "show_coastline", NULL, MGROUP_SAFE,
654 { "SHOW_PATHS", N_("_Paths"),
655 "show_paths", NULL, MGROUP_SAFE,
657 { "SHOW_IRRIGATION", N_("_Irrigation"),
658 "show_irrigation", NULL, MGROUP_SAFE,
660 { "SHOW_MINES", N_("_Mines"),
661 "show_mines", NULL, MGROUP_SAFE,
663 { "SHOW_BASES", N_("_Bases"),
664 "show_bases", NULL, MGROUP_SAFE,
666 { "SHOW_RESOURCES", N_("_Resources"),
667 "show_resources", NULL, MGROUP_SAFE,
669 { "SHOW_HUTS", N_("_Huts"),
670 "show_huts", NULL, MGROUP_SAFE,
672 { "SHOW_POLLUTION", N_("Po_llution & Fallout"),
673 "show_pollution", NULL, MGROUP_SAFE,
675 { "SHOW_CITIES", N_("Citi_es"),
676 "show_cities", NULL, MGROUP_SAFE,
678 { "SHOW_UNITS", N_("_Units"),
679 "show_units", NULL, MGROUP_SAFE,
681 { "SHOW_UNIT_SOLID_BG", N_("Unit Solid Background"),
682 "show_unit_solid_bg", NULL, MGROUP_SAFE,
684 { "SHOW_UNIT_SHIELDS", N_("Unit shields"),
685 "show_unit_shields", NULL, MGROUP_SAFE,
687 { "SHOW_STACK_SIZE", N_("Unit Stack Size"),
688 "show_stack_size", "<ctrl>plus", MGROUP_SAFE,
690 { "SHOW_FOCUS_UNIT", N_("Focu_s Unit"),
691 "show_focus_unit", NULL, MGROUP_SAFE,
693 { "SHOW_FOG_OF_WAR", N_("Fog of _War"),
694 "show_fow", NULL, MGROUP_SAFE,
696
697 { "FULL_SCREEN", N_("_Fullscreen"),
698 "full_screen", "<ctrl>F11", MGROUP_SAFE,
700 { "CENTER_VIEW", N_("_Center View"),
701 "center_view", "c", MGROUP_PLAYER,
702 NULL, FALSE },
703
704 /* Select menu */
705 { "SELECT_SINGLE", N_("_Single Unit (Unselect Others)"),
706 "select_single", "z", MGROUP_UNIT,
707 NULL, FALSE },
708 { "SELECT_ALL_ON_TILE", N_("_All On Tile"),
709 "select_all_tile", "v", MGROUP_UNIT,
710 NULL, FALSE },
711 { "SELECT_SAME_TYPE_TILE", N_("Same Type on _Tile"),
712 "select_same_type_tile", "<shift>v", MGROUP_UNIT,
713 NULL, FALSE },
714 { "SELECT_SAME_TYPE_CONT", N_("Same Type on _Continent"),
715 "select_same_type_cont", "<shift>c", MGROUP_UNIT,
716 NULL, FALSE },
717 { "SELECT_SAME_TYPE", N_("Same Type _Everywhere"),
718 "select_same_type", "<shift>x", MGROUP_UNIT,
719 NULL, FALSE },
720 { "SELECT_DLG", N_("Unit Selection Dialog"),
721 "select_dlg", NULL, MGROUP_UNIT,
722 NULL, FALSE },
723
724 /* Unit menu */
725 { "UNIT_GOTO", N_("_Go to"),
726 "goto", "g", MGROUP_UNIT,
727 NULL, FALSE },
728 { "UNIT_GOTO_CITY", N_("Go _to/Airlift to City..."),
729 "goto_city", "t", MGROUP_UNIT,
730 NULL, FALSE },
731 { "UNIT_RETURN", N_("_Return to Nearest City"),
732 "return", "<shift>g", MGROUP_UNIT,
733 NULL, FALSE },
734 { "UNIT_EXPLORE", N_("Auto E_xplore"),
735 "explore", "x", MGROUP_UNIT,
736 NULL, FALSE },
737 { "UNIT_PATROL", N_("_Patrol"),
738 "patrol", "q", MGROUP_UNIT,
739 NULL, FALSE },
740 { "UNIT_TELEPORT", N_("_Teleport"),
741 "teleport", NULL, MGROUP_UNIT,
742 NULL, FALSE },
743 { "UNIT_SENTRY", N_("_Sentry"),
744 "sentry", "s", MGROUP_UNIT,
745 NULL, FALSE },
746 { "UNSENTRY_ALL", N_("Uns_entry All On Tile"),
747 "unsentry_all", "<shift>s", MGROUP_UNIT,
748 NULL, FALSE },
749 { "UNIT_BOARD", N_("_Load"),
750 "board", "l", MGROUP_UNIT,
751 NULL, FALSE },
752 { "UNIT_DEBOARD", N_("_Unload"),
753 "deboard", "u", MGROUP_UNIT,
754 NULL, FALSE },
755 { "UNIT_UNLOAD_TRANSPORTER", N_("U_nload All From Transporter"),
756 "unload_transporter", "<shift>t", MGROUP_UNIT,
757 NULL, FALSE },
758 { "UNIT_HOMECITY", N_("Set _Home City"),
759 "homecity", "h", MGROUP_UNIT,
760 NULL, FALSE },
761 { "UNIT_UPGRADE", N_("Upgr_ade"),
762 "upgrade", "<shift>u", MGROUP_UNIT,
763 NULL, FALSE },
764 { "UNIT_CONVERT", N_("C_onvert"),
765 "convert", "<shift>o", MGROUP_UNIT,
766 NULL, FALSE },
767 { "UNIT_DISBAND", N_("_Disband"),
768 "disband", "<shift>d", MGROUP_UNIT,
769 NULL, FALSE },
770 { "DO_ACTION", N_("_Do..."),
771 "do_action", "d", MGROUP_UNIT,
772 NULL, FALSE },
773 { "UNIT_WAIT", N_("_Wait"),
774 "wait", "w", MGROUP_UNIT,
775 NULL, FALSE },
776 { "UNIT_DONE", N_("_Done"),
777 "done", "space", MGROUP_UNIT,
778 NULL, FALSE },
779
780 /* Work menu */
781 { "BUILD_CITY", N_("_Build City"),
782 "build_city", "b", MGROUP_UNIT,
783 NULL, FALSE },
784 { "AUTO_WORKER", N_("_Auto Worker"),
785 "auto_work", "a", MGROUP_UNIT,
786 NULL, FALSE },
787 { "BUILD_ROAD", N_("Build _Road"),
788 "build_road", "r", MGROUP_UNIT,
789 NULL, FALSE },
790 { "BUILD_IRRIGATION", N_("Build _Irrigation"),
791 "build_irrigation", "i", MGROUP_UNIT,
792 NULL, FALSE },
793 { "BUILD_MINE", N_("Build _Mine"),
794 "build_mine", "m", MGROUP_UNIT,
795 NULL, FALSE },
796 { "CULTIVATE", N_("Cultivate"),
797 "cultivate", "<shift>i", MGROUP_UNIT,
798 NULL, FALSE },
799 { "PLANT", N_("Plant"),
800 "plant", "<shift>m", MGROUP_UNIT,
801 NULL, FALSE },
802 { "TRANSFORM_TERRAIN", N_("Transf_orm Terrain"),
803 "transform_terrain", "o", MGROUP_UNIT,
804 NULL, FALSE },
805 { "CONNECT_ROAD", N_("Connect With Roa_d"),
806 "connect_road", "<ctrl>r", MGROUP_UNIT,
807 NULL, FALSE },
808 { "CONNECT_RAIL", N_("Connect With Rai_l"),
809 "connect_rail", "<ctrl>l", MGROUP_UNIT,
810 NULL, FALSE },
811 { "CONNECT_MAGLEV", N_("Connect With _Maglev"),
812 "connect_maglev", "<ctrl>m", MGROUP_UNIT,
813 NULL, FALSE },
814 { "CONNECT_IRRIGATION", N_("Connect With Irri_gation"),
815 "connect_irrigation", "<ctrl>i", MGROUP_UNIT,
816 NULL, FALSE },
817 { "CLEAN", N_("_Clean"),
818 "clean", "p", MGROUP_UNIT,
819 NULL, FALSE },
820
821 /* Combat menu */
822 { "FORTIFY", N_("Fortify"),
823 "fortify", "f", MGROUP_UNIT,
824 NULL, FALSE },
825 { "BUILD_FORTRESS", N_("Build Fortress"),
826 "build_base_fortress", "<shift>f", MGROUP_UNIT,
827 NULL, FALSE },
828 { "BUILD_AIRBASE", N_("Build Airbase"),
829 "build_base_airbase", "<shift>e", MGROUP_UNIT,
830 NULL, FALSE },
831 { "PARADROP", N_("P_aradrop"),
832 "paradrop", "j", MGROUP_UNIT,
833 NULL, FALSE },
834 { "PILLAGE", N_("_Pillage"),
835 "pillage", "<shift>p", MGROUP_UNIT,
836 NULL, FALSE },
837
838 /* Civilization */
839 { "MAP_VIEW", N_("?noun:_View"),
840 "map_view", "F1", MGROUP_SAFE,
841 NULL, FALSE },
842 { "REPORT_UNITS", N_("_Units"),
843 "report_units", "F2", MGROUP_SAFE,
844 NULL, FALSE },
845 { "REPORT_NATIONS", N_("_Nations"),
846 "report_nations", "F3", MGROUP_SAFE,
847 NULL, FALSE },
848 { "REPORT_CITIES", N_("_Cities"),
849 "report_cities", "F4", MGROUP_SAFE,
850 NULL, FALSE },
851 { "REPORT_ECONOMY", N_("_Economy"),
852 "report_economy", "F5", MGROUP_PLAYER,
853 NULL, FALSE },
854 { "REPORT_RESEARCH", N_("_Research"),
855 "report_research", "F6", MGROUP_PLAYER,
856 NULL, FALSE },
857
858 { "TAX_RATES", N_("_Tax Rates..."),
859 "tax_rates", "<ctrl>t", MGROUP_PLAYING,
860 NULL, FALSE },
861 { "POLICIES", N_("_Policies..."),
862 "policies", "<shift><ctrl>p", MGROUP_PLAYER,
863 NULL, FALSE },
864 { "START_REVOLUTION", N_("_Revolution..."),
865 "revolution", "<shift><ctrl>g", MGROUP_PLAYING,
866 NULL, FALSE },
867
868 { "REPORT_WOW", N_("_Wonders of the World"),
869 "report_wow", "F7", MGROUP_SAFE,
870 NULL, FALSE },
871 { "REPORT_TOP_CITIES", N_("Top Cities"),
872 "report_top_cities", "F8", MGROUP_SAFE,
873 NULL, FALSE },
874 { "REPORT_MESSAGES", N_("_Messages"),
875 "report_messages", "F9", MGROUP_SAFE,
876 NULL, FALSE },
877 { "REPORT_DEMOGRAPHIC", N_("_Demographics"),
878 "report_demographics", "F11", MGROUP_SAFE,
879 NULL, FALSE },
880 { "REPORT_SPACESHIP", N_("_Spaceship"),
881 "report_spaceship", "F12", MGROUP_SAFE,
882 NULL, FALSE },
883 { "REPORT_ACHIEVEMENTS", N_("_Achievements"),
884 "report_achievements", "asterisk", MGROUP_SAFE,
885 NULL, FALSE },
886
887 /* Battle Groups menu */
888 /* Note that user view: 1 - 4, internal: 0 - 3 */
889 { "BG_SELECT_1", N_("Select Battle Group 1"),
890 "bg_select_0", "<shift>F1", MGROUP_PLAYING,
891 NULL, FALSE },
892 { "BG_ASSIGN_1", N_("Assign Battle Group 1"),
893 "bg_assign_0", "<ctrl>F1", MGROUP_PLAYING,
894 NULL, FALSE },
895 { "BG_APPEND_1", N_("Append to Battle Group 1"),
896 "bg_append_0", "<shift><ctrl>F1", MGROUP_PLAYING,
897 NULL, FALSE },
898 { "BG_SELECT_2", N_("Select Battle Group 2"),
899 "bg_select_1", "<shift>F2", MGROUP_PLAYING,
900 NULL, FALSE },
901 { "BG_ASSIGN_2", N_("Assign Battle Group 2"),
902 "bg_assign_1", "<ctrl>F2", MGROUP_PLAYING,
903 NULL, FALSE },
904 { "BG_APPEND_2", N_("Append to Battle Group 2"),
905 "bg_append_1", "<shift><ctrl>F2", MGROUP_PLAYING,
906 NULL, FALSE },
907 { "BG_SELECT_3", N_("Select Battle Group 3"),
908 "bg_select_2", "<shift>F3", MGROUP_PLAYING,
909 NULL, FALSE },
910 { "BG_ASSIGN_3", N_("Assign Battle Group 3"),
911 "bg_assign_2", "<ctrl>F3", MGROUP_PLAYING,
912 NULL, FALSE },
913 { "BG_APPEND_3", N_("Append to Battle Group 3"),
914 "bg_append_2", "<shift><ctrl>F3", MGROUP_PLAYING,
915 NULL, FALSE },
916 { "BG_SELECT_4", N_("Select Battle Group 4"),
917 "bg_select_3", "<shift>F4", MGROUP_PLAYING,
918 NULL, FALSE },
919 { "BG_ASSIGN_4", N_("Assign Battle Group 4"),
920 "bg_assign_3", "<ctrl>F4", MGROUP_PLAYING,
921 NULL, FALSE },
922 { "BG_APPEND_4", N_("Append to Battle Group 4"),
923 "bg_append_3", "<shift><ctrl>F4", MGROUP_PLAYING,
924 NULL, FALSE },
925
926 /* Help menu */
927 { "HELP_OVERVIEW", N_("?help:Overview"),
928 "help_overview", NULL, MGROUP_SAFE,
929 NULL, FALSE },
930 { "HELP_PLAYING", N_("Strategy and Tactics"),
931 "help_playing", NULL, MGROUP_SAFE,
932 NULL, FALSE },
933 { "HELP_POLICIES", N_("Policies"),
934 "help_policies", NULL, MGROUP_SAFE,
935 NULL, FALSE },
936 { "HELP_TERRAIN", N_("Terrain"),
937 "help_terrains", NULL, MGROUP_SAFE,
938 NULL, FALSE },
939 { "HELP_ECONOMY", N_("Economy"),
940 "help_economy", NULL, MGROUP_SAFE,
941 NULL, FALSE },
942 { "HELP_CITIES", N_("Cities"),
943 "help_cities", NULL, MGROUP_SAFE,
944 NULL, FALSE },
945 { "HELP_IMPROVEMENTS", N_("City Improvements"),
946 "help_improvements", NULL, MGROUP_SAFE,
947 NULL, FALSE },
948 { "HELP_WONDERS", N_("Wonders of the World"),
949 "help_wonders", NULL, MGROUP_SAFE,
950 NULL, FALSE },
951 { "HELP_UNITS", N_("Units"),
952 "help_units", NULL, MGROUP_SAFE,
953 NULL, FALSE },
954 { "HELP_COMBAT", N_("Combat"),
955 "help_combat", NULL, MGROUP_SAFE,
956 NULL, FALSE },
957 { "HELP_ZOC", N_("Zones of Control"),
958 "help_zoc", NULL, MGROUP_SAFE,
959 NULL, FALSE },
960 { "HELP_GOVERNMENT", N_("Government"),
961 "help_government", NULL, MGROUP_SAFE,
962 NULL, FALSE },
963 { "HELP_DIPLOMACY", N_("Diplomacy"),
964 "help_diplomacy", NULL, MGROUP_SAFE,
965 NULL, FALSE },
966 { "HELP_TECH", N_("Technology"),
967 "help_tech", NULL, MGROUP_SAFE,
968 NULL, FALSE },
969 { "HELP_SPACE_RACE", N_("Space Race"),
970 "help_space_race", NULL, MGROUP_SAFE,
971 NULL, FALSE },
972 { "HELP_RULESET", N_("About Current Ruleset"),
973 "help_ruleset", NULL, MGROUP_SAFE,
974 NULL, FALSE },
975 { "HELP_TILESET", N_("About Current Tileset"),
976 "help_tileset", NULL, MGROUP_SAFE,
977 NULL, FALSE },
978 { "HELP_MUSICSET", N_("About Current Musicset"),
979 "help_musicset", NULL, MGROUP_SAFE,
980 NULL, FALSE },
981 { "HELP_NATIONS", N_("About Nations"),
982 "help_nations", NULL, MGROUP_SAFE,
983 NULL, FALSE },
984 { "HELP_CONNECTING", N_("Connecting"),
985 "help_connecting", NULL, MGROUP_SAFE,
986 NULL, FALSE },
987 { "HELP_CONTROLS", N_("Controls"),
988 "help_controls", NULL, MGROUP_SAFE,
989 NULL, FALSE },
990 { "HELP_GOVERNOR", N_("Citizen Governor"),
991 "help_governor", NULL, MGROUP_SAFE,
992 NULL, FALSE },
993 { "HELP_CHATLINE", N_("Chatline"),
994 "help_chatline", NULL, MGROUP_SAFE,
995 NULL, FALSE },
996 { "HELP_WORKLIST_EDITOR", N_("Worklist Editor"),
997 "help_worklist_editor", NULL, MGROUP_SAFE,
998 NULL, FALSE },
999 { "HELP_LANGUAGES", N_("Languages"),
1000 "help_languages", NULL, MGROUP_SAFE,
1001 NULL, FALSE },
1002 { "HELP_COPYING", N_("Copying"),
1003 "help_copying", NULL, MGROUP_SAFE,
1004 NULL, FALSE },
1005 { "HELP_ABOUT", N_("About Freeciv"),
1006 "help_about", NULL, MGROUP_SAFE,
1007 NULL, FALSE },
1008 { NULL }
1009};
1010
1011enum {
1041
1043 { "clear_chat", clear_chat_logs_callback },
1044 { "save_chat", save_chat_logs_callback },
1045 { "local_options", local_options_callback },
1046 { "message_options", message_options_callback },
1047 { "server_options", server_options_callback },
1048 { "save_options", save_options_callback },
1049
1050#ifdef FREECIV_DEBUG
1051 { "reload_tileset", reload_tileset_callback },
1052#endif /* FREECIV_DEBUG */
1053
1054 { "game_save", save_game_callback },
1055 { "game_save_as", save_game_as_callback },
1056 { "save_mapimg", save_mapimg_callback },
1057 { "save_mapimg_as", save_mapimg_as_callback },
1058 { "leave", leave_callback },
1059 { "quit", quit_callback },
1060
1061 { "find_city", find_city_callback },
1062 { "worklists", worklists_callback },
1063 { "rally_dlg", rally_dialog_callback },
1064 { "infra_dlg", infra_dialog_callback },
1065 { "scenario_props", scenario_properties_callback },
1066 { "scenario_save", save_scenario_callback },
1067 { "lua_script", client_lua_script_callback },
1068
1069 { "center_view", center_view_callback },
1070
1071 { "select_single", select_single_callback },
1072 { "select_all_tile", select_all_on_tile_callback },
1073 { "select_same_type_tile", select_same_type_tile_callback },
1074 { "select_same_type_cont", select_same_type_cont_callback },
1075 { "select_same_type", select_same_type_callback },
1076 { "select_dlg", select_dialog_callback },
1077
1078 { "goto", unit_goto_callback },
1079 { "goto_city", unit_goto_city_callback },
1080 { "return", unit_return_callback },
1081 { "explore", unit_explore_callback },
1082 { "patrol", unit_patrol_callback },
1083 { "teleport", unit_teleport_callback },
1084 { "sentry", unit_sentry_callback },
1085 { "unsentry_all", unsentry_all_callback },
1086 { "board", unit_board_callback },
1087 { "deboard", unit_deboard_callback },
1088 { "unload_transporter", unit_unload_transporter_callback },
1089 { "homecity", unit_homecity_callback },
1090 { "upgrade", unit_upgrade_callback },
1091 { "convert", unit_convert_callback },
1092 { "disband", unit_disband_callback },
1093 { "do_action", do_action_callback },
1094 { "wait", unit_wait_callback },
1095 { "done", unit_done_callback },
1096
1097 { "build_city", build_city_callback },
1098 { "auto_work", auto_work_callback },
1099 { "build_road", build_road_callback },
1100 { "build_irrigation", build_irrigation_callback },
1101 { "build_mine", build_mine_callback },
1102 { "cultivate", cultivate_callback },
1103 { "plant", plant_callback },
1104 { "transform_terrain", transform_terrain_callback },
1105 { "connect_road", connect_road_callback },
1106 { "connect_rail", connect_rail_callback },
1107 { "connect_maglev", connect_maglev_callback },
1108 { "connect_irrigation", connect_irrigation_callback },
1109 { "clean", clean_callback },
1110
1111 { "fortify", fortify_callback },
1112 { "build_base_fortress", build_fortress_callback },
1113 { "build_base_airbase", build_airbase_callback },
1114 { "paradrop", paradrop_callback },
1115 { "pillage", pillage_callback },
1116
1117 { "revolution", revolution_callback },
1118
1119 { "map_view", map_view_callback },
1120 { "report_units", report_units_callback },
1121 { "report_nations", report_nations_callback },
1122 { "report_cities", report_cities_callback },
1123 { "report_economy", report_economy_callback },
1124 { "report_research", report_research_callback },
1125 { "tax_rates", tax_rate_callback },
1126 { "policies", multiplier_callback },
1127 { "report_wow", report_wow_callback },
1128 { "report_top_cities", report_top_cities_callback },
1129 { "report_messages", report_messages_callback },
1130 { "report_demographics", report_demographic_callback },
1131 { "report_spaceship", report_spaceship_callback },
1132 { "report_achievements", report_achievements_callback },
1133
1134 { "help_overview", help_overview_callback },
1135 { "help_playing", help_playing_callback },
1136 { "help_policies", help_policies_callback },
1137 { "help_terrains", help_terrain_callback },
1138 { "help_economy", help_economy_callback },
1139 { "help_cities", help_cities_callback },
1140 { "help_improvements", help_improvements_callback },
1141 { "help_wonders", help_wonders_callback },
1142 { "help_units", help_units_callback },
1143 { "help_combat", help_combat_callback },
1144 { "help_zoc", help_zoc_callback },
1145 { "help_government", help_government_callback },
1146 { "help_diplomacy", help_diplomacy_callback },
1147 { "help_tech", help_tech_callback },
1148 { "help_space_race", help_space_race_callback },
1149 { "help_ruleset", help_ruleset_callback },
1150 { "help_tileset", help_tileset_callback },
1151 { "help_musicset", help_musicset_callback },
1152 { "help_nations", help_nations_callback },
1153 { "help_connecting", help_connecting_callback },
1154 { "help_controls", help_controls_callback },
1155 { "help_governor", help_governor_callback },
1156 { "help_chatline", help_chatline_callback },
1157 { "help_worklist_editor", help_worklist_editor_callback },
1158 { "help_languages", help_language_callback },
1159 { "help_copying", help_copying_callback },
1160 { "help_about", help_about_callback }
1161};
1162
1163static struct menu_entry_info *menu_entry_info_find(const char *key);
1164
1165/************************************************************************/
1169 GVariant *parameter,
1170 gpointer data)
1171{
1173}
1174
1175/************************************************************************/
1179 GVariant *parameter,
1180 gpointer data)
1181{
1183}
1184
1185/************************************************************************/
1189 GVariant *parameter,
1190 gpointer data)
1191{
1192 option_dialog_popup(_("Set local options"), client_optset);
1193}
1194
1195/************************************************************************/
1199 GVariant *parameter,
1200 gpointer data)
1201{
1203}
1204
1205/************************************************************************/
1209 GVariant *parameter,
1210 gpointer data)
1211{
1212 option_dialog_popup(_("Game Settings"), server_optset);
1213}
1214
1215/************************************************************************/
1219 GVariant *parameter,
1220 gpointer data)
1221{
1223}
1224
1225/************************************************************************/
1229 GVariant *parameter,
1230 gpointer data)
1231{
1232 struct menu_entry_info *info = (struct menu_entry_info *)data;
1233
1234 info->state ^= 1;
1236
1238
1241}
1242
1243#ifdef FREECIV_DEBUG
1244/************************************************************************/
1248 GVariant *parameter,
1249 gpointer data)
1250{
1251 tilespec_reread(NULL, TRUE, 1.0);
1252}
1253#endif /* FREECIV_DEBUG */
1254
1255/************************************************************************/
1259 gpointer data)
1260{
1262}
1263
1264/************************************************************************/
1268 gpointer data)
1269{
1271}
1272
1273/************************************************************************/
1277 gpointer data)
1278{
1280}
1281
1282/************************************************************************/
1286 gpointer data)
1287{
1289}
1290
1291/************************************************************************/
1296 gpointer data)
1297{
1299 result, NULL);
1300
1301 if (button == 0) {
1302 /* It might be killed already */
1303 if (client.conn.used) {
1304 /* It will also kill the server */
1306 }
1307 }
1308}
1309
1310/************************************************************************/
1314 GVariant *parameter,
1315 gpointer data)
1316{
1317 if (is_server_running()) {
1318 const char *buttons[] = { _("Leave"), _("Cancel"), NULL };
1319 GtkAlertDialog *dialog
1320 = gtk_alert_dialog_new(_("Leaving a local game will end it!"));
1321
1327 } else {
1329 }
1330}
1331
1332/************************************************************************/
1336 GVariant *parameter,
1337 gpointer data)
1338{
1340}
1341
1342/************************************************************************/
1346 GVariant *parameter,
1347 gpointer data)
1348{
1350}
1351
1352/************************************************************************/
1356 GVariant *parameter,
1357 gpointer data)
1358{
1360}
1361
1362/************************************************************************/
1366 GVariant *parameter, gpointer data)
1367{
1369}
1370
1371/************************************************************************/
1375 GVariant *parameter,
1376 gpointer data)
1377{
1379}
1380
1381/************************************************************************/
1394
1395/************************************************************************/
1399 GVariant *parameter,
1400 gpointer data)
1401{
1403}
1404
1405/************************************************************************/
1409 GVariant *parameter,
1410 gpointer data)
1411{
1413}
1414
1415/************************************************************************/
1419 GVariant *parameter,
1420 gpointer data)
1421{
1423}
1424
1425/************************************************************************/
1434
1435/************************************************************************/
1444
1445/************************************************************************/
1454
1455/************************************************************************/
1459 GVariant *parameter,
1460 gpointer data)
1461{
1463}
1464
1465/************************************************************************/
1474
1475/************************************************************************/
1479 GVariant *parameter,
1480 gpointer data)
1481{
1483}
1484
1485/************************************************************************/
1489 GVariant *parameter,
1490 gpointer data)
1491{
1493}
1494
1495/************************************************************************/
1499 GVariant *parameter,
1500 gpointer data)
1501{
1503}
1504
1505/************************************************************************/
1514
1515/************************************************************************/
1519 GVariant *parameter,
1520 gpointer data)
1521{
1523}
1524
1525/************************************************************************/
1529 GVariant *parameter,
1530 gpointer data)
1531{
1533}
1534
1535/************************************************************************/
1539 GVariant *parameter,
1540 gpointer data)
1541{
1543}
1544
1545/************************************************************************/
1549 GVariant *parameter,
1550 gpointer data)
1551{
1553}
1554
1555/************************************************************************/
1564
1565/************************************************************************/
1574
1575/************************************************************************/
1579 GVariant *parameter,
1580 gpointer data)
1581{
1583}
1584
1585/************************************************************************/
1594
1595/************************************************************************/
1599 GVariant *parameter,
1600 gpointer data)
1601{
1603}
1604
1605/************************************************************************/
1609 GVariant *parameter,
1610 gpointer data)
1611{
1613}
1614
1615/************************************************************************/
1624
1625/************************************************************************/
1629 GVariant *parameter,
1630 gpointer data)
1631{
1633}
1634
1635/************************************************************************/
1644
1645/************************************************************************/
1654
1655/************************************************************************/
1659 GVariant *parameter,
1660 gpointer data)
1661{
1663}
1664
1665/************************************************************************/
1674
1675/************************************************************************/
1684
1685/************************************************************************/
1694
1695/************************************************************************/
1699 GVariant *parameter,
1700 gpointer data)
1701{
1703}
1704
1705/************************************************************************/
1709 GVariant *parameter,
1710 gpointer data)
1711{
1713}
1714
1715/************************************************************************/
1719 GVariant *parameter,
1720 gpointer data)
1721{
1723
1724 /* Unreachable techs in reqtree on/off */
1726}
1727
1728struct menu_entry_option_map {
1729 const char *menu_entry;
1730 bool *option;
1731 int menu_pos;
1732};
1733
1735 { "SAVE_OPTIONS_ON_EXIT", &gui_options.save_options_on_exit, -1 },
1736 { "FULL_SCREEN", &(GUI_GTK_OPTION(fullscreen)), -1 },
1737 { "EDIT_MODE", &game.info.is_edit_mode, -1 },
1738 { "TOGGLE_FOG", &game.client.fog_of_war, -1 },
1739 { "SHOW_CITY_OUTLINES", &gui_options.draw_city_outlines, VMENU_CITY_OUTLINES },
1740 { "SHOW_CITY_OUTPUT", &gui_options.draw_city_output, VMENU_CITY_OUTPUT },
1741 { "SHOW_MAP_GRID", &gui_options.draw_map_grid, VMENU_MAP_GRID },
1742 { "SHOW_NAT_BORDERS", &gui_options.draw_borders, VMENU_NAT_BORDERS },
1743 { "SHOW_NATIVE_TILES", &gui_options.draw_native, VMENU_NATIVE_TILES },
1744 { "SHOW_CITY_FULL_BAR", &gui_options.draw_full_citybar, VMENU_CITY_FULL_BAR },
1745 { "SHOW_CITY_NAMES", &gui_options.draw_city_names, VMENU_CITY_NAMES },
1746 { "SHOW_CITY_GROWTH", &gui_options.draw_city_growth, VMENU_CITY_GROWTH },
1747 { "SHOW_CITY_PRODUCTIONS", &gui_options.draw_city_productions,
1749 { "SHOW_CITY_BUY_COST", &gui_options.draw_city_buycost, VMENU_CITY_BUY_COST },
1750 { "SHOW_CITY_TRADE_ROUTES", &gui_options.draw_city_trade_routes,
1752 { "SHOW_TERRAIN", &gui_options.draw_terrain, VMENU_TERRAIN },
1753 { "SHOW_COASTLINE", &gui_options.draw_coastline, VMENU_COASTLINE },
1754 { "SHOW_PATHS", &gui_options.draw_paths, VMENU_PATHS },
1755 { "SHOW_IRRIGATION", &gui_options.draw_irrigation, VMENU_IRRIGATION },
1756 { "SHOW_MINES", &gui_options.draw_mines, VMENU_MINES },
1757 { "SHOW_BASES", &gui_options.draw_fortress_airbase, VMENU_BASES },
1758 { "SHOW_RESOURCES", &gui_options.draw_specials, VMENU_RESOURCES },
1759 { "SHOW_HUTS", &gui_options.draw_huts, VMENU_HUTS },
1760 { "SHOW_POLLUTION", &gui_options.draw_pollution, VMENU_POLLUTION },
1761 { "SHOW_CITIES", &gui_options.draw_cities, VMENU_CITIES },
1762 { "SHOW_UNITS", &gui_options.draw_units, VMENU_UNITS },
1763 { "SHOW_UNIT_SOLID_BG", &gui_options.solid_color_behind_units, VMENU_UNIT_SOLID_BG },
1764 { "SHOW_UNIT_SHIELDS", &gui_options.draw_unit_shields , VMENU_UNIT_SHIELDS },
1765 { "SHOW_STACK_SIZE", &gui_options.draw_unit_stack_size, VMENU_STACK_SIZE },
1766 { "SHOW_FOCUS_UNIT", &gui_options.draw_focus_unit, VMENU_FOCUS_UNIT },
1767 { "SHOW_FOG_OF_WAR", &gui_options.draw_fog_of_war, VMENU_FOW },
1768
1769 { NULL, NULL, -1 }
1770};
1771
1772/************************************************************************/
1775static void view_menu_item_toggle(void (*cb)(void),
1776 bool updt_sensitivity,
1777 gpointer data)
1778{
1779 int i;
1780 struct menu_entry_info *info = (struct menu_entry_info *)data;
1781
1782 info->state ^= 1;
1783
1784 cb();
1785
1786 if (updt_sensitivity) {
1788 }
1789
1790 /* TODO: Make the information available directly from menu_entry_info,
1791 * se we don't need to do this search for it */
1792 for (i = 0; meoms[i].menu_entry != NULL; i++) {
1793 if (!strcmp(meoms[i].menu_entry, info->key)) {
1794 g_menu_remove(view_menu, meoms[i].menu_pos);
1797 return;
1798 }
1799 }
1800}
1801
1802/************************************************************************/
1811
1812/************************************************************************/
1816 GVariant *parameter,
1817 gpointer data)
1818{
1820}
1821
1822/************************************************************************/
1830
1831/************************************************************************/
1840
1841/************************************************************************/
1845 GVariant *parameter,
1846 gpointer data)
1847{
1849}
1850
1851/************************************************************************/
1860
1861/************************************************************************/
1865 GVariant *parameter,
1866 gpointer data)
1867{
1869}
1870
1871/************************************************************************/
1875 GVariant *parameter,
1876 gpointer data)
1877{
1879}
1880
1881/************************************************************************/
1890
1891/************************************************************************/
1900
1901/************************************************************************/
1910
1911/************************************************************************/
1915 GVariant *parameter,
1916 gpointer data)
1917{
1919}
1920
1921/************************************************************************/
1925 GVariant *parameter,
1926 gpointer data)
1927{
1929}
1930
1931/************************************************************************/
1935 GVariant *parameter,
1936 gpointer data)
1937{
1939}
1940
1941/************************************************************************/
1945 GVariant *parameter,
1946 gpointer data)
1947{
1949}
1950
1951/************************************************************************/
1955 GVariant *parameter,
1956 gpointer data)
1957{
1959}
1960
1961/************************************************************************/
1965 gpointer data)
1966{
1968}
1969
1970/************************************************************************/
1974 GVariant *parameter,
1975 gpointer data)
1976{
1978}
1979
1980/************************************************************************/
1984 gpointer data)
1985{
1987}
1988
1989/************************************************************************/
1997
1998/************************************************************************/
2002 gpointer data)
2003{
2005}
2006
2007/************************************************************************/
2011 gpointer data)
2012{
2014}
2015
2016/************************************************************************/
2025
2026/************************************************************************/
2035
2036/************************************************************************/
2045
2046/************************************************************************/
2050 GVariant *parameter,
2051 gpointer data)
2052{
2054}
2055
2056/************************************************************************/
2064
2065/************************************************************************/
2069 gpointer data)
2070{
2071 struct menu_entry_info *info = (struct menu_entry_info *)data;
2072
2073 info->state ^= 1;
2075
2077
2079
2082}
2083
2084/************************************************************************/
2088 GVariant *parameter,
2089 gpointer data)
2090{
2091 struct menu_entry_info *info = (struct menu_entry_info *)data;
2092
2093 info->state ^= 1;
2094
2096
2098
2101}
2102
2103/************************************************************************/
2116
2117/************************************************************************/
2121 gpointer data)
2122{
2124}
2125
2126/************************************************************************/
2134
2135/************************************************************************/
2144
2145/************************************************************************/
2154
2155/************************************************************************/
2164
2165/************************************************************************/
2174
2175/************************************************************************/
2179 GVariant *parameter,
2180 gpointer data)
2181{
2183}
2184
2185/************************************************************************/
2189 GVariant *parameter,
2190 gpointer data)
2191{
2193}
2194
2195/************************************************************************/
2199 GVariant *parameter,
2200 gpointer data)
2201{
2203}
2204
2205/************************************************************************/
2209 GVariant *parameter,
2210 gpointer data)
2211{
2212 key_unit_wait();
2213}
2214
2215/************************************************************************/
2219 GVariant *parameter,
2220 gpointer data)
2221{
2222 key_unit_done();
2223}
2224
2225/************************************************************************/
2229 gpointer data)
2230{
2231 key_unit_goto();
2232}
2233
2234/************************************************************************/
2238 GVariant *parameter,
2239 gpointer data)
2240{
2241 int sub_target = NO_TARGET;
2242 struct action *paction = (struct action *)data;
2243
2245
2247 case ASTK_BUILDING:
2248 {
2250 "end_building");
2252 sub_target = improvement_number(pbuilding);
2253 }
2254 break;
2255 case ASTK_TECH:
2256 {
2258 "end_tech");
2260 sub_target = advance_number(ptech);
2261 }
2262 break;
2263 case ASTK_EXTRA:
2265 {
2266 struct extra_type *pextra = g_object_get_data(G_OBJECT(action),
2267 "end_extra");
2268 fc_assert_ret(pextra != NULL);
2269 sub_target = extra_number(pextra);
2270 }
2271 break;
2272 case ASTK_NONE:
2273 sub_target = NO_TARGET;
2274 break;
2275 case ASTK_COUNT:
2276 /* Should not exits */
2278 break;
2279 }
2280
2282}
2283
2284/************************************************************************/
2288 GVariant *parameter,
2289 gpointer data)
2290{
2291 if (get_num_units_in_focus() > 0) {
2293 }
2294}
2295
2296/************************************************************************/
2307
2308/************************************************************************/
2312 GVariant *parameter,
2313 gpointer data)
2314{
2316}
2317
2318/************************************************************************/
2322 gpointer data)
2323{
2325}
2326
2327/************************************************************************/
2331 gpointer data)
2332{
2334}
2335
2336/************************************************************************/
2340 GVariant *parameter,
2341 gpointer data)
2342{
2344}
2345
2346/************************************************************************/
2350 GVariant *parameter,
2351 gpointer data)
2352{
2354}
2355
2356/************************************************************************/
2367
2368/************************************************************************/
2378
2379/************************************************************************/
2389
2390/************************************************************************/
2394 GVariant *parameter,
2395 gpointer data)
2396{
2398}
2399
2400/************************************************************************/
2404 GVariant *parameter,
2405 gpointer data)
2406{
2408}
2409
2410/************************************************************************/
2419
2420/************************************************************************/
2424 GVariant *parameter,
2425 gpointer data)
2426{
2428}
2429
2430/************************************************************************/
2439
2440/************************************************************************/
2444 GVariant *parameter,
2445 gpointer data)
2446{
2448 /* FIXME: this can provide different items for different units...
2449 * not good! */
2450 /* Enable the button for adding to a city in all cases, so we
2451 get an eventual error message from the server if we try. */
2457 }
2459}
2460
2461/************************************************************************/
2465 GVariant *parameter,
2466 gpointer data)
2467{
2469}
2470
2471/************************************************************************/
2475 GVariant *parameter,
2476 gpointer data)
2477{
2479 /* FIXME: this can provide different actions for different units...
2480 * not good! */
2482 EC_ROAD,
2484 punit);
2485 bool building_road = FALSE;
2486
2487 if (tgt != NULL
2491 }
2492
2495 }
2497}
2498
2499/************************************************************************/
2503 GVariant *parameter,
2504 gpointer data)
2505{
2507}
2508
2509/************************************************************************/
2513 GVariant *parameter,
2514 gpointer data)
2515{
2517}
2518
2519/************************************************************************/
2523 GVariant *parameter,
2524 gpointer data)
2525{
2527}
2528
2529/************************************************************************/
2533 GVariant *parameter,
2534 gpointer data)
2535{
2536 key_unit_mine();
2537}
2538
2539/************************************************************************/
2543 GVariant *parameter,
2544 gpointer data)
2545{
2547
2548 if (proad != NULL) {
2549 struct extra_type *tgt;
2550
2551 tgt = road_extra_get(proad);
2552
2554 }
2555}
2556
2557/************************************************************************/
2561 GVariant *parameter,
2562 gpointer data)
2563{
2565
2566 if (prail != NULL) {
2567 struct extra_type *tgt;
2568
2569 tgt = road_extra_get(prail);
2570
2572 }
2573}
2574
2575/************************************************************************/
2579 GVariant *parameter,
2580 gpointer data)
2581{
2583
2584 if (pmaglev != NULL) {
2585 struct extra_type *tgt;
2586
2587 tgt = road_extra_get(pmaglev);
2588
2590 }
2591}
2592
2593/************************************************************************/
2597 GVariant *parameter,
2598 gpointer data)
2599{
2601
2602 if (extra_type_list_size(extras) > 0) {
2603 struct extra_type *pextra;
2604
2606
2608 }
2609}
2610
2611/************************************************************************/
2615 GVariant *parameter,
2616 gpointer data)
2617{
2619}
2620
2621/************************************************************************/
2625 gpointer data)
2626{
2628}
2629
2630/************************************************************************/
2634 gpointer data)
2635{
2637}
2638
2639/************************************************************************/
2643 gpointer data)
2644{
2646}
2647
2648/************************************************************************/
2652 GVariant *parameter,
2653 gpointer data)
2654{
2656}
2657
2658/************************************************************************/
2662 GVariant *parameter,
2663 gpointer data)
2664{
2666}
2667
2668/************************************************************************/
2672 GVariant *parameter,
2673 gpointer data)
2674{
2676}
2677
2678/************************************************************************/
2682 gpointer data)
2683{
2685}
2686
2687/************************************************************************/
2691 gpointer data)
2692{
2694}
2695
2696/************************************************************************/
2700 GVariant *parameter,
2701 gpointer data)
2702{
2704}
2705
2706/************************************************************************/
2710 GVariant *parameter,
2711 gpointer data)
2712{
2714}
2715
2716/************************************************************************/
2720 GVariant *parameter,
2721 gpointer data)
2722{
2723 struct extra_type *pextra = data;
2724
2728}
2729
2730/************************************************************************/
2734 GVariant *parameter,
2735 gpointer data)
2736{
2737 struct extra_type *pextra = data;
2738
2741 pextra);
2743}
2744
2745/************************************************************************/
2749 GVariant *parameter,
2750 gpointer data)
2751{
2752 struct extra_type *pextra = data;
2753
2756 pextra);
2758}
2759
2760/************************************************************************/
2764 GVariant *parameter,
2765 gpointer data)
2766{
2767 struct extra_type *pextra = data;
2768
2771 pextra);
2773}
2774
2775/************************************************************************/
2779 GVariant *parameter,
2780 gpointer data)
2781{
2782 struct extra_type *pextra = data;
2783
2787 pextra);
2788 }
2790}
2791
2792/************************************************************************/
2796 GVariant *parameter,
2797 gpointer data)
2798{
2800}
2801
2802/************************************************************************/
2806 GVariant *parameter,
2807 gpointer data)
2808{
2810}
2811
2812/************************************************************************/
2816 GVariant *parameter,
2817 gpointer data)
2818
2819{
2821}
2822
2823/************************************************************************/
2832
2833/************************************************************************/
2842
2843/************************************************************************/
2847 GVariant *parameter,
2848 gpointer data)
2849{
2850 if (NULL != client.conn.playing) {
2852 }
2853}
2854
2855/************************************************************************/
2864
2865/************************************************************************/
2874
2875/************************************************************************/
2884
2885/************************************************************************/
2890{
2891 char actname[150];
2892 GMenuItem *item;
2893
2894 fc_snprintf(actname, sizeof(actname), "app.%s(%s)",
2895 info->action, info->state ? "true" : "false");
2896 item = g_menu_item_new(Q_(info->name), NULL);
2898
2899 if (info->accl != NULL) {
2900 const char *accls[2] = { info->accl, NULL };
2901
2903 }
2904
2905 return item;
2906}
2907
2908/************************************************************************/
2913{
2915}
2916
2917/************************************************************************/
2920static void menu_entry_init(GMenu *sub, const char *key)
2921{
2923
2924 if (info != NULL) {
2925 GMenuItem *item;
2926
2927 if (info->toggle != NULL) {
2929 } else {
2930 char actname[150];
2931
2932 fc_snprintf(actname, sizeof(actname), "app.%s", info->action);
2933 item = g_menu_item_new(Q_(info->name), actname);
2934 }
2935
2936 /* Should be menu_item_append_unref()? */
2939 }
2940}
2941
2942/************************************************************************/
2946{
2947 int i;
2948
2949 for (i = 0; meoms[i].menu_entry != NULL; i++) {
2950 struct menu_entry_info *info = menu_entry_info_find(meoms[i].menu_entry);
2951
2952 if (meoms[i].option != NULL) {
2953 info->state = *meoms[i].option;
2954 } else {
2955 info->state = FALSE; /* Best guess we have */
2956 }
2957 }
2958}
2959
2960/************************************************************************/
2964{
2965 int i;
2967
2968 /* Simple entries */
2971
2972 /* Toggles */
2973 for (i = 0; menu_entries[i].key != NULL; i++) {
2974 if (menu_entries[i].toggle != NULL) {
2975 GSimpleAction *act;
2976 GVariant *var = g_variant_new("b", TRUE);
2977
2980 g_signal_connect(act, "change-state",
2982 (gpointer)&(menu_entries[i]));
2983 }
2984 }
2985
2987
2988 for (i = 0; menu_entries[i].key != NULL; i++) {
2989 if (menu_entries[i].accl != NULL && menu_entries[i].toggle == NULL) {
2990 const char *accls[2] = { menu_entries[i].accl, NULL };
2991 char actname[150];
2992
2993 fc_snprintf(actname, sizeof(actname), "app.%s", menu_entries[i].action);
2994
2996 }
2997 }
2998}
2999
3000/************************************************************************/
3003static void register_bg_actions(GActionMap *map, int bg)
3004{
3005 GSimpleAction *act;
3006 char actname[256];
3007
3008 fc_snprintf(actname, sizeof(actname), "bg_select_%d", bg);
3011 g_signal_connect(act, "activate",
3013
3014 fc_snprintf(actname, sizeof(actname), "bg_assign_%d", bg);
3017 g_signal_connect(act, "activate",
3019
3020 fc_snprintf(actname, sizeof(actname), "bg_append_%d", bg);
3023 g_signal_connect(act, "activate",
3025}
3026
3027/************************************************************************/
3031{
3032 GMenu *menubar;
3033 GMenu *topmenu;
3034 GMenu *submenu;
3035 int i;
3036
3038
3039 menubar = g_menu_new();
3040
3041 topmenu = g_menu_new();
3042 menu_entry_init(topmenu, "CLEAR_CHAT_LOGS");
3043 menu_entry_init(topmenu, "SAVE_CHAT_LOGS");
3044
3046 menu_entry_init(options_menu, "LOCAL_OPTIONS");
3047 menu_entry_init(options_menu, "MESSAGE_OPTIONS");
3048 menu_entry_init(options_menu, "SERVER_OPTIONS");
3049 menu_entry_init(options_menu, "SAVE_OPTIONS");
3050 menu_entry_init(options_menu, "SAVE_OPTIONS_ON_EXIT");
3051
3053
3054#ifdef FREECIV_DEBUG
3055 menu_entry_init(topmenu, "RELOAD_TILESET");
3056#endif /* FREECIV_DEBUG */
3057
3058 menu_entry_init(topmenu, "GAME_SAVE");
3059 menu_entry_init(topmenu, "GAME_SAVE_AS");
3060 menu_entry_init(topmenu, "MAPIMG_SAVE");
3061 menu_entry_init(topmenu, "MAPIMG_SAVE_AS");
3062 menu_entry_init(topmenu, "LEAVE");
3063 menu_entry_init(topmenu, "QUIT");
3064
3066
3068
3069 menu_entry_init(edit_menu, "FIND_CITY");
3070 menu_entry_init(edit_menu, "WORKLISTS");
3071 menu_entry_init(edit_menu, "RALLY_DLG");
3072 menu_entry_init(edit_menu, "INFRA_DLG");
3073 menu_entry_init(edit_menu, "EDIT_MODE");
3074 menu_entry_init(edit_menu, "TOGGLE_FOG");
3075 menu_entry_init(edit_menu, "SCENARIO_PROPERTIES");
3076 menu_entry_init(edit_menu, "SCENARIO_SAVE");
3077 menu_entry_init(edit_menu, "CLIENT_LUA_SCRIPT");
3078
3080
3082
3083 menu_entry_init(view_menu, "SHOW_CITY_OUTLINES");
3084 menu_entry_init(view_menu, "SHOW_CITY_OUTPUT");
3085 menu_entry_init(view_menu, "SHOW_MAP_GRID");
3086 menu_entry_init(view_menu, "SHOW_NAT_BORDERS");
3087 menu_entry_init(view_menu, "SHOW_NATIVE_TILES");
3088 menu_entry_init(view_menu, "SHOW_CITY_FULL_BAR");
3089 menu_entry_init(view_menu, "SHOW_CITY_NAMES");
3090 menu_entry_init(view_menu, "SHOW_CITY_GROWTH");
3091 menu_entry_init(view_menu, "SHOW_CITY_PRODUCTIONS");
3092 menu_entry_init(view_menu, "SHOW_CITY_BUY_COST");
3093 menu_entry_init(view_menu, "SHOW_CITY_TRADE_ROUTES");
3094 menu_entry_init(view_menu, "SHOW_TERRAIN");
3095 menu_entry_init(view_menu, "SHOW_COASTLINE");
3096 menu_entry_init(view_menu, "SHOW_PATHS");
3097 menu_entry_init(view_menu, "SHOW_IRRIGATION");
3098 menu_entry_init(view_menu, "SHOW_MINES");
3099 menu_entry_init(view_menu, "SHOW_BASES");
3100 menu_entry_init(view_menu, "SHOW_RESOURCES");
3101 menu_entry_init(view_menu, "SHOW_HUTS");
3102 menu_entry_init(view_menu, "SHOW_POLLUTION");
3103 menu_entry_init(view_menu, "SHOW_CITIES");
3104 menu_entry_init(view_menu, "SHOW_UNITS");
3105 menu_entry_init(view_menu, "SHOW_UNIT_SOLID_BG");
3106 menu_entry_init(view_menu, "SHOW_UNIT_SHIELDS");
3107 menu_entry_init(view_menu, "SHOW_STACK_SIZE");
3108 menu_entry_init(view_menu, "SHOW_FOCUS_UNIT");
3109
3110 menu_entry_init(view_menu, "SHOW_FOG_OF_WAR");
3111
3112 menu_entry_init(view_menu, "FULL_SCREEN");
3113 menu_entry_init(view_menu, "CENTER_VIEW");
3114
3116
3117 topmenu = g_menu_new();
3118
3119 menu_entry_init(topmenu, "SELECT_SINGLE");
3120 menu_entry_init(topmenu, "SELECT_ALL_ON_TILE");
3121 menu_entry_init(topmenu, "SELECT_SAME_TYPE_TILE");
3122 menu_entry_init(topmenu, "SELECT_SAME_TYPE_CONT");
3123 menu_entry_init(topmenu, "SELECT_SAME_TYPE");
3124 menu_entry_init(topmenu, "SELECT_DLG");
3125
3127
3129
3130 menu_entry_init(unit_menu, "UNIT_GOTO");
3131
3132 /* Placeholder submenu (so that menu update has something to replace) */
3133 submenu = g_menu_new();
3135
3136 menu_entry_init(unit_menu, "UNIT_GOTO_CITY");
3137 menu_entry_init(unit_menu, "UNIT_RETURN");
3138 menu_entry_init(unit_menu, "UNIT_EXPLORE");
3139 menu_entry_init(unit_menu, "UNIT_PATROL");
3140 menu_entry_init(unit_menu, "UNIT_TELEPORT");
3141 menu_entry_init(unit_menu, "UNIT_SENTRY");
3142 menu_entry_init(unit_menu, "UNSENTRY_ALL");
3143 menu_entry_init(unit_menu, "UNIT_BOARD");
3144 menu_entry_init(unit_menu, "UNIT_DEBOARD");
3145 menu_entry_init(unit_menu, "UNIT_UNLOAD_TRANSPORTER");
3146 menu_entry_init(unit_menu, "UNIT_HOMECITY");
3147 menu_entry_init(unit_menu, "UNIT_UPGRADE");
3148 menu_entry_init(unit_menu, "UNIT_CONVERT");
3149 menu_entry_init(unit_menu, "UNIT_DISBAND");
3150 menu_entry_init(unit_menu, "DO_ACTION");
3151 menu_entry_init(unit_menu, "UNIT_WAIT");
3152 menu_entry_init(unit_menu, "UNIT_DONE");
3153
3155
3157 menu_entry_init(work_menu, "BUILD_CITY");
3158 menu_entry_init(work_menu, "AUTO_WORKER");
3159
3160 /* Placeholder submenus (so that menu update has something to replace) */
3161 submenu = g_menu_new();
3163 submenu = g_menu_new();
3164 submenu_append_unref(work_menu, _("Build _Irrigation"), G_MENU_MODEL(submenu));
3165 submenu = g_menu_new();
3167 submenu = g_menu_new();
3168 submenu_append_unref(work_menu, _("_Clean Nuisance"), G_MENU_MODEL(submenu));
3169
3170 menu_entry_init(work_menu, "BUILD_ROAD");
3171 menu_entry_init(work_menu, "BUILD_IRRIGATION");
3172 menu_entry_init(work_menu, "BUILD_MINE");
3173 menu_entry_init(work_menu, "CULTIVATE");
3174 menu_entry_init(work_menu, "PLANT");
3175 menu_entry_init(work_menu, "TRANSFORM_TERRAIN");
3176 menu_entry_init(work_menu, "CONNECT_ROAD");
3177 menu_entry_init(work_menu, "CONNECT_RAIL");
3178 menu_entry_init(work_menu, "CONNECT_MAGLEV");
3179 menu_entry_init(work_menu, "CONNECT_IRRIGATION");
3180 menu_entry_init(work_menu, "CLEAN");
3181
3183
3185 menu_entry_init(combat_menu, "FORTIFY");
3186 menu_entry_init(combat_menu, "BUILD_FORTRESS");
3187 menu_entry_init(combat_menu, "BUILD_AIRBASE");
3188
3189 /* Placeholder submenu (so that menu update has something to replace) */
3190 submenu = g_menu_new();
3192
3194
3195 menu_entry_init(combat_menu, "PARADROP");
3196 menu_entry_init(combat_menu, "PILLAGE");
3197
3198 gov_menu = g_menu_new();
3199
3200 menu_entry_init(gov_menu, "MAP_VIEW");
3201 menu_entry_init(gov_menu, "REPORT_UNITS");
3202 menu_entry_init(gov_menu, "REPORT_NATIONS");
3203 menu_entry_init(gov_menu, "REPORT_CITIES");
3204 menu_entry_init(gov_menu, "REPORT_ECONOMY");
3205 menu_entry_init(gov_menu, "REPORT_RESEARCH");
3206 menu_entry_init(gov_menu, "TAX_RATES");
3207 menu_entry_init(gov_menu, "POLICIES");
3208
3209 /* Placeholder submenu (so that menu update has something to replace) */
3210 submenu = g_menu_new();
3212
3213 menu_entry_init(gov_menu, "REPORT_WOW");
3214 menu_entry_init(gov_menu, "REPORT_TOP_CITIES");
3215 menu_entry_init(gov_menu, "REPORT_MESSAGES");
3216 menu_entry_init(gov_menu, "REPORT_DEMOGRAPHIC");
3217 menu_entry_init(gov_menu, "REPORT_SPACESHIP");
3218 menu_entry_init(gov_menu, "REPORT_ACHIEVEMENTS");
3219
3220 submenu_append_unref(menubar, _("C_ivilization"), G_MENU_MODEL(gov_menu));
3221
3222 topmenu = g_menu_new();
3223
3224 /* Keys exist for 4 battle groups */
3226
3227 for (i = 0; i < MAX_NUM_BATTLEGROUPS; i++) {
3228 char key[128];
3229
3230 /* User side battle group numbers start from 1 */
3231 fc_snprintf(key, sizeof(key), "BG_SELECT_%d", i + 1);
3233 fc_snprintf(key, sizeof(key), "BG_ASSIGN_%d", i + 1);
3235 fc_snprintf(key, sizeof(key), "BG_APPEND_%d", i + 1);
3237
3239 }
3240
3241 submenu_append_unref(menubar, _("_Battle Groups"), G_MENU_MODEL(topmenu));
3242
3243 topmenu = g_menu_new();
3244
3245 menu_entry_init(topmenu, "HELP_OVERVIEW");
3246 menu_entry_init(topmenu, "HELP_PLAYING");
3247 menu_entry_init(topmenu, "HELP_POLICIES");
3248 menu_entry_init(topmenu, "HELP_TERRAIN");
3249 menu_entry_init(topmenu, "HELP_ECONOMY");
3250 menu_entry_init(topmenu, "HELP_CITIES");
3251 menu_entry_init(topmenu, "HELP_IMPROVEMENTS");
3252 menu_entry_init(topmenu, "HELP_WONDERS");
3253 menu_entry_init(topmenu, "HELP_UNITS");
3254 menu_entry_init(topmenu, "HELP_COMBAT");
3255 menu_entry_init(topmenu, "HELP_ZOC");
3256 menu_entry_init(topmenu, "HELP_GOVERNMENT");
3257 menu_entry_init(topmenu, "HELP_DIPLOMACY");
3258 menu_entry_init(topmenu, "HELP_TECH");
3259 menu_entry_init(topmenu, "HELP_SPACE_RACE");
3260 menu_entry_init(topmenu, "HELP_RULESET");
3261 menu_entry_init(topmenu, "HELP_TILESET");
3262 menu_entry_init(topmenu, "HELP_MUSICSET");
3263 menu_entry_init(topmenu, "HELP_NATIONS");
3264 menu_entry_init(topmenu, "HELP_CONNECTING");
3265 menu_entry_init(topmenu, "HELP_CONTROLS");
3266 menu_entry_init(topmenu, "HELP_GOVERNOR");
3267 menu_entry_init(topmenu, "HELP_CHATLINE");
3268 menu_entry_init(topmenu, "HELP_WORKLIST_EDITOR");
3269 menu_entry_init(topmenu, "HELP_LANGUAGES");
3270 menu_entry_init(topmenu, "HELP_COPYING");
3271 menu_entry_init(topmenu, "HELP_ABOUT");
3272
3274
3275 menus_built = TRUE;
3276
3278
3279 return menubar;
3280}
3281
3282/************************************************************************/
3285static struct menu_entry_info *menu_entry_info_find(const char *key)
3286{
3287 int i;
3288
3289 for (i = 0; menu_entries[i].key != NULL; i++) {
3290 if (!strcmp(key, menu_entries[i].key)) {
3291 return &(menu_entries[i]);
3292 }
3293 }
3294
3295 return NULL;
3296}
3297
3298/************************************************************************/
3302 struct menu_entry_info *info,
3304{
3305 GAction *act = g_action_map_lookup_action(map, info->action);
3306
3307 if (act != NULL) {
3309 }
3310}
3311
3312/************************************************************************/
3316 const char *key,
3318{
3320
3321 if (info != NULL) {
3323 }
3324}
3325
3326/************************************************************************/
3330 enum menu_entry_grouping group,
3332{
3333 int i;
3334
3335 for (i = 0; menu_entries[i].key != NULL; i++) {
3336 if (menu_entries[i].grouping == group || group == MGROUP_ALL) {
3338 }
3339 }
3340}
3341
3342/************************************************************************/
3345static void menus_rename(GMenu *parent, int index, const char *key,
3346 const char *new_name)
3347{
3349
3350 if (info != NULL) {
3351 char actname[150];
3352 GMenuItem *item;
3353
3354 fc_snprintf(actname, sizeof(actname), "app.%s", info->action);
3355 g_menu_remove(parent, index);
3356
3357 item = g_menu_item_new(new_name, actname);
3359 }
3360}
3361
3362/************************************************************************/
3366{
3367 /* The "full" city bar (i.e. the new way of drawing the
3368 * city name), can draw the city growth even without drawing
3369 * the city name. But the old method cannot. */
3371 menu_entry_set_sensitive(map, "SHOW_CITY_GROWTH", TRUE);
3372 menu_entry_set_sensitive(map, "SHOW_CITY_TRADE_ROUTES", TRUE);
3373 } else {
3374 menu_entry_set_sensitive(map, "SHOW_CITY_GROWTH", gui_options.draw_city_names);
3375 menu_entry_set_sensitive(map, "SHOW_CITY_TRADE_ROUTES",
3377 }
3378
3379 menu_entry_set_sensitive(map, "SHOW_CITY_BUY_COST",
3381 menu_entry_set_sensitive(map, "SHOW_COASTLINE", !gui_options.draw_terrain);
3382 menu_entry_set_sensitive(map, "SHOW_UNIT_SOLID_BG",
3384 menu_entry_set_sensitive(map, "SHOW_UNIT_SHIELDS",
3386 menu_entry_set_sensitive(map, "SHOW_FOCUS_UNIT", !gui_options.draw_units);
3387}
3388
3389/************************************************************************/
3395static const char *get_tile_change_menu_text(struct tile *ptile,
3396 enum unit_activity activity)
3397{
3398 struct tile *newtile = tile_virtual_new(ptile);
3399 const char *text;
3400
3401 tile_apply_activity(newtile, activity, NULL);
3402 text = tile_get_info_text(newtile, FALSE, 0);
3404
3405 return text;
3406}
3407
3408/************************************************************************/
3412{
3415 GMenu *submenu;
3416 int i, j;
3417 int tgt_kind_group;
3418 struct unit_list *punits;
3419 unsigned num_units;
3420 struct menu_entry_info *info;
3421 struct road_type *proad;
3422 struct extra_type_list *extras;
3423 bool conn_possible;
3424
3426 return;
3427 }
3428
3430
3431 submenu = g_menu_new();
3432
3433 i = 0;
3434 j = 0;
3435
3436 /* Add the new action entries grouped by target kind. */
3439 struct action *paction = action_by_number(act_id);
3440 GSimpleAction *act;
3441 char actname[256];
3442 char name[256];
3443
3444 if (action_id_get_actor_kind(act_id) != AAK_UNIT) {
3445 /* This action isn't performed by a unit. */
3446 continue;
3447 }
3448
3450 /* Wrong group. */
3451 continue;
3452 }
3453
3454 if (!units_can_do_action(punits, act_id, TRUE)) {
3455 continue;
3456 }
3457
3458 /* Create and add the menu item. */
3459 fc_snprintf(actname, sizeof(actname), "action_%d", i);
3462
3463 fc_snprintf(name, sizeof(name), "%s",
3464 action_get_ui_name_mnemonic(act_id, "_"));
3465 fc_snprintf(actname, sizeof(actname), "app.action_%d", i++);
3466
3467 if (action_id_has_complex_target(act_id)) {
3469 char subname[256];
3470
3471#define CREATE_SUB_ITEM(_sub_target_, _sub_target_key_, _sub_target_name_) \
3472{ \
3473 fc_snprintf(actname, sizeof(actname), "subtgt_%d", j); \
3474 act = g_simple_action_new(actname, NULL); \
3475 g_action_map_add_action(map, G_ACTION(act)); \
3476 g_object_set_data(G_OBJECT(act), _sub_target_key_, _sub_target_); \
3477 g_signal_connect(act, "activate", G_CALLBACK(unit_goto_and_callback), \
3478 paction); \
3479 fc_snprintf(subname, sizeof(subname), "%s", _sub_target_name_); \
3480 fc_snprintf(actname, sizeof(actname), "app.subtgt_%d", j++); \
3481 menu_item_append_unref(sub_target_menu, \
3482 g_menu_item_new(subname, actname)); \
3483}
3484
3486 case ASTK_BUILDING:
3488 CREATE_SUB_ITEM(pimpr, "end_building",
3491 break;
3492 case ASTK_TECH:
3494 CREATE_SUB_ITEM(ptech, "end_tech",
3497 break;
3498 case ASTK_EXTRA:
3500 extra_type_iterate(pextra) {
3501 if (!actres_creates_extra(paction->result, pextra)
3502 && !actres_removes_extra(paction->result, pextra)) {
3503 /* Not relevant */
3504 continue;
3505 }
3506 CREATE_SUB_ITEM(pextra, "end_extra",
3507 extra_name_translation(pextra));
3509 break;
3510 case ASTK_NONE:
3511 /* Should not be here. */
3513 break;
3514 case ASTK_COUNT:
3515 /* Should not exits */
3517 break;
3518 }
3519
3520#undef CREATE_SUB_ITEM
3521
3523 } else {
3524 g_signal_connect(act, "activate",
3527 }
3529 }
3531 g_menu_insert_submenu(unit_menu, 1, _("Go to a_nd..."), G_MENU_MODEL(submenu));
3532
3533 submenu = g_menu_new();
3534
3536 menu_entry_init(submenu, "START_REVOLUTION");
3537 }
3538
3539 i = 0;
3542 char name[256];
3543 char actname[256];
3544 GSimpleAction *act;
3545
3546 fc_snprintf(actname, sizeof(actname), "government_%d", i);
3550 g_signal_connect(act, "activate", G_CALLBACK(government_callback), g);
3551
3552 /* TRANS: %s is a government name */
3553 fc_snprintf(name, sizeof(name), _("%s..."),
3555 fc_snprintf(actname, sizeof(actname), "app.government_%d", i++);
3557 }
3560 g_menu_insert_submenu(gov_menu, 8, _("_Government"), G_MENU_MODEL(submenu));
3561
3562 submenu = g_menu_new();
3563
3565 if (pextra->buildable) {
3566 char actname[256];
3567 GSimpleAction *act;
3568
3569 fc_snprintf(actname, sizeof(actname), "path_%d", i);
3574 pextra));
3576 g_signal_connect(act, "activate", G_CALLBACK(road_callback), pextra);
3577
3578 fc_snprintf(actname, sizeof(actname), "app.path_%d", i++);
3581 }
3583
3586
3587 submenu = g_menu_new();
3588
3590 if (pextra->buildable) {
3591 char actname[256];
3592 GSimpleAction *act;
3593
3594 fc_snprintf(actname, sizeof(actname), "irrig_%d", i);
3599 pextra));
3601 g_signal_connect(act, "activate", G_CALLBACK(irrigation_callback), pextra);
3602
3603 fc_snprintf(actname, sizeof(actname), "app.irrig_%d", i++);
3606 }
3608
3610 g_menu_insert_submenu(work_menu, 3, _("Build _Irrigation"), G_MENU_MODEL(submenu));
3611
3612 submenu = g_menu_new();
3613
3615 if (pextra->buildable) {
3616 char actname[256];
3617 GSimpleAction *act;
3618
3619 fc_snprintf(actname, sizeof(actname), "mine_%d", i);
3624 pextra));
3626 g_signal_connect(act, "activate", G_CALLBACK(mine_callback), pextra);
3627
3628 fc_snprintf(actname, sizeof(actname), "app.mine_%d", i++);
3631 }
3633
3636
3637 submenu = g_menu_new();
3638
3640 char actname[256];
3641 GSimpleAction *act;
3642
3643 fc_snprintf(actname, sizeof(actname), "clean_%d", i);
3648 pextra));
3650 g_signal_connect(act, "activate", G_CALLBACK(clean_menu_callback), pextra);
3651
3652 fc_snprintf(actname, sizeof(actname), "app.clean_%d", i++);
3656
3658 g_menu_insert_submenu(work_menu, 5, _("_Clean Nuisance"),
3660
3661 submenu = g_menu_new();
3662
3664 if (pextra->buildable) {
3665 char actname[256];
3666 GSimpleAction *act;
3667
3668 fc_snprintf(actname, sizeof(actname), "base_%d", i);
3673 pextra));
3675 g_signal_connect(act, "activate", G_CALLBACK(base_callback), pextra);
3676
3677 fc_snprintf(actname, sizeof(actname), "app.base_%d", i++);
3680 }
3682
3685
3687 char acttext[128], irrtext[128], mintext[128], transtext[128];
3688 char cultext[128], plantext[128];
3689 struct terrain *pterrain;
3690
3691 if (!can_client_change_view()) {
3692 return;
3693 }
3694
3696
3697 if (num_units > 0) {
3698 const struct tile *ptile = NULL;
3699 const struct unit_type *ptype = NULL;
3700
3702 fc_assert((ptile == NULL) == (ptype == NULL));
3703
3704 if (ptile || ptype) {
3705 if (unit_tile(punit) != ptile) {
3707 }
3708 if (unit_type_get(punit) != ptype) {
3710 }
3711 } else {
3712 ptile = unit_tile(punit);
3714 }
3716 }
3717
3722 num_units > 0
3724 && !editor_is_active());
3725
3726 menu_entry_set_sensitive(map, "GAME_SAVE_AS",
3728 menu_entry_set_sensitive(map, "GAME_SAVE",
3730
3731 menu_entry_set_sensitive(map, "SERVER_OPTIONS", client.conn.established);
3732
3733 menu_entry_set_sensitive(map, "LEAVE",
3735
3737 menu_entry_set_sensitive(map, "INFRA_DLG", terrain_control.infrapoints);
3738
3739 menu_entry_set_sensitive(map, "POLICIES", multiplier_count() > 0);
3740 menu_entry_set_sensitive(map, "REPORT_TOP_CITIES", game.info.top_cities_count > 0);
3741 menu_entry_set_sensitive(map, "REPORT_SPACESHIP",
3742 client_player() != NULL && client_player()->spaceship.state != SSHIP_NONE);
3743
3744 info = menu_entry_info_find("EDIT_MODE");
3745 if (info->state != game.info.is_edit_mode) {
3746 info->state = game.info.is_edit_mode;
3750
3751 menu_entry_set_sensitive(map, "EDIT_MODE",
3754 }
3755
3756 info = menu_entry_info_find("TOGGLE_FOG");
3757 if (info->state != game.client.fog_of_war) {
3758 info->state = game.client.fog_of_war;
3759
3763 }
3764
3765 {
3766 char road_buf[500];
3767
3769 if (proad != NULL) {
3770 /* TRANS: Connect with some road type (Road/Railroad) */
3771 snprintf(road_buf, sizeof(road_buf), _("Connect With %s"),
3773 menus_rename(work_menu, 12, "CONNECT_ROAD", road_buf);
3774 }
3775
3777 if (proad != NULL) {
3778 snprintf(road_buf, sizeof(road_buf), _("Connect With %s"),
3780 menus_rename(work_menu, 13, "CONNECT_RAIL", road_buf);
3781 }
3782 }
3783
3784 if (!can_client_issue_orders()) {
3785 return;
3786 }
3787
3788 if (!punits) {
3789 return;
3790 }
3791
3792 /* Remaining part of this function: Update Unit, Work, and Combat menus */
3793
3794 /* Enable the button for adding to a city in all cases, so we
3795 * get an eventual error message from the server if we try. */
3796 menu_entry_set_sensitive(map, "BUILD_CITY",
3801
3802 menu_entry_set_sensitive(map, "DO_ACTION",
3804
3805 menu_entry_set_sensitive(map, "UNIT_TELEPORT",
3807
3808 menu_entry_set_sensitive(map, "BUILD_ROAD",
3812 menu_entry_set_sensitive(map, "BUILD_IRRIGATION",
3814 menu_entry_set_sensitive(map, "BUILD_MINE",
3816 menu_entry_set_sensitive(map, "CULTIVATE",
3818 menu_entry_set_sensitive(map, "PLANT",
3820 menu_entry_set_sensitive(map, "TRANSFORM_TERRAIN",
3822 menu_entry_set_sensitive(map, "FORTIFY",
3825 menu_entry_set_sensitive(map, "PARADROP",
3827 menu_entry_set_sensitive(map, "PILLAGE",
3829 menu_entry_set_sensitive(map, "CLEAN",
3831 menu_entry_set_sensitive(map, "BUILD_FORTRESS",
3833 menu_entry_set_sensitive(map, "BUILD_AIRBASE",
3835 menu_entry_set_sensitive(map, "UNIT_SENTRY",
3837 menu_entry_set_sensitive(map, "UNSENTRY_ALL",
3840 menu_entry_set_sensitive(map, "UNIT_HOMECITY",
3842 menu_entry_set_sensitive(map, "UNIT_UPGRADE", units_can_upgrade(&(wld.map), punits));
3843 menu_entry_set_sensitive(map, "UNIT_CONVERT", units_can_convert(&(wld.map), punits));
3844 menu_entry_set_sensitive(map, "UNIT_DISBAND",
3846 TRUE));
3847
3848 menu_entry_set_sensitive(map, "AUTO_WORKER",
3850 menu_entry_set_sensitive(map, "UNIT_EXPLORE",
3852 menu_entry_set_sensitive(map, "UNIT_BOARD",
3854 menu_entry_set_sensitive(map, "UNIT_DEBOARD",
3856 menu_entry_set_sensitive(map, "UNIT_UNLOAD_TRANSPORTER",
3858
3860 if (proad != NULL) {
3861 struct extra_type *tgt;
3862
3863 tgt = road_extra_get(proad);
3864
3866 } else {
3868 }
3869 menu_entry_set_sensitive(map, "CONNECT_ROAD", conn_possible);
3870
3872 if (proad != NULL) {
3873 struct extra_type *tgt;
3874
3875 tgt = road_extra_get(proad);
3876
3878 } else {
3880 }
3881 menu_entry_set_sensitive(map, "CONNECT_RAIL", conn_possible);
3882
3884 if (proad != NULL) {
3885 struct extra_type *tgt;
3886
3887 tgt = road_extra_get(proad);
3888
3890 } else {
3892 }
3893 menu_entry_set_sensitive(map, "CONNECT_MAGLEV", conn_possible);
3894
3896
3897 if (extra_type_list_size(extras) > 0) {
3898 struct extra_type *tgt;
3899
3900 tgt = extra_type_list_get(extras, 0);
3902 } else {
3904 }
3905 menu_entry_set_sensitive(map, "CONNECT_IRRIGATION", conn_possible);
3906
3907 menu_entry_set_sensitive(map, "TAX_RATES",
3910
3912 menus_rename(work_menu, 0, "BUILD_CITY",
3914 } else {
3915 bool city_on_tile = FALSE;
3916
3917 /* FIXME: This overloading doesn't work well with multiple focus
3918 * units. */
3920 if (tile_city(unit_tile(punit))) {
3922 break;
3923 }
3925
3927 TRUE)) {
3928 menus_rename(work_menu, 0, "BUILD_CITY",
3930 } else {
3931 /* Refresh default order */
3932 menus_rename(work_menu, 0, "BUILD_CITY",
3934 }
3935 }
3936
3938 menus_rename(work_menu, 6, "BUILD_ROAD",
3941 char road_item[500];
3942 struct extra_type *pextra = NULL;
3943
3944 /* FIXME: This overloading doesn't work well with multiple focus
3945 * units. */
3949 if (pextra != NULL) {
3950 break;
3951 }
3953
3954 if (pextra != NULL) {
3955 /* TRANS: Build road of specific type (Road/Railroad) */
3956 snprintf(road_item, sizeof(road_item), _("Build %s"),
3957 extra_name_translation(pextra));
3958 menus_rename(work_menu, 6, "BUILD_ROAD", road_item);
3959 }
3960 } else {
3961 menus_rename(work_menu, 6, "BUILD_ROAD", _("Build _Road"));
3962 }
3963
3964 if (units_all_same_type && num_units > 0) {
3965 struct unit *punit = unit_list_get(punits, 0);
3966 const struct unit_type *to_unittype
3968
3969 if (to_unittype) {
3970 /* TRANS: %s is a unit type. */
3971 fc_snprintf(acttext, sizeof(acttext), _("Upgr_ade to %s"),
3974 unit_type_get(punit))));
3975 } else {
3976 acttext[0] = '\0';
3977 }
3978 } else {
3979 acttext[0] = '\0';
3980 }
3981 if ('\0' != acttext[0]) {
3982 menus_rename(unit_menu, 13, "UNIT_UPGRADE", acttext);
3983 } else {
3984 menus_rename(unit_menu, 13, "UNIT_UPGRADE", _("Upgr_ade"));
3985 }
3986
3987 if (units_can_convert(&(wld.map), punits)) {
3988 if (units_all_same_type && num_units > 0) {
3989 struct unit *punit = unit_list_get(punits, 0);
3990
3991 /* TRANS: %s is a unit type. */
3992 fc_snprintf(acttext, sizeof(acttext), _("C_onvert to %s"),
3994 } else {
3995 acttext[0] = '\0';
3996 }
3997 } else {
3998 menu_entry_set_sensitive(map, "UNIT_CONVERT", FALSE);
3999 acttext[0] = '\0';
4000 }
4001 if ('\0' != acttext[0]) {
4002 menus_rename(unit_menu, 14, "UNIT_CONVERT", acttext);
4003 } else {
4004 menus_rename(unit_menu, 14, "UNIT_CONVERT", _("C_onvert"));
4005 }
4006
4007 if (units_all_same_tile && num_units > 0) {
4008 struct unit *first = unit_list_get(punits, 0);
4009
4010 pterrain = tile_terrain(unit_tile(first));
4011
4013 struct extra_type *pextra = NULL;
4014
4015 /* FIXME: this overloading doesn't work well with multiple focus
4016 * units. */
4020 if (pextra != NULL) {
4021 break;
4022 }
4024
4025 if (pextra != NULL) {
4026 /* TRANS: Build irrigation of specific type */
4027 snprintf(irrtext, sizeof(irrtext), _("Build %s"),
4028 extra_name_translation(pextra));
4029 } else {
4030 sz_strlcpy(irrtext, _("Build _Irrigation"));
4031 }
4032 } else {
4033 sz_strlcpy(irrtext, _("Build _Irrigation"));
4034 }
4035
4036 if (pterrain->cultivate_result != T_NONE) {
4037 fc_snprintf(cultext, sizeof(cultext), _("Change to %s"),
4040 } else {
4041 sz_strlcpy(cultext, _("_Cultivate"));
4042 }
4043
4045 struct extra_type *pextra = NULL;
4046
4047 /* FIXME: this overloading doesn't work well with multiple focus
4048 * units. */
4052 if (pextra != NULL) {
4053 break;
4054 }
4056
4057 if (pextra != NULL) {
4058 /* TRANS: Build mine of specific type */
4059 snprintf(mintext, sizeof(mintext), _("Build %s"),
4060 extra_name_translation(pextra));
4061 } else {
4062 sz_strlcpy(mintext, _("Build _Mine"));
4063 }
4064 } else {
4065 sz_strlcpy(mintext, _("Build _Mine"));
4066 }
4067
4068 if (pterrain->plant_result != T_NONE) {
4069 fc_snprintf(plantext, sizeof(plantext), _("Change to %s"),
4071 } else {
4072 sz_strlcpy(plantext, _("_Plant"));
4073 }
4074
4075 if (pterrain->transform_result != T_NONE
4076 && pterrain->transform_result != pterrain) {
4077 fc_snprintf(transtext, sizeof(transtext), _("Transf_orm to %s"),
4080 } else {
4081 sz_strlcpy(transtext, _("Transf_orm Terrain"));
4082 }
4083 } else {
4084 sz_strlcpy(irrtext, _("Build _Irrigation"));
4085 sz_strlcpy(cultext, _("_Cultivate"));
4086 sz_strlcpy(mintext, _("Build _Mine"));
4087 sz_strlcpy(plantext, _("_Plant"));
4088 sz_strlcpy(transtext, _("Transf_orm Terrain"));
4089 }
4090
4091 menus_rename(work_menu, 7, "BUILD_IRRIGATION", irrtext);
4092 menus_rename(work_menu, 9, "CULTIVATE", cultext);
4093 menus_rename(work_menu, 8, "BUILD_MINE", mintext);
4094 menus_rename(work_menu, 10, "PLANT", plantext);
4095 menus_rename(work_menu, 11, "TRANSFORM_TERRAIN", transtext);
4096
4097 menus_rename(unit_menu, 12, "UNIT_HOMECITY",
4099
4100 menus_rename(combat_menu, 1, "BUILD_FORTRESS",
4101 Q_(terrain_control.gui_type_base0));
4102 menus_rename(combat_menu, 2, "BUILD_AIRBASE",
4103 Q_(terrain_control.gui_type_base1));
4104}
4105
4106/************************************************************************/
4111{
4112 if (!menus_built) {
4113 return;
4114 }
4115
4116#ifdef MENUS_GTK3
4117
4118 if (!can_client_change_view()) {
4120
4121 return;
4122 }
4123
4126
4127 menu_entry_set_sensitive("SHOW_NATIONAL_BORDERS",
4129
4131#endif /* MENUS_GTK3 */
4132}
4133
4134/**********************************************************************/
4138{
4140
4141 if (enable) {
4142 if (main_menubar == NULL) {
4145 /* Ensure the menus are really created before performing any operations
4146 * on them. */
4147 while (g_main_context_pending(NULL)) {
4149 }
4150 }
4151
4154
4155 } else {
4158 }
4159
4160 /* Workaround for gtk bug that (re)setting the menubar after the window has
4161 * been already created is not noticed. */
4162 g_object_notify(G_OBJECT(gtk_settings_get_default()), "gtk-shell-shows-menubar");
4163}
4164
4165/**********************************************************************/
enum action_sub_target_kind action_get_sub_target_kind(const struct action *paction)
Definition actions.c:1119
const char * action_get_ui_name_mnemonic(action_id act_id, const char *mnemonic)
Definition actions.c:1258
#define action_noninternal_iterate_end
Definition actions.h:236
static struct action * action_by_number(action_id act_id)
Definition actions.h:396
#define action_id_get_actor_kind(act_id)
Definition actions.h:409
#define ACTION_ANY
Definition actions.h:52
#define action_noninternal_iterate(_act_)
Definition actions.h:231
#define action_id_get_target_kind(act_id)
Definition actions.h:413
#define action_id_has_complex_target(act_id)
Definition actions.h:431
bool actres_removes_extra(enum action_result result, const struct extra_type *pextra)
Definition actres.c:810
bool actres_creates_extra(enum action_result result, const struct extra_type *pextra)
Definition actres.c:789
struct civclient client
enum client_states client_state(void)
void send_report_request(enum report_type type)
bool can_client_issue_orders(void)
bool client_has_player(void)
bool can_client_change_view(void)
#define client_player()
@ C_S_DISCONNECTED
Definition client_main.h:45
@ C_S_RUNNING
Definition client_main.h:47
bool can_units_do_connect(struct unit_list *punits, enum unit_activity activity, struct extra_type *tgt)
Definition climisc.c:1242
void disconnect_from_server(bool leaving_sound)
Definition clinet.c:306
char * incite_cost
Definition comments.c:76
@ REPORT_WONDERS_OF_THE_WORLD
Definition conn_types.h:50
@ REPORT_DEMOGRAPHIC
Definition conn_types.h:53
@ REPORT_WONDERS_OF_THE_WORLD_LONG
Definition conn_types.h:51
@ REPORT_ACHIEVEMENTS
Definition conn_types.h:54
@ REPORT_TOP_CITIES
Definition conn_types.h:52
void send_save_game(const char *filename)
bool is_server_running(void)
bool can_client_access_hack(void)
bool can_conn_enable_editing(const struct connection *pconn)
Definition connection.c:521
void key_coastline_toggle(void)
Definition control.c:3952
void key_irrigation_toggle(void)
Definition control.c:3968
void key_unit_sentry(void)
Definition control.c:3756
void key_city_output_toggle(void)
Definition control.c:3853
void request_unit_return(struct unit *punit)
Definition control.c:1552
void request_unit_fortify(struct unit *punit)
Definition control.c:2353
void request_unit_caravan_action(struct unit *punit, action_id action)
Definition control.c:2223
void key_focus_unit_toggle(void)
Definition control.c:4048
void key_unit_auto_explore(void)
Definition control.c:3577
void key_unit_connect(enum unit_activity activity, struct extra_type *tgt)
Definition control.c:3375
void key_city_full_bar_toggle(void)
Definition control.c:3885
void key_bases_toggle(void)
Definition control.c:3984
void key_map_native_toggle(void)
Definition control.c:3877
void key_resources_toggle(void)
Definition control.c:3992
void request_unit_goto(enum unit_orders last_order, action_id act_id, int sub_tgt_id)
Definition control.c:1130
void key_unit_paradrop(void)
Definition control.c:3479
struct unit_list * get_units_in_focus(void)
Definition control.c:177
void key_unit_teleport(void)
Definition control.c:3495
void key_unit_shields_toggle(void)
Definition control.c:4040
void key_city_productions_toggle(void)
Definition control.c:3919
void key_unit_plant(void)
Definition control.c:3696
void key_unit_fortress(void)
Definition control.c:3624
void key_unit_mine(void)
Definition control.c:3688
void key_unit_pillage(void)
Definition control.c:3708
void request_unit_unload(struct unit *pcargo)
Definition control.c:2194
void key_editor_toggle_fogofwar(void)
Definition control.c:4081
void request_new_unit_activity_targeted(struct unit *punit, enum unit_activity act, struct extra_type *tgt)
Definition control.c:1938
void key_unit_irrigate(void)
Definition control.c:3668
void request_unit_build_city(struct unit *punit)
Definition control.c:1817
void key_unit_unload_all(void)
Definition control.c:3517
void key_cities_toggle(void)
Definition control.c:4016
void key_city_outlines_toggle(void)
Definition control.c:3845
void key_unit_homecity(void)
Definition control.c:3641
void key_unit_patrol(void)
Definition control.c:3487
void key_unit_solid_bg_toggle(void)
Definition control.c:4032
void key_terrain_toggle(void)
Definition control.c:3944
void key_paths_toggle(void)
Definition control.c:3960
void key_unit_wakeup_others(void)
Definition control.c:3550
void key_unit_stack_size_toggle(void)
Definition control.c:3936
void key_huts_toggle(void)
Definition control.c:4000
void key_fog_of_war_toggle(void)
Definition control.c:4056
void key_unit_wait(void)
Definition control.c:3542
void key_units_toggle(void)
Definition control.c:4024
void key_unit_select_battlegroup(int battlegroup, bool append)
Definition control.c:3819
void key_map_grid_toggle(void)
Definition control.c:3861
void key_pollution_toggle(void)
Definition control.c:4008
void key_city_growth_toggle(void)
Definition control.c:3902
void key_unit_action_select_tgt(void)
Definition control.c:3406
void key_city_buycost_toggle(void)
Definition control.c:3911
int get_num_units_in_focus(void)
Definition control.c:185
void key_unit_transform(void)
Definition control.c:3768
void key_unit_done(void)
Definition control.c:3463
void key_city_trade_routes_toggle(void)
Definition control.c:3928
void key_city_names_toggle(void)
Definition control.c:3893
void request_unit_select(struct unit_list *punits, enum unit_select_type_mode seltype, enum unit_select_location_mode selloc)
Definition control.c:1621
void key_unit_auto_work(void)
Definition control.c:3590
void key_unit_airbase(void)
Definition control.c:3560
void key_unit_goto(void)
Definition control.c:3471
void key_unit_convert(void)
Definition control.c:3602
void key_unit_clean(void)
Definition control.c:3720
void key_editor_toggle(void)
Definition control.c:4064
void key_unit_assign_battlegroup(int battlegroup, bool append)
Definition control.c:3780
void key_unit_cultivate(void)
Definition control.c:3676
void key_mines_toggle(void)
Definition control.c:3976
void key_map_borders_toggle(void)
Definition control.c:3869
#define can_unit_do_activity_targeted_client(_punit_, _act_, _tgt_)
Definition control.h:43
#define can_units_do_activity_targeted_client(_punits_, _act_, _tgt_)
Definition control.h:47
#define can_units_do_activity_client(_punits_, _act_)
Definition control.h:45
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
Definition dialogs_g.h:74
bool editor_is_active(void)
Definition editor.c:346
@ OBJTYPE_GAME
Definition editor.h:31
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:779
int extra_number(const struct extra_type *pextra)
Definition extras.c:161
struct extra_type_list * extra_type_list_by_cause(enum extra_cause cause)
Definition extras.c:249
static struct extra_type extras[MAX_EXTRA_TYPES]
Definition extras.c:31
const char * extra_name_translation(const struct extra_type *pextra)
Definition extras.c:194
#define extra_type_iterate(_p)
Definition extras.h:315
#define extra_type_iterate_end
Definition extras.h:321
#define extra_type_by_rmcause_iterate_end
Definition extras.h:358
#define extra_type_by_rmcause_iterate(_rmcause, _extra)
Definition extras.h:353
#define extra_type_by_cause_iterate_end
Definition extras.h:339
#define extra_type_by_cause_iterate(_cause, _extra)
Definition extras.h:333
#define NO_TARGET
Definition fc_types.h:213
@ BORDERS_DISABLED
Definition fc_types.h:745
#define Q_(String)
Definition fcintl.h:70
#define _(String)
Definition fcintl.h:67
#define N_(String)
Definition fcintl.h:69
struct civ_game game
Definition game.c:61
struct world wld
Definition game.c:62
const char * government_name_translation(const struct government *pgovern)
Definition government.c:143
bool untargeted_revolution_allowed(void)
Definition government.c:566
bool can_change_to_government(struct player *pplayer, const struct government *gov)
Definition government.c:166
#define governments_iterate(NAME_pgov)
Definition government.h:124
#define governments_iterate_end
Definition government.h:127
void log_output_window(void)
Definition chatline.c:929
void clear_output_window(void)
Definition chatline.c:944
void city_report_dialog_popup(bool raise)
Definition cityrep.c:292
void unit_select_dialog_popup(struct tile *ptile)
Definition dialogs.c:377
void popup_upgrade_dialog(struct unit_list *punits)
Definition dialogs.c:1435
void popup_disband_dialog(struct unit_list *punits)
Definition dialogs.c:1473
void editgui_refresh(void)
Definition editgui.c:1796
void property_editor_popup(struct property_editor *pe, enum editor_object_type objtype)
Definition editprop.c:6292
struct property_editor * editprop_get_property_editor(void)
Definition editprop.c:6245
void property_editor_reload(struct property_editor *pe, enum editor_object_type objtype)
Definition editprop.c:6382
void popup_find_dialog(void)
Definition finddlg.c:58
void popup_multiplier_dialog(void)
Definition gamedlgs.c:383
void popup_rates_dialog(void)
Definition gamedlgs.c:533
void popup_goto_dialog(void)
Definition gotodlg.c:258
void fullscreen_opt_refresh(struct option *poption)
Definition gui_main.c:2434
gboolean map_canvas_focus(void)
Definition gui_main.c:360
GtkWidget * toplevel
Definition gui_main.c:126
void popup_quit_dialog(void)
Definition gui_main.c:2350
#define GUI_GTK_OPTION(optname)
Definition gui_main.h:25
void setup_dialog(GtkWidget *shell, GtkWidget *parent)
Definition gui_stuff.c:287
void popup_help_dialog_string(const char *item)
Definition helpdlg.c:212
void infra_dialog_popup(void)
Definition infradlg.c:85
void luaconsole_dialog_popup(bool raise)
Definition luaconsole.c:126
void center_on_unit(void)
Definition mapctrl.c:496
static void save_mapimg_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:697
static void show_national_borders_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1207
static void show_focus_unit_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1443
GtkWidget * setup_menus(GtkWidget *window)
Definition menu.c:2151
static void help_connecting_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:857
static void menus_rename(const char *key, const gchar *new_label)
Definition menu.c:2285
static void help_combat_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1065
static void menu_entry_group_set_sensitive(enum menu_entry_grouping group, gboolean is_sensitive)
Definition menu.c:2253
static void help_ruleset_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1009
static void select_single_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1513
static void unit_unload_transporter_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1721
static void help_government_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1105
static void report_achievements_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:833
static void show_fog_of_war_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1454
static void help_zoc_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1073
static void show_city_productions_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1264
static void client_lua_script_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:817
static void show_city_names_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1241
static void help_space_race_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1121
static void help_tileset_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1017
static void help_playing_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1001
static void plant_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1839
static struct menu_entry_info menu_entries[]
Definition menu.c:267
static void base_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2001
static void help_economy_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1033
static void unit_sentry_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1685
static void center_view_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2041
static void unit_explore_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1669
static void build_mine_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1831
static void quit_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:749
static void unit_return_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1659
static void show_city_trade_routes_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1287
static void transform_terrain_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1911
static void help_wonders_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1097
static void show_terrain_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1298
static void show_city_growth_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1253
static void show_stack_size_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1432
static void multiplier_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1985
static void help_terrain_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1089
static void save_game_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:681
static void show_unit_solid_bg_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1410
static void show_coastline_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1309
static void toggle_fog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1485
static void show_city_full_bar_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1229
static void edit_mode_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1162
static void help_chatline_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:873
static void show_paths_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1319
static void connect_road_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1847
static void help_overview_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:993
static void save_game_as_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:689
static void help_diplomacy_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1113
static void show_units_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1399
static void show_irrigation_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1329
static void show_map_grid_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1196
static void help_improvements_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1049
static void find_city_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:757
static void report_nations_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:781
static void report_demographic_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:825
static void help_worklist_editor_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:881
static void help_cities_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1041
static void leave_local_game_response(GtkWidget *dialog, gint response)
Definition menu.c:714
static void help_language_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:841
static void server_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:657
static void leave_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:729
static void select_same_type_cont_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1537
static void unit_convert_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1746
static void select_dialog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1553
static void show_huts_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1369
static void report_wow_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:789
static void unit_upgrade_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1738
static void help_tech_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1081
static void unit_goto_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1593
static void clean_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2026
static void build_city_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1762
static void unit_patrol_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1677
void real_menus_init(void)
Definition menu.c:2915
menu_entry_grouping
Definition menu.c:91
@ MGROUP_ALL
Definition menu.c:92
@ MGROUP_PLAYING
Definition menu.c:91
@ MGROUP_PLAYER
Definition menu.c:92
@ MGROUP_SAFE
Definition menu.c:91
@ MGROUP_EDIT
Definition menu.c:91
@ MGROUP_UNIT
Definition menu.c:92
static void rally_dialog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1561
static void help_about_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1145
static void build_road_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1789
static void local_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:641
static void show_cities_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1389
static void unit_homecity_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1730
static void menu_entry_set_sensitive(const char *key, gboolean is_sensitive)
Definition menu.c:2240
static void show_pollution_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1379
static void save_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:665
static void save_mapimg_as_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:705
static void worklists_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:765
static void connect_maglev_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1879
static void full_screen_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1465
static void report_top_cities_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:801
static void help_controls_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:865
static void select_same_type_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1545
static void connect_rail_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1863
static void unit_wait_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1577
static const char * get_tile_change_menu_text(struct tile *ptile, enum unit_activity activity)
Definition menu.c:2338
static void build_airbase_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1945
static void report_cities_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2057
static void infra_dialog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1569
static void message_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:649
static void tax_rate_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1977
static void help_musicset_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1025
static void unit_goto_city_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1649
static struct menu_entry_info * menu_entry_info_find(const char *key)
Definition menu.c:2211
static void auto_work_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1781
static void government_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1993
static void report_economy_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2065
static void report_messages_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:809
static void show_bases_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1349
static void select_same_type_tile_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1529
static void save_options_on_exit_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1153
static void show_native_tiles_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1218
static void menu_entry_init(GtkBuildable *item)
Definition menu.c:2091
static void show_unit_shields_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1421
static void reload_tileset_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:673
static void scenario_properties_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1493
static void clear_chat_logs_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:625
static void unit_deboard_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1711
static void help_policies_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:849
static void unit_done_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1585
static void help_nations_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1129
static void unit_goto_and_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1601
static void show_city_output_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1185
static void show_city_outlines_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1174
static void save_scenario_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1505
static void help_copying_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1137
static void cultivate_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1823
static void save_chat_logs_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:633
void real_menus_update(void)
Definition menu.c:2353
static void report_spaceship_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2081
static void select_all_on_tile_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1521
static void show_city_buy_cost_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1276
static void build_fortress_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1927
#define CREATE_SUB_ITEM(_sub_target_, _sub_target_key_, _sub_target_name_)
static void view_menu_update_sensitivity(void)
Definition menu.c:2306
static void unit_board_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1701
static void fortify_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1935
static void show_resources_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1359
static void connect_irrigation_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1895
static void build_irrigation_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1815
static void report_units_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2049
static void road_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2013
static void unit_disband_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1754
static void help_units_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1057
static void report_research_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2073
static void map_view_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:773
void popup_messageopt_dialog(void)
Definition messagedlg.c:51
void meswin_dialog_popup(bool raise)
Definition messagewin.c:417
void option_dialog_popup(const char *name, const struct option_set *poptset)
Definition optiondlg.c:972
void save_mapimg_dialog_popup(void)
Definition pages.c:3551
void mapimg_client_save(const char *filename)
Definition pages.c:3570
void save_game_dialog_popup(void)
Definition pages.c:3487
void save_scenario_dialog_popup(void)
Definition pages.c:3522
void popup_players_dialog(bool raise)
Definition plrdlg.c:91
void rally_dialog_popup(void)
void science_report_dialog_popup(bool raise)
Definition repodlgs.c:716
void economy_report_dialog_popup(bool raise)
Definition repodlgs.c:1243
void units_report_dialog_popup(bool raise)
Definition repodlgs.c:1768
void science_report_dialog_popdown(void)
Definition repodlgs.c:740
void popup_spaceship_dialog(struct player *pplayer)
bool request_transport(struct unit *cargo, struct tile *ptile)
void popup_worklists_report(void)
Definition wldlg.c:287
static GtkApplication * fc_app
Definition gui_main.c:184
GtkApplication * gui_app(void)
Definition gui_main.c:2674
#define submenu_append_unref(menu, name, submenu)
Definition gui_stuff.h:165
#define menu_item_insert_unref(menu, index, item)
Definition gui_stuff.h:142
#define menu_item_append_unref(menu, item)
Definition gui_stuff.h:149
static void help_governor_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:1654
static void irrigation_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2744
static void bg_append_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2874
static void unsentry_all_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2345
static GMenu * combat_menu
Definition menu.c:89
static GMenuItem * create_toggle_menu_item_for_key(const char *key)
Definition menu.c:2908
static void pillage_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2657
void enable_menus(bool enable)
Definition menu.c:4133
static void setup_app_actions(GApplication *fc_app)
Definition menu.c:2959
static GMenu * options_menu
Definition menu.c:83
static void register_bg_actions(GActionMap *map, int bg)
Definition menu.c:2999
const GActionEntry acts[]
Definition menu.c:1042
static void revolution_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2705
static GMenu * view_menu
Definition menu.c:85
@ VMENU_HUTS
Definition menu.c:1030
@ VMENU_MINES
Definition menu.c:1027
@ VMENU_COASTLINE
Definition menu.c:1024
@ VMENU_UNIT_SOLID_BG
Definition menu.c:1034
@ VMENU_CITY_NAMES
Definition menu.c:1018
@ VMENU_UNITS
Definition menu.c:1033
@ VMENU_CITY_FULL_BAR
Definition menu.c:1017
@ VMENU_CITY_OUTLINES
Definition menu.c:1012
@ VMENU_POLLUTION
Definition menu.c:1031
@ VMENU_FOCUS_UNIT
Definition menu.c:1037
@ VMENU_BASES
Definition menu.c:1028
@ VMENU_MAP_GRID
Definition menu.c:1014
@ VMENU_CITY_BUY_COST
Definition menu.c:1021
@ VMENU_TERRAIN
Definition menu.c:1023
@ VMENU_CITY_GROWTH
Definition menu.c:1019
@ VMENU_PATHS
Definition menu.c:1025
@ VMENU_CITIES
Definition menu.c:1032
@ VMENU_STACK_SIZE
Definition menu.c:1036
@ VMENU_UNIT_SHIELDS
Definition menu.c:1035
@ VMENU_IRRIGATION
Definition menu.c:1026
@ VMENU_NATIVE_TILES
Definition menu.c:1016
@ VMENU_CITY_OUTPUT
Definition menu.c:1013
@ VMENU_RESOURCES
Definition menu.c:1029
@ VMENU_CITY_PRODUCTIONS
Definition menu.c:1020
@ VMENU_CITY_TRADE_ROUTES
Definition menu.c:1022
@ VMENU_FULL_SCREEN
Definition menu.c:1039
@ VMENU_NAT_BORDERS
Definition menu.c:1015
@ VMENU_FOW
Definition menu.c:1038
static GMenu * work_menu
Definition menu.c:88
static void bg_assign_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2864
static void menu_entry_set_sensitive_info(GActionMap *map, struct menu_entry_info *info, gboolean is_enabled)
Definition menu.c:3297
static bool menus_built
Definition menu.c:74
static void show_mines_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:1950
static GMenu * edit_menu
Definition menu.c:84
void menus_disable_unit_commands(void)
Definition menu.c:4164
static void unit_teleport_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2326
static void paradrop_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2647
const struct menu_entry_option_map meoms[]
Definition menu.c:1730
static GMenu * unit_menu
Definition menu.c:87
static void do_action_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2667
static void bg_select_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2854
static void mine_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2759
static GMenu * main_menubar
Definition menu.c:73
static GMenuItem * create_toggle_menu_item(struct menu_entry_info *info)
Definition menu.c:2885
void menus_set_initial_toggle_values(void)
Definition menu.c:2941
static void clean_menu_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2774
static void view_menu_item_toggle(void(*cb)(void), bool updt_sensitivity, gpointer data)
Definition menu.c:1771
#define enable(id)
Definition widget.h:223
void popup_revolution_dialog(void)
Definition dialogs.c:112
#define HELP_MUSICSET_ITEM
#define HELP_CITIES_ITEM
#define HELP_TERRAIN_ITEM
#define HELP_LANGUAGES_ITEM
#define HELP_CONNECTING_ITEM
#define HELP_TILESET_ITEM
#define HELP_CHATLINE_ITEM
#define HELP_RULESET_ITEM
#define HELP_GOVERNMENT_ITEM
#define HELP_ABOUT_ITEM
#define HELP_MULTIPLIER_ITEM
#define HELP_PLAYING_ITEM
#define HELP_IMPROVEMENTS_ITEM
#define HELP_UNITS_ITEM
#define HELP_ZOC_ITEM
#define HELP_WORKLIST_EDITOR_ITEM
#define HELP_WONDERS_ITEM
#define HELP_COMBAT_ITEM
#define HELP_SPACE_RACE_ITEM
#define HELP_COPYING_ITEM
#define HELP_OVERVIEW_ITEM
#define HELP_NATIONS_ITEM
#define HELP_TECHS_ITEM
#define HELP_DIPLOMACY_ITEM
#define HELP_ECONOMY_ITEM
#define HELP_CMA_ITEM
#define HELP_CONTROLS_ITEM
Impr_type_id improvement_number(const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
#define improvement_iterate_end
#define improvement_iterate(_p)
const char * name
Definition inputfile.c:127
#define fc_assert_ret(condition)
Definition log.h:192
#define fc_assert(condition)
Definition log.h:177
#define FC_STATIC_ASSERT(cond, tag)
Definition log.h:238
struct terrain_misc terrain_control
Definition map.c:68
Multiplier_type_id multiplier_count(void)
Definition multipliers.c:88
const struct option_set * server_optset
Definition options.c:4278
const struct option_set * client_optset
Definition options.c:1316
void options_save(option_save_log_callback log_cb)
Definition options.c:6340
struct client_options gui_options
Definition options.c:71
@ GUI_GTK_MSGCHAT_MERGED
Definition options.h:69
struct extra_type * road_extra_get(const struct road_type *proad)
Definition road.c:42
struct road_type * road_by_gui_type(enum road_gui_type gui_type)
Definition road.c:180
static char * grouping
Definition shared.c:98
@ SSHIP_NONE
Definition spaceship.h:84
struct civ_game::@32::@35 client
bool fog_of_war
Definition game.h:121
struct packet_game_info info
Definition game.h:89
struct government * government_during_revolution
Definition game.h:94
struct connection conn
Definition client_main.h:96
bool draw_native
Definition options.h:216
bool draw_specials
Definition options.h:208
bool draw_city_output
Definition options.h:195
bool draw_city_names
Definition options.h:197
bool draw_city_productions
Definition options.h:199
bool draw_mines
Definition options.h:206
bool draw_borders
Definition options.h:215
bool draw_fortress_airbase
Definition options.h:207
bool draw_city_buycost
Definition options.h:200
bool draw_unit_stack_size
Definition options.h:219
bool draw_irrigation
Definition options.h:205
bool draw_terrain
Definition options.h:202
bool draw_units
Definition options.h:212
bool draw_fog_of_war
Definition options.h:214
bool draw_city_trade_routes
Definition options.h:201
bool draw_unit_shields
Definition options.h:218
bool draw_cities
Definition options.h:211
bool save_options_on_exit
Definition options.h:125
bool draw_map_grid
Definition options.h:196
bool draw_city_growth
Definition options.h:198
bool draw_focus_unit
Definition options.h:213
bool draw_paths
Definition options.h:204
bool draw_city_outlines
Definition options.h:194
bool draw_coastline
Definition options.h:203
bool draw_full_citybar
Definition options.h:217
bool draw_pollution
Definition options.h:210
bool solid_color_behind_units
Definition options.h:150
bool established
Definition connection.h:140
struct player * playing
Definition connection.h:151
struct extra_type::@26 data
Definition climisc.h:82
Definition menu.c:97
const char * accl
Definition menu.c:95
const char * key
Definition menu.c:98
bool state
Definition menu.c:98
enum menu_entry_grouping grouping
Definition menu.c:103
void(* toggle)(GSimpleAction *act, GVariant *value, gpointer data)
Definition menu.c:97
GCallback cb
Definition menu.c:102
const char * name
Definition menu.c:99
const char * action
Definition menu.c:94
Definition menu.c:1724
bool * option
Definition menu.c:1726
const char * menu_entry
Definition menu.c:1725
int menu_pos
Definition menu.c:1727
enum borders_mode borders
struct terrain * cultivate_result
Definition terrain.h:108
struct terrain * plant_result
Definition terrain.h:111
struct terrain * transform_result
Definition terrain.h:122
Definition tile.h:50
Definition unit.h:140
struct civ_map map
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:960
#define sz_strlcpy(dest, src)
Definition support.h:195
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47
const char * advance_name_translation(const struct advance *padvance)
Definition tech.c:300
Tech_type_id advance_number(const struct advance *padvance)
Definition tech.c:98
#define advance_iterate(_p)
Definition tech.h:271
#define advance_iterate_end
Definition tech.h:272
#define T_NONE
Definition terrain.h:61
void tile_virtual_destroy(struct tile *vtile)
Definition tile.c:1035
bool tile_apply_activity(struct tile *ptile, Activity_type_id act, struct extra_type *tgt)
Definition tile.c:681
struct tile * tile_virtual_new(const struct tile *ptile)
Definition tile.c:981
const char * tile_get_info_text(const struct tile *ptile, bool include_nuisances, int linebreaks)
Definition tile.c:771
struct city * tile_city(const struct tile *ptile)
Definition tile.c:83
#define tile_terrain(_tile)
Definition tile.h:111
bool tilespec_reread(const char *new_tileset_name, bool game_fully_initialized, float scale)
Definition tilespec.c:1401
bool unit_can_est_trade_route_here(const struct unit *punit)
Definition unit.c:284
bool unit_can_add_or_build_city(const struct civ_map *nmap, const struct unit *punit)
Definition unit.c:472
bool can_unit_change_homecity(const struct civ_map *nmap, const struct unit *punit)
Definition unit.c:505
bool can_unit_do_autoworker(const struct unit *punit)
Definition unit.c:630
bool can_unit_teleport(const struct civ_map *nmap, const struct unit *punit)
Definition unit.c:830
bool can_unit_paradrop(const struct civ_map *nmap, const struct unit *punit)
Definition unit.c:846
bool unit_can_help_build_wonder_here(const struct civ_map *nmap, const struct unit *punit)
Definition unit.c:258
#define unit_tile(_pu)
Definition unit.h:404
@ ORDER_PERFORM_ACTION
Definition unit.h:48
#define unit_owner(_pu)
Definition unit.h:403
#define MAX_NUM_BATTLEGROUPS
Definition unit.h:192
bool units_can_convert(const struct civ_map *nmap, const struct unit_list *punits)
Definition unitlist.c:350
bool units_are_occupied(const struct unit_list *punits)
Definition unitlist.c:273
bool units_can_unload(const struct civ_map *nmap, const struct unit_list *punits)
Definition unitlist.c:301
bool can_units_do_base_gui(const struct unit_list *punits, enum base_gui_type base_gui)
Definition unitlist.c:180
bool can_units_do_any_road(const struct civ_map *nmap, const struct unit_list *punits)
Definition unitlist.c:161
bool units_can_upgrade(const struct civ_map *nmap, const struct unit_list *punits)
Definition unitlist.c:335
bool units_have_activity_on_tile(const struct unit_list *punits, enum unit_activity activity)
Definition unitlist.c:319
bool units_have_type_flag(const struct unit_list *punits, enum unit_type_flag_id flag, bool has_flag)
Definition unitlist.c:202
bool can_units_do(const struct unit_list *punits, bool(can_fn)(const struct unit *punit))
Definition unitlist.c:95
bool units_can_do_action(const struct unit_list *punits, action_id act_id, bool can_do)
Definition unitlist.c:239
bool units_can_load(const struct unit_list *punits)
Definition unitlist.c:287
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
#define unit_list_iterate(unitlist, punit)
Definition unitlist.h:31
#define unit_list_iterate_end
Definition unitlist.h:33
const struct unit_type * unit_type_get(const struct unit *punit)
Definition unittype.c:123
const struct unit_type * can_upgrade_unittype(const struct player *pplayer, const struct unit_type *punittype)
Definition unittype.c:1709
const char * utype_name_translation(const struct unit_type *punittype)
Definition unittype.c:1566
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
Definition unittype.c:377