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 Lesser 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 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser 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-2000. 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>
35 #endif /* __cplusplus */
37 /* Forward declarations */
38 typedef struct _GtkIconFactory GtkIconFactory;
39 typedef struct _GtkRcContext GtkRcContext;
40 typedef struct _GtkSettings GtkSettings;
42 typedef struct _GtkRcStyleClass GtkRcStyleClass;
44 #define GTK_TYPE_RC_STYLE (gtk_rc_style_get_type ())
45 #define GTK_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_RC_STYLE, GtkRcStyle))
46 #define GTK_RC_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_RC_STYLE, GtkRcStyleClass))
47 #define GTK_IS_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_RC_STYLE))
48 #define GTK_IS_RC_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RC_STYLE))
49 #define GTK_RC_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_RC_STYLE, GtkRcStyleClass))
61 GObject parent_instance;
66 gchar *bg_pixmap_name[5];
67 PangoFontDescription *font_desc;
69 GtkRcFlags color_flags[5];
79 GBSearchArray *rc_properties;
81 /* list of RC style lists including this RC style */
82 GSList *rc_style_lists;
84 GSList *icon_factories;
87 struct _GtkRcStyleClass
89 GObjectClass parent_class;
91 /* Create an empty RC style of the same type as this RC style.
92 * The default implementation, which does
93 * g_object_new (G_OBJECT_TYPE (style), NULL);
94 * should work in most cases.
96 GtkRcStyle * (*create_rc_style) (GtkRcStyle *rc_style);
98 /* Fill in engine specific parts of GtkRcStyle by parsing contents
99 * of brackets. Returns G_TOKEN_NONE if succesful, otherwise returns
100 * the token it expected but didn't get.
102 guint (*parse) (GtkRcStyle *rc_style,
103 GtkSettings *settings,
106 /* Combine RC style data from src into dest. If overriden, this
107 * function should chain to the parent.
109 void (*merge) (GtkRcStyle *dest,
112 /* Create an empty style suitable to this RC style
114 GtkStyle * (*create_style) (GtkRcStyle *rc_style);
117 void _gtk_rc_init (void);
118 void gtk_rc_add_default_file (const gchar *filename);
119 void gtk_rc_set_default_files (gchar **filenames);
120 gchar** gtk_rc_get_default_files (void);
121 GtkStyle* gtk_rc_get_style (GtkWidget *widget);
122 GtkStyle* gtk_rc_get_style_by_paths (GtkSettings *settings,
123 const char *widget_path,
124 const char *class_path,
127 gboolean gtk_rc_reparse_all_for_settings (GtkSettings *settings,
128 gboolean force_load);
129 gchar* gtk_rc_find_pixmap_in_path (GtkSettings *context,
131 const gchar *pixmap_file);
133 void gtk_rc_parse (const gchar *filename);
134 void gtk_rc_parse_string (const gchar *rc_string);
135 gboolean gtk_rc_reparse_all (void);
137 #ifndef GTK_DISABLE_DEPRECATED
138 void gtk_rc_add_widget_name_style (GtkRcStyle *rc_style,
139 const gchar *pattern);
140 void gtk_rc_add_widget_class_style (GtkRcStyle *rc_style,
141 const gchar *pattern);
142 void gtk_rc_add_class_style (GtkRcStyle *rc_style,
143 const gchar *pattern);
144 #endif /* GTK_DISABLE_DEPRECATED */
147 GType gtk_rc_style_get_type (void) G_GNUC_CONST;
148 GtkRcStyle* gtk_rc_style_new (void);
149 GtkRcStyle* gtk_rc_style_copy (GtkRcStyle *orig);
150 void gtk_rc_style_ref (GtkRcStyle *rc_style);
151 void gtk_rc_style_unref (GtkRcStyle *rc_style);
153 gchar* gtk_rc_find_module_in_path (const gchar *module_file);
154 gchar* gtk_rc_get_theme_dir (void);
155 gchar* gtk_rc_get_module_dir (void);
156 gchar* gtk_rc_get_im_module_path (void);
157 gchar* gtk_rc_get_im_module_file (void);
159 /* private functions/definitions */
161 GTK_RC_TOKEN_INVALID = G_TOKEN_LAST,
162 GTK_RC_TOKEN_INCLUDE,
165 GTK_RC_TOKEN_PRELIGHT,
166 GTK_RC_TOKEN_SELECTED,
167 GTK_RC_TOKEN_INSENSITIVE,
172 GTK_RC_TOKEN_XTHICKNESS,
173 GTK_RC_TOKEN_YTHICKNESS,
175 GTK_RC_TOKEN_FONTSET,
176 GTK_RC_TOKEN_FONT_NAME,
177 GTK_RC_TOKEN_BG_PIXMAP,
178 GTK_RC_TOKEN_PIXMAP_PATH,
180 GTK_RC_TOKEN_BINDING,
183 GTK_RC_TOKEN_WIDGET_CLASS,
187 GTK_RC_TOKEN_APPLICATION,
190 GTK_RC_TOKEN_HIGHEST,
192 GTK_RC_TOKEN_MODULE_PATH,
193 GTK_RC_TOKEN_IM_MODULE_PATH,
194 GTK_RC_TOKEN_IM_MODULE_FILE,
201 GScanner* gtk_rc_scanner_new (void);
202 guint gtk_rc_parse_color (GScanner *scanner,
204 guint gtk_rc_parse_state (GScanner *scanner,
205 GtkStateType *state);
206 guint gtk_rc_parse_priority (GScanner *scanner,
207 GtkPathPriorityType *priority);
211 * (structure forward declared in gtkstyle.h)
213 struct _GtkRcProperty
215 /* quark-ified property identifier like "GtkScrollbar::spacing" */
217 GQuark property_name;
219 /* fields similar to GtkSettingsValue */
223 const GtkRcProperty* _gtk_rc_style_lookup_rc_property (GtkRcStyle *rc_style,
225 GQuark property_name);
228 gchar* gtk_win32_get_installation_directory (void);
234 #endif /* __cplusplus */
237 #endif /* __GTK_RC_H__ */