]> Pileus Git - ~andy/gtk/blob - gtk/gtkstylepropertyprivate.h
gdk/x11: Add gdk_x11_device_manager_lookup()
[~andy/gtk] / gtk / gtkstylepropertyprivate.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 2010 Carlos Garnacho <carlosg@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 #ifndef __GTK_STYLEPROPERTY_PRIVATE_H__
21 #define __GTK_STYLEPROPERTY_PRIVATE_H__
22
23 #include "gtkcssparserprivate.h"
24
25 G_BEGIN_DECLS
26
27 typedef struct _GtkStyleProperty GtkStyleProperty;
28 typedef enum {
29   GTK_STYLE_PROPERTY_INHERIT = (1 << 0)
30 } GtkStylePropertyFlags;
31
32 typedef GParameter *     (* GtkStyleUnpackFunc)            (const GValue           *value,
33                                                             guint                  *n_params);
34 typedef void             (* GtkStylePackFunc)              (GValue                 *value,
35                                                             GtkStyleProperties     *props,
36                                                             GtkStateFlags           state);
37 typedef gboolean         (* GtkStyleParseFunc)             (GtkCssParser           *parser,
38                                                             GFile                  *base,
39                                                             GValue                 *value);
40 typedef void             (* GtkStylePrintFunc)             (const GValue           *value,
41                                                             GString                *string);
42 typedef void             (* GtkStyleDefaultValueFunc)      (GtkStyleProperties     *props,
43                                                             GtkStateFlags           state,
44                                                             GValue                 *value);
45
46
47 struct _GtkStyleProperty
48 {
49   GParamSpec               *pspec;
50   GtkStylePropertyFlags     flags;
51
52   GtkStylePropertyParser    property_parse_func;
53   GtkStyleUnpackFunc        unpack_func;
54   GtkStylePackFunc          pack_func;
55   GtkStyleParseFunc         parse_func;
56   GtkStylePrintFunc         print_func;
57   GtkStyleDefaultValueFunc  default_value_func;
58 };
59
60 const GtkStyleProperty * _gtk_style_property_lookup        (const char             *name);
61
62 void                     _gtk_style_property_register      (GParamSpec             *pspec,
63                                                             GtkStylePropertyFlags   flags,
64                                                             GtkStylePropertyParser  property_parse_func,
65                                                             GtkStyleUnpackFunc      unpack_func,
66                                                             GtkStylePackFunc        pack_func,
67                                                             GtkStyleParseFunc       parse_func,
68                                                             GtkStylePrintFunc       print_func,
69                                                             GtkStyleDefaultValueFunc default_value_func);
70
71 gboolean                 _gtk_style_property_is_inherit    (const GtkStyleProperty *property);
72
73 void                     _gtk_style_property_default_value (const GtkStyleProperty *property,
74                                                             GtkStyleProperties     *properties,
75                                                             GtkStateFlags           state,
76                                                             GValue                 *value);
77
78 void                     _gtk_style_property_resolve       (const GtkStyleProperty *property,
79                                                             GtkStyleProperties     *properties,
80                                                             GtkStateFlags           state,
81                                                             GValue                 *value);
82
83 gboolean                 _gtk_style_property_is_shorthand  (const GtkStyleProperty *property);
84 GParameter *             _gtk_style_property_unpack        (const GtkStyleProperty *property,
85                                                             const GValue           *value,
86                                                             guint                  *n_params);
87 void                     _gtk_style_property_pack          (const GtkStyleProperty *property,
88                                                             GtkStyleProperties     *props,
89                                                             GtkStateFlags           state,
90                                                             GValue                 *value);
91
92 gboolean                 _gtk_style_property_parse_value   (const GtkStyleProperty *property,
93                                                             GValue                 *value,
94                                                             GtkCssParser           *parser,
95                                                             GFile                  *base);
96 void                     _gtk_style_property_print_value   (const GtkStyleProperty *property,
97                                                             const GValue           *value,
98                                                             GString                *string);
99
100 G_END_DECLS
101
102 #endif /* __GTK_CSS_STYLEPROPERTY_PRIVATE_H__ */