Freeciv-3.3: /fast/freeciv/nightly/main/client/gui-gtk-5.0/editprop.c File Reference

Freeciv-3.3

Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions | Variables
editprop.c File Reference
`#include <limits.h>`
`#include <gtk/gtk.h>`
`#include <gdk/gdkkeysyms.h>`
`#include "bitvector.h"`
`#include "fc_cmdline.h"`
`#include "fcintl.h"`
`#include "log.h"`
`#include "mem.h"`
`#include "fc_interface.h"`
`#include "game.h"`
`#include "government.h"`
`#include "map.h"`
`#include "movement.h"`
`#include "nation.h"`
`#include "research.h"`
`#include "tile.h"`
`#include "client_main.h"`
`#include "climisc.h"`
`#include "editor.h"`
`#include "mapview_common.h"`
`#include "tilespec.h"`
`#include "canvas.h"`
`#include "gui_main.h"`
`#include "gui_stuff.h"`
`#include "plrdlg.h"`
`#include "sprite.h"`
`#include "editprop.h"`
`#include "spechash.h"`

Go to the source code of this file.

## Data Structures

union | packetdata
struct | tile_vision_data
struct | pf_pattern
struct | pf_conjunction
struct | property_filter
union | propval_data
struct | propval
struct | propstate
struct | objprop
struct | objbind
struct | extviewer
struct | property_page
struct | property_editor

## Macros

#define | SPECHASH_TAG stored_tag
#define | SPECHASH_INT_KEY_TYPE
#define | SPECHASH_INT_DATA_TYPE
#define | PF_MAX_CLAUSES 16
#define | PF_DISJUNCTION_SEPARATOR "|"
#define | PF_CONJUNCTION_SEPARATOR "&"
#define | SPECHASH_TAG propstate
#define | SPECHASH_INT_KEY_TYPE
#define | SPECHASH_IDATA_TYPE struct propstate *
#define | SPECHASH_IDATA_FREE propstate_destroy
#define | SPECHASH_TAG objprop
#define | SPECHASH_INT_KEY_TYPE
#define | SPECHASH_IDATA_TYPE struct objprop *
#define | SPECHASH_TAG objbind
#define | SPECHASH_INT_KEY_TYPE
#define | SPECHASH_IDATA_TYPE struct objbind *
#define | SPECHASH_IDATA_FREE objbind_destroy
#define | property_page_objprop_iterate(ARG_pp, NAME_op) TYPED_HASH_DATA_ITERATE(struct objprop *, (ARG_pp)->objprop_table, NAME_op)
#define | property_page_objprop_iterate_end HASH_DATA_ITERATE_END
#define | property_page_objbind_iterate(ARG_pp, NAME_ob) TYPED_HASH_DATA_ITERATE(struct objbind *, (ARG_pp)->objbind_table, NAME_ob)
#define | property_page_objbind_iterate_end HASH_DATA_ITERATE_END
#define | ADDPROP(ARG_id, ARG_name, ARG_tooltip, ARG_flags, ARG_valtype)

## Enumerations

enum

value_types {
VALTYPE_NONE = 0 , VALTYPE_INT , VALTYPE_BOOL , VALTYPE_STRING ,
VALTYPE_PIXBUF , VALTYPE_BUILT_ARRAY , VALTYPE_INVENTIONS_ARRAY , VALTYPE_BV_SPECIAL ,
VALTYPE_BV_ROADS , VALTYPE_BV_BASES , VALTYPE_NATION , VALTYPE_NATION_HASH ,
VALTYPE_GOV , VALTYPE_TILE_VISION_DATA
}

enum

object_property_ids {
OPID_TILE_IMAGE , OPID_TILE_X , OPID_TILE_Y , OPID_TILE_NAT_X ,
OPID_TILE_NAT_Y , OPID_TILE_CONTINENT , OPID_TILE_TERRAIN , OPID_TILE_INDEX ,
OPID_TILE_XY , OPID_TILE_RESOURCE , OPID_TILE_SPECIALS , OPID_TILE_ROADS ,
OPID_TILE_BASES , OPID_TILE_VISION , OPID_TILE_LABEL , OPID_STARTPOS_IMAGE ,
OPID_STARTPOS_XY , OPID_STARTPOS_EXCLUDE , OPID_STARTPOS_NATIONS , OPID_UNIT_IMAGE ,
OPID_UNIT_TYPE , OPID_UNIT_ID , OPID_UNIT_XY , OPID_UNIT_MOVES_LEFT ,
OPID_UNIT_FUEL , OPID_UNIT_MOVED , OPID_UNIT_DONE_MOVING , OPID_UNIT_HP ,
OPID_UNIT_VETERAN , OPID_UNIT_STAY , OPID_CITY_IMAGE , OPID_CITY_NAME ,
OPID_CITY_ID , OPID_CITY_XY , OPID_CITY_SIZE , OPID_CITY_HISTORY ,
OPID_CITY_BUILDINGS , OPID_CITY_FOOD_STOCK , OPID_CITY_SHIELD_STOCK , OPID_PLAYER_NAME ,
OPID_PLAYER_NATION , OPID_PLAYER_GOV , OPID_PLAYER_AGE , OPID_PLAYER_INVENTIONS ,
OPID_PLAYER_SCENARIO_RESERVED , OPID_PLAYER_SELECT_WEIGHT , OPID_PLAYER_SCIENCE , OPID_PLAYER_GOLD ,
OPID_GAME_SCENARIO , OPID_GAME_SCENARIO_NAME , OPID_GAME_SCENARIO_AUTHORS , OPID_GAME_SCENARIO_DESC ,
OPID_GAME_SCENARIO_RANDSTATE , OPID_GAME_SCENARIO_PLAYERS , OPID_GAME_STARTPOS_NATIONS , OPID_GAME_PREVENT_CITIES ,
OPID_GAME_LAKE_FLOODING , OPID_GAME_RULESET_LOCKED
}

enum | object_property_flags { OPF_NO_FLAGS = 0 , OPF_EDITABLE = 1 << 0 , OPF_IN_LISTVIEW = 1 << 1 , OPF_HAS_WIDGET = 1 << 2 }

## Functions

