]> Pileus Git - ~andy/gtk/blob - gtk/gtkthemes.h
e1c4a472331ef7da3fdd3e3b30b351b00c38167a
[~andy/gtk] / gtk / gtkthemes.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * Themes added by The Rasterman <raster@redhat.com>
5  * 
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.
10  *
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.
15  *
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.
19  */
20
21 /*
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/. 
26  */
27
28 #ifndef __GTK_THEMES_H__
29 #define __GTK_THEMES_H__
30
31 #include <gdk/gdk.h>
32 #include <gtk/gtkstyle.h>
33 #include <gtk/gtkwidget.h>
34
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.
39    */
40   guint (*parse_rc_style)    (GScanner *scanner, GtkRcStyle *rc_style);
41   
42   /* Combine RC style data from src into dest. If 
43    * dest->engine_data is NULL, it should be initialized to default
44    * values.
45    */
46   void (*merge_rc_style)    (GtkRcStyle *dest,     GtkRcStyle *src);
47
48   /* Fill in style->engine_data from rc_style->engine_data */
49   void (*rc_style_to_style) (GtkStyle   *style, GtkRcStyle *rc_style);
50
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.
54    */
55   void (*duplicate_style)   (GtkStyle *dest,       GtkStyle *src);
56
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 
60    * the colormap
61    */
62   void (*realize_style) (GtkStyle   *new_style);
63
64   /* If style needs to clean up for a particular colormap/depth
65    * combination, do it here. 
66    */
67   void (*unrealize_style) (GtkStyle   *new_style);
68
69   /* Clean up rc_style->engine_data before rc_style is destroyed */
70   void (*destroy_rc_style)  (GtkRcStyle *rc_style);
71
72   /* Clean up style->engine_data before style is destroyed */
73   void (*destroy_style)     (GtkStyle   *style);
74
75   void (*set_background) (GtkStyle     *style,
76                           GdkWindow    *window,
77                           GtkStateType  state_type);
78 };
79
80 GtkThemeEngine *gtk_theme_engine_get   (gchar          *name);
81 void            gtk_theme_engine_ref   (GtkThemeEngine *engine);
82 void            gtk_theme_engine_unref (GtkThemeEngine *engine);
83
84 #ifdef __cplusplus
85 extern "C" {
86 #endif /* __cplusplus */
87
88 /* Initialization, exit, mainloop and miscellaneous routines
89  */
90 void       gtk_themes_init       (int          *argc,
91                                   char       ***argv);
92 void       gtk_themes_exit       (gint          error_code);
93
94 #ifdef __cplusplus
95 }
96 #endif /* __cplusplus */
97
98
99 #endif /* __GTK_THEMES_H__ */