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