1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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.
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.
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.
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/.
31 #include <gtk/gtkstyle.h>
32 #include <gtk/gtkwidget.h>
36 #endif /* __cplusplus */
38 #define GTK_TYPE_RC_STYLE (gtk_rc_style_get_type ())
39 #define GTK_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_RC_STYLE, GtkRcStyle))
40 #define GTK_RC_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_RC_STYLE, GtkRcStyleClass))
41 #define GTK_IS_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_RC_STYLE))
42 #define GTK_IS_RC_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RC_STYLE))
43 #define GTK_RC_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_RC_STYLE, GtkRcStyleClass))
52 typedef struct _GtkRcStyleClass GtkRcStyleClass;
56 GObject parent_instance;
61 gchar *bg_pixmap_name[5];
62 PangoFontDescription *font_desc;
64 GtkRcFlags color_flags[5];
70 GtkThemeEngine *engine;
75 /* list of RC style lists including this RC style */
76 GSList *rc_style_lists;
79 struct _GtkRcStyleClass
81 GObjectClass parent_class;
85 void gtk_rc_init (void);
86 void gtk_rc_add_default_file (const gchar *filename);
87 void gtk_rc_set_default_files (gchar **filenames);
88 gchar** gtk_rc_get_default_files (void);
89 void gtk_rc_parse (const gchar *filename);
90 void gtk_rc_parse_string (const gchar *rc_string);
91 gboolean gtk_rc_reparse_all (void);
92 GtkStyle* gtk_rc_get_style (GtkWidget *widget);
93 void gtk_rc_add_widget_name_style (GtkRcStyle *rc_style,
94 const gchar *pattern);
95 void gtk_rc_add_widget_class_style (GtkRcStyle *rc_style,
96 const gchar *pattern);
97 void gtk_rc_add_class_style (GtkRcStyle *rc_style,
98 const gchar *pattern);
100 GType gtk_rc_style_get_type (void);
101 GtkRcStyle* gtk_rc_style_new (void);
102 void gtk_rc_style_ref (GtkRcStyle *rc_style);
103 void gtk_rc_style_unref (GtkRcStyle *rc_style);
105 /* Tell gtkrc to use a custom routine to load images specified in rc files instead of
106 * the default xpm-only loader
108 typedef GdkPixmap* (*GtkImageLoader) (GdkWindow *window,
109 GdkColormap *colormap,
111 GdkColor *transparent_color,
112 const gchar *filename);
113 void gtk_rc_set_image_loader (GtkImageLoader loader);
115 GdkPixmap* gtk_rc_load_image (GdkColormap *colormap,
116 GdkColor *transparent_color,
117 const gchar *filename);
118 gchar* gtk_rc_find_pixmap_in_path (GScanner *scanner,
119 const gchar *pixmap_file);
120 gchar* gtk_rc_find_module_in_path (const gchar *module_file);
121 gchar* gtk_rc_get_theme_dir (void);
122 gchar* gtk_rc_get_module_dir (void);
124 /* private functions/definitions */
126 GTK_RC_TOKEN_INVALID = G_TOKEN_LAST,
127 GTK_RC_TOKEN_INCLUDE,
130 GTK_RC_TOKEN_PRELIGHT,
131 GTK_RC_TOKEN_SELECTED,
132 GTK_RC_TOKEN_INSENSITIVE,
138 GTK_RC_TOKEN_FONTSET,
139 GTK_RC_TOKEN_FONT_NAME,
140 GTK_RC_TOKEN_BG_PIXMAP,
141 GTK_RC_TOKEN_PIXMAP_PATH,
143 GTK_RC_TOKEN_BINDING,
146 GTK_RC_TOKEN_WIDGET_CLASS,
150 GTK_RC_TOKEN_APPLICATION,
152 GTK_RC_TOKEN_HIGHEST,
154 GTK_RC_TOKEN_MODULE_PATH,
158 guint gtk_rc_parse_color (GScanner *scanner,
160 guint gtk_rc_parse_state (GScanner *scanner,
161 GtkStateType *state);
162 guint gtk_rc_parse_priority (GScanner *scanner,
163 GtkPathPriorityType *priority);
169 #endif /* __cplusplus */
172 #endif /* __GTK_RC_H__ */