Commit 7c95f50e authored by Matthias Clasen's avatar Matthias Clasen

Add a way to add aliases for css properties

This will be used to rename some properties in a more
systematic way without breaking all users of the old name.
parent d2d521d4
...@@ -233,6 +233,26 @@ _gtk_style_property_init_properties (void) ...@@ -233,6 +233,26 @@ _gtk_style_property_init_properties (void)
_gtk_css_shorthand_property_init_properties (); _gtk_css_shorthand_property_init_properties ();
} }
void
_gtk_style_property_add_alias (const gchar *name,
const gchar *alias)
{
GtkStylePropertyClass *klass;
GtkStyleProperty *property;
g_return_if_fail (name != NULL);
g_return_if_fail (alias != NULL);
klass = g_type_class_peek (GTK_TYPE_STYLE_PROPERTY);
property = g_hash_table_lookup (klass->properties, name);
g_assert (property != NULL);
g_assert (g_hash_table_lookup (klass->properties, alias) == NULL);
g_hash_table_insert (klass->properties, (gpointer)alias, property);
}
/** /**
* _gtk_style_property_lookup: * _gtk_style_property_lookup:
* @name: name of the property to lookup * @name: name of the property to lookup
......
...@@ -67,6 +67,9 @@ GType _gtk_style_property_get_type (void) G_GNUC_CONST ...@@ -67,6 +67,9 @@ GType _gtk_style_property_get_type (void) G_GNUC_CONST
void _gtk_style_property_init_properties (void); void _gtk_style_property_init_properties (void);
void _gtk_style_property_add_alias (const gchar *name,
const gchar *alias);
GtkStyleProperty * _gtk_style_property_lookup (const char *name); GtkStyleProperty * _gtk_style_property_lookup (const char *name);
const char * _gtk_style_property_get_name (GtkStyleProperty *property); const char * _gtk_style_property_get_name (GtkStyleProperty *property);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment