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_PLAYER_INFRAPOINTS , 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 GdkPixbufcreate_pixbuf_from_layers (const struct tile *ptile, const struct unit *punit, const struct city *pcity, enum layer_category category)
 
static GdkPixbufcreate_tile_pixbuf (const struct tile *ptile)
 
static GdkPixbufcreate_unit_pixbuf (const struct unit *punit)
 
static GdkPixbufcreate_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 charvision_layer_get_name (enum vision_layer)
 
static struct property_filterproperty_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 charobjtype_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 charvaltype_get_name (enum value_types valtype)
 
static void propval_free (struct propval *pv)
 
static void propval_free_data (struct propval *pv)
 
static struct propvalpropval_copy (struct propval *pv)
 
static bool propval_equal (struct propval *pva, struct propval *pvb)
 
static struct propstatepropstate_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 propvalpropstate_get_value (struct propstate *ps)
 
static struct objpropobjprop_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 charobjprop_get_name (const struct objprop *op)
 
static const charobjprop_get_tooltip (const struct objprop *op)
 
static enum value_types objprop_get_valtype (const struct objprop *op)
 
static struct property_pageobjprop_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 charobjprop_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 GtkTreeViewColumnobjprop_get_treeview_column (const struct objprop *op)
 
static GtkCellRendererobjprop_create_cell_renderer (const struct objprop *op)
 
static void objprop_setup_widget (struct objprop *op)
 
static GtkWidgetobjprop_get_widget (struct objprop *op)
 
static void objprop_set_child_widget (struct objprop *op, const char *widget_name, GtkWidget *widget)
 
static GtkWidgetobjprop_get_child_widget (struct objprop *op, const char *widget_name)
 
static void objprop_set_extviewer (struct objprop *op, struct extviewer *ev)
 
static struct extviewerobjprop_get_extviewer (struct objprop *op)
 
static void objprop_refresh_widget (struct objprop *op, struct objbind *ob)
 
static void objprop_widget_entry_changed (GtkEntry *entry, 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 objbindobjbind_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 propvalobjbind_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 propvalobjbind_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 GtkTreeRowReferenceobjbind_get_rowref (struct objbind *ob)
 
static struct extviewerextviewer_new (struct objprop *op)
 
static struct objpropextviewer_get_objprop (struct extviewer *ev)
 
static GtkWidgetextviewer_get_panel_widget (struct extviewer *ev)
 
static GtkWidgetextviewer_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_pageproperty_page_new (enum editor_object_type objtype, struct property_editor *parent)
 
static void property_page_setup_objprops (struct property_page *pp)
 
static const charproperty_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 objbindproperty_page_get_focused_objbind (struct property_page *pp)
 
static void property_page_set_focused_objbind (struct property_page *pp, struct objbind *ob)
 
static struct objbindproperty_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_editorproperty_editor_new (void)
 
static bool property_editor_add_page (struct property_editor *pe, enum editor_object_type objtype)
 
static struct property_pageproperty_editor_get_page (struct property_editor *pe, enum editor_object_type objtype)
 
static gcharpropval_as_string (struct propval *pv)
 
static gcharbuilt_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_editoreditprop_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_editorthe_property_editor
 

Macro Definition Documentation

◆ ADDPROP

#define ADDPROP (   ARG_id,
  ARG_name,
  ARG_tooltip,
  ARG_flags,
  ARG_valtype 
)
Value:
do { \
objprop_hash_insert(pp->objprop_table, MY_op->id, MY_op); \
} while (FALSE)
char * incite_cost
Definition comments.c:76
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:3477
#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 639 of file editprop.c.

◆ property_page_objbind_iterate_end

#define property_page_objbind_iterate_end   HASH_DATA_ITERATE_END

Definition at line 641 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 635 of file editprop.c.

◆ property_page_objprop_iterate_end

#define property_page_objprop_iterate_end   HASH_DATA_ITERATE_END

Definition at line 637 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

Enumerator
OPF_NO_FLAGS 
OPF_EDITABLE 
OPF_IN_LISTVIEW 
OPF_HAS_WIDGET 

Definition at line 384 of file editprop.c.

◆ 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_PLAYER_INFRAPOINTS 
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

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 820 of file editprop.c.

Referenced by extviewer_new().

◆ 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 981 of file editprop.c.

Referenced by extviewer_refresh_widgets(), and extviewer_view_cell_toggled().

◆ 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 1002 of file editprop.c.

Referenced by property_page_create_objects().

◆ 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 5126 of file editprop.c.

Referenced by objbind_get_value_from_object().

◆ 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 5140 of file editprop.c.

Referenced by create_city_pixbuf(), create_tile_pixbuf(), and create_unit_pixbuf().

◆ 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 5102 of file editprop.c.

Referenced by objbind_get_value_from_object().

