diff options
author | Tristan Van Berkom <tvb@src.gnome.org> | 2008-12-09 18:46:04 +0000 |
---|---|---|
committer | Tristan Van Berkom <tvb@src.gnome.org> | 2008-12-09 18:46:04 +0000 |
commit | 0c97337671d8d711937c0b74adef86e405111ba1 (patch) | |
tree | 8b004f3552e16c5d964c811287055d828b7e5fe4 | |
parent | a2a5cd045b14b6d92a5a368d642ec3852486b40a (diff) | |
download | glade-0c97337671d8d711937c0b74adef86e405111ba1.tar.gz |
Bumping gtk+ required version to 2.14
* configure.ac: Bumping gtk+ required version to 2.14
* gladeui/glade-xml-utils.c, gladeui/glade-widget-adaptor.[ch],
gladeui/glade-property-class.[ch], gladeui/glade-project.c: Added support
for "builder-since" versioning (since builder supported this property/widget).
* plugins/gtk+/gtk+.xml.in: Marked appropriate properties and objects "builder-since"
and brought up to date new properties and signals introduced in 2.14.
* gladeui/glade-base-editor.c: Plugged resource leak in finalize().
svn path=/trunk/; revision=2060
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | gladeui/glade-base-editor.c | 25 | ||||
-rw-r--r-- | gladeui/glade-project.c | 321 | ||||
-rw-r--r-- | gladeui/glade-property-class.c | 9 | ||||
-rw-r--r-- | gladeui/glade-property-class.h | 10 | ||||
-rw-r--r-- | gladeui/glade-property.h | 52 | ||||
-rw-r--r-- | gladeui/glade-widget-adaptor.c | 15 | ||||
-rw-r--r-- | gladeui/glade-widget-adaptor.h | 83 | ||||
-rw-r--r-- | gladeui/glade-xml-utils.h | 1 | ||||
-rw-r--r-- | plugins/gtk+/gtk+.xml.in | 64 |
11 files changed, 399 insertions, 196 deletions
@@ -1,3 +1,16 @@ +2008-12-09 Tristan Van Berkom <tvb@gnome.org> + + * configure.ac: Bumping gtk+ required version to 2.14 + + * gladeui/glade-xml-utils.c, gladeui/glade-widget-adaptor.[ch], + gladeui/glade-property-class.[ch], gladeui/glade-project.c: Added support + for "builder-since" versioning (since builder supported this property/widget). + + * plugins/gtk+/gtk+.xml.in: Marked appropriate properties and objects "builder-since" + and brought up to date new properties and signals introduced in 2.14. + + * gladeui/glade-base-editor.c: Plugged resource leak in finalize(). + 2008-11-28 Juan Pablo Ugarte <juanpablougarte@gmail.com> * gladeui/glade-inspector.c: added explanation string in the search entry. diff --git a/configure.ac b/configure.ac index 91eeeb66..3766b8c0 100644 --- a/configure.ac +++ b/configure.ac @@ -116,7 +116,7 @@ GTK_DOC_CHECK(1.9) dnl ================================================================ dnl Check for gtk+ dnl ================================================================ -PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.12.0 gthread-2.0 libxml-2.0 >= 2.4.0]) +PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.14.0 gthread-2.0 libxml-2.0 >= 2.4.0]) AC_SUBST(GTK_LIBS) AC_SUBST(GTK_CFLAGS) diff --git a/gladeui/glade-base-editor.c b/gladeui/glade-base-editor.c index 0049a793..f40e2448 100644 --- a/gladeui/glade-base-editor.c +++ b/gladeui/glade-base-editor.c @@ -113,6 +113,24 @@ static void glade_base_editor_set_container (GladeBaseEditor *editor, static void glade_base_editor_block_callbacks (GladeBaseEditor *editor, gboolean block); + +static void +reset_child_types (GladeBaseEditor *editor) +{ + GList *l; + ChildTypeTab *tab; + + for (l = editor->priv->child_types; l; l = l->next) + { + tab = l->data; + g_object_unref (tab->children); + g_free (tab); + } + g_list_free (editor->priv->child_types); + editor->priv->child_types = NULL; +} + + static gint sort_type_by_hierarchy (ChildTypeTab *a, ChildTypeTab *b) { @@ -1153,7 +1171,7 @@ glade_base_editor_set_container (GladeBaseEditor *editor, if (container == NULL) { - /* XXX Destroy childtypetabs ...*/ + reset_child_types (editor); e->gcontainer = NULL; e->project = NULL; @@ -1203,14 +1221,13 @@ glade_base_editor_set_container (GladeBaseEditor *editor, } /*************************** GladeBaseEditor Class ****************************/ - static void glade_base_editor_finalize (GObject *object) { GladeBaseEditor *cobj = GLADE_BASE_EDITOR (object); - /* XXX Free up ChildTypeTabs here... */ - + reset_child_types (cobj); + /* Free private members, etc. */ glade_base_editor_project_disconnect (cobj); diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c index b649d8a9..bf8faa0a 100644 --- a/gladeui/glade-project.c +++ b/gladeui/glade-project.c @@ -1548,6 +1548,88 @@ glade_project_save (GladeProject *project, const gchar *path, GError **error) /******************************************************************* Verify code here (versioning, incompatability checks) *******************************************************************/ + +/* translators: reffers to a widget in toolkit version '%s %d.%d' and a project targeting toolkit version '%s %d.%d' */ +#define WIDGET_VERSION_CONFLICT_MSGFMT _("This widget was introduced in %s %d.%d while project targets %s %d.%d") + +/* translators: reffers to a widget '[%s]' introduced in toolkit version '%s %d.%d' */ +#define WIDGET_VERSION_CONFLICT_FMT _("[%s] Object class '%s' was introduced in %s %d.%d\n") + +/* translators: reffers to a widget in toolkit version '%s %d.%d' and a project targeting toolkit version '%s %d.%d' */ +#define WIDGET_BUILDER_VERSION_CONFLICT_MSGFMT _("This widget was made available in GtkBuilder format in %s %d.%d " \ + "while project targets %s %d.%d") + +/* translators: reffers to a widget '[%s]' introduced in toolkit version '%s %d.%d' */ +#define WIDGET_BUILDER_VERSION_CONFLICT_FMT _("[%s] Object class '%s' was made available in GtkBuilder format " \ + "in %s %d.%d\n") + +#define WIDGET_LIBGLADE_ONLY_MSG _("This widget is only supported in libglade format") + +/* translators: reffers to a widget '[%s]' loaded from toolkit version '%s %d.%d' */ +#define WIDGET_LIBGLADE_ONLY_FMT _("[%s] Object class '%s' from %s %d.%d " \ + "is only supported in libglade format\n") + +#define WIDGET_LIBGLADE_UNSUPPORTED_MSG _("This widget is not supported in libglade format") + +/* translators: reffers to a widget '[%s]' loaded from toolkit version '%s %d.%d' */ +#define WIDGET_LIBGLADE_UNSUPPORTED_FMT _("[%s] Object class '%s' from %s %d.%d " \ + "is not supported in libglade format\n") + +#define WIDGET_DEPRECATED_MSG _("This widget is deprecated") + +/* translators: reffers to a widget '[%s]' loaded from toolkit version '%s %d.%d' */ +#define WIDGET_DEPRECATED_FMT _("[%s] Object class '%s' from %s %d.%d is deprecated\n") + + +/* Defined here for pretty translator comments (bug in intl tools, for some reason + * you can only comment about the line directly following, forcing you to write + * ugly messy code with comments in line breaks inside function calls). + */ +#define PROP_LIBGLADE_UNSUPPORTED_MSG _("This property is not supported in libglade format") + +/* translators: reffers to a property '%s' of widget '[%s]' */ +#define PROP_LIBGLADE_UNSUPPORTED_FMT _("[%s] Property '%s' of object class '%s' is not " \ + "supported in libglade format\n") +/* translators: reffers to a property '%s' of widget '[%s]' */ +#define PACK_PROP_LIBGLADE_UNSUPPORTED_FMT _("[%s] Packing property '%s' of object class '%s' is not " \ + "supported in libglade format\n") + +#define PROP_LIBGLADE_ONLY_MSG _("This property is only supported in libglade format") + +/* translators: reffers to a property '%s' of widget '[%s]' */ +#define PROP_LIBGLADE_ONLY_FMT _("[%s] Property '%s' of object class '%s' is only " \ + "supported in libglade format\n") + +/* translators: reffers to a property '%s' of widget '[%s]' */ +#define PACK_PROP_LIBGLADE_ONLY_FMT _("[%s] Packing property '%s' of object class '%s' is only " \ + "supported in libglade format\n") + +/* translators: reffers to a property in toolkit version '%s %d.%d' + * and a project targeting toolkit version '%s %d.%d' */ +#define PROP_VERSION_CONFLICT_MSGFMT _("This property was introduced in %s %d.%d while project targets %s %d.%d") + +/* translators: reffers to a property '%s' of widget '[%s]' in toolkit version '%s %d.%d' */ +#define PROP_VERSION_CONFLICT_FMT _("[%s] Property '%s' of object class '%s' was introduced in %s %d.%d\n") + +/* translators: reffers to a property '%s' of widget '[%s]' in toolkit version '%s %d.%d' */ +#define PACK_PROP_VERSION_CONFLICT_FMT _("[%s] Packing property '%s' of object class '%s' " \ + "was introduced in %s %d.%d\n") + +/* translators: reffers to a property in toolkit version '%s %d.%d' and a project targeting toolkit version '%s %d.%d' */ +#define PROP_BUILDER_VERSION_CONFLICT_MSGFMT _("This property was made available in GtkBuilder format in %s %d.%d " \ + "while project targets %s %d.%d") + +/* translators: reffers to a property '%s' of widget '[%s]' in toolkit version '%s %d.%d' */ +#define PROP_BUILDER_VERSION_CONFLICT_FMT _("[%s] Property '%s' of object class '%s' was " \ + "made available in GtkBuilder format in %s %d.%d\n") + +/* translators: reffers to a property '%s' of widget '[%s]' in toolkit version '%s %d.%d' */ +#define PACK_PROP_BUILDER_VERSION_CONFLICT_FMT _("[%s] Packing property '%s' of object class '%s' " \ + "was made available in GtkBuilder format in %s %d.%d\n") + +/* translators: reffers to a signal '%s' of widget '[%s]' in toolkit version '%s %d.%d' */ +#define SIGNAL_VERSION_CONFLICT_FMT _("[%s] Signal '%s' of object class '%s' was introduced in %s %d.%d\n") + static void glade_project_verify_property (GladeProject *project, GladeProperty *property, @@ -1575,40 +1657,30 @@ glade_project_verify_property (GladeProject *project, { if (forwidget) glade_property_set_support_warning - (property, TRUE, _("This property is not supported in libglade format")); + (property, TRUE, PROP_LIBGLADE_UNSUPPORTED_MSG); else - /* translators: reffers to a property '%s' of widget '[%s]' - * introduced in toolkit version '%s %d.%d' */ - g_string_append_printf - (string, - property->klass->packing ? - _("[%s] Packing property '%s' of object class '%s' is not " - "supported in libglade format\n") : - _("[%s] Property '%s' of object class '%s' is not " - "supported in libglade format\n"), - path_name, - property->klass->name, - adaptor->title); + g_string_append_printf (string, + property->klass->packing ? + PACK_PROP_LIBGLADE_UNSUPPORTED_FMT : + PROP_LIBGLADE_UNSUPPORTED_FMT, + path_name, + property->klass->name, + adaptor->title); } else if (project->priv->format == GLADE_PROJECT_FORMAT_GTKBUILDER && property->klass->libglade_only) { if (forwidget) glade_property_set_support_warning - (property, TRUE, _("This property is only supported in libglade format")); + (property, TRUE, PROP_LIBGLADE_ONLY_MSG); else - /* translators: reffers to a property '%s' of widget '[%s]' - * introduced in toolkit version '%s %d.%d' */ - g_string_append_printf - (string, - property->klass->packing ? - _("[%s] Packing property '%s' of object class '%s' is only " - "supported in libglade format\n") : - _("[%s] Property '%s' of object class '%s' is only " - "supported in libglade format\n"), - path_name, - property->klass->name, - adaptor->title); + g_string_append_printf (string, + property->klass->packing ? + PACK_PROP_LIBGLADE_ONLY_FMT : + PROP_LIBGLADE_ONLY_FMT, + path_name, + property->klass->name, + adaptor->title); } else if (target_major < property->klass->version_since_major || (target_major == property->klass->version_since_major && @@ -1616,36 +1688,54 @@ glade_project_verify_property (GladeProject *project, { if (forwidget) { - /* translators: reffers to a property introduced in toolkit - * version '%s %d.%d' and a project targeting toolkit - * version '%s %d.%d' */ - tooltip = g_strdup_printf - (_("This property was introduced in %s %d.%d, " - "project targets %s %d.%d"), - catalog, - property->klass->version_since_major, - property->klass->version_since_minor, - catalog, - target_major, target_minor); - + tooltip = g_strdup_printf (PROP_VERSION_CONFLICT_MSGFMT, + catalog, + property->klass->version_since_major, + property->klass->version_since_minor, + catalog, + target_major, target_minor); + glade_property_set_support_warning (property, FALSE, tooltip); g_free (tooltip); } else - /* translators: reffers to a property '%s' of widget '[%s]' - * introduced in toolkit version '%s %d.%d' */ - g_string_append_printf - (string, - property->klass->packing ? - _("[%s] Packing property '%s' of object class '%s' was " - "introduced in %s %d.%d\n") : - _("[%s] Property '%s' of object class '%s' was " - "introduced in %s %d.%d\n"), - path_name, - property->klass->name, - adaptor->title, catalog, - property->klass->version_since_major, - property->klass->version_since_minor); + g_string_append_printf (string, + property->klass->packing ? + PACK_PROP_VERSION_CONFLICT_FMT : + PROP_VERSION_CONFLICT_FMT, + path_name, + property->klass->name, + adaptor->title, catalog, + property->klass->version_since_major, + property->klass->version_since_minor); + } + else if (project->priv->format == GLADE_PROJECT_FORMAT_GTKBUILDER && + (target_major < property->klass->builder_since_major || + (target_major == property->klass->builder_since_major && + target_minor < property->klass->builder_since_minor))) + { + if (forwidget) + { + tooltip = g_strdup_printf (PROP_BUILDER_VERSION_CONFLICT_MSGFMT, + catalog, + property->klass->builder_since_major, + property->klass->builder_since_minor, + catalog, + target_major, target_minor); + + glade_property_set_support_warning (property, FALSE, tooltip); + g_free (tooltip); + } + else + g_string_append_printf (string, + property->klass->packing ? + PACK_PROP_BUILDER_VERSION_CONFLICT_FMT : + PROP_BUILDER_VERSION_CONFLICT_FMT, + path_name, + property->klass->name, + adaptor->title, catalog, + property->klass->builder_since_major, + property->klass->builder_since_minor); } else if (forwidget) glade_property_set_support_warning (property, FALSE, NULL); @@ -1722,18 +1812,14 @@ glade_project_verify_signal (GladeWidget *widget, if (target_major < signal_class->version_since_major || (target_major == signal_class->version_since_major && target_minor < signal_class->version_since_minor)) - /* translators: reffers to a signal '%s' of widget '[%s]' - * introduced in toolkit version '%s %d.%d' */ - g_string_append_printf - (string, - _("[%s] Signal '%s' of object class '%s' was " - "introduced in %s %d.%d\n"), - path_name, - signal->name, - signal_class->adaptor->title, - catalog, - signal_class->version_since_major, - signal_class->version_since_minor); + g_string_append_printf (string, + SIGNAL_VERSION_CONFLICT_FMT, + path_name, + signal->name, + signal_class->adaptor->title, + catalog, + signal_class->version_since_major, + signal_class->version_since_minor); g_free (catalog); } @@ -1862,7 +1948,7 @@ glade_project_verify_adaptor (GladeProject *project, gint target_major, target_minor; gchar *catalog = NULL; - for (adaptor_iter = adaptor; adaptor_iter; + for (adaptor_iter = adaptor; adaptor_iter && support_mask == GLADE_SUPPORT_OK; adaptor_iter = glade_widget_adaptor_get_parent_adaptor (adaptor_iter)) { @@ -1871,37 +1957,52 @@ glade_project_verify_adaptor (GladeProject *project, &target_major, &target_minor); + /* Only one versioning message (builder or otherwise)... + */ if (target_major < GWA_VERSION_SINCE_MAJOR (adaptor_iter) || (target_major == GWA_VERSION_SINCE_MAJOR (adaptor_iter) && target_minor < GWA_VERSION_SINCE_MINOR (adaptor_iter))) { if (forwidget) - { - /* translators: reffers to a widget - * introduced in toolkit version '%s %d.%d', - * and a project targeting toolkit verion '%s %d.%d' */ - g_string_append_printf - (string, - _("This widget was introduced in %s %d.%d " - "project targets %s %d.%d"), - catalog, - GWA_VERSION_SINCE_MAJOR (adaptor_iter), - GWA_VERSION_SINCE_MINOR (adaptor_iter), - catalog, target_major, target_minor); - } + g_string_append_printf (string, + WIDGET_VERSION_CONFLICT_MSGFMT, + catalog, + GWA_VERSION_SINCE_MAJOR (adaptor_iter), + GWA_VERSION_SINCE_MINOR (adaptor_iter), + catalog, target_major, target_minor); + else + g_string_append_printf (string, + WIDGET_VERSION_CONFLICT_FMT, + path_name, adaptor_iter->title, catalog, + GWA_VERSION_SINCE_MAJOR (adaptor_iter), + GWA_VERSION_SINCE_MINOR (adaptor_iter)); + + support_mask |= GLADE_SUPPORT_MISMATCH; + } + else if (project->priv->format == GLADE_PROJECT_FORMAT_GTKBUILDER && + (target_major < GWA_BUILDER_SINCE_MAJOR (adaptor_iter) || + (target_major == GWA_BUILDER_SINCE_MAJOR (adaptor_iter) && + target_minor < GWA_BUILDER_SINCE_MINOR (adaptor_iter)))) + { + if (forwidget) + g_string_append_printf (string, + WIDGET_BUILDER_VERSION_CONFLICT_MSGFMT, + catalog, + GWA_BUILDER_SINCE_MAJOR (adaptor_iter), + GWA_BUILDER_SINCE_MINOR (adaptor_iter), + catalog, target_major, target_minor); else - /* translators: reffers to a widget '[%s]' - * introduced in toolkit version '%s %d.%d' */ - g_string_append_printf - (string, - _("[%s] Object class '%s' was introduced in %s %d.%d\n"), - path_name, adaptor_iter->title, catalog, - GWA_VERSION_SINCE_MAJOR (adaptor_iter), - GWA_VERSION_SINCE_MINOR (adaptor_iter)); + g_string_append_printf (string, + WIDGET_BUILDER_VERSION_CONFLICT_FMT, + path_name, adaptor_iter->title, catalog, + GWA_BUILDER_SINCE_MAJOR (adaptor_iter), + GWA_BUILDER_SINCE_MINOR (adaptor_iter)); support_mask |= GLADE_SUPPORT_MISMATCH; } + /* Now accumulate some more messages... + */ if (project->priv->format == GLADE_PROJECT_FORMAT_GTKBUILDER && GWA_LIBGLADE_ONLY (adaptor_iter)) { @@ -1909,19 +2010,13 @@ glade_project_verify_adaptor (GladeProject *project, { if (string->len) g_string_append (string, "\n"); - g_string_append_printf - (string, - _("This widget is only supported in libglade format")); + g_string_append_printf (string, WIDGET_LIBGLADE_ONLY_MSG); } else - /* translators: reffers to a widget '[%s]' - * loaded from toolkit version '%s %d.%d' */ - g_string_append_printf - (string, - _("[%s] Object class '%s' from %s %d.%d " - "is only supported in libglade format\n"), - path_name, adaptor_iter->title, catalog, - target_major, target_minor); + g_string_append_printf (string, + WIDGET_LIBGLADE_ONLY_FMT, + path_name, adaptor_iter->title, catalog, + target_major, target_minor); support_mask |= GLADE_SUPPORT_LIBGLADE_ONLY; } @@ -1932,19 +2027,13 @@ glade_project_verify_adaptor (GladeProject *project, { if (string->len) g_string_append (string, "\n"); - g_string_append_printf - (string, - _("This widget is not supported in libglade format")); + + g_string_append_printf (string, WIDGET_LIBGLADE_UNSUPPORTED_MSG); } else - /* translators: reffers to a widget '[%s]' - * loaded from toolkit version '%s %d.%d' */ - g_string_append_printf - (string, - _("[%s] Object class '%s' from %s %d.%d " - "is not supported in libglade format\n"), - path_name, adaptor_iter->title, catalog, - target_major, target_minor); + g_string_append_printf (string, WIDGET_LIBGLADE_UNSUPPORTED_FMT, + path_name, adaptor_iter->title, catalog, + target_major, target_minor); support_mask |= GLADE_SUPPORT_LIBGLADE_UNSUPPORTED; } @@ -1955,18 +2044,13 @@ glade_project_verify_adaptor (GladeProject *project, { if (string->len) g_string_append (string, "\n"); - g_string_append_printf - (string, _("This widget is deprecated")); + + g_string_append_printf (string, WIDGET_DEPRECATED_MSG); } else - /* translators: reffers to a widget '[%s]' - * loaded from toolkit version '%s %d.%d' */ - g_string_append_printf - (string, - _("[%s] Object class '%s' from %s %d.%d " - "is deprecated\n"), - path_name, adaptor_iter->title, catalog, - target_major, target_minor); + g_string_append_printf (string, WIDGET_DEPRECATED_FMT, + path_name, adaptor_iter->title, catalog, + target_major, target_minor); support_mask |= GLADE_SUPPORT_DEPRECATED; } @@ -1974,6 +2058,7 @@ glade_project_verify_adaptor (GladeProject *project, } if (mask) *mask = support_mask; + } /** diff --git a/gladeui/glade-property-class.c b/gladeui/glade-property-class.c index b16d5133..9532c364 100644 --- a/gladeui/glade-property-class.c +++ b/gladeui/glade-property-class.c @@ -104,6 +104,10 @@ glade_property_class_new (gpointer handle) /* Initialize them to the base version */ property_class->version_since_major = GWA_VERSION_SINCE_MAJOR (handle); property_class->version_since_minor = GWA_VERSION_SINCE_MINOR (handle); + + property_class->builder_since_major = GWA_BUILDER_SINCE_MAJOR (handle); + property_class->builder_since_minor = GWA_BUILDER_SINCE_MINOR (handle); + return property_class; } @@ -1581,6 +1585,11 @@ glade_property_class_update_from_node (GladeXmlNode *node, &klass->version_since_major, &klass->version_since_minor); + glade_xml_get_property_version + (node, GLADE_TAG_BUILDER_SINCE, + &klass->builder_since_major, + &klass->builder_since_minor); + /* Get the Parameters */ if ((child = glade_xml_search_child (node, GLADE_TAG_PARAMETERS)) != NULL) klass->parameters = glade_parameter_list_new_from_node (klass->parameters, child); diff --git a/gladeui/glade-property-class.h b/gladeui/glade-property-class.h index 12827a24..1af397e9 100644 --- a/gladeui/glade-property-class.h +++ b/gladeui/glade-property-class.h @@ -46,10 +46,12 @@ struct _GladePropertyClass * was created for. */ - gint version_since_major; /* Version in which this property was - * introduced - */ - gint version_since_minor; + + guint16 version_since_major; /* Version in which this property was */ + guint16 version_since_minor; /* introduced. */ + + guint16 builder_since_major; /* Version in which this property became */ + guint16 builder_since_minor; /* available in GtkBuilder format */ /* For catalogs that support libglade: */ gboolean libglade_only; /* Mark special libglade virtual properties */ diff --git a/gladeui/glade-property.h b/gladeui/glade-property.h index b67d6cb8..f8fd63d3 100644 --- a/gladeui/glade-property.h +++ b/gladeui/glade-property.h @@ -43,9 +43,6 @@ struct _GladeProperty GValue *value; /* The value of the property */ - gboolean sensitive; /* Whether this property is sensitive (if the - * property is "optional" this takes precedence). - */ gchar *insensitive_tooltip; /* Tooltip to display when in insensitive state * (used to explain why the property is * insensitive) @@ -56,34 +53,37 @@ struct _GladeProperty * (used to explain why the property is * insensitive) */ - gboolean support_disabled; /* Whether this property is disabled due - * to format conflicts - */ - - gboolean enabled; /* 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. - */ - - gboolean save_always; /* 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). - */ + 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. */ - gboolean i18n_translatable; - gboolean i18n_has_context; + guint i18n_translatable : 1; + guint i18n_has_context : 1; gchar *i18n_context; gchar *i18n_comment; - gint syncing; /* Avoid recursion while synchronizing object with value. - */ + gint syncing; /* Avoid recursion while synchronizing object with value */ gint sync_tolerance; }; diff --git a/gladeui/glade-widget-adaptor.c b/gladeui/glade-widget-adaptor.c index b9b038c6..a6d93b0f 100644 --- a/gladeui/glade-widget-adaptor.c +++ b/gladeui/glade-widget-adaptor.c @@ -387,9 +387,14 @@ gwa_clone_parent_properties (GladeWidgetAdaptor *adaptor, gboolean is_packing) /* Reset versioning in derived catalogs just once */ if (strcmp (adaptor->priv->catalog, parent_adaptor->priv->catalog)) + { pclass->version_since_major = pclass->version_since_major = 0; + pclass->builder_since_major = + pclass->builder_since_major = 0; + + } properties = g_list_prepend (properties, pclass); } } @@ -602,9 +607,14 @@ glade_widget_adaptor_constructor (GType type, /* Reset version numbering if we're in a new catalog just once */ if (parent_adaptor && strcmp (adaptor->priv->catalog, parent_adaptor->priv->catalog)) + { GLADE_WIDGET_ADAPTOR_GET_CLASS(adaptor)->version_since_major = GLADE_WIDGET_ADAPTOR_GET_CLASS(adaptor)->version_since_minor = 0; + GLADE_WIDGET_ADAPTOR_GET_CLASS(adaptor)->builder_since_major = + GLADE_WIDGET_ADAPTOR_GET_CLASS(adaptor)->builder_since_minor = 0; + } + /* Copy parent actions */ if (parent_adaptor) { @@ -1489,6 +1499,11 @@ gwa_derived_class_init (GladeWidgetAdaptorClass *adaptor_class, if (module) gwa_extend_with_node_load_sym (adaptor_class, node, module); glade_xml_get_property_version + (node, GLADE_TAG_BUILDER_SINCE, + &adaptor_class->builder_since_major, + &adaptor_class->builder_since_minor); + + glade_xml_get_property_version (node, GLADE_TAG_VERSION_SINCE, &adaptor_class->version_since_major, &adaptor_class->version_since_minor); diff --git a/gladeui/glade-widget-adaptor.h b/gladeui/glade-widget-adaptor.h index 2fde45db..ac184d4e 100644 --- a/gladeui/glade-widget-adaptor.h +++ b/gladeui/glade-widget-adaptor.h @@ -67,8 +67,8 @@ typedef struct _GladeWidgetAdaptorClass GladeWidgetAdaptorClass; * * Checks major version in which this widget was introduced */ -#define GWA_VERSION_SINCE_MAJOR(obj) \ - ((obj) ? GLADE_WIDGET_ADAPTOR_GET_CLASS(obj)->version_since_major : FALSE) +#define GWA_VERSION_SINCE_MAJOR(obj) \ + ((obj) ? GLADE_WIDGET_ADAPTOR_GET_CLASS(obj)->version_since_major : 0) /** * GWA_VERSION_SINCE_MINOR: @@ -76,8 +76,27 @@ typedef struct _GladeWidgetAdaptorClass GladeWidgetAdaptorClass; * * Checks minor version in which this widget was introduced */ -#define GWA_VERSION_SINCE_MINOR(obj) \ - ((obj) ? GLADE_WIDGET_ADAPTOR_GET_CLASS(obj)->version_since_minor : FALSE) +#define GWA_VERSION_SINCE_MINOR(obj) \ + ((obj) ? GLADE_WIDGET_ADAPTOR_GET_CLASS(obj)->version_since_minor : 0) + +/** + * GWA_BUILDER_SINCE_MAJOR: + * @obj: A #GladeWidgetAdaptor + * + * Checks major version in which this widget introduced gtkbuilder support + */ +#define GWA_BUILDER_SINCE_MAJOR(obj) \ + ((obj) ? GLADE_WIDGET_ADAPTOR_GET_CLASS(obj)->builder_since_major : 0) + +/** + * GWA_BUILDER_SINCE_MINOR: + * @obj: A #GladeWidgetAdaptor + * + * Checks minor version in which this widget introduced gtkbuilder support + */ +#define GWA_BUILDER_SINCE_MINOR(obj) \ + ((obj) ? GLADE_WIDGET_ADAPTOR_GET_CLASS(obj)->builder_since_minor : 0) + /** * GWA_IS_TOPLEVEL: @@ -590,29 +609,31 @@ struct _GladeWidgetAdaptorClass { GObjectClass parent_class; - gint version_since_major; /* Version in which this widget was - * introduced - */ - gint version_since_minor; - - gboolean deprecated; /* If this widget is currently - * deprecated - */ - gboolean libglade_unsupported; /* If this widget is not supported - * by libglade - */ - gboolean libglade_only; /* If this widget is only supported - * by libglade - */ + guint16 version_since_major; /* Version in which this widget was */ + guint16 version_since_minor; /* introduced. */ - gboolean fixed; /* If this is a GtkContainer, use free-form - * placement with drag/resize/paste at mouse... - */ - gboolean toplevel; /* If this class is toplevel */ + guint16 builder_since_major; /* Version in which this widget became */ + guint16 builder_since_minor; /* available in GtkBuilder format */ - gboolean use_placeholders; /* Whether or not to use placeholders - * to interface with child widgets. - */ + + guint deprecated : 1; /* If this widget is currently + * deprecated + */ + guint libglade_unsupported : 1; /* If this widget is not supported + * by libglade + */ + guint libglade_only : 1; /* If this widget is only supported + * by libglade + */ + + guint fixed : 1; /* If this is a Container, use free-form + * placement with drag/resize/paste at mouse... + */ + guint toplevel : 1; /* If this class is toplevel */ + + guint use_placeholders : 1; /* Whether or not to use placeholders + * to interface with child widgets. + */ gint default_width; /* Default width in GladeDesignLayout */ gint default_height; /* Default height in GladeDesignLayout */ @@ -673,12 +694,12 @@ struct _GladeWidgetAdaptorClass GladeChildSetPropertyFunc child_set_property; /* Sets/Gets a packing property */ GladeChildGetPropertyFunc child_get_property; /* for this child */ - GladeReplaceChildFunc replace_child; /* This method replaces a - * child widget with - * another one: it's used to - * replace a placeholder with - * a widget and viceversa. - */ + GladeReplaceChildFunc replace_child; /* This method replaces a + * child widget with + * another one: it's used to + * replace a placeholder with + * a widget and viceversa. + */ GladeActionActivateFunc action_activate; /* This method is used to catch actions */ GladeChildActionActivateFunc child_action_activate; /* This method is used to catch packing actions */ diff --git a/gladeui/glade-xml-utils.h b/gladeui/glade-xml-utils.h index 524dbf3b..e7322d70 100644 --- a/gladeui/glade-xml-utils.h +++ b/gladeui/glade-xml-utils.h @@ -89,6 +89,7 @@ typedef enum { #define GLADE_TAG_VERSION "version" #define GLADE_TAG_TARGETABLE "targetable" #define GLADE_TAG_VERSION_SINCE "since" +#define GLADE_TAG_BUILDER_SINCE "gtkbuilder-since" #define GLADE_TAG_DEPRECATED "deprecated" #define GLADE_TAG_LIBGLADE_ONLY "libglade-only" diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in index 65538cb7..db68d645 100644 --- a/plugins/gtk+/gtk+.xml.in +++ b/plugins/gtk+/gtk+.xml.in @@ -1,6 +1,6 @@ <glade-catalog name="gtk+" - version="2.14" - targetable="2.12,2.10,2.8" + version="2.16" + targetable="2.14,2.12,2.10,2.8" supports="libglade,gtkbuilder" icon-prefix="gtk" library="gladegtk" @@ -26,6 +26,7 @@ <signal id="drag-failed" since="2.12"/> <signal id="keynav-failed" since="2.12"/> <signal id="query-tooltip" since="2.12"/> + <signal id="damage-event" since="2.14"/> </signals> <actions> @@ -104,6 +105,7 @@ </displayable-values> </property> + <property id="window" disabled="True" since="2.14"/> <property id="name" disabled="True"/> <property id="parent" disabled="True"/> <property id="style" disabled="True"/> @@ -412,7 +414,7 @@ embedded in another object</_tooltip> </properties> </glade-widget-class> - <glade-widget-class name="GtkMenuShell" _title="Menu Shell" use-placeholders="False"> + <glade-widget-class name="GtkMenuShell" _title="Menu Shell" use-placeholders="False" gtkbuilder-since="2.16"> <post-create-function>empty</post-create-function> <add-child-function>glade_gtk_menu_shell_add_child</add-child-function> <remove-child-function>glade_gtk_menu_shell_remove_child</remove-child-function> @@ -435,7 +437,8 @@ embedded in another object</_tooltip> </packing-properties> </glade-widget-class> - <glade-widget-class name="GtkMenuItem" generic-name="menuitem" _title="Menu Item" use-placeholders="False"> + <glade-widget-class name="GtkMenuItem" generic-name="menuitem" _title="Menu Item" use-placeholders="False" + gtkbuilder-since="2.16"> <constructor-function>glade_gtk_menu_item_constructor</constructor-function> <post-create-function>glade_gtk_menu_item_post_create</post-create-function> <get-children-function>glade_gtk_menu_item_get_children</get-children-function> @@ -450,6 +453,9 @@ embedded in another object</_tooltip> <action id="launch_editor" _name="Edit…" stock="gtk-edit" important="True"/> </actions> <properties> + <property id="accel-path" since="2.14"/> + <property id="right-justified" since="2.14"/> + <property id="width-chars" since="2.14"/> <property id="label" _name="Label" translatable="True"> <parameter-spec> <type>GParamString</type> @@ -730,7 +736,8 @@ embedded in another object</_tooltip> <property id="label" default="label" translatable="True" custom-layout="True"> <visible-lines>2</visible-lines> </property> - <property id="glade-attributes" _name="Attributes" save="False" custom-layout="True"> + <property id="glade-attributes" _name="Attributes" save="False" custom-layout="True" + libglade-unsupported="True" gtkbuilder-since="2.16"> <parameter-spec> <type>GParamBoxed</type> <value-type>GladeAttrGList</value-type> @@ -958,14 +965,18 @@ embedded in another object</_tooltip> </properties> </glade-widget-class> - <glade-widget-class name="GtkScaleButton" generic-name="scalebutton" _title="Scale Button" since="2.12"/> + <glade-widget-class name="GtkScaleButton" generic-name="scalebutton" _title="Scale Button" since="2.12"> + <properties> + <property id="orientation" since="2.14"/> + </properties> + </glade-widget-class> <glade-widget-class name="GtkVolumeButton" generic-name="volumebutton" _title="Volume Button"/> <glade-widget-class name="GtkFileChooserWidget" generic-name="filechooserwidget" _title="File Chooser Widget"> <post-create-function>glade_gtk_file_chooser_widget_post_create</post-create-function> <properties> - <property id="size" default="1" query="False" /> + <property id="size" default="1" query="False" /> <property id="extra-widget" parentless-widget="True" libglade-unsupported="True"/> <property id="preview-widget" parentless-widget="True" libglade-unsupported="True"/> <property id="filter" libglade-unsupported="True"/> @@ -1076,6 +1087,10 @@ embedded in another object</_tooltip> <value id="GTK_PROGRESS_DISCRETE" _name="Discrete"/> </displayable-values> </property> + <property id="min-horizontal-bar-height" since="2.14"/> + <property id="min-horizontal-bar-width" since="2.14"/> + <property id="min-vertical-bar-height" since="2.14"/> + <property id="min-vertical-bar-width" since="2.14"/> </properties> </glade-widget-class> @@ -1290,7 +1305,13 @@ embedded in another object</_tooltip> <glade-widget-class name="GtkVScale" generic-name="vscale" _title="Vertical Scale"/> - <glade-widget-class name="GtkCalendar" generic-name="calendar" _title="Calendar"/> + <glade-widget-class name="GtkCalendar" generic-name="calendar" _title="Calendar"> + <properties> + <property id="detail-height-rows" since="2.14"/> + <property id="detail-width-chars" since="2.14"/> + <property id="show-details" since="2.14"/> + </properties> + </glade-widget-class> <glade-widget-class name="GtkMenu" generic-name="menu" _title="Popup Menu" toplevel="True"> <constructor-function>glade_gtk_menu_constructor</constructor-function> @@ -1301,7 +1322,16 @@ embedded in another object</_tooltip> <actions> <action id="launch_editor" _name="Edit…" stock="gtk-edit" important="True"/> </actions> - </glade-widget-class> + + <properties> + <property id="accel-group" since="2.14"/> + <property id="accel-path" since="2.14"/> + <property id="active" disabled="True" since="2.14"/> + <property id="attach-widget" disabled="True" since="2.14"/> + <property id="monitor" disabled="True" since="2.14"/> + </properties> + + </glade-widget-class> <glade-widget-class name="GtkHScrollbar" generic-name="hscrollbar" _title="Horizontal Scrollbar"/> @@ -1692,9 +1722,10 @@ embedded in another object</_tooltip> <glade-widget-class name="GtkLinkButton" generic-name="linkbutton" _title="Link Button"> <properties> - <!-- The pspec of this prop says that the default is http://www.gtk.org but gtk_link_button_init() does not set it up - do we need to override it to avoid seting a NULL value. --> + <!-- The pspec of this prop says that the default is http://www.gtk.org but gtk_link_button_init() does + not set it up... do we need to override it to avoid seting a NULL value ? --> <property id="uri" default="http://glade.gnome.org" since="2.10"/> + <property id="visited" since="2.14"/> </properties> </glade-widget-class> @@ -2606,6 +2637,11 @@ embedded in another object</_tooltip> <glade-widget-class name="GtkCellRendererCombo" generic-name="cellrenderercombo" _title="Combo Renderer" libglade-unsupported="True"> + + <signals> + <signal id="changed" since="2.14"/> + </signals> + <properties> <property id="has-entry" save="False" custom-layout="True"/> <property id="attr-has-entry" _name="Has Entry column" save="False" default="-1" custom-layout="True"> @@ -2989,7 +3025,11 @@ embedded in another object</_tooltip> <glade-widget-class name="GtkStatusIcon" generic-name="statusicon" _title="Status Icon" - libglade-unsupported="True" toplevel="True"/> + libglade-unsupported="True" toplevel="True"> + <properties> + <property id="gicon" disabled="True" since="2.14"/> + </properties> + </glade-widget-class> <glade-widget-class name="GtkTextBuffer" generic-name="textbuffer" _title="Text Buffer" libglade-unsupported="True" toplevel="True"> |