]> Pileus Git - ~andy/gtk/blob - gtk/gtkstylecontext.h
types: Clean up gtkwidget.h includes
[~andy/gtk] / gtk / gtkstylecontext.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, see <http://www.gnu.org/licenses/>.
16  */
17
18 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
19 #error "Only <gtk/gtk.h> can be included directly."
20 #endif
21
22 #ifndef __GTK_STYLE_CONTEXT_H__
23 #define __GTK_STYLE_CONTEXT_H__
24
25 #include <gtk/gtkborder.h>
26 #include <gtk/gtkcsssection.h>
27 #include <gtk/gtkstyleprovider.h>
28 #include <gtk/gtktypes.h>
29 #include <atk/atk.h>
30
31 G_BEGIN_DECLS
32
33 #define GTK_TYPE_STYLE_CONTEXT         (gtk_style_context_get_type ())
34 #define GTK_STYLE_CONTEXT(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_STYLE_CONTEXT, GtkStyleContext))
35 #define GTK_STYLE_CONTEXT_CLASS(c)     (G_TYPE_CHECK_CLASS_CAST    ((c), GTK_TYPE_STYLE_CONTEXT, GtkStyleContextClass))
36 #define GTK_IS_STYLE_CONTEXT(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_STYLE_CONTEXT))
37 #define GTK_IS_STYLE_CONTEXT_CLASS(c)  (G_TYPE_CHECK_CLASS_TYPE    ((c), GTK_TYPE_STYLE_CONTEXT))
38 #define GTK_STYLE_CONTEXT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS  ((o), GTK_TYPE_STYLE_CONTEXT, GtkStyleContextClass))
39
40 typedef struct _GtkStyleContextClass GtkStyleContextClass;
41 typedef struct _GtkStyleContextPrivate GtkStyleContextPrivate;
42
43 struct _GtkStyleContext
44 {
45   GObject parent_object;
46   GtkStyleContextPrivate *priv;
47 };
48
49 struct _GtkStyleContextClass
50 {
51   GObjectClass parent_class;
52
53   void (* changed) (GtkStyleContext *context);
54
55   /* Padding for future expansion */
56   void (*_gtk_reserved1) (void);
57   void (*_gtk_reserved2) (void);
58   void (*_gtk_reserved3) (void);
59   void (*_gtk_reserved4) (void);
60 };
61
62 /* Default set of properties that GtkStyleContext may contain */
63
64 /**
65  * GTK_STYLE_PROPERTY_BACKGROUND_COLOR:
66  *
67  * A property holding the background color of rendered elements as a #GdkRGBA.
68  */
69 #define GTK_STYLE_PROPERTY_BACKGROUND_COLOR "background-color"
70
71 /**
72  * GTK_STYLE_PROPERTY_COLOR:
73  *
74  * A property holding the foreground color of rendered elements as a #GdkRGBA.
75  */
76 #define GTK_STYLE_PROPERTY_COLOR "color"
77
78 /**
79  * GTK_STYLE_PROPERTY_FONT:
80  *
81  * A property holding the font properties used when rendering text
82  * as a #PangoFontDescription.
83  */
84 #define GTK_STYLE_PROPERTY_FONT "font"
85
86 /**
87  * GTK_STYLE_PROPERTY_PADDING:
88  *
89  * A property holding the rendered element's padding as a #GtkBorder. The
90  * padding is defined as the spacing between the inner part of the element border
91  * and its child. It's the innermost spacing property of the padding/border/margin
92  * series.
93  */
94 #define GTK_STYLE_PROPERTY_PADDING "padding"
95
96 /**
97  * GTK_STYLE_PROPERTY_BORDER_WIDTH:
98  *
99  * A property holding the rendered element's border width in pixels as
100  * a #GtkBorder. The border is the intermediary spacing property of the
101  * padding/border/margin series.
102  *
103  * gtk_render_frame() uses this property to find out the frame line width,
104  * so #GtkWidget<!-- -->s rendering frames may need to add up this padding when
105  * requesting size
106  */
107 #define GTK_STYLE_PROPERTY_BORDER_WIDTH "border-width"
108
109 /**
110  * GTK_STYLE_PROPERTY_MARGIN:
111  *
112  * A property holding the rendered element's margin as a #GtkBorder. The
113  * margin is defined as the spacing between the border of the element
114  * and its surrounding elements. It is external to #GtkWidget<!-- -->s's
115  * size allocations, and the most external spacing property of the
116  * padding/border/margin series.
117  */
118 #define GTK_STYLE_PROPERTY_MARGIN "margin"
119
120 /**
121  * GTK_STYLE_PROPERTY_BORDER_RADIUS:
122  *
123  * A property holding the rendered element's border radius in pixels as a #gint.
124  */
125 #define GTK_STYLE_PROPERTY_BORDER_RADIUS "border-radius"
126
127 /**
128  * GTK_STYLE_PROPERTY_BORDER_STYLE:
129  *
130  * A property holding the element's border style as a #GtkBorderStyle.
131  */
132 #define GTK_STYLE_PROPERTY_BORDER_STYLE "border-style"
133
134 /**
135  * GTK_STYLE_PROPERTY_BORDER_COLOR:
136  *
137  * A property holding the element's border color as a #GdkRGBA.
138  */
139 #define GTK_STYLE_PROPERTY_BORDER_COLOR "border-color"
140
141 /**
142  * GTK_STYLE_PROPERTY_BACKGROUND_IMAGE:
143  *
144  * A property holding the element's background as a #cairo_pattern_t.
145  */
146 #define GTK_STYLE_PROPERTY_BACKGROUND_IMAGE "background-image"
147
148 /* Predefined set of CSS classes */
149
150 /**
151  * GTK_STYLE_CLASS_CELL:
152  *
153  * A CSS class to match content rendered in cell views.
154  *
155  * This is used by cell renderers, e.g. in #GtkIconView
156  * and #GtkTreeView.
157  */
158 #define GTK_STYLE_CLASS_CELL "cell"
159
160 /**
161  * GTK_STYLE_CLASS_ENTRY:
162  *
163  * A CSS class to match text entries.
164  *
165  * This is used by #GtkEntry.
166  */
167 #define GTK_STYLE_CLASS_ENTRY "entry"
168
169 /**
170  * GTK_STYLE_CLASS_COMBOBOX_ENTRY:
171  *
172  * A CSS class to match combobox entries.
173  *
174  * This is used by #GtkComboBox.
175  */
176 #define GTK_STYLE_CLASS_COMBOBOX_ENTRY "combobox-entry"
177
178 /**
179  * GTK_STYLE_CLASS_BUTTON:
180  *
181  * A CSS class to match buttons.
182  *
183  * This is used by #GtkButton and its subclasses, as well
184  * as various other widget pieces that appear like buttons,
185  * e.g. the arrows in a #GtkCalendar.
186  */
187 #define GTK_STYLE_CLASS_BUTTON "button"
188
189 /**
190  * GTK_STYLE_CLASS_CALENDAR:
191  *
192  * A CSS class to match calendars.
193  *
194  * This is not used by GTK+ itself, currently.
195  */
196 #define GTK_STYLE_CLASS_CALENDAR "calendar"
197
198 /**
199  * GTK_STYLE_CLASS_SLIDER:
200  *
201  * A CSS class to match sliders.
202  *
203  * This is used by #GtkSwitch and #GtkRange and its subclasses.
204  */
205 #define GTK_STYLE_CLASS_SLIDER "slider"
206
207 /**
208  * GTK_STYLE_CLASS_BACKGROUND:
209  *
210  * A CSS class to match the window background.
211  */
212 #define GTK_STYLE_CLASS_BACKGROUND "background"
213
214 /**
215  * GTK_STYLE_CLASS_RUBBERBAND:
216  *
217  * A CSS class to match the rubberband selection rectangle.
218  *
219  * This is used in #GtkIconView and #GtkTreeView.
220  */
221 #define GTK_STYLE_CLASS_RUBBERBAND "rubberband"
222
223 /**
224  * GTK_STYLE_CLASS_TOOLTIP:
225  *
226  * A CSS class to match tooltip windows.
227  */
228 #define GTK_STYLE_CLASS_TOOLTIP "tooltip"
229
230 /**
231  * GTK_STYLE_CLASS_MENU:
232  *
233  * A CSS class to match popup menus.
234  *
235  * This is used in #GtkMenu.
236  */
237 #define GTK_STYLE_CLASS_MENU "menu"
238
239 /**
240  * GTK_STYLE_CLASS_MENUBAR:
241  *
242  * A CSS class to menubars.
243  *
244  * This is used in #GtkMenuBar.
245  */
246 #define GTK_STYLE_CLASS_MENUBAR "menubar"
247
248 /**
249  * GTK_STYLE_CLASS_MENUITEM:
250  *
251  * A CSS class to match menu items.
252  *
253  * This is used in #GtkMenuItem and its subclasses.
254  */
255 #define GTK_STYLE_CLASS_MENUITEM "menuitem"
256
257 /**
258  * GTK_STYLE_CLASS_TOOLBAR:
259  *
260  * A CSS class to match toolbars.
261  *
262  * This is used in #GtkToolbar.
263  */
264 #define GTK_STYLE_CLASS_TOOLBAR "toolbar"
265
266 /**
267  * GTK_STYLE_CLASS_PRIMARY_TOOLBAR:
268  *
269  * A CSS class to match primary toolbars.
270  *
271  * This should be used for the 'main' toolbar of an application,
272  * right below its menubar.
273  */
274 #define GTK_STYLE_CLASS_PRIMARY_TOOLBAR "primary-toolbar"
275
276 /**
277  * GTK_STYLE_CLASS_INLINE_TOOLBAR:
278  *
279  * A CSS class to match inline toolbars.
280  *
281  * This should be used for toolbars that are used to hold
282  * actions below lists, as seen e.g. in the left pane of the
283  * file chooser.
284  */
285 #define GTK_STYLE_CLASS_INLINE_TOOLBAR "inline-toolbar"
286
287 /**
288  * GTK_STYLE_CLASS_RADIO:
289  *
290  * A CSS class to match radio buttons.
291  *
292  * This is used in #GtkRadioButton, #GtkRadioMenuItem and
293  * #GtkCellRendererToggle.
294  */
295 #define GTK_STYLE_CLASS_RADIO "radio"
296
297 /**
298  * GTK_STYLE_CLASS_CHECK:
299  *
300  * A CSS class to match check boxes.
301  *
302  * This is used in #GtkCheckButton, #GtkCheckMenuItem and
303  * #GtkCellRendererToggle.
304  */
305 #define GTK_STYLE_CLASS_CHECK "check"
306
307 /**
308  * GTK_STYLE_CLASS_DEFAULT:
309  *
310  * A CSS class to match the default widget.
311  *
312  * This is used by #GtkButton.
313  */
314 #define GTK_STYLE_CLASS_DEFAULT "default"
315
316 /**
317  * GTK_STYLE_CLASS_TROUGH:
318  *
319  * A CSS class to match troughs, as in scrollbars and progressbars.
320  *
321  * This is used in #GtkRange and its subclasses, #GtkProgressBar
322  * and #GtkSwitch.
323  */
324 #define GTK_STYLE_CLASS_TROUGH "trough"
325
326 /**
327  * GTK_STYLE_CLASS_SCROLLBAR:
328  *
329  * A CSS class to match scrollbars.
330  */
331 #define GTK_STYLE_CLASS_SCROLLBAR "scrollbar"
332
333 /**
334  * GTK_STYLE_CLASS_SCROLLBARS_JUNCTION:
335  *
336  * A CSS class to match the junction area between an horizontal
337  * and vertical scrollbar, when they're both shown.
338  * 
339  * This is used in #GtkScrolledWindow.
340  */
341 #define GTK_STYLE_CLASS_SCROLLBARS_JUNCTION "scrollbars-junction"
342
343 /**
344  * GTK_STYLE_CLASS_SCALE:
345  *
346  * A CSS class to match scale widgets.
347  *
348  * This is used in #GtkScale.
349  */
350 #define GTK_STYLE_CLASS_SCALE "scale"
351
352 /**
353  * GTK_STYLE_CLASS_SCALE_HAS_MARKS_ABOVE:
354  *
355  * A CSS class to match scale widgets with marks attached,
356  * all the marks are above for horizontal #GtkScale.
357  * left for vertical #GtkScale.
358  */
359 #define GTK_STYLE_CLASS_SCALE_HAS_MARKS_ABOVE "scale-has-marks-above"
360
361 /**
362  * GTK_STYLE_CLASS_SCALE_HAS_MARKS_BELOW:
363  *
364  * A CSS class to match scale widgets with marks attached,
365  * all the marks are below for horizontal #GtkScale,
366  * right for vertical #GtkScale.
367  */
368 #define GTK_STYLE_CLASS_SCALE_HAS_MARKS_BELOW "scale-has-marks-below"
369
370 /**
371  * GTK_STYLE_CLASS_HEADER:
372  *
373  * A CSS class to match a header element.
374  *
375  * This is used for the header in #GtkCalendar.
376  */
377 #define GTK_STYLE_CLASS_HEADER "header"
378
379 /**
380  * GTK_STYLE_CLASS_ACCELERATOR:
381  *
382  * A CSS class to match an accelerator.
383  *
384  * This is used for the accelerator in #GtkAccelLabel.
385  */
386 #define GTK_STYLE_CLASS_ACCELERATOR "accelerator"
387
388 /**
389  * GTK_STYLE_CLASS_RAISED:
390  *
391  * A CSS class to match a raised control, such as a raised
392  * button on a toolbar.
393  *
394  * This should be used in conjunction with #GTK_STYLE_CLASS_PRIMARY_TOOLBAR.
395  */
396 #define GTK_STYLE_CLASS_RAISED "raised"
397
398 /**
399  * GTK_STYLE_CLASS_LINKED:
400  *
401  * A CSS class to match a linked area, such as a box containing buttons
402  * belonging to the same control.
403  */
404 #define GTK_STYLE_CLASS_LINKED "linked"
405
406 /**
407  * GTK_STYLE_CLASS_GRIP:
408  *
409  * A CSS class defining a resize grip.
410  *
411  * This is used for the resize grip in #GtkWindow.
412  */
413 #define GTK_STYLE_CLASS_GRIP "grip"
414
415 /**
416  * GTK_STYLE_CLASS_DOCK:
417  *
418  * A CSS class defining a dock area.
419  *
420  * This is used by #GtkHandleBox.
421  */
422 #define GTK_STYLE_CLASS_DOCK "dock"
423
424 /**
425  * GTK_STYLE_CLASS_PROGRESSBAR:
426  *
427  * A CSS class to use when rendering activity as a progressbar.
428  *
429  * This is used in #GtkProgressBar and when drawing progress
430  * inside a #GtkEntry or in #GtkCellRendererProgress.
431  */
432 #define GTK_STYLE_CLASS_PROGRESSBAR "progressbar"
433
434 /**
435  * GTK_STYLE_CLASS_SPINNER:
436  *
437  * A CSS class to use when rendering activity as a 'spinner'.
438  *
439  * This is used by #GtkSpinner and #GtkCellRendererSpinner.
440  */
441 #define GTK_STYLE_CLASS_SPINNER "spinner"
442
443 /**
444  * GTK_STYLE_CLASS_MARK:
445  *
446  * A CSS class defining marks in a widget, such as in scales.
447  *
448  * Used in #GtkScale.
449  */
450 #define GTK_STYLE_CLASS_MARK "mark"
451
452 /**
453  * GTK_STYLE_CLASS_EXPANDER:
454  *
455  * A CSS class defining an expander, such as those in treeviews.
456  *
457  * Used for drawing expanders in #GtkTreeView, GtkExpander and
458  * #GtkToolItemGroup.
459  */
460 #define GTK_STYLE_CLASS_EXPANDER "expander"
461
462 /**
463  * GTK_STYLE_CLASS_SPINBUTTON:
464  *
465  * A CSS class defining an spinbutton.
466  *
467  * This is used in #GtkSpinButton.
468  */
469 #define GTK_STYLE_CLASS_SPINBUTTON "spinbutton"
470
471 /**
472  * GTK_STYLE_CLASS_NOTEBOOK:
473  *
474  * A CSS class defining a notebook.
475  *
476  * Used in #GtkNotebook.
477  */
478 #define GTK_STYLE_CLASS_NOTEBOOK "notebook"
479
480 /**
481  * GTK_STYLE_CLASS_VIEW:
482  *
483  * A CSS class defining a view, such as iconviews or treeviews.
484  *
485  * This is used in #GtkTreeView, #GtkIconView, #GtkTextView,
486  * as well as #GtkCalendar.
487  */
488 #define GTK_STYLE_CLASS_VIEW "view"
489
490 /**
491  * GTK_STYLE_CLASS_SIDEBAR:
492  *
493  * A CSS class defining a sidebar, such as the left side in
494  * a file chooser.
495  *
496  * This is used in #GtkFileChooser and in #GtkAssistant.
497  */
498 #define GTK_STYLE_CLASS_SIDEBAR "sidebar"
499
500 /**
501  * GTK_STYLE_CLASS_IMAGE:
502  *
503  * A CSS class defining an image, such as the icon in an entry.
504  *
505  * This is used when rendering icons in #GtkEntry.
506  */
507 #define GTK_STYLE_CLASS_IMAGE "image"
508
509 /**
510  * GTK_STYLE_CLASS_HIGHLIGHT:
511  *
512  * A CSS class defining a highlighted area, such as headings in
513  * assistants and calendars.
514  *
515  * This is used in #GtkAssistant and #GtkCalendar.
516  */
517 #define GTK_STYLE_CLASS_HIGHLIGHT "highlight"
518
519 /**
520  * GTK_STYLE_CLASS_FRAME:
521  *
522  * A CSS class defining a frame delimiting content, such as
523  * #GtkFrame or the scrolled window frame around the
524  * scrollable area.
525  *
526  * This is used in #GtkFrame and #GtkScrollbar.
527  */
528 #define GTK_STYLE_CLASS_FRAME "frame"
529
530 /**
531  * GTK_STYLE_CLASS_DND:
532  *
533  * A CSS class for a drag-and-drop indicator.
534  *
535  * This is used when drawing an outline around a potential
536  * drop target during DND.
537  */
538 #define GTK_STYLE_CLASS_DND "dnd"
539
540 /**
541  * GTK_STYLE_CLASS_PANE_SEPARATOR:
542  *
543  * A CSS class for a pane separator, such as those in #GtkPaned.
544  *
545  * Used in #GtkPaned.
546  */
547 #define GTK_STYLE_CLASS_PANE_SEPARATOR "pane-separator"
548
549 /**
550  * GTK_STYLE_CLASS_SEPARATOR:
551  *
552  * A CSS class for a separator.
553  *
554  * This is used in #GtkSeparator, #GtkSeparatorMenuItem,
555  * #GtkSeparatorToolItem, and when drawing separators in #GtkTreeView.
556  */
557 #define GTK_STYLE_CLASS_SEPARATOR "separator"
558
559 /**
560  * GTK_STYLE_CLASS_INFO:
561  *
562  * A CSS class for an area displaying an informational message,
563  * such as those in infobars.
564  *
565  * This is used by #GtkInfoBar.
566  */
567 #define GTK_STYLE_CLASS_INFO "info"
568
569 /**
570  * GTK_STYLE_CLASS_WARNING:
571  *
572  * A CSS class for an area displaying a warning message,
573  * such as those in infobars.
574  *
575  * This is used by #GtkInfoBar.
576  */
577 #define GTK_STYLE_CLASS_WARNING "warning"
578
579 /**
580  * GTK_STYLE_CLASS_QUESTION:
581  *
582  * A CSS class for an area displaying a question to the user,
583  * such as those in infobars.
584  *
585  * This is used by #GtkInfoBar.
586  */
587 #define GTK_STYLE_CLASS_QUESTION "question"
588
589 /**
590  * GTK_STYLE_CLASS_ERROR:
591  *
592  * A CSS class for an area displaying an error message,
593  * such as those in infobars.
594  *
595  * This is used by #GtkInfoBar.
596  */
597 #define GTK_STYLE_CLASS_ERROR "error"
598
599 /**
600  * GTK_STYLE_CLASS_HORIZONTAL:
601  *
602  * A CSS class for horizontally layered widgets.
603  *
604  * This is used by widgets implementing #GtkOrientable.
605  */
606 #define GTK_STYLE_CLASS_HORIZONTAL "horizontal"
607
608 /**
609  * GTK_STYLE_CLASS_VERTICAL:
610  *
611  * A CSS class for vertically layered widgets.
612  *
613  * This is used by widgets implementing #GtkOrientable.
614  */
615 #define GTK_STYLE_CLASS_VERTICAL "vertical"
616
617 /**
618  * GTK_STYLE_CLASS_TOP:
619  *
620  * A CSS class to indicate an area at the top of a widget.
621  *
622  * This is used by widgets that can render an area in different
623  * positions, such as tabs in a #GtkNotebook.
624  */
625 #define GTK_STYLE_CLASS_TOP "top"
626
627 /**
628  * GTK_STYLE_CLASS_BOTTOM:
629  *
630  * A CSS class to indicate an area at the bottom of a widget.
631  *
632  * This is used by widgets that can render an area in different
633  * positions, such as tabs in a #GtkNotebook.
634  */
635 #define GTK_STYLE_CLASS_BOTTOM "bottom"
636
637 /**
638  * GTK_STYLE_CLASS_LEFT:
639  *
640  * A CSS class to indicate an area at the left of a widget.
641  *
642  * This is used by widgets that can render an area in different
643  * positions, such as tabs in a #GtkNotebook.
644  */
645 #define GTK_STYLE_CLASS_LEFT "left"
646
647 /**
648  * GTK_STYLE_CLASS_RIGHT:
649  *
650  * A CSS class to indicate an area at the right of a widget.
651  *
652  * This is used by widgets that can render an area in different
653  * positions, such as tabs in a #GtkNotebook.
654  */
655 #define GTK_STYLE_CLASS_RIGHT "right"
656
657 /* Predefined set of widget regions */
658
659 /**
660  * GTK_STYLE_REGION_ROW:
661  *
662  * A widget region name to define a treeview row.
663  */
664 #define GTK_STYLE_REGION_ROW "row"
665
666 /**
667  * GTK_STYLE_REGION_COLUMN:
668  *
669  * A widget region name to define a treeview column.
670  */
671 #define GTK_STYLE_REGION_COLUMN "column"
672
673 /**
674  * GTK_STYLE_REGION_COLUMN_HEADER:
675  *
676  * A widget region name to define a treeview column header.
677  */
678 #define GTK_STYLE_REGION_COLUMN_HEADER "column-header"
679
680 /**
681  * GTK_STYLE_REGION_TAB:
682  *
683  * A widget region name to define a notebook tab.
684  */
685 #define GTK_STYLE_REGION_TAB "tab"
686
687 /**
688  * GTK_STYLE_CLASS_PULSE:
689  *
690  * A CSS class to use when rendering a pulse in an indeterminate progress bar.
691  *
692  * This is used by #GtkProgressBar and #GtkEntry.
693  */
694 #define GTK_STYLE_CLASS_PULSE "pulse"
695
696 /**
697  * GTK_STYLE_CLASS_ARROW:
698  *
699  * A CSS class used when rendering an arrow element.
700  *
701  * Note that #gtk_render_arrow automatically adds this style class
702  * to the style context when rendering an arrow element.
703  */
704 #define GTK_STYLE_CLASS_ARROW "arrow"
705
706
707 GType gtk_style_context_get_type (void) G_GNUC_CONST;
708
709 GtkStyleContext * gtk_style_context_new (void);
710
711 void gtk_style_context_add_provider_for_screen    (GdkScreen        *screen,
712                                                    GtkStyleProvider *provider,
713                                                    guint             priority);
714 void gtk_style_context_remove_provider_for_screen (GdkScreen        *screen,
715                                                    GtkStyleProvider *provider);
716
717 void gtk_style_context_add_provider    (GtkStyleContext  *context,
718                                         GtkStyleProvider *provider,
719                                         guint             priority);
720
721 void gtk_style_context_remove_provider (GtkStyleContext  *context,
722                                         GtkStyleProvider *provider);
723
724 void gtk_style_context_save    (GtkStyleContext *context);
725 void gtk_style_context_restore (GtkStyleContext *context);
726
727 GtkCssSection * gtk_style_context_get_section (GtkStyleContext *context,
728                                                const gchar     *property);
729 void gtk_style_context_get_property (GtkStyleContext *context,
730                                      const gchar     *property,
731                                      GtkStateFlags    state,
732                                      GValue          *value);
733 void gtk_style_context_get_valist   (GtkStyleContext *context,
734                                      GtkStateFlags    state,
735                                      va_list          args);
736 void gtk_style_context_get          (GtkStyleContext *context,
737                                      GtkStateFlags    state,
738                                      ...) G_GNUC_NULL_TERMINATED;
739
740 void          gtk_style_context_set_state    (GtkStyleContext *context,
741                                               GtkStateFlags    flags);
742 GtkStateFlags gtk_style_context_get_state    (GtkStyleContext *context);
743
744 gboolean      gtk_style_context_state_is_running (GtkStyleContext *context,
745                                                   GtkStateType     state,
746                                                   gdouble         *progress);
747
748 void          gtk_style_context_set_path     (GtkStyleContext *context,
749                                               GtkWidgetPath   *path);
750 const GtkWidgetPath * gtk_style_context_get_path (GtkStyleContext *context);
751 GDK_AVAILABLE_IN_3_4
752 void          gtk_style_context_set_parent   (GtkStyleContext *context,
753                                               GtkStyleContext *parent);
754 GtkStyleContext *gtk_style_context_get_parent (GtkStyleContext *context);
755
756 GList *  gtk_style_context_list_classes (GtkStyleContext *context);
757
758 void     gtk_style_context_add_class    (GtkStyleContext *context,
759                                          const gchar     *class_name);
760 void     gtk_style_context_remove_class (GtkStyleContext *context,
761                                          const gchar     *class_name);
762 gboolean gtk_style_context_has_class    (GtkStyleContext *context,
763                                          const gchar     *class_name);
764
765 GList *  gtk_style_context_list_regions (GtkStyleContext *context);
766
767 void     gtk_style_context_add_region    (GtkStyleContext    *context,
768                                           const gchar        *region_name,
769                                           GtkRegionFlags      flags);
770 void     gtk_style_context_remove_region (GtkStyleContext    *context,
771                                           const gchar        *region_name);
772 gboolean gtk_style_context_has_region    (GtkStyleContext    *context,
773                                           const gchar        *region_name,
774                                           GtkRegionFlags     *flags_return);
775
776 void gtk_style_context_get_style_property (GtkStyleContext *context,
777                                            const gchar     *property_name,
778                                            GValue          *value);
779 void gtk_style_context_get_style_valist   (GtkStyleContext *context,
780                                            va_list          args);
781 void gtk_style_context_get_style          (GtkStyleContext *context,
782                                            ...);
783
784 GtkIconSet * gtk_style_context_lookup_icon_set (GtkStyleContext *context,
785                                                 const gchar     *stock_id);
786 GdkPixbuf  * gtk_icon_set_render_icon_pixbuf   (GtkIconSet      *icon_set,
787                                                 GtkStyleContext *context,
788                                                 GtkIconSize      size);
789
790 void        gtk_style_context_set_screen (GtkStyleContext *context,
791                                           GdkScreen       *screen);
792 GdkScreen * gtk_style_context_get_screen (GtkStyleContext *context);
793
794 void             gtk_style_context_set_direction (GtkStyleContext  *context,
795                                                   GtkTextDirection  direction);
796 GtkTextDirection gtk_style_context_get_direction (GtkStyleContext  *context);
797
798 void             gtk_style_context_set_junction_sides (GtkStyleContext  *context,
799                                                        GtkJunctionSides  sides);
800 GtkJunctionSides gtk_style_context_get_junction_sides (GtkStyleContext  *context);
801
802 gboolean gtk_style_context_lookup_color (GtkStyleContext *context,
803                                          const gchar     *color_name,
804                                          GdkRGBA         *color);
805
806 void  gtk_style_context_notify_state_change (GtkStyleContext *context,
807                                              GdkWindow       *window,
808                                              gpointer         region_id,
809                                              GtkStateType     state,
810                                              gboolean         state_value);
811 void  gtk_style_context_cancel_animations   (GtkStyleContext *context,
812                                              gpointer         region_id);
813 void  gtk_style_context_scroll_animations   (GtkStyleContext *context,
814                                              GdkWindow       *window,
815                                              gint             dx,
816                                              gint             dy);
817
818 void gtk_style_context_push_animatable_region (GtkStyleContext *context,
819                                                gpointer         region_id);
820 void gtk_style_context_pop_animatable_region  (GtkStyleContext *context);
821
822 /* Some helper functions to retrieve most common properties */
823 void gtk_style_context_get_color            (GtkStyleContext *context,
824                                              GtkStateFlags    state,
825                                              GdkRGBA         *color);
826 void gtk_style_context_get_background_color (GtkStyleContext *context,
827                                              GtkStateFlags    state,
828                                              GdkRGBA         *color);
829 void gtk_style_context_get_border_color     (GtkStyleContext *context,
830                                              GtkStateFlags    state,
831                                              GdkRGBA         *color);
832 const PangoFontDescription *
833      gtk_style_context_get_font             (GtkStyleContext *context,
834                                              GtkStateFlags    state);
835 void gtk_style_context_get_border           (GtkStyleContext *context,
836                                              GtkStateFlags    state,
837                                              GtkBorder       *border);
838 void gtk_style_context_get_padding          (GtkStyleContext *context,
839                                              GtkStateFlags    state,
840                                              GtkBorder       *padding);
841 void gtk_style_context_get_margin           (GtkStyleContext *context,
842                                              GtkStateFlags    state,
843                                              GtkBorder       *margin);
844
845 void gtk_style_context_invalidate           (GtkStyleContext *context);
846 void gtk_style_context_reset_widgets        (GdkScreen       *screen);
847
848 void gtk_style_context_set_background       (GtkStyleContext *context,
849                                              GdkWindow       *window);
850
851 /* Paint methods */
852 void        gtk_render_check       (GtkStyleContext     *context,
853                                     cairo_t             *cr,
854                                     gdouble              x,
855                                     gdouble              y,
856                                     gdouble              width,
857                                     gdouble              height);
858 void        gtk_render_option      (GtkStyleContext     *context,
859                                     cairo_t             *cr,
860                                     gdouble              x,
861                                     gdouble              y,
862                                     gdouble              width,
863                                     gdouble              height);
864 void        gtk_render_arrow       (GtkStyleContext     *context,
865                                     cairo_t             *cr,
866                                     gdouble              angle,
867                                     gdouble              x,
868                                     gdouble              y,
869                                     gdouble              size);
870 void        gtk_render_background  (GtkStyleContext     *context,
871                                     cairo_t             *cr,
872                                     gdouble              x,
873                                     gdouble              y,
874                                     gdouble              width,
875                                     gdouble              height);
876 void        gtk_render_frame       (GtkStyleContext     *context,
877                                     cairo_t             *cr,
878                                     gdouble              x,
879                                     gdouble              y,
880                                     gdouble              width,
881                                     gdouble              height);
882 void        gtk_render_expander    (GtkStyleContext     *context,
883                                     cairo_t             *cr,
884                                     gdouble              x,
885                                     gdouble              y,
886                                     gdouble              width,
887                                     gdouble              height);
888 void        gtk_render_focus       (GtkStyleContext     *context,
889                                     cairo_t             *cr,
890                                     gdouble              x,
891                                     gdouble              y,
892                                     gdouble              width,
893                                     gdouble              height);
894 void        gtk_render_layout      (GtkStyleContext     *context,
895                                     cairo_t             *cr,
896                                     gdouble              x,
897                                     gdouble              y,
898                                     PangoLayout         *layout);
899 void        gtk_render_line        (GtkStyleContext     *context,
900                                     cairo_t             *cr,
901                                     gdouble              x0,
902                                     gdouble              y0,
903                                     gdouble              x1,
904                                     gdouble              y1);
905 void        gtk_render_slider      (GtkStyleContext     *context,
906                                     cairo_t             *cr,
907                                     gdouble              x,
908                                     gdouble              y,
909                                     gdouble              width,
910                                     gdouble              height,
911                                     GtkOrientation       orientation);
912 void        gtk_render_frame_gap   (GtkStyleContext     *context,
913                                     cairo_t             *cr,
914                                     gdouble              x,
915                                     gdouble              y,
916                                     gdouble              width,
917                                     gdouble              height,
918                                     GtkPositionType      gap_side,
919                                     gdouble              xy0_gap,
920                                     gdouble              xy1_gap);
921 void        gtk_render_extension   (GtkStyleContext     *context,
922                                     cairo_t             *cr,
923                                     gdouble              x,
924                                     gdouble              y,
925                                     gdouble              width,
926                                     gdouble              height,
927                                     GtkPositionType      gap_side);
928 void        gtk_render_handle      (GtkStyleContext     *context,
929                                     cairo_t             *cr,
930                                     gdouble              x,
931                                     gdouble              y,
932                                     gdouble              width,
933                                     gdouble              height);
934 void        gtk_render_activity    (GtkStyleContext     *context,
935                                     cairo_t             *cr,
936                                     gdouble              x,
937                                     gdouble              y,
938                                     gdouble              width,
939                                     gdouble              height);
940 GdkPixbuf * gtk_render_icon_pixbuf (GtkStyleContext     *context,
941                                     const GtkIconSource *source,
942                                     GtkIconSize          size);
943 GDK_AVAILABLE_IN_3_2
944 void        gtk_render_icon        (GtkStyleContext     *context,
945                                     cairo_t             *cr,
946                                     GdkPixbuf           *pixbuf,
947                                     gdouble              x,
948                                     gdouble              y);
949 GDK_AVAILABLE_IN_3_4
950 void        gtk_render_insertion_cursor
951                                    (GtkStyleContext     *context,
952                                     cairo_t             *cr,
953                                     gdouble              x,
954                                     gdouble              y,
955                                     PangoLayout         *layout,
956                                     int                  index,
957                                     PangoDirection       direction);
958 GDK_DEPRECATED_IN_3_4
959 void   gtk_draw_insertion_cursor    (GtkWidget          *widget,
960                                      cairo_t            *cr,
961                                      const GdkRectangle *location,
962                                      gboolean            is_primary,
963                                      GtkTextDirection    direction,
964                                      gboolean            draw_arrow);
965
966 /* Accessibility support */
967 AtkAttributeSet *_gtk_style_context_get_attributes (AtkAttributeSet *attributes,
968                                                     GtkStyleContext *context,
969                                                     GtkStateFlags    flags);
970
971 G_END_DECLS
972
973 #endif /* __GTK_STYLE_CONTEXT_H__ */