static GdkPixbuf * | create_pixbuf_from_layers (const struct tile *ptile, const struct unit *punit, const struct city *pcity, enum layer_category category)
static GdkPixbuf * | create_tile_pixbuf (const struct tile *ptile)
static GdkPixbuf * | create_unit_pixbuf (const struct unit *punit)
static GdkPixbuf * | create_city_pixbuf (const struct city *pcity)
static void | add_column (GtkWidget *view, int col_id, const char *name, GType gtype, bool editable, bool is_radio, GCallback edit_callback, gpointer callback_userdata)
static bool | can_create_unit_at_tile (struct tile *ptile)
static int | get_next_unique_tag (void)
const char * | vision_layer_get_name (enum vision_layer)
static struct property_filter * | property_filter_new (const char *filter)
static bool | property_filter_match (struct property_filter *pf, const struct objprop *op)
static void | property_filter_free (struct property_filter *pf)
static const char * | objtype_get_name (enum editor_object_type objtype)
static int | objtype_get_id_from_object (enum editor_object_type objtype, gpointer object)
static gpointer | objtype_get_object_from_id (enum editor_object_type objtype, int id)
static bool | objtype_is_conserved (enum editor_object_type objtype)
static const char * | valtype_get_name (enum value_types valtype)
static void | propval_free (struct propval *pv)
static void | propval_free_data (struct propval *pv)
static struct propval * | propval_copy (struct propval *pv)
static bool | propval_equal (struct propval *pva, struct propval *pvb)
static struct propstate * | propstate_new (struct objprop *op, struct propval *pv)
static void | propstate_destroy (struct propstate *ps)
static void | propstate_clear_value (struct propstate *ps)
static void | propstate_set_value (struct propstate *ps, struct propval *pv)
static struct propval * | propstate_get_value (struct propstate *ps)
static struct objprop * | objprop_new (int id, const char *name, const char *tooltip, enum object_property_flags flags, enum value_types valtype, struct property_page *parent)
static int | objprop_get_id (const struct objprop *op)
static const char * | objprop_get_name (const struct objprop *op)
static const char * | objprop_get_tooltip (const struct objprop *op)
static enum value_types | objprop_get_valtype (const struct objprop *op)
static struct property_page * | objprop_get_property_page (const struct objprop *op)
static bool | objprop_show_in_listview (const struct objprop *op)
static bool | objprop_is_sortable (const struct objprop *op)
static bool | objprop_is_readonly (const struct objprop *op)
static bool | objprop_has_widget (const struct objprop *op)
static GType | objprop_get_gtype (const struct objprop *op)
static const char * | objprop_get_attribute_type_string (const struct objprop *op)
static void | objprop_set_column_id (struct objprop *op, int col_id)
static int | objprop_get_column_id (const struct objprop *op)
static void | objprop_set_treeview_column (struct objprop *op, GtkTreeViewColumn *col)
static GtkTreeViewColumn * | objprop_get_treeview_column (const struct objprop *op)
static GtkCellRenderer * | objprop_create_cell_renderer (const struct objprop *op)
static void | objprop_setup_widget (struct objprop *op)
static GtkWidget * | objprop_get_widget (struct objprop *op)
static void | objprop_set_child_widget (struct objprop *op, const char *widget_name, GtkWidget *widget)
static GtkWidget * | objprop_get_child_widget (struct objprop *op, const char *widget_name)
static void | objprop_set_extviewer (struct objprop *op, struct extviewer *ev)
static struct extviewer * | objprop_get_extviewer (struct objprop *op)
static void | objprop_refresh_widget (struct objprop *op, struct objbind *ob)
static void | objprop_widget_text_changed (GtkEditable *text, gpointer userdata)
static void | objprop_widget_spin_button_changed (GtkSpinButton *spin, gpointer userdata)
static void | objprop_widget_toggle_button_changed (GtkToggleButton *button, gpointer userdata)
static struct objbind * | objbind_new (enum editor_object_type objtype, gpointer object)
static void | objbind_destroy (struct objbind *ob)
static enum editor_object_type | objbind_get_objtype (const struct objbind *ob)
static void | objbind_bind_properties (struct objbind *ob, struct property_page *pp)
static gpointer | objbind_get_object (struct objbind *ob)
static int | objbind_get_object_id (struct objbind *ob)
static void | objbind_request_destroy_object (struct objbind *ob)
static struct propval * | objbind_get_value_from_object (struct objbind *ob, struct objprop *op)
static bool | objbind_get_allowed_value_span (struct objbind *ob, struct objprop *op, double *pmin, double *pmax, double *pstep, double *pbig_step)
static bool | objbind_set_modified_value (struct objbind *ob, struct objprop *op, struct propval *pv)
static struct propval * | objbind_get_modified_value (struct objbind *ob, struct objprop *op)
static void | objbind_clear_modified_value (struct objbind *ob, struct objprop *op)
static bool | objbind_property_is_modified (struct objbind *ob, struct objprop *op)
static bool | objbind_has_modified_properties (struct objbind *ob)
static void | objbind_clear_all_modified_values (struct objbind *ob)
static void | objbind_pack_current_values (struct objbind *ob, union packetdata packet)
static void | objbind_pack_modified_value (struct objbind *ob, struct objprop *op, union packetdata packet)
static void | objbind_set_rowref (struct objbind *ob, GtkTreeRowReference *rr)
static GtkTreeRowReference * | objbind_get_rowref (struct objbind *ob)
static struct extviewer * | extviewer_new (struct objprop *op)
static struct objprop * | extviewer_get_objprop (struct extviewer *ev)
static GtkWidget * | extviewer_get_panel_widget (struct extviewer *ev)
static GtkWidget * | extviewer_get_view_widget (struct extviewer *ev)
static void | extviewer_refresh_widgets (struct extviewer *ev, struct propval *pv)
static void | extviewer_clear_widgets (struct extviewer *ev)
static void | extviewer_panel_button_clicked (GtkButton *button, gpointer userdata)
static void | extviewer_view_cell_toggled (GtkCellRendererToggle *cell, gchar *path, gpointer userdata)
static void | extviewer_textbuf_changed (GtkTextBuffer *textbuf, gpointer userdata)
static struct property_page * | property_page_new (enum editor_object_type objtype, struct property_editor *parent)
static void | property_page_setup_objprops (struct property_page *pp)
static const char * | property_page_get_name (const struct property_page *pp)
static enum editor_object_type | property_page_get_objtype (const struct property_page *pp)
static void | property_page_load_tiles (struct property_page *pp, const struct tile_list *tiles)
static void | property_page_add_objbinds_from_tile (struct property_page *pp, const struct tile *ptile)
static int | property_page_get_num_objbinds (const struct property_page *pp)
static void | property_page_clear_objbinds (struct property_page *pp)
static void | property_page_add_objbind (struct property_page *pp, gpointer object_data)
static void | property_page_fill_widgets (struct property_page *pp)
static struct objbind * | property_page_get_focused_objbind (struct property_page *pp)
static void | property_page_set_focused_objbind (struct property_page *pp, struct objbind *ob)
static struct objbind * | property_page_get_objbind (struct property_page *pp, int object_id)
static void | property_page_selection_changed (GtkTreeSelection *sel, gpointer userdata)
static gboolean | property_page_selection_func (GtkTreeSelection *sel, GtkTreeModel *model, GtkTreePath *path, gboolean currently_selected, gpointer data)
static void | property_page_quick_find_entry_changed (GtkWidget *entry, gpointer userdata)
static void | property_page_change_value (struct property_page *pp, struct objprop *op, struct propval *pv)
static void | property_page_send_values (struct property_page *pp)
static void | property_page_reset_objbinds (struct property_page *pp)
static void | property_page_destroy_objects (struct property_page *pp)
static void | property_page_create_objects (struct property_page *pp, struct tile_list *hint_tiles)
static union packetdata | property_page_new_packet (struct property_page *pp)
static void | property_page_send_packet (struct property_page *pp, union packetdata packet)
static void | property_page_free_packet (struct property_page *pp, union packetdata packet)
static void | property_page_object_changed (struct property_page *pp, int object_id, bool remove)
static void | property_page_object_created (struct property_page *pp, int tag, int object_id)
static void | property_page_add_extviewer (struct property_page *pp, struct extviewer *ev)
static void | property_page_show_extviewer (struct property_page *pp, struct extviewer *ev)
static void | property_page_store_creation_tag (struct property_page *pp, int tag, int count)
static void | property_page_remove_creation_tag (struct property_page *pp, int tag)
static bool | property_page_tag_is_known (struct property_page *pp, int tag)
static void | property_page_clear_tags (struct property_page *pp)
static void | property_page_apply_button_clicked (GtkButton *button, gpointer userdata)
static void | property_page_refresh_button_clicked (GtkButton *button, gpointer userdata)
static void | property_page_create_button_clicked (GtkButton *button, gpointer userdata)
static void | property_page_destroy_button_clicked (GtkButton *button, gpointer userdata)
static struct property_editor * | property_editor_new (void)
static bool | property_editor_add_page (struct property_editor *pe, enum editor_object_type objtype)
static struct property_page * | property_editor_get_page (struct property_editor *pe, enum editor_object_type objtype)
static gchar * | propval_as_string (struct propval *pv)
static gchar * | built_status_to_string (struct built_status *bs)
static bool | property_page_set_store_value (struct property_page *pp, struct objprop *op, struct objbind *ob, GtkTreeIter *iter)
struct property_editor * | editprop_get_property_editor (void)
void | property_editor_load_tiles (struct property_editor *pe, const struct tile_list *tiles)
void | property_editor_popup (struct property_editor *pe, enum editor_object_type objtype)
void | property_editor_popdown (struct property_editor *pe)
void | property_editor_handle_object_changed (struct property_editor *pe, enum editor_object_type objtype, int object_id, bool remove)
void | property_editor_handle_object_created (struct property_editor *pe, int tag, int object_id)
void | property_editor_clear (struct property_editor *pe)
void | property_editor_reload (struct property_editor *pe, enum editor_object_type objtype)

