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_STYLE_CONTEXT_H__
21 #define __GTK_STYLE_CONTEXT_H__
23 #include <glib-object.h>
24 #include <gtk/gtkstyleprovider.h>
25 #include <gtk/gtkwidgetpath.h>
29 #define GTK_TYPE_STYLE_CONTEXT (gtk_style_context_get_type ())
30 #define GTK_STYLE_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_STYLE_CONTEXT, GtkStyleContext))
31 #define GTK_STYLE_CONTEXT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GTK_TYPE_STYLE_CONTEXT, GtkStyleContextClass))
32 #define GTK_IS_STYLE_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_STYLE_CONTEXT))
33 #define GTK_IS_STYLE_CONTEXT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GTK_TYPE_STYLE_CONTEXT))
34 #define GTK_STYLE_CONTEXT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_STYLE_CONTEXT, GtkStyleContextClass))
36 typedef struct GtkStyleContext GtkStyleContext;
37 typedef struct GtkStyleContextClass GtkStyleContextClass;
39 struct GtkStyleContext
41 GObject parent_object;
45 struct GtkStyleContextClass
47 GObjectClass parent_class;
49 void (* changed) (GtkStyleContext *context);
52 GType gtk_style_context_get_type (void) G_GNUC_CONST;
54 void gtk_style_context_add_provider_for_screen (GdkScreen *screen,
55 GtkStyleProvider *provider,
57 void gtk_style_context_remove_provider_for_screen (GdkScreen *screen,
58 GtkStyleProvider *provider);
60 void gtk_style_context_add_provider (GtkStyleContext *context,
61 GtkStyleProvider *provider,
64 void gtk_style_context_remove_provider (GtkStyleContext *context,
65 GtkStyleProvider *provider);
67 void gtk_style_context_save (GtkStyleContext *context);
68 void gtk_style_context_restore (GtkStyleContext *context);
70 void gtk_style_context_get_property (GtkStyleContext *context,
71 const gchar *property,
74 void gtk_style_context_get_valist (GtkStyleContext *context,
77 void gtk_style_context_get (GtkStyleContext *context,
79 ...) G_GNUC_NULL_TERMINATED;
81 void gtk_style_context_set_state (GtkStyleContext *context,
83 GtkStateFlags gtk_style_context_get_state (GtkStyleContext *context);
85 gboolean gtk_style_context_is_state_set (GtkStyleContext *context,
89 void gtk_style_context_set_path (GtkStyleContext *context,
91 G_CONST_RETURN GtkWidgetPath * gtk_style_context_get_path (GtkStyleContext *context);
93 GList * gtk_style_context_list_classes (GtkStyleContext *context);
95 void gtk_style_context_set_class (GtkStyleContext *context,
96 const gchar *class_name);
97 void gtk_style_context_unset_class (GtkStyleContext *context,
98 const gchar *class_name);
99 gboolean gtk_style_context_has_class (GtkStyleContext *context,
100 const gchar *class_name);
102 GList * gtk_style_context_list_regions (GtkStyleContext *context);
104 void gtk_style_context_set_region (GtkStyleContext *context,
105 const gchar *region_name,
106 GtkRegionFlags flags);
107 void gtk_style_context_unset_region (GtkStyleContext *context,
108 const gchar *region_name);
109 gboolean gtk_style_context_has_region (GtkStyleContext *context,
110 const gchar *region_name,
111 GtkRegionFlags *flags_return);
113 void gtk_style_context_get_style_property (GtkStyleContext *context,
114 const gchar *property_name,
116 void gtk_style_context_get_style_valist (GtkStyleContext *context,
118 void gtk_style_context_get_style (GtkStyleContext *context,
121 GtkIconSet * gtk_style_context_lookup_icon_set (GtkStyleContext *context,
122 const gchar *stock_id);
124 void gtk_style_context_set_screen (GtkStyleContext *context,
126 GdkScreen * gtk_style_context_get_screen (GtkStyleContext *context);
128 void gtk_style_context_set_direction (GtkStyleContext *context,
129 GtkTextDirection direction);
130 GtkTextDirection gtk_style_context_get_direction (GtkStyleContext *context);
132 void gtk_style_context_set_junction_sides (GtkStyleContext *context,
133 GtkJunctionSides sides);
134 GtkJunctionSides gtk_style_context_get_junction_sides (GtkStyleContext *context);
136 gboolean gtk_style_context_lookup_color (GtkStyleContext *context,
137 const gchar *color_name,
140 void gtk_style_context_notify_state_change (GtkStyleContext *context,
144 gboolean state_value);
145 void gtk_style_context_push_animatable_region (GtkStyleContext *context,
147 void gtk_style_context_pop_animatable_region (GtkStyleContext *context);
150 /* Semi-private API */
151 const GValue * _gtk_style_context_peek_style_property (GtkStyleContext *context,
154 void _gtk_style_context_invalidate_animation_areas (GtkStyleContext *context);
155 void _gtk_style_context_coalesce_animation_areas (GtkStyleContext *context,
159 /* Animation for state changes */
160 void gtk_style_context_state_transition_start (GtkStyleContext *context,
166 void gtk_style_context_state_transition_update (GtkStyleContext *context,
170 void gtk_style_context_state_transition_stop (GtkStyleContext *context,
171 gpointer identifier);
173 void gtk_style_context_invalidate (GtkStyleContext *context);
174 void gtk_style_context_reset_widgets (GdkScreen *screen);
177 void gtk_render_check (GtkStyleContext *context,
183 void gtk_render_option (GtkStyleContext *context,
189 void gtk_render_arrow (GtkStyleContext *context,
195 void gtk_render_background (GtkStyleContext *context,
201 void gtk_render_frame (GtkStyleContext *context,
207 void gtk_render_expander (GtkStyleContext *context,
213 void gtk_render_focus (GtkStyleContext *context,
219 void gtk_render_layout (GtkStyleContext *context,
223 PangoLayout *layout);
224 void gtk_render_line (GtkStyleContext *context,
230 void gtk_render_slider (GtkStyleContext *context,
236 GtkOrientation orientation);
237 void gtk_render_frame_gap (GtkStyleContext *context,
243 GtkPositionType gap_side,
246 void gtk_render_extension (GtkStyleContext *context,
252 GtkPositionType gap_side);
253 void gtk_render_handle (GtkStyleContext *context,
259 void gtk_render_progress (GtkStyleContext *context,
268 #endif /* __GTK_STYLE_CONTEXT_H__ */