]> Pileus Git - ~andy/gtk/blob - gtk/gtkstyleproviderprivate.c
a7b0a6fcb726f038ff21c5f84a6a6747755e3a70
[~andy/gtk] / gtk / gtkstyleproviderprivate.c
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 2011 Benjamin Otte <otte@gnome.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #include "config.h"
21
22 #include "gtkstyleproviderprivate.h"
23 #include "gtkstyleprovider.h"
24
25 G_DEFINE_INTERFACE (GtkStyleProviderPrivate, _gtk_style_provider_private, GTK_TYPE_STYLE_PROVIDER)
26
27 static void
28 _gtk_style_provider_private_default_init (GtkStyleProviderPrivateInterface *iface)
29 {
30 }
31
32 GtkSymbolicColor *
33 _gtk_style_provider_private_get_color (GtkStyleProviderPrivate *provider,
34                                        const char              *name)
35 {
36   GtkStyleProviderPrivateInterface *iface;
37
38   g_return_val_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider), NULL);
39
40   iface = GTK_STYLE_PROVIDER_PRIVATE_GET_INTERFACE (provider);
41
42   if (!iface->get_color)
43     return NULL;
44
45   return iface->get_color (provider, name);
46 }
47
48 void
49 _gtk_style_provider_private_lookup (GtkStyleProviderPrivate *provider,
50                                     GtkWidgetPath           *path,
51                                     GtkStateFlags            state,
52                                     GtkCssLookup            *lookup)
53 {
54   GtkStyleProviderPrivateInterface *iface;
55
56   g_return_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider));
57   g_return_if_fail (path != NULL);
58   g_return_if_fail (lookup != NULL);
59
60   iface = GTK_STYLE_PROVIDER_PRIVATE_GET_INTERFACE (provider);
61
62   if (!iface->lookup)
63     return;
64
65   iface->lookup (provider, path, state, lookup);
66 }