## Variables

static struct property_editor * | the_property_editor

## Macro Definition Documentation

## ◆ ADDPROP

#define ADDPROP | ( |  | ARG_id,
|  |  | ARG_name,
|  |  | ARG_tooltip,
|  |  | ARG_flags,
|  |  | ARG_valtype
| ) |  |

Value:
do { \
struct objprop *MY_op = objprop_new(ARG_id, ARG_name, ARG_tooltip, \
ARG_flags, ARG_valtype, pp); \
objprop_hash_insert(pp->objprop_table, MY_op->id, MY_op); \
} while (FALSE)
incite_cost
char * incite_cost
Definition comments.c:74
objprop_new
static struct objprop * objprop_new(int id, const char *name, const char *tooltip, enum object_property_flags flags, enum value_types valtype, struct property_page *parent)
Definition editprop.c:3457
objprop
Definition editprop.c:390
FALSE
#define FALSE
Definition support.h:47

## ◆ PF_CONJUNCTION_SEPARATOR

#define PF_CONJUNCTION_SEPARATOR "&"

Definition at line 120 of file editprop.c.

## ◆ PF_DISJUNCTION_SEPARATOR

#define PF_DISJUNCTION_SEPARATOR "|"

Definition at line 119 of file editprop.c.

## ◆ PF_MAX_CLAUSES

#define PF_MAX_CLAUSES 16

Definition at line 118 of file editprop.c.

## ◆ property_page_objbind_iterate

#define property_page_objbind_iterate | ( |  | ARG_pp,
|  |  | NAME_ob
| ) |  | TYPED_HASH_DATA_ITERATE(struct objbind *, (ARG_pp)->objbind_table, NAME_ob)

Definition at line 638 of file editprop.c.

## ◆ property_page_objbind_iterate_end

#define property_page_objbind_iterate_end HASH_DATA_ITERATE_END

Definition at line 640 of file editprop.c.

## ◆ property_page_objprop_iterate

#define property_page_objprop_iterate | ( |  | ARG_pp,
|  |  | NAME_op
| ) |  | TYPED_HASH_DATA_ITERATE(struct objprop *, (ARG_pp)->objprop_table, NAME_op)

Definition at line 634 of file editprop.c.

## ◆ property_page_objprop_iterate_end

#define property_page_objprop_iterate_end HASH_DATA_ITERATE_END

Definition at line 636 of file editprop.c.

## ◆ SPECHASH_IDATA_FREE [1/2]

#define SPECHASH_IDATA_FREE propstate_destroy

Definition at line 270 of file editprop.c.

## ◆ SPECHASH_IDATA_FREE [2/2]

#define SPECHASH_IDATA_FREE objbind_destroy

Definition at line 270 of file editprop.c.

## ◆ SPECHASH_IDATA_TYPE [1/3]

#define SPECHASH_IDATA_TYPE struct propstate *

Definition at line 269 of file editprop.c.

## ◆ SPECHASH_IDATA_TYPE [2/3]

#define SPECHASH_IDATA_TYPE struct objprop *

Definition at line 269 of file editprop.c.

## ◆ SPECHASH_IDATA_TYPE [3/3]

#define SPECHASH_IDATA_TYPE struct objbind *

Definition at line 269 of file editprop.c.

## ◆ SPECHASH_INT_DATA_TYPE

#define SPECHASH_INT_DATA_TYPE

Definition at line 91 of file editprop.c.

## ◆ SPECHASH_INT_KEY_TYPE [1/4]

#define SPECHASH_INT_KEY_TYPE

Definition at line 90 of file editprop.c.

## ◆ SPECHASH_INT_KEY_TYPE [2/4]

#define SPECHASH_INT_KEY_TYPE

Definition at line 90 of file editprop.c.

## ◆ SPECHASH_INT_KEY_TYPE [3/4]

#define SPECHASH_INT_KEY_TYPE

Definition at line 90 of file editprop.c.

## ◆ SPECHASH_INT_KEY_TYPE [4/4]

#define SPECHASH_INT_KEY_TYPE

Definition at line 90 of file editprop.c.

## ◆ SPECHASH_TAG [1/4]

#define SPECHASH_TAG stored_tag

Definition at line 89 of file editprop.c.

## ◆ SPECHASH_TAG [2/4]

#define SPECHASH_TAG propstate

Definition at line 89 of file editprop.c.

## ◆ SPECHASH_TAG [3/4]

#define SPECHASH_TAG objprop

Definition at line 89 of file editprop.c.

## ◆ SPECHASH_TAG [4/4]

#define SPECHASH_TAG objbind

Definition at line 89 of file editprop.c.

## Enumeration Type Documentation

## ◆ object_property_flags

enum object_property_flags

Enumerator
OPF_NO_FLAGS |
OPF_EDITABLE |
OPF_IN_LISTVIEW |
OPF_HAS_WIDGET |

Definition at line 383 of file editprop.c.

## ◆ object_property_ids

enum object_property_ids

Enumerator
OPID_TILE_IMAGE |
OPID_TILE_X |
OPID_TILE_Y |
OPID_TILE_NAT_X |
OPID_TILE_NAT_Y |
OPID_TILE_CONTINENT |
OPID_TILE_TERRAIN |
OPID_TILE_INDEX |
OPID_TILE_XY |
OPID_TILE_RESOURCE |
OPID_TILE_SPECIALS |
OPID_TILE_ROADS |
OPID_TILE_BASES |
OPID_TILE_VISION |
OPID_TILE_LABEL |
OPID_STARTPOS_IMAGE |
OPID_STARTPOS_XY |
OPID_STARTPOS_EXCLUDE |
OPID_STARTPOS_NATIONS |
OPID_UNIT_IMAGE |
OPID_UNIT_TYPE |
OPID_UNIT_ID |
OPID_UNIT_XY |
OPID_UNIT_MOVES_LEFT |
OPID_UNIT_FUEL |
OPID_UNIT_MOVED |
OPID_UNIT_DONE_MOVING |
OPID_UNIT_HP |
OPID_UNIT_VETERAN |
OPID_UNIT_STAY |
OPID_CITY_IMAGE |
OPID_CITY_NAME |
OPID_CITY_ID |
OPID_CITY_XY |
OPID_CITY_SIZE |
OPID_CITY_HISTORY |
OPID_CITY_BUILDINGS |
OPID_CITY_FOOD_STOCK |
OPID_CITY_SHIELD_STOCK |
OPID_PLAYER_NAME |
OPID_PLAYER_NATION |
OPID_PLAYER_GOV |
OPID_PLAYER_AGE |
OPID_PLAYER_INVENTIONS |
OPID_PLAYER_SCENARIO_RESERVED |
OPID_PLAYER_SELECT_WEIGHT |
OPID_PLAYER_SCIENCE |
OPID_PLAYER_GOLD |
OPID_GAME_SCENARIO |
OPID_GAME_SCENARIO_NAME |
OPID_GAME_SCENARIO_AUTHORS |
OPID_GAME_SCENARIO_DESC |
OPID_GAME_SCENARIO_RANDSTATE |
OPID_GAME_SCENARIO_PLAYERS |
OPID_GAME_STARTPOS_NATIONS |
OPID_GAME_PREVENT_CITIES |
OPID_GAME_LAKE_FLOODING |
OPID_GAME_RULESET_LOCKED |