◆ 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 5114 of file editprop.c.

Referenced by objbind_get_value_from_object().

◆ editprop_get_property_editor()

struct property_editor * editprop_get_property_editor ( void  )

◆ extviewer_clear_widgets()

static void extviewer_clear_widgets ( struct extviewer ev)
static

Clear the display widgets.

Definition at line 4091 of file editprop.c.

Referenced by objprop_refresh_widget().

◆ 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 3786 of file editprop.c.

Referenced by extviewer_clear_widgets(), extviewer_panel_button_clicked(), extviewer_refresh_widgets(), extviewer_textbuf_changed(), and extviewer_view_cell_toggled().

◆ 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 3798 of file editprop.c.

Referenced by objprop_setup_widget().

◆ 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 3810 of file editprop.c.

Referenced by property_page_add_extviewer(), and property_page_show_extviewer().

◆ 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 3502 of file editprop.c.

Referenced by objprop_setup_widget().

◆ 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 4146 of file editprop.c.

Referenced by extviewer_new().

◆ 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 3821 of file editprop.c.

Referenced by objprop_refresh_widget().

◆ 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 4387 of file editprop.c.

Referenced by extviewer_clear_widgets(), extviewer_new(), and extviewer_refresh_widgets().

◆ 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 4166 of file editprop.c.

Referenced by extviewer_new().

◆ get_next_unique_tag()

static int get_next_unique_tag ( void  )
static

Return the next tag number in the sequence.

Definition at line 1035 of file editprop.c.

Referenced by property_page_create_objects().

◆ 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 2225 of file editprop.c.

Referenced by property_page_add_objbind().

◆ 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 2116 of file editprop.c.

Referenced by property_page_reset_objbinds().

◆ 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 2071 of file editprop.c.

Referenced by objbind_set_modified_value(), and objprop_refresh_widget().

◆ 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 2195 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 1884 of file editprop.c.

Referenced by objprop_refresh_widget().

◆ 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 2176 of file editprop.c.

Referenced by objbind_pack_modified_value(), and objprop_refresh_widget().

◆ objbind_get_object()

static gpointer objbind_get_object ( struct objbind ob)
static

◆ 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 1382 of file editprop.c.

Referenced by objbind_get_object(), and objbind_request_destroy_object().

◆ objbind_get_objtype()

static enum editor_object_type objbind_get_objtype ( const struct objbind ob)
static

◆ 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 2666 of file editprop.c.

Referenced by property_page_fill_widgets(), and property_page_object_changed().

◆ 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 1443 of file editprop.c.

Referenced by objbind_set_modified_value(), objprop_refresh_widget(), and property_page_set_store_value().

◆ 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 2104 of file editprop.c.

Referenced by property_page_send_values().

◆ 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 1340 of file editprop.c.

Referenced by property_page_add_objbind().

◆ 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 2239 of file editprop.c.

Referenced by property_page_send_values().

◆ 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 2382 of file editprop.c.

Referenced by property_page_send_values().

◆ 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 2085 of file editprop.c.

Referenced by objbind_pack_modified_value(), and objprop_refresh_widget().

◆ 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 1395 of file editprop.c.

Referenced by property_page_destroy_objects().

◆ 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 2130 of file editprop.c.

Referenced by property_page_change_value().

◆ 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 2654 of file editprop.c.

Referenced by property_page_fill_widgets().

◆ 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 2858 of file editprop.c.

Referenced by property_page_new().

◆ 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 2761 of file editprop.c.

Referenced by property_page_new().

◆ 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 3410 of file editprop.c.

Referenced by objprop_refresh_widget().

◆ 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 2799 of file editprop.c.

Referenced by property_page_new(), and property_page_set_store_value().

◆ 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 3455 of file editprop.c.

Referenced by objprop_refresh_widget().

◆ 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 2692 of file editprop.c.

Referenced by objprop_create_cell_renderer(), objprop_get_attribute_type_string(), objprop_is_sortable(), and property_page_new().

◆ objprop_get_id()

static int objprop_get_id ( const struct objprop op)
static

◆ objprop_get_name()

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

◆ objprop_get_property_page()

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

◆ objprop_get_tooltip()

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

Return a description (translated) of the property.

Definition at line 2845 of file editprop.c.

Referenced by property_page_new().

◆ 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 2823 of file editprop.c.

Referenced by property_page_quick_find_entry_changed().

◆ 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 2725 of file editprop.c.

Referenced by objbind_get_value_from_object(), and property_page_set_store_value().

◆ 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 3368 of file editprop.c.

Referenced by objprop_get_child_widget(), objprop_refresh_widget(), objprop_set_child_widget(), property_page_new(), and property_page_quick_find_entry_changed().

◆ 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 2747 of file editprop.c.

Referenced by objprop_refresh_widget(), objprop_setup_widget(), property_page_new(), and property_page_quick_find_entry_changed().

