]> Pileus Git - ~andy/gtk/blob - gtk/gtkstyleproviderprivate.c
Change FSF Address
[~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, see <http://www.gnu.org/licenses/>.
16  */
17
18 #include "config.h"
19
20 #include "gtkstyleproviderprivate.h"
21 #include "gtkstyleprovider.h"
22
23 G_DEFINE_INTERFACE (GtkStyleProviderPrivate, _gtk_style_provider_private, GTK_TYPE_STYLE_PROVIDER)
24
25 static void
26 _gtk_style_provider_private_default_init (GtkStyleProviderPrivateInterface *iface)
27 {
28 }
29
30 GtkSymbolicColor *
31 _gtk_style_provider_private_get_color (GtkStyleProviderPrivate *provider,
32                                        const char              *name)
33 {
34   GtkStyleProviderPrivateInterface *iface;
35
36   g_return_val_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider), NULL);
37
38   iface = GTK_STYLE_PROVIDER_PRIVATE_GET_INTERFACE (provider);
39
40   if (!iface->get_color)
41     return NULL;
42
43   return iface->get_color (provider, name);
44 }
45
46 void
47 _gtk_style_provider_private_lookup (GtkStyleProviderPrivate *provider,
48                                     GtkWidgetPath           *path,
49                                     GtkStateFlags            state,
50                                     GtkCssLookup            *lookup)
51 {
52   GtkStyleProviderPrivateInterface *iface;
53
54   g_return_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider));
55   g_return_if_fail (path != NULL);
56   g_return_if_fail (lookup != NULL);
57
58   iface = GTK_STYLE_PROVIDER_PRIVATE_GET_INTERFACE (provider);
59
60   if (!iface->lookup)
61     return;
62
63   iface->lookup (provider, path, state, lookup);
64 }