diff options
author | Denis Washington <denisw@src.gnome.org> | 2011-11-15 17:56:03 +0100 |
---|---|---|
committer | Denis Washington <denisw@src.gnome.org> | 2011-12-13 07:49:03 +0100 |
commit | e015ce5bb4d422586fb8371a24db1af8e4c11441 (patch) | |
tree | eec85e950ebc5add34527f2e6f91c140605b4858 /gladeui/glade-widget-adaptor.h | |
parent | d33f042c8ad77db4da562a045977be3d2eaaf229 (diff) | |
download | glade-e015ce5bb4d422586fb8371a24db1af8e4c11441.tar.gz |
Add glade_command_set_sensitive() and port a bit of the GTK+ plugin code to it
The aim of this is to let all changes to the sensitivity of properties through
the command system so that the code in the "gbinding" branch can cleanly react
to the source or target of a property binding becoming insensitive (e.g. by
undoably removing the binding).
Diffstat (limited to 'gladeui/glade-widget-adaptor.h')
-rw-r--r-- | gladeui/glade-widget-adaptor.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/gladeui/glade-widget-adaptor.h b/gladeui/glade-widget-adaptor.h index ab33a531..a1a2a29f 100644 --- a/gladeui/glade-widget-adaptor.h +++ b/gladeui/glade-widget-adaptor.h @@ -553,6 +553,21 @@ typedef GladeEditable *(* GladeCreateEditableFunc) (GladeWidgetAdaptor *adapto GladeEditorPageType type); +/** + * GladeAdjustPropertyFlagsFunc: + * @adaptor: A #GladeWidgetAdaptor + * @widget: The #GladeWidget + * @use_command: whether to use the GladeCommand interface + * + * This is called after a widget is loaded or a widget's + * property value has changed. It allows the backend to keep the + * sensitive/enabled flags of all properties consistent with the + * property values. + */ +typedef void (* GladeAdjustPropertyFlagsFunc) (GladeWidgetAdaptor *adaptor, + GladeWidget *widget, + gboolean use_command); + /* Note that everything that must be processed at the creation of * every instance is managed on the instance structure, and everywhere * that we want to take advantage of inheritance is handled in the class @@ -659,7 +674,8 @@ struct _GladeWidgetAdaptorClass GladeCreateEPropFunc create_eprop; /* Creates a GladeEditorProperty */ GladeStringFromValueFunc string_from_value; /* Creates a string for a value */ GladeCreateEditableFunc create_editable; /* Creates a page for the editor */ - + GladeAdjustPropertyFlagsFunc adjust_property_flags; /* Appropiately sets all properties' sensitive/enabled flags */ + void (* glade_reserved1) (void); void (* glade_reserved2) (void); void (* glade_reserved3) (void); @@ -667,7 +683,6 @@ struct _GladeWidgetAdaptorClass void (* glade_reserved5) (void); void (* glade_reserved6) (void); void (* glade_reserved7) (void); - void (* glade_reserved8) (void); }; #define glade_widget_adaptor_create_widget(adaptor, query, ...) \ @@ -845,6 +860,10 @@ GladeWidgetAdaptor *glade_widget_adaptor_get_parent_adaptor (GladeWidgetAdapto gboolean glade_widget_adaptor_has_internal_children (GladeWidgetAdaptor *adaptor); +void glade_widget_adaptor_adjust_property_flags (GladeWidgetAdaptor *adaptor, + GladeWidget *widget, + gboolean use_command); + G_END_DECLS #endif /* _GLADE_WIDGET_ADAPTOR_H_ */ |