Freeciv-3.3
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "bitvector.h"
#include "fcintl.h"
#include "log.h"
#include "mem.h"
#include "shared.h"
#include "support.h"
#include "city.h"
#include "counters.h"
#include "game.h"
#include "map.h"
#include "movement.h"
#include "packets.h"
#include "player.h"
#include "unitlist.h"
#include "chatline_common.h"
#include "client_main.h"
#include "colors.h"
#include "control.h"
#include "climap.h"
#include "options.h"
#include "text.h"
#include "tilespec.h"
#include "cma_fec.h"
#include "choice_dialog.h"
#include "citizensinfo.h"
#include "cityrep.h"
#include "cma_fe.h"
#include "dialogs.h"
#include "graphics.h"
#include "gui_main.h"
#include "gui_stuff.h"
#include "happiness.h"
#include "helpdlg.h"
#include "inputdlg.h"
#include "mapview.h"
#include "update_queue.h"
#include "wldlg.h"
#include "citydlg.h"
#include "speclist.h"
#include "specvec.h"
Go to the source code of this file.
Data Structures | |
struct | unit_node |
struct | city_map_canvas |
struct | city_dialog |
Enumerations | |
enum | citydlg_response { CDLGR_UNITS , CDLGR_PREV , CDLGR_NEXT } |
enum | { OVERVIEW_PAGE , WORKLIST_PAGE , HAPPINESS_PAGE , CMA_PAGE , SETTINGS_PAGE , STICKY_PAGE , NUM_PAGES } |
enum | { INFO_SIZE , INFO_FOOD , INFO_SHIELD , INFO_TRADE , INFO_GOLD , INFO_LUXURY , INFO_SCIENCE , INFO_GRANARY , INFO_GROWTH , INFO_CORRUPTION , INFO_WASTE , INFO_CULTURE , INFO_POLLUTION , INFO_ILLNESS , INFO_STEAL , INFO_AIRLIFT , NUM_INFO_FIELDS } |
Variables | ||
static struct dialog_list * | dialog_list | |
static bool | city_dialogs_have_been_initialised = FALSE | |
static int | canvas_width | |
static int | canvas_height | |
static int | new_dialog_def_page = OVERVIEW_PAGE | |
static int | last_page = OVERVIEW_PAGE | |
static bool | is_showing_workertask_dialog = FALSE | |
struct { | ||
struct city * owner | ||
struct tile * loc | ||
} | workertask_req | |
static bool | low_citydlg | |
#define CITYMAP_HEIGHT (CITYMAP_WIDTH * canvas_height / canvas_width) |
#define CITYMAP_SCALE ((double)CITYMAP_WIDTH / (double)canvas_width) |
#define CITYMAP_WIDTH MIN(512, canvas_width) |
#define dialog_list_iterate | ( | dialoglist, | |
pdialog | |||
) | TYPED_LIST_ITERATE(struct city_dialog, dialoglist, pdialog) |
#define dialog_list_iterate_end LIST_ITERATE_END |
#define SPECLIST_TYPE struct city_dialog |
#define unit_node_vector_iterate_end VECTOR_ITERATE_END |
|
static |
User has pressed button on citymap
Definition at line 3124 of file citydlg.c.
Referenced by city_dialog_map_create().
User has clicked buy-button
Definition at line 3187 of file citydlg.c.
Referenced by create_and_append_overview_page(), create_production_header(), and create_production_header().
User has answered buy cost dialog
Definition at line 3174 of file citydlg.c.
Referenced by buy_callback().
Redraw map canvas on expose.
Definition at line 404 of file citydlg.c.
Referenced by city_dialog_map_create().
|
static |
Callback for the dropdown production menu.
Definition at line 3237 of file citydlg.c.
Referenced by create_and_append_overview_page().
|
static |
Somebody clicked our list of citizens. If they clicked a specialist then change its type, else do nothing.
Definition at line 2956 of file citydlg.c.
Referenced by create_city_dialog().
User has closed rename city dialog
Definition at line 3459 of file citydlg.c.
Referenced by create_city_dialog().
Return whether city dialog for given city is open
Definition at line 587 of file citydlg.c.
Referenced by city_packet_common(), popdown_city_cma_dialog(), popdown_city_dialog(), popdown_worklist_editor(), popup_hurry_production_dialog(), and real_city_dialog_refresh().
|
static |
Create a city map widget; used in the overview and in the happiness page.
Definition at line 423 of file citydlg.c.
Referenced by create_and_append_happiness_page(), create_citydlg_main_map(), and create_citydlg_main_map().
Center city dialog map.
Definition at line 462 of file citydlg.c.
Referenced by real_city_dialog_popup(), and switch_city_callback().
|
static |
Update what city is building and buy cost in city dialog
Definition at line 2069 of file citydlg.c.
Referenced by real_city_dialog_refresh().
|
static |
Update citizens in city dialog
Definition at line 1869 of file citydlg.c.
Referenced by real_city_dialog_refresh().
|
static |
Update counters tab in city dialog
Definition at line 1413 of file citydlg.c.
Referenced by create_and_append_counters_page(), and real_city_dialog_refresh().
|
static |
Update list of improvements in city dialog
Definition at line 2192 of file citydlg.c.
Referenced by real_city_dialog_refresh().
|
static |
Update textual info fields in city dialog
Definition at line 1932 of file citydlg.c.
Referenced by real_city_dialog_refresh().
|
static |
Update map display of city dialog
Definition at line 2047 of file citydlg.c.
Referenced by real_city_dialog_refresh(), and reset_city_dialogs().
|
static |
Update list of present units in city dialog
Definition at line 2356 of file citydlg.c.
Referenced by gui_refresh_unit_city_dialogs(), real_city_dialog_refresh(), and refresh_unit_city_dialogs().
Updates the sensitivity of the prev and next buttons. this does not need pdialog as a parameter, since it iterates over all the open dialogs. note: we still need the sensitivity code in create_city_dialog() for the spied dialogs.
Definition at line 2463 of file citydlg.c.
Referenced by city_destroy_callback(), and create_city_dialog().
|
static |
Update list of supported units in city dialog
Definition at line 2249 of file citydlg.c.
Referenced by gui_refresh_unit_city_dialogs(), real_city_dialog_refresh(), and refresh_unit_city_dialogs().
|
static |
Update title of city dialog.
Definition at line 1830 of file citydlg.c.
Referenced by real_city_dialog_refresh().
User clicked button from action area.
Definition at line 2502 of file citydlg.c.
Referenced by create_city_dialog().
City options callbacks
Definition at line 3391 of file citydlg.c.
Referenced by create_and_append_settings_page().
User has clicked rename city-button
Definition at line 3451 of file citydlg.c.
Referenced by create_city_dialog().
|
static |
Close city dialog
Definition at line 3514 of file citydlg.c.
Referenced by close_callback(), middle_present_unit_release(), middle_supported_unit_release(), popdown_all_city_dialogs(), popdown_city_dialog(), present_unit_activate_close_callback(), present_unit_activate_close_callback(), present_unit_middle_callback(), supported_unit_activate_close_callback(), supported_unit_activate_close_callback(), and supported_unit_middle_callback().
|
static |
Create buildings list page for small screens
Definition at line 1238 of file citydlg.c.
Referenced by create_city_dialog().
|
static |
Citizen Management Agent (CMA) Page ****
Definition at line 1480 of file citydlg.c.
Referenced by create_city_dialog().
|
static |
Counters Page **** Creates counters page
Definition at line 1393 of file citydlg.c.
Referenced by create_city_dialog().
|
static |
Happiness Page ****
+- GtkWidget *page -------—+----------------------------------------—+ | +- GtkWidget *left ---—+ | +- GtkWidget *right -----------------—+ | | | Info | | | City map | | | +- GtkWidget *citizens –+ | +- GtkWidget pdialog->happiness.widget -+ | | | Citizens data | | | Happiness | | | +---------------------—+ | +------------------------------------—+ | +-------------------------—+----------------------------------------—+
Definition at line 1316 of file citydlg.c.
Referenced by create_city_dialog().
|
static |
Create map page for small screens
Definition at line 1144 of file citydlg.c.
Referenced by create_city_dialog().
|
static |
Overview page ****
+- GtkWidget *page ---------------------------------------—+ | +- GtkWidget *middle --------—+---------------------—+ | | | City map | Production | | | +----------------------------—+---------------------—+ | +---------------------------------------------------------—+ | +- GtkWidget *bottom ----—+-------------------------—+ | | | Info | +- GtkWidget *right --—+ | | | | | | supported units | | | | | | +---------------------—+ | | | | | | present units | | | | | | +---------------------—+ | | | +------------------------—+-------------------------—+ | +---------------------------------------------------------—+
Definition at line 956 of file citydlg.c.
Referenced by create_city_dialog().
|
static |
Misc. Settings Page ****
Definition at line 1500 of file citydlg.c.
Referenced by create_city_dialog().
|
static |
|
static |
Main City Dialog ****
+-------------------------—+----------------------------—+ | GtkWidget *top: Citizens | city name | +-------------------------—+----------------------------—+ | [notebook tab] | +---------------------------------------------------------—+
Definition at line 1642 of file citydlg.c.
Referenced by real_city_dialog_popup().
|
static |
Used once in the overview page and once in the happiness page info_label points to the info_label in the respective struct
Definition at line 745 of file citydlg.c.
Referenced by create_and_append_happiness_page(), and create_and_append_overview_page().
|
static |
Create improvements list
Definition at line 897 of file citydlg.c.
Referenced by create_and_append_buildings_page(), and create_and_append_overview_page().
|
static |
Create main citydlg map
Definition at line 880 of file citydlg.c.
Referenced by create_and_append_map_page(), and create_and_append_overview_page().
|
static |
Create production page header - what tab this actually is, depends on screen size and layout.
Definition at line 1205 of file citydlg.c.
Referenced by create_and_append_buildings_page(), and create_and_append_worklist_page().
Destroy widget -callback
Definition at line 2528 of file citydlg.c.
Referenced by present_unit_callback(), and supported_unit_callback().
|
static |
Set map canvas to be drawn
Definition at line 3162 of file citydlg.c.
Referenced by city_dialog_update_map().
|
static |
Return city dialog of the given city, or NULL is it doesn't already exist
Definition at line 387 of file citydlg.c.
Referenced by city_dialog_is_open(), gui_refresh_unit_city_dialogs(), middle_present_unit_release(), middle_supported_unit_release(), popdown_city_dialog(), present_unit_activate_close_callback(), present_unit_activate_close_callback(), present_unit_callback(), present_unit_callback(), present_unit_middle_callback(), real_city_dialog_popup(), real_city_dialog_refresh(), refresh_unit_city_dialogs(), supported_unit_activate_close_callback(), supported_unit_activate_close_callback(), supported_unit_callback(), supported_unit_callback(), supported_unit_middle_callback(), and switch_city_callback().
|
static |
This is here because it's closely related to the sell stuff
Definition at line 3310 of file citydlg.c.
Referenced by create_citydlg_improvement_list(), and create_citydlg_improvement_list().
Called to set the dimensions of the city dialog, both on startup and if the tileset is changed.
Definition at line 332 of file citydlg.c.
Referenced by initialize_city_dialogs(), and reset_city_dialogs().
Initialize stuff needed for city dialogs
Definition at line 341 of file citydlg.c.
Referenced by create_city_dialog(), and get_city_dialog().
|
static |
Keyboard handler for city dialog
Definition at line 624 of file citydlg.c.
Referenced by create_city_dialog().
Sets which page will be set on reopen of dialog
Definition at line 3383 of file citydlg.c.
Referenced by create_and_append_settings_page().
Popdown all dialogs
Definition at line 607 of file citydlg.c.
Referenced by handle_game_info(), popdown_all_game_dialogs(), reset_city_dialogs(), and set_client_state().
Popdown the dialog
Definition at line 595 of file citydlg.c.
Referenced by activate_and_exit_units_orders_city_dlg_callback(), client_remove_city(), exit_city_dlg_callback(), popdown_all_city_dialogs(), and units_orders_city_dlg_callback().
Open dialog for setting worker task
Definition at line 3046 of file citydlg.c.
Referenced by button_down_citymap(), and right_button_down_citymap().
User has requested some present unit to be activated and city dialog to be closed
Definition at line 2827 of file citydlg.c.
Referenced by create_unit_menu(), and present_unit_callback().
|
static |
Pop-up menu to change attributes of units, ex. change homecity.
Definition at line 2598 of file citydlg.c.
Referenced by city_dialog_update_present_units().
|
static |
If user middle-clicked on a unit, activate it and close dialog
Definition at line 2719 of file citydlg.c.
Referenced by city_dialog_update_present_units().
Popup the dialog 10% inside the main-window
Definition at line 566 of file citydlg.c.
Referenced by cities_update_callback().
Refresh city dialog of the given city
Definition at line 487 of file citydlg.c.
Referenced by cities_update_callback(), create_city_dialog(), and switch_city_callback().
Refresh city dialogs of unit's homecity and city where unit currently is.
Definition at line 546 of file citydlg.c.
Referenced by clear_unit_orders(), and handle_unit_packet_common().
Called when Rename button pressed
Definition at line 3349 of file citydlg.c.
Referenced by create_and_append_settings_page().
Called when user has finished with "Rename City" popup
Definition at line 3366 of file citydlg.c.
Referenced by rename_callback().
Called when the tileset changes.
Definition at line 365 of file citydlg.c.
Referenced by tileset_changed().
User has clicked sell-button
Definition at line 3256 of file citydlg.c.
Referenced by impr_callback(), and impr_callback().
User has responded to sell price dialog
Definition at line 3295 of file citydlg.c.
Referenced by sell_callback(), and sell_callback().
Set requested workertask
Definition at line 2983 of file citydlg.c.
Referenced by popup_workertask_dlg().
|
static |
Refresh the city options (auto_[land, air, sea, helicopter] and disband-is-size-1) in the misc page.
Definition at line 3425 of file citydlg.c.
Referenced by create_and_append_settings_page(), and switch_city_callback().
|
static |
Destroy info popup dialog when button released
Definition at line 648 of file citydlg.c.
Referenced by show_info_popup().
|
static |
Popup info dialog
Definition at line 661 of file citydlg.c.
Referenced by create_city_info_table(), and create_city_info_table().
User has clicked show units
Definition at line 2515 of file citydlg.c.
Referenced by citydlg_response_callback().
User has requested some supported unit to be activated and city dialog to be closed
Definition at line 2802 of file citydlg.c.
Referenced by create_unit_menu(), and supported_unit_callback().
|
static |
Pop-up menu to change attributes of supported units
Definition at line 2536 of file citydlg.c.
Referenced by city_dialog_update_supported_units().
|
static |
If user middle-clicked on a unit, activate it and close dialog
Definition at line 2747 of file citydlg.c.
Referenced by city_dialog_update_supported_units().
Callback for the prev/next buttons. Switches to the previous/next city.
Definition at line 3523 of file citydlg.c.
Referenced by create_city_dialog().
|
static |
Something dragged to worklist dialog.
Definition at line 1167 of file citydlg.c.
Referenced by create_production_header(), and create_production_header().
User has requested unit activation
Definition at line 2788 of file citydlg.c.
Referenced by create_unit_menu(), present_unit_callback(), and supported_unit_callback().
User has requested centering to unit
Definition at line 2775 of file citydlg.c.
Referenced by create_unit_menu(), and supported_unit_callback().
User has requested unit to be disbanded
Definition at line 2902 of file citydlg.c.
Referenced by create_unit_menu(), present_unit_callback(), and supported_unit_callback().
User has requested unit to be fortified
Definition at line 2889 of file citydlg.c.
Referenced by create_unit_menu(), and present_unit_callback().
User has requested unit to change homecity to city where it currently is
Definition at line 2922 of file citydlg.c.
Referenced by create_unit_menu(), and present_unit_callback().
User has requested unit to be loaded to transport
Definition at line 2850 of file citydlg.c.
Referenced by create_unit_menu(), and present_unit_callback().
User has requested unit to be sentried
Definition at line 2876 of file citydlg.c.
Referenced by create_unit_menu(), and present_unit_callback().
User has requested unit to be unloaded from transport
Definition at line 2863 of file citydlg.c.
Referenced by create_unit_menu(), and present_unit_callback().
User has requested unit to be upgraded
Definition at line 2935 of file citydlg.c.
Referenced by create_unit_menu(), and present_unit_callback().
Destroy workertask dlg
Definition at line 3038 of file citydlg.c.
Referenced by popup_workertask_dlg().
|
static |
Definition at line 218 of file citydlg.c.
Referenced by button_down_citymap(), create_city_dialog(), init_citydlg_dimensions(), left_button_down_citymap(), and right_button_down_citymap().
|
static |
Definition at line 218 of file citydlg.c.
Referenced by button_down_citymap(), create_city_dialog(), init_citydlg_dimensions(), left_button_down_citymap(), and right_button_down_citymap().
Definition at line 217 of file citydlg.c.
Referenced by create_city_dialog(), get_city_dialog(), initialize_city_dialogs(), popdown_all_city_dialogs(), reset_city_dialogs(), and switch_city_callback().
|
static |
Definition at line 216 of file citydlg.c.
Referenced by city_destroy_callback(), city_dialog_update_prev_next(), create_city_dialog(), get_city_dialog(), initialize_city_dialogs(), popdown_all_city_dialogs(), refresh_all_city_worklists(), and reset_city_dialogs().
Definition at line 222 of file citydlg.c.
Referenced by popup_workertask_dlg(), and workertask_dlg_destroy().
|
static |
Definition at line 220 of file citydlg.c.
Referenced by city_destroy_callback(), and create_and_append_settings_page().
Definition at line 227 of file citydlg.c.
Referenced by plocation_name(), usdata_destroy(), usdata_new(), usdlg_check_unit_location(), usdlg_cmd_center(), usdlg_cmd_cursor_changed(), usdlg_cmd_exec(), usdlg_cmd_focus(), usdlg_data_add_unit(), usdlg_refresh(), usdlg_tab_append_activity(), usdlg_tab_append_units(), usdlg_tab_append_utype(), usdlg_tab_select(), and usdlg_tab_update().
|
static |
Definition at line 230 of file citydlg.c.
Referenced by create_and_append_buildings_page(), create_and_append_cma_page(), create_and_append_happiness_page(), create_and_append_map_page(), create_and_append_overview_page(), create_and_append_worklist_page(), initialize_city_dialogs(), real_city_dialog_refresh(), and switch_city_callback().
|
static |
Definition at line 219 of file citydlg.c.
Referenced by create_and_append_settings_page(), and misc_whichtab_callback().
Definition at line 226 of file citydlg.c.
Referenced by adv_could_be_my_zoc(), adv_danger_at(), api_edit_unit_teleport(), autoworker_tile_behavior(), begin_phase(), build_landarea_map(), building_lost(), citizen_happiness_nationality(), create_city_dialog(), destroy_extra(), diplomat_bribe_stack(), do_nuke_tile(), do_paradrop(), do_wipe_units(), dsend_packet_edit_city_create(), dsend_packet_edit_unit_create(), dsend_packet_edit_unit_remove(), fill_sprite_array(), game_remove_unit(), get_potential_improvement_bonus(), get_unit_info_label_text2(), handle_edit_city_create(), handle_edit_unit_create(), handle_edit_unit_remove(), handle_unit_packet_common(), is_buildingflag_in_city(), is_friendly_city_near(), map_claim_border(), map_update_border(), maybe_cancel_goto_due_to_enemy(), overview_tile_color(), paste_tile(), pixel_border_hexa(), pixel_border_isohexa(), pixel_border_rect(), player_clear(), player_in_territory(), popup_find_dialog(), popup_info_text(), real_city_dialog_popup(), rebuild_imprm_list(), receive_packet_city_info_100(), receive_packet_city_short_info_100(), receive_packet_edit_city_100(), receive_packet_edit_city_create_100(), receive_packet_edit_unit_100(), receive_packet_edit_unit_create_100(), receive_packet_edit_unit_remove_100(), receive_packet_tile_info_100(), receive_packet_unit_info_100(), receive_packet_unit_short_info_100(), redraw_unit_info_label(), reestablish_city_trade_routes(), sdi_try_defend(), send_tile_info(), server_handle_packet(), sg_load_map_owner(), sg_load_map_owner(), show_delegations(), terrain_change_bounce_single_unit(), text_happiness_nationality(), tile_non_allied_unit(), unit_bribe_cost(), unit_description(), unit_do_disband_trad(), unpackage_short_unit(), hud_units::update_actions(), update_goto_dialog(), utype_build_shield_cost(), utype_buy_gold_cost(), vision_site_new(), and wonder_visible_to_player().
struct { ... } workertask_req |
Referenced by popup_workertask_dlg(), and set_city_workertask().