Freeciv-3.1
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "fcintl.h"
#include "log.h"
#include "shared.h"
#include "support.h"
#include "city.h"
#include "game.h"
#include "packets.h"
#include "unit.h"
#include "cma_fec.h"
#include "citydlg_common.h"
#include "cityrepdata.h"
#include "client_main.h"
#include "climisc.h"
#include "global_worklist.h"
#include "mapctrl_common.h"
#include "mapview_common.h"
#include "options.h"
#include "chatline.h"
#include "citydlg.h"
#include "gui_main.h"
#include "gui_stuff.h"
#include "mapview.h"
#include "optiondlg.h"
#include "repodlgs.h"
#include "cityrep.h"
Go to the source code of this file.
Data Structures | |
struct | sell_data |
Macros | |
#define | NEG_VAL(x) ((x)<0 ? (x) : (-x)) |
#define | CMA_NONE (10000) |
#define | CMA_CUSTOM (10001) |
#define | CRD_COL_CITY_ID (0 + NUM_CREPORT_COLS) |
Enumerations | |
enum | city_operation_type { CO_CHANGE , CO_LAST , CO_NEXT , CO_FIRST , CO_NEXT_TO_LAST , CO_SELL , CO_NONE } |
enum | { CITY_CENTER = 1 , CITY_POPUP , CITY_BUY } |
Functions | |
static void | create_city_report_dialog (bool make_modal) |
static void | city_activated_callback (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data) |
static void | city_command_callback (struct gui_dialog *dlg, int response, gpointer data) |
static void | city_selection_changed_callback (GtkTreeSelection *selection) |
static void | city_clear_worklist_callback (GSimpleAction *action, GVariant *parameter, gpointer data) |
static void | update_total_buy_cost (void) |
static GMenu * | create_production_menu (GActionGroup *group) |
static GMenu * | create_select_menu (GActionGroup *group) |
static GMenu * | create_change_menu (GActionGroup *group, const char *mname, const char *human_mname, enum city_operation_type oper) |
static void | recreate_production_menu (GActionGroup *group) |
static void | recreate_select_menu (GActionGroup *group) |
static void | recreate_sell_menu (GActionGroup *group) |
static void | get_city_table_header (char **text, int n) |
static GtkListStore * | city_report_dialog_store_new (void) |
static void | city_model_set (GtkListStore *store, GtkTreeIter *iter, struct city *pcity) |
static struct city * | city_model_get (GtkTreeModel *model, GtkTreeIter *iter) |
static gboolean | city_model_find (GtkTreeModel *model, GtkTreeIter *iter, const struct city *pcity) |
static void | city_model_fill (GtkListStore *store, GtkTreeSelection *selection, GHashTable *select) |
void | city_report_dialog_popup (bool raise) |
void | city_report_dialog_popdown (void) |
static void | append_impr_or_unit_to_menu (GMenu *menu, GActionGroup *act_group, const char *act_pfx, const char *act_pfx2, bool append_units, bool append_wonders, enum city_operation_type city_operation, TestCityFunc test_func, GCallback callback, int size) |
static void | impr_or_unit_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
static void | worklist_last_impr_or_unit_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
static void | worklist_first_impr_or_unit_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
static void | worklist_next_impr_or_unit_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
static void | worklist_next_to_last_impr_or_unit_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
static void | sell_impr_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
static void | select_impr_or_unit_callback (GSimpleAction *action, GVariant *parameter, gpointer data) |
static void | governors_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
static void | select_governor_callback (GSimpleAction *action, GVariant *parameter, gpointer data) |
static GMenu * | create_governor_menu (GActionGroup *group, bool change_governor) |
static void | update_governor_menu (void) |
static void | append_worklist_foreach (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
static void | append_worklist_callback (GSimpleAction *action, GVariant *parameter, gpointer data) |
static void | set_worklist_foreach (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
static void | set_worklist_callback (GSimpleAction *action, GVariant *parameter, gpointer data) |
static GMenu * | create_wl_menu (GActionGroup *group, const char *act_pfx, GCallback cb) |
static void | city_report_update_views (void) |
static GMenuItem * | create_display_menu_item (int pos) |
static void | toggle_view (GSimpleAction *act, GVariant *value, gpointer data) |
static GMenu * | create_display_menu (GActionGroup *group) |
static GtkWidget * | create_city_report_menu (void) |
static gint | cityrep_sort_func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer data) |
static void | city_select_all_callback (GSimpleAction *action, GVariant *parameter, gpointer data) |
static void | city_unselect_all_callback (GSimpleAction *action, GVariant *parameter, gpointer data) |
static void | city_invert_selection_callback (GSimpleAction *action, GVariant *parameter, gpointer data) |
static void | city_select_coastal_callback (GSimpleAction *action, GVariant *parameter, gpointer data) |
static void | same_island_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
static void | city_select_island_callback (GSimpleAction *action, GVariant *parameter, gpointer data) |
static void | city_select_building_callback (GSimpleAction *action, GVariant *parameter, gpointer data) |
static void | buy_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
static void | center_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
static void | popup_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
void | real_city_report_dialog_update (void *unused) |
void | real_city_report_update_city (struct city *pcity) |
static bool | city_building_impr_or_unit (const struct city *pcity, const struct universal *target) |
static void | clear_worklist_foreach_func (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
void | hilite_cities_from_canvas (void) |
void | toggle_city_hilite (struct city *pcity, bool on_off) |
Variables | |
static struct gui_dialog * | city_dialog_shell = NULL |
static GtkWidget * | city_view |
static GtkTreeSelection * | city_selection |
static GtkListStore * | city_model |
static GtkWidget * | city_center_command |
static GtkWidget * | city_popup_command |
static GtkWidget * | city_buy_command |
static GtkWidget * | city_total_buy_cost_label |
static GMenu * | prod_menu = NULL |
static GMenu * | change_menu |
static GMenu * | add_first_menu |
static GMenu * | add_last_menu |
static GMenu * | add_next_menu |
static GMenu * | add_2ndlast_menu |
static GMenu * | wl_set_menu |
static GMenu * | wl_append_menu |
static GMenu * | select_menu |
static GMenu * | unit_b_select_menu = NULL |
static GMenu * | impr_b_select_menu |
static GMenu * | wndr_b_select_menu |
static GMenu * | unit_s_select_menu |
static GMenu * | unit_p_select_menu |
static GMenu * | impr_p_select_menu |
static GMenu * | wndr_p_select_menu |
static GMenu * | unit_a_select_menu |
static GMenu * | impr_a_select_menu |
static GMenu * | wndr_a_select_menu |
static GMenu * | governor_select_menu |
static int | city_dialog_shell_is_modal |
static GMenu * | cityrep_menu |
static GActionGroup * | cityrep_group |
static GMenu * | display_menu |
#define CRD_COL_CITY_ID (0 + NUM_CREPORT_COLS) |
enum city_operation_type |
|
static |
Make submenu listing possible build targets
Definition at line 307 of file cityrep.c.
Referenced by create_change_menu(), create_select_menu(), and recreate_sell_menu().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
gui_dialog response callback.
|
static |
|
static |
|
static |
|
static |
|
static |
void city_report_dialog_popdown | ( | void | ) |
void city_report_dialog_popup | ( | bool | raise | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
User has chosen to select all cities on same island
Definition at line 1362 of file cityrep.c.
Referenced by create_select_menu().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Create menu for city report
Definition at line 1112 of file cityrep.c.
Referenced by create_city_report_dialog().
|
static |
Create columns selection menu for the city report.
Definition at line 1084 of file cityrep.c.
Referenced by create_city_report_menu().
|
static |
Create up-to-date menu item for the display menu. Caller need to g_object_unref() returned item.
Definition at line 1052 of file cityrep.c.
Referenced by create_display_menu(), and toggle_view().
|
static |
Create the governor entries in the change menu and the select menu. The indices CMA_NONE and CMA_CUSTOM are special. CMA_NONE signifies a preset of "none" and CMA_CUSTOM a "custom" preset.
Definition at line 759 of file cityrep.c.
Referenced by create_city_report_menu(), create_select_menu(), and update_governor_menu().
|
static |
Creates production menu
Definition at line 1618 of file cityrep.c.
Referenced by recreate_production_menu().
|
static |
|
static |
Create submenu based on global worklist.
Definition at line 985 of file cityrep.c.
Referenced by create_production_menu().
|
static |
|
static |
Governors iterating callback.
Definition at line 680 of file cityrep.c.
Referenced by select_governor_callback().
void hilite_cities_from_canvas | ( | void | ) |
|
static |
|
static |
void real_city_report_dialog_update | ( | void * | unused | ) |
void real_city_report_update_city | ( | struct city * | pcity | ) |
|
static |
Recreates production menu
Definition at line 1682 of file cityrep.c.
Referenced by city_selection_changed_callback(), and create_city_report_dialog().
|
static |
Recreates production menu
Definition at line 1869 of file cityrep.c.
Referenced by city_selection_changed_callback(), and create_city_report_dialog().
|
static |
|
static |
|
static |
Called when one clicks on an governor item to make a selection or to change a selection's preset.
Definition at line 700 of file cityrep.c.
Referenced by create_governor_menu().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Recreate governor menu
Definition at line 891 of file cityrep.c.
Referenced by city_selection_changed_callback(), and real_city_report_dialog_update().
|
static |
|
static |
Called by select_impr_or_unit_callback() for each city that is selected in the city list dialog to have a object inserted first to the worklist. Sends a packet adding the current production to the first place after the current production of the worklist. Then changes the production to the requested item.
|
static |
Called by select_impr_or_unit_callback() for each city that is selected in the city list dialog to have a object appended to the worklist. Sends a packet adding the item to the end of the worklist.
|
static |
Called by select_impr_or_unit_callback() for each city that is selected in the city list dialog to have a object added next to the worklist. Sends a packet adding the item to the first place after the current production of the worklist.
|
static |
Called by select_impr_or_unit_callback() for each city that is selected in the city list dialog to have an object added before the last position in the worklist.
|
static |
Definition at line 130 of file cityrep.c.
Referenced by create_production_menu(), and recreate_production_menu().
|
static |
Definition at line 127 of file cityrep.c.
Referenced by create_production_menu(), and recreate_production_menu().
|
static |
Definition at line 128 of file cityrep.c.
Referenced by create_production_menu(), and recreate_production_menu().
|
static |
Definition at line 129 of file cityrep.c.
Referenced by create_production_menu(), and recreate_production_menu().
|
static |
Definition at line 126 of file cityrep.c.
Referenced by create_production_menu(), city_dialog::display_worklist_menu(), and recreate_production_menu().
|
static |
|
static |
|
static |
Definition at line 150 of file cityrep.c.
Referenced by city_selection_changed_callback(), create_city_report_dialog(), create_city_report_menu(), create_select_menu(), and update_governor_menu().
|
static |
Definition at line 149 of file cityrep.c.
Referenced by create_city_report_menu(), recreate_production_menu(), recreate_select_menu(), recreate_sell_menu(), and update_governor_menu().
|
static |
Definition at line 151 of file cityrep.c.
Referenced by create_display_menu(), and toggle_view().
|
static |
Definition at line 145 of file cityrep.c.
Referenced by create_select_menu(), and recreate_select_menu().
|
static |
Definition at line 143 of file cityrep.c.
Referenced by create_select_menu(), and recreate_select_menu().
|
static |
Definition at line 136 of file cityrep.c.
Referenced by create_select_menu(), and recreate_select_menu().
|
static |
Definition at line 140 of file cityrep.c.
Referenced by create_select_menu(), and recreate_select_menu().
|
static |
Definition at line 125 of file cityrep.c.
Referenced by create_production_menu(), and recreate_production_menu().
|
static |
Definition at line 134 of file cityrep.c.
Referenced by create_select_menu(), and recreate_select_menu().
|
static |
Definition at line 142 of file cityrep.c.
Referenced by create_select_menu(), and recreate_select_menu().
|
static |
Definition at line 135 of file cityrep.c.
Referenced by create_select_menu(), and recreate_select_menu().
|
static |
Definition at line 139 of file cityrep.c.
Referenced by create_select_menu(), and recreate_select_menu().
|
static |
Definition at line 138 of file cityrep.c.
Referenced by create_select_menu(), and recreate_select_menu().
|
static |
Definition at line 132 of file cityrep.c.
Referenced by create_production_menu(), and recreate_production_menu().
|
static |
Definition at line 131 of file cityrep.c.
Referenced by create_production_menu(), and recreate_production_menu().
|
static |
Definition at line 144 of file cityrep.c.
Referenced by create_select_menu(), and recreate_select_menu().
|
static |
Definition at line 137 of file cityrep.c.
Referenced by create_select_menu(), and recreate_select_menu().
|
static |
Definition at line 141 of file cityrep.c.
Referenced by create_select_menu(), and recreate_select_menu().