]> Pileus Git - ~andy/gtk/blob - gtk/gtkthemes.h
Use IPC_RMID _after_ doing XShmAttach. This should work everywhere, and
[~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 #ifndef __GTK_THEMES_H__
21 #define __GTK_THEMES_H__
22
23
24 #include <string.h>
25 #include <stdio.h>
26 #include <stdlib.h>
27 #include <gdk/gdk.h>
28 #include <gtk/gtkstyle.h>
29 #include <gtk/gtkwidget.h>
30
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.
35    */
36   guint (*parse_rc_style)    (GScanner *scanner, GtkRcStyle *rc_style);
37   
38   /* Combine RC style data from src into dest. If 
39    * dest->engine_data is NULL, it should be initialized to default
40    * values.
41    */
42   void (*merge_rc_style)    (GtkRcStyle *dest,     GtkRcStyle *src);
43
44   /* Fill in style->engine_data from rc_style->engine_data */
45   void (*rc_style_to_style) (GtkStyle   *style, GtkRcStyle *rc_style);
46
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.
50    */
51   void (*duplicate_style)   (GtkStyle *dest,       GtkStyle *src);
52
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 
56    * the colormap
57    */
58   void (*realize_style) (GtkStyle   *new_style);
59
60   /* If style needs to clean up for a particular colormap/depth
61    * combination, do it here. 
62    */
63   void (*unrealize_style) (GtkStyle   *new_style);
64
65   /* Clean up rc_style->engine_data before rc_style is destroyed */
66   void (*destroy_rc_style)  (GtkRcStyle *rc_style);
67
68   /* Clean up style->engine_data before style is destroyed */
69   void (*destroy_style)     (GtkStyle   *style);
70
71   void (*set_background) (GtkStyle     *style,
72                           GdkWindow    *window,
73                           GtkStateType  state_type);
74 };
75
76 GtkThemeEngine *gtk_theme_engine_get   (gchar          *name);
77 void            gtk_theme_engine_ref   (GtkThemeEngine *engine);
78 void            gtk_theme_engine_unref (GtkThemeEngine *engine);
79
80 #ifdef __cplusplus
81 extern "C" {
82 #endif /* __cplusplus */
83
84 /* Initialization, exit, mainloop and miscellaneous routines
85  */
86 void       gtk_themes_init       (int          *argc,
87                                   char       ***argv);
88 void       gtk_themes_exit       (gint          error_code);
89
90 #ifdef __cplusplus
91 }
92 #endif /* __cplusplus */
93
94
95 #endif /* __GTK_THEMES_H__ */