Commit 0c973376 authored by Tristan Van Berkom's avatar Tristan Van Berkom

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
parent a2a5cd04
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.
......
......@@ -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)
......
......@@ -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);
......
......@@ -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;
}
/**
......
......@@ -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);
......
......@@ -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 */
......
......@@ -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;
};
......
......@@ -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)
{
......@@ -1488,6 +1498,11 @@ gwa_derived_class_init (GladeWidgetAdaptorClass *adaptor_class,
/* Load catalog symbols from module */
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,
......
......@@ -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