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;
50 GType gtk_style_context_get_type (void) G_GNUC_CONST;
52 void gtk_style_context_add_provider (GtkStyleContext *context,
53 GtkStyleProvider *provider,
56 void gtk_style_context_remove_provider (GtkStyleContext *context,
57 GtkStyleProvider *provider);
59 void gtk_style_context_save (GtkStyleContext *context);
60 void gtk_style_context_restore (GtkStyleContext *context);
62 void gtk_style_context_get_property (GtkStyleContext *context,
63 const gchar *property,
66 void gtk_style_context_get_valist (GtkStyleContext *context,
69 void gtk_style_context_get (GtkStyleContext *context,
71 ...) G_GNUC_NULL_TERMINATED;
73 void gtk_style_context_set_state (GtkStyleContext *context,
75 GtkStateFlags gtk_style_context_get_state (GtkStyleContext *context);
77 gboolean gtk_style_context_is_state_set (GtkStyleContext *context,
80 void gtk_style_context_set_path (GtkStyleContext *context,
82 G_CONST_RETURN GtkWidgetPath * gtk_style_context_get_path (GtkStyleContext *context);
84 void gtk_style_context_set_class (GtkStyleContext *context,
85 const gchar *class_name);
86 void gtk_style_context_unset_class (GtkStyleContext *context,
87 const gchar *class_name);
88 gboolean gtk_style_context_has_class (GtkStyleContext *context,
89 const gchar *class_name);
91 GList * gtk_style_context_list_child_classes (GtkStyleContext *context);
93 void gtk_style_context_set_child_class (GtkStyleContext *context,
94 const gchar *class_name,
95 GtkChildClassFlags flags);
96 void gtk_style_context_unset_child_class (GtkStyleContext *context,
97 const gchar *class_name);
98 gboolean gtk_style_context_has_child_class (GtkStyleContext *context,
99 const gchar *class_name,
100 GtkChildClassFlags *flags_return);
102 void gtk_style_context_get_style_property (GtkStyleContext *context,
103 const gchar *property_name,
105 void gtk_style_context_get_style_valist (GtkStyleContext *context,
107 void gtk_style_context_get_style (GtkStyleContext *context,
110 GtkIconSet * gtk_style_context_lookup_icon_set (GtkStyleContext *context,
111 const gchar *stock_id);
113 void gtk_style_context_set_screen (GtkStyleContext *context,
115 GdkScreen * gtk_style_context_get_screen (GtkStyleContext *context);
118 /* Semi-private API */
119 const GValue * _gtk_style_context_peek_style_property (GtkStyleContext *context,
124 void gtk_render_check (GtkStyleContext *context,
130 void gtk_render_option (GtkStyleContext *context,
136 void gtk_render_arrow (GtkStyleContext *context,
142 void gtk_render_background (GtkStyleContext *context,
148 void gtk_render_frame (GtkStyleContext *context,
154 void gtk_render_expander (GtkStyleContext *context,
160 void gtk_render_focus (GtkStyleContext *context,
166 void gtk_render_layout (GtkStyleContext *context,
170 PangoLayout *layout);
171 void gtk_render_line (GtkStyleContext *context,
177 void gtk_render_slider (GtkStyleContext *context,
183 GtkOrientation orientation);
184 void gtk_render_frame_gap (GtkStyleContext *context,
190 GtkPositionType gap_side,
193 void gtk_render_extension (GtkStyleContext *context,
199 GtkPositionType gap_side);
200 void gtk_render_handle (GtkStyleContext *context,
206 GtkOrientation orientation);
210 #endif /* __GTK_STYLE_CONTEXT_H__ */