◆ 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 2893 of file editprop.c.

Referenced by extviewer_new(), objbind_pack_modified_value(), objbind_property_is_modified(), property_page_change_value(), and property_page_send_values().

◆ 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 2879 of file editprop.c.

Referenced by property_page_new().

◆ 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 3477 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 3132 of file editprop.c.

Referenced by property_page_change_value(), property_page_fill_widgets(), property_page_object_changed(), property_page_reset_objbinds(), and property_page_selection_changed().

◆ 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 3383 of file editprop.c.

Referenced by objprop_setup_widget().

◆ 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 2786 of file editprop.c.

Referenced by property_page_new().

◆ 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 3443 of file editprop.c.

Referenced by objprop_setup_widget().

◆ 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 2810 of file editprop.c.

Referenced by property_page_new().

◆ 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 2954 of file editprop.c.

Referenced by objprop_get_widget().

◆ 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 2736 of file editprop.c.

Referenced by property_page_new(), property_page_quick_find_entry_changed(), and property_page_set_store_value().

◆ objprop_widget_entry_changed()

static void objprop_widget_entry_changed ( GtkEntry entry,
gpointer  userdata 
)
static

Callback for entry widget 'changed' signal.

Definition at line 2904 of file editprop.c.

Referenced by objprop_setup_widget().

◆ 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 2920 of file editprop.c.

Referenced by objprop_refresh_widget(), and objprop_setup_widget().

◆ 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 2937 of file editprop.c.

Referenced by objprop_refresh_widget(), and objprop_setup_widget().

◆ 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 696 of file editprop.c.

Referenced by objbind_new(), and property_page_add_objbind().

◆ objtype_get_name()

static const char * objtype_get_name ( enum editor_object_type  objtype)
static

◆ 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 725 of file editprop.c.

Referenced by objbind_get_object(), and property_page_object_created().

◆ 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 756 of file editprop.c.

Referenced by objbind_request_destroy_object(), property_editor_handle_object_created(), property_page_create_objects(), and property_page_new().

◆ 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 6155 of file editprop.c.

Referenced by property_editor_new().

◆ property_editor_clear()

void property_editor_clear ( struct property_editor pe)

Clear all property pages in the given property editor.

Definition at line 6362 of file editprop.c.

Referenced by editgui_popdown_all(), editgui_popup_properties(), and editgui_refresh().

◆ property_editor_get_page()

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

◆ 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 6322 of file editprop.c.

Referenced by editgui_notify_object_changed().

◆ 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 6344 of file editprop.c.

Referenced by editgui_notify_object_created().

◆ 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 6256 of file editprop.c.

Referenced by editgui_popup_properties().

◆ property_editor_new()

static struct property_editor * property_editor_new ( void  )
static

Create and return the property editor widget bundle.

Definition at line 6202 of file editprop.c.

Referenced by editprop_get_property_editor().

◆ property_editor_popdown()

void property_editor_popdown ( struct property_editor pe)

Hide the property editor window.

Definition at line 6310 of file editprop.c.

Referenced by editgui_popdown_all(), editgui_refresh(), and popdown_all_game_dialogs().

◆ 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 6292 of file editprop.c.

Referenced by editbar_player_properties_button_clicked(), editgui_popup_properties(), scenario_properties_callback(), and scenario_properties_callback().

◆ 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 6382 of file editprop.c.

Referenced by editbar_player_properties_button_clicked(), editgui_popup_properties(), scenario_properties_callback(), and scenario_properties_callback().

◆ property_filter_free()

static void property_filter_free ( struct property_filter pf)
static

Frees all memory used by the property filter.

Definition at line 6558 of file editprop.c.

Referenced by property_page_quick_find_entry_changed().

◆ 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 6504 of file editprop.c.

Referenced by property_page_quick_find_entry_changed().

◆ 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 preceded 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 6430 of file editprop.c.

Referenced by property_page_quick_find_entry_changed().

◆ 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 5987 of file editprop.c.

Referenced by objprop_setup_widget().

◆ 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 5197 of file editprop.c.

Referenced by property_editor_reload(), property_page_add_objbinds_from_tile(), and property_page_object_created().

◆ 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 5233 of file editprop.c.

Referenced by property_page_load_tiles().

◆ 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 6095 of file editprop.c.

Referenced by property_page_new().

◆ 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 5507 of file editprop.c.

Referenced by extviewer_textbuf_changed(), extviewer_view_cell_toggled(), objprop_widget_entry_changed(), objprop_widget_spin_button_changed(), objprop_widget_text_changed(), and objprop_widget_toggle_button_changed().

◆ 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 5182 of file editprop.c.

Referenced by property_editor_clear(), and property_editor_reload().

◆ 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 6084 of file editprop.c.

