]> Pileus Git - ~andy/gtk/blob - gtk/gtkstyle.h
Add gdk_pixbuf_get_option.
[~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 #ifndef __GTK_STYLE_H__
28 #define __GTK_STYLE_H__
29
30
31 #include <gdk/gdk.h>
32 #include <gtk/gtkenums.h>
33 #include <pango/pango.h>
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif /* __cplusplus */
38
39 #define GTK_TYPE_STYLE              (gtk_style_get_type ())
40 #define GTK_STYLE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_STYLE, GtkStyle))
41 #define GTK_STYLE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_STYLE, GtkStyleClass))
42 #define GTK_IS_STYLE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_STYLE))
43 #define GTK_IS_STYLE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_STYLE))
44 #define GTK_STYLE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_STYLE, GtkStyleClass))
45
46 /* Some forward declarations needed to rationalize the header
47  * files.
48  */
49 typedef struct _GtkBorder      GtkBorder;
50 typedef struct _GtkStyle       GtkStyle;
51 typedef struct _GtkStyleClass  GtkStyleClass;
52 typedef struct _GtkThemeEngine GtkThemeEngine;
53 typedef struct _GtkRcStyle     GtkRcStyle;
54 typedef struct _GtkIconSet     GtkIconSet;
55 typedef struct _GtkIconSource  GtkIconSource;
56 typedef struct _GtkRcProperty  GtkRcProperty;
57 typedef gboolean (*GtkRcPropertyParser) (const GParamSpec *pspec,
58                                          const GString    *rc_string,
59                                          GValue           *property_value);
60
61 /* We make this forward declaration here, since we pass
62  * GtkWidgt's to the draw functions.
63  */
64 typedef struct _GtkWidget      GtkWidget;
65
66 /* This is used for having dynamic style changing stuff
67  * fg, bg, light, dark, mid, text, base
68  */
69 #define GTK_STYLE_NUM_STYLECOLORS()     (7 * 5)
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                                  GdkRectangle           *area,
344                                  GtkWidget              *widget,
345                                  const gchar            *detail,
346                                  gint                    x,
347                                  gint                    y,
348                                  gint                    width,
349                                  gint                    height);
350   void (*draw_slider)           (GtkStyle               *style,
351                                  GdkWindow              *window,
352                                  GtkStateType            state_type,
353                                  GtkShadowType           shadow_type,
354                                  GdkRectangle           *area,
355                                  GtkWidget              *widget,
356                                  const gchar            *detail,
357                                  gint                    x,
358                                  gint                    y,
359                                  gint                    width,
360                                  gint                    height,
361                                  GtkOrientation          orientation);
362   void (*draw_handle)           (GtkStyle               *style,
363                                  GdkWindow              *window,
364                                  GtkStateType            state_type,
365                                  GtkShadowType           shadow_type,
366                                  GdkRectangle           *area,
367                                  GtkWidget              *widget,
368                                  const gchar            *detail,
369                                  gint                    x,
370                                  gint                    y,
371                                  gint                    width,
372                                  gint                    height,
373                                  GtkOrientation          orientation);
374
375   void (*draw_expander)         (GtkStyle               *style,
376                                  GdkWindow              *window,
377                                  GtkStateType            state_type,
378                                  GdkRectangle           *area,
379                                  GtkWidget              *widget,
380                                  const gchar            *detail,
381                                  gint                    x,
382                                  gint                    y,
383                                  GtkExpanderStyle        expander_style);
384   void (*draw_layout)           (GtkStyle               *style,
385                                  GdkWindow              *window,
386                                  GtkStateType            state_type,
387                                  gboolean                use_text,
388                                  GdkRectangle           *area,
389                                  GtkWidget              *widget,
390                                  const gchar            *detail,
391                                  gint                    x,
392                                  gint                    y,
393                                  PangoLayout            *layout);
394   void (*draw_resize_grip)      (GtkStyle               *style,
395                                  GdkWindow              *window,
396                                  GtkStateType            state_type,
397                                  GdkRectangle           *area,
398                                  GtkWidget              *widget,
399                                  const gchar            *detail,
400                                  GdkWindowEdge           edge,
401                                  gint                    x,
402                                  gint                    y,
403                                  gint                    width,
404                                  gint                    height);
405   
406 };
407
408 struct _GtkBorder
409 {
410   gint left;
411   gint right;
412   gint top;
413   gint bottom;
414 };
415
416 GType     gtk_style_get_type                 (void) G_GNUC_CONST;
417 GtkStyle* gtk_style_new                      (void);
418 GtkStyle* gtk_style_copy                     (GtkStyle     *style);
419 GtkStyle* gtk_style_attach                   (GtkStyle     *style,
420                                               GdkWindow    *window);
421 void      gtk_style_detach                   (GtkStyle     *style);
422
423 #ifndef GTK_DISABLE_DEPRECATED
424 GtkStyle* gtk_style_ref                      (GtkStyle     *style);
425 void      gtk_style_unref                    (GtkStyle     *style);
426
427 GdkFont * gtk_style_get_font                 (GtkStyle     *style);
428 void      gtk_style_set_font                 (GtkStyle     *style,
429                                               GdkFont      *font);
430 #endif /* GTK_DISABLE_DEPRECATED */
431
432 void      gtk_style_set_background           (GtkStyle     *style,
433                                               GdkWindow    *window,
434                                               GtkStateType  state_type);
435 void      gtk_style_apply_default_background (GtkStyle     *style,
436                                               GdkWindow    *window,
437                                               gboolean      set_bg,
438                                               GtkStateType  state_type, 
439                                               GdkRectangle *area, 
440                                               gint          x, 
441                                               gint          y, 
442                                               gint          width, 
443                                               gint          height);
444
445 GtkIconSet* gtk_style_lookup_icon_set (GtkStyle            *style,
446                                        const gchar         *stock_id);
447 GdkPixbuf*  gtk_style_render_icon     (GtkStyle            *style,
448                                        const GtkIconSource *source,
449                                        GtkTextDirection     direction,
450                                        GtkStateType         state,
451                                        GtkIconSize          size,
452                                        GtkWidget           *widget,
453                                        const gchar         *detail);
454 #ifndef GTK_DISABLE_DEPRECATED
455 void gtk_draw_hline      (GtkStyle        *style,
456                           GdkWindow       *window,
457                           GtkStateType     state_type,
458                           gint             x1,
459                           gint             x2,
460                           gint             y);
461 void gtk_draw_vline      (GtkStyle        *style,
462                           GdkWindow       *window,
463                           GtkStateType     state_type,
464                           gint             y1,
465                           gint             y2,
466                           gint             x);
467 void gtk_draw_shadow     (GtkStyle        *style,
468                           GdkWindow       *window,
469                           GtkStateType     state_type,
470                           GtkShadowType    shadow_type,
471                           gint             x,
472                           gint             y,
473                           gint             width,
474                           gint             height);
475 void gtk_draw_polygon    (GtkStyle        *style,
476                           GdkWindow       *window,
477                           GtkStateType     state_type,
478                           GtkShadowType    shadow_type,
479                           GdkPoint        *points,
480                           gint             npoints,
481                           gboolean         fill);
482 void gtk_draw_arrow      (GtkStyle        *style,
483                           GdkWindow       *window,
484                           GtkStateType     state_type,
485                           GtkShadowType    shadow_type,
486                           GtkArrowType     arrow_type,
487                           gboolean         fill,
488                           gint             x,
489                           gint             y,
490                           gint             width,
491                           gint             height);
492 void gtk_draw_diamond    (GtkStyle        *style,
493                           GdkWindow       *window,
494                           GtkStateType     state_type,
495                           GtkShadowType    shadow_type,
496                           gint             x,
497                           gint             y,
498                           gint             width,
499                           gint             height);
500 void gtk_draw_box        (GtkStyle        *style,
501                           GdkWindow       *window,
502                           GtkStateType     state_type,
503                           GtkShadowType    shadow_type,
504                           gint             x,
505                           gint             y,
506                           gint             width,
507                           gint             height);
508 void gtk_draw_flat_box   (GtkStyle        *style,
509                           GdkWindow       *window,
510                           GtkStateType     state_type,
511                           GtkShadowType    shadow_type,
512                           gint             x,
513                           gint             y,
514                           gint             width,
515                           gint             height);
516 void gtk_draw_check      (GtkStyle        *style,
517                           GdkWindow       *window,
518                           GtkStateType     state_type,
519                           GtkShadowType    shadow_type,
520                           gint             x,
521                           gint             y,
522                           gint             width,
523                           gint             height);
524 void gtk_draw_option     (GtkStyle        *style,
525                           GdkWindow       *window,
526                           GtkStateType     state_type,
527                           GtkShadowType    shadow_type,
528                           gint             x,
529                           gint             y,
530                           gint             width,
531                           gint             height);
532 void gtk_draw_tab        (GtkStyle        *style,
533                           GdkWindow       *window,
534                           GtkStateType     state_type,
535                           GtkShadowType    shadow_type,
536                           gint             x,
537                           gint             y,
538                           gint             width,
539                           gint             height);
540 void gtk_draw_shadow_gap (GtkStyle        *style,
541                           GdkWindow       *window,
542                           GtkStateType     state_type,
543                           GtkShadowType    shadow_type,
544                           gint             x,
545                           gint             y,
546                           gint             width,
547                           gint             height,
548                           GtkPositionType  gap_side,
549                           gint             gap_x,
550                           gint             gap_width);
551 void gtk_draw_box_gap    (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                           GtkPositionType  gap_side,
560                           gint             gap_x,
561                           gint             gap_width);
562 void gtk_draw_extension  (GtkStyle        *style,
563                           GdkWindow       *window,
564                           GtkStateType     state_type,
565                           GtkShadowType    shadow_type,
566                           gint             x,
567                           gint             y,
568                           gint             width,
569                           gint             height,
570                           GtkPositionType  gap_side);
571 void gtk_draw_focus      (GtkStyle        *style,
572                           GdkWindow       *window,
573                           gint             x,
574                           gint             y,
575                           gint             width,
576                           gint             height);
577 void gtk_draw_slider     (GtkStyle        *style,
578                           GdkWindow       *window,
579                           GtkStateType     state_type,
580                           GtkShadowType    shadow_type,
581                           gint             x,
582                           gint             y,
583                           gint             width,
584                           gint             height,
585                           GtkOrientation   orientation);
586 void gtk_draw_handle     (GtkStyle        *style,
587                           GdkWindow       *window,
588                           GtkStateType     state_type,
589                           GtkShadowType    shadow_type,
590                           gint             x,
591                           gint             y,
592                           gint             width,
593                           gint             height,
594                           GtkOrientation   orientation);
595 void gtk_draw_expander   (GtkStyle        *style,
596                           GdkWindow       *window,
597                           GtkStateType     state_type,
598                           gint             x,
599                           gint             y,
600                           GtkExpanderStyle expander_style);
601 void gtk_draw_layout     (GtkStyle        *style,
602                           GdkWindow       *window,
603                           GtkStateType     state_type,
604                           gboolean         use_text,
605                           gint             x,
606                           gint             y,
607                           PangoLayout     *layout);
608 void gtk_draw_resize_grip (GtkStyle       *style,
609                            GdkWindow      *window,
610                            GtkStateType    state_type,
611                            GdkWindowEdge   edge,
612                            gint            x,
613                            gint            y,
614                            gint            width,
615                            gint            height);
616 #endif /* GTK_DISABLE_DEPRECATED */
617
618 void gtk_paint_hline      (GtkStyle        *style,
619                            GdkWindow       *window,
620                            GtkStateType     state_type,
621                            GdkRectangle    *area,
622                            GtkWidget       *widget,
623                            const gchar     *detail,
624                            gint             x1,
625                            gint             x2,
626                            gint             y);
627 void gtk_paint_vline      (GtkStyle        *style,
628                            GdkWindow       *window,
629                            GtkStateType     state_type,
630                            GdkRectangle    *area,
631                            GtkWidget       *widget,
632                            const gchar     *detail,
633                            gint             y1,
634                            gint             y2,
635                            gint             x);
636 void gtk_paint_shadow     (GtkStyle        *style,
637                            GdkWindow       *window,
638                            GtkStateType     state_type,
639                            GtkShadowType    shadow_type,
640                            GdkRectangle    *area,
641                            GtkWidget       *widget,
642                            const gchar     *detail,
643                            gint             x,
644                            gint             y,
645                            gint             width,
646                            gint             height);
647 void gtk_paint_polygon    (GtkStyle        *style,
648                            GdkWindow       *window,
649                            GtkStateType     state_type,
650                            GtkShadowType    shadow_type,
651                            GdkRectangle    *area,
652                            GtkWidget       *widget,
653                            const gchar     *detail,
654                            GdkPoint        *points,
655                            gint             npoints,
656                            gboolean         fill);
657 void gtk_paint_arrow      (GtkStyle        *style,
658                            GdkWindow       *window,
659                            GtkStateType     state_type,
660                            GtkShadowType    shadow_type,
661                            GdkRectangle    *area,
662                            GtkWidget       *widget,
663                            const gchar     *detail,
664                            GtkArrowType     arrow_type,
665                            gboolean         fill,
666                            gint             x,
667                            gint             y,
668                            gint             width,
669                            gint             height);
670 void gtk_paint_diamond    (GtkStyle        *style,
671                            GdkWindow       *window,
672                            GtkStateType     state_type,
673                            GtkShadowType    shadow_type,
674                            GdkRectangle    *area,
675                            GtkWidget       *widget,
676                            const gchar     *detail,
677                            gint             x,
678                            gint             y,
679                            gint             width,
680                            gint             height);
681 void gtk_paint_box        (GtkStyle        *style,
682                            GdkWindow       *window,
683                            GtkStateType     state_type,
684                            GtkShadowType    shadow_type,
685                            GdkRectangle    *area,
686                            GtkWidget       *widget,
687                            const gchar     *detail,
688                            gint             x,
689                            gint             y,
690                            gint             width,
691                            gint             height);
692 void gtk_paint_flat_box   (GtkStyle        *style,
693                            GdkWindow       *window,
694                            GtkStateType     state_type,
695                            GtkShadowType    shadow_type,
696                            GdkRectangle    *area,
697                            GtkWidget       *widget,
698                            const gchar     *detail,
699                            gint             x,
700                            gint             y,
701                            gint             width,
702                            gint             height);
703 void gtk_paint_check      (GtkStyle        *style,
704                            GdkWindow       *window,
705                            GtkStateType     state_type,
706                            GtkShadowType    shadow_type,
707                            GdkRectangle    *area,
708                            GtkWidget       *widget,
709                            const gchar     *detail,
710                            gint             x,
711                            gint             y,
712                            gint             width,
713                            gint             height);
714 void gtk_paint_option     (GtkStyle        *style,
715                            GdkWindow       *window,
716                            GtkStateType     state_type,
717                            GtkShadowType    shadow_type,
718                            GdkRectangle    *area,
719                            GtkWidget       *widget,
720                            const gchar     *detail,
721                            gint             x,
722                            gint             y,
723                            gint             width,
724                            gint             height);
725 void gtk_paint_tab        (GtkStyle        *style,
726                            GdkWindow       *window,
727                            GtkStateType     state_type,
728                            GtkShadowType    shadow_type,
729                            GdkRectangle    *area,
730                            GtkWidget       *widget,
731                            const gchar     *detail,
732                            gint             x,
733                            gint             y,
734                            gint             width,
735                            gint             height);
736 void gtk_paint_shadow_gap (GtkStyle        *style,
737                            GdkWindow       *window,
738                            GtkStateType     state_type,
739                            GtkShadowType    shadow_type,
740                            GdkRectangle    *area,
741                            GtkWidget       *widget,
742                            gchar           *detail,
743                            gint             x,
744                            gint             y,
745                            gint             width,
746                            gint             height,
747                            GtkPositionType  gap_side,
748                            gint             gap_x,
749                            gint             gap_width);
750 void gtk_paint_box_gap    (GtkStyle        *style,
751                            GdkWindow       *window,
752                            GtkStateType     state_type,
753                            GtkShadowType    shadow_type,
754                            GdkRectangle    *area,
755                            GtkWidget       *widget,
756                            gchar           *detail,
757                            gint             x,
758                            gint             y,
759                            gint             width,
760                            gint             height,
761                            GtkPositionType  gap_side,
762                            gint             gap_x,
763                            gint             gap_width);
764 void gtk_paint_extension  (GtkStyle        *style,
765                            GdkWindow       *window,
766                            GtkStateType     state_type,
767                            GtkShadowType    shadow_type,
768                            GdkRectangle    *area,
769                            GtkWidget       *widget,
770                            gchar           *detail,
771                            gint             x,
772                            gint             y,
773                            gint             width,
774                            gint             height,
775                            GtkPositionType  gap_side);
776 void gtk_paint_focus      (GtkStyle        *style,
777                            GdkWindow       *window,
778                            GdkRectangle    *area,
779                            GtkWidget       *widget,
780                            const gchar     *detail,
781                            gint             x,
782                            gint             y,
783                            gint             width,
784                            gint             height);
785 void gtk_paint_slider     (GtkStyle        *style,
786                            GdkWindow       *window,
787                            GtkStateType     state_type,
788                            GtkShadowType    shadow_type,
789                            GdkRectangle    *area,
790                            GtkWidget       *widget,
791                            const gchar     *detail,
792                            gint             x,
793                            gint             y,
794                            gint             width,
795                            gint             height,
796                            GtkOrientation   orientation);
797 void gtk_paint_handle     (GtkStyle        *style,
798                            GdkWindow       *window,
799                            GtkStateType     state_type,
800                            GtkShadowType    shadow_type,
801                            GdkRectangle    *area,
802                            GtkWidget       *widget,
803                            const gchar     *detail,
804                            gint             x,
805                            gint             y,
806                            gint             width,
807                            gint             height,
808                            GtkOrientation   orientation);
809 void gtk_paint_expander   (GtkStyle        *style,
810                            GdkWindow       *window,
811                            GtkStateType     state_type,
812                            GdkRectangle    *area,
813                            GtkWidget       *widget,
814                            const gchar     *detail,
815                            gint             x,
816                            gint             y,
817                            GtkExpanderStyle expander_style);
818 void gtk_paint_layout     (GtkStyle        *style,
819                            GdkWindow       *window,
820                            GtkStateType     state_type,
821                            gboolean         use_text,
822                            GdkRectangle    *area,
823                            GtkWidget       *widget,
824                            const gchar     *detail,
825                            gint             x,
826                            gint             y,
827                            PangoLayout     *layout);
828
829 void gtk_paint_resize_grip (GtkStyle            *style,
830                             GdkWindow           *window,
831                             GtkStateType         state_type,
832                             GdkRectangle        *area,
833                             GtkWidget           *widget,
834                             const gchar         *detail,
835                             GdkWindowEdge        edge,
836                             gint                 x,
837                             gint                 y,
838                             gint                 width,
839                             gint                 height);
840
841
842 GtkBorder *gtk_border_copy (const GtkBorder *border);
843 void       gtk_border_free (GtkBorder       *border);
844
845 /* --- private API --- */
846 const GValue* _gtk_style_peek_property_value (GtkStyle           *style,
847                                               GType               widget_type,
848                                               GParamSpec         *pspec,
849                                               GtkRcPropertyParser parser);
850
851
852 /* depprecated */
853 #ifndef GTK_DISABLE_DEPRECATED
854 #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)
855 void gtk_draw_string     (GtkStyle        *style,
856                           GdkWindow       *window,
857                           GtkStateType     state_type,
858                           gint             x,
859                           gint             y,
860                           const gchar     *string);
861 void gtk_paint_string     (GtkStyle        *style,
862                            GdkWindow       *window,
863                            GtkStateType     state_type,
864                            GdkRectangle    *area,
865                            GtkWidget       *widget,
866                            const gchar     *detail,
867                            gint             x,
868                            gint             y,
869                            const gchar     *string);
870 #endif /* GTK_DISABLE_DEPRECATED */
871
872 void _gtk_draw_insertion_cursor (GdkDrawable      *drawable,
873                                  GdkGC            *gc,
874                                  GdkRectangle     *location,
875                                  GtkTextDirection  dir);
876
877 #ifdef __cplusplus
878 }
879 #endif /* __cplusplus */
880
881
882 #endif /* __GTK_STYLE_H__ */