1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library 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.
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 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library 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.
21 * Modified by the GTK+ Team and others 1997-1999. 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/.
27 #ifndef __GTK_STYLE_H__
28 #define __GTK_STYLE_H__
32 #include <gtk/gtkenums.h>
36 #endif /* __cplusplus */
38 typedef struct _GtkStyle GtkStyle;
39 typedef struct _GtkStyleClass GtkStyleClass;
41 /* Some forward declarations needed to rationalize the header
44 typedef struct _GtkThemeEngine GtkThemeEngine;
45 typedef struct _GtkRcStyle GtkRcStyle;
48 /* We make this forward declaration here, since we pass
49 * GtkWidgt's to the draw functions.
51 typedef struct _GtkWidget GtkWidget;
53 /* This is used for having dynamic style changing stuff
54 * fg, bg, light, dark, mid, text, base
56 #define GTK_STYLE_NUM_STYLECOLORS() (7 * 5)
58 #define GTK_STYLE_ATTACHED(style) (((GtkStyle*) (style))->attach_count > 0)
86 GdkPixmap *bg_pixmap[5];
94 GdkColormap *colormap;
96 GtkThemeEngine *engine;
100 GtkRcStyle *rc_style; /* the Rc style from which this style
106 struct _GtkStyleClass
111 void (*draw_hline) (GtkStyle *style,
113 GtkStateType state_type,
120 void (*draw_vline) (GtkStyle *style,
122 GtkStateType state_type,
129 void (*draw_shadow) (GtkStyle *style,
131 GtkStateType state_type,
132 GtkShadowType shadow_type,
140 void (*draw_polygon) (GtkStyle *style,
142 GtkStateType state_type,
143 GtkShadowType shadow_type,
150 void (*draw_arrow) (GtkStyle *style,
152 GtkStateType state_type,
153 GtkShadowType shadow_type,
157 GtkArrowType arrow_type,
163 void (*draw_diamond) (GtkStyle *style,
165 GtkStateType state_type,
166 GtkShadowType shadow_type,
174 void (*draw_oval) (GtkStyle *style,
176 GtkStateType state_type,
177 GtkShadowType shadow_type,
185 void (*draw_string) (GtkStyle *style,
187 GtkStateType state_type,
193 const gchar *string);
194 void (*draw_box) (GtkStyle *style,
196 GtkStateType state_type,
197 GtkShadowType shadow_type,
205 void (*draw_flat_box) (GtkStyle *style,
207 GtkStateType state_type,
208 GtkShadowType shadow_type,
216 void (*draw_check) (GtkStyle *style,
218 GtkStateType state_type,
219 GtkShadowType shadow_type,
227 void (*draw_option) (GtkStyle *style,
229 GtkStateType state_type,
230 GtkShadowType shadow_type,
238 void (*draw_cross) (GtkStyle *style,
240 GtkStateType state_type,
241 GtkShadowType shadow_type,
249 void (*draw_ramp) (GtkStyle *style,
251 GtkStateType state_type,
252 GtkShadowType shadow_type,
256 GtkArrowType arrow_type,
261 void (*draw_tab) (GtkStyle *style,
263 GtkStateType state_type,
264 GtkShadowType shadow_type,
272 void (*draw_shadow_gap) (GtkStyle *style,
274 GtkStateType state_type,
275 GtkShadowType shadow_type,
283 GtkPositionType gap_side,
286 void (*draw_box_gap) (GtkStyle *style,
288 GtkStateType state_type,
289 GtkShadowType shadow_type,
297 GtkPositionType gap_side,
300 void (*draw_extension) (GtkStyle *style,
302 GtkStateType state_type,
303 GtkShadowType shadow_type,
311 GtkPositionType gap_side);
312 void (*draw_focus) (GtkStyle *style,
321 void (*draw_slider) (GtkStyle *style,
323 GtkStateType state_type,
324 GtkShadowType shadow_type,
332 GtkOrientation orientation);
333 void (*draw_handle) (GtkStyle *style,
335 GtkStateType state_type,
336 GtkShadowType shadow_type,
344 GtkOrientation orientation);
347 GtkStyle* gtk_style_new (void);
348 GtkStyle* gtk_style_copy (GtkStyle *style);
349 GtkStyle* gtk_style_attach (GtkStyle *style,
351 void gtk_style_detach (GtkStyle *style);
352 GtkStyle* gtk_style_ref (GtkStyle *style);
353 void gtk_style_unref (GtkStyle *style);
354 void gtk_style_set_background (GtkStyle *style,
356 GtkStateType state_type);
357 void gtk_style_apply_default_background (GtkStyle *style,
360 GtkStateType state_type,
367 void gtk_draw_hline (GtkStyle *style,
369 GtkStateType state_type,
373 void gtk_draw_vline (GtkStyle *style,
375 GtkStateType state_type,
379 void gtk_draw_shadow (GtkStyle *style,
381 GtkStateType state_type,
382 GtkShadowType shadow_type,
387 void gtk_draw_polygon (GtkStyle *style,
389 GtkStateType state_type,
390 GtkShadowType shadow_type,
394 void gtk_draw_arrow (GtkStyle *style,
396 GtkStateType state_type,
397 GtkShadowType shadow_type,
398 GtkArrowType arrow_type,
404 void gtk_draw_diamond (GtkStyle *style,
406 GtkStateType state_type,
407 GtkShadowType shadow_type,
412 void gtk_draw_oval (GtkStyle *style,
414 GtkStateType state_type,
415 GtkShadowType shadow_type,
420 void gtk_draw_string (GtkStyle *style,
422 GtkStateType state_type,
425 const gchar *string);
426 void gtk_draw_box (GtkStyle *style,
428 GtkStateType state_type,
429 GtkShadowType shadow_type,
434 void gtk_draw_flat_box (GtkStyle *style,
436 GtkStateType state_type,
437 GtkShadowType shadow_type,
442 void gtk_draw_check (GtkStyle *style,
444 GtkStateType state_type,
445 GtkShadowType shadow_type,
450 void gtk_draw_option (GtkStyle *style,
452 GtkStateType state_type,
453 GtkShadowType shadow_type,
458 void gtk_draw_cross (GtkStyle *style,
460 GtkStateType state_type,
461 GtkShadowType shadow_type,
466 void gtk_draw_ramp (GtkStyle *style,
468 GtkStateType state_type,
469 GtkShadowType shadow_type,
470 GtkArrowType arrow_type,
475 void gtk_draw_tab (GtkStyle *style,
477 GtkStateType state_type,
478 GtkShadowType shadow_type,
483 void gtk_draw_shadow_gap (GtkStyle *style,
485 GtkStateType state_type,
486 GtkShadowType shadow_type,
491 GtkPositionType gap_side,
494 void gtk_draw_box_gap (GtkStyle *style,
496 GtkStateType state_type,
497 GtkShadowType shadow_type,
502 GtkPositionType gap_side,
505 void gtk_draw_extension (GtkStyle *style,
507 GtkStateType state_type,
508 GtkShadowType shadow_type,
513 GtkPositionType gap_side);
514 void gtk_draw_focus (GtkStyle *style,
520 void gtk_draw_slider (GtkStyle *style,
522 GtkStateType state_type,
523 GtkShadowType shadow_type,
528 GtkOrientation orientation);
529 void gtk_draw_handle (GtkStyle *style,
531 GtkStateType state_type,
532 GtkShadowType shadow_type,
537 GtkOrientation orientation);
539 void gtk_paint_hline (GtkStyle *style,
541 GtkStateType state_type,
548 void gtk_paint_vline (GtkStyle *style,
550 GtkStateType state_type,
557 void gtk_paint_shadow (GtkStyle *style,
559 GtkStateType state_type,
560 GtkShadowType shadow_type,
568 void gtk_paint_polygon (GtkStyle *style,
570 GtkStateType state_type,
571 GtkShadowType shadow_type,
578 void gtk_paint_arrow (GtkStyle *style,
580 GtkStateType state_type,
581 GtkShadowType shadow_type,
585 GtkArrowType arrow_type,
591 void gtk_paint_diamond (GtkStyle *style,
593 GtkStateType state_type,
594 GtkShadowType shadow_type,
602 void gtk_paint_oval (GtkStyle *style,
604 GtkStateType state_type,
605 GtkShadowType shadow_type,
613 void gtk_paint_string (GtkStyle *style,
615 GtkStateType state_type,
621 const gchar *string);
622 void gtk_paint_box (GtkStyle *style,
624 GtkStateType state_type,
625 GtkShadowType shadow_type,
633 void gtk_paint_flat_box (GtkStyle *style,
635 GtkStateType state_type,
636 GtkShadowType shadow_type,
644 void gtk_paint_check (GtkStyle *style,
646 GtkStateType state_type,
647 GtkShadowType shadow_type,
655 void gtk_paint_option (GtkStyle *style,
657 GtkStateType state_type,
658 GtkShadowType shadow_type,
666 void gtk_paint_cross (GtkStyle *style,
668 GtkStateType state_type,
669 GtkShadowType shadow_type,
677 void gtk_paint_ramp (GtkStyle *style,
679 GtkStateType state_type,
680 GtkShadowType shadow_type,
684 GtkArrowType arrow_type,
689 void gtk_paint_tab (GtkStyle *style,
691 GtkStateType state_type,
692 GtkShadowType shadow_type,
700 void gtk_paint_shadow_gap (GtkStyle *style,
702 GtkStateType state_type,
703 GtkShadowType shadow_type,
711 GtkPositionType gap_side,
714 void gtk_paint_box_gap (GtkStyle *style,
716 GtkStateType state_type,
717 GtkShadowType shadow_type,
725 GtkPositionType gap_side,
728 void gtk_paint_extension (GtkStyle *style,
730 GtkStateType state_type,
731 GtkShadowType shadow_type,
739 GtkPositionType gap_side);
740 void gtk_paint_focus (GtkStyle *style,
749 void gtk_paint_slider (GtkStyle *style,
751 GtkStateType state_type,
752 GtkShadowType shadow_type,
760 GtkOrientation orientation);
761 void gtk_paint_handle (GtkStyle *style,
763 GtkStateType state_type,
764 GtkShadowType shadow_type,
772 GtkOrientation orientation);
776 #endif /* __cplusplus */
779 #endif /* __GTK_STYLE_H__ */