Definition at line 305 of file editprop.c.

## ◆ value_types

enum value_types

Enumerator
VALTYPE_NONE |
VALTYPE_INT |
VALTYPE_BOOL |
VALTYPE_STRING |
VALTYPE_PIXBUF |
VALTYPE_BUILT_ARRAY |
VALTYPE_INVENTIONS_ARRAY |
VALTYPE_BV_SPECIAL |
VALTYPE_BV_ROADS |
VALTYPE_BV_BASES |
VALTYPE_NATION |
VALTYPE_NATION_HASH |
VALTYPE_GOV |
VALTYPE_TILE_VISION_DATA |

Definition at line 197 of file editprop.c.

## Function Documentation

## ◆ add_column()

static void add_column | ( | GtkWidget * | view,
|  | int | col_id,
|  | const char * | name,
|  | GType | gtype,
|  | bool | editable,
|  | bool | is_radio,
|  | GCallback | edit_callback,
|  | gpointer | userdata
| ) |  |

static

Convenience function to add a column to a GtkTreeView. Used for the view widget creation in extviewer_new().

Definition at line 819 of file editprop.c.

## ◆ built_status_to_string()

static gchar * built_status_to_string | ( | struct built_status * | bs | ) |

static

Convert the built_status information to a user viewable string. Returned value is g_strdup'd and must be g_free'd.

Definition at line 976 of file editprop.c.

## ◆ can_create_unit_at_tile()

static bool can_create_unit_at_tile | ( | struct tile * | ptile | ) |

static

Returns TRUE if a unit can be created at the given tile based on the state of the editor (see editor_unit_virtual_create).

Definition at line 997 of file editprop.c.

## ◆ create_city_pixbuf()

static GdkPixbuf * create_city_pixbuf | ( | const struct city * | pcity | ) |

static

Create a pixbuf containing an image of the given city.

May return NULL on error or bad input. NB: You must call g_object_unref on the non-NULL return value when you no longer need it.

Definition at line 5112 of file editprop.c.

## ◆ create_pixbuf_from_layers()

static GdkPixbuf * create_pixbuf_from_layers | ( | const struct tile * | ptile,
|  | const struct unit * | punit,
|  | const struct city * | pcity,
|  | enum layer_category | category
| ) |  |

static

Create a pixbuf containing an image of the given tile, unit or city restricted to the layer category 'cat'.

May return NULL on error or bad input. NB: You must call g_object_unref on the non-NULL return value when you no longer need it.

Definition at line 5126 of file editprop.c.

## ◆ create_tile_pixbuf()

static GdkPixbuf * create_tile_pixbuf | ( | const struct tile * | ptile | ) |

static

Create a pixbuf containing an image of the given tile. The image will only be of the layers containing terrains, resources and specials.

May return NULL on error or bad input. NB: You must call g_object_unref on the non-NULL return value when you no longer need it.

Definition at line 5088 of file editprop.c.

## ◆ create_unit_pixbuf()

static GdkPixbuf * create_unit_pixbuf | ( | const struct unit * | punit | ) |

static

Create a pixbuf containing an image of the given unit.

May return NULL on error or bad input. NB: You must call g_object_unref on the non-NULL return value when you no longer need it.

Definition at line 5100 of file editprop.c.

## ◆ editprop_get_property_editor()

struct property_editor * editprop_get_property_editor | ( | void |  | ) |

Get the property editor for the client's GUI.

Definition at line 6228 of file editprop.c.

## ◆ extviewer_clear_widgets()

static void extviewer_clear_widgets | ( | struct extviewer * | ev | ) |

static

Clear the display widgets.

Definition at line 4073 of file editprop.c.

## ◆ extviewer_get_objprop()

static struct objprop * extviewer_get_objprop | ( | struct extviewer * | ev | ) |

static

Returns the object property that is displayed by this extviewer.

Definition at line 3774 of file editprop.c.

## ◆ extviewer_get_panel_widget()

static GtkWidget * extviewer_get_panel_widget | ( | struct extviewer * | ev | ) |

static

Returns the "panel widget" for this extviewer, i.e. the widget the is to be placed into the properties panel.

Definition at line 3786 of file editprop.c.

## ◆ extviewer_get_view_widget()

static GtkWidget * extviewer_get_view_widget | ( | struct extviewer * | ev | ) |

static

Returns the "view widget" for this extviewer, i.e. the widget the is to be used for viewing/editing a complex property.

Definition at line 3798 of file editprop.c.

## ◆ extviewer_new()

static struct extviewer * extviewer_new | ( | struct objprop * | op | ) |

static

Create "extended property viewer". This is used for viewing/editing complex property values (e.g. arrays, bitvectors, etc.).

Definition at line 3492 of file editprop.c.

## ◆ extviewer_panel_button_clicked()

static void extviewer_panel_button_clicked | ( | GtkButton * | button,
|  | gpointer | userdata
| ) |  |

static

Handle the extviewer's panel button click. This should set the property page to display the view widget for this complex property.

Definition at line 4128 of file editprop.c.

## ◆ extviewer_refresh_widgets()

static void extviewer_refresh_widgets | ( | struct extviewer * | ev,
|  | struct propval * | pv
| ) |  |

static

Set the widgets in the extended property viewer to display the given value.

Definition at line 3809 of file editprop.c.

## ◆ extviewer_textbuf_changed()

static void extviewer_textbuf_changed | ( | GtkTextBuffer * | textbuf,
|  | gpointer | userdata
| ) |  |

static

Handle a change in the extviewer's text buffer.

Definition at line 4363 of file editprop.c.

## ◆ extviewer_view_cell_toggled()

static void extviewer_view_cell_toggled | ( | GtkCellRendererToggle * | cell,
|  | gchar * | path,
|  | gpointer | userdata
| ) |  |

static

Handle toggling of a boolean cell value in the extviewer's tree view.

Definition at line 4148 of file editprop.c.

## ◆ get_next_unique_tag()

static int get_next_unique_tag | ( | void |  | ) |

static

Return the next tag number in the sequence.

Definition at line 1030 of file editprop.c.

## ◆ objbind_bind_properties()

static void objbind_bind_properties | ( | struct objbind * | ob,
|  | struct property_page * | pp
| ) |  |

static

Bind the object in the given objbind to the properties in the page.

Definition at line 2212 of file editprop.c.

## ◆ objbind_clear_all_modified_values()

static void objbind_clear_all_modified_values | ( | struct objbind * | ob | ) |

static

Deletes all stored modified property values.

Definition at line 2103 of file editprop.c.

## ◆ objbind_clear_modified_value()

