1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 2000 Red Hat, Inc.
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 Free
16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
20 #error "Only <gtk/gtk.h> can be included directly."
23 #ifndef __GTK_SETTINGS_H__
24 #define __GTK_SETTINGS_H__
31 /* -- type macros --- */
32 #define GTK_TYPE_SETTINGS (gtk_settings_get_type ())
33 #define GTK_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SETTINGS, GtkSettings))
34 #define GTK_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SETTINGS, GtkSettingsClass))
35 #define GTK_IS_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SETTINGS))
36 #define GTK_IS_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SETTINGS))
37 #define GTK_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SETTINGS, GtkSettingsClass))
40 /* --- typedefs --- */
41 typedef struct _GtkSettings GtkSettings;
42 typedef struct _GtkSettingsPrivate GtkSettingsPrivate;
43 typedef struct _GtkSettingsClass GtkSettingsClass;
44 typedef struct _GtkSettingsValue GtkSettingsValue;
47 typedef gboolean (*GtkRcPropertyParser) (const GParamSpec *pspec,
48 const GString *rc_string,
49 GValue *property_value);
52 /* --- structures --- */
55 GObject parent_instance;
58 GtkSettingsPrivate *priv;
61 struct _GtkSettingsClass
63 GObjectClass parent_class;
65 /* Padding for future expansion */
66 void (*_gtk_reserved1) (void);
67 void (*_gtk_reserved2) (void);
68 void (*_gtk_reserved3) (void);
69 void (*_gtk_reserved4) (void);
72 struct _GtkSettingsValue
74 /* origin should be something like "filename:linenumber" for rc files,
75 * or e.g. "XProperty" for other sources
79 /* valid types are LONG, DOUBLE and STRING corresponding to the token parsed,
80 * or a GSTRING holding an unparsed statement
86 /* --- functions --- */
87 GType gtk_settings_get_type (void) G_GNUC_CONST;
88 #ifndef GDK_MULTIHEAD_SAFE
89 GtkSettings* gtk_settings_get_default (void);
91 GtkSettings* gtk_settings_get_for_screen (GdkScreen *screen);
93 void gtk_settings_install_property (GParamSpec *pspec);
94 void gtk_settings_install_property_parser (GParamSpec *pspec,
95 GtkRcPropertyParser parser);
97 /* --- precoded parsing functions --- */
98 gboolean gtk_rc_property_parse_color (const GParamSpec *pspec,
99 const GString *gstring,
100 GValue *property_value);
101 gboolean gtk_rc_property_parse_enum (const GParamSpec *pspec,
102 const GString *gstring,
103 GValue *property_value);
104 gboolean gtk_rc_property_parse_flags (const GParamSpec *pspec,
105 const GString *gstring,
106 GValue *property_value);
107 gboolean gtk_rc_property_parse_requisition (const GParamSpec *pspec,
108 const GString *gstring,
109 GValue *property_value);
110 gboolean gtk_rc_property_parse_border (const GParamSpec *pspec,
111 const GString *gstring,
112 GValue *property_value);
114 void gtk_settings_set_property_value (GtkSettings *settings,
116 const GtkSettingsValue *svalue);
117 void gtk_settings_set_string_property (GtkSettings *settings,
119 const gchar *v_string,
120 const gchar *origin);
121 void gtk_settings_set_long_property (GtkSettings *settings,
124 const gchar *origin);
125 void gtk_settings_set_double_property (GtkSettings *settings,
128 const gchar *origin);
133 #endif /* __GTK_SETTINGS_H__ */