Ardour  9.0-pre0-582-g084a23a80d
gtkrc.h
Go to the documentation of this file.
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 #ifndef __GTK_RC_H__
28 #define __GTK_RC_H__
29 
30 
31 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
32 #error "Only <gtk/gtk.h> can be included directly."
33 #endif
34 
35 #include <gtk/gtkstyle.h>
36 
37 G_BEGIN_DECLS
38 
39 /* Forward declarations */
40 typedef struct _GtkIconFactory GtkIconFactory;
41 typedef struct _GtkRcContext GtkRcContext;
42 
43 typedef struct _GtkRcStyleClass GtkRcStyleClass;
44 
45 #define GTK_TYPE_RC_STYLE (gtk_rc_style_get_type ())
46 #define GTK_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_RC_STYLE, GtkRcStyle))
47 #define GTK_RC_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_RC_STYLE, GtkRcStyleClass))
48 #define GTK_IS_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_RC_STYLE))
49 #define GTK_IS_RC_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RC_STYLE))
50 #define GTK_RC_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_RC_STYLE, GtkRcStyleClass))
51 
52 typedef enum
53 {
54  GTK_RC_FG = 1 << 0,
55  GTK_RC_BG = 1 << 1,
56  GTK_RC_TEXT = 1 << 2,
57  GTK_RC_BASE = 1 << 3
59 
61 {
62  GObject parent_instance;
63 
64  /*< public >*/
65 
66  gchar *name;
67  gchar *bg_pixmap_name[5];
68  PangoFontDescription *font_desc;
69 
75 
76  gint xthickness;
77  gint ythickness;
78 
79  /*< private >*/
80  GArray *rc_properties;
81 
82  /* list of RC style lists including this RC style */
83  GSList *rc_style_lists;
84 
85  GSList *icon_factories;
86 
87  guint engine_specified : 1; /* The RC file specified the engine */
88 };
89 
91 {
92  GObjectClass parent_class;
93 
94  /* Create an empty RC style of the same type as this RC style.
95  * The default implementation, which does
96  * g_object_new (G_OBJECT_TYPE (style), NULL);
97  * should work in most cases.
98  */
99  GtkRcStyle * (*create_rc_style) (GtkRcStyle *rc_style);
100 
101  /* Fill in engine specific parts of GtkRcStyle by parsing contents
102  * of brackets. Returns G_TOKEN_NONE if successful, otherwise returns
103  * the token it expected but didn't get.
104  */
105  guint (*parse) (GtkRcStyle *rc_style,
106  GtkSettings *settings,
107  GScanner *scanner);
108 
109  /* Combine RC style data from src into dest. If overridden, this
110  * function should chain to the parent.
111  */
112  void (*merge) (GtkRcStyle *dest,
113  GtkRcStyle *src);
114 
115  /* Create an empty style suitable to this RC style
116  */
117  GtkStyle * (*create_style) (GtkRcStyle *rc_style);
118 
119  /* Padding for future expansion */
120  void (*_gtk_reserved1) (void);
121  void (*_gtk_reserved2) (void);
122  void (*_gtk_reserved3) (void);
123  void (*_gtk_reserved4) (void);
124 };
125 
126 #ifdef G_OS_WIN32
127 /* Reserve old names for DLL ABI backward compatibility */
128 #define gtk_rc_parse gtk_rc_parse_utf8
129 #endif
130 
131 void _gtk_rc_init (void);
132 GSList* _gtk_rc_parse_widget_class_path (const gchar *pattern);
133 void _gtk_rc_free_widget_class_path (GSList *list);
134 gboolean _gtk_rc_match_widget_class (GSList *list,
135  gint length,
136  gchar *path,
137  gchar *path_reversed);
138 
141  const char *widget_path,
142  const char *class_path,
143  GType type);
144 
146  gboolean force_load);
148 
150  GScanner *scanner,
151  const gchar *pixmap_file);
152 
153 void gtk_rc_parse (const gchar *filename);
154 void gtk_rc_parse_string (const gchar *rc_string);
155 gboolean gtk_rc_reparse_all (void);
156 
157 #ifndef GTK_DISABLE_DEPRECATED
159  const gchar *pattern);
161  const gchar *pattern);
163  const gchar *pattern);
164 #endif /* GTK_DISABLE_DEPRECATED */
165 
166 
167 GType gtk_rc_style_get_type (void) G_GNUC_CONST;
170 
171 #ifndef GTK_DISABLE_DEPRECATED
172 void gtk_rc_style_ref (GtkRcStyle *rc_style);
174 #endif
175 
176 gchar* gtk_rc_find_module_in_path (const gchar *module_file);
177 gchar* gtk_rc_get_module_dir (void);
180 
181 /* private functions/definitions */
182 typedef enum {
183  GTK_RC_TOKEN_INVALID = G_TOKEN_LAST,
224 
225 GScanner* gtk_rc_scanner_new (void);
226 guint gtk_rc_parse_color (GScanner *scanner,
227  GdkColor *color);
228 guint gtk_rc_parse_color_full (GScanner *scanner,
229  GtkRcStyle *style,
230  GdkColor *color);
231 guint gtk_rc_parse_state (GScanner *scanner,
232  GtkStateType *state);
233 guint gtk_rc_parse_priority (GScanner *scanner,
234  GtkPathPriorityType *priority);
235 
236 /* rc properties
237  * (structure forward declared in gtkstyle.h)
238  */
240 {
241  /* quark-ified property identifier like "GtkScrollbar::spacing" */
242  GQuark type_name;
244 
245  /* fields similar to GtkSettingsValue */
246  gchar *origin;
247  GValue value;
248 };
250  GQuark type_name,
251  GQuark property_name);
253  GtkRcProperty *property);
255  GQuark type_name,
256  GQuark property_name);
257 
259 
262 
263 G_END_DECLS
264 
265 #endif /* __GTK_RC_H__ */
GtkStateType
Definition: gtkenums.h:400
GtkPathPriorityType
Definition: gtkenums.h:286
guint gtk_rc_parse_color(GScanner *scanner, GdkColor *color)
void gtk_rc_parse(const gchar *filename)
GtkRcStyle * gtk_rc_style_new(void)
const GtkRcProperty * _gtk_rc_style_lookup_rc_property(GtkRcStyle *rc_style, GQuark type_name, GQuark property_name)
void _gtk_rc_free_widget_class_path(GSList *list)
const gchar * _gtk_rc_context_get_default_font_name(GtkSettings *settings)
GtkRcStyle * gtk_rc_style_copy(GtkRcStyle *orig)
void gtk_rc_style_unref(GtkRcStyle *rc_style)
gchar * gtk_rc_get_im_module_path(void)
GtkRcFlags
Definition: gtkrc.h:53
@ GTK_RC_BASE
Definition: gtkrc.h:57
@ GTK_RC_TEXT
Definition: gtkrc.h:56
@ GTK_RC_FG
Definition: gtkrc.h:54
@ GTK_RC_BG
Definition: gtkrc.h:55
void gtk_rc_reset_styles(GtkSettings *settings)
void gtk_rc_parse_string(const gchar *rc_string)
GScanner * gtk_rc_scanner_new(void)
GtkStyle * gtk_rc_get_style(GtkWidget *widget)
struct _GtkRcContext GtkRcContext
Definition: gtkrc.h:41
void _gtk_rc_style_unset_rc_property(GtkRcStyle *rc_style, GQuark type_name, GQuark property_name)
void _gtk_rc_init(void)
gboolean gtk_rc_reparse_all_for_settings(GtkSettings *settings, gboolean force_load)
GtkRcTokenType
Definition: gtkrc.h:182
@ GTK_RC_TOKEN_YTHICKNESS
Definition: gtkrc.h:195
@ GTK_RC_TOKEN_BASE
Definition: gtkrc.h:193
@ GTK_RC_TOKEN_UNBIND
Definition: gtkrc.h:221
@ GTK_RC_TOKEN_LAST
Definition: gtkrc.h:222
@ GTK_RC_TOKEN_WIDGET_CLASS
Definition: gtkrc.h:205
@ GTK_RC_TOKEN_ACTIVE
Definition: gtkrc.h:186
@ GTK_RC_TOKEN_INCLUDE
Definition: gtkrc.h:184
@ GTK_RC_TOKEN_BIND
Definition: gtkrc.h:203
@ GTK_RC_TOKEN_LTR
Definition: gtkrc.h:218
@ GTK_RC_TOKEN_IM_MODULE_FILE
Definition: gtkrc.h:216
@ GTK_RC_TOKEN_INSENSITIVE
Definition: gtkrc.h:189
@ GTK_RC_TOKEN_BG
Definition: gtkrc.h:191
@ GTK_RC_TOKEN_BINDING
Definition: gtkrc.h:202
@ GTK_RC_TOKEN_FONT_NAME
Definition: gtkrc.h:198
@ GTK_RC_TOKEN_GTK
Definition: gtkrc.h:208
@ GTK_RC_TOKEN_LOWEST
Definition: gtkrc.h:207
@ GTK_RC_TOKEN_STYLE
Definition: gtkrc.h:201
@ GTK_RC_TOKEN_MODULE_PATH
Definition: gtkrc.h:214
@ GTK_RC_TOKEN_CLASS
Definition: gtkrc.h:206
@ GTK_RC_TOKEN_RC
Definition: gtkrc.h:211
@ GTK_RC_TOKEN_APPLICATION
Definition: gtkrc.h:209
@ GTK_RC_TOKEN_ENGINE
Definition: gtkrc.h:213
@ GTK_RC_TOKEN_XTHICKNESS
Definition: gtkrc.h:194
@ GTK_RC_TOKEN_WIDGET
Definition: gtkrc.h:204
@ GTK_RC_TOKEN_INVALID
Definition: gtkrc.h:183
@ GTK_RC_TOKEN_IM_MODULE_PATH
Definition: gtkrc.h:215
@ GTK_RC_TOKEN_SELECTED
Definition: gtkrc.h:188
@ GTK_RC_TOKEN_HIGHEST
Definition: gtkrc.h:212
@ GTK_RC_TOKEN_COLOR
Definition: gtkrc.h:220
@ GTK_RC_TOKEN_TEXT
Definition: gtkrc.h:192
@ GTK_RC_TOKEN_STOCK
Definition: gtkrc.h:217
@ GTK_RC_TOKEN_RTL
Definition: gtkrc.h:219
@ GTK_RC_TOKEN_FONTSET
Definition: gtkrc.h:197
@ GTK_RC_TOKEN_PIXMAP_PATH
Definition: gtkrc.h:200
@ GTK_RC_TOKEN_BG_PIXMAP
Definition: gtkrc.h:199
@ GTK_RC_TOKEN_FONT
Definition: gtkrc.h:196
@ GTK_RC_TOKEN_FG
Definition: gtkrc.h:190
@ GTK_RC_TOKEN_PRELIGHT
Definition: gtkrc.h:187
@ GTK_RC_TOKEN_NORMAL
Definition: gtkrc.h:185
@ GTK_RC_TOKEN_THEME
Definition: gtkrc.h:210
GSList * _gtk_rc_parse_widget_class_path(const gchar *pattern)
void gtk_rc_add_widget_name_style(GtkRcStyle *rc_style, const gchar *pattern)
gboolean gtk_rc_reparse_all(void)
guint gtk_rc_parse_color_full(GScanner *scanner, GtkRcStyle *style, GdkColor *color)
void gtk_rc_add_widget_class_style(GtkRcStyle *rc_style, const gchar *pattern)
void gtk_rc_style_ref(GtkRcStyle *rc_style)
void _gtk_rc_style_set_rc_property(GtkRcStyle *rc_style, GtkRcProperty *property)
GType gtk_rc_style_get_type(void) G_GNUC_CONST
gchar * gtk_rc_find_pixmap_in_path(GtkSettings *settings, GScanner *scanner, const gchar *pixmap_file)
void gtk_rc_add_class_style(GtkRcStyle *rc_style, const gchar *pattern)
GSList * _gtk_rc_style_get_color_hashes(GtkRcStyle *rc_style)
GtkStyle * gtk_rc_get_style_by_paths(GtkSettings *settings, const char *widget_path, const char *class_path, GType type)
guint gtk_rc_parse_priority(GScanner *scanner, GtkPathPriorityType *priority)
typedefG_BEGIN_DECLS struct _GtkIconFactory GtkIconFactory
Definition: gtkrc.h:40
gchar * gtk_rc_get_module_dir(void)
void _gtk_rc_context_destroy(GtkSettings *settings)
gchar * gtk_rc_find_module_in_path(const gchar *module_file)
gboolean _gtk_rc_match_widget_class(GSList *list, gint length, gchar *path, gchar *path_reversed)
gchar * gtk_rc_get_im_module_file(void)
guint gtk_rc_parse_state(GScanner *scanner, GtkStateType *state)
PBD::PropertyDescriptor< uint32_t > color
PBD::PropertyDescriptor< timecnt_t > length
GValue value
Definition: gtkrc.h:247
GQuark type_name
Definition: gtkrc.h:242
GQuark property_name
Definition: gtkrc.h:243
gchar * origin
Definition: gtkrc.h:246
void(* _gtk_reserved1)(void)
Definition: gtkrc.h:120
void(* _gtk_reserved2)(void)
Definition: gtkrc.h:121
void(* _gtk_reserved4)(void)
Definition: gtkrc.h:123
void(* _gtk_reserved3)(void)
Definition: gtkrc.h:122
GObjectClass parent_class
Definition: gtkrc.h:92
void(* merge)(GtkRcStyle *dest, GtkRcStyle *src)
Definition: gtkrc.h:112
guint(* parse)(GtkRcStyle *rc_style, GtkSettings *settings, GScanner *scanner)
Definition: gtkrc.h:105
gint ythickness
Definition: gtkrc.h:77
PangoFontDescription * font_desc
Definition: gtkrc.h:68
gint xthickness
Definition: gtkrc.h:76
GArray * rc_properties
Definition: gtkrc.h:80
gchar * name
Definition: gtkrc.h:66
GdkColor base[5]
Definition: gtkrc.h:74
GtkRcFlags color_flags[5]
Definition: gtkrc.h:70
GSList * rc_style_lists
Definition: gtkrc.h:83
GdkColor fg[5]
Definition: gtkrc.h:71
GSList * icon_factories
Definition: gtkrc.h:85
GdkColor bg[5]
Definition: gtkrc.h:72
GdkColor text[5]
Definition: gtkrc.h:73
gchar * bg_pixmap_name[5]
Definition: gtkrc.h:67
guint engine_specified
Definition: gtkrc.h:87
GObject parent_instance
Definition: gtkrc.h:62