Freeciv-3.1
|
#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 "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 |
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_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 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 |
#define ADDPROP | ( | ARG_id, | |
ARG_name, | |||
ARG_tooltip, | |||
ARG_flags, | |||
ARG_valtype | |||
) |
#define PF_CONJUNCTION_SEPARATOR "&" |
Definition at line 119 of file editprop.c.
#define PF_DISJUNCTION_SEPARATOR "|" |
Definition at line 118 of file editprop.c.
#define PF_MAX_CLAUSES 16 |
Definition at line 117 of file editprop.c.
#define property_page_objbind_iterate | ( | ARG_pp, | |
NAME_ob | |||
) | TYPED_HASH_DATA_ITERATE(struct objbind *, (ARG_pp)->objbind_table, NAME_ob) |
Definition at line 636 of file editprop.c.
#define property_page_objbind_iterate_end HASH_DATA_ITERATE_END |
Definition at line 638 of file editprop.c.
#define property_page_objprop_iterate | ( | ARG_pp, | |
NAME_op | |||
) | TYPED_HASH_DATA_ITERATE(struct objprop *, (ARG_pp)->objprop_table, NAME_op) |
Definition at line 632 of file editprop.c.
#define property_page_objprop_iterate_end HASH_DATA_ITERATE_END |
Definition at line 634 of file editprop.c.
#define SPECHASH_IDATA_FREE propstate_destroy |
Definition at line 269 of file editprop.c.
#define SPECHASH_IDATA_FREE objbind_destroy |
Definition at line 269 of file editprop.c.
#define SPECHASH_IDATA_TYPE struct propstate * |
Definition at line 268 of file editprop.c.
#define SPECHASH_IDATA_TYPE struct objprop * |
Definition at line 268 of file editprop.c.
#define SPECHASH_IDATA_TYPE struct objbind * |
Definition at line 268 of file editprop.c.
#define SPECHASH_INT_DATA_TYPE |
Definition at line 90 of file editprop.c.
#define SPECHASH_INT_KEY_TYPE |
Definition at line 89 of file editprop.c.
#define SPECHASH_INT_KEY_TYPE |
Definition at line 89 of file editprop.c.
#define SPECHASH_INT_KEY_TYPE |
Definition at line 89 of file editprop.c.
#define SPECHASH_INT_KEY_TYPE |
Definition at line 89 of file editprop.c.
#define SPECHASH_TAG stored_tag |
Definition at line 88 of file editprop.c.
#define SPECHASH_TAG propstate |
Definition at line 88 of file editprop.c.
#define SPECHASH_TAG objprop |
Definition at line 88 of file editprop.c.
#define SPECHASH_TAG objbind |
Definition at line 88 of file editprop.c.
Enumerator | |
---|---|
OPF_NO_FLAGS | |
OPF_EDITABLE | |
OPF_IN_LISTVIEW | |
OPF_HAS_WIDGET |
Definition at line 381 of file editprop.c.
enum object_property_ids |
Definition at line 304 of file editprop.c.
enum value_types |
Definition at line 196 of file editprop.c.
|
static |
Convenience function to add a column to a GtkTreeView. Used for the view widget creation in extviewer_new().
Definition at line 817 of file editprop.c.
|
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 978 of file editprop.c.
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 999 of file editprop.c.
|
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 5087 of file editprop.c.
|
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 5101 of file editprop.c.
|
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 5063 of file editprop.c.
|
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 5075 of file editprop.c.
struct property_editor * editprop_get_property_editor | ( | void | ) |
Get the property editor for the client's GUI.
Definition at line 6206 of file editprop.c.
|
static |
Clear the display widgets.
Definition at line 4059 of file editprop.c.
Returns the object property that is displayed by this extviewer.
Definition at line 3754 of file editprop.c.
|
static |
Returns the "panel widget" for this extviewer, i.e. the widget the is to be placed into the properties panel.
Definition at line 3766 of file editprop.c.
|
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 3778 of file editprop.c.
Create "extended property viewer". This is used for viewing/editing complex property values (e.g. arrays, bitvectors, etc.).
Definition at line 3470 of file editprop.c.
|
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 4114 of file editprop.c.
Set the widgets in the extended property viewer to display the given value.
Definition at line 3789 of file editprop.c.
|
static |
Handle a change in the extviewer's text buffer.
Definition at line 4355 of file editprop.c.
|
static |
Handle toggling of a boolean cell value in the extviewer's tree view.
Definition at line 4134 of file editprop.c.
|
static |
Return the next tag number in the sequence.
Definition at line 1031 of file editprop.c.
|
static |
Bind the object in the given objbind to the properties in the page.
Definition at line 2203 of file editprop.c.
|
static |
Deletes all stored modified property values.
Definition at line 2094 of file editprop.c.
Remove a stored modified value, if it exists.
Definition at line 2049 of file editprop.c.
|
static |
Destroy the object bind and free any resources it might have been using.
Definition at line 2173 of file editprop.c.
|
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 1874 of file editprop.c.
|
static |
Retrieve the stored property value for the bound object, or NULL if none exists.
NB: Does NOT return a copy.
Definition at line 2154 of file editprop.c.
|
static |
Returns the bound object, if it still "exists". Returns NULL on error.
Definition at line 1362 of file editprop.c.
|
static |
Returns the ID of the bound object, or -1 if invalid.
Definition at line 1378 of file editprop.c.
|
static |
Returns the object type of the bound object.
Definition at line 2192 of file editprop.c.
|
static |
Returns the row reference of this objbind, or NULL if not applicable.
Definition at line 2638 of file editprop.c.
|
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.
Returns TRUE if there are any stored modified values of any of the properties of the bound object.
Definition at line 2082 of file editprop.c.
|
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.
|
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 2217 of file editprop.c.
|
static |
Package the modified property value into the supplied packet.
Definition at line 2360 of file editprop.c.
Returns TRUE if a stored modified property value exists for this bound object for the given property.
Definition at line 2063 of file editprop.c.
|
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.
|
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 2108 of file editprop.c.
|
static |
Sets the row reference in a GtkTreeModel of this objbind.
Definition at line 2626 of file editprop.c.
|
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 2830 of file editprop.c.
|
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 2733 of file editprop.c.
|
static |
Retrieves the widget stored under the given name, or returns NULL and logs an error message if not found.
Definition at line 3378 of file editprop.c.
|
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 2771 of file editprop.c.
Return the stored extviewer, or NULL if none exists.
Definition at line 3423 of file editprop.c.
|
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 2664 of file editprop.c.
|
static |
Returns the unique property identifier for this object property.
Definition at line 2649 of file editprop.c.
|
static |
Returns the string name of this object property.
Definition at line 2806 of file editprop.c.
|
static |
Get the property page in which this property is installed.
Definition at line 3434 of file editprop.c.
|
static |
Return a description (translated) of the property.
Definition at line 2817 of file editprop.c.
|
static |
Returns the previously stored tree view column reference, or NULL if none exists.
Definition at line 2795 of file editprop.c.
|
static |
Returns the value type of this property value (one of enum value_types).
Definition at line 2697 of file editprop.c.
|
static |
Returns the gtk widget used to display or edit this property, or NULL if not applicable.
Definition at line 3336 of file editprop.c.
Returns TRUE if this object property can create and use a property widget.
Definition at line 2719 of file editprop.c.
Return TRUE if the given object property cannot be edited (i.e. it is displayed information only).
Definition at line 2865 of file editprop.c.
Return TRUE if the given object property can be sorted (i.e. in the list view).
Definition at line 2851 of file editprop.c.
|
static |
Create a new object property.
Definition at line 3445 of file editprop.c.
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 3102 of file editprop.c.
|
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 3351 of file editprop.c.
|
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 2758 of file editprop.c.
Store the extviewer struct for later retrieval.
Definition at line 3411 of file editprop.c.
|
static |
Sets the view column reference for later convenience.
Definition at line 2782 of file editprop.c.
|
static |
Create the gtk widget used to edit or display this object property.
Definition at line 2926 of file editprop.c.
Returns TRUE if this object property can be viewed in a GtkTreeView.
Definition at line 2708 of file editprop.c.
|
static |
Callback for entry widget 'changed' signal.
Definition at line 2876 of file editprop.c.
|
static |
Callback for spin button widget 'value-changed' signal.
Definition at line 2892 of file editprop.c.
|
static |
Callback for toggle type button widget 'toggled' signal.
Definition at line 2909 of file editprop.c.
|
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 693 of file editprop.c.
|
static |
Returns the translated name for the given object type.
Definition at line 664 of file editprop.c.
|
static |
Get the object of type 'objtype' uniquely identified by 'id'.
Definition at line 722 of file editprop.c.
|
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 753 of file editprop.c.
|
static |
Create and add a property page for the given object type to the property editor. Returns TRUE if successful.
Definition at line 6116 of file editprop.c.
void property_editor_clear | ( | struct property_editor * | pe | ) |
Clear all property pages in the given property editor.
Definition at line 6323 of file editprop.c.
|
static |
Returns the property page for the given object type.
Definition at line 6150 of file editprop.c.
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 6283 of file editprop.c.
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 6305 of file editprop.c.
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 6217 of file editprop.c.
|
static |
Create and return the property editor widget bundle.
Definition at line 6163 of file editprop.c.
void property_editor_popdown | ( | struct property_editor * | pe | ) |
Hide the property editor window.
Definition at line 6271 of file editprop.c.
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 6253 of file editprop.c.
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 6343 of file editprop.c.
|
static |
Frees all memory used by the property filter.
Definition at line 6519 of file editprop.c.
|
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 6465 of file editprop.c.
|
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 6391 of file editprop.c.
|
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 5948 of file editprop.c.
|
static |
Create a new object bind to the given object and register it with the given property page.
Definition at line 5158 of file editprop.c.
|
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 5194 of file editprop.c.
|
static |
Handles the 'clicked' signal for the "Apply" button in the property page.
Definition at line 6056 of file editprop.c.
|
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 5468 of file editprop.c.
|
static |
Remove all object binds (i.e. objects listed) in the property page.
Definition at line 5143 of file editprop.c.
|
static |
Remove all tags in the tag table.
Definition at line 6045 of file editprop.c.
|
static |
Handle a request to create a new object in the property page.
Definition at line 6077 of file editprop.c.
|
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 5746 of file editprop.c.
|
static |
Handle a click on the "destroy" button.
Definition at line 6105 of file editprop.c.
|
static |
Destroy all selected objects in the current property page.
Definition at line 5707 of file editprop.c.
|
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 5348 of file editprop.c.
|
static |
Free any resources being used by the packet.
Definition at line 5646 of file editprop.c.
|
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 5397 of file editprop.c.
|
static |
Returns the translated name of the property page's object type.
Definition at line 5035 of file editprop.c.
|
static |
Return the number of current bound objects to this property page.
Definition at line 5456 of file editprop.c.
|
static |
Returns the objbind whose object corresponds to the given id, or NULL if no such objbind exists.
Definition at line 5422 of file editprop.c.
|
static |
Returns the object type for this property page, or -1 if none.
Definition at line 5047 of file editprop.c.
|
static |
Removes all of the current objbinds and extracts new ones from the supplied list of tiles.
Definition at line 5439 of file editprop.c.
|
static |
Create and return a property page of the given object type. Returns NULL if the page could not be created.
Definition at line 4729 of file editprop.c.
|
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 5564 of file editprop.c.
|
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 5870 of file editprop.c.
|
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 5922 of file editprop.c.
|
static |
Callback to handle text changing in the quick find entry widget.
Definition at line 4687 of file editprop.c.
|
static |
Handles the 'clicked' signal for the "Refresh" button in the property page.
Definition at line 6067 of file editprop.c.
|
static |
Decrease the tag count and remove the object creation tag if it is no longer needed.
Definition at line 6015 of file editprop.c.
|
static |
Reload the displayed values of all properties for the selected bound objects. Hence, deletes all their stored modified values.
Definition at line 5666 of file editprop.c.
|
static |
Callback for when a property page's listview's selection changes.
Definition at line 4607 of file editprop.c.
|
static |
Monitor which rows are to be selected, so we know which objbind to display in the properties panel.
Definition at line 4632 of file editprop.c.
|
static |
Sends the given packet.
Definition at line 5605 of file editprop.c.
|
static |
Send all modified values of all selected properties.
Definition at line 5510 of file editprop.c.
|
static |
Set the objbind that should be shown in the properties panel. Does not refresh property widgets.
Definition at line 5409 of file editprop.c.
|
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 5248 of file editprop.c.
|
static |
Install all object properties that this page type can view/edit.
Definition at line 4404 of file editprop.c.
|
static |
Make the given extended property viewer's view widget visible in the property page.
Definition at line 5968 of file editprop.c.
|
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 5993 of file editprop.c.
|
static |
Check if the given tag is one that we previously stored.
Definition at line 6034 of file editprop.c.
|
static |
Removes the stored value, freeing it if needed.
Definition at line 1281 of file editprop.c.
|
static |
Free a property state and any associated resources.
Definition at line 1294 of file editprop.c.
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.
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.
|
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 859 of file editprop.c.
Return a newly allocated deep copy of the given value.
Definition at line 1042 of file editprop.c.
Returns TRUE if the two values are equal, in a deep sense.
Definition at line 1175 of file editprop.c.
|
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 1124 of file editprop.c.
|
static |
Frees the internal data held by the propval, without freeing the propval struct itself.
Definition at line 1138 of file editprop.c.
|
static |
Returns the untranslated name for the given value type.
Definition at line 776 of file editprop.c.
const char * vision_layer_get_name | ( | enum vision_layer | vl | ) |
Returns a translated string name for the given "vision layer".
Definition at line 6547 of file editprop.c.
|
static |
Definition at line 658 of file editprop.c.