]> Pileus Git - ~andy/gtk/blob - gtk/gtkthemingengine.h
Move all theming stack to use GtkStateFlags.
[~andy/gtk] / gtk / gtkthemingengine.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_THEMING_ENGINE_H__
21 #define __GTK_THEMING_ENGINE_H__
22
23 #include <glib-object.h>
24 #include <cairo.h>
25
26 #include <gtk/gtkstylecontext.h>
27 #include <gtk/gtkwidgetpath.h>
28 #include <gtk/gtkenums.h>
29
30 G_BEGIN_DECLS
31
32 #define GTK_TYPE_THEMING_ENGINE         (gtk_theming_engine_get_type ())
33 #define GTK_THEMING_ENGINE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_THEMING_ENGINE, GtkThemingEngine))
34 #define GTK_THEMING_ENGINE_CLASS(c)     (G_TYPE_CHECK_CLASS_CAST    ((c), GTK_TYPE_THEMING_ENGINE, GtkThemingEngineClass))
35 #define GTK_IS_THEMING_ENGINE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_THEMING_ENGINE))
36 #define GTK_IS_THEMING_ENGINE_CLASS(c)  (G_TYPE_CHECK_CLASS_TYPE    ((c), GTK_TYPE_THEMING_ENGINE))
37 #define GTK_THEMING_ENGINE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS  ((o), GTK_TYPE_THEMING_ENGINE, GtkThemingEngineClass))
38
39 typedef struct GtkThemingEngine GtkThemingEngine;
40 typedef struct GtkThemingEngineClass GtkThemingEngineClass;
41
42 struct GtkThemingEngine
43 {
44   GObject parent_object;
45   gpointer priv;
46 };
47
48 struct GtkThemingEngineClass
49 {
50   GObjectClass parent_class;
51
52   void (* render_line) (GtkThemingEngine *engine,
53                         cairo_t          *cr,
54                         gdouble           x0,
55                         gdouble           y0,
56                         gdouble           x1,
57                         gdouble           y1);
58   void (* render_background) (GtkThemingEngine *engine,
59                               cairo_t          *cr,
60                               gdouble           x,
61                               gdouble           y,
62                               gdouble           width,
63                               gdouble           height);
64   void (* render_frame) (GtkThemingEngine *engine,
65                          cairo_t          *cr,
66                          gdouble           x,
67                          gdouble           y,
68                          gdouble           width,
69                          gdouble           height);
70   void (* render_frame_gap) (GtkThemingEngine *engine,
71                              cairo_t          *cr,
72                              gdouble           x,
73                              gdouble           y,
74                              gdouble           width,
75                              gdouble           height,
76                              GtkPositionType   gap_side,
77                              gdouble           xy0_gap,
78                              gdouble           xy1_gap);
79   void (* render_extension) (GtkThemingEngine *engine,
80                              cairo_t          *cr,
81                              gdouble           x,
82                              gdouble           y,
83                              gdouble           width,
84                              gdouble           height,
85                              GtkPositionType   gap_side);
86   void (* render_check) (GtkThemingEngine *engine,
87                          cairo_t          *cr,
88                          gdouble           x,
89                          gdouble           y,
90                          gdouble           width,
91                          gdouble           height);
92   void (* render_option) (GtkThemingEngine *engine,
93                           cairo_t          *cr,
94                           gdouble           x,
95                           gdouble           y,
96                           gdouble           width,
97                           gdouble           height);
98   void (* render_arrow) (GtkThemingEngine *engine,
99                          cairo_t          *cr,
100                          gdouble           angle,
101                          gdouble           x,
102                          gdouble           y,
103                          gdouble           size);
104   void (* render_expander) (GtkThemingEngine *engine,
105                             cairo_t          *cr,
106                             gdouble           x,
107                             gdouble           y,
108                             gdouble           width,
109                             gdouble           height);
110   void (* render_focus) (GtkThemingEngine *engine,
111                          cairo_t          *cr,
112                          gdouble           x,
113                          gdouble           y,
114                          gdouble           width,
115                          gdouble           height);
116   void (* render_layout) (GtkThemingEngine *engine,
117                           cairo_t          *cr,
118                           gdouble           x,
119                           gdouble           y,
120                           PangoLayout      *layout);
121   void (* render_slider) (GtkThemingEngine *engine,
122                           cairo_t          *cr,
123                           gdouble           x,
124                           gdouble           y,
125                           gdouble           width,
126                           gdouble           height,
127                           GtkOrientation    orientation);
128   void (* render_handle)    (GtkThemingEngine *engine,
129                              cairo_t          *cr,
130                              gdouble           x,
131                              gdouble           y,
132                              gdouble           width,
133                              gdouble           height,
134                              GtkOrientation    orientation);
135 };
136
137 GType gtk_theming_engine_get_type (void) G_GNUC_CONST;
138
139 void _gtk_theming_engine_set_context (GtkThemingEngine *engine,
140                                       GtkStyleContext  *context);
141
142 void gtk_theming_engine_register_property (GtkThemingEngine       *engine,
143                                            const gchar            *property_name,
144                                            GType                   type,
145                                            const GValue           *default_value,
146                                            GtkStylePropertyParser  parse_func);
147
148 void gtk_theming_engine_get_property (GtkThemingEngine *engine,
149                                       const gchar      *property,
150                                       GtkStateFlags     state,
151                                       GValue           *value);
152 void gtk_theming_engine_get_valist   (GtkThemingEngine *engine,
153                                       GtkStateFlags     state,
154                                       va_list           args);
155 void gtk_theming_engine_get          (GtkThemingEngine *engine,
156                                       GtkStateFlags     state,
157                                       ...) G_GNUC_NULL_TERMINATED;
158
159 void gtk_theming_engine_get_style_property (GtkThemingEngine *engine,
160                                             const gchar      *property_name,
161                                             GValue           *value);
162 void gtk_theming_engine_get_style_valist   (GtkThemingEngine *engine,
163                                             va_list           args);
164 void gtk_theming_engine_get_style          (GtkThemingEngine *engine,
165                                             ...);
166
167
168 G_CONST_RETURN GtkWidgetPath * gtk_theming_engine_get_path (GtkThemingEngine *engine);
169
170 gboolean gtk_theming_engine_has_class  (GtkThemingEngine *engine,
171                                         const gchar      *style_class);
172 gboolean gtk_theming_engine_has_region (GtkThemingEngine *engine,
173                                         const gchar      *style_class,
174                                         GtkRegionFlags   *flags);
175
176 GtkStateFlags gtk_theming_engine_get_state     (GtkThemingEngine *engine);
177 gboolean      gtk_theming_engine_is_state_set  (GtkThemingEngine *engine,
178                                                 GtkStateType      state);
179
180 GtkTextDirection gtk_theming_engine_get_direction (GtkThemingEngine *engine);
181
182 GtkJunctionSides gtk_theming_engine_get_junction_sides (GtkThemingEngine *engine);
183
184 G_CONST_RETURN GtkThemingEngine * gtk_theming_engine_load (const gchar *name);
185
186 GdkScreen * gtk_theming_engine_get_screen (GtkThemingEngine *engine);
187
188
189 G_END_DECLS
190
191 #endif /* __GTK_THEMING_ENGINE_H__ */