]> Pileus Git - ~andy/gtk/blob - gtk/deprecated/gtkrc.h
Move wholly deprecated files to a subdirectory
[~andy/gtk] / gtk / deprecated / 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 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.
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  * Lesser General Public License for more details.
13  *
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.
18  */
19
20 /*
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/.
25  */
26
27 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
28 #error "Only <gtk/gtk.h> can be included directly."
29 #endif
30
31 #ifndef __GTK_RC_H__
32 #define __GTK_RC_H__
33
34 #include <gtk/gtkwidget.h>
35
36 G_BEGIN_DECLS
37
38 /* Forward declarations */
39 typedef struct _GtkRcContext    GtkRcContext;
40 typedef struct _GtkRcStyleClass GtkRcStyleClass;
41
42 #define GTK_TYPE_RC_STYLE              (gtk_rc_style_get_type ())
43 #define GTK_RC_STYLE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_RC_STYLE, GtkRcStyle))
44 #define GTK_RC_STYLE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_RC_STYLE, GtkRcStyleClass))
45 #define GTK_IS_RC_STYLE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_RC_STYLE))
46 #define GTK_IS_RC_STYLE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RC_STYLE))
47 #define GTK_RC_STYLE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_RC_STYLE, GtkRcStyleClass))
48
49 typedef enum
50 {
51   GTK_RC_FG             = 1 << 0,
52   GTK_RC_BG             = 1 << 1,
53   GTK_RC_TEXT           = 1 << 2,
54   GTK_RC_BASE           = 1 << 3
55 } GtkRcFlags;
56
57 /**
58  * GtkRcStyle:
59  * @name:
60  * @bg_pixmap_name:
61  * @font_desc:
62  * @color_flags:
63  * @fg:
64  * @bg:
65  * @text:
66  * @base:
67  * @xthickness:
68  * @ythickness:
69  *
70  * The #GtkRcStyle structure is used to represent a set
71  * of information about the appearance of a widget.
72  * This can later be composited together with other
73  * #GtkRcStyle structures to form a #GtkStyle.
74  */
75 struct _GtkRcStyle
76 {
77   GObject parent_instance;
78
79   /*< public >*/
80
81   gchar *name;
82   gchar *bg_pixmap_name[5];
83   PangoFontDescription *font_desc;
84
85   GtkRcFlags color_flags[5];
86   GdkColor   fg[5];
87   GdkColor   bg[5];
88   GdkColor   text[5];
89   GdkColor   base[5];
90
91   gint xthickness;
92   gint ythickness;
93
94   /*< private >*/
95   GArray *rc_properties;
96
97   /* list of RC style lists including this RC style */
98   GSList *rc_style_lists;
99
100   GSList *icon_factories;
101
102   guint engine_specified : 1;   /* The RC file specified the engine */
103 };
104
105 struct _GtkRcStyleClass
106 {
107   GObjectClass parent_class;
108
109   /* Create an empty RC style of the same type as this RC style.
110    * The default implementation, which does
111    * g_object_new (G_OBJECT_TYPE (style), NULL);
112    * should work in most cases.
113    */
114   GtkRcStyle * (*create_rc_style) (GtkRcStyle *rc_style);
115
116   /* Fill in engine specific parts of GtkRcStyle by parsing contents
117    * of brackets. Returns G_TOKEN_NONE if successful, otherwise returns
118    * the token it expected but didn't get.
119    */
120   guint     (*parse)  (GtkRcStyle   *rc_style,
121                        GtkSettings  *settings,
122                        GScanner     *scanner);
123
124   /* Combine RC style data from src into dest. If overridden, this
125    * function should chain to the parent.
126    */
127   void      (*merge)  (GtkRcStyle *dest,
128                        GtkRcStyle *src);
129
130   /* Create an empty style suitable to this RC style
131    */
132   GtkStyle * (*create_style) (GtkRcStyle *rc_style);
133
134   /* Padding for future expansion */
135   void (*_gtk_reserved1) (void);
136   void (*_gtk_reserved2) (void);
137   void (*_gtk_reserved3) (void);
138   void (*_gtk_reserved4) (void);
139 };
140
141 GSList*   _gtk_rc_parse_widget_class_path (const gchar *pattern);
142 void      _gtk_rc_free_widget_class_path (GSList       *list);
143 gboolean  _gtk_rc_match_widget_class     (GSList       *list,
144                                           gint          length,
145                                           gchar        *path,
146                                           gchar        *path_reversed);
147
148 GDK_DEPRECATED_FOR(GtkStyleContext)
149 void      gtk_rc_add_default_file       (const gchar *filename);
150 GDK_DEPRECATED_FOR(GtkStyleContext)
151 void      gtk_rc_set_default_files      (gchar **filenames);
152 GDK_DEPRECATED_FOR(GtkStyleContext)
153 gchar**   gtk_rc_get_default_files      (void);
154 GDK_DEPRECATED_FOR(GtkStyleContext)
155 GtkStyle* gtk_rc_get_style              (GtkWidget   *widget);
156 GDK_DEPRECATED_FOR(GtkStyleContext)
157 GtkStyle* gtk_rc_get_style_by_paths     (GtkSettings *settings,
158                                          const char  *widget_path,
159                                          const char  *class_path,
160                                          GType        type);
161
162 GDK_DEPRECATED_FOR(GtkStyleContext)
163 gboolean gtk_rc_reparse_all_for_settings (GtkSettings *settings,
164                                           gboolean     force_load);
165 GDK_DEPRECATED_FOR(GtkStyleContext)
166 void     gtk_rc_reset_styles             (GtkSettings *settings);
167
168 GDK_DEPRECATED_FOR(GtkStyleContext)
169 gchar*   gtk_rc_find_pixmap_in_path (GtkSettings  *settings,
170                                      GScanner     *scanner,
171                                      const gchar  *pixmap_file);
172
173 GDK_DEPRECATED_FOR(GtkStyleContext)
174 void     gtk_rc_parse                   (const gchar *filename);
175 GDK_DEPRECATED_FOR(GtkStyleContext)
176 void      gtk_rc_parse_string           (const gchar *rc_string);
177 GDK_DEPRECATED_FOR(GtkStyleContext)
178 gboolean  gtk_rc_reparse_all            (void);
179
180 GType       gtk_rc_style_get_type   (void) G_GNUC_CONST;
181 GDK_DEPRECATED_FOR(GtkStyleContext)
182 GtkRcStyle* gtk_rc_style_new        (void);
183 GDK_DEPRECATED_FOR(GtkStyleContext)
184 GtkRcStyle* gtk_rc_style_copy       (GtkRcStyle *orig);
185
186 GDK_DEPRECATED_FOR(GtkStyleContext)
187 gchar*      gtk_rc_find_module_in_path (const gchar *module_file);
188 GDK_DEPRECATED_FOR(GtkStyleContext)
189 gchar*      gtk_rc_get_theme_dir       (void);
190 GDK_DEPRECATED_FOR(GtkStyleContext)
191 gchar*      gtk_rc_get_module_dir      (void);
192 GDK_DEPRECATED_FOR(GtkStyleContext)
193 gchar*      gtk_rc_get_im_module_path  (void);
194 GDK_DEPRECATED_FOR(GtkStyleContext)
195 gchar*      gtk_rc_get_im_module_file  (void);
196
197 /* private functions/definitions */
198
199 /**
200  * GtkRcTokenType:
201  * @GTK_RC_TOKEN_INVALID:
202  * @GTK_RC_TOKEN_INCLUDE:
203  * @GTK_RC_TOKEN_NORMAL:
204  * @GTK_RC_TOKEN_ACTIVE:
205  * @GTK_RC_TOKEN_PRELIGHT:
206  * @GTK_RC_TOKEN_SELECTED:
207  * @GTK_RC_TOKEN_INSENSITIVE:
208  * @GTK_RC_TOKEN_FG:
209  * @GTK_RC_TOKEN_BG:
210  * @GTK_RC_TOKEN_TEXT:
211  * @GTK_RC_TOKEN_BASE:
212  * @GTK_RC_TOKEN_XTHICKNESS:
213  * @GTK_RC_TOKEN_YTHICKNESS:
214  * @GTK_RC_TOKEN_FONT:
215  * @GTK_RC_TOKEN_FONTSET:
216  * @GTK_RC_TOKEN_FONT_NAME:
217  * @GTK_RC_TOKEN_BG_PIXMAP:
218  * @GTK_RC_TOKEN_PIXMAP_PATH:
219  * @GTK_RC_TOKEN_STYLE:
220  * @GTK_RC_TOKEN_BINDING:
221  * @GTK_RC_TOKEN_BIND:
222  * @GTK_RC_TOKEN_WIDGET:
223  * @GTK_RC_TOKEN_WIDGET_CLASS:
224  * @GTK_RC_TOKEN_CLASS:
225  * @GTK_RC_TOKEN_LOWEST:
226  * @GTK_RC_TOKEN_GTK:
227  * @GTK_RC_TOKEN_APPLICATION:
228  * @GTK_RC_TOKEN_THEME:
229  * @GTK_RC_TOKEN_RC:
230  * @GTK_RC_TOKEN_HIGHEST:
231  * @GTK_RC_TOKEN_ENGINE:
232  * @GTK_RC_TOKEN_MODULE_PATH:
233  * @GTK_RC_TOKEN_IM_MODULE_PATH:
234  * @GTK_RC_TOKEN_IM_MODULE_FILE:
235  * @GTK_RC_TOKEN_STOCK:
236  * @GTK_RC_TOKEN_LTR:
237  * @GTK_RC_TOKEN_RTL:
238  * @GTK_RC_TOKEN_COLOR:
239  * @GTK_RC_TOKEN_UNBIND:
240  * @GTK_RC_TOKEN_LAST:
241  *
242  * The #GtkRcTokenType enumeration represents the tokens
243  * in the RC file. It is exposed so that theme engines
244  * can reuse these tokens when parsing the theme-engine
245  * specific portions of a RC file.
246  *
247  * Deprecated: 3.0: Use #GtkCssProvider instead.
248  */
249 typedef enum {
250   GTK_RC_TOKEN_INVALID = G_TOKEN_LAST,
251   GTK_RC_TOKEN_INCLUDE,
252   GTK_RC_TOKEN_NORMAL,
253   GTK_RC_TOKEN_ACTIVE,
254   GTK_RC_TOKEN_PRELIGHT,
255   GTK_RC_TOKEN_SELECTED,
256   GTK_RC_TOKEN_INSENSITIVE,
257   GTK_RC_TOKEN_FG,
258   GTK_RC_TOKEN_BG,
259   GTK_RC_TOKEN_TEXT,
260   GTK_RC_TOKEN_BASE,
261   GTK_RC_TOKEN_XTHICKNESS,
262   GTK_RC_TOKEN_YTHICKNESS,
263   GTK_RC_TOKEN_FONT,
264   GTK_RC_TOKEN_FONTSET,
265   GTK_RC_TOKEN_FONT_NAME,
266   GTK_RC_TOKEN_BG_PIXMAP,
267   GTK_RC_TOKEN_PIXMAP_PATH,
268   GTK_RC_TOKEN_STYLE,
269   GTK_RC_TOKEN_BINDING,
270   GTK_RC_TOKEN_BIND,
271   GTK_RC_TOKEN_WIDGET,
272   GTK_RC_TOKEN_WIDGET_CLASS,
273   GTK_RC_TOKEN_CLASS,
274   GTK_RC_TOKEN_LOWEST,
275   GTK_RC_TOKEN_GTK,
276   GTK_RC_TOKEN_APPLICATION,
277   GTK_RC_TOKEN_THEME,
278   GTK_RC_TOKEN_RC,
279   GTK_RC_TOKEN_HIGHEST,
280   GTK_RC_TOKEN_ENGINE,
281   GTK_RC_TOKEN_MODULE_PATH,
282   GTK_RC_TOKEN_IM_MODULE_PATH,
283   GTK_RC_TOKEN_IM_MODULE_FILE,
284   GTK_RC_TOKEN_STOCK,
285   GTK_RC_TOKEN_LTR,
286   GTK_RC_TOKEN_RTL,
287   GTK_RC_TOKEN_COLOR,
288   GTK_RC_TOKEN_UNBIND,
289   GTK_RC_TOKEN_LAST
290 } GtkRcTokenType;
291
292 GDK_DEPRECATED_FOR(GtkStyleContext)
293 GScanner* gtk_rc_scanner_new    (void);
294 GDK_DEPRECATED_FOR(GtkStyleContext)
295 guint     gtk_rc_parse_color    (GScanner            *scanner,
296                                  GdkColor            *color);
297 GDK_DEPRECATED_FOR(GtkStyleContext)
298 guint     gtk_rc_parse_color_full (GScanner          *scanner,
299                                    GtkRcStyle        *style,
300                                    GdkColor          *color);
301 GDK_DEPRECATED_FOR(GtkStyleContext)
302 guint     gtk_rc_parse_state    (GScanner            *scanner,
303                                  GtkStateType        *state);
304 GDK_DEPRECATED_FOR(GtkStyleContext)
305 guint     gtk_rc_parse_priority (GScanner            *scanner,
306                                  GtkPathPriorityType *priority);
307
308 /* rc properties
309  * (structure forward declared in gtkstyle.h)
310  */
311 struct _GtkRcProperty
312 {
313   /* quark-ified property identifier like "GtkScrollbar::spacing" */
314   GQuark type_name;
315   GQuark property_name;
316
317   /* fields similar to GtkSettingsValue */
318   gchar *origin;
319   GValue value;
320 };
321
322 G_END_DECLS
323
324 #endif /* __GTK_RC_H__ */