|
Freeciv-3.1
|
#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 "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 "repodlgs.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 |
Macros | |
| #define | CITYMAP_WIDTH MIN(512, canvas_width) |
| #define | CITYMAP_HEIGHT (CITYMAP_WIDTH * canvas_height / canvas_width) |
| #define | CITYMAP_SCALE ((double)CITYMAP_WIDTH / (double)canvas_width) |
| #define | TINYSCREEN_MAX_HEIGHT (500 - 1) |
| #define | SPECLIST_TAG dialog |
| #define | SPECLIST_TYPE struct city_dialog |
| #define | dialog_list_iterate(dialoglist, pdialog) TYPED_LIST_ITERATE(struct city_dialog, dialoglist, pdialog) |
| #define | dialog_list_iterate_end LIST_ITERATE_END |
| #define | SPECVEC_TAG unit_node |
| #define | SPECVEC_TYPE struct unit_node |
| #define | unit_node_vector_iterate(list, elt) TYPED_VECTOR_ITERATE(struct unit_node, list, elt) |
| #define | unit_node_vector_iterate_end VECTOR_ITERATE_END |
| #define | NUM_CITIZENS_SHOWN 30 |
| #define | CITY_MAP_MIN_SIZE_X 200 |
| #define | CITY_MAP_MIN_SIZE_Y 150 |
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 } |
Functions | |
| static void | initialize_city_dialogs (void) |
| static void | city_dialog_map_create (struct city_dialog *pdialog, struct city_map_canvas *cmap_canvas) |
| static void | city_dialog_map_recenter (GtkWidget *map_canvas_sw) |
| static struct city_dialog * | get_city_dialog (struct city *pcity) |
| static gboolean | keyboard_handler (GtkWidget *widget, GdkEventKey *event, struct city_dialog *pdialog) |
| static GtkWidget * | create_city_info_table (struct city_dialog *pdialog, GtkWidget **info_ebox, GtkWidget **info_label) |
| static void | create_and_append_overview_page (struct city_dialog *pdialog) |
| static void | create_and_append_map_page (struct city_dialog *pdialog) |
| static void | create_and_append_buildings_page (struct city_dialog *pdialog) |
| static void | create_and_append_worklist_page (struct city_dialog *pdialog) |
| static void | create_and_append_happiness_page (struct city_dialog *pdialog) |
| static void | create_and_append_cma_page (struct city_dialog *pdialog) |
| static void | create_and_append_settings_page (struct city_dialog *pdialog) |
| static struct city_dialog * | create_city_dialog (struct city *pcity) |
| static void | city_dialog_update_title (struct city_dialog *pdialog) |
| static void | city_dialog_update_citizens (struct city_dialog *pdialog) |
| static void | city_dialog_update_information (GtkWidget **info_ebox, GtkWidget **info_label, struct city_dialog *pdialog) |
| static void | city_dialog_update_map (struct city_dialog *pdialog) |
| static void | city_dialog_update_building (struct city_dialog *pdialog) |
| static void | city_dialog_update_improvement_list (struct city_dialog *pdialog) |
| static void | city_dialog_update_supported_units (struct city_dialog *pdialog) |
| static void | city_dialog_update_present_units (struct city_dialog *pdialog) |
| static void | city_dialog_update_prev_next (void) |
| static void | show_units_response (void *data) |
| static gboolean | supported_unit_callback (GtkWidget *w, GdkEventButton *ev, gpointer data) |
| static gboolean | present_unit_callback (GtkWidget *w, GdkEventButton *ev, gpointer data) |
| static gboolean | supported_unit_middle_callback (GtkWidget *w, GdkEventButton *ev, gpointer data) |
| static gboolean | present_unit_middle_callback (GtkWidget *w, GdkEventButton *ev, gpointer data) |
| static void | unit_center_callback (GtkWidget *w, gpointer data) |
| static void | unit_activate_callback (GtkWidget *w, gpointer data) |
| static void | supported_unit_activate_close_callback (GtkWidget *w, gpointer data) |
| static void | present_unit_activate_close_callback (GtkWidget *w, gpointer data) |
| static void | unit_load_callback (GtkWidget *w, gpointer data) |
| static void | unit_unload_callback (GtkWidget *w, gpointer data) |
| static void | unit_sentry_callback (GtkWidget *w, gpointer data) |
| static void | unit_fortify_callback (GtkWidget *w, gpointer data) |
| static void | unit_disband_callback (GtkWidget *w, gpointer data) |
| static void | unit_homecity_callback (GtkWidget *w, gpointer data) |
| static void | unit_upgrade_callback (GtkWidget *w, gpointer data) |
| static gboolean | citizens_callback (GtkWidget *w, GdkEventButton *ev, gpointer data) |
| static gboolean | button_down_citymap (GtkWidget *w, GdkEventButton *ev, gpointer data) |
| static void | draw_map_canvas (struct city_dialog *pdialog) |
| static void | buy_callback (GtkWidget *w, gpointer data) |
| static void | change_production_callback (GtkComboBox *combo, struct city_dialog *pdialog) |
| static void | sell_callback (struct impr_type *pimprove, gpointer data) |
| static void | sell_callback_response (GtkWidget *w, gint response, gpointer data) |
| static void | impr_callback (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data) |
| static void | rename_callback (GtkWidget *w, gpointer data) |
| static void | rename_popup_callback (gpointer data, gint response, const char *input) |
| static void | set_cityopt_values (struct city_dialog *pdialog) |
| static void | cityopt_callback (GtkWidget *w, gpointer data) |
| static void | misc_whichtab_callback (GtkWidget *w, gpointer data) |
| static void | city_destroy_callback (GtkWidget *w, gpointer data) |
| static void | close_city_dialog (struct city_dialog *pdialog) |
| static void | citydlg_response_callback (GtkDialog *dlg, gint response, void *data) |
| static void | close_callback (GtkWidget *w, gpointer data) |
| static void | switch_city_callback (GtkWidget *w, gpointer data) |
| static void | init_citydlg_dimensions (void) |
| void | reset_city_dialogs (void) |
| static gboolean | canvas_exposed_cb (GtkWidget *w, cairo_t *cr, gpointer data) |
| void | real_city_dialog_refresh (struct city *pcity) |
| void | refresh_unit_city_dialogs (struct unit *punit) |
| void | real_city_dialog_popup (struct city *pcity) |
| bool | city_dialog_is_open (struct city *pcity) |
| void | popdown_city_dialog (struct city *pcity) |
| void | popdown_all_city_dialogs (void) |
| static gboolean | show_info_button_release (GtkWidget *w, GdkEventButton *ev, gpointer data) |
| static gboolean | show_info_popup (GtkWidget *w, GdkEventButton *ev, gpointer data) |
| static void | create_citydlg_main_map (struct city_dialog *pdialog, GtkWidget *container) |
| static GtkWidget * | create_citydlg_improvement_list (struct city_dialog *pdialog, GtkWidget *vbox) |
| static void | target_drag_data_received (GtkWidget *w, GdkDragContext *context, gint x, gint y, GtkSelectionData *data, guint info, guint time, gpointer user_data) |
| static void | create_production_header (struct city_dialog *pdialog, GtkContainer *contain) |
| static void | destroy_func (GtkWidget *w, gpointer data) |
| static void | set_city_workertask (GtkWidget *w, gpointer data) |
| static void | workertask_dlg_destroy (GtkWidget *w, gpointer data) |
| static void | popup_workertask_dlg (struct city *pcity, struct tile *ptile) |
| static void | buy_callback_response (GtkWidget *w, gint response, gpointer data) |
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 | ( | list, | |
| elt | |||
| ) | TYPED_VECTOR_ITERATE(struct unit_node, list, elt) |
| #define unit_node_vector_iterate_end VECTOR_ITERATE_END |
| anonymous enum |
| anonymous enum |
| enum citydlg_response |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
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.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Happiness Page ****
+- GtkWidget *page -------—+----------------------------------------—+ | +- GtkWidget *left ---—+ | +- GtkWidget *right -----------------—+ | | | Info | | | City map | | | +- GtkWidget *citizens –+ | +- GtkWidget pdialog->happiness.widget -+ | | | Citizens data | | | Happiness | | | +---------------------—+ | +------------------------------------—+ | +-------------------------—+----------------------------------------—+
|
static |
|
static |
Overview page ****
+- GtkWidget *page ---------------------------------------—+ | +- GtkWidget *middle --------—+---------------------—+ | | | City map | Production | | | +----------------------------—+---------------------—+ | +---------------------------------------------------------—+ | +- GtkWidget *bottom ----—+-------------------------—+ | | | Info | +- GtkWidget *right --—+ | | | | | | supported units | | | | | | +---------------------—+ | | | | | | present units | | | | | | +---------------------—+ | | | +------------------------—+-------------------------—+ | +---------------------------------------------------------—+
|
static |
|
static |
|
static |
Main City Dialog ****
+-------------------------—+----------------------------—+ | GtkWidget *top: Citizens | city name | +-------------------------—+----------------------------—+ | [notebook tab] | +---------------------------------------------------------—+
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| void popdown_all_city_dialogs | ( | void | ) |
| void popdown_city_dialog | ( | struct city * | pcity | ) |
|
static |
|
static |
|
static |
| void real_city_dialog_popup | ( | struct city * | pcity | ) |
| void real_city_dialog_refresh | ( | struct city * | pcity | ) |
| void refresh_unit_city_dialogs | ( | struct unit * | punit | ) |
|
static |
|
static |
| void reset_city_dialogs | ( | void | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| struct { ... } workertask_req |