static void objbind_clear_modified_value | ( | struct objbind * | ob,
|  | struct objprop * | op
| ) |  |

static

Remove a stored modified value, if it exists.

Definition at line 2058 of file editprop.c.

## ◆ objbind_destroy()

static void objbind_destroy | ( | struct objbind * | ob | ) |

static

Destroy the object bind and free any resources it might have been using.

Definition at line 2182 of file editprop.c.

## ◆ objbind_get_allowed_value_span()

static bool objbind_get_allowed_value_span | ( | struct objbind * | ob,
|  | struct objprop * | op,
|  | double * | pmin,
|  | double * | pmax,
|  | double * | pstep,
|  | double * | pbig_step
| ) |  |

static

If applicable, sets the allowed range values of the given object property as applied to the bound object. Returns TRUE if values were set.

Definition at line 1877 of file editprop.c.

## ◆ objbind_get_modified_value()

static struct propval * objbind_get_modified_value | ( | struct objbind * | ob,
|  | struct objprop * | op
| ) |  |

static

Retrieve the stored property value for the bound object, or NULL if none exists.

NB: Does NOT return a copy.

Definition at line 2163 of file editprop.c.

## ◆ objbind_get_object()

static gpointer objbind_get_object | ( | struct objbind * | ob | ) |

static

Returns the bound object, if it still "exists". Returns NULL on error.

Definition at line 1362 of file editprop.c.

## ◆ objbind_get_object_id()

static int objbind_get_object_id | ( | struct objbind * | ob | ) |

static

Returns the ID of the bound object, or -1 if invalid.

Definition at line 1378 of file editprop.c.

## ◆ objbind_get_objtype()

static enum editor_object_type objbind_get_objtype | ( | const struct objbind * | ob | ) |

static

Returns the object type of the bound object.

Definition at line 2201 of file editprop.c.

## ◆ objbind_get_rowref()

static GtkTreeRowReference * objbind_get_rowref | ( | struct objbind * | ob | ) |

static

Returns the row reference of this objbind, or NULL if not applicable.

Definition at line 2649 of file editprop.c.

## ◆ objbind_get_value_from_object()

static struct propval * objbind_get_value_from_object | ( | struct objbind * | ob,
|  | struct objprop * | op
| ) |  |

static

Returns a newly allocated property value for the given object property on the object referenced by the given object bind, or NULL on failure.

NB: You must call propval_free() on the non-NULL return value when it no longer needed.

Definition at line 1439 of file editprop.c.

## ◆ objbind_has_modified_properties()

static bool objbind_has_modified_properties | ( | struct objbind * | ob | ) |

static

Returns TRUE if there are any stored modified values of any of the properties of the bound object.

Definition at line 2091 of file editprop.c.

## ◆ objbind_new()

static struct objbind * objbind_new | ( | enum editor_object_type | objtype,
|  | gpointer | object
| ) |  |

static

Create a new object "bind". It serves to bind a set of object properties to an object instance.

Definition at line 1336 of file editprop.c.

## ◆ objbind_pack_current_values()

static void objbind_pack_current_values | ( | struct objbind * | ob,
|  | union packetdata | pd
| ) |  |

static

Fill the packet with the bound object's current state.

NB: This must be updated if the packet_edit_<object> definitions change.

Definition at line 2226 of file editprop.c.

## ◆ objbind_pack_modified_value()

static void objbind_pack_modified_value | ( | struct objbind * | ob,
|  | struct objprop * | op,
|  | union packetdata | pd
| ) |  |

static

Package the modified property value into the supplied packet.

Definition at line 2368 of file editprop.c.

## ◆ objbind_property_is_modified()

static bool objbind_property_is_modified | ( | struct objbind * | ob,
|  | struct objprop * | op
| ) |  |

static

Returns TRUE if a stored modified property value exists for this bound object for the given property.

Definition at line 2072 of file editprop.c.

## ◆ objbind_request_destroy_object()

static void objbind_request_destroy_object | ( | struct objbind * | ob | ) |

static

Sends a request to the server to have the bound object erased from existence. Only makes sense for object types for which the function objtype_is_conserved() returns FALSE.

Definition at line 1391 of file editprop.c.

## ◆ objbind_set_modified_value()

static bool objbind_set_modified_value | ( | struct objbind * | ob,
|  | struct objprop * | op,
|  | struct propval * | pv
| ) |  |

static

Store a modified property value, but only if it is different from the current value. Always makes a copy of the given value when storing.

Returns whether anything changed.

Definition at line 2117 of file editprop.c.

## ◆ objbind_set_rowref()

static void objbind_set_rowref | ( | struct objbind * | ob,
|  | GtkTreeRowReference * | rr
| ) |  |

static

Sets the row reference in a GtkTreeModel of this objbind.

Definition at line 2637 of file editprop.c.

## ◆ objprop_create_cell_renderer()

static GtkCellRenderer * objprop_create_cell_renderer | ( | const struct objprop * | op | ) |

static

Create and return a cell renderer corresponding to this object property, suitable to be used with a tree view. May return NULL if this object property cannot exist in a list store.

Definition at line 2841 of file editprop.c.

## ◆ objprop_get_attribute_type_string()

static const char * objprop_get_attribute_type_string | ( | const struct objprop * | op | ) |

static

Returns a the string corresponding to the attribute type name required for gtk_tree_view_column_new_with_attributes according to this objprop's GType value. May return NULL if it does not make sense for this object property.

Definition at line 2744 of file editprop.c.

## ◆ objprop_get_child_widget()

static GtkWidget * objprop_get_child_widget | ( | struct objprop * | op,
|  | const char * | widget_name
| ) |  |

static

Retrieves the widget stored under the given name, or returns NULL and logs an error message if not found.

Definition at line 3400 of file editprop.c.

## ◆ objprop_get_column_id()

static int objprop_get_column_id | ( | const struct objprop * | op | ) |

static

Returns the column id in the list store for this object property. May return -1 if not applicable or if not yet set. NB: This is the column id in the model, not the view.

Definition at line 2782 of file editprop.c.

## ◆ objprop_get_extviewer()

static struct extviewer * objprop_get_extviewer | ( | struct objprop * | op | ) |

static

Return the stored extviewer, or NULL if none exists.

Definition at line 3445 of file editprop.c.

## ◆ objprop_get_gtype()

static GType objprop_get_gtype | ( | const struct objprop * | op | ) |

static

Returns the GType that this object property renders as in a GtkTreeView. Returning G_TYPE_NONE indicates that this property cannot be viewed in a list.

NB: This must correspond to the actions in property_page_set_store_value.

Definition at line 2675 of file editprop.c.

## ◆ objprop_get_id()

static int objprop_get_id | ( | const struct objprop * | op | ) |

static

Returns the unique property identifier for this object property.

Definition at line 2660 of file editprop.c.

## ◆ objprop_get_name()

static const char * objprop_get_name | ( | const struct objprop * | op | ) |

static

Returns the string name of this object property.

Definition at line 2817 of file editprop.c.

## ◆ objprop_get_property_page()

static struct property_page * objprop_get_property_page | ( | const struct objprop * | op | ) |

static

Get the property page in which this property is installed.

Definition at line 3456 of file editprop.c.

## ◆ objprop_get_tooltip()

static const char * objprop_get_tooltip | ( | const struct objprop * | op | ) |

static

Return a description (translated) of the property.

Definition at line 2828 of file editprop.c.

## ◆ objprop_get_treeview_column()

static GtkTreeViewColumn * objprop_get_treeview_column | ( | const struct objprop * | op | ) |

static

