Freeciv-3.3
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions | Variables
citydlg.c File Reference
#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
 
struct  _FcImprRow
 
struct  _FcImprClass
 
struct  _FcProdRow
 
struct  _FcProdClass
 

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
 
#define FC_TYPE_IMPR_ROW   (fc_impr_row_get_type())
 
#define IMPR_ROW_PIXBUF   0
 
#define IMPR_ROW_DESC   1
 
#define IMPR_ROW_UPKEEP   2
 
#define FC_TYPE_PROD_ROW   (fc_prod_row_get_type())
 
#define PROD_ROW_PIXBUF   0
 
#define PROD_ROW_NAME   1
 

Enumerations

enum  citydlg_response { CDLGR_UNITS , CDLGR_PREV , CDLGR_NEXT }
 
enum  {
  OVERVIEW_PAGE , WORKLIST_PAGE , HAPPINESS_PAGE , COUNTERS_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_dialogget_city_dialog (struct city *pcity)
 
static gboolean citydlg_keyboard_handler (GtkEventControllerKey *controller, guint keyval, guint keycode, GdkModifierType state, gpointer data)
 
static GtkWidgetcreate_city_info_table (struct city_dialog *pdialog, 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_dialogcreate_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_counters (struct city_dialog *pdialog)
 
static void city_dialog_update_information (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 (GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
 
static gboolean present_unit_callback (GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
 
static gboolean middle_supported_unit_release (GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
 
static gboolean middle_present_unit_release (GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
 
static gboolean right_unit_release (GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
 
static void close_citydlg_unit_popover (struct city_dialog *pdialog)
 
static void unit_center_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void unit_activate_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void supported_unit_activate_close_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void present_unit_activate_close_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void unit_load_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void unit_unload_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void unit_sentry_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void unit_fortify_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void unit_disband_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void unit_homecity_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void unit_upgrade_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static gboolean citizens_callback (GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
 
static gboolean left_button_down_citymap (GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
 
static gboolean right_button_down_citymap (GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
 
static void draw_map_canvas (struct city_dialog *pdialog)
 
static void buy_callback (GtkWidget *w, gpointer data)
 
static void change_production_callback (GtkSelectionModel *self, guint position, guint n_items, gpointer data)
 
static void sell_callback (const struct impr_type *pimprove, gpointer data)
 
static void sell_callback_response (GtkWidget *w, gint response, gpointer data)
 
static void impr_callback (GtkColumnView *self, guint position, 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 fc_impr_row_finalize (GObject *gobject)
 
static void fc_impr_row_class_init (FcImprRowClass *klass)
 
static void fc_impr_row_init (FcImprRow *self)
 
static FcImprRowfc_impr_row_new (void)
 
static void fc_prod_row_finalize (GObject *gobject)
 
static void fc_prod_row_class_init (FcProdRowClass *klass)
 
static void fc_prod_row_init (FcProdRow *self)
 
static FcProdRowfc_prod_row_new (void)
 
static void init_citydlg_dimensions (void)
 
void reset_city_dialogs (void)
 
static void canvas_draw_cb (GtkDrawingArea *w, cairo_t *cr, int width, int height, 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_popup (GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
 
static void create_citydlg_main_map (struct city_dialog *pdialog, GtkWidget *grid, int col, int row)
 
static void impr_factory_bind (GtkSignalListItemFactory *self, GtkListItem *list_item, gpointer user_data)
 
static void impr_factory_setup (GtkSignalListItemFactory *self, GtkListItem *list_item, gpointer user_data)
 
static gboolean query_impr_tooltip (GtkWidget *widget, gint x, gint y, gboolean keyboard_tip, GtkTooltip *tooltip, gpointer data)
 
static GtkWidgetcreate_citydlg_improvement_list (struct city_dialog *pdialog)
 
static void prod_factory_bind (GtkSignalListItemFactory *self, GtkListItem *list_item, gpointer user_data)
 
static void prod_factory_setup (GtkSignalListItemFactory *self, GtkListItem *list_item, gpointer user_data)
 
static gboolean target_drag_data_received (GtkDropTarget *target, const GValue *value, double x, double y, gpointer data)
 
static int create_production_header (struct city_dialog *pdialog, GtkWidget *grid, int row)
 
static void create_and_append_counters_page (struct city_dialog *pdialog)
 
static bool create_unit_menu (struct city_dialog *pdialog, struct unit *punit, GtkWidget *wdg, bool supported)
 
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 (GObject *dialog, GAsyncResult *result, gpointer data)
 
void refresh_all_city_worklists (void)
 

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
 

Macro Definition Documentation

◆ CITY_MAP_MIN_SIZE_X

#define CITY_MAP_MIN_SIZE_X   200

Definition at line 131 of file citydlg.c.

◆ CITY_MAP_MIN_SIZE_Y

#define CITY_MAP_MIN_SIZE_Y   150

Definition at line 132 of file citydlg.c.

◆ CITYMAP_HEIGHT

#define CITYMAP_HEIGHT   (CITYMAP_WIDTH * canvas_height / canvas_width)

Definition at line 75 of file citydlg.c.

◆ CITYMAP_SCALE

#define CITYMAP_SCALE   ((double)CITYMAP_WIDTH / (double)canvas_width)

Definition at line 76 of file citydlg.c.

◆ CITYMAP_WIDTH

#define CITYMAP_WIDTH   MIN(512, canvas_width)

Definition at line 74 of file citydlg.c.

◆ dialog_list_iterate

#define dialog_list_iterate (   dialoglist,
  pdialog 
)     TYPED_LIST_ITERATE(struct city_dialog, dialoglist, pdialog)

Definition at line 91 of file citydlg.c.

◆ dialog_list_iterate_end

#define dialog_list_iterate_end   LIST_ITERATE_END

Definition at line 93 of file citydlg.c.

◆ FC_TYPE_IMPR_ROW

#define FC_TYPE_IMPR_ROW   (fc_impr_row_get_type())

Definition at line 345 of file citydlg.c.

◆ FC_TYPE_PROD_ROW

#define FC_TYPE_PROD_ROW   (fc_prod_row_get_type())

Definition at line 372 of file citydlg.c.

◆ IMPR_ROW_DESC

#define IMPR_ROW_DESC   1

Definition at line 369 of file citydlg.c.

◆ IMPR_ROW_PIXBUF

#define IMPR_ROW_PIXBUF   0

Definition at line 368 of file citydlg.c.

◆ IMPR_ROW_UPKEEP

#define IMPR_ROW_UPKEEP   2

Definition at line 370 of file citydlg.c.

◆ NUM_CITIZENS_SHOWN

#define NUM_CITIZENS_SHOWN   30

Definition at line 113 of file citydlg.c.

◆ PROD_ROW_NAME

#define PROD_ROW_NAME   1

Definition at line 394 of file citydlg.c.

◆ PROD_ROW_PIXBUF

#define PROD_ROW_PIXBUF   0

Definition at line 393 of file citydlg.c.

◆ SPECLIST_TAG

#define SPECLIST_TAG   dialog

Definition at line 87 of file citydlg.c.

◆ SPECLIST_TYPE

#define SPECLIST_TYPE   struct city_dialog

Definition at line 88 of file citydlg.c.

◆ SPECVEC_TAG

#define SPECVEC_TAG   unit_node

Definition at line 105 of file citydlg.c.

◆ SPECVEC_TYPE

#define SPECVEC_TYPE   struct unit_node

Definition at line 106 of file citydlg.c.

◆ TINYSCREEN_MAX_HEIGHT

#define TINYSCREEN_MAX_HEIGHT   (500 - 1)

Definition at line 78 of file citydlg.c.

◆ unit_node_vector_iterate

#define unit_node_vector_iterate (   list,
  elt 
)     TYPED_VECTOR_ITERATE(struct unit_node, list, elt)

Definition at line 109 of file citydlg.c.

◆ unit_node_vector_iterate_end

#define unit_node_vector_iterate_end   VECTOR_ITERATE_END

Definition at line 111 of file citydlg.c.

Enumeration Type Documentation

◆ anonymous enum

Enumerator
OVERVIEW_PAGE 
WORKLIST_PAGE 
HAPPINESS_PAGE 
COUNTERS_PAGE 
CMA_PAGE 
SETTINGS_PAGE 
STICKY_PAGE 
NUM_PAGES 

Definition at line 115 of file citydlg.c.

◆ anonymous enum

Enumerator
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 

Definition at line 121 of file citydlg.c.

◆ citydlg_response

Enumerator
CDLGR_UNITS 
CDLGR_PREV 
CDLGR_NEXT 

Definition at line 82 of file citydlg.c.

Function Documentation

◆ buy_callback()

static void buy_callback ( GtkWidget w,
gpointer  data 
)
static

User has clicked buy-button

Definition at line 3593 of file citydlg.c.

◆ buy_callback_response()

static void buy_callback_response ( GObject dialog,
GAsyncResult result,
gpointer  data 
)
static

User has answered buy cost dialog

Definition at line 3577 of file citydlg.c.

◆ canvas_draw_cb()

static void canvas_draw_cb ( GtkDrawingArea w,
cairo_t cr,
int  width,
int  height,
gpointer  data 
)
static

Redraw map canvas.

Definition at line 567 of file citydlg.c.

◆ change_production_callback()

static void change_production_callback ( GtkSelectionModel self,
guint  position,
guint  n_items,
gpointer  data 
)
static

Callback for the production list.

Definition at line 3642 of file citydlg.c.

◆ citizens_callback()

static gboolean citizens_callback ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y,
gpointer  data 
)
static

User clicked the list of citizens. If they clicked a specialist then change its type, else do nothing.

Definition at line 3336 of file citydlg.c.

◆ city_destroy_callback()

static void city_destroy_callback ( GtkWidget w,
gpointer  data 
)
static

User has closed rename city dialog

Definition at line 3852 of file citydlg.c.

◆ city_dialog_is_open()

bool city_dialog_is_open ( struct city pcity)

Return whether city dialog for given city is open

Definition at line 748 of file citydlg.c.

◆ city_dialog_map_create()

static void city_dialog_map_create ( struct city_dialog pdialog,
struct city_map_canvas cmap_canvas 
)
static

Create a city map widget; used in the overview and in the happiness page.

Definition at line 584 of file citydlg.c.

◆ city_dialog_map_recenter()

static void city_dialog_map_recenter ( GtkWidget map_canvas_sw)
static

Center city dialog map.

Definition at line 625 of file citydlg.c.

◆ city_dialog_update_building()

static void city_dialog_update_building ( struct city_dialog pdialog)
static

Update what city is building and buy cost in city dialog

Definition at line 2345 of file citydlg.c.

◆ city_dialog_update_citizens()

static void city_dialog_update_citizens ( struct city_dialog pdialog)
static

Update citizens in city dialog

Definition at line 2074 of file citydlg.c.

◆ city_dialog_update_counters()

static void city_dialog_update_counters ( struct city_dialog pdialog)
static

Update counters tab in city dialog

Definition at line 2141 of file citydlg.c.

◆ city_dialog_update_improvement_list()

static void city_dialog_update_improvement_list ( struct city_dialog pdialog)
static

Update list of improvements in city dialog

Definition at line 2475 of file citydlg.c.

◆ city_dialog_update_information()

static void city_dialog_update_information ( GtkWidget **  info_label,
struct city_dialog pdialog 
)
static

Update textual info fields in city dialog

Definition at line 2209 of file citydlg.c.

◆ city_dialog_update_map()

static void city_dialog_update_map ( struct city_dialog pdialog)
static

Update map display of city dialog

Definition at line 2323 of file citydlg.c.

◆ city_dialog_update_present_units()

static void city_dialog_update_present_units ( struct city_dialog pdialog)
static

Update list of present units in city dialog

Definition at line 2650 of file citydlg.c.

◆ city_dialog_update_prev_next()

static void city_dialog_update_prev_next ( void  )
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.

Definition at line 2776 of file citydlg.c.

◆ city_dialog_update_supported_units()

static void city_dialog_update_supported_units ( struct city_dialog pdialog)
static

Update list of supported units in city dialog

Definition at line 2524 of file citydlg.c.

◆ city_dialog_update_title()

static void city_dialog_update_title ( struct city_dialog pdialog)
static

Update title of city dialog.

Definition at line 2035 of file citydlg.c.

◆ citydlg_keyboard_handler()

static gboolean citydlg_keyboard_handler ( GtkEventControllerKey controller,
guint  keyval,
guint  keycode,
GdkModifierType  state,
gpointer  data 
)
static

Keyboard handler for city dialog

Definition at line 785 of file citydlg.c.

◆ citydlg_response_callback()

static void citydlg_response_callback ( GtkDialog dlg,
gint  response,
void data 
)
static

User clicked button from action area.

Definition at line 2812 of file citydlg.c.

◆ cityopt_callback()

static void cityopt_callback ( GtkWidget w,
gpointer  data 
)
static

City options callbacks

Definition at line 3783 of file citydlg.c.

◆ close_callback()

static void close_callback ( GtkWidget w,
gpointer  data 
)
static

User has clicked rename city-button

Definition at line 3844 of file citydlg.c.

◆ close_city_dialog()

static void close_city_dialog ( struct city_dialog pdialog)
static

Close city dialog

Definition at line 3904 of file citydlg.c.

◆ close_citydlg_unit_popover()

static void close_citydlg_unit_popover ( struct city_dialog pdialog)
static

Close unit menu

Parameters
pdialogDialog where the menu should be closed from

Definition at line 3109 of file citydlg.c.

◆ create_and_append_buildings_page()

static void create_and_append_buildings_page ( struct city_dialog pdialog)
static

Create buildings list page for small screens

Definition at line 1490 of file citydlg.c.

◆ create_and_append_cma_page()

static void create_and_append_cma_page ( struct city_dialog pdialog)
static

Citizen Management Agent (CMA) Page ****

Definition at line 1673 of file citydlg.c.

◆ create_and_append_counters_page()

static void create_and_append_counters_page ( struct city_dialog pdialog)
static

Counters Page **** Creates counters page

Definition at line 1653 of file citydlg.c.

◆ create_and_append_happiness_page()

static void create_and_append_happiness_page ( struct city_dialog pdialog)
static
                     Happiness Page ****

+- GtkWidget *page -------—+----------------------------------------—+ | +- GtkWidget *left ---—+ | +- GtkWidget *right -----------------—+ | | | Info | | | City map | | | +- GtkWidget *citizens –+ | +- GtkWidget pdialog->happiness.widget -+ | | | Citizens data | | | Happiness | | | +---------------------—+ | +------------------------------------—+ | +-------------------------—+----------------------------------------—+

Definition at line 1577 of file citydlg.c.

◆ create_and_append_map_page()

static void create_and_append_map_page ( struct city_dialog pdialog)
static

Create map page for small screens

Definition at line 1400 of file citydlg.c.

◆ create_and_append_overview_page()

static void create_and_append_overview_page ( struct city_dialog pdialog)
static
                  Overview page ****

+- GtkWidget *page ---------------------------------------—+ | +- GtkWidget *middle --------—+---------------------—+ | | | City map | Production | | | +----------------------------—+---------------------—+ | +---------------------------------------------------------—+ | +- GtkWidget *bottom ----—+-------------------------—+ | | | Info | +- GtkWidget *right --—+ | | | | | | supported units | | | | | | +---------------------—+ | | | | | | present units | | | | | | +---------------------—+ | | | +------------------------—+-------------------------—+ | +---------------------------------------------------------—+

Definition at line 1232 of file citydlg.c.

◆ create_and_append_settings_page()

static void create_and_append_settings_page ( struct city_dialog pdialog)
static

Misc. Settings Page ****

Definition at line 1693 of file citydlg.c.

◆ create_and_append_worklist_page()

static void create_and_append_worklist_page ( struct city_dialog pdialog)
static

Production Page ****

Definition at line 1526 of file citydlg.c.

◆ create_city_dialog()

static struct city_dialog * create_city_dialog ( struct city pcity)
static
                     Main City Dialog ****

+-------------------------—+----------------------------—+ | GtkWidget *top: Citizens | city name | +-------------------------—+----------------------------—+ | [notebook tab] | +---------------------------------------------------------—+

Definition at line 1846 of file citydlg.c.

◆ create_city_info_table()

static GtkWidget * create_city_info_table ( struct city_dialog pdialog,
GtkWidget **  info_label 
)
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 886 of file citydlg.c.

◆ create_citydlg_improvement_list()

static GtkWidget * create_citydlg_improvement_list ( struct city_dialog pdialog)
static

Create improvements list

Definition at line 1114 of file citydlg.c.

◆ create_citydlg_main_map()

static void create_citydlg_main_map ( struct city_dialog pdialog,
GtkWidget grid,
int  col,
int  row 
)
static

Create main citydlg map

Map frame will be placed to top left (col, row) position of the grid.

Definition at line 1013 of file citydlg.c.

◆ create_production_header()

static int create_production_header ( struct city_dialog pdialog,
GtkWidget grid,
int  row 
)
static

Create production page header - what tab this actually is, depends on screen size and layout.

Definition at line 1452 of file citydlg.c.

◆ create_unit_menu()

static bool create_unit_menu ( struct city_dialog pdialog,
struct unit punit,
GtkWidget wdg,
bool  supported 
)
static

Create menu for the unit in citydlg

Parameters
pdialogDialog to create menu to
punitUnit to create menu for
wdgWidget to attach menu to
supportedIs this supported units menu (not present units)
Returns
whether menu was really created

Definition at line 2845 of file citydlg.c.

◆ draw_map_canvas()

static void draw_map_canvas ( struct city_dialog pdialog)
static

Set map canvas to be drawn

Definition at line 3564 of file citydlg.c.

◆ fc_impr_row_class_init()

static void fc_impr_row_class_init ( FcImprRowClass klass)
static

Initialization method for FcImprRow class

Definition at line 415 of file citydlg.c.

◆ fc_impr_row_finalize()

static void fc_impr_row_finalize ( GObject gobject)
static

Finalizing method for FcImprRow class

Definition at line 399 of file citydlg.c.

Referenced by fc_impr_row_class_init().

◆ fc_impr_row_init()

static void fc_impr_row_init ( FcImprRow self)
static

Initialization method for FcImprRow

Definition at line 426 of file citydlg.c.

◆ fc_impr_row_new()

static FcImprRow * fc_impr_row_new ( void  )
static

FcImprRow creation method

Definition at line 434 of file citydlg.c.

Referenced by city_dialog_update_improvement_list().

◆ fc_prod_row_class_init()

static void fc_prod_row_class_init ( FcProdRowClass klass)
static

Initialization method for FcProdRow class

Definition at line 462 of file citydlg.c.

◆ fc_prod_row_finalize()

static void fc_prod_row_finalize ( GObject gobject)
static

Finalizing method for FcProdRow class

Definition at line 446 of file citydlg.c.

Referenced by fc_prod_row_class_init().

◆ fc_prod_row_init()

static void fc_prod_row_init ( FcProdRow self)
static

Initialization method for FcProdRow

Definition at line 473 of file citydlg.c.

◆ fc_prod_row_new()

static FcProdRow * fc_prod_row_new ( void  )
static

FcProdRow creation method

Definition at line 481 of file citydlg.c.

Referenced by city_dialog_update_building().

◆ get_city_dialog()

static struct city_dialog * get_city_dialog ( struct city pcity)
static

Return city dialog of the given city, or NULL is it doesn't already exist

Definition at line 549 of file citydlg.c.

◆ impr_callback()

static void impr_callback ( GtkColumnView self,
guint  position,
gpointer  data 
)
static

This is here because it's closely related to the sell stuff

Definition at line 3712 of file citydlg.c.

◆ impr_factory_bind()

static void impr_factory_bind ( GtkSignalListItemFactory self,
GtkListItem list_item,
gpointer  user_data 
)
static

Improvement table cell bind function

Definition at line 1030 of file citydlg.c.

Referenced by create_citydlg_improvement_list().

◆ impr_factory_setup()

static void impr_factory_setup ( GtkSignalListItemFactory self,
GtkListItem list_item,
gpointer  user_data 
)
static

Improvement table cell setup function

Definition at line 1073 of file citydlg.c.

Referenced by create_citydlg_improvement_list().

◆ init_citydlg_dimensions()

static void init_citydlg_dimensions ( void  )
static

Called to set the dimensions of the city dialog, both on startup and if the tileset is changed.

Definition at line 494 of file citydlg.c.

◆ initialize_city_dialogs()

static void initialize_city_dialogs ( void  )
static

Initialize stuff needed for city dialogs

Definition at line 503 of file citydlg.c.

◆ left_button_down_citymap()

static gboolean left_button_down_citymap ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y,
gpointer  data 
)
static

User has pressed left button on citymap

Definition at line 3505 of file citydlg.c.

◆ middle_present_unit_release()

static gboolean middle_present_unit_release ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y,
gpointer  data 
)
static

If user middle-clicked on a unit, activate it and close dialog. Dialog to close is that of city where unit currently is.

Definition at line 3044 of file citydlg.c.

◆ middle_supported_unit_release()

static gboolean middle_supported_unit_release ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y,
gpointer  data 
)
static

If user middle-clicked on a unit, activate it and close dialog. Dialog to close is that of unit's home city.

Definition at line 3068 of file citydlg.c.

◆ misc_whichtab_callback()

static void misc_whichtab_callback ( GtkWidget w,
gpointer  data 
)
static

Sets which page will be set on reopen of dialog

Definition at line 3775 of file citydlg.c.

◆ popdown_all_city_dialogs()

void popdown_all_city_dialogs ( void  )

Popdown all dialogs

Definition at line 768 of file citydlg.c.

◆ popdown_city_dialog()

void popdown_city_dialog ( struct city pcity)

Popdown the dialog

Definition at line 756 of file citydlg.c.

◆ popup_workertask_dlg()

static void popup_workertask_dlg ( struct city pcity,
struct tile ptile 
)
static

Open dialog for setting worker task

Definition at line 3427 of file citydlg.c.

◆ present_unit_activate_close_callback()

static void present_unit_activate_close_callback ( GSimpleAction action,
GVariant parameter,
gpointer  data 
)
static

User has requested some present unit to be activated and city dialog to be closed

Definition at line 3182 of file citydlg.c.

◆ present_unit_callback()

static gboolean present_unit_callback ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y,
gpointer  data 
)
static

Pop-up menu to change attributes of units, ex. change homecity.

Definition at line 3020 of file citydlg.c.

◆ prod_factory_bind()

static void prod_factory_bind ( GtkSignalListItemFactory self,
GtkListItem list_item,
gpointer  user_data 
)
static

Prod table cell bind function

Definition at line 1167 of file citydlg.c.

Referenced by create_and_append_overview_page().

◆ prod_factory_setup()

static void prod_factory_setup ( GtkSignalListItemFactory self,
GtkListItem list_item,
gpointer  user_data 
)
static

Prod table cell setup function

Definition at line 1202 of file citydlg.c.

Referenced by create_and_append_overview_page().

◆ query_impr_tooltip()

static gboolean query_impr_tooltip ( GtkWidget widget,
gint  x,
gint  y,
gboolean  keyboard_tip,
GtkTooltip tooltip,
gpointer  data 
)
static

Callback for getting main list row tooltip

Definition at line 1091 of file citydlg.c.

Referenced by create_citydlg_improvement_list().

◆ real_city_dialog_popup()

void real_city_dialog_popup ( struct city pcity)

Popup the dialog 10% inside the main-window

Definition at line 727 of file citydlg.c.

◆ real_city_dialog_refresh()

void real_city_dialog_refresh ( struct city pcity)

Refresh city dialog of the given city

Definition at line 650 of file citydlg.c.

◆ refresh_all_city_worklists()

void refresh_all_city_worklists ( void  )

Refresh worklist editor for all city dialogs.

Definition at line 4011 of file citydlg.c.

◆ refresh_unit_city_dialogs()

void refresh_unit_city_dialogs ( struct unit punit)

Refresh city dialogs of unit's homecity and city where unit currently is.

Definition at line 707 of file citydlg.c.

◆ rename_callback()

static void rename_callback ( GtkWidget w,
gpointer  data 
)
static

Called when Rename button pressed

Definition at line 3741 of file citydlg.c.

◆ rename_popup_callback()

static void rename_popup_callback ( gpointer  data,
gint  response,
const char input 
)
static

Called when user has finished with "Rename City" popup

Definition at line 3758 of file citydlg.c.

◆ reset_city_dialogs()

void reset_city_dialogs ( void  )

Called when the tileset changes.

Definition at line 527 of file citydlg.c.

◆ right_button_down_citymap()

static gboolean right_button_down_citymap ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y,
gpointer  data 
)
static

User has pressed right button on citymap

Definition at line 3534 of file citydlg.c.

◆ right_unit_release()

static gboolean right_unit_release ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y,
gpointer  data 
)
static

If user right-clicked on a unit, activate it

Definition at line 3090 of file citydlg.c.

◆ sell_callback()

static void sell_callback ( const struct impr_type pimprove,
gpointer  data 
)
static

User has clicked sell-button

Definition at line 3659 of file citydlg.c.

◆ sell_callback_response()

static void sell_callback_response ( GtkWidget w,
gint  response,
gpointer  data 
)
static

User has responded to sell price dialog

Definition at line 3697 of file citydlg.c.

◆ set_city_workertask()

static void set_city_workertask ( GtkWidget w,
gpointer  data 
)
static

Set requested workertask

Definition at line 3364 of file citydlg.c.

◆ set_cityopt_values()

static void set_cityopt_values ( struct city_dialog pdialog)
static

Refresh the city options (auto_[land, air, sea, helicopter] and disband-is-size-1) in the misc page.

Definition at line 3817 of file citydlg.c.

◆ show_info_popup()

static gboolean show_info_popup ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y,
gpointer  data 
)
static

Popup info dialog

Definition at line 814 of file citydlg.c.

◆ show_units_response()

static void show_units_response ( void data)
static

User has clicked show units

Definition at line 2825 of file citydlg.c.

◆ supported_unit_activate_close_callback()

static void supported_unit_activate_close_callback ( GSimpleAction action,
GVariant parameter,
gpointer  data 
)
static

User has requested some supported unit to be activated and city dialog to be closed

Definition at line 3154 of file citydlg.c.

◆ supported_unit_callback()

static gboolean supported_unit_callback ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y,
gpointer  data 
)
static

Pop-up menu to change attributes of supported units

Definition at line 2997 of file citydlg.c.

◆ switch_city_callback()

static void switch_city_callback ( GtkWidget w,
gpointer  data 
)
static

Callback for the prev/next buttons. Switches to the previous/next city.

Definition at line 3913 of file citydlg.c.

◆ target_drag_data_received()

static gboolean target_drag_data_received ( GtkDropTarget target,
const GValue value,
double  x,
double  y,
gpointer  data 
)
static

Something dragged to worklist dialog.

Definition at line 1427 of file citydlg.c.

◆ unit_activate_callback()

static void unit_activate_callback ( GSimpleAction action,
GVariant parameter,
gpointer  data 
)
static

User has requested unit activation

Definition at line 3137 of file citydlg.c.

◆ unit_center_callback()

static void unit_center_callback ( GSimpleAction action,
GVariant parameter,
gpointer  data 
)
static

User has requested centering to unit

Definition at line 3121 of file citydlg.c.

◆ unit_disband_callback()

static void unit_disband_callback ( GSimpleAction action,
GVariant parameter,
gpointer  data 
)
static

User has requested unit to be disbanded

Definition at line 3272 of file citydlg.c.

◆ unit_fortify_callback()

static void unit_fortify_callback ( GSimpleAction action,
GVariant parameter,
gpointer  data 
)
static

User has requested unit to be fortified

Definition at line 3256 of file citydlg.c.

◆ unit_homecity_callback()

static void unit_homecity_callback ( GSimpleAction action,
GVariant parameter,
gpointer  data 
)
static

User has requested unit to change homecity to city where it currently is

Definition at line 3295 of file citydlg.c.

◆ unit_load_callback()

static void unit_load_callback ( GSimpleAction action,
GVariant parameter,
gpointer  data 
)
static

User has requested unit to be loaded to transport

Definition at line 3208 of file citydlg.c.

◆ unit_sentry_callback()

static void unit_sentry_callback ( GSimpleAction action,
GVariant parameter,
gpointer  data 
)
static

User has requested unit to be sentried

Definition at line 3240 of file citydlg.c.

◆ unit_unload_callback()

static void unit_unload_callback ( GSimpleAction action,
GVariant parameter,
gpointer  data 
)
static

User has requested unit to be unloaded from transport

Definition at line 3224 of file citydlg.c.

◆ unit_upgrade_callback()

static void unit_upgrade_callback ( GSimpleAction action,
GVariant parameter,
gpointer  data 
)
static

User has requested unit to be upgraded

Definition at line 3311 of file citydlg.c.

◆ workertask_dlg_destroy()

static void workertask_dlg_destroy ( GtkWidget w,
gpointer  data 
)
static

Destroy workertask dlg

Definition at line 3419 of file citydlg.c.

Variable Documentation

◆ canvas_height

int canvas_height
static

Definition at line 218 of file citydlg.c.

◆ canvas_width

int canvas_width
static

Definition at line 218 of file citydlg.c.

◆ city_dialogs_have_been_initialised

bool city_dialogs_have_been_initialised = FALSE
static

Definition at line 217 of file citydlg.c.

◆ dialog_list

struct dialog_list* dialog_list
static

Definition at line 216 of file citydlg.c.

◆ is_showing_workertask_dialog

bool is_showing_workertask_dialog = FALSE
static

Definition at line 222 of file citydlg.c.

◆ last_page

int last_page = OVERVIEW_PAGE
static

Definition at line 220 of file citydlg.c.

◆ loc

struct tile* loc

Definition at line 227 of file citydlg.c.

◆ low_citydlg

bool low_citydlg
static

Definition at line 230 of file citydlg.c.

◆ new_dialog_def_page

int new_dialog_def_page = OVERVIEW_PAGE
static

Definition at line 219 of file citydlg.c.

◆ owner

struct city* owner

Definition at line 226 of file citydlg.c.

◆ [struct]

struct { ... } workertask_req