GtkThemingEngine: Add gtk_theming_engine_register_property().
This function may be used for custom property registration from
theming engines. The property names will have the
-${engine-type-name}-${prop-name} format, the parser has been
modified to allow properties with '-' as the first char.
This commit is contained in:
@ -194,6 +194,25 @@ _gtk_theming_engine_set_context (GtkThemingEngine *engine,
|
||||
priv->context = context;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_theming_engine_register_property (GtkThemingEngine *engine,
|
||||
const gchar *property_name,
|
||||
GType type,
|
||||
const GValue *default_value,
|
||||
GtkStylePropertyParser parse_func)
|
||||
{
|
||||
gchar *name;
|
||||
|
||||
g_return_if_fail (GTK_IS_THEMING_ENGINE (engine));
|
||||
g_return_if_fail (property_name != NULL);
|
||||
g_return_if_fail (type != G_TYPE_INVALID);
|
||||
g_return_if_fail (default_value != NULL && G_IS_VALUE (default_value));
|
||||
|
||||
name = g_strdup_printf ("-%s-%s", G_OBJECT_TYPE_NAME (engine), property_name);
|
||||
gtk_style_set_register_property (name, type, default_value, parse_func);
|
||||
g_free (name);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_theming_engine_get_property (GtkThemingEngine *engine,
|
||||
const gchar *property,
|
||||
|
||||
Reference in New Issue
Block a user