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.
22 * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
23 * file for a list of people on the GTK+ Team. See the ChangeLog
24 * files for a list of changes. These files are distributed with
25 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
28 #ifndef __GTK_THEMES_H__
29 #define __GTK_THEMES_H__
32 #include <gtk/gtkstyle.h>
33 #include <gtk/gtkwidget.h>
35 struct _GtkThemeEngine {
36 /* Fill in engine_data pointer in a GtkRcStyle by parsing contents
37 * of brackets. Returns G_TOKEN_NONE if succesfull, otherwise returns
38 * the token it expected but didn't get.
40 guint (*parse_rc_style) (GScanner *scanner, GtkRcStyle *rc_style);
42 /* Combine RC style data from src into dest. If
43 * dest->engine_data is NULL, it should be initialized to default
46 void (*merge_rc_style) (GtkRcStyle *dest, GtkRcStyle *src);
48 /* Fill in style->engine_data from rc_style->engine_data */
49 void (*rc_style_to_style) (GtkStyle *style, GtkRcStyle *rc_style);
51 /* Duplicate engine_data from src to dest. The engine_data will
52 * not subsequently be modified except by a call to realize_style()
53 * so if realize_style() does nothing, refcounting is appropriate.
55 void (*duplicate_style) (GtkStyle *dest, GtkStyle *src);
57 /* If style needs to initialize for a particular colormap/depth
58 * combination, do it here. style->colormap/style->depth will have
59 * been set at this point, and style itself initialized for
62 void (*realize_style) (GtkStyle *new_style);
64 /* If style needs to clean up for a particular colormap/depth
65 * combination, do it here.
67 void (*unrealize_style) (GtkStyle *new_style);
69 /* Clean up rc_style->engine_data before rc_style is destroyed */
70 void (*destroy_rc_style) (GtkRcStyle *rc_style);
72 /* Clean up style->engine_data before style is destroyed */
73 void (*destroy_style) (GtkStyle *style);
75 void (*set_background) (GtkStyle *style,
77 GtkStateType state_type);
80 GtkThemeEngine *gtk_theme_engine_get (gchar *name);
81 void gtk_theme_engine_ref (GtkThemeEngine *engine);
82 void gtk_theme_engine_unref (GtkThemeEngine *engine);
86 #endif /* __cplusplus */
88 /* Initialization, exit, mainloop and miscellaneous routines
90 void gtk_themes_init (int *argc,
92 void gtk_themes_exit (gint error_code);
96 #endif /* __cplusplus */
99 #endif /* __GTK_THEMES_H__ */