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