Returns the previously stored tree view column reference, or NULL if none exists.

Definition at line 2806 of file editprop.c.

## ◆ objprop_get_valtype()

static enum value_types objprop_get_valtype | ( | const struct objprop * | op | ) |

static

Returns the value type of this property value (one of enum value_types).

Definition at line 2708 of file editprop.c.

## ◆ objprop_get_widget()

static GtkWidget * objprop_get_widget | ( | struct objprop * | op | ) |

static

Returns the gtk widget used to display or edit this property, or NULL if not applicable.

Definition at line 3358 of file editprop.c.

## ◆ objprop_has_widget()

static bool objprop_has_widget | ( | const struct objprop * | op | ) |

static

Returns TRUE if this object property can create and use a property widget.

Definition at line 2730 of file editprop.c.

## ◆ objprop_is_readonly()

static bool objprop_is_readonly | ( | const struct objprop * | op | ) |

static

Return TRUE if the given object property cannot be edited (i.e. it is displayed information only).

Definition at line 2876 of file editprop.c.

## ◆ objprop_is_sortable()

static bool objprop_is_sortable | ( | const struct objprop * | op | ) |

static

Return TRUE if the given object property can be sorted (i.e. in the list view).

Definition at line 2862 of file editprop.c.

## ◆ objprop_new()

static struct objprop * objprop_new | ( | int | id,
|  | const char * | name,
|  | const char * | tooltip,
|  | enum object_property_flags | flags,
|  | enum value_types | valtype,
|  | struct property_page * | parent
| ) |  |

static

Create a new object property.

Definition at line 3467 of file editprop.c.

## ◆ objprop_refresh_widget()

static void objprop_refresh_widget | ( | struct objprop * | op,
|  | struct objbind * | ob
| ) |  |

static

Refresh the display/edit widget corresponding to this object property according to the value of the bound object. If a stored modified value exists, then check it against the object's current value and remove it if they are equal.

If 'ob' is NULL, then clear the widget.

Definition at line 3112 of file editprop.c.

## ◆ objprop_set_child_widget()

static void objprop_set_child_widget | ( | struct objprop * | op,
|  | const char * | widget_name,
|  | GtkWidget * | widget
| ) |  |

static

Stores the given widget under the given name. This function will have no effect if objprop_get_widget does not return a valid GtkWidget instance.

Definition at line 3373 of file editprop.c.

## ◆ objprop_set_column_id()

static void objprop_set_column_id | ( | struct objprop * | op,
|  | int | col_id
| ) |  |

static

Store the column id of the list store that this object property can be viewed in. This should generally only be changed set once, when the object property's associated list view is created. NB: This is the column id in the model, not the view.

Definition at line 2769 of file editprop.c.

## ◆ objprop_set_extviewer()

static void objprop_set_extviewer | ( | struct objprop * | op,
|  | struct extviewer * | ev
| ) |  |

static

Store the extviewer struct for later retrieval.

Definition at line 3433 of file editprop.c.

## ◆ objprop_set_treeview_column()

static void objprop_set_treeview_column | ( | struct objprop * | op,
|  | GtkTreeViewColumn * | col
| ) |  |

static

Sets the view column reference for later convenience.

Definition at line 2793 of file editprop.c.

## ◆ objprop_setup_widget()

static void objprop_setup_widget | ( | struct objprop * | op | ) |

static

Create the gtk widget used to edit or display this object property.

Definition at line 2937 of file editprop.c.

## ◆ objprop_show_in_listview()

static bool objprop_show_in_listview | ( | const struct objprop * | op | ) |

static

Returns TRUE if this object property can be viewed in a GtkTreeView.

Definition at line 2719 of file editprop.c.

## ◆ objprop_widget_spin_button_changed()

static void objprop_widget_spin_button_changed | ( | GtkSpinButton * | spin,
|  | gpointer | userdata
| ) |  |

static

Callback for spin button widget 'value-changed' signal.

Definition at line 2903 of file editprop.c.

## ◆ objprop_widget_text_changed()

static void objprop_widget_text_changed | ( | GtkEditable * | text,
|  | gpointer | userdata
| ) |  |

static

Callback for text widget 'changed' signal.

Definition at line 2887 of file editprop.c.

## ◆ objprop_widget_toggle_button_changed()

static void objprop_widget_toggle_button_changed | ( | GtkToggleButton * | button,
|  | gpointer | userdata
| ) |  |

static

Callback for toggle type button widget 'toggled' signal.

Definition at line 2920 of file editprop.c.

## ◆ objtype_get_id_from_object()

static int objtype_get_id_from_object | ( | enum editor_object_type | objtype,
|  | gpointer | object
| ) |  |

static

Returns the unique identifier value from the given object, assuming it is of the 'objtype' object type. Valid IDs are always greater than or equal to zero.

Definition at line 695 of file editprop.c.

## ◆ objtype_get_name()

static const char * objtype_get_name | ( | enum editor_object_type | objtype | ) |

static

Returns the translated name for the given object type.

Definition at line 666 of file editprop.c.

## ◆ objtype_get_object_from_id()

static gpointer objtype_get_object_from_id | ( | enum editor_object_type | objtype,
|  | int | id
| ) |  |

static

Get the object of type 'objtype' uniquely identified by 'id'.

Definition at line 724 of file editprop.c.

## ◆ objtype_is_conserved()

static bool objtype_is_conserved | ( | enum editor_object_type | objtype | ) |

static

Returns TRUE if it does not make sense for the object of the given type to be created and destroyed (e.g. tiles, game), as opposed to those that can be (e.g. units, cities, players, etc.).

Definition at line 755 of file editprop.c.

## ◆ property_editor_add_page()

static bool property_editor_add_page | ( | struct property_editor * | pe,
|  | enum editor_object_type | objtype
| ) |  |

static

Create and add a property page for the given object type to the property editor. Returns TRUE if successful.

Definition at line 6137 of file editprop.c.

## ◆ property_editor_clear()

void property_editor_clear | ( | struct property_editor * | pe | ) |

Clear all property pages in the given property editor.

Definition at line 6346 of file editprop.c.

## ◆ property_editor_get_page()

static struct property_page * property_editor_get_page | ( | struct property_editor * | pe,
|  | enum editor_object_type | objtype
| ) |  |

static

Returns the property page for the given object type.

Definition at line 6171 of file editprop.c.

## ◆ property_editor_handle_object_changed()

void property_editor_handle_object_changed | ( | struct property_editor * | pe,
|  | enum editor_object_type | objtype,
|  | int | object_id,
|  | bool | remove
| ) |  |

Handle a notification from the client core that some object has changed state at the server side (including being removed).

Definition at line 6306 of file editprop.c.

## ◆ property_editor_handle_object_created()

void property_editor_handle_object_created | ( | struct property_editor * | pe,
|  | int | tag,
|  | int | object_id
| ) |  |

Handle a notification that an object was created under the given tag.

Definition at line 6328 of file editprop.c.

## ◆ property_editor_load_tiles()

void property_editor_load_tiles | ( | struct property_editor * | pe,
|  | const struct tile_list * | tiles
| ) |  |

Refresh the given property editor according to the given list of tiles.

Definition at line 6239 of file editprop.c.

## ◆ property_editor_new()

static struct property_editor * property_editor_new | ( | void |  | ) |

static

Create and return the property editor widget bundle.

Definition at line 6184 of file editprop.c.

## ◆ property_editor_popdown()

void property_editor_popdown | ( | struct property_editor * | pe | ) |

Hide the property editor window.

