Freeciv-3.1
|
#include <gtk/gtk.h>
#include "fcintl.h"
#include "fc_types.h"
#include "game.h"
#include "player.h"
#include "unit.h"
#include "unitlist.h"
#include "unittype.h"
#include "client_main.h"
#include "control.h"
#include "goto.h"
#include "tilespec.h"
#include "unitselect_common.h"
#include "graphics.h"
#include "gui_stuff.h"
#include "gui_main.h"
#include "unitselect.h"
Go to the source code of this file.
Data Structures | |
struct | unit_select_dialog |
Macros | |
#define | USDLG_COLUMNS_DEFAULT 3 |
#define | USDLG_COL_UTID USDLG_COLUMNS_DEFAULT + 0 /* Unit type ID */ |
#define | USDLG_COL_UID USDLG_COLUMNS_DEFAULT + 1 /* Unit ID */ |
#define | USDLG_COL_LOCATION USDLG_COLUMNS_DEFAULT + 2 /* Unit location */ |
#define | USDLG_COL_ACTIVITY USDLG_COLUMNS_DEFAULT + 3 /* Unit activity */ |
#define | USDLG_COL_ROW_TYPE USDLG_COLUMNS_DEFAULT + 4 /* Row type */ |
#define | USDLG_COLUMNS_DEBUG USDLG_COLUMNS_DEFAULT + 5 |
#define | USDLG_COL_STYLE USDLG_COLUMNS_DEBUG + 0 |
#define | USDLG_COL_WEIGHT USDLG_COLUMNS_DEBUG + 1 |
#define | USDLG_COLUMNS_ALL USDLG_COLUMNS_DEBUG + 2 |
#define | USDLG_COLUMNS_SHOW USDLG_COLUMNS_DEFAULT |
Enumerations | |
enum | usdlg_column_types { COL_PIXBUF , COL_TEXT , COL_INT } |
enum | usdlg_row_types { ROW_UNITTYPE , ROW_ACTIVITY , ROW_UNIT , ROW_UNIT_TRANSPORTED } |
enum | usdlg_cmd { USDLG_CMD_SELECT , USDLG_CMD_DESELECT , USDLG_CMD_READY , USDLG_CMD_SENTRY , USDLG_CMD_CENTER , USDLG_CMD_FOCUS , USDLG_CMD_LAST } |
Functions | |
static struct unit_select_dialog * | usdlg_get (bool create) |
static struct unit_select_dialog * | usdlg_create (void) |
static void | usdlg_destroy (void) |
static void | usdlg_destroy_callback (GObject *object, gpointer data) |
static void | usdlg_tile (struct unit_select_dialog *pdialog, struct tile *ptile) |
static void | usdlg_refresh (struct unit_select_dialog *pdialog) |
static void | usdlg_tab_select (struct unit_select_dialog *pdialog, const char *title, enum unit_select_location_mode loc) |
static GtkTreeStore * | usdlg_tab_store_new (void) |
static bool | usdlg_tab_update (struct unit_select_dialog *pdialog, struct usdata_hash *ushash, enum unit_select_location_mode loc) |
static void | usdlg_tab_append_utype (GtkTreeStore *store, enum unit_select_location_mode loc, const struct unit_type *putype, GtkTreeIter *it) |
static void | usdlg_tab_append_activity (GtkTreeStore *store, enum unit_select_location_mode loc, const struct unit_type *putype, enum unit_activity act, int count, GtkTreeIter *it, GtkTreeIter *parent) |
static void | usdlg_tab_append_units (struct unit_select_dialog *pdialog, enum unit_select_location_mode loc, enum unit_activity act, const struct unit *punit, bool transported, GtkTreeIter *it, GtkTreeIter *parent) |
static void | usdlg_cmd_ready (GObject *object, gpointer data) |
static void | usdlg_cmd_sentry (GObject *object, gpointer data) |
static void | usdlg_cmd_select (GObject *object, gpointer data) |
static void | usdlg_cmd_deselect (GObject *object, gpointer data) |
static void | usdlg_cmd_exec (GObject *object, gpointer mode_data, enum usdlg_cmd cmd) |
static void | usdlg_cmd_exec_unit (struct unit *punit, enum usdlg_cmd cmd) |
static void | usdlg_cmd_center (GObject *object, gpointer data) |
static void | usdlg_cmd_focus (GObject *object, gpointer data) |
static void | usdlg_cmd_focus_real (GtkTreeView *view) |
static void | usdlg_cmd_row_activated (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data) |
static void | usdlg_cmd_cursor_changed (GtkTreeView *view, gpointer data) |
void | unit_select_dialog_popup_main (struct tile *ptile, bool create) |
void | unit_select_dialog_popdown (void) |
GdkPixbuf * | usdlg_get_unit_image (const struct unit *punit) |
const char * | usdlg_get_unit_descr (const struct unit *punit) |
Variables | |
enum usdlg_column_types | usdlg_col_types [USDLG_COLUMNS_ALL] |
static const char * | usdlg_col_titles [USDLG_COLUMNS_ALL] |
static struct unit_select_dialog * | unit_select_dlg = NULL |
#define USDLG_COL_ACTIVITY USDLG_COLUMNS_DEFAULT + 3 /* Unit activity */ |
Definition at line 67 of file unitselect.c.
#define USDLG_COL_LOCATION USDLG_COLUMNS_DEFAULT + 2 /* Unit location */ |
Definition at line 66 of file unitselect.c.
#define USDLG_COL_ROW_TYPE USDLG_COLUMNS_DEFAULT + 4 /* Row type */ |
Definition at line 68 of file unitselect.c.
#define USDLG_COL_STYLE USDLG_COLUMNS_DEBUG + 0 |
Definition at line 71 of file unitselect.c.
#define USDLG_COL_UID USDLG_COLUMNS_DEFAULT + 1 /* Unit ID */ |
Definition at line 65 of file unitselect.c.
#define USDLG_COL_UTID USDLG_COLUMNS_DEFAULT + 0 /* Unit type ID */ |
Definition at line 64 of file unitselect.c.
#define USDLG_COL_WEIGHT USDLG_COLUMNS_DEBUG + 1 |
Definition at line 72 of file unitselect.c.
#define USDLG_COLUMNS_ALL USDLG_COLUMNS_DEBUG + 2 |
Definition at line 73 of file unitselect.c.
#define USDLG_COLUMNS_DEBUG USDLG_COLUMNS_DEFAULT + 5 |
Definition at line 69 of file unitselect.c.
#define USDLG_COLUMNS_DEFAULT 3 |
Definition at line 62 of file unitselect.c.
#define USDLG_COLUMNS_SHOW USDLG_COLUMNS_DEFAULT |
Definition at line 78 of file unitselect.c.
enum usdlg_cmd |
Enumerator | |
---|---|
USDLG_CMD_SELECT | |
USDLG_CMD_DESELECT | |
USDLG_CMD_READY | |
USDLG_CMD_SENTRY | |
USDLG_CMD_CENTER | |
USDLG_CMD_FOCUS | |
USDLG_CMD_LAST |
Definition at line 107 of file unitselect.c.
enum usdlg_column_types |
Enumerator | |
---|---|
COL_PIXBUF | |
COL_TEXT | |
COL_INT |
Definition at line 48 of file unitselect.c.
enum usdlg_row_types |
Enumerator | |
---|---|
ROW_UNITTYPE | |
ROW_ACTIVITY | |
ROW_UNIT | |
ROW_UNIT_TRANSPORTED |
Definition at line 54 of file unitselect.c.
void unit_select_dialog_popdown | ( | void | ) |
Popdown the unit selection dialog.
Definition at line 214 of file unitselect.c.
Popup the unit selection dialog.
Definition at line 193 of file unitselect.c.
|
static |
Callback for the center button.
Definition at line 1093 of file unitselect.c.
|
static |
Callback if the row is changed.
Definition at line 1190 of file unitselect.c.
|
static |
Callback for the deselect button.
Definition at line 935 of file unitselect.c.
|
static |
Main function for the callbacks.
Definition at line 943 of file unitselect.c.
Update one unit (select/deselect/ready/sentry).
Definition at line 1054 of file unitselect.c.
|
static |
Callback for the focus button.
Definition at line 1132 of file unitselect.c.
|
static |
Focus to the currently selected unit.
Definition at line 1156 of file unitselect.c.
|
static |
Callback for the ready button.
Definition at line 911 of file unitselect.c.
|
static |
Callback if a row is activated.
Definition at line 1147 of file unitselect.c.
|
static |
Callback for the select button.
Definition at line 927 of file unitselect.c.
|
static |
Callback for the sentry button.
Definition at line 919 of file unitselect.c.
|
static |
Create a new unit selection dialog.
Definition at line 241 of file unitselect.c.
|
static |
Destroy a unit selection dialog.
Definition at line 292 of file unitselect.c.
|
static |
Callback for the destruction of the dialog.
Definition at line 304 of file unitselect.c.
|
static |
Get the current unit selection dialog. Create it if needed and 'create' is TRUE.
Definition at line 223 of file unitselect.c.
const char * usdlg_get_unit_descr | ( | const struct unit * | punit | ) |
Get an unit selection list item suitable description of the specified unit.
Definition at line 796 of file unitselect.c.
GdkPixbuf * usdlg_get_unit_image | ( | const struct unit * | punit | ) |
Get an unit selection list item suitable image of the specified unit.
Caller is responsible for getting rid of the returned image after use.
Definition at line 775 of file unitselect.c.
|
static |
Refresh the dialog.
Definition at line 337 of file unitselect.c.
|
static |
Append the unit activity.
Definition at line 737 of file unitselect.c.
|
static |
Append units (recursively).
Definition at line 838 of file unitselect.c.
|
static |
Append the data for one unit type.
Definition at line 688 of file unitselect.c.
|
static |
+-----------------------------—+ | +--------------—+-------—+ | | | (unit list) | select | |
deselect | |||
---|---|---|---|
center | |||
focus |
| +--------------—+-------—+ | | | tabs | ... | | | close | +-----------------------------—+
Definition at line 386 of file unitselect.c.
|
static |
Create a player dialog store.
Definition at line 550 of file unitselect.c.
|
static |
Update on tab of the dialog.
Definition at line 578 of file unitselect.c.
|
static |
Set the reference tile.
Definition at line 312 of file unitselect.c.
|
static |
Definition at line 141 of file unitselect.c.
|
static |
Definition at line 94 of file unitselect.c.
enum usdlg_column_types usdlg_col_types[USDLG_COLUMNS_ALL] |
Definition at line 81 of file unitselect.c.