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