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 GtkStyleContext * gtk_style_context_new (void);
56 void gtk_style_context_add_provider_for_screen (GdkScreen *screen,
57 GtkStyleProvider *provider,
59 void gtk_style_context_remove_provider_for_screen (GdkScreen *screen,
60 GtkStyleProvider *provider);
62 void gtk_style_context_add_provider (GtkStyleContext *context,
63 GtkStyleProvider *provider,
66 void gtk_style_context_remove_provider (GtkStyleContext *context,
67 GtkStyleProvider *provider);
69 void gtk_style_context_save (GtkStyleContext *context);
70 void gtk_style_context_restore (GtkStyleContext *context);
72 void gtk_style_context_get_property (GtkStyleContext *context,
73 const gchar *property,
76 void gtk_style_context_get_valist (GtkStyleContext *context,
79 void gtk_style_context_get (GtkStyleContext *context,
81 ...) G_GNUC_NULL_TERMINATED;
83 void gtk_style_context_set_state (GtkStyleContext *context,
85 GtkStateFlags gtk_style_context_get_state (GtkStyleContext *context);
87 gboolean gtk_style_context_state_is_running (GtkStyleContext *context,
91 void gtk_style_context_set_path (GtkStyleContext *context,
93 G_CONST_RETURN GtkWidgetPath * gtk_style_context_get_path (GtkStyleContext *context);
95 GList * gtk_style_context_list_classes (GtkStyleContext *context);
97 void gtk_style_context_add_class (GtkStyleContext *context,
98 const gchar *class_name);
99 void gtk_style_context_remove_class (GtkStyleContext *context,
100 const gchar *class_name);
101 gboolean gtk_style_context_has_class (GtkStyleContext *context,
102 const gchar *class_name);
104 GList * gtk_style_context_list_regions (GtkStyleContext *context);
106 void gtk_style_context_add_region (GtkStyleContext *context,
107 const gchar *region_name,
108 GtkRegionFlags flags);
109 void gtk_style_context_remove_region (GtkStyleContext *context,
110 const gchar *region_name);
111 gboolean gtk_style_context_has_region (GtkStyleContext *context,
112 const gchar *region_name,
113 GtkRegionFlags *flags_return);
115 void gtk_style_context_get_style_property (GtkStyleContext *context,
116 const gchar *property_name,
118 void gtk_style_context_get_style_valist (GtkStyleContext *context,
120 void gtk_style_context_get_style (GtkStyleContext *context,
123 GtkIconSet * gtk_style_context_lookup_icon_set (GtkStyleContext *context,
124 const gchar *stock_id);
126 void gtk_style_context_set_screen (GtkStyleContext *context,
128 GdkScreen * gtk_style_context_get_screen (GtkStyleContext *context);
130 void gtk_style_context_set_direction (GtkStyleContext *context,
131 GtkTextDirection direction);
132 GtkTextDirection gtk_style_context_get_direction (GtkStyleContext *context);
134 void gtk_style_context_set_junction_sides (GtkStyleContext *context,
135 GtkJunctionSides sides);
136 GtkJunctionSides gtk_style_context_get_junction_sides (GtkStyleContext *context);
138 gboolean gtk_style_context_lookup_color (GtkStyleContext *context,
139 const gchar *color_name,
142 void gtk_style_context_notify_state_change (GtkStyleContext *context,
146 gboolean state_value);
147 void gtk_style_context_push_animatable_region (GtkStyleContext *context,
149 void gtk_style_context_pop_animatable_region (GtkStyleContext *context);
152 /* Semi-private API */
153 const GValue * _gtk_style_context_peek_style_property (GtkStyleContext *context,
156 void _gtk_style_context_invalidate_animation_areas (GtkStyleContext *context);
157 void _gtk_style_context_coalesce_animation_areas (GtkStyleContext *context,
161 /* Animation for state changes */
162 void gtk_style_context_state_transition_start (GtkStyleContext *context,
168 void gtk_style_context_state_transition_update (GtkStyleContext *context,
172 void gtk_style_context_state_transition_stop (GtkStyleContext *context,
173 gpointer identifier);
175 void gtk_style_context_invalidate (GtkStyleContext *context);
176 void gtk_style_context_reset_widgets (GdkScreen *screen);
179 void gtk_render_check (GtkStyleContext *context,
185 void gtk_render_option (GtkStyleContext *context,
191 void gtk_render_arrow (GtkStyleContext *context,
197 void gtk_render_background (GtkStyleContext *context,
203 void gtk_render_frame (GtkStyleContext *context,
209 void gtk_render_expander (GtkStyleContext *context,
215 void gtk_render_focus (GtkStyleContext *context,
221 void gtk_render_layout (GtkStyleContext *context,
225 PangoLayout *layout);
226 void gtk_render_line (GtkStyleContext *context,
232 void gtk_render_slider (GtkStyleContext *context,
238 GtkOrientation orientation);
239 void gtk_render_frame_gap (GtkStyleContext *context,
245 GtkPositionType gap_side,
248 void gtk_render_extension (GtkStyleContext *context,
254 GtkPositionType gap_side);
255 void gtk_render_handle (GtkStyleContext *context,
261 void gtk_render_activity (GtkStyleContext *context,
270 #endif /* __GTK_STYLE_CONTEXT_H__ */