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