Referenced by property_editor_clear().

◆ 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 6116 of file editprop.c.

Referenced by property_page_new().

◆ 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 5785 of file editprop.c.

Referenced by property_page_create_button_clicked().

◆ 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 6144 of file editprop.c.

Referenced by property_page_new().

◆ 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 5746 of file editprop.c.

Referenced by property_page_destroy_button_clicked().

◆ 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 5387 of file editprop.c.

Referenced by property_editor_reload(), property_page_load_tiles(), and property_page_object_created().

◆ 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 5685 of file editprop.c.

Referenced by property_page_send_values().

◆ 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 5436 of file editprop.c.

Referenced by property_page_change_value(), property_page_fill_widgets(), property_page_object_changed(), property_page_reset_objbinds(), property_page_selection_changed(), and property_page_selection_func().

◆ 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 5074 of file editprop.c.

Referenced by property_editor_add_page(), and property_page_store_creation_tag().

◆ 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 5495 of file editprop.c.

Referenced by property_editor_load_tiles().

◆ 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 5461 of file editprop.c.

Referenced by property_page_object_changed().

◆ property_page_get_objtype()

static enum editor_object_type property_page_get_objtype ( const struct property_page pp)
static

◆ 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 5478 of file editprop.c.

Referenced by property_editor_load_tiles().

◆ 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 4768 of file editprop.c.

Referenced by property_editor_add_page().

◆ 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 5603 of file editprop.c.

Referenced by property_page_send_values().

◆ 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 5909 of file editprop.c.

Referenced by property_editor_handle_object_changed().

◆ 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 5961 of file editprop.c.

Referenced by property_editor_handle_object_created().

◆ 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 4726 of file editprop.c.

Referenced by property_page_new().

◆ 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 6106 of file editprop.c.

Referenced by property_page_new().

◆ 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 6054 of file editprop.c.

Referenced by property_page_object_created().

◆ 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 5705 of file editprop.c.

Referenced by property_page_refresh_button_clicked().

◆ 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 4646 of file editprop.c.

Referenced by property_page_new().

◆ 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 4671 of file editprop.c.

Referenced by property_page_new().

◆ 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 5644 of file editprop.c.

Referenced by property_page_send_values().

◆ 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 5549 of file editprop.c.

Referenced by property_page_apply_button_clicked().

◆ 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 5448 of file editprop.c.

Referenced by property_page_clear_objbinds(), property_page_selection_changed(), and property_page_selection_func().

◆ 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 5287 of file editprop.c.

Referenced by property_page_fill_widgets(), property_page_object_changed(), and property_page_reset_objbinds().

◆ 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 4436 of file editprop.c.

Referenced by property_page_new().

◆ 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 6007 of file editprop.c.

Referenced by extviewer_panel_button_clicked().

◆ 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 6032 of file editprop.c.

Referenced by property_page_create_objects().

◆ 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 6073 of file editprop.c.

Referenced by property_page_object_created().

◆ propstate_clear_value()

static void propstate_clear_value ( struct propstate ps)
static

Removes the stored value, freeing it if needed.

Definition at line 1285 of file editprop.c.

Referenced by propstate_destroy(), and propstate_set_value().

◆ propstate_destroy()

static void propstate_destroy ( struct propstate ps)
static

Free a property state and any associated resources.

Definition at line 1298 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 1328 of file editprop.c.

Referenced by objbind_get_modified_value().

◆ 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 1266 of file editprop.c.

Referenced by objbind_set_modified_value().

◆ 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 1313 of file editprop.c.

Referenced by objbind_set_modified_value().

◆ 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 862 of file editprop.c.

Referenced by extviewer_refresh_widgets(), extviewer_textbuf_changed(), extviewer_view_cell_toggled(), and property_page_set_store_value().

◆ propval_copy()

static struct propval * propval_copy ( struct propval pv)
static

Return a newly allocated deep copy of the given value.

Definition at line 1046 of file editprop.c.

Referenced by extviewer_refresh_widgets(), and objbind_set_modified_value().

◆ 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 1179 of file editprop.c.

Referenced by extviewer_refresh_widgets(), objbind_set_modified_value(), and objprop_refresh_widget().

◆ 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 1128 of file editprop.c.

Referenced by extviewer_clear_widgets(), extviewer_refresh_widgets(), objbind_set_modified_value(), objprop_refresh_widget(), property_page_set_store_value(), and propstate_clear_value().

◆ 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 1142 of file editprop.c.

Referenced by propval_free().

◆ 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 779 of file editprop.c.

Referenced by propval_free_data().

◆ 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 6586 of file editprop.c.

Referenced by extviewer_new().

Variable Documentation

◆ the_property_editor

struct property_editor* the_property_editor
static

Definition at line 661 of file editprop.c.

Referenced by editprop_get_property_editor().