]> Pileus Git - ~andy/gtk/blob - gtk/gtkthemingengine.h
GtkThemingEngine: Do not use possible reserved word.
[~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 /**
49  * GtkThemingEngineClass
50  * @parent_class: The parent class.
51  * @render_line: Renders a line between two points.
52  * @render_background: Renders the background area of a widget region.
53  * @render_frame: Renders the frame around a widget area.
54  * @render_frame_gap: Renders the frame around a widget area with a gap in it.
55  * @render_extension: Renders a extension to a box, usually a notebook tab.
56  * @render_check: Renders a checkmark, as in #GtkCheckButton.
57  * @render_option: Renders an option, as in #GtkRadioButton.
58  * @render_arrow: Renders an arrow pointing to a certain direction.
59  * @render_expander: Renders an element what will expose/expand part of
60  *                   the UI, as in #GtkExpander.
61  * @render_focus: Renders the focus indicator.
62  * @render_layout: Renders a #PangoLayout
63  * @render_slider: Renders a slider control, as in #GtkScale.
64  * @render_handle: Renders a handle to drag UI elements, as in #GtkPaned.
65  * @render_activity: Renders an area displaying activity, such as in #GtkSpinner,
66  *                   or #GtkProgressBar.
67  * @render_icon_pixbuf: Renders an icon as a #GdkPixbuf.
68  *
69  * Base class for theming engines.
70  */
71 struct _GtkThemingEngineClass
72 {
73   GObjectClass parent_class;
74
75   void (* render_line) (GtkThemingEngine *engine,
76                         cairo_t          *cr,
77                         gdouble           x0,
78                         gdouble           y0,
79                         gdouble           x1,
80                         gdouble           y1);
81   void (* render_background) (GtkThemingEngine *engine,
82                               cairo_t          *cr,
83                               gdouble           x,
84                               gdouble           y,
85                               gdouble           width,
86                               gdouble           height);
87   void (* render_frame) (GtkThemingEngine *engine,
88                          cairo_t          *cr,
89                          gdouble           x,
90                          gdouble           y,
91                          gdouble           width,
92                          gdouble           height);
93   void (* render_frame_gap) (GtkThemingEngine *engine,
94                              cairo_t          *cr,
95                              gdouble           x,
96                              gdouble           y,
97                              gdouble           width,
98                              gdouble           height,
99                              GtkPositionType   gap_side,
100                              gdouble           xy0_gap,
101                              gdouble           xy1_gap);
102   void (* render_extension) (GtkThemingEngine *engine,
103                              cairo_t          *cr,
104                              gdouble           x,
105                              gdouble           y,
106                              gdouble           width,
107                              gdouble           height,
108                              GtkPositionType   gap_side);
109   void (* render_check) (GtkThemingEngine *engine,
110                          cairo_t          *cr,
111                          gdouble           x,
112                          gdouble           y,
113                          gdouble           width,
114                          gdouble           height);
115   void (* render_option) (GtkThemingEngine *engine,
116                           cairo_t          *cr,
117                           gdouble           x,
118                           gdouble           y,
119                           gdouble           width,
120                           gdouble           height);
121   void (* render_arrow) (GtkThemingEngine *engine,
122                          cairo_t          *cr,
123                          gdouble           angle,
124                          gdouble           x,
125                          gdouble           y,
126                          gdouble           size);
127   void (* render_expander) (GtkThemingEngine *engine,
128                             cairo_t          *cr,
129                             gdouble           x,
130                             gdouble           y,
131                             gdouble           width,
132                             gdouble           height);
133   void (* render_focus) (GtkThemingEngine *engine,
134                          cairo_t          *cr,
135                          gdouble           x,
136                          gdouble           y,
137                          gdouble           width,
138                          gdouble           height);
139   void (* render_layout) (GtkThemingEngine *engine,
140                           cairo_t          *cr,
141                           gdouble           x,
142                           gdouble           y,
143                           PangoLayout      *layout);
144   void (* render_slider) (GtkThemingEngine *engine,
145                           cairo_t          *cr,
146                           gdouble           x,
147                           gdouble           y,
148                           gdouble           width,
149                           gdouble           height,
150                           GtkOrientation    orientation);
151   void (* render_handle)    (GtkThemingEngine *engine,
152                              cairo_t          *cr,
153                              gdouble           x,
154                              gdouble           y,
155                              gdouble           width,
156                              gdouble           height);
157   void (* render_activity) (GtkThemingEngine *engine,
158                             cairo_t          *cr,
159                             gdouble           x,
160                             gdouble           y,
161                             gdouble           width,
162                             gdouble           height);
163
164   GdkPixbuf * (* render_icon_pixbuf) (GtkThemingEngine    *engine,
165                                       const GtkIconSource *source,
166                                       GtkIconSize          size);
167 };
168
169 GType gtk_theming_engine_get_type (void) G_GNUC_CONST;
170
171 void _gtk_theming_engine_set_context (GtkThemingEngine *engine,
172                                       GtkStyleContext  *context);
173
174 void gtk_theming_engine_register_property (const gchar            *name_space,
175                                            GtkStylePropertyParser  parse_func,
176                                            GParamSpec             *pspec);
177
178 void gtk_theming_engine_get_property (GtkThemingEngine *engine,
179                                       const gchar      *property,
180                                       GtkStateFlags     state,
181                                       GValue           *value);
182 void gtk_theming_engine_get_valist   (GtkThemingEngine *engine,
183                                       GtkStateFlags     state,
184                                       va_list           args);
185 void gtk_theming_engine_get          (GtkThemingEngine *engine,
186                                       GtkStateFlags     state,
187                                       ...) G_GNUC_NULL_TERMINATED;
188
189 void gtk_theming_engine_get_style_property (GtkThemingEngine *engine,
190                                             const gchar      *property_name,
191                                             GValue           *value);
192 void gtk_theming_engine_get_style_valist   (GtkThemingEngine *engine,
193                                             va_list           args);
194 void gtk_theming_engine_get_style          (GtkThemingEngine *engine,
195                                             ...);
196
197
198 G_CONST_RETURN GtkWidgetPath * gtk_theming_engine_get_path (GtkThemingEngine *engine);
199
200 gboolean gtk_theming_engine_has_class  (GtkThemingEngine *engine,
201                                         const gchar      *style_class);
202 gboolean gtk_theming_engine_has_region (GtkThemingEngine *engine,
203                                         const gchar      *style_region,
204                                         GtkRegionFlags   *flags);
205
206 GtkStateFlags gtk_theming_engine_get_state        (GtkThemingEngine *engine);
207 gboolean      gtk_theming_engine_state_is_running (GtkThemingEngine *engine,
208                                                    GtkStateType      state,
209                                                    gdouble          *progress);
210
211 GtkTextDirection gtk_theming_engine_get_direction (GtkThemingEngine *engine);
212
213 GtkJunctionSides gtk_theming_engine_get_junction_sides (GtkThemingEngine *engine);
214
215 GtkThemingEngine * gtk_theming_engine_load (const gchar *name);
216
217 GdkScreen * gtk_theming_engine_get_screen (GtkThemingEngine *engine);
218
219
220 G_END_DECLS
221
222 #endif /* __GTK_THEMING_ENGINE_H__ */