Definition at line 6293 of file editprop.c.

## ◆ property_editor_popup()

void property_editor_popup | ( | struct property_editor * | pe,
|  | enum editor_object_type | objtype
| ) |  |

Show the property editor to the user, with given page corresponding to 'objtype' in front (if a valid object type).

Definition at line 6275 of file editprop.c.

## ◆ property_editor_reload()

void property_editor_reload | ( | struct property_editor * | pe,
|  | enum editor_object_type | objtype
| ) |  |

Clear and load objects into the property page corresponding to the given object type. Also, make it the current shown notebook page.

Definition at line 6366 of file editprop.c.

## ◆ property_filter_free()

static void property_filter_free | ( | struct property_filter * | pf | ) |

static

Frees all memory used by the property filter.

Definition at line 6542 of file editprop.c.

## ◆ property_filter_match()

static bool property_filter_match | ( | struct property_filter * | pf,
|  | const struct objprop * | op
| ) |  |

static

Returns TRUE if the filter matches the given object property.

The filter matches if its truth value is TRUE. That is, it has at least one OR clause in which all AND clauses are TRUE. An AND clause is TRUE if its pattern matches the name of the given object property (case is ignored), or it is negated and does not match. For example:

a - Matches all properties whose names contain "a" (or "A"). !a - Matches all properties whose names do not contain "a". a|b - Matches all properties whose names contain "a" or "b". a|b&c - Matches all properties whose names contain either an "a", or contain both "b" and "c".

NB: If you change the behaviour of this function, be sure to update the filter tooltip in property_page_new().

Definition at line 6488 of file editprop.c.

## ◆ property_filter_new()

static struct property_filter * property_filter_new | ( | const char * | filter | ) |

static

Create a new property filter from the given filter string. Result should be freed by property_filter_free when no longed needed.

The filter string is '|' ("or") separated list of '&' ("and") separated lists of patterns. A pattern may be preceeded by '!' to have its result negated.

NB: If you change the behaviour of this function, be sure to update the filter tooltip in property_page_new().

Definition at line 6414 of file editprop.c.

## ◆ property_page_add_extviewer()

static void property_page_add_extviewer | ( | struct property_page * | pp,
|  | struct extviewer * | ev
| ) |  |

static

Add the extviewer's view widget to the property page so that it can be shown in the extended property view panel.

Definition at line 5969 of file editprop.c.

## ◆ property_page_add_objbind()

static void property_page_add_objbind | ( | struct property_page * | pp,
|  | gpointer | object_data
| ) |  |

static

Create a new object bind to the given object and register it with the given property page.

Definition at line 5183 of file editprop.c.

## ◆ property_page_add_objbinds_from_tile()

static void property_page_add_objbinds_from_tile | ( | struct property_page * | pp,
|  | const struct tile * | ptile
| ) |  |

static

Create zero or more object binds from the objects on the given tile to the properties contained in the given property page.

Definition at line 5219 of file editprop.c.

## ◆ property_page_apply_button_clicked()

static void property_page_apply_button_clicked | ( | GtkButton * | button,
|  | gpointer | userdata
| ) |  |

static

Handles the 'clicked' signal for the "Apply" button in the property page.

Definition at line 6077 of file editprop.c.

## ◆ property_page_change_value()

static void property_page_change_value | ( | struct property_page * | pp,
|  | struct objprop * | op,
|  | struct propval * | pv
| ) |  |

static

Called when a user sets a new value for the given property via the GUI. Refreshes the properties widget if anything changes.

Definition at line 5489 of file editprop.c.

## ◆ property_page_clear_objbinds()

static void property_page_clear_objbinds | ( | struct property_page * | pp | ) |

static

Remove all object binds (i.e. objects listed) in the property page.

Definition at line 5168 of file editprop.c.

## ◆ property_page_clear_tags()

static void property_page_clear_tags | ( | struct property_page * | pp | ) |

static

Remove all tags in the tag table.

Definition at line 6066 of file editprop.c.

## ◆ property_page_create_button_clicked()

static void property_page_create_button_clicked | ( | GtkButton * | button,
|  | gpointer | userdata
| ) |  |

static

Handle a request to create a new object in the property page.

Definition at line 6098 of file editprop.c.

## ◆ property_page_create_objects()

static void property_page_create_objects | ( | struct property_page * | pp,
|  | struct tile_list * | hint_tiles
| ) |  |

static

Create objects corresponding to the type of this property page. Parameters such as the type, count, size and player owner are taken from the current editor state. The 'hint_tiles' argument is a list of tiles where the objects could be created.

Definition at line 5767 of file editprop.c.

## ◆ property_page_destroy_button_clicked()

static void property_page_destroy_button_clicked | ( | GtkButton * | button,
|  | gpointer | userdata
| ) |  |

static

Handle a click on the "destroy" button.

Definition at line 6126 of file editprop.c.

## ◆ property_page_destroy_objects()

static void property_page_destroy_objects | ( | struct property_page * | pp | ) |

static

Destroy all selected objects in the current property page.

Definition at line 5728 of file editprop.c.

## ◆ property_page_fill_widgets()

static void property_page_fill_widgets | ( | struct property_page * | pp | ) |

static

Inserts any objbinds owned by this proprety page into the page's list store if they are not there already and refreshes all property widgets.

Definition at line 5368 of file editprop.c.

## ◆ property_page_free_packet()

static void property_page_free_packet | ( | struct property_page * | pp,
|  | union packetdata | packet
| ) |  |

static

Free any resources being used by the packet.

Definition at line 5667 of file editprop.c.

## ◆ property_page_get_focused_objbind()

static struct objbind * property_page_get_focused_objbind | ( | struct property_page * | pp | ) |

static

Get the objbind corresponding to the object that is currently in view (i.e. in the information/properties panels) or NULL if none.

Definition at line 5418 of file editprop.c.

## ◆ property_page_get_name()

static const char * property_page_get_name | ( | const struct property_page * | pp | ) |

static

Returns the translated name of the property page's object type.

Definition at line 5060 of file editprop.c.

## ◆ property_page_get_num_objbinds()

static int property_page_get_num_objbinds | ( | const struct property_page * | pp | ) |

static

Return the number of current bound objects to this property page.

Definition at line 5477 of file editprop.c.

## ◆ property_page_get_objbind()

static struct objbind * property_page_get_objbind | ( | struct property_page * | pp,
|  | int | object_id
| ) |  |

static

Returns the objbind whose object corresponds to the given id, or NULL if no such objbind exists.

Definition at line 5443 of file editprop.c.

## ◆ property_page_get_objtype()

static enum editor_object_type property_page_get_objtype | ( | const struct property_page * | pp | ) |

static

Returns the object type for this property page, or -1 if none.

Definition at line 5072 of file editprop.c.

## ◆ property_page_load_tiles()

static void property_page_load_tiles | ( | struct property_page * | pp,
|  | const struct tile_list * | tiles
| ) |  |

static

Removes all of the current objbinds and extracts new ones from the supplied list of tiles.

Definition at line 5460 of file editprop.c.

## ◆ property_page_new()

static struct property_page * property_page_new | ( | enum editor_object_type | objtype,
|  | struct property_editor * | pe
| ) |  |

static

Create and return a property page of the given object type. Returns NULL if the page could not be created.

Definition at line 4737 of file editprop.c.

## ◆ property_page_new_packet()

static union packetdata property_page_new_packet | ( | struct property_page * | pp | ) |

static

Returns pointer to a packet suitable for this page's object type. Result should be freed using property_page_free_packet when no longer needed.

