]> Pileus Git - ~andy/gtk/blob - gtk/gtkstyle.h
a6af1779c16a61a34c2ba66d2e944f99586e8a33
[~andy/gtk] / gtk / gtkstyle.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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 /*
21  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
25  */
26
27 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
28 #error "Only <gtk/gtk.h> can be included directly."
29 #endif
30
31 #ifndef __GTK_STYLE_H__
32 #define __GTK_STYLE_H__
33
34
35 #include <gdk/gdk.h>
36 #include <gtk/gtkenums.h>
37
38
39 G_BEGIN_DECLS
40
41 #define GTK_TYPE_STYLE              (gtk_style_get_type ())
42 #define GTK_STYLE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_STYLE, GtkStyle))
43 #define GTK_STYLE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_STYLE, GtkStyleClass))
44 #define GTK_IS_STYLE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_STYLE))
45 #define GTK_IS_STYLE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_STYLE))
46 #define GTK_STYLE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_STYLE, GtkStyleClass))
47
48 #define GTK_TYPE_BORDER             (gtk_border_get_type ())
49
50 /* Some forward declarations needed to rationalize the header
51  * files.
52  */
53 typedef struct _GtkBorder      GtkBorder;
54 typedef struct _GtkStyle       GtkStyle;
55 typedef struct _GtkStyleClass  GtkStyleClass;
56 typedef struct _GtkThemeEngine GtkThemeEngine;
57 typedef struct _GtkRcStyle     GtkRcStyle;
58 typedef struct _GtkIconSet     GtkIconSet;
59 typedef struct _GtkIconSource  GtkIconSource;
60 typedef struct _GtkRcProperty  GtkRcProperty;
61 typedef struct _GtkSettings    GtkSettings;
62 typedef gboolean (*GtkRcPropertyParser) (const GParamSpec *pspec,
63                                          const GString    *rc_string,
64                                          GValue           *property_value);
65
66 /* We make this forward declaration here, since we pass
67  * GtkWidget's to the draw functions.
68  */
69 typedef struct _GtkWidget      GtkWidget;
70
71 #define GTK_STYLE_ATTACHED(style)       (GTK_STYLE (style)->attach_count > 0)
72
73 struct _GtkStyle
74 {
75   GObject parent_instance;
76
77   /*< public >*/
78
79   GdkColor fg[5];
80   GdkColor bg[5];
81   GdkColor light[5];
82   GdkColor dark[5];
83   GdkColor mid[5];
84   GdkColor text[5];
85   GdkColor base[5];
86   GdkColor text_aa[5];          /* Halfway between text/base */
87
88   GdkColor black;
89   GdkColor white;
90   PangoFontDescription *font_desc;
91
92   gint xthickness;
93   gint ythickness;
94
95   GdkGC *fg_gc[5];
96   GdkGC *bg_gc[5];
97   GdkGC *light_gc[5];
98   GdkGC *dark_gc[5];
99   GdkGC *mid_gc[5];
100   GdkGC *text_gc[5];
101   GdkGC *base_gc[5];
102   GdkGC *text_aa_gc[5];
103   GdkGC *black_gc;
104   GdkGC *white_gc;
105
106   GdkPixmap *bg_pixmap[5];
107
108   /*< private >*/
109
110   gint attach_count;
111
112   gint depth;
113   GdkColormap *colormap;
114   GdkFont *private_font;
115   PangoFontDescription *private_font_desc; /* Font description for style->private_font or %NULL */
116
117   /* the RcStyle from which this style was created */
118   GtkRcStyle     *rc_style;
119
120   GSList         *styles;         /* of type GtkStyle* */
121   GArray         *property_cache;
122   GSList         *icon_factories; /* of type GtkIconFactory* */
123 };
124
125 struct _GtkStyleClass
126 {
127   GObjectClass parent_class;
128
129   /* Initialize for a particular colormap/depth
130    * combination. style->colormap/style->depth will have
131    * been set at this point. Will typically chain to parent.
132    */
133   void (*realize)               (GtkStyle               *style);
134
135   /* Clean up for a particular colormap/depth combination. Will
136    * typically chain to parent.
137    */
138   void (*unrealize)             (GtkStyle               *style);
139
140   /* Make style an exact duplicate of src.
141    */
142   void (*copy)                  (GtkStyle               *style,
143                                  GtkStyle               *src);
144
145   /* Create an empty style of the same type as this style.
146    * The default implementation, which does
147    * g_object_new (G_OBJECT_TYPE (style), NULL);
148    * should work in most cases.
149    */
150   GtkStyle *(*clone)             (GtkStyle               *style);
151
152   /* Initialize the GtkStyle with the values in the GtkRcStyle.
153    * should chain to the parent implementation.
154    */
155   void     (*init_from_rc)      (GtkStyle               *style,
156                                  GtkRcStyle             *rc_style);
157
158   void (*set_background)        (GtkStyle               *style,
159                                  GdkWindow              *window,
160                                  GtkStateType            state_type);
161
162
163   GdkPixbuf * (* render_icon)   (GtkStyle               *style,
164                                  const GtkIconSource    *source,
165                                  GtkTextDirection        direction,
166                                  GtkStateType            state,
167                                  GtkIconSize             size,
168                                  GtkWidget              *widget,
169                                  const gchar            *detail);
170
171   /* Drawing functions
172    */
173
174   void (*draw_hline)            (GtkStyle               *style,
175                                  GdkWindow              *window,
176                                  GtkStateType            state_type,
177                                  GdkRectangle           *area,
178                                  GtkWidget              *widget,
179                                  const gchar            *detail,
180                                  gint                    x1,
181                                  gint                    x2,
182                                  gint                    y);
183   void (*draw_vline)            (GtkStyle               *style,
184                                  GdkWindow              *window,
185                                  GtkStateType            state_type,
186                                  GdkRectangle           *area,
187                                  GtkWidget              *widget,
188                                  const gchar            *detail,
189                                  gint                    y1_,
190                                  gint                    y2_,
191                                  gint                    x);
192   void (*draw_shadow)           (GtkStyle               *style,
193                                  GdkWindow              *window,
194                                  GtkStateType            state_type,
195                                  GtkShadowType           shadow_type,
196                                  GdkRectangle           *area,
197                                  GtkWidget              *widget,
198                                  const gchar            *detail,
199                                  gint                    x,
200                                  gint                    y,
201                                  gint                    width,
202                                  gint                    height);
203   void (*draw_polygon)          (GtkStyle               *style,
204                                  GdkWindow              *window,
205                                  GtkStateType            state_type,
206                                  GtkShadowType           shadow_type,
207                                  GdkRectangle           *area,
208                                  GtkWidget              *widget,
209                                  const gchar            *detail,
210                                  GdkPoint               *point,
211                                  gint                    npoints,
212                                  gboolean                fill);
213   void (*draw_arrow)            (GtkStyle               *style,
214                                  GdkWindow              *window,
215                                  GtkStateType            state_type,
216                                  GtkShadowType           shadow_type,
217                                  GdkRectangle           *area,
218                                  GtkWidget              *widget,
219                                  const gchar            *detail,
220                                  GtkArrowType            arrow_type,
221                                  gboolean                fill,
222                                  gint                    x,
223                                  gint                    y,
224                                  gint                    width,
225                                  gint                    height);
226   void (*draw_diamond)          (GtkStyle               *style,
227                                  GdkWindow              *window,
228                                  GtkStateType            state_type,
229                                  GtkShadowType           shadow_type,
230                                  GdkRectangle           *area,
231                                  GtkWidget              *widget,
232                                  const gchar            *detail,
233                                  gint                    x,
234                                  gint                    y,
235                                  gint                    width,
236                                  gint                    height);
237   void (*draw_string)           (GtkStyle               *style,
238                                  GdkWindow              *window,
239                                  GtkStateType            state_type,
240                                  GdkRectangle           *area,
241                                  GtkWidget              *widget,
242                                  const gchar            *detail,
243                                  gint                    x,
244                                  gint                    y,
245                                  const gchar            *string);
246   void (*draw_box)              (GtkStyle               *style,
247                                  GdkWindow              *window,
248                                  GtkStateType            state_type,
249                                  GtkShadowType           shadow_type,
250                                  GdkRectangle           *area,
251                                  GtkWidget              *widget,
252                                  const gchar            *detail,
253                                  gint                    x,
254                                  gint                    y,
255                                  gint                    width,
256                                  gint                    height);
257   void (*draw_flat_box)         (GtkStyle               *style,
258                                  GdkWindow              *window,
259                                  GtkStateType            state_type,
260                                  GtkShadowType           shadow_type,
261                                  GdkRectangle           *area,
262                                  GtkWidget              *widget,
263                                  const gchar            *detail,
264                                  gint                    x,
265                                  gint                    y,
266                                  gint                    width,
267                                  gint                    height);
268   void (*draw_check)            (GtkStyle               *style,
269                                  GdkWindow              *window,
270                                  GtkStateType            state_type,
271                                  GtkShadowType           shadow_type,
272                                  GdkRectangle           *area,
273                                  GtkWidget              *widget,
274                                  const gchar            *detail,
275                                  gint                    x,
276                                  gint                    y,
277                                  gint                    width,
278                                  gint                    height);
279   void (*draw_option)           (GtkStyle               *style,
280                                  GdkWindow              *window,
281                                  GtkStateType            state_type,
282                                  GtkShadowType           shadow_type,
283                                  GdkRectangle           *area,
284                                  GtkWidget              *widget,
285                                  const gchar            *detail,
286                                  gint                    x,
287                                  gint                    y,
288                                  gint                    width,
289                                  gint                    height);
290   void (*draw_tab)              (GtkStyle               *style,
291                                  GdkWindow              *window,
292                                  GtkStateType            state_type,
293                                  GtkShadowType           shadow_type,
294                                  GdkRectangle           *area,
295                                  GtkWidget              *widget,
296                                  const gchar            *detail,
297                                  gint                    x,
298                                  gint                    y,
299                                  gint                    width,
300                                  gint                    height);
301   void (*draw_shadow_gap)       (GtkStyle               *style,
302                                  GdkWindow              *window,
303                                  GtkStateType            state_type,
304                                  GtkShadowType           shadow_type,
305                                  GdkRectangle           *area,
306                                  GtkWidget              *widget,
307                                  const gchar            *detail,
308                                  gint                    x,
309                                  gint                    y,
310                                  gint                    width,
311                                  gint                    height,
312                                  GtkPositionType         gap_side,
313                                  gint                    gap_x,
314                                  gint                    gap_width);
315   void (*draw_box_gap)          (GtkStyle               *style,
316                                  GdkWindow              *window,
317                                  GtkStateType            state_type,
318                                  GtkShadowType           shadow_type,
319                                  GdkRectangle           *area,
320                                  GtkWidget              *widget,
321                                  const gchar            *detail,
322                                  gint                    x,
323                                  gint                    y,
324                                  gint                    width,
325                                  gint                    height,
326                                  GtkPositionType         gap_side,
327                                  gint                    gap_x,
328                                  gint                    gap_width);
329   void (*draw_extension)        (GtkStyle               *style,
330                                  GdkWindow              *window,
331                                  GtkStateType            state_type,
332                                  GtkShadowType           shadow_type,
333                                  GdkRectangle           *area,
334                                  GtkWidget              *widget,
335                                  const gchar            *detail,
336                                  gint                    x,
337                                  gint                    y,
338                                  gint                    width,
339                                  gint                    height,
340                                  GtkPositionType         gap_side);
341   void (*draw_focus)            (GtkStyle               *style,
342                                  GdkWindow              *window,
343                                  GtkStateType            state_type,
344                                  GdkRectangle           *area,
345                                  GtkWidget              *widget,
346                                  const gchar            *detail,
347                                  gint                    x,
348                                  gint                    y,
349                                  gint                    width,
350                                  gint                    height);
351   void (*draw_slider)           (GtkStyle               *style,
352                                  GdkWindow              *window,
353                                  GtkStateType            state_type,
354                                  GtkShadowType           shadow_type,
355                                  GdkRectangle           *area,
356                                  GtkWidget              *widget,
357                                  const gchar            *detail,
358                                  gint                    x,
359                                  gint                    y,
360                                  gint                    width,
361                                  gint                    height,
362                                  GtkOrientation          orientation);
363   void (*draw_handle)           (GtkStyle               *style,
364                                  GdkWindow              *window,
365                                  GtkStateType            state_type,
366                                  GtkShadowType           shadow_type,
367                                  GdkRectangle           *area,
368                                  GtkWidget              *widget,
369                                  const gchar            *detail,
370                                  gint                    x,
371                                  gint                    y,
372                                  gint                    width,
373                                  gint                    height,
374                                  GtkOrientation          orientation);
375
376   void (*draw_expander)         (GtkStyle               *style,
377                                  GdkWindow              *window,
378                                  GtkStateType            state_type,
379                                  GdkRectangle           *area,
380                                  GtkWidget              *widget,
381                                  const gchar            *detail,
382                                  gint                    x,
383                                  gint                    y,
384                                  GtkExpanderStyle        expander_style);
385   void (*draw_layout)           (GtkStyle               *style,
386                                  GdkWindow              *window,
387                                  GtkStateType            state_type,
388                                  gboolean                use_text,
389                                  GdkRectangle           *area,
390                                  GtkWidget              *widget,
391                                  const gchar            *detail,
392                                  gint                    x,
393                                  gint                    y,
394                                  PangoLayout            *layout);
395   void (*draw_resize_grip)      (GtkStyle               *style,
396                                  GdkWindow              *window,
397                                  GtkStateType            state_type,
398                                  GdkRectangle           *area,
399                                  GtkWidget              *widget,
400                                  const gchar            *detail,
401                                  GdkWindowEdge           edge,
402                                  gint                    x,
403                                  gint                    y,
404                                  gint                    width,
405                                  gint                    height);
406
407   /* Padding for future expansion */
408   void (*_gtk_reserved1)  (void);
409   void (*_gtk_reserved2)  (void);
410   void (*_gtk_reserved3)  (void);
411   void (*_gtk_reserved4)  (void);
412   void (*_gtk_reserved5)  (void);
413   void (*_gtk_reserved6)  (void);
414   void (*_gtk_reserved7)  (void);
415   void (*_gtk_reserved8)  (void);
416   void (*_gtk_reserved9)  (void);
417   void (*_gtk_reserved10) (void);
418   void (*_gtk_reserved11) (void);
419   void (*_gtk_reserved12) (void);
420 };
421
422 struct _GtkBorder
423 {
424   gint left;
425   gint right;
426   gint top;
427   gint bottom;
428 };
429
430 GType     gtk_style_get_type                 (void) G_GNUC_CONST;
431 GtkStyle* gtk_style_new                      (void);
432 GtkStyle* gtk_style_copy                     (GtkStyle     *style);
433 GtkStyle* gtk_style_attach                   (GtkStyle     *style,
434                                               GdkWindow    *window) G_GNUC_WARN_UNUSED_RESULT;
435 void      gtk_style_detach                   (GtkStyle     *style);
436
437 #ifndef GTK_DISABLE_DEPRECATED
438 GtkStyle* gtk_style_ref                      (GtkStyle     *style);
439 void      gtk_style_unref                    (GtkStyle     *style);
440
441 GdkFont * gtk_style_get_font                 (GtkStyle     *style);
442 void      gtk_style_set_font                 (GtkStyle     *style,
443                                               GdkFont      *font);
444 #endif /* GTK_DISABLE_DEPRECATED */
445
446 void      gtk_style_set_background           (GtkStyle     *style,
447                                               GdkWindow    *window,
448                                               GtkStateType  state_type);
449 void      gtk_style_apply_default_background (GtkStyle     *style,
450                                               GdkWindow    *window,
451                                               gboolean      set_bg,
452                                               GtkStateType  state_type,
453                                               const GdkRectangle *area,
454                                               gint          x,
455                                               gint          y,
456                                               gint          width,
457                                               gint          height);
458
459 GtkIconSet* gtk_style_lookup_icon_set        (GtkStyle     *style,
460                                               const gchar  *stock_id);
461 gboolean    gtk_style_lookup_color           (GtkStyle     *style,
462                                               const gchar  *color_name,
463                                               GdkColor     *color);
464
465 GdkPixbuf*  gtk_style_render_icon     (GtkStyle            *style,
466                                        const GtkIconSource *source,
467                                        GtkTextDirection     direction,
468                                        GtkStateType         state,
469                                        GtkIconSize          size,
470                                        GtkWidget           *widget,
471                                        const gchar         *detail);
472
473 #ifndef GTK_DISABLE_DEPRECATED
474 void gtk_draw_hline      (GtkStyle        *style,
475                           GdkWindow       *window,
476                           GtkStateType     state_type,
477                           gint             x1,
478                           gint             x2,
479                           gint             y);
480 void gtk_draw_vline      (GtkStyle        *style,
481                           GdkWindow       *window,
482                           GtkStateType     state_type,
483                           gint             y1_,
484                           gint             y2_,
485                           gint             x);
486 void gtk_draw_shadow     (GtkStyle        *style,
487                           GdkWindow       *window,
488                           GtkStateType     state_type,
489                           GtkShadowType    shadow_type,
490                           gint             x,
491                           gint             y,
492                           gint             width,
493                           gint             height);
494 void gtk_draw_polygon    (GtkStyle        *style,
495                           GdkWindow       *window,
496                           GtkStateType     state_type,
497                           GtkShadowType    shadow_type,
498                           GdkPoint        *points,
499                           gint             npoints,
500                           gboolean         fill);
501 void gtk_draw_arrow      (GtkStyle        *style,
502                           GdkWindow       *window,
503                           GtkStateType     state_type,
504                           GtkShadowType    shadow_type,
505                           GtkArrowType     arrow_type,
506                           gboolean         fill,
507                           gint             x,
508                           gint             y,
509                           gint             width,
510                           gint             height);
511 void gtk_draw_diamond    (GtkStyle        *style,
512                           GdkWindow       *window,
513                           GtkStateType     state_type,
514                           GtkShadowType    shadow_type,
515                           gint             x,
516                           gint             y,
517                           gint             width,
518                           gint             height);
519 void gtk_draw_box        (GtkStyle        *style,
520                           GdkWindow       *window,
521                           GtkStateType     state_type,
522                           GtkShadowType    shadow_type,
523                           gint             x,
524                           gint             y,
525                           gint             width,
526                           gint             height);
527 void gtk_draw_flat_box   (GtkStyle        *style,
528                           GdkWindow       *window,
529                           GtkStateType     state_type,
530                           GtkShadowType    shadow_type,
531                           gint             x,
532                           gint             y,
533                           gint             width,
534                           gint             height);
535 void gtk_draw_check      (GtkStyle        *style,
536                           GdkWindow       *window,
537                           GtkStateType     state_type,
538                           GtkShadowType    shadow_type,
539                           gint             x,
540                           gint             y,
541                           gint             width,
542                           gint             height);
543 void gtk_draw_option     (GtkStyle        *style,
544                           GdkWindow       *window,
545                           GtkStateType     state_type,
546                           GtkShadowType    shadow_type,
547                           gint             x,
548                           gint             y,
549                           gint             width,
550                           gint             height);
551 void gtk_draw_tab        (GtkStyle        *style,
552                           GdkWindow       *window,
553                           GtkStateType     state_type,
554                           GtkShadowType    shadow_type,
555                           gint             x,
556                           gint             y,
557                           gint             width,
558                           gint             height);
559 void gtk_draw_shadow_gap (GtkStyle        *style,
560                           GdkWindow       *window,
561                           GtkStateType     state_type,
562                           GtkShadowType    shadow_type,
563                           gint             x,
564                           gint             y,
565                           gint             width,
566                           gint             height,
567                           GtkPositionType  gap_side,
568                           gint             gap_x,
569                           gint             gap_width);
570 void gtk_draw_box_gap    (GtkStyle        *style,
571                           GdkWindow       *window,
572                           GtkStateType     state_type,
573                           GtkShadowType    shadow_type,
574                           gint             x,
575                           gint             y,
576                           gint             width,
577                           gint             height,
578                           GtkPositionType  gap_side,
579                           gint             gap_x,
580                           gint             gap_width);
581 void gtk_draw_extension  (GtkStyle        *style,
582                           GdkWindow       *window,
583                           GtkStateType     state_type,
584                           GtkShadowType    shadow_type,
585                           gint             x,
586                           gint             y,
587                           gint             width,
588                           gint             height,
589                           GtkPositionType  gap_side);
590 void gtk_draw_focus      (GtkStyle        *style,
591                           GdkWindow       *window,
592                           gint             x,
593                           gint             y,
594                           gint             width,
595                           gint             height);
596 void gtk_draw_slider     (GtkStyle        *style,
597                           GdkWindow       *window,
598                           GtkStateType     state_type,
599                           GtkShadowType    shadow_type,
600                           gint             x,
601                           gint             y,
602                           gint             width,
603                           gint             height,
604                           GtkOrientation   orientation);
605 void gtk_draw_handle     (GtkStyle        *style,
606                           GdkWindow       *window,
607                           GtkStateType     state_type,
608                           GtkShadowType    shadow_type,
609                           gint             x,
610                           gint             y,
611                           gint             width,
612                           gint             height,
613                           GtkOrientation   orientation);
614 void gtk_draw_expander   (GtkStyle        *style,
615                           GdkWindow       *window,
616                           GtkStateType     state_type,
617                           gint             x,
618                           gint             y,
619                           GtkExpanderStyle expander_style);
620 void gtk_draw_layout     (GtkStyle        *style,
621                           GdkWindow       *window,
622                           GtkStateType     state_type,
623                           gboolean         use_text,
624                           gint             x,
625                           gint             y,
626                           PangoLayout     *layout);
627 void gtk_draw_resize_grip (GtkStyle       *style,
628                            GdkWindow      *window,
629                            GtkStateType    state_type,
630                            GdkWindowEdge   edge,
631                            gint            x,
632                            gint            y,
633                            gint            width,
634                            gint            height);
635 #endif /* GTK_DISABLE_DEPRECATED */
636
637 void gtk_paint_hline       (GtkStyle           *style,
638                             GdkWindow          *window,
639                             GtkStateType        state_type,
640                             const GdkRectangle *area,
641                             GtkWidget          *widget,
642                             const gchar        *detail,
643                             gint                x1,
644                             gint                x2,
645                             gint                y);
646 void gtk_paint_vline       (GtkStyle           *style,
647                             GdkWindow          *window,
648                             GtkStateType        state_type,
649                             const GdkRectangle *area,
650                             GtkWidget          *widget,
651                             const gchar        *detail,
652                             gint                y1_,
653                             gint                y2_,
654                             gint                x);
655 void gtk_paint_shadow      (GtkStyle           *style,
656                             GdkWindow          *window,
657                             GtkStateType        state_type,
658                             GtkShadowType       shadow_type,
659                             const GdkRectangle *area,
660                             GtkWidget          *widget,
661                             const gchar        *detail,
662                             gint                x,
663                             gint                y,
664                             gint                width,
665                             gint                height);
666 void gtk_paint_polygon     (GtkStyle           *style,
667                             GdkWindow          *window,
668                             GtkStateType        state_type,
669                             GtkShadowType       shadow_type,
670                             const GdkRectangle *area,
671                             GtkWidget          *widget,
672                             const gchar        *detail,
673                             const GdkPoint     *points,
674                             gint                n_points,
675                             gboolean            fill);
676 void gtk_paint_arrow       (GtkStyle           *style,
677                             GdkWindow          *window,
678                             GtkStateType        state_type,
679                             GtkShadowType       shadow_type,
680                             const GdkRectangle *area,
681                             GtkWidget          *widget,
682                             const gchar        *detail,
683                             GtkArrowType        arrow_type,
684                             gboolean            fill,
685                             gint                x,
686                             gint                y,
687                             gint                width,
688                             gint                height);
689 void gtk_paint_diamond     (GtkStyle           *style,
690                             GdkWindow          *window,
691                             GtkStateType        state_type,
692                             GtkShadowType       shadow_type,
693                             const GdkRectangle *area,
694                             GtkWidget          *widget,
695                             const gchar        *detail,
696                             gint                x,
697                             gint                y,
698                             gint                width,
699                             gint                height);
700 void gtk_paint_box         (GtkStyle           *style,
701                             GdkWindow          *window,
702                             GtkStateType        state_type,
703                             GtkShadowType       shadow_type,
704                             const GdkRectangle *area,
705                             GtkWidget          *widget,
706                             const gchar        *detail,
707                             gint                x,
708                             gint                y,
709                             gint                width,
710                             gint                height);
711 void gtk_paint_flat_box    (GtkStyle           *style,
712                             GdkWindow          *window,
713                             GtkStateType        state_type,
714                             GtkShadowType       shadow_type,
715                             const GdkRectangle *area,
716                             GtkWidget          *widget,
717                             const gchar        *detail,
718                             gint                x,
719                             gint                y,
720                             gint                width,
721                             gint                height);
722 void gtk_paint_check       (GtkStyle           *style,
723                             GdkWindow          *window,
724                             GtkStateType        state_type,
725                             GtkShadowType       shadow_type,
726                             const GdkRectangle *area,
727                             GtkWidget          *widget,
728                             const gchar        *detail,
729                             gint                x,
730                             gint                y,
731                             gint                width,
732                             gint                height);
733 void gtk_paint_option      (GtkStyle           *style,
734                             GdkWindow          *window,
735                             GtkStateType        state_type,
736                             GtkShadowType       shadow_type,
737                             const GdkRectangle *area,
738                             GtkWidget          *widget,
739                             const gchar        *detail,
740                             gint                x,
741                             gint                y,
742                             gint                width,
743                             gint                height);
744 void gtk_paint_tab         (GtkStyle           *style,
745                             GdkWindow          *window,
746                             GtkStateType        state_type,
747                             GtkShadowType       shadow_type,
748                             const GdkRectangle *area,
749                             GtkWidget          *widget,
750                             const gchar        *detail,
751                             gint                x,
752                             gint                y,
753                             gint                width,
754                             gint                height);
755 void gtk_paint_shadow_gap  (GtkStyle           *style,
756                             GdkWindow          *window,
757                             GtkStateType        state_type,
758                             GtkShadowType       shadow_type,
759                             const GdkRectangle *area,
760                             GtkWidget          *widget,
761                             const gchar        *detail,
762                             gint                x,
763                             gint                y,
764                             gint                width,
765                             gint                height,
766                             GtkPositionType     gap_side,
767                             gint                gap_x,
768                             gint                gap_width);
769 void gtk_paint_box_gap     (GtkStyle           *style,
770                             GdkWindow          *window,
771                             GtkStateType        state_type,
772                             GtkShadowType       shadow_type,
773                             const GdkRectangle *area,
774                             GtkWidget          *widget,
775                             const gchar        *detail,
776                             gint                x,
777                             gint                y,
778                             gint                width,
779                             gint                height,
780                             GtkPositionType     gap_side,
781                             gint                gap_x,
782                             gint                gap_width);
783 void gtk_paint_extension   (GtkStyle           *style,
784                             GdkWindow          *window,
785                             GtkStateType        state_type,
786                             GtkShadowType       shadow_type,
787                             const GdkRectangle *area,
788                             GtkWidget          *widget,
789                             const gchar        *detail,
790                             gint                x,
791                             gint                y,
792                             gint                width,
793                             gint                height,
794                             GtkPositionType     gap_side);
795 void gtk_paint_focus       (GtkStyle           *style,
796                             GdkWindow          *window,
797                             GtkStateType        state_type,
798                             const GdkRectangle *area,
799                             GtkWidget          *widget,
800                             const gchar        *detail,
801                             gint                x,
802                             gint                y,
803                             gint                width,
804                             gint                height);
805 void gtk_paint_slider      (GtkStyle           *style,
806                             GdkWindow          *window,
807                             GtkStateType        state_type,
808                             GtkShadowType       shadow_type,
809                             const GdkRectangle *area,
810                             GtkWidget          *widget,
811                             const gchar        *detail,
812                             gint                x,
813                             gint                y,
814                             gint                width,
815                             gint                height,
816                             GtkOrientation      orientation);
817 void gtk_paint_handle      (GtkStyle           *style,
818                             GdkWindow          *window,
819                             GtkStateType        state_type,
820                             GtkShadowType       shadow_type,
821                             const GdkRectangle *area,
822                             GtkWidget          *widget,
823                             const gchar        *detail,
824                             gint                x,
825                             gint                y,
826                             gint                width,
827                             gint                height,
828                             GtkOrientation      orientation);
829 void gtk_paint_expander    (GtkStyle           *style,
830                             GdkWindow          *window,
831                             GtkStateType        state_type,
832                             const GdkRectangle *area,
833                             GtkWidget          *widget,
834                             const gchar        *detail,
835                             gint                x,
836                             gint                y,
837                             GtkExpanderStyle    expander_style);
838 void gtk_paint_layout      (GtkStyle           *style,
839                             GdkWindow          *window,
840                             GtkStateType        state_type,
841                             gboolean            use_text,
842                             const GdkRectangle *area,
843                             GtkWidget          *widget,
844                             const gchar        *detail,
845                             gint                x,
846                             gint                y,
847                             PangoLayout        *layout);
848 void gtk_paint_resize_grip (GtkStyle           *style,
849                             GdkWindow          *window,
850                             GtkStateType        state_type,
851                             const GdkRectangle *area,
852                             GtkWidget          *widget,
853                             const gchar        *detail,
854                             GdkWindowEdge       edge,
855                             gint                x,
856                             gint                y,
857                             gint                width,
858                             gint                height);
859
860
861 GType      gtk_border_get_type (void) G_GNUC_CONST;
862 GtkBorder *gtk_border_new      (void) G_GNUC_MALLOC;
863 GtkBorder *gtk_border_copy     (const GtkBorder *border_);
864 void       gtk_border_free     (GtkBorder       *border_);
865
866 void gtk_style_get_style_property (GtkStyle    *style,
867                                    GType        widget_type,
868                                    const gchar *property_name,
869                                    GValue      *value);
870 void gtk_style_get_valist         (GtkStyle    *style,
871                                    GType        widget_type,
872                                    const gchar *first_property_name,
873                                    va_list      var_args);
874 void gtk_style_get                (GtkStyle    *style,
875                                    GType        widget_type,
876                                    const gchar *first_property_name,
877                                    ...) G_GNUC_NULL_TERMINATED;
878
879 /* --- private API --- */
880 const GValue* _gtk_style_peek_property_value (GtkStyle           *style,
881                                               GType               widget_type,
882                                               GParamSpec         *pspec,
883                                               GtkRcPropertyParser parser);
884
885 void          _gtk_style_init_for_settings   (GtkStyle           *style,
886                                               GtkSettings        *settings);
887
888 void          _gtk_style_shade               (const GdkColor     *a,
889                                               GdkColor           *b,
890                                               gdouble             k);
891
892 /* deprecated */
893 #ifndef GTK_DISABLE_DEPRECATED
894 #define gtk_style_apply_default_pixmap(s,gw,st,a,x,y,w,h) gtk_style_apply_default_background (s,gw,1,st,a,x,y,w,h)
895 void gtk_draw_string      (GtkStyle           *style,
896                            GdkWindow          *window,
897                            GtkStateType        state_type,
898                            gint                x,
899                            gint                y,
900                            const gchar        *string);
901 void gtk_paint_string     (GtkStyle           *style,
902                            GdkWindow          *window,
903                            GtkStateType        state_type,
904                            const GdkRectangle *area,
905                            GtkWidget          *widget,
906                            const gchar        *detail,
907                            gint                x,
908                            gint                y,
909                            const gchar        *string);
910 #endif /* GTK_DISABLE_DEPRECATED */
911
912 void   gtk_draw_insertion_cursor    (GtkWidget          *widget,
913                                      GdkDrawable        *drawable,
914                                      const GdkRectangle *area,
915                                      const GdkRectangle *location,
916                                      gboolean            is_primary,
917                                      GtkTextDirection    direction,
918                                      gboolean            draw_arrow);
919 GdkGC *_gtk_widget_get_cursor_gc    (GtkWidget          *widget);
920 void   _gtk_widget_get_cursor_color (GtkWidget          *widget,
921                                      GdkColor           *color);
922
923 G_END_DECLS
924
925 #endif /* __GTK_STYLE_H__ */