Commit e4b45016 authored by Tristan Van Berkom's avatar Tristan Van Berkom

* Made GladeProperty internalize *everything* into a private data structure,

	17 files changed, 766 insertions(+), 592 deletions(-)
parent d324ec80
......@@ -27,6 +27,9 @@
* gladeui/glade-clipboard.h, gladeui/glade-app.c: Removed clipboard->view member and
make GladeApp properly destroy the clipboard when disposing.
* Made GladeProperty internalize *everything* into a private data structure,
17 files changed, 766 insertions(+), 592 deletions(-)
2010-12-31 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-project.c: Further fixing project dispose cycle, still leaking a little
......
......@@ -1365,11 +1365,10 @@ glade_base_editor_change_type (GladeBaseEditor * editor,
l = glade_widget_get_packing_properties (gchild);
while (l)
{
GladeProperty *orig_prop = (GladeProperty *) l->data;
GladeProperty *dup_prop = glade_widget_get_property (gchild_new,
orig_prop->klass->
id);
glade_property_set_value (dup_prop, orig_prop->value);
GladeProperty *orig_prop = (GladeProperty *) l->data;
GladePropertyClass *pclass = glade_property_get_class (orig_prop);
GladeProperty *dup_prop = glade_widget_get_property (gchild_new, pclass->id);
glade_property_set_value (dup_prop, glade_property_inline_value (orig_prop));
l = g_list_next (l);
}
......
......@@ -361,8 +361,10 @@ glade_command_set_property_execute (GladeCommand * cmd)
for (l = me->sdata; l; l = l->next)
{
GValue new_value = { 0, };
GCSetPropData *sdata = l->data;
GValue new_value = { 0, };
GCSetPropData *sdata = l->data;
GladePropertyClass *pclass = glade_property_get_class (sdata->property);
GladeWidget *widget = glade_property_get_widget (sdata->property);
g_value_init (&new_value, G_VALUE_TYPE (sdata->new_value));
......@@ -375,12 +377,11 @@ glade_command_set_property_execute (GladeCommand * cmd)
{
gchar *str =
glade_widget_adaptor_string_from_value
(GLADE_WIDGET_ADAPTOR (sdata->property->klass->handle),
sdata->property->klass, &new_value);
(GLADE_WIDGET_ADAPTOR (pclass->handle), pclass, &new_value);
g_print ("Setting %s property of %s to %s (sumode: %d)\n",
sdata->property->klass->id,
sdata->property->widget->name,
pclass->id,
glade_widget_get_name (widget),
str, glade_property_superuser ());
g_free (str);
......@@ -390,37 +391,32 @@ glade_command_set_property_execute (GladeCommand * cmd)
/* Packing properties need to be refreshed here since
* they are reset when they get added to containers.
*/
if (sdata->property->klass->packing)
if (pclass->packing)
{
GladeProperty *tmp_prop;
tmp_prop = glade_widget_get_pack_property
(sdata->property->widget, sdata->property->klass->id);
tmp_prop = glade_widget_get_pack_property (widget, pclass->id);
if (sdata->property != tmp_prop)
{
g_object_unref (sdata->property);
sdata->property = g_object_ref (tmp_prop);
}
}
success = glade_property_set_value (sdata->property, &new_value);
retval = retval || success;
retval = retval || success;
if (!me->set_once && success)
{
/* If some verify functions didnt pass on
* the first go.. we need to record the actual
* properties here.
* properties here. XXX should be able to use glade_property_get_value() here
*/
g_value_copy (sdata->property->value, sdata->new_value);
g_value_copy (glade_property_inline_value (sdata->property), sdata->new_value);
}
g_value_unset (&new_value);
}
if (me->set_once != FALSE)
......@@ -466,7 +462,9 @@ glade_command_set_property_unifies (GladeCommand * this_cmd,
GladeCommand * other_cmd)
{
GladeCommandSetProperty *cmd1, *cmd2;
GladePropertyClass *pclass1, *pclass2;
GCSetPropData *pdata1, *pdata2;
GladeWidget *widget1, *widget2;
GList *list, *l;
if (!other_cmd)
......@@ -477,9 +475,10 @@ glade_command_set_property_unifies (GladeCommand * this_cmd,
for (list = cmd1->sdata; list; list = list->next)
{
pdata1 = list->data;
pdata1 = list->data;
pclass1 = glade_property_get_class (pdata1->property);
if (glade_property_class_compare (pdata1->property->klass,
if (glade_property_class_compare (pclass1,
pdata1->old_value,
pdata1->new_value))
return FALSE;
......@@ -501,14 +500,18 @@ glade_command_set_property_unifies (GladeCommand * this_cmd,
for (list = cmd1->sdata; list; list = list->next)
{
pdata1 = list->data;
pdata1 = list->data;
pclass1 = glade_property_get_class (pdata1->property);
widget1 = glade_property_get_widget (pdata1->property);
for (l = cmd2->sdata; l; l = l->next)
{
pdata2 = l->data;
pdata2 = l->data;
pclass2 = glade_property_get_class (pdata2->property);
widget2 = glade_property_get_widget (pdata2->property);
if (pdata1->property->widget == pdata2->property->widget &&
glade_property_class_match (pdata1->property->klass,
pdata2->property->klass))
if (widget1 == widget2 &&
glade_property_class_match (pclass1, pclass2))
break;
}
......@@ -517,7 +520,6 @@ glade_command_set_property_unifies (GladeCommand * this_cmd,
*/
if (l == NULL)
return FALSE;
}
return TRUE;
......@@ -531,6 +533,7 @@ glade_command_set_property_collapse (GladeCommand * this_cmd,
{
GladeCommandSetProperty *cmd1, *cmd2;
GCSetPropData *pdata1, *pdata2;
GladePropertyClass *pclass1, *pclass2;
GList *list, *l;
g_return_if_fail (GLADE_IS_COMMAND_SET_PROPERTY (this_cmd) &&
......@@ -542,13 +545,15 @@ glade_command_set_property_collapse (GladeCommand * this_cmd,
for (list = cmd1->sdata; list; list = list->next)
{
pdata1 = list->data;
pdata1 = list->data;
pclass1 = glade_property_get_class (pdata1->property);
for (l = cmd2->sdata; l; l = l->next)
{
pdata2 = l->data;
pdata2 = l->data;
pclass2 = glade_property_get_class (pdata2->property);
if (glade_property_class_match (pdata1->property->klass,
pdata2->property->klass))
if (glade_property_class_match (pclass1, pclass2))
{
/* Merge the GCSetPropData structs manually here
*/
......@@ -575,6 +580,8 @@ glade_command_set_property_description (GladeCommandSetProperty * me)
GCSetPropData *sdata;
gchar *description = NULL;
gchar *value_name;
GladePropertyClass *pclass;
GladeWidget *widget;
g_assert (me->sdata);
......@@ -582,23 +589,24 @@ glade_command_set_property_description (GladeCommandSetProperty * me)
description = g_strdup_printf (_("Setting multiple properties"));
else
{
sdata = me->sdata->data;
pclass = glade_property_get_class (sdata->property);
widget = glade_property_get_widget (sdata->property);
sdata = me->sdata->data;
value_name = glade_widget_adaptor_string_from_value
(GLADE_WIDGET_ADAPTOR (sdata->property->klass->handle),
sdata->property->klass, sdata->new_value);
(GLADE_WIDGET_ADAPTOR (pclass->handle), pclass, sdata->new_value);
if (!value_name || strlen (value_name) > MAX_UNDO_MENU_ITEM_VALUE_LEN
|| strchr (value_name, '_'))
{
description = g_strdup_printf (_("Setting %s of %s"),
sdata->property->klass->name,
glade_widget_get_name (sdata->property->widget));
pclass->name,
glade_widget_get_name (widget));
}
else
{
description = g_strdup_printf (_("Setting %s of %s to %s"),
sdata->property->klass->name,
glade_widget_get_name (sdata->property->widget),
pclass->name,
glade_widget_get_name (widget),
value_name);
}
g_free (value_name);
......@@ -662,6 +670,8 @@ glade_command_set_properties (GladeProperty * property,
{
GCSetPropData *sdata;
GladeProperty *prop;
GladeWidget *widget;
GladeProject *project;
GValue *ovalue, *nvalue;
GList *list = NULL;
va_list vl;
......@@ -701,7 +711,9 @@ glade_command_set_properties (GladeProperty * property,
}
va_end (vl);
glade_command_set_properties_list (glade_widget_get_project (property->widget), list);
widget = glade_property_get_widget (property);
project = glade_widget_get_project (widget);
glade_command_set_properties_list (project, list);
}
void
......@@ -714,7 +726,7 @@ glade_command_set_property_value (GladeProperty * property,
if (glade_property_equals_value (property, pvalue))
return;
glade_command_set_properties (property, property->value, pvalue, NULL);
glade_command_set_properties (property, glade_property_inline_value (property), pvalue, NULL);
}
void
......@@ -726,7 +738,7 @@ glade_command_set_property (GladeProperty * property, ...)
g_return_if_fail (GLADE_IS_PROPERTY (property));
va_start (args, property);
value = glade_property_class_make_gvalue_from_vl (property->klass, args);
value = glade_property_class_make_gvalue_from_vl (glade_property_get_class (property), args);
va_end (args);
glade_command_set_property_value (property, value);
......@@ -1241,12 +1253,13 @@ glade_command_transfer_props (GladeWidget * gnew, GList * saved_props)
for (l = saved_props; l; l = l->next)
{
GladeProperty *prop, *sprop = l->data;
GladePropertyClass *pclass = glade_property_get_class (sprop);
prop = glade_widget_get_pack_property (gnew, sprop->klass->id);
prop = glade_widget_get_pack_property (gnew, pclass->id);
if (prop && sprop->klass->transfer_on_paste &&
glade_property_class_match (prop->klass, sprop->klass))
glade_property_set_value (prop, sprop->value);
if (prop && pclass->transfer_on_paste &&
glade_property_class_match (glade_property_get_class (prop), pclass))
glade_property_set_value (prop, glade_property_inline_value (sprop));
}
}
......@@ -1327,11 +1340,11 @@ glade_command_add_execute (GladeCommandAddRemove * me)
/* Now that we've added, apply any packing props if nescisary. */
for (l = cdata->pack_props; l; l = l->next)
{
GValue value = { 0, };
GladeProperty *saved_prop = l->data;
GladeProperty *widget_prop =
glade_widget_get_pack_property (cdata->widget,
saved_prop->klass->id);
GValue value = { 0, };
GladeProperty *saved_prop = l->data;
GladePropertyClass *pclass = glade_property_get_class (saved_prop);
GladeProperty *widget_prop =
glade_widget_get_pack_property (cdata->widget, pclass->id);
glade_property_get_value (saved_prop, &value);
glade_property_set_value (widget_prop, &value);
......@@ -2244,9 +2257,9 @@ glade_command_set_i18n (GladeProperty * property,
g_return_if_fail (property);
/* check that something changed before continuing with the command */
if (translatable == property->i18n_translatable &&
!g_strcmp0 (property->i18n_context, context) &&
!g_strcmp0 (property->i18n_comment, comment))
if (translatable == glade_property_i18n_get_translatable (property) &&
!g_strcmp0 (glade_property_i18n_get_context (property), context) &&
!g_strcmp0 (glade_property_i18n_get_comment (property), comment))
return;
/* load up the command */
......@@ -2255,11 +2268,12 @@ glade_command_set_i18n (GladeProperty * property,
me->translatable = translatable;
me->context = g_strdup (context);
me->comment = g_strdup (comment);
me->old_translatable = property->i18n_translatable;
me->old_context = g_strdup (property->i18n_context);
me->old_comment = g_strdup (property->i18n_comment);
me->old_translatable = glade_property_i18n_get_translatable (property);
me->old_context = g_strdup (glade_property_i18n_get_context (property));
me->old_comment = g_strdup (glade_property_i18n_get_comment (property));
GLADE_COMMAND (me)->project = glade_widget_get_project (property->widget);
GLADE_COMMAND (me)->project =
glade_widget_get_project (glade_property_get_widget (property));
GLADE_COMMAND (me)->description =
g_strdup_printf (_("Setting i18n metadata"));;
......
This diff is collapsed.
......@@ -980,6 +980,7 @@ glade_editor_populate_reset_view (GladeEditor * editor, GtkTreeView * tree_view)
GtkTreeIter property_iter, general_iter, common_iter, atk_iter, *iter;
GList *list;
GladeProperty *property;
GladePropertyClass *pclass;
gboolean def;
g_return_if_fail (editor->loaded_widget != NULL);
......@@ -1012,13 +1013,14 @@ glade_editor_populate_reset_view (GladeEditor * editor, GtkTreeView * tree_view)
for (list = glade_widget_get_properties (editor->loaded_widget); list; list = list->next)
{
property = list->data;
pclass = glade_property_get_class (property);
if (glade_property_class_is_visible (property->klass) == FALSE)
if (glade_property_class_is_visible (pclass) == FALSE)
continue;
if (property->klass->atk)
if (pclass->atk)
iter = &atk_iter;
else if (property->klass->common)
else if (pclass->common)
iter = &common_iter;
else
iter = &general_iter;
......@@ -1028,7 +1030,7 @@ glade_editor_populate_reset_view (GladeEditor * editor, GtkTreeView * tree_view)
gtk_tree_store_append (model, &property_iter, iter);
gtk_tree_store_set (model, &property_iter,
COLUMN_ENABLED, !def,
COLUMN_PROP_NAME, property->klass->name,
COLUMN_PROP_NAME, pclass->name,
COLUMN_PROPERTY, property,
COLUMN_WEIGHT, PANGO_WEIGHT_NORMAL,
COLUMN_CHILD, TRUE,
......@@ -1046,6 +1048,7 @@ glade_editor_reset_selection_changed_cb (GtkTreeSelection * selection,
GladeProperty *property = NULL;
GtkTreeModel *model = NULL;
GtkTextBuffer *text_buffer;
GladePropertyClass *pclass = NULL;
const gchar *message =
_("Select the properties that you want to reset to their default values");
......@@ -1055,8 +1058,12 @@ glade_editor_reset_selection_changed_cb (GtkTreeSelection * selection,
{
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (desc_view));
gtk_tree_model_get (model, &iter, COLUMN_PROPERTY, &property, -1);
if (property)
pclass = glade_property_get_class (property);
gtk_text_buffer_set_text (text_buffer,
property ? property->klass->tooltip : message,
pclass ? pclass->tooltip : message,
-1);
if (property)
g_object_unref (G_OBJECT (property));
......@@ -1140,13 +1147,14 @@ glade_editor_reset_properties (GList * props)
GList *list, *sdata_list = NULL;
GCSetPropData *sdata;
GladeProperty *prop;
GladeWidget *widget;
GladeProject *project = NULL;
for (list = props; list; list = list->next)
{
prop = list->data;
project = glade_widget_get_project (prop->widget);
prop = list->data;
widget = glade_property_get_widget (prop);
project = glade_widget_get_project (widget);
sdata = g_new (GCSetPropData, 1);
sdata->property = prop;
......
......@@ -722,19 +722,19 @@ static void
glade_popup_property_docs_cb (GtkMenuItem * item, GladeProperty * property)
{
GladeWidgetAdaptor *adaptor, *prop_adaptor;
GladePropertyClass *pclass;
gchar *search, *book;
prop_adaptor = glade_widget_adaptor_from_pclass (property->klass);
adaptor =
glade_widget_adaptor_from_pspec (prop_adaptor, property->klass->pspec);
search = g_strdup_printf ("The %s property", property->klass->id);
pclass = glade_property_get_class (property);
prop_adaptor = glade_widget_adaptor_from_pclass (pclass);
adaptor = glade_widget_adaptor_from_pspec (prop_adaptor, pclass->pspec);
search = g_strdup_printf ("The %s property", pclass->id);
g_object_get (adaptor, "book", &book, NULL);
glade_editor_search_doc_search (glade_app_get_editor (),
book,
g_type_name (property->klass->pspec->
owner_type), search);
book,
g_type_name (pclass->pspec->owner_type), search);
g_free (book);
g_free (search);
......@@ -745,14 +745,15 @@ glade_popup_property_pop (GladeProperty * property, GdkEventButton * event)
{
GladeWidgetAdaptor *adaptor, *prop_adaptor;
GladePropertyClass *pclass;
GtkWidget *popup_menu;
gchar *book = NULL;
gint button;
gint event_time;
prop_adaptor = glade_widget_adaptor_from_pclass (property->klass);
adaptor =
glade_widget_adaptor_from_pspec (prop_adaptor, property->klass->pspec);
pclass = glade_property_get_class (property);
prop_adaptor = glade_widget_adaptor_from_pclass (pclass);
adaptor = glade_widget_adaptor_from_pspec (prop_adaptor, pclass->pspec);
g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
......
......@@ -980,9 +980,12 @@ glade_project_fix_object_props (GladeProject * project)
for (ll = glade_widget_get_properties (gwidget); ll; ll = ll->next)
{
GladePropertyClass *klass;
property = GLADE_PROPERTY (ll->data);
klass = glade_property_get_class (property);
if (glade_property_class_is_object (property->klass) &&
if (glade_property_class_is_object (klass) &&
(txt = g_object_get_data (G_OBJECT (property),
"glade-loaded-object")) != NULL)
{
......@@ -990,7 +993,7 @@ glade_project_fix_object_props (GladeProject * project)
* (this magicly works for both objects & object lists)
*/
value = glade_property_class_make_gvalue_from_string
(property->klass, txt, glade_widget_get_project (gwidget), gwidget);
(klass, txt, glade_widget_get_project (gwidget), gwidget);
glade_property_set_value (property, value);
......@@ -1190,23 +1193,24 @@ update_project_for_resource_path (GladeProject * project)
for (list = glade_widget_get_properties (widget); list; list = list->next)
{
GladePropertyClass *klass;
property = list->data;
klass = glade_property_get_class (property);
/* XXX We should have a "resource" flag on properties that need
* to be loaded from the resource path, but that would require
* that they can serialize both ways (custom properties are only
* required to generate unique strings for value comparisons).
*/
if (property->klass->pspec->value_type == GDK_TYPE_PIXBUF)
if (klass->pspec->value_type == GDK_TYPE_PIXBUF)
{
GValue *value;
gchar *string;
gchar *string;
string = glade_property_class_make_string_from_gvalue
(property->klass, property->value);
value = glade_property_class_make_gvalue_from_string
(property->klass, string, project, widget);
string = glade_property_make_string (property);
value = glade_property_class_make_gvalue_from_string
(klass, string, project, widget);
glade_property_set_value (property, value);
......@@ -1332,6 +1336,7 @@ glade_project_introspect_gtk_version (GladeProject * project)
for (l = glade_widget_get_properties (widget); l; l = l->next)
{
GladeProperty *property = l->data;
GladePropertyClass *pclass = glade_property_get_class (property);
GladeWidgetAdaptor *prop_adaptor, *adaptor;
/* Unset properties ofcourse dont count... */
......@@ -1339,10 +1344,9 @@ glade_project_introspect_gtk_version (GladeProject * project)
continue;
/* Check if this property originates from a GTK+ widget class */
prop_adaptor = glade_widget_adaptor_from_pclass (property->klass);
prop_adaptor = glade_widget_adaptor_from_pclass (pclass);
adaptor =
glade_widget_adaptor_from_pspec (prop_adaptor,
property->klass->pspec);
glade_widget_adaptor_from_pspec (prop_adaptor, pclass->pspec);
catalog = NULL;
is_gtk_adaptor = FALSE;
......@@ -1353,10 +1357,10 @@ glade_project_introspect_gtk_version (GladeProject * project)
/* Check GTK+ property class versions */
if (is_gtk_adaptor &&
!GPC_VERSION_CHECK (property->klass, target_major, target_minor))
!GPC_VERSION_CHECK (pclass, target_major, target_minor))
{
target_major = property->klass->version_since_major;
target_minor = property->klass->version_since_minor;
target_major = pclass->version_since_major;
target_minor = pclass->version_since_minor;
}
}
......@@ -2045,28 +2049,31 @@ glade_project_verify_property (GladeProject * project,
GString * string, gboolean forwidget)
{
GladeWidgetAdaptor *adaptor, *prop_adaptor;
GladeWidget *widget;
GladePropertyClass *pclass;
gint target_major, target_minor;
gchar *catalog, *tooltip;
if (glade_property_original_default (property) && !forwidget)
return;
prop_adaptor = glade_widget_adaptor_from_pclass (property->klass);
adaptor =
glade_widget_adaptor_from_pspec (prop_adaptor, property->klass->pspec);
pclass = glade_property_get_class (property);
prop_adaptor = glade_widget_adaptor_from_pclass (pclass);
adaptor = glade_widget_adaptor_from_pspec (prop_adaptor, pclass->pspec);
widget = glade_property_get_widget (property);
g_object_get (adaptor, "catalog", &catalog, NULL);
glade_project_target_version_for_adaptor (glade_widget_get_project (property->widget), adaptor,
glade_project_target_version_for_adaptor (glade_widget_get_project (widget), adaptor,
&target_major, &target_minor);
if (!GPC_VERSION_CHECK (property->klass, target_major, target_minor))
if (!GPC_VERSION_CHECK (pclass, target_major, target_minor))
{
if (forwidget)
{
tooltip = g_strdup_printf (PROP_VERSION_CONFLICT_MSGFMT,
catalog,
property->klass->version_since_major,
property->klass->version_since_minor,
pclass->version_since_major,
pclass->version_since_minor,
catalog, target_major, target_minor);
glade_property_set_support_warning (property, FALSE, tooltip);
......@@ -2074,14 +2081,14 @@ glade_project_verify_property (GladeProject * project,
}
else
g_string_append_printf (string,
property->klass->packing ?
pclass->packing ?
PACK_PROP_VERSION_CONFLICT_FMT :
PROP_VERSION_CONFLICT_FMT,
path_name,
property->klass->name,
pclass->name,
adaptor->title, catalog,
property->klass->version_since_major,
property->klass->version_since_minor);
pclass->version_since_major,
pclass->version_since_minor);
}
else if (forwidget)
glade_property_set_support_warning (property, FALSE, NULL);
......
This diff is collapsed.
......@@ -12,13 +12,14 @@ G_BEGIN_DECLS
#define GLADE_IS_PROPERTY_KLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_PROPERTY))
#define GLADE_PROPERTY_GET_KLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GLADE_PROPERTY, GladePropertyKlass))
typedef struct _GladePropertyKlass GladePropertyKlass;
typedef struct _GladePropertyKlass GladePropertyKlass;
typedef struct _GladePropertyPrivate GladePropertyPrivate;
typedef enum {
GLADE_STATE_NORMAL = 0,
GLADE_STATE_CHANGED = (1 << 0),
GLADE_STATE_UNSUPPORTED = (1 << 1),
GLADE_STATE_SUPPORT_DISABLED = (1 << 2)
GLADE_STATE_NORMAL = 0,
GLADE_STATE_CHANGED = (1 << 0),
GLADE_STATE_UNSUPPORTED = (1 << 1),
GLADE_STATE_SUPPORT_DISABLED = (1 << 2)
} GladePropertyState;
/* A GladeProperty is an instance of a GladePropertyClass.
......@@ -27,81 +28,28 @@ typedef enum {
*/
struct _GladeProperty
{
GObject parent_instance;
GladePropertyClass *klass; /* A pointer to the GladeProperty that this
* setting specifies
*/
GladeWidget *widget; /* A pointer to the GladeWidget that this
* GladeProperty is modifying
*/
GladePropertyState state; /* Current property state, used by editing widgets.
*/
GValue *value; /* The value of the property
*/
gchar *insensitive_tooltip; /* Tooltip to display when in insensitive state
* (used to explain why the property is
* insensitive)
*/
gchar *support_warning; /* Tooltip to display when the property
* has format problems
* (used to explain why the property is
* insensitive)
*/
guint support_disabled : 1; /* Whether this property is disabled due
* to format conflicts
*/
guint sensitive : 1; /* Whether this property is sensitive (if the
* property is "optional" this takes precedence).
*/
guint enabled : 1; /* Enabled is a flag that is used for GladeProperties
* that have the optional flag set to let us know
* if this widget has this setting enabled or
* not. (Like default size, it can be specified or
* unspecified). This flag also sets the state
* of the property->input state for the loaded
* widget.
*/
guint save_always : 1; /* Used to make a special case exception and always
* save this property regardless of what the default
* value is (used for some special cases like properties
* that are assigned initial values in composite widgets
* or derived widget code).
*/
/* Used only for translatable strings. */
guint i18n_translatable : 1;
gchar *i18n_context;
gchar *i18n_comment;
gint syncing; /* Avoid recursion while synchronizing object with value */
gint sync_tolerance;
GObject parent_instance;
GladePropertyPrivate *priv;
};
struct _GladePropertyKlass
{
GObjectClass parent_class;
/* Class methods */
GladeProperty * (* dup) (GladeProperty *, GladeWidget *);
gboolean (* equals_value) (GladeProperty *, const GValue *);
gboolean (* set_value) (GladeProperty *, const GValue *);
void (* get_value) (GladeProperty *, GValue *);
void (* sync) (GladeProperty *);
void (* load) (GladeProperty *);
/* Signals */
void (* value_changed) (GladeProperty *, GValue *, GValue *);
void (* tooltip_changed) (GladeProperty *, const gchar *,
const gchar *, const gchar *);
GObjectClass parent_class;
/* Class methods */
GladeProperty * (* dup) (GladeProperty *, GladeWidget *);
gboolean (* equals_value) (GladeProperty *, const GValue *);
gboolean (* set_value) (GladeProperty *, const GValue *);
void (* get_value) (GladeProperty *, GValue *);
void (* sync) (GladeProperty *);
void (* load) (GladeProperty *);
/* Signals */
void (* value_changed) (GladeProperty *, GValue *, GValue *);
void (* tooltip_changed) (GladeProperty *, const gchar *,
const gchar *, const gchar *);
};
......@@ -167,13 +115,17 @@ void glade_property_write (GladeProperty
GladeXmlContext *context,
GladeXmlNode *node);
GladePropertyClass *glade_property_get_class (GladeProperty *property);
void glade_property_set_sensitive (GladeProperty *property,
gboolean sensitive,
const gchar *reason);
G_CONST_RETURN gchar *glade_propert_get_insensitive_tooltip(GladeProperty *property);
void glade_property_set_support_warning (GladeProperty *property,
gboolean disable,
const gchar *reason);