Definition at line 5585 of file editprop.c.

## ◆ property_page_object_changed()

static void property_page_object_changed | ( | struct property_page * | pp,
|  | int | object_id,
|  | bool | removed
| ) |  |

static

Update objbinds and widgets according to how the object given by 'object_id' has changed. If the object no longer exists then the objbind is removed from the property page.

Definition at line 5891 of file editprop.c.

## ◆ property_page_object_created()

static void property_page_object_created | ( | struct property_page * | pp,
|  | int | tag,
|  | int | object_id
| ) |  |

static

Handle a notification of object creation sent back from the server. If this is something we previously requested, then 'tag' should be found in the tag table. In this case we create a new objbind for the object given by 'object_id' and add it to this page.

Definition at line 5943 of file editprop.c.

## ◆ property_page_quick_find_entry_changed()

static void property_page_quick_find_entry_changed | ( | GtkWidget * | entry,
|  | gpointer | userdata
| ) |  |

static

Callback to handle text changing in the quick find entry widget.

Definition at line 4699 of file editprop.c.

## ◆ property_page_refresh_button_clicked()

static void property_page_refresh_button_clicked | ( | GtkButton * | button,
|  | gpointer | userdata
| ) |  |

static

Handles the 'clicked' signal for the "Refresh" button in the property page.

Definition at line 6088 of file editprop.c.

## ◆ property_page_remove_creation_tag()

static void property_page_remove_creation_tag | ( | struct property_page * | pp,
|  | int | tag
| ) |  |

static

Decrease the tag count and remove the object creation tag if it is no longer needed.

Definition at line 6036 of file editprop.c.

## ◆ property_page_reset_objbinds()

static void property_page_reset_objbinds | ( | struct property_page * | pp | ) |

static

Reload the displayed values of all properties for the selected bound objects. Hence, deletes all their stored modified values.

Definition at line 5687 of file editprop.c.

## ◆ property_page_selection_changed()

static void property_page_selection_changed | ( | GtkTreeSelection * | sel,
|  | gpointer | userdata
| ) |  |

static

Callback for when a property page's listview's selection changes.

Definition at line 4619 of file editprop.c.

## ◆ property_page_selection_func()

static gboolean property_page_selection_func | ( | GtkTreeSelection * | sel,
|  | GtkTreeModel * | model,
|  | GtkTreePath * | sel_path,
|  | gboolean | currently_selected,
|  | gpointer | data
| ) |  |

static

Monitor which rows are to be selected, so we know which objbind to display in the properties panel.

Definition at line 4644 of file editprop.c.

## ◆ property_page_send_packet()

static void property_page_send_packet | ( | struct property_page * | pp,
|  | union packetdata | packet
| ) |  |

static

Sends the given packet.

Definition at line 5626 of file editprop.c.

## ◆ property_page_send_values()

static void property_page_send_values | ( | struct property_page * | pp | ) |

static

Send all modified values of all selected properties.

Definition at line 5531 of file editprop.c.

## ◆ property_page_set_focused_objbind()

static void property_page_set_focused_objbind | ( | struct property_page * | pp,
|  | struct objbind * | ob
| ) |  |

static

Set the objbind that should be shown in the properties panel. Does not refresh property widgets.

Definition at line 5430 of file editprop.c.

## ◆ property_page_set_store_value()

static bool property_page_set_store_value | ( | struct property_page * | pp,
|  | struct objprop * | op,
|  | struct objbind * | ob,
|  | GtkTreeIter * | iter
| ) |  |

static

Set the column value in the list store of the property page. Returns TRUE if data was enetered into the store.

NB: This must match the conversion in objprop_get_gtype.

Definition at line 5273 of file editprop.c.

## ◆ property_page_setup_objprops()

static void property_page_setup_objprops | ( | struct property_page * | pp | ) |

static

Install all object properties that this page type can view/edit.

Definition at line 4412 of file editprop.c.

## ◆ property_page_show_extviewer()

static void property_page_show_extviewer | ( | struct property_page * | pp,
|  | struct extviewer * | ev
| ) |  |

static

Make the given extended property viewer's view widget visible in the property page.

Definition at line 5989 of file editprop.c.

## ◆ property_page_store_creation_tag()

static void property_page_store_creation_tag | ( | struct property_page * | pp,
|  | int | tag,
|  | int | count
| ) |  |

static

Store the given object creation tag so that when the server notifies us about it we know what to do, up to 'count' times.

Definition at line 6014 of file editprop.c.

## ◆ property_page_tag_is_known()

static bool property_page_tag_is_known | ( | struct property_page * | pp,
|  | int | tag
| ) |  |

static

Check if the given tag is one that we previously stored.

Definition at line 6055 of file editprop.c.

## ◆ propstate_clear_value()

static void propstate_clear_value | ( | struct propstate * | ps | ) |

static

Removes the stored value, freeing it if needed.

Definition at line 1281 of file editprop.c.

## ◆ propstate_destroy()

static void propstate_destroy | ( | struct propstate * | ps | ) |

static

Free a property state and any associated resources.

Definition at line 1294 of file editprop.c.

## ◆ propstate_get_value()

static struct propval * propstate_get_value | ( | struct propstate * | ps | ) |

static

Returns the stored value.

NB: NOT a copy of the value.

Definition at line 1324 of file editprop.c.

## ◆ propstate_new()

static struct propstate * propstate_new | ( | struct objprop * | op,
|  | struct propval * | pv
| ) |  |

static

Create a new "property state" record. It keeps track of the modified value of a property bound to an object.

NB: Does NOT make a copy of 'pv'.

Definition at line 1262 of file editprop.c.

## ◆ propstate_set_value()

static void propstate_set_value | ( | struct propstate * | ps,
|  | struct propval * | pv
| ) |  |

static

Replace the stored property value with a new one. The old value will be freed if needed.

NB: Does NOT make a copy of 'pv'.

Definition at line 1309 of file editprop.c.

## ◆ propval_as_string()

static gchar * propval_as_string | ( | struct propval * | pv | ) |

static

Fill the supplied buffer with a short string representation of the given value. Returned value is g_strdup'd and must be g_free'd.

Definition at line 861 of file editprop.c.

## ◆ propval_copy()

static struct propval * propval_copy | ( | struct propval * | pv | ) |

static

Return a newly allocated deep copy of the given value.

Definition at line 1041 of file editprop.c.

## ◆ propval_equal()

static bool propval_equal | ( | struct propval * | pva,
|  | struct propval * | pvb
| ) |  |

static

Returns TRUE if the two values are equal, in a deep sense.

Definition at line 1174 of file editprop.c.

## ◆ propval_free()

static void propval_free | ( | struct propval * | pv | ) |

static

Free all allocated memory used by this property value, including calling the appropriate free function on the internal data according to its type.

Definition at line 1123 of file editprop.c.

## ◆ propval_free_data()

static void propval_free_data | ( | struct propval * | pv | ) |

static

Frees the internal data held by the propval, without freeing the propval struct itself.

Definition at line 1137 of file editprop.c.

## ◆ valtype_get_name()

static const char * valtype_get_name | ( | enum value_types | valtype | ) |

static

Returns the untranslated name for the given value type.

Definition at line 778 of file editprop.c.

## ◆ vision_layer_get_name()

const char * vision_layer_get_name | ( | enum vision_layer | vl | ) |

Returns a translated string name for the given "vision layer".

Definition at line 6570 of file editprop.c.

## Variable Documentation

## ◆ the_property_editor

struct property_editor* the_property_editor

static

Definition at line 660 of file editprop.c.