1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
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.
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.
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.
20 #ifndef __GTK_STYLEPROPERTY_PRIVATE_H__
21 #define __GTK_STYLEPROPERTY_PRIVATE_H__
23 #include "gtkcssparserprivate.h"
24 #include "gtkstylecontextprivate.h"
28 #define GTK_TYPE_STYLE_PROPERTY (_gtk_style_property_get_type ())
29 #define GTK_STYLE_PROPERTY(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, GTK_TYPE_STYLE_PROPERTY, GtkStyleProperty))
30 #define GTK_STYLE_PROPERTY_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST (cls, GTK_TYPE_STYLE_PROPERTY, GtkStylePropertyClass))
31 #define GTK_IS_STYLE_PROPERTY(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GTK_TYPE_STYLE_PROPERTY))
32 #define GTK_IS_STYLE_PROPERTY_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE (obj, GTK_TYPE_STYLE_PROPERTY))
33 #define GTK_STYLE_PROPERTY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_STYLE_PROPERTY, GtkStylePropertyClass))
35 typedef struct _GtkStyleProperty GtkStyleProperty;
36 typedef struct _GtkStylePropertyClass GtkStylePropertyClass;
39 GTK_STYLE_PROPERTY_INHERIT = (1 << 0)
40 } GtkStylePropertyFlags;
42 typedef GParameter * (* GtkStyleUnpackFunc) (const GValue *value,
44 typedef void (* GtkStylePackFunc) (GValue *value,
45 GtkStyleProperties *props,
47 GtkStylePropertyContext *context);
48 typedef gboolean (* GtkStyleParseFunc) (GtkCssParser *parser,
51 typedef void (* GtkStylePrintFunc) (const GValue *value,
53 typedef void (* GtkStyleUnsetFunc) (GtkStyleProperties *props,
56 struct _GtkStyleProperty
64 GtkStylePropertyFlags flags;
67 GtkStylePropertyParser property_parse_func;
68 GtkStyleUnpackFunc unpack_func;
69 GtkStylePackFunc pack_func;
70 GtkStyleParseFunc parse_func;
71 GtkStylePrintFunc print_func;
72 GtkStyleUnsetFunc unset_func;
75 struct _GtkStylePropertyClass
77 GObjectClass parent_class;
79 GHashTable *properties;
82 GType _gtk_style_property_get_type (void) G_GNUC_CONST;
84 GtkStyleProperty * _gtk_style_property_lookup (const char *name);
86 const char * _gtk_style_property_get_name (GtkStyleProperty *property);
88 void _gtk_style_property_register (GParamSpec *pspec,
89 GtkStylePropertyFlags flags,
90 GtkStylePropertyParser property_parse_func,
91 GtkStyleParseFunc parse_func,
92 GtkStylePrintFunc print_func,
93 const GValue *initial_value);
95 GParameter * _gtk_style_property_unpack (GtkStyleProperty * property,
99 gboolean _gtk_style_property_parse_value (GtkStyleProperty * property,
101 GtkCssParser *parser,
103 void _gtk_style_property_print_value (GtkStyleProperty * property,
107 GType _gtk_style_property_get_value_type(GtkStyleProperty * property);
108 void _gtk_style_property_query (GtkStyleProperty * property,
109 GtkStyleProperties *props,
111 GtkStylePropertyContext *context,
113 void _gtk_style_property_assign (GtkStyleProperty *property,
114 GtkStyleProperties *props,
116 const GValue *value);
120 #endif /* __GTK_CSS_STYLEPROPERTY_PRIVATE_H__ */