diff options
author | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2013-04-01 18:13:05 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2013-04-01 18:18:24 +0900 |
commit | 9a0ff231d65d05975c3e6b94ad79cfd54546a197 (patch) | |
tree | e567c31c9650a4511c634324f3c421d6c697b3c8 /gladeui/glade-property-class.c | |
parent | 8a5cba1a59b55a7c7eb8b6cf844c169d2d3f1f6d (diff) | |
download | glade-9a0ff231d65d05975c3e6b94ad79cfd54546a197.tar.gz |
Add support for deprecated properties and signals.
Parse the "deprecated" parts of gtk+.xml.in on properties and signals,
and update GladeProject to format the deprecation messages when verifying
the project.
Diffstat (limited to 'gladeui/glade-property-class.c')
-rw-r--r-- | gladeui/glade-property-class.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/gladeui/glade-property-class.c b/gladeui/glade-property-class.c index 75fcaf7f..00bfa92c 100644 --- a/gladeui/glade-property-class.c +++ b/gladeui/glade-property-class.c @@ -176,6 +176,8 @@ struct _GladePropertyClass * in the project */ + guint deprecated : 1; /* True if this property is deprecated */ + gdouble weight; /* This will determine the position of this property in * the editor. */ @@ -229,9 +231,10 @@ glade_property_class_new (GladeWidgetAdaptor *adaptor, property_class->weight = -1.0; property_class->parentless_widget = FALSE; - /* Initialize them to the base version */ + /* Initialize property versions & deprecated to adaptor */ property_class->version_since_major = GWA_VERSION_SINCE_MAJOR (adaptor); property_class->version_since_minor = GWA_VERSION_SINCE_MINOR (adaptor); + property_class->deprecated = GWA_DEPRECATED (adaptor); return property_class; } @@ -1478,6 +1481,13 @@ glade_property_class_since_minor (GladePropertyClass *property_class) return property_class->version_since_minor; } +gboolean +glade_property_class_deprecated (GladePropertyClass *property_class) +{ + g_return_val_if_fail (GLADE_IS_PROPERTY_CLASS (property_class), FALSE); + + return property_class->deprecated; +} G_CONST_RETURN gchar * glade_property_class_id (GladePropertyClass *property_class) @@ -2089,6 +2099,16 @@ glade_property_class_update_from_node (GladeXmlNode * node, klass->parentless_widget); + glade_xml_get_property_version (node, GLADE_TAG_VERSION_SINCE, + &klass->version_since_major, + &klass->version_since_minor); + + klass->deprecated = + glade_xml_get_property_boolean (node, + GLADE_TAG_DEPRECATED, + klass->deprecated); + + if ((buf = glade_xml_get_property_string (node, GLADE_TAG_CREATE_TYPE)) != NULL) { |