diff options
author | Tristan Van Berkom <tvb@src.gnome.org> | 2008-04-03 19:32:48 +0000 |
---|---|---|
committer | Tristan Van Berkom <tvb@src.gnome.org> | 2008-04-03 19:32:48 +0000 |
commit | e87b2381bb065e6afd0b3a47f5db9ec6bb8aa069 (patch) | |
tree | 0a5a064166f15584fb3a48320bae94259190ee80 | |
parent | b8242d6c3238c54bb1ce35924cd42580570c3fef (diff) | |
download | glade-builder.tar.gz |
Implemented saving of properties, signals, atkprops accelerators:builder
Implemented saving of properties, signals, atkprops
accelerators: everything is saving properly now !
svn path=/branches/builder/; revision=1763
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | gladeui/glade-project.c | 61 | ||||
-rw-r--r-- | gladeui/glade-property-class.h | 7 | ||||
-rw-r--r-- | gladeui/glade-property.c | 444 | ||||
-rw-r--r-- | gladeui/glade-property.h | 13 | ||||
-rw-r--r-- | gladeui/glade-signal-editor.c | 20 | ||||
-rw-r--r-- | gladeui/glade-signal.c | 68 | ||||
-rw-r--r-- | gladeui/glade-signal.h | 14 | ||||
-rw-r--r-- | gladeui/glade-widget-adaptor.c | 80 | ||||
-rw-r--r-- | gladeui/glade-widget-adaptor.h | 23 | ||||
-rw-r--r-- | gladeui/glade-widget.c | 427 | ||||
-rw-r--r-- | gladeui/glade-widget.h | 8 | ||||
-rw-r--r-- | gladeui/glade-xml-utils.c | 48 | ||||
-rw-r--r-- | gladeui/glade-xml-utils.h | 8 | ||||
-rw-r--r-- | plugins/gtk+/glade-gtk.c | 323 | ||||
-rw-r--r-- | plugins/gtk+/gtk+.xml.in | 55 |
16 files changed, 835 insertions, 776 deletions
@@ -1,3 +1,11 @@ +2008-04-03 Tristan Van Berkom <tvb@gnome.org> + + * glade-widget, glade-property, glade-gtk (plugin), + glade-project, glade-xml-utils... lots. + + Implemented saving of properties, signals, atkprops + accelerators: everything is saving properly now ! + 2008-04-02 Tristan Van Berkom <tvb@gnome.org> * gladeui/glade-widget-adaptor.[ch]: Added new entry points @@ -28,6 +36,10 @@ notebook tabs and frame labels), and removed some obsolete loading code from the old implementation. + * gladeui/glade-widget.[ch], gladeui/glade-project.c: + Basic glade file saving framework in place, currently saves + widgets, thier children and class types and widget names. + 2008-04-01 Tristan Van Berkom <tvb@gnome.org> * gladeui/glade-widget.[ch], gladeui/glade-widget-adaptor.[ch], diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c index 74c6606d..cd262403 100644 --- a/gladeui/glade-project.c +++ b/gladeui/glade-project.c @@ -1624,6 +1624,37 @@ glade_project_update_comment (GladeProject *project) g_strfreev (lines); } + +static GladeXmlContext * +glade_project_write (GladeProject *project) +{ + GladeXmlContext *context; + GladeXmlDoc *doc; + GladeXmlNode *root; + GList *list; + + doc = glade_xml_doc_new (); + context = glade_xml_context_new (doc, NULL); + root = glade_xml_node_new (context, GLADE_XML_TAG_PROJECT); + glade_xml_doc_set_root (doc, root); + + + for (list = project->priv->objects; list; list = list->next) + { + GladeWidget *widget; + + widget = glade_widget_get_from_gobject (list->data); + + /* + * Append toplevel widgets. Each widget then takes + * care of appending its children. + */ + if (widget->parent == NULL) + glade_widget_write (widget, context, root); + } + + return context; +} #if LOADING_WAS_IMPLEMENTED /** @@ -1852,24 +1883,15 @@ glade_project_move_resources (GladeProject *project, gboolean glade_project_save (GladeProject *project, const gchar *path, GError **error) { -#if LOADING_WAS_IMPLEMENTED - - GladeInterface *interface; - gboolean ret; - gchar *canonical_path; - - g_return_val_if_fail (GLADE_IS_PROJECT (project), FALSE); - g_return_val_if_fail (path != NULL, FALSE); - - interface = glade_project_write (project); - if (!interface) - { - g_warning ("Could not write glade document\n"); - return FALSE; - } + GladeXmlContext *context; + GladeXmlDoc *doc; + gchar *canonical_path; + gint ret; - ret = glade_parser_interface_dump (interface, path, error); - glade_parser_interface_destroy (interface); + context = glade_project_write (project); + doc = glade_xml_context_get_doc (context); + ret = glade_xml_doc_save (doc, path); + glade_xml_context_destroy (context); canonical_path = glade_util_canonical_path (path); g_assert (canonical_path); @@ -1909,10 +1931,7 @@ glade_project_save (GladeProject *project, const gchar *path, GError **error) g_free (canonical_path); - return ret; -#endif // LOADING_WAS_IMPLEMENTED - - return TRUE; + return ret > 0; } diff --git a/gladeui/glade-property-class.h b/gladeui/glade-property-class.h index f1b4230b..8ee8a663 100644 --- a/gladeui/glade-property-class.h +++ b/gladeui/glade-property-class.h @@ -103,7 +103,9 @@ struct _GladePropertyClass * property editor availability & live object updates in the glade environment. */ gboolean save; /* Whether we should save to the glade file or not - * (mostly just for custom glade properties) + * (mostly just for virtual internal glade properties, + * also used for properties with generic pspecs that + * are saved in custom ways by the plugin) */ gboolean save_always; /* Used to make a special case exception and always * save this property regardless of what the default @@ -114,10 +116,9 @@ struct _GladePropertyClass gboolean visible; /* Whether or not to show this property in the editor */ gboolean ignore; /* When true, we will not sync the object when the property - * changes. + * changes, or load values from the object. */ - gboolean is_modified; /* If true, this property_class has been "modified" from the * the standard property by a xml file. */ diff --git a/gladeui/glade-property.c b/gladeui/glade-property.c index ee5cdd67..ea285c5f 100644 --- a/gladeui/glade-property.c +++ b/gladeui/glade-property.c @@ -355,128 +355,6 @@ glade_property_load_impl (GladeProperty *property) g_object_get_property (object, property->klass->id, property->value); } -#if LOADING_WAS_IMPLEMENTED - -static gboolean -glade_property_write_impl (GladeProperty *property, - GladeInterface *interface, - GArray *props) -{ - GladePropInfo info = { 0, }; - GladeAtkActionInfo ainfo = { 0, }; - GList *list; - gchar *name, *value, **split, *tmp; - gint i; - - if (!property->klass->save || !property->enabled) - return FALSE; - - g_assert (property->klass->orig_def); - g_assert (property->klass->def); - - /* Skip properties that are default by original pspec default - * (excepting those that specified otherwise). - */ - if (!(property->klass->save_always || property->save_always) && - glade_property_equals_value (property, property->klass->orig_def)) - return FALSE; - - /* we should change each '-' by '_' on the name of the property - * (<property name="...">) */ - if (property->klass->type != GPC_NORMAL) - { - - tmp = (gchar *)glade_property_class_atk_realname (property->klass->id); - name = g_strdup (tmp); - } - else - { - name = g_strdup (property->klass->id); - } - - /* XXX ??? convert the value of this property to a string */ - if (property->klass->type == GPC_ACCEL_PROPERTY || - (value = glade_widget_adaptor_string_from_value - (GLADE_WIDGET_ADAPTOR (property->klass->handle), - property->klass, property->value)) == NULL) - /* make sure we keep the empty string, also... upcomming - * funcs that may not like NULL. - */ - value = g_strdup (""); - else - { - /* Escape the string so that it will be parsed as it should. */ - tmp = value; - value = g_markup_escape_text (value, -1); - g_free (tmp); - } - - switch (property->klass->type) - { - case GPC_ATK_PROPERTY: - tmp = g_strdup_printf ("AtkObject::%s", name); - g_free (name); - name = tmp; - /* Dont break here ... */ - case GPC_NORMAL: - info.name = glade_xml_alloc_propname(interface, name); - info.value = glade_xml_alloc_string(interface, value); - - if (property->klass->translatable) - { - info.translatable = property->i18n_translatable; - info.has_context = property->i18n_has_context; - if (property->i18n_comment) - info.comment = glade_xml_alloc_string - (interface, property->i18n_comment); - } - g_array_append_val (props, info); - break; - case GPC_ATK_RELATION: - if ((split = g_strsplit (value, GPC_OBJECT_DELIMITER, 0)) != NULL) - { - for (i = 0; split[i] != NULL; i++) - { - GladeAtkRelationInfo rinfo = { 0, }; - rinfo.type = glade_xml_alloc_string(interface, name); - rinfo.target = glade_xml_alloc_string(interface, split[i]); - g_array_append_val (props, rinfo); - } - g_strfreev (split); - } - break; - case GPC_ATK_ACTION: - ainfo.action_name = glade_xml_alloc_string(interface, name); - ainfo.description = glade_xml_alloc_string(interface, value); - g_array_append_val (props, ainfo); - break; - case GPC_ACCEL_PROPERTY: - for (list = g_value_get_boxed (property->value); - list; list = list->next) - { - GladeAccelInfo *accel = list->data; - GladeAccelInfo accel_info = { 0, }; - - accel_info.signal = glade_xml_alloc_string(interface, accel->signal); - accel_info.key = accel->key; - accel_info.modifiers = accel->modifiers; - - g_array_append_val (props, accel_info); - } - break; - default: - break; - } - - g_free (name); - g_free (value); - - return TRUE; -} - -#endif // LOADING_WAS_IMPLEMENTED - - static G_CONST_RETURN gchar * glade_property_get_tooltip_impl (GladeProperty *property) { @@ -601,7 +479,6 @@ glade_property_klass_init (GladePropertyKlass *prop_class) prop_class->get_default = glade_property_get_default_impl; prop_class->sync = glade_property_sync_impl; prop_class->load = glade_property_load_impl; -/* XXX prop_class->write = glade_property_write_impl; */ prop_class->get_tooltip = glade_property_get_tooltip_impl; prop_class->value_changed = NULL; prop_class->tooltip_changed = NULL; @@ -666,7 +543,6 @@ glade_property_klass_init (GladePropertyKlass *prop_class) } - GType glade_property_get_type (void) { @@ -695,196 +571,6 @@ glade_property_get_type (void) } /******************************************************************************* - GladeInterface Parsing code - *******************************************************************************/ - -#if LOADING_WAS_IMPLEMENTED - -static GValue * -glade_property_read_atk_prop (GladeProperty *property, - GladePropertyClass *pclass, - GladeProject *project, - GladeWidgetInfo *info, - gboolean free_value) -{ - GValue *gvalue = NULL; - gint i; - gchar *id; - - for (i = 0; i < info->n_atk_props; ++i) - { - GladePropInfo *pinfo = info->atk_props + i; - - id = glade_util_read_prop_name (pinfo->name); - - if (!strcmp (id, pclass->id)) - { - gvalue = glade_property_class_make_gvalue_from_string - (pclass, pinfo->value, project); - - if (property) - { - glade_property_i18n_set_translatable - (property, pinfo->translatable); - glade_property_i18n_set_has_context - (property, pinfo->has_context); - glade_property_i18n_set_comment - (property, pinfo->comment); - - property->enabled = TRUE; - - GLADE_PROPERTY_GET_KLASS (property)->set_value - (property, gvalue); - } - - if (free_value) - { - g_value_unset (gvalue); - g_free (gvalue); - } - - g_free (id); - break; - } - g_free (id); - } - return gvalue; -} - -static GValue * -glade_property_read_atk_relation (GladeProperty *property, - GladePropertyClass *pclass, - GladeProject *project, - GladeWidgetInfo *info) -{ - const gchar *class_id; - gchar *id, *string = NULL, *tmp; - gint i; - - for (i = 0; i < info->n_relations; ++i) - { - GladeAtkRelationInfo *rinfo = info->relations + i; - - id = glade_util_read_prop_name (rinfo->type); - class_id = glade_property_class_atk_realname (pclass->id); - - if (!strcmp (id, class_id)) - { - if (string == NULL) - string = g_strdup (rinfo->target); - else - { - tmp = g_strdup_printf ("%s%s%s", string, - GPC_OBJECT_DELIMITER, rinfo->target); - string = (g_free (string), tmp); - } - } - g_free (id); - } - - /* we must synchronize this directly after loading this project - * (i.e. lookup the actual objects after they've been parsed and - * are present). - */ - if (property) - { - g_object_set_data_full (G_OBJECT (property), "glade-loaded-object", - g_strdup (string), g_free); - } - - return NULL; -} - -static GValue * -glade_property_read_atk_action (GladeProperty *property, - GladePropertyClass *pclass, - GladeProject *project, - GladeWidgetInfo *info, - gboolean free_value) -{ - GValue *gvalue = NULL; - const gchar *class_id; - gchar *id; - gint i; - - for (i = 0; i < info->n_atk_actions; ++i) - { - GladeAtkActionInfo *ainfo = info->atk_actions + i; - - id = glade_util_read_prop_name (ainfo->action_name); - class_id = glade_property_class_atk_realname (pclass->id); - - if (!strcmp (id, class_id)) - { - /* Need special case for NULL values here ??? */ - - gvalue = glade_property_class_make_gvalue_from_string - (pclass, ainfo->description, project); - - if (property) - GLADE_PROPERTY_GET_KLASS - (property)->set_value (property, gvalue); - - if (free_value) - { - g_value_unset (gvalue); - g_free (gvalue); - } - g_free (id); - break; - } - g_free (id); - } - return gvalue; -} - -static GValue * -glade_property_read_accel_prop (GladeProperty *property, - GladePropertyClass *pclass, - GladeProject *project, - GladeWidgetInfo *info, - gboolean free_value) -{ - GValue *gvalue = NULL; - GList *accels = NULL; - gint i; - - for (i = 0; i < info->n_accels; ++i) - { - GladeAccelInfo *ainfo = info->accels + i; - - GladeAccelInfo *ainfo_dup = g_new0 (GladeAccelInfo, 1); - - ainfo_dup = g_new0 (GladeAccelInfo, 1); - ainfo_dup->signal = g_strdup (ainfo->signal); - ainfo_dup->key = ainfo->key; - ainfo_dup->modifiers = ainfo->modifiers; - - accels = g_list_prepend (accels, ainfo_dup); - } - - gvalue = g_new0 (GValue, 1); - g_value_init (gvalue, GLADE_TYPE_ACCEL_GLIST); - g_value_take_boxed (gvalue, accels); - - - if (property) - GLADE_PROPERTY_GET_KLASS - (property)->set_value (property, gvalue); - - - if (free_value) - { - g_value_unset (gvalue); - g_free (gvalue); - } - - return gvalue; -} -#endif // LOADING_WAS_IMPLEMENTED - - -/******************************************************************************* API *******************************************************************************/ /** @@ -1217,39 +903,33 @@ glade_property_load (GladeProperty *property) /** * glade_property_read: * @property: a #GladeProperty or #NULL - * @pclass: the #GladePropertyClass * @project: the #GladeProject * @node: the #GladeXmlNode to read, will either be a <widget> * node or a <child> node for packing properties. - * @free_value: Whether the return value should be freed after applying - * it to the property or if it should be returned in tact. * - * Read the value and any attributes for @property from @info, assumes + * Read the value and any attributes for @property from @node, assumes * @property is being loaded for @project * - * Returns: The newly created #GValue if successfull (and if @free_value == FALSE) - * * Note that object values will only be resolved after the project is * completely loaded */ -GValue * +void glade_property_read (GladeProperty *property, - GladePropertyClass *pclass, GladeProject *project, - GladeXmlNode *node, - gboolean free_value) + GladeXmlNode *node) { GladeXmlNode *prop; GValue *gvalue = NULL; gchar *id, *name, *value; - g_return_val_if_fail (pclass != NULL, NULL); - g_return_val_if_fail (node != NULL, NULL); + g_return_if_fail (GLADE_IS_PROPERTY (property)); + g_return_if_fail (GLADE_IS_PROJECT (project)); + g_return_if_fail (node != NULL); /* This code should work the same for <packing> and <widget> */ if (!(glade_xml_node_verify_silent (node, GLADE_XML_TAG_PACKING) || glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET))) - return NULL; + return; for (prop = glade_xml_node_get_children (node); prop; prop = glade_xml_node_next (prop)) @@ -1268,7 +948,7 @@ glade_property_read (GladeProperty *property, id = glade_util_read_prop_name (name); g_free (name); - if (!strcmp (id, pclass->id)) + if (!strcmp (id, property->klass->id)) { if (!(value = glade_xml_get_content (prop))) { @@ -1277,8 +957,7 @@ glade_property_read (GladeProperty *property, break; } - - if (property && glade_property_class_is_object (pclass)) + if (property && glade_property_class_is_object (property->klass)) { /* we must synchronize this directly after loading this project * (i.e. lookup the actual objects after they've been parsed and @@ -1291,7 +970,7 @@ glade_property_read (GladeProperty *property, else { gvalue = glade_property_class_make_gvalue_from_string - (pclass, value, project); + (property->klass, value, project); if (property) { @@ -1299,12 +978,8 @@ glade_property_read (GladeProperty *property, (property)->set_value (property, gvalue); } - if (free_value) - { - g_value_unset (gvalue); - g_free (gvalue); - gvalue = NULL; - } + g_value_unset (gvalue); + g_free (gvalue); /* If an optional property is specified in the * glade file, its enabled @@ -1340,33 +1015,98 @@ glade_property_read (GladeProperty *property, } g_free (id); } - - return gvalue; } -#if LOADING_WAS_IMPLEMENTED - /** * glade_property_write: * @property: a #GladeProperty - * @interface: a #GladeInterface - * @props: a GArray of #GladePropInfo + * @context: A #GladeXmlContext + * @node: A #GladeXmlNode * - * Write this property to the GladeInterface metadata + * Write @property to @node */ -gboolean -glade_property_write (GladeProperty *property, GladeInterface *interface, GArray *props) +void +glade_property_write (GladeProperty *property, + GladeXmlContext *context, + GladeXmlNode *node) { - g_return_val_if_fail (GLADE_IS_PROPERTY (property), FALSE); - g_return_val_if_fail (interface != NULL, FALSE); - g_return_val_if_fail (props != NULL, FALSE); - return GLADE_PROPERTY_GET_KLASS (property)->write (property, interface, props); -} + GladeXmlNode *prop_node; + gchar *name, *value, *tmp; + + g_return_if_fail (GLADE_IS_PROPERTY (property)); + g_return_if_fail (node != NULL); + + /* This code should work the same for <packing> and <widget> */ + if (!(glade_xml_node_verify_silent (node, GLADE_XML_TAG_PACKING) || + glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET))) + return; + + if (!property->klass->save || !property->enabled) + return; + + g_assert (property->klass->orig_def); + g_assert (property->klass->def); + + /* Skip properties that are default by original pspec default + * (excepting those that specified otherwise). + */ + if (!(property->klass->save_always || property->save_always) && + glade_property_equals_value (property, property->klass->orig_def)) + return; + + /* Escape our string and save with underscores */ + name = g_strdup (property->klass->id); + glade_util_replace (name, '-', '_'); + + /* convert the value of this property to a string */ + if (!(value = glade_widget_adaptor_string_from_value + (GLADE_WIDGET_ADAPTOR (property->klass->handle), + property->klass, property->value))) + /* make sure we keep the empty string, also... upcomming + * funcs that may not like NULL. + */ + value = g_strdup (""); + else + { + /* Escape the string so that it will be parsed as it should. */ + tmp = value; + value = g_markup_escape_text (value, -1); + g_free (tmp); + } + + /* Now dump the node values... */ + prop_node = glade_xml_node_new (context, GLADE_XML_TAG_PROPERTY); + glade_xml_node_append_child (node, prop_node); + + /* Name and value */ + glade_xml_node_set_property_string (prop_node, GLADE_XML_TAG_NAME, name); + glade_xml_set_content (prop_node, value); + + /* i18n stuff */ + if (property->klass->translatable) + { + if (property->i18n_translatable) + glade_xml_node_set_property_string (prop_node, + GLADE_TAG_TRANSLATABLE, + GLADE_XML_TAG_I18N_TRUE); -#endif // LOADING_WAS_IMPLEMENTED + if (property->i18n_has_context) + glade_xml_node_set_property_string (prop_node, + GLADE_TAG_HAS_CONTEXT, + GLADE_XML_TAG_I18N_TRUE); + if (property->i18n_comment) + glade_xml_node_set_property_string (prop_node, + GLADE_TAG_COMMENT, + property->i18n_comment); + } + + g_free (name); + g_free (value); +} + /** * glade_property_add_object: * @property: a #GladeProperty diff --git a/gladeui/glade-property.h b/gladeui/glade-property.h index ab75ee57..569cbabc 100644 --- a/gladeui/glade-property.h +++ b/gladeui/glade-property.h @@ -78,7 +78,6 @@ struct _GladePropertyKlass void (* get_default) (GladeProperty *, GValue *); void (* sync) (GladeProperty *); void (* load) (GladeProperty *); -/* XXX gboolean (* write) (GladeProperty *, GladeInterface *, GArray *); */ G_CONST_RETURN gchar * (* get_tooltip) (GladeProperty *); /* Signals */ @@ -141,15 +140,13 @@ void glade_property_sync (GladeProperty void glade_property_load (GladeProperty *property); -GValue *glade_property_read (GladeProperty *property, - GladePropertyClass *pclass, +void glade_property_read (GladeProperty *property, GladeProject *project, - GladeXmlNode *node, - gboolean free_value); + GladeXmlNode *node); -/* XXX gboolean glade_property_write (GladeProperty *property, */ -/* GladeInterface *interface, */ -/* GArray *props); */ +void glade_property_write (GladeProperty *property, + GladeXmlContext *context, + GladeXmlNode *node); G_CONST_RETURN gchar *glade_property_get_tooltip (GladeProperty *property); diff --git a/gladeui/glade-signal-editor.c b/gladeui/glade-signal-editor.c index d62e0e94..06fac409 100644 --- a/gladeui/glade-signal-editor.c +++ b/gladeui/glade-signal-editor.c @@ -102,8 +102,8 @@ glade_signal_editor_after_toggled (GtkCellRendererToggle *cell, g_assert (signal_name != NULL); } - old_signal = glade_signal_new (signal_name, handler, userdata, lookup, after); - new_signal = glade_signal_new (signal_name, handler, userdata, lookup, !after); + old_signal = glade_signal_new (signal_name, handler, userdata, after); + new_signal = glade_signal_new (signal_name, handler, userdata, !after); glade_command_change_signal (editor->widget, old_signal, new_signal); gtk_tree_store_set (GTK_TREE_STORE (model), &iter, COLUMN_AFTER, !after, -1); @@ -348,7 +348,7 @@ glade_signal_editor_handler_cell_edited (GtkCellRendererText *cell, if (slot && !is_void_signal_handler(new_handler)) { GladeSignal *new_signal = glade_signal_new (signal_name, new_handler, - NULL, FALSE, FALSE); + NULL, FALSE); glade_command_add_signal (glade_widget, new_signal); glade_signal_free (new_signal); gtk_tree_store_set (GTK_TREE_STORE (model), &iter, @@ -368,7 +368,7 @@ glade_signal_editor_handler_cell_edited (GtkCellRendererText *cell, glade_signal_new (signal_name, old_handler, is_void_user_data (userdata) ? NULL : userdata, - lookup, after); + after); glade_command_remove_signal (glade_widget, old_signal); glade_signal_free (old_signal); @@ -397,14 +397,12 @@ glade_signal_editor_handler_cell_edited (GtkCellRendererText *cell, (signal_name, old_handler, is_void_user_data(userdata) ? NULL : userdata, - lookup, after); GladeSignal *new_signal = glade_signal_new (signal_name, new_handler, is_void_user_data(userdata) ? NULL : userdata, - lookup, after); glade_command_change_signal (glade_widget, old_signal, new_signal); @@ -619,14 +617,12 @@ glade_signal_editor_userdata_cell_edited (GtkCellRendererText *cell, old_signal = glade_signal_new (signal_name, handler, - is_void_user_data(old_userdata) ? NULL : old_userdata, - lookup, after); + is_void_user_data(old_userdata) ? NULL : old_userdata, after); new_signal = glade_signal_new (signal_name, handler, - is_void_user_data(new_userdata) ? NULL : new_userdata, - lookup, after); + is_void_user_data(new_userdata) ? NULL : new_userdata, after); if (glade_signal_equal (old_signal, new_signal) == FALSE) glade_command_change_signal (glade_widget, old_signal, new_signal); @@ -921,7 +917,7 @@ glade_signal_editor_load_widget (GladeSignalEditor *editor, COLUMN_USERDATA, widget_signal->userdata ? widget_signal->userdata : _(USERDATA_DEFAULT), - COLUMN_LOOKUP, widget_signal->lookup, + COLUMN_LOOKUP, FALSE/* widget_signal->lookup */, COLUMN_LOOKUP_VISIBLE, widget_signal->userdata ? TRUE : FALSE, COLUMN_AFTER_VISIBLE, TRUE, @@ -944,7 +940,7 @@ glade_signal_editor_load_widget (GladeSignalEditor *editor, COLUMN_USERDATA, widget_signal->userdata ? widget_signal->userdata : _(USERDATA_DEFAULT), - COLUMN_LOOKUP, widget_signal->lookup, + COLUMN_LOOKUP, FALSE/* widget_signal->lookup */, COLUMN_LOOKUP_VISIBLE, widget_signal->userdata ? TRUE : FALSE, COLUMN_AFTER_VISIBLE, TRUE, diff --git a/gladeui/glade-signal.c b/gladeui/glade-signal.c index 87dc44c5..3e5e522c 100644 --- a/gladeui/glade-signal.c +++ b/gladeui/glade-signal.c @@ -45,7 +45,6 @@ GladeSignal *glade_signal_new (const gchar *name, const gchar *handler, const gchar *userdata, - gboolean lookup, gboolean after) { GladeSignal *signal = g_new0 (GladeSignal, 1); @@ -53,7 +52,6 @@ GladeSignal *glade_signal_new (const gchar *name, signal->name = g_strdup (name); signal->handler = g_strdup (handler); signal->userdata = userdata ? g_strdup (userdata) : NULL; - signal->lookup = lookup; signal->after = after; return signal; @@ -92,8 +90,7 @@ glade_signal_equal (GladeSignal *sig1, GladeSignal *sig2) if (!strcmp (sig1->name, sig2->name) && !strcmp (sig1->handler, sig2->handler) && - sig1->after == sig2->after && - sig1->lookup == sig2->lookup) + sig1->after == sig2->after) { if ((sig1->userdata == NULL && sig2->userdata == NULL) || (sig1->userdata != NULL && sig2->userdata != NULL && @@ -116,40 +113,61 @@ glade_signal_clone (const GladeSignal *signal) return glade_signal_new (signal->name, signal->handler, signal->userdata, - signal->lookup, signal->after); } -#if LOADING_WAS_IMPLEMENTED - /** * glade_signal_write: - * @info: - * @signal: - * @interface: + * @signal: The #GladeSignal + * @context: A #GladeXmlContext + * @node: A #GladeXmlNode * - * Returns: TRUE if succeed + * Writes @signal to @node */ -gboolean -glade_signal_write (GladeSignalInfo *info, GladeSignal *signal, - GladeInterface *interface) +void +glade_signal_write (GladeSignal *signal, + GladeXmlContext *context, + GladeXmlNode *node) { - info->name = glade_xml_alloc_string(interface, signal->name); - glade_util_replace (info->name, '-', '_'); - info->handler = glade_xml_alloc_string(interface, signal->handler); - info->object = - signal->userdata ? - glade_xml_alloc_string(interface, signal->userdata) : NULL; - info->after = signal->after; - info->lookup = signal->lookup; + GladeXmlNode *signal_node; + gchar *name; + + if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET)) + return; + + name = g_strdup (signal->name); + glade_util_replace (name, '-', '_'); + + /* Now dump the node values... */ + signal_node = glade_xml_node_new (context, GLADE_XML_TAG_SIGNAL); + glade_xml_node_append_child (node, signal_node); + + glade_xml_node_set_property_string (signal_node, GLADE_XML_TAG_NAME, name); + glade_xml_node_set_property_string (signal_node, GLADE_XML_TAG_HANDLER, signal->handler); + + if (signal->userdata) + glade_xml_node_set_property_string (signal_node, + GLADE_XML_TAG_OBJECT, + signal->userdata); + + if (signal->after) + glade_xml_node_set_property_string (signal_node, + GLADE_XML_TAG_AFTER, + GLADE_XML_TAG_SIGNAL_TRUE); + + g_free (name); return TRUE; } -#endif // LOADING_WAS_IMPLEMENTED -/* - * Returns a new GladeSignal with the attributes defined in node +/** + * glade_signal_read: + * @node: The #GladeXmlNode to read + * + * Reads and creates a ner #GladeSignal based on @node + * + * Returns: A newly created #GladeSignal */ GladeSignal * glade_signal_read (GladeXmlNode *node) diff --git a/gladeui/glade-signal.h b/gladeui/glade-signal.h index f771aed6..1bb8871c 100644 --- a/gladeui/glade-signal.h +++ b/gladeui/glade-signal.h @@ -17,9 +17,6 @@ struct _GladeSignal gchar *name; /* Signal name eg "clicked" */ gchar *handler; /* Handler function eg "gtk_main_quit" */ gchar *userdata; /* User data signal handler argument */ - gboolean lookup; /* Whether user_data should be looked up - * with the GModule interface by libglade. - */ gboolean after; /* Connect after TRUE or FALSE */ }; @@ -27,7 +24,6 @@ struct _GladeSignal GladeSignal *glade_signal_new (const gchar *name, const gchar *handler, const gchar *userdata, - gboolean lookup, gboolean after); GladeSignal *glade_signal_clone (const GladeSignal *signal); void glade_signal_free (GladeSignal *signal); @@ -35,13 +31,9 @@ void glade_signal_free (GladeSignal *signal); gboolean glade_signal_equal (GladeSignal *sig1, GladeSignal *sig2); GladeSignal *glade_signal_read (GladeXmlNode *node); - - -/* XXX gboolean glade_signal_write (GladeSignalInfo *info, GladeSignal *signal, */ -/* GladeInterface *interface); */ - -/* GladeSignal *glade_signal_new_from_signal_info (GladeSignalInfo *info); */ - +void glade_signal_write (GladeSignal *signal, + GladeXmlContext *context, + GladeXmlNode *node); G_END_DECLS diff --git a/gladeui/glade-widget-adaptor.c b/gladeui/glade-widget-adaptor.c index 0c12ef68..51dff531 100644 --- a/gladeui/glade-widget-adaptor.c +++ b/gladeui/glade-widget-adaptor.c @@ -769,8 +769,7 @@ glade_widget_adaptor_object_read_widget (GladeWidgetAdaptor *adaptor, { GladeProperty *property = props->data; glade_property_read - (property, property->klass, - widget->project, node, TRUE); + (property, widget->project, node); } /* Read in the signals */ @@ -787,6 +786,52 @@ glade_widget_adaptor_object_read_widget (GladeWidgetAdaptor *adaptor, } } +typedef struct { + GladeXmlContext *context; + GladeXmlNode *node; +} WriteSignalsInfo; + + +static void +glade_widget_adaptor_write_signals (gpointer key, + gpointer value, + gpointer user_data) +{ + WriteSignalsInfo *info; + GPtrArray *signals; + guint i; + + info = (WriteSignalsInfo *) user_data; + signals = (GPtrArray *) value; + for (i = 0; i < signals->len; i++) + { + GladeSignal *signal = g_ptr_array_index (signals, i); + glade_signal_write (signal, + info->context, + info->node); + } +} + +static void +glade_widget_adaptor_object_write_widget (GladeWidgetAdaptor *adaptor, + GladeWidget *widget, + GladeXmlContext *context, + GladeXmlNode *node) +{ + GList *props; + WriteSignalsInfo info = { context, node }; + + /* Write the properties */ + for (props = widget->properties; + props; props = props->next) + glade_property_write (GLADE_PROPERTY (props->data), context, node); + + /* Write the signals */ + g_hash_table_foreach (widget->signals, + glade_widget_adaptor_write_signals, + &info); +} + static GType glade_widget_adaptor_get_eprop_type (GParamSpec *pspec) { @@ -918,6 +963,7 @@ glade_widget_adaptor_class_init (GladeWidgetAdaptorClass *adaptor_class) adaptor_class->action_activate = glade_widget_adaptor_object_action_activate; adaptor_class->child_action_activate= glade_widget_adaptor_object_child_action_activate; adaptor_class->read_widget = glade_widget_adaptor_object_read_widget; + adaptor_class->write_widget = glade_widget_adaptor_object_write_widget; adaptor_class->create_eprop = glade_widget_adaptor_object_create_eprop; adaptor_class->string_from_value = glade_widget_adaptor_object_string_from_value; @@ -1169,6 +1215,11 @@ gwa_extend_with_node_load_sym (GladeWidgetAdaptorClass *klass, klass->read_widget = symbol; if (glade_xml_load_sym_from_node (node, module, + GLADE_TAG_WRITE_WIDGET_FUNCTION, + &symbol)) + klass->write_widget = symbol; + + if (glade_xml_load_sym_from_node (node, module, GLADE_TAG_CREATE_EPROP_FUNCTION, &symbol)) klass->create_eprop = symbol; @@ -2952,6 +3003,31 @@ glade_widget_adaptor_read_widget (GladeWidgetAdaptor *adaptor, /** + * glade_widget_adaptor_write_widget: + * @adaptor: A #GladeWidgetAdaptor + * @widget: The #GladeWidget + * @context: The #GladeXmlContext + * @node: The #GladeXmlNode + * + * This function is called to update @widget from @node + * when loading xml files. + */ +void +glade_widget_adaptor_write_widget (GladeWidgetAdaptor *adaptor, + GladeWidget *widget, + GladeXmlContext *context, + GladeXmlNode *node) +{ + g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor)); + g_return_if_fail (GLADE_IS_WIDGET (widget)); + g_return_if_fail (node != NULL); + + GLADE_WIDGET_ADAPTOR_GET_CLASS (adaptor)->write_widget (adaptor, widget, + context, node); +} + + +/** * glade_widget_adaptor_create_eprop: * @adaptor: A #GladeWidgetAdaptor * @klass: The #GladePropertyClass to be edited diff --git a/gladeui/glade-widget-adaptor.h b/gladeui/glade-widget-adaptor.h index 8e630246..0bfdfee2 100644 --- a/gladeui/glade-widget-adaptor.h +++ b/gladeui/glade-widget-adaptor.h @@ -348,6 +348,21 @@ typedef void (* GladeReadWidgetFunc) (GladeWidgetAdaptor *adaptor, GladeXmlNode *node); /** + * GladeWriteWidgetFunc: + * @adaptor: A #GladeWidgetAdaptor + * @widget: The #GladeWidget + * @node: The #GladeXmlNode + * + * This function is called to fill in @node from @widget. + * + */ +typedef void (* GladeWriteWidgetFunc) (GladeWidgetAdaptor *adaptor, + GladeWidget *widget, + GladeXmlContext *context, + GladeXmlNode *node); + + +/** * GladeCreateEPropFunc: * @adaptor: A #GladeWidgetAdaptor * @klass: The #GladePropertyClass to be edited @@ -524,7 +539,8 @@ struct _GladeWidgetAdaptorClass GladeReadWidgetFunc read_widget; /* Reads widget attributes from xml */ - + + GladeWriteWidgetFunc write_widget; /* Writes widget attributes to the xml */ GladeCreateEPropFunc create_eprop; /* Creates a GladeEditorProperty */ @@ -684,6 +700,11 @@ void glade_widget_adaptor_read_widget (GladeWidgetAdaptor GladeWidget *widget, GladeXmlNode *node); +void glade_widget_adaptor_write_widget (GladeWidgetAdaptor *adaptor, + GladeWidget *widget, + GladeXmlContext *context, + GladeXmlNode *node); + GladeEditorProperty *glade_widget_adaptor_create_eprop (GladeWidgetAdaptor *adaptor, GladePropertyClass *klass, gboolean use_command); diff --git a/gladeui/glade-widget.c b/gladeui/glade-widget.c index e633b32c..7f9b2c6e 100644 --- a/gladeui/glade-widget.c +++ b/gladeui/glade-widget.c @@ -95,11 +95,6 @@ enum }; static guint glade_widget_signals[LAST_SIGNAL] = {0}; - -/* Sometimes we need to use the project deep in the loading code, - * this is just a shortcut way to get the project. - */ -static GladeProject *loading_project = NULL; static GQuark glade_widget_name_quark = 0; @@ -288,7 +283,6 @@ glade_widget_change_signal_handler_impl (GladeWidget *widget, g_strdup (new_signal_handler->userdata); tmp_signal_handler->after = new_signal_handler->after; - tmp_signal_handler->lookup = new_signal_handler->lookup; break; } } @@ -3292,263 +3286,6 @@ glade_widget_replace (GladeWidget *parent, GObject *old_object, GObject *new_obj GLADE_WIDGET_GET_CLASS (parent)->replace_child (parent, old_object, new_object); } -/* XML Serialization */ -#if LOADING_WAS_IMPLEMENTED - -static gboolean -glade_widget_write_child (GArray *children, GladeWidget *parent, GObject *object, GladeInterface *interface); - -typedef struct _WriteSignalsContext -{ - GladeInterface *interface; - GArray *signals; -} WriteSignalsContext; - -static void -glade_widget_write_signals (gpointer key, gpointer value, gpointer user_data) -{ - WriteSignalsContext *write_signals_context; - GPtrArray *signals; - guint i; - - write_signals_context = (WriteSignalsContext *) user_data; - signals = (GPtrArray *) value; - for (i = 0; i < signals->len; i++) - { - GladeSignal *signal = g_ptr_array_index (signals, i); - GladeSignalInfo signalinfo; - - glade_signal_write (&signalinfo, signal, - write_signals_context->interface); - g_array_append_val (write_signals_context->signals, - signalinfo); - } -} - -/** - * glade_widget_write: - * @widget: a #GladeWidget - * @interface: a #GladeInterface - * - * TODO: write me - * - * Returns: - */ -GladeWidgetInfo* -glade_widget_write (GladeWidget *widget, GladeInterface *interface) -{ - WriteSignalsContext write_signals_context; - GladeWidgetInfo *info; - GArray *props, *atk_props, *atk_actions, *atk_relations, *accels, *children; - GList *list; - - g_return_val_if_fail (GLADE_IS_WIDGET (widget), NULL); - - info = g_new0 (GladeWidgetInfo, 1); - - info->classname = glade_xml_alloc_string (interface, widget->adaptor->name); - info->name = glade_xml_alloc_string (interface, widget->name); - - /* Write the properties */ - props = g_array_new (FALSE, FALSE, sizeof (GladePropInfo)); - atk_props = g_array_new (FALSE, FALSE, sizeof (GladePropInfo)); - atk_relations = g_array_new (FALSE, FALSE, sizeof (GladeAtkRelationInfo)); - atk_actions = g_array_new (FALSE, FALSE, sizeof (GladeAtkActionInfo)); - accels = g_array_new (FALSE, FALSE, sizeof (GladeAccelInfo)); - - for (list = widget->properties; list; list = list->next) - { - GladeProperty *property = list->data; - - /* This should never happen */ - if (property->klass->packing) - continue; - - switch (property->klass->type) - { - case GPC_NORMAL: - glade_property_write (property, interface, props); - break; - case GPC_ATK_PROPERTY: - glade_property_write (property, interface, atk_props); - break; - case GPC_ATK_RELATION: - glade_property_write (property, interface, atk_relations); - break; - case GPC_ATK_ACTION: - glade_property_write (property, interface, atk_actions); - break; - case GPC_ACCEL_PROPERTY: - glade_property_write (property, interface, accels); - break; - default: - break; - } - } - - /* Properties */ - info->properties = (GladePropInfo *) props->data; - info->n_properties = props->len; - g_array_free(props, FALSE); - - /* Atk Properties */ - info->atk_props = (GladePropInfo *) atk_props->data; - info->n_atk_props = atk_props->len; - g_array_free(atk_props, FALSE); - - /* Atk Relations */ - info->relations = (GladeAtkRelationInfo *) atk_relations->data; - info->n_relations = atk_relations->len; - g_array_free(atk_relations, FALSE); - - /* Atk Actions */ - info->atk_actions = (GladeAtkActionInfo *) atk_actions->data; - info->n_atk_actions = atk_actions->len; - g_array_free(atk_actions, FALSE); - - /* Accels */ - info->accels = (GladeAccelInfo *) accels->data; - info->n_accels = accels->len; - g_array_free(accels, FALSE); - - /* Signals */ - write_signals_context.interface = interface; - write_signals_context.signals = g_array_new (FALSE, FALSE, - sizeof (GladeSignalInfo)); - g_hash_table_foreach (widget->signals, - glade_widget_write_signals, - &write_signals_context); - info->signals = (GladeSignalInfo *) - write_signals_context.signals->data; - info->n_signals = write_signals_context.signals->len; - g_array_free (write_signals_context.signals, FALSE); - - /* Children */ - if ((list = - glade_widget_adaptor_get_children (widget->adaptor, - widget->object)) != NULL) - { - children = g_array_new (FALSE, FALSE, sizeof (GladeChildInfo)); - while (list && list->data) - { - GObject *child = list->data; - glade_widget_write_child (children, widget, child, interface); - list = list->next; - } - info->children = (GladeChildInfo *) children->data; - info->n_children = children->len; - - g_array_free (children, FALSE); - g_list_free (list); - } - g_hash_table_insert(interface->names, info->name, info); - - return info; -} - - -static gboolean -glade_widget_write_special_child_prop (GArray *props, - GladeWidget *parent, - GObject *object, - GladeInterface *interface) -{ - GladePropInfo info = { 0 }; - gchar *buff, *special_child_type; - - buff = g_object_get_data (object, "special-child-type"); - - g_object_get (parent->adaptor, "special-child-type", &special_child_type, NULL); - - if (special_child_type && buff) - { - info.name = glade_xml_alloc_propname (interface, - special_child_type); - info.value = glade_xml_alloc_string (interface, buff); - g_array_append_val (props, info); - - g_free (special_child_type); - return TRUE; - } - g_free (special_child_type); - return FALSE; -} - -gboolean -glade_widget_write_child (GArray *children, - GladeWidget *parent, - GObject *object, - GladeInterface *interface) -{ - GladeChildInfo info = { 0 }; - GladeWidget *child_widget; - GList *list; - GArray *props; - - if (GLADE_IS_PLACEHOLDER (object)) - { - props = g_array_new (FALSE, FALSE, - sizeof (GladePropInfo)); - /* Here we have to add the "special-child-type" packing property */ - glade_widget_write_special_child_prop (props, parent, - object, interface); - - info.properties = (GladePropInfo *) props->data; - info.n_properties = props->len; - g_array_free(props, FALSE); - - g_array_append_val (children, info); - - return TRUE; - } - - child_widget = glade_widget_get_from_gobject (object); - if (!child_widget) - return FALSE; - - if (child_widget->internal) - info.internal_child = glade_xml_alloc_string(interface, child_widget->internal); - - info.child = glade_widget_write (child_widget, interface); - if (!info.child) - { - g_warning ("Failed to write child widget"); - return FALSE; - } - - /* Append the packing properties */ - props = g_array_new (FALSE, FALSE, sizeof (GladePropInfo)); - - /* Here we have to add the "special-child-type" packing property */ - glade_widget_write_special_child_prop (props, parent, - child_widget->object, - interface); - - if (child_widget->packing_properties != NULL) - { - for (list = child_widget->packing_properties; - list; list = list->next) - { - GladeProperty *property; - - property = list->data; - g_assert (property->klass->packing != FALSE); - glade_property_write (property, interface, props); - } - } - - info.properties = (GladePropInfo *) props->data; - info.n_properties = props->len; - g_array_free(props, FALSE); - - g_array_append_val (children, info); - - return TRUE; -} - -#endif // LOADING_WAS_IMPLEMENTED - - /******************************************************************************* * Xml Parsing code * *******************************************************************************/ @@ -3635,7 +3372,7 @@ glade_widget_read_children (GladeWidget *widget, widget, widget_node, internal_name); - + if (child_widget) { if (!internal_name) { @@ -3655,9 +3392,9 @@ glade_widget_read_children (GladeWidget *widget, packing; packing = packing->next) { GladeProperty *property = packing->data; - glade_property_read - (property, property->klass, - loading_project, packing_node, TRUE); + glade_property_read (property, + child_widget->project, + packing_node); } } } @@ -3698,9 +3435,7 @@ glade_widget_read (GladeProject *project, GladeWidget *widget = NULL; gchar *klass, *id; - glade_widget_push_superuser (); - loading_project = project; if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET)) return NULL; @@ -3765,12 +3500,164 @@ glade_widget_read (GladeProject *project, g_free (klass); } - loading_project = NULL; glade_widget_pop_superuser (); return widget; } +static void +glade_widget_write_special_child_prop (GladeWidget *parent, + GObject *object, + GladeXmlContext *context, + GladeXmlNode *node) +{ + GladeXmlNode *prop_node; + gchar *buff, *special_child_type; + + buff = g_object_get_data (object, "special-child-type"); + g_object_get (parent->adaptor, "special-child-type", &special_child_type, NULL); + + if (special_child_type && buff) + { + + prop_node = glade_xml_node_new (context, GLADE_XML_TAG_PROPERTY); + glade_xml_node_append_child (node, prop_node); + + /* Name and value */ + glade_xml_node_set_property_string (prop_node, + GLADE_XML_TAG_NAME, + special_child_type); + glade_xml_set_content (prop_node, buff); + + } + g_free (special_child_type); +} + +static void +glade_widget_write_child (GladeWidget *widget, + GladeXmlContext *context, + GladeXmlNode *node) +{ + GladeXmlNode *child_node, *packing_node; + GList *props; + + child_node = glade_xml_node_new (context, GLADE_XML_TAG_CHILD); + glade_xml_node_append_child (node, child_node); + + /* Set internal child */ + if (widget->internal) + glade_xml_node_set_property_string (child_node, + GLADE_XML_TAG_INTERNAL_CHILD, + widget->internal); + + /* Write out the widget */ + glade_widget_write (widget, context, child_node); + + /* Write out packing properties and special-child-type */ + packing_node = glade_xml_node_new (context, GLADE_XML_TAG_PACKING); + glade_xml_node_append_child (child_node, packing_node); + + for (props = widget->packing_properties; + props; props = props->next) + glade_property_write (GLADE_PROPERTY (props->data), + context, packing_node); + + glade_widget_write_special_child_prop (widget->parent, + widget->object, + context, packing_node); + + + /* Default packing properties and such are not saved, + * so lets check afterwords if there was anything saved + * and then just remove the node. + */ + if (!glade_xml_node_get_children (packing_node)) + { + glade_xml_node_remove (packing_node); + glade_xml_node_delete (packing_node); + } +} + +static void +glade_widget_write_placeholder (GladeWidget *parent, + GObject *object, + GladeXmlContext *context, + GladeXmlNode *node) +{ + GladeXmlNode *child_node, *packing_node, *placeholder_node; + + child_node = glade_xml_node_new (context, GLADE_XML_TAG_CHILD); + glade_xml_node_append_child (node, child_node); + + placeholder_node = glade_xml_node_new (context, GLADE_XML_TAG_PLACEHOLDER); + glade_xml_node_append_child (child_node, placeholder_node); + + /* maybe write out special-child-type here */ + packing_node = glade_xml_node_new (context, GLADE_XML_TAG_PACKING); + glade_xml_node_append_child (child_node, packing_node); + + glade_widget_write_special_child_prop (parent, object, + context, packing_node); + + if (!glade_xml_node_get_children (packing_node)) + { + glade_xml_node_remove (packing_node); + glade_xml_node_delete (packing_node); + } +} + +/** + * glade_widget_write: + * @widget: The #GladeWidget + * @context: A #GladeXmlContext + * @node: A #GladeXmlNode + * + * Recursively writes out @widget and its children + * and appends the created #GladeXmlNode to @node. + */ +void +glade_widget_write (GladeWidget *widget, + GladeXmlContext *context, + GladeXmlNode *node) +{ + GladeXmlNode *widget_node; + GList *list, *l; + + widget_node = glade_xml_node_new (context, GLADE_XML_TAG_WIDGET); + glade_xml_node_append_child (node, widget_node); + + /* Set class and id */ + glade_xml_node_set_property_string (widget_node, + GLADE_XML_TAG_CLASS, + widget->adaptor->name); + glade_xml_node_set_property_string (widget_node, + GLADE_XML_TAG_ID, + widget->name); + + /* Write out widget content (properties and signals) */ + glade_widget_adaptor_write_widget (widget->adaptor, widget, context, widget_node); + + /* Write out children */ + if ((list = + glade_widget_adaptor_get_children (widget->adaptor, + widget->object)) != NULL) + { + for (l = list; l; l = l->next) + { + GladeWidget *child = glade_widget_get_from_gobject (l->data); + + if (child) + glade_widget_write_child (child, context, widget_node); + else if (GLADE_IS_PLACEHOLDER (l->data)) + glade_widget_write_placeholder (widget, + G_OBJECT (l->data), + context, widget_node); + } + g_list_free (list); + } + +} + static gint glade_widget_su_stack = 0; diff --git a/gladeui/glade-widget.h b/gladeui/glade-widget.h index 53ef806a..b872e330 100644 --- a/gladeui/glade-widget.h +++ b/gladeui/glade-widget.h @@ -97,7 +97,6 @@ struct _GladeWidget /* Construct parameters: */ GladeWidget *construct_template; -/* GladeWidgetInfo *construct_info; */ GladeCreateReason construct_reason; gchar *construct_internal; }; @@ -213,9 +212,10 @@ void glade_widget_remove_pack_action (GladeWidget *widget GtkWidget * glade_widget_create_action_menu (GladeWidget *widget, const gchar *action_path); -/* XXX GladeWidgetInfo *glade_widget_write (GladeWidget *widget, */ -/* GladeInterface *interface); */ - +void glade_widget_write (GladeWidget *widget, + GladeXmlContext *context, + GladeXmlNode *node); + GladeWidget *glade_widget_read (GladeProject *project, GladeWidget *parent, GladeXmlNode *node, diff --git a/gladeui/glade-xml-utils.c b/gladeui/glade-xml-utils.c index a2246383..daca97be 100644 --- a/gladeui/glade-xml-utils.c +++ b/gladeui/glade-xml-utils.c @@ -538,7 +538,7 @@ GladeXmlContext * glade_xml_context_new (GladeXmlDoc *doc, const gchar *name_space) { /* We are not using the namespace now */ - return glade_xml_context_new_real (doc, FALSE, NULL); + return glade_xml_context_new_real (doc, TRUE, NULL); } void @@ -630,6 +630,17 @@ glade_xml_node_append_child (GladeXmlNode *node_in, GladeXmlNode *child_in) xmlAddChild (node, child); } +void +glade_xml_node_remove (GladeXmlNode *node_in) +{ + xmlNodePtr node = (xmlNodePtr) node_in; + + g_return_if_fail (node != NULL); + + xmlReplaceNode (node, NULL); +} + + GladeXmlNode * glade_xml_node_new (GladeXmlContext *context, const gchar *name) { @@ -744,41 +755,6 @@ glade_xml_doc_get_root (GladeXmlDoc *doc) return (GladeXmlNode *)node; } -#if OBSOLETE_CODE_HERE -gchar * -glade_xml_alloc_string(GladeInterface *interface, const gchar *string) -{ - gchar *s; - - s = g_hash_table_lookup(interface->strings, string); - if (!s) { - s = g_strdup(string); - g_hash_table_insert(interface->strings, s, s); - } - - return s; -} - -gchar * -glade_xml_alloc_propname(GladeInterface *interface, const gchar *string) -{ - static GString *norm_str; - guint i; - - if (!norm_str) - norm_str = g_string_new_len(NULL, 64); - - /* assign the string to norm_str */ - g_string_assign(norm_str, string); - /* convert all dashes to underscores */ - for (i = 0; i < norm_str->len; i++) - if (norm_str->str[i] == '-') - norm_str->str[i] = '_'; - - return glade_xml_alloc_string(interface, norm_str->str); -} -#endif // OBSOLETE_CODE_HERE - gboolean glade_xml_load_sym_from_node (GladeXmlNode *node_in, GModule *module, diff --git a/gladeui/glade-xml-utils.h b/gladeui/glade-xml-utils.h index 4d23fda1..92e7eb99 100644 --- a/gladeui/glade-xml-utils.h +++ b/gladeui/glade-xml-utils.h @@ -35,6 +35,8 @@ typedef struct _GladeXmlDoc GladeXmlDoc; #define GLADE_XML_TAG_PACKING "packing" #define GLADE_XML_TAG_PLACEHOLDER "placeholder" #define GLADE_XML_TAG_INTERNAL_CHILD "internal-child" +#define GLADE_XML_TAG_I18N_TRUE "yes" +#define GLADE_XML_TAG_SIGNAL_TRUE "yes" #define GLADE_TAG_GLADE_CATALOG "glade-catalog" #define GLADE_TAG_GLADE_WIDGET_CLASSES "glade-widget-classes" @@ -64,6 +66,7 @@ typedef struct _GladeXmlDoc GladeXmlDoc; #define GLADE_TAG_ACTION_ACTIVATE_FUNCTION "action-activate-function" #define GLADE_TAG_CHILD_ACTION_ACTIVATE_FUNCTION "child-action-activate-function" #define GLADE_TAG_READ_WIDGET_FUNCTION "read-widget-function" +#define GLADE_TAG_WRITE_WIDGET_FUNCTION "write-widget-function" #define GLADE_TAG_CREATE_EPROP_FUNCTION "create-editor-property-function" #define GLADE_TAG_STRING_FROM_VALUE_FUNCTION "string-from-value-function" #define GLADE_TAG_PROPERTIES "properties" @@ -171,6 +174,8 @@ gboolean glade_xml_node_verify (GladeXmlNode * node_in, const gchar *name) gboolean glade_xml_node_verify_silent (GladeXmlNode *node_in, const gchar *name); const gchar * glade_xml_node_get_name (GladeXmlNode *node_in); void glade_xml_node_append_child (GladeXmlNode * node, GladeXmlNode * child); +void glade_xml_node_remove (GladeXmlNode *node_in); + /* Document Operatons */ GladeXmlNode * glade_xml_doc_get_root (GladeXmlDoc *doc); @@ -188,9 +193,6 @@ GladeXmlContext * glade_xml_context_new_from_path (const gchar *full_path, const gchar *root_name); GladeXmlDoc * glade_xml_context_get_doc (GladeXmlContext *context); -/* XXX gchar * glade_xml_alloc_string (GladeInterface *interface, const gchar *string); */ -/* XXX gchar * glade_xml_alloc_propname (GladeInterface *interface, const gchar *string); */ - gboolean glade_xml_load_sym_from_node (GladeXmlNode *node_in, GModule *module, gchar *tagname, diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c index c9353c1f..ff26a73a 100644 --- a/plugins/gtk+/glade-gtk.c +++ b/plugins/gtk+/glade-gtk.c @@ -360,7 +360,7 @@ glade_gtk_widget_read_accels (GladeWidget *widget, key = glade_xml_get_property_string_required (prop, GLADE_TAG_ACCEL_KEY, NULL); signal = glade_xml_get_property_string_required - (prop, GLADE_TAG_ACCEL_MODIFIERS, NULL); + (prop, GLADE_TAG_ACCEL_SIGNAL, NULL); modifiers = glade_xml_get_property_string (prop, GLADE_TAG_ACCEL_MODIFIERS); /* translate to GladeAccelInfo... */ @@ -586,6 +586,327 @@ glade_gtk_widget_read_widget (GladeWidgetAdaptor *adaptor, } +static void +glade_gtk_widget_write_atk_property (GladeProperty *property, + GladeXmlContext *context, + GladeXmlNode *node) +{ + GladeXmlNode *prop_node; + gchar *value; + + glade_property_get (property, &value); + if (value && value[0]) + { + prop_node = glade_xml_node_new (context, GLADE_TAG_A11Y_PROPERTY); + glade_xml_node_append_child (node, prop_node); + + glade_xml_node_set_property_string (prop_node, + GLADE_TAG_NAME, + property->klass->id); + + glade_xml_set_content (prop_node, value); + + if (property->i18n_translatable) + glade_xml_node_set_property_string (prop_node, + GLADE_TAG_TRANSLATABLE, + GLADE_XML_TAG_I18N_TRUE); + + if (property->i18n_has_context) + glade_xml_node_set_property_string (prop_node, + GLADE_TAG_HAS_CONTEXT, + GLADE_XML_TAG_I18N_TRUE); + + + if (property->i18n_comment) + glade_xml_node_set_property_string (prop_node, + GLADE_TAG_COMMENT, + property->i18n_comment); + } +} + +static void +glade_gtk_widget_write_atk_properties (GladeWidget *widget, + GladeXmlContext *context, + GladeXmlNode *node) +{ + GladeProperty *name_prop, *desc_prop; + + name_prop = glade_widget_get_property (widget, "AtkObject::accessible-name"); + desc_prop = glade_widget_get_property (widget, "AtkObject::accessible-description"); + + glade_gtk_widget_write_atk_property (name_prop, context, node); + glade_gtk_widget_write_atk_property (desc_prop, context, node); +} + +static void +glade_gtk_widget_write_atk_relation (GladeProperty *property, + GladeXmlContext *context, + GladeXmlNode *node) +{ + GladeXmlNode *prop_node; + gchar *value, **split; + gint i; + + if ((value = glade_widget_adaptor_string_from_value + (GLADE_WIDGET_ADAPTOR (property->klass->handle), + property->klass, property->value)) != NULL) + { + if ((split = g_strsplit (value, GPC_OBJECT_DELIMITER, 0)) != NULL) + { + for (i = 0; split[i] != NULL; i++) + { + prop_node = glade_xml_node_new (context, GLADE_TAG_A11Y_RELATION); + glade_xml_node_append_child (node, prop_node); + + glade_xml_node_set_property_string (prop_node, + GLADE_TAG_A11Y_TYPE, + property->klass->id); + glade_xml_node_set_property_string (prop_node, + GLADE_TAG_A11Y_TARGET, + split[i]); + } + g_strfreev (split); + } + } +} + +static void +glade_gtk_widget_write_atk_relations (GladeWidget *widget, + GladeXmlContext *context, + GladeXmlNode *node) +{ + GladeProperty *property; + gint i; + + for (i = 0; atk_relations_list[i]; i++) + { + if ((property = + glade_widget_get_property (widget, + atk_relations_list[i]))) + glade_gtk_widget_write_atk_relation (property, context, node); + else + g_warning ("Couldnt find atk relation %s on widget %s", + atk_relations_list[i], widget->name); + } +} + +static void +glade_gtk_widget_write_atk_action (GladeProperty *property, + GladeXmlContext *context, + GladeXmlNode *node) +{ + GladeXmlNode *prop_node; + gchar *value = NULL; + + glade_property_get (property, &value); + + if (value && value[0]) + { + prop_node = glade_xml_node_new (context, GLADE_TAG_A11Y_ACTION); + glade_xml_node_append_child (node, prop_node); + + glade_xml_node_set_property_string (prop_node, + GLADE_TAG_A11Y_ACTION_NAME, + &property->klass->id[4]); + glade_xml_node_set_property_string (prop_node, + GLADE_TAG_A11Y_DESC, + value); + } +} + +static void +glade_gtk_widget_write_atk_actions (GladeWidget *widget, + GladeXmlContext *context, + GladeXmlNode *node) +{ + GladeProperty *property; + + if ((property = glade_widget_get_property (widget, "atk-click")) != NULL) + glade_gtk_widget_write_atk_action (property, context, node); + if ((property = glade_widget_get_property (widget, "atk-activate")) != NULL) + glade_gtk_widget_write_atk_action (property, context, node); + if ((property = glade_widget_get_property (widget, "atk-press")) != NULL) + glade_gtk_widget_write_atk_action (property, context, node); + if ((property = glade_widget_get_property (widget, "atk-release")) != NULL) + glade_gtk_widget_write_atk_action (property, context, node); +} + +static void +glade_gtk_widget_write_atk_props (GladeWidget *widget, + GladeXmlContext *context, + GladeXmlNode *node) +{ + GladeXmlNode *atk_node; + + atk_node = glade_xml_node_new (context, GLADE_TAG_A11Y_A11Y); + glade_xml_node_append_child (node, atk_node); + + glade_gtk_widget_write_atk_properties (widget, context, atk_node); + glade_gtk_widget_write_atk_relations (widget, context, atk_node); + glade_gtk_widget_write_atk_actions (widget, context, atk_node); + + if (!glade_xml_node_get_children (atk_node)) + { + glade_xml_node_remove (atk_node); + glade_xml_node_delete (atk_node); + } +} + +static gchar * +glade_gtk_modifier_string_from_bits (GdkModifierType modifiers) +{ + GString *string = g_string_new (""); + + if (modifiers & GDK_SHIFT_MASK) { + if (string->len > 0) + g_string_append (string, " | "); + g_string_append (string, "GDK_SHIFT_MASK"); + } + + if (modifiers & GDK_LOCK_MASK) { + if (string->len > 0) + g_string_append (string, " | "); + g_string_append (string, "GDK_LOCK_MASK"); + } + + if (modifiers & GDK_CONTROL_MASK) { + if (string->len > 0) + g_string_append (string, " | "); + g_string_append (string, "GDK_CONTROL_MASK"); + } + + if (modifiers & GDK_MOD1_MASK) { + if (string->len > 0) + g_string_append (string, " | "); + g_string_append (string, "GDK_MOD1_MASK"); + } + + if (modifiers & GDK_MOD2_MASK) { + if (string->len > 0) + g_string_append (string, " | "); + g_string_append (string, "GDK_MOD2_MASK"); + } + + if (modifiers & GDK_MOD3_MASK) { + if (string->len > 0) + g_string_append (string, " | "); + g_string_append (string, "GDK_MOD3_MASK"); + } + + if (modifiers & GDK_MOD4_MASK) { + if (string->len > 0) + g_string_append (string, " | "); + g_string_append (string, "GDK_MOD4_MASK"); + } + + if (modifiers & GDK_MOD5_MASK) { + if (string->len > 0) + g_string_append (string, " | "); + g_string_append (string, "GDK_MOD5_MASK"); + } + + if (modifiers & GDK_BUTTON1_MASK) { + if (string->len > 0) + g_string_append (string, " | "); + g_string_append (string, "GDK_BUTTON1_MASK"); + } + + if (modifiers & GDK_BUTTON2_MASK) { + if (string->len > 0) + g_string_append (string, " | "); + g_string_append (string, "GDK_BUTTON2_MASK"); + } + + if (modifiers & GDK_BUTTON3_MASK) { + if (string->len > 0) + g_string_append (string, " | "); + g_string_append (string, "GDK_BUTTON3_MASK"); + } + + if (modifiers & GDK_BUTTON4_MASK) { + if (string->len > 0) + g_string_append (string, " | "); + g_string_append (string, "GDK_BUTTON4_MASK"); + } + + if (modifiers & GDK_BUTTON5_MASK) { + if (string->len > 0) + g_string_append (string, " | "); + g_string_append (string, "GDK_BUTTON5_MASK"); + } + + if (modifiers & GDK_RELEASE_MASK) { + if (string->len > 0) + g_string_append (string, " | "); + g_string_append (string, "GDK_RELEASE_MASK"); + } + + if (string->len > 0) + return g_string_free (string, FALSE); + + g_string_free (string, TRUE); + return NULL; +} + + +static void +glade_gtk_widget_write_accels (GladeWidget *widget, + GladeXmlContext *context, + GladeXmlNode *node) +{ + GladeXmlNode *accel_node; + GladeProperty *property; + GList *list; + + /* Some child widgets may have disabled the property */ + if (!(property = glade_widget_get_property (widget, "accelerator"))) + return; + + for (list = g_value_get_boxed (property->value); + list; list = list->next) + { + GladeAccelInfo *accel = list->data; + gchar *modifiers = glade_gtk_modifier_string_from_bits (accel->modifiers); + + accel_node = glade_xml_node_new (context, GLADE_TAG_ACCEL); + glade_xml_node_append_child (node, accel_node); + + glade_xml_node_set_property_string (accel_node, GLADE_TAG_ACCEL_KEY, + gdk_keyval_name(accel->key)); + glade_xml_node_set_property_string (accel_node, GLADE_TAG_ACCEL_SIGNAL, + accel->signal); + glade_xml_node_set_property_string (accel_node, GLADE_TAG_ACCEL_MODIFIERS, + modifiers); + + g_free (modifiers); + } + + +} + +void +glade_gtk_widget_write_widget (GladeWidgetAdaptor *adaptor, + GladeWidget *widget, + GladeXmlContext *context, + GladeXmlNode *node) +{ + /* This code should work the same for <packing> and <widget> */ + if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET)) + return; + + /* First chain up and read in all the normal properties.. */ + GWA_GET_CLASS (G_TYPE_OBJECT)->write_widget (adaptor, widget, context, node); + + + /* Write atk props */ + glade_gtk_widget_write_atk_props (widget, context, node); + + /* Write accelerators */ + glade_gtk_widget_write_accels (widget, context, node); + +} + + GladeEditorProperty * glade_gtk_widget_create_eprop (GladeWidgetAdaptor *adaptor, GladePropertyClass *klass, diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in index 2df77877..fa366b43 100644 --- a/plugins/gtk+/gtk+.xml.in +++ b/plugins/gtk+/gtk+.xml.in @@ -12,6 +12,7 @@ <get-property-function>glade_gtk_widget_get_property</get-property-function> <action-activate-function>glade_gtk_widget_action_activate</action-activate-function> <read-widget-function>glade_gtk_widget_read_widget</read-widget-function> + <write-widget-function>glade_gtk_widget_write_widget</write-widget-function> <create-editor-property-function>glade_gtk_widget_create_eprop</create-editor-property-function> <string-from-value-function>glade_gtk_widget_string_from_value</string-from-value-function> @@ -87,101 +88,101 @@ <property id="has-default" ignore="True" common="True"/> <!-- Accelerators --> - <property id="accelerator" _name="Accelerators" ignore="True" common="True"> + <property id="accelerator" _name="Accelerators" ignore="True" common="True" save="False"> <spec>glade_standard_accel_spec</spec> </property> <!-- Atk name and description properties --> - <property id="AtkObject::accessible-name" _name="Accessible Name" ignore="True" atk-property="True" translatable="True"> + <property id="AtkObject::accessible-name" _name="Accessible Name" ignore="True" atk-property="True" translatable="True" save="False"> <_tooltip>Object instance's name formatted for assistive technology access</_tooltip> <spec>glade_standard_string_spec</spec> <visible-lines>2</visible-lines> </property> - <property id="AtkObject::accessible-description" _name="Accessible Description" ignore="True" atk-property="True" translatable="True"> + <property id="AtkObject::accessible-description" _name="Accessible Description" ignore="True" atk-property="True" translatable="True" save="False"> <_tooltip>Description of an object, formatted for assistive technology access</_tooltip> <spec>glade_standard_string_spec</spec> <visible-lines>2</visible-lines> </property> <!-- Atk relationset properties --> - <property id="controlled-by" _name="Controlled By" ignore="True" atk-property="True"> + <property id="controlled-by" _name="Controlled By" ignore="True" atk-property="True" save="False"> <_tooltip>Indicates an object controlled by one or more target objects</_tooltip> <spec>glade_standard_objects_spec</spec> </property> - <property id="controller-for" _name="Controller For" ignore="True" atk-property="True"> + <property id="controller-for" _name="Controller For" ignore="True" atk-property="True" save="False"> <_tooltip>Indicates an object is a controller for one or more target objects</_tooltip> <spec>glade_standard_objects_spec</spec> </property> - <property id="labelled-by" _name="Labelled By" ignore="True" atk-property="True"> + <property id="labelled-by" _name="Labelled By" ignore="True" atk-property="True" save="False"> <_tooltip>Indicates an object is labelled by one or more target objects</_tooltip> <spec>glade_standard_objects_spec</spec> </property> - <property id="label-for" _name="Label For" ignore="True" atk-property="True"> + <property id="label-for" _name="Label For" ignore="True" atk-property="True" save="False"> <_tooltip>Indicates an object is a label for one or more target objects</_tooltip> <spec>glade_standard_objects_spec</spec> </property> - <property id="member-of" _name="Member Of" ignore="True" atk-property="True"> + <property id="member-of" _name="Member Of" ignore="True" atk-property="True" save="False"> <_tooltip>Indicates an object is a member of a group of one or more target objects</_tooltip> <spec>glade_standard_objects_spec</spec> </property> - <property id="node-child-of" _name="Node Child Of" ignore="True" atk-property="True"> + <property id="node-child-of" _name="Node Child Of" ignore="True" atk-property="True" save="False"> <_tooltip>Indicates an object is a cell in a treetable which is displayed because a cell in the same column is expanded and identifies that cell</_tooltip> <spec>glade_standard_objects_spec</spec> </property> - <property id="flows-to" _name="Flows To" ignore="True" atk-property="True"> + <property id="flows-to" _name="Flows To" ignore="True" atk-property="True" save="False"> <_tooltip>Indicates that the object has content that flows logically to another AtkObject in a sequential way, (for instance text-flow)</_tooltip> <spec>glade_standard_objects_spec</spec> </property> - <property id="flows-from" _name="Flows From" ignore="True" atk-property="True"> + <property id="flows-from" _name="Flows From" ignore="True" atk-property="True" save="False"> <_tooltip>Indicates that the object has content that flows logically from another AtkObject in a sequential way, (for instance text-flow)</_tooltip> <spec>glade_standard_objects_spec</spec> </property> - <property id="subwindow-of" _name="Subwindow Of" ignore="True" atk-property="True"> + <property id="subwindow-of" _name="Subwindow Of" ignore="True" atk-property="True" save="False"> <_tooltip>Indicates a subwindow attached to a component but otherwise has no connection in the UI hierarchy to that component</_tooltip> <spec>glade_standard_objects_spec</spec> </property> - <property id="embeds" _name="Embeds" ignore="True" atk-property="True"> + <property id="embeds" _name="Embeds" ignore="True" atk-property="True" save="False"> <_tooltip>Indicates that the object visually embeds another object's content, i.e. this object's content flows around another's content</_tooltip> <spec>glade_standard_objects_spec</spec> </property> - <property id="embedded-by" _name="Embedded By" ignore="True" atk-property="True"> + <property id="embedded-by" _name="Embedded By" ignore="True" atk-property="True" save="False"> <_tooltip>Inverse of 'Embeds', indicates that this object's content is visually embedded in another object</_tooltip> <spec>glade_standard_objects_spec</spec> </property> - <property id="popup-for" _name="Popup For" ignore="True" atk-property="True"> + <property id="popup-for" _name="Popup For" ignore="True" atk-property="True" save="False"> <_tooltip>Indicates that an object is a popup for another object</_tooltip> <spec>glade_standard_objects_spec</spec> </property> - <property id="parent-window-of" _name="Parent Window Of" ignore="True" atk-property="True"> + <property id="parent-window-of" _name="Parent Window Of" ignore="True" atk-property="True" save="False"> <_tooltip>Indicates that an object is a parent window of another object</_tooltip> <spec>glade_standard_objects_spec</spec> </property> - <property id="described-by" _name="Described By" ignore="True" atk-property="True"> + <property id="described-by" _name="Described By" ignore="True" atk-property="True" save="False"> <_tooltip>Indicates that another object provides descriptive information about this object; more verbose than 'Labelled By'</_tooltip> <spec>glade_standard_objects_spec</spec> </property> - <property id="description-for" _name="Description For" ignore="True" atk-property="True"> + <property id="description-for" _name="Description For" ignore="True" atk-property="True" save="False"> <_tooltip>Indicates that an object provides descriptive information about another object; more verbose than 'Label For'</_tooltip> <spec>glade_standard_objects_spec</spec> </property> @@ -354,7 +355,7 @@ embedded in another object</_tooltip> <spec>glade_standard_boolean_spec</spec> </property> <!-- Atk click property --> - <property id="atk-click" _name="Click" ignore="True" atk-property="True"> + <property id="atk-click" _name="Click" ignore="True" atk-property="True" save="False"> <_tooltip>Set the description of the Click atk action</_tooltip> <spec>glade_standard_string_spec</spec> <visible-lines>2</visible-lines> @@ -608,7 +609,7 @@ embedded in another object</_tooltip> </displayable-values> </property> <!-- Atk activate property --> - <property id="atk-activate" _name="Activate" ignore="True" atk-property="True"> + <property id="atk-activate" _name="Activate" ignore="True" atk-property="True" save="False"> <_tooltip>Set the description of the Activate atk action</_tooltip> <spec>glade_standard_string_spec</spec> <visible-lines>2</visible-lines> @@ -702,21 +703,21 @@ embedded in another object</_tooltip> </property> <!-- Atk click property --> - <property id="atk-click" _name="Click" ignore="True" atk-property="True"> + <property id="atk-click" _name="Click" ignore="True" atk-property="True" save="False"> <_tooltip>Set the description of the Click atk action</_tooltip> <spec>glade_standard_string_spec</spec> <visible-lines>2</visible-lines> </property> <!-- Atk press property --> - <property id="atk-press" _name="Press" ignore="True" atk-property="True"> + <property id="atk-press" _name="Press" ignore="True" atk-property="True" save="False"> <_tooltip>Set the description of the Press atk action</_tooltip> <spec>glade_standard_string_spec</spec> <visible-lines>2</visible-lines> </property> <!-- Atk release property --> - <property id="atk-release" _name="Release" ignore="True" atk-property="True"> + <property id="atk-release" _name="Release" ignore="True" atk-property="True" save="False"> <_tooltip>Set the description of the Release atk action</_tooltip> <spec>glade_standard_string_spec</spec> <visible-lines>2</visible-lines> @@ -857,7 +858,7 @@ embedded in another object</_tooltip> </property> <!-- Atk press property --> - <property id="atk-press" _name="Press" ignore="True" atk-property="True"> + <property id="atk-press" _name="Press" ignore="True" atk-property="True" save="False"> <_tooltip>Set the description of the Press atk action</_tooltip> <spec>glade_standard_string_spec</spec> <visible-lines>2</visible-lines> @@ -1295,7 +1296,7 @@ embedded in another object</_tooltip> <property id="label-widget" disabled="True"/> <!-- Atk activate property --> - <property id="atk-activate" _name="Activate" ignore="True" atk-property="True"> + <property id="atk-activate" _name="Activate" ignore="True" atk-property="True" save="False"> <_tooltip>Set the description of the Activate atk action</_tooltip> <spec>glade_standard_string_spec</spec> <visible-lines>2</visible-lines> @@ -1480,7 +1481,7 @@ embedded in another object</_tooltip> <property id="size" disabled="True"/> <!-- Atk press property --> - <property id="atk-press" _name="Press" ignore="True" atk-property="True"> + <property id="atk-press" _name="Press" ignore="True" atk-property="True" save="False"> <_tooltip>Set the description of the Press atk action</_tooltip> <spec>glade_standard_string_spec</spec> <visible-lines>2</visible-lines> @@ -1492,7 +1493,7 @@ embedded in another object</_tooltip> <glade-widget-class name="GtkOptionMenu" generic-name="optionmenu" _title="Option Menu"> <properties> <!-- Atk press property --> - <property id="atk-press" _name="Press" ignore="True" atk-property="True"> + <property id="atk-press" _name="Press" ignore="True" atk-property="True" save="False"> <_tooltip>Set the description of the Press atk action</_tooltip> <spec>glade_standard_string_spec</spec> <visible-lines>2</visible-lines> |