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