diff options
author | Benjamin Otte <otte@gnome.org> | 2016-02-14 01:11:57 +0100 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2016-02-15 04:41:12 +0100 |
commit | d584e22e021b15446e60ef451160211ae3347bb7 (patch) | |
tree | 2c748ca94ba98d6c7083b35e22efee91a41c53ab /gtk/gtkwin32theme.c | |
parent | 3b19db425e63fb6f16b1daf4c8da288c631e1cc0 (diff) | |
download | gtk+-d584e22e021b15446e60ef451160211ae3347bb7.tar.gz |
win32: Add gtk_win32_theme_parse()
So all places can use this function instead of parsing things themselves.
Diffstat (limited to 'gtk/gtkwin32theme.c')
-rw-r--r-- | gtk/gtkwin32theme.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gtk/gtkwin32theme.c b/gtk/gtkwin32theme.c index c55a66a314..4f9452d189 100644 --- a/gtk/gtkwin32theme.c +++ b/gtk/gtkwin32theme.c @@ -247,7 +247,7 @@ gtk_win32_theme_get_htheme (GtkWin32Theme *theme) #endif /* G_OS_WIN32 */ -GtkWin32Theme * +static GtkWin32Theme * gtk_win32_theme_lookup (const char *classname) { GtkWin32Theme *theme; @@ -269,6 +269,25 @@ gtk_win32_theme_lookup (const char *classname) return theme; } +GtkWin32Theme * +gtk_win32_theme_parse (GtkCssParser *parser) +{ + GtkWin32Theme *theme; + char *class_name; + + class_name = _gtk_css_parser_try_name (parser, TRUE); + if (class_name == NULL) + { + _gtk_css_parser_error (parser, "Expected valid win32 theme name"); + return NULL; + } + + theme = gtk_win32_theme_lookup (class_name); + g_free (class_name); + + return theme; +} + cairo_surface_t * gtk_win32_theme_create_surface (GtkWin32Theme *theme, int xp_part, |