]> Pileus Git - ~andy/gtk/blob - gtk/gtkstyleproperties.h
a2398bd15217314fedaa115f0202ef450b94ec33
[~andy/gtk] / gtk / gtkstyleproperties.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 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
21 #error "Only <gtk/gtk.h> can be included directly."
22 #endif
23
24 #ifndef __GTK_STYLE_PROPERTIES_H__
25 #define __GTK_STYLE_PROPERTIES_H__
26
27 #include <glib-object.h>
28 #include <gdk/gdk.h>
29 #include <gtk/gtkenums.h>
30
31 G_BEGIN_DECLS
32
33 #define GTK_TYPE_STYLE_PROPERTIES         (gtk_style_properties_get_type ())
34 #define GTK_STYLE_PROPERTIES(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_STYLE_PROPERTIES, GtkStyleProperties))
35 #define GTK_STYLE_PROPERTIES_CLASS(c)     (G_TYPE_CHECK_CLASS_CAST    ((c), GTK_TYPE_STYLE_PROPERTIES, GtkStylePropertiesClass))
36 #define GTK_IS_STYLE_PROPERTIES(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_STYLE_PROPERTIES))
37 #define GTK_IS_STYLE_PROPERTIES_CLASS(c)  (G_TYPE_CHECK_CLASS_TYPE    ((c), GTK_TYPE_STYLE_PROPERTIES))
38 #define GTK_STYLE_PROPERTIES_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS  ((o), GTK_TYPE_STYLE_PROPERTIES, GtkStylePropertiesClass))
39
40 typedef struct _GtkStyleProperties GtkStyleProperties;
41 typedef struct _GtkStylePropertiesClass GtkStylePropertiesClass;
42 typedef struct _GtkStylePropertiesPrivate GtkStylePropertiesPrivate;
43
44 typedef struct _GtkSymbolicColor GtkSymbolicColor;
45 typedef struct _GtkGradient GtkGradient;
46
47 struct _GtkStyleProperties
48 {
49   GObject parent_object;
50   GtkStylePropertiesPrivate *priv;
51 };
52
53 struct _GtkStylePropertiesClass
54 {
55   GObjectClass parent_class;
56
57   /* Padding for future expansion */
58   void (*_gtk_reserved1) (void);
59   void (*_gtk_reserved2) (void);
60   void (*_gtk_reserved3) (void);
61   void (*_gtk_reserved4) (void);
62 };
63
64 typedef gboolean (* GtkStylePropertyParser) (const gchar  *string,
65                                              GValue       *value,
66                                              GError      **error);
67
68 GType gtk_style_properties_get_type (void) G_GNUC_CONST;
69
70 /* Next 2 are implemented in gtkcsscustomproperty.c */
71 void     gtk_style_properties_register_property (GtkStylePropertyParser  parse_func,
72                                                  GParamSpec             *pspec);
73 gboolean gtk_style_properties_lookup_property   (const gchar             *property_name,
74                                                  GtkStylePropertyParser  *parse_func,
75                                                  GParamSpec             **pspec);
76
77 GtkStyleProperties * gtk_style_properties_new (void);
78
79 void               gtk_style_properties_map_color    (GtkStyleProperties *props,
80                                                       const gchar        *name,
81                                                       GtkSymbolicColor   *color);
82 GtkSymbolicColor * gtk_style_properties_lookup_color (GtkStyleProperties *props,
83                                                       const gchar        *name);
84
85 void     gtk_style_properties_set_property (GtkStyleProperties *props,
86                                             const gchar        *property,
87                                             GtkStateFlags       state,
88                                             const GValue       *value);
89 void     gtk_style_properties_set_valist   (GtkStyleProperties *props,
90                                             GtkStateFlags       state,
91                                             va_list             args);
92 void     gtk_style_properties_set          (GtkStyleProperties *props,
93                                             GtkStateFlags       state,
94                                             ...) G_GNUC_NULL_TERMINATED;
95
96 gboolean gtk_style_properties_get_property (GtkStyleProperties *props,
97                                             const gchar        *property,
98                                             GtkStateFlags       state,
99                                             GValue             *value);
100 void     gtk_style_properties_get_valist   (GtkStyleProperties *props,
101                                             GtkStateFlags       state,
102                                             va_list             args);
103 void     gtk_style_properties_get          (GtkStyleProperties *props,
104                                             GtkStateFlags       state,
105                                             ...) G_GNUC_NULL_TERMINATED;
106
107 void     gtk_style_properties_unset_property (GtkStyleProperties *props,
108                                               const gchar        *property,
109                                               GtkStateFlags       state);
110
111 void     gtk_style_properties_clear          (GtkStyleProperties  *props);
112
113 void     gtk_style_properties_merge          (GtkStyleProperties       *props,
114                                               const GtkStyleProperties *props_to_merge,
115                                               gboolean                  replace);
116
117 G_END_DECLS
118
119 #endif /* __GTK_STYLE_PROPERTIES_H__ */