]> Pileus Git - ~andy/gtk/blob - gtk/gtkrc.h
Added notice to look in AUTHORS and ChangeLog files for a list of changes.
[~andy/gtk] / gtk / gtkrc.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
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.
8  *
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.
13  *
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.
18  */
19
20 /*
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/. 
25  */
26
27 #ifndef __GTK_RC_H__
28 #define __GTK_RC_H__
29
30
31 #include <gtk/gtkstyle.h>
32 #include <gtk/gtkwidget.h>
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif /* __cplusplus */
37
38
39 typedef enum {
40   GTK_RC_FG   = 1 << 0,
41   GTK_RC_BG   = 1 << 1,
42   GTK_RC_TEXT = 1 << 2,
43   GTK_RC_BASE = 1 << 3
44 } GtkRcFlags;
45
46 struct _GtkRcStyle
47 {
48   gchar *name;
49   gchar *font_name;
50   gchar *fontset_name;
51   gchar *bg_pixmap_name[5];
52
53   GtkRcFlags color_flags[5];
54   GdkColor   fg[5];
55   GdkColor   bg[5];
56   GdkColor   text[5];
57   GdkColor   base[5];
58
59   GtkThemeEngine *engine;
60   gpointer        engine_data;
61
62   /* Private */
63   guint ref_count;
64 };
65
66 void      gtk_rc_init                   (void);
67 void      gtk_rc_add_default_file    (const gchar *filename);
68 void      gtk_rc_set_default_files      (gchar **filenames);
69 gchar**   gtk_rc_get_default_files      (void);
70 void      gtk_rc_parse                  (const gchar *filename);
71 void      gtk_rc_parse_string           (const gchar *rc_string);
72 gboolean  gtk_rc_reparse_all            (void);
73 GtkStyle* gtk_rc_get_style              (GtkWidget   *widget);
74 void      gtk_rc_add_widget_name_style  (GtkRcStyle  *rc_style,
75                                          const gchar *pattern);
76 void      gtk_rc_add_widget_class_style (GtkRcStyle  *rc_style,
77                                          const gchar *pattern);
78 void      gtk_rc_add_class_style        (GtkRcStyle  *rc_style,
79                                          const gchar *pattern);
80
81 GtkRcStyle* gtk_rc_style_new              (void);
82 void        gtk_rc_style_ref              (GtkRcStyle  *rc_style);
83 void        gtk_rc_style_unref            (GtkRcStyle  *rc_style);
84
85 /* Tell gtkrc to use a custom routine to load images specified in rc files instead of
86  *   the default xpm-only loader
87  */
88 typedef GdkPixmap*  (*GtkImageLoader)           (GdkWindow      *window,
89                                                  GdkColormap    *colormap,
90                                                  GdkBitmap     **mask,
91                                                  GdkColor       *transparent_color,
92                                                  const gchar    *filename);
93 void            gtk_rc_set_image_loader         (GtkImageLoader  loader);
94
95 GdkPixmap*      gtk_rc_load_image               (GdkColormap    *colormap,
96                                                  GdkColor       *transparent_color,
97                                                  const gchar    *filename);
98 gchar*          gtk_rc_find_pixmap_in_path      (GScanner       *scanner,
99                                                  const gchar    *pixmap_file);
100 gchar*          gtk_rc_find_module_in_path      (const gchar    *module_file);
101 gchar*          gtk_rc_get_theme_dir            (void);
102 gchar*          gtk_rc_get_module_dir           (void);
103
104 /* private functions/definitions */
105 typedef enum {
106   GTK_RC_TOKEN_INVALID = G_TOKEN_LAST,
107   GTK_RC_TOKEN_INCLUDE,
108   GTK_RC_TOKEN_NORMAL,
109   GTK_RC_TOKEN_ACTIVE,
110   GTK_RC_TOKEN_PRELIGHT,
111   GTK_RC_TOKEN_SELECTED,
112   GTK_RC_TOKEN_INSENSITIVE,
113   GTK_RC_TOKEN_FG,
114   GTK_RC_TOKEN_BG,
115   GTK_RC_TOKEN_BASE,
116   GTK_RC_TOKEN_TEXT,
117   GTK_RC_TOKEN_FONT,
118   GTK_RC_TOKEN_FONTSET,
119   GTK_RC_TOKEN_BG_PIXMAP,
120   GTK_RC_TOKEN_PIXMAP_PATH,
121   GTK_RC_TOKEN_STYLE,
122   GTK_RC_TOKEN_BINDING,
123   GTK_RC_TOKEN_BIND,
124   GTK_RC_TOKEN_WIDGET,
125   GTK_RC_TOKEN_WIDGET_CLASS,
126   GTK_RC_TOKEN_CLASS,
127   GTK_RC_TOKEN_LOWEST,
128   GTK_RC_TOKEN_GTK,
129   GTK_RC_TOKEN_APPLICATION,
130   GTK_RC_TOKEN_RC,
131   GTK_RC_TOKEN_HIGHEST,
132   GTK_RC_TOKEN_ENGINE,
133   GTK_RC_TOKEN_MODULE_PATH,
134   GTK_RC_TOKEN_LAST
135 } GtkRcTokenType;
136
137 guint   gtk_rc_parse_color      (GScanner            *scanner,
138                                  GdkColor            *color);
139 guint   gtk_rc_parse_state      (GScanner            *scanner,
140                                  GtkStateType        *state);
141 guint   gtk_rc_parse_priority   (GScanner            *scanner,
142                                  GtkPathPriorityType *priority);
143      
144
145
146 #ifdef __cplusplus
147 }
148 #endif /* __cplusplus */
149
150
151 #endif /* __GTK_RC_H__ */