1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * Themes added by The Rasterman <raster@redhat.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the Free
18 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __GTK_THEMES_H__
21 #define __GTK_THEMES_H__
28 #include <gtk/gtkstyle.h>
29 #include <gtk/gtkwidget.h>
31 struct _GtkThemeEngine {
32 /* Fill in engine_data pointer in a GtkRcStyle by parsing contents
33 * of brackets. Returns G_TOKEN_NONE if succesfull, otherwise returns
34 * the token it expected but didn't get.
36 guint (*parse_rc_style) (GScanner *scanner, GtkRcStyle *rc_style);
38 /* Combine RC style data from src into dest. If
39 * dest->engine_data is NULL, it should be initialized to default
42 void (*merge_rc_style) (GtkRcStyle *dest, GtkRcStyle *src);
44 /* Fill in style->engine_data from rc_style->engine_data */
45 void (*rc_style_to_style) (GtkStyle *style, GtkRcStyle *rc_style);
47 /* Duplicate engine_data from src to dest. The engine_data will
48 * not subsequently be modified except by a call to realize_style()
49 * so if realize_style() does nothing, refcounting is appropriate.
51 void (*duplicate_style) (GtkStyle *dest, GtkStyle *src);
53 /* If style needs to initialize for a particular colormap/depth
54 * combination, do it here. style->colormap/style->depth will have
55 * been set at this point, and style itself initialized for
58 void (*realize_style) (GtkStyle *new_style);
60 /* If style needs to clean up for a particular colormap/depth
61 * combination, do it here.
63 void (*unrealize_style) (GtkStyle *new_style);
65 /* Clean up rc_style->engine_data before rc_style is destroyed */
66 void (*destroy_rc_style) (GtkRcStyle *rc_style);
68 /* Clean up style->engine_data before style is destroyed */
69 void (*destroy_style) (GtkStyle *style);
71 void (*set_background) (GtkStyle *style,
73 GtkStateType state_type);
76 GtkThemeEngine *gtk_theme_engine_get (gchar *name);
77 void gtk_theme_engine_ref (GtkThemeEngine *engine);
78 void gtk_theme_engine_unref (GtkThemeEngine *engine);
82 #endif /* __cplusplus */
84 /* Initialization, exit, mainloop and miscellaneous routines
86 void gtk_themes_init (int *argc,
88 void gtk_themes_exit (gint error_code);
92 #endif /* __cplusplus */
95 #endif /* __GTK_THEMES_H__ */