Ardour  8.7-14-g57a6773833
gtksettings.h
Go to the documentation of this file.
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 2000 Red Hat, Inc.
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 Free
16  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  */
18 
19 #ifndef __GTK_SETTINGS_H__
20 #define __GTK_SETTINGS_H__
21 
22 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
23 #error "Only <gtk/gtk.h> can be included directly."
24 #endif
25 
26 #include <gtk/gtkrc.h>
27 
28 G_BEGIN_DECLS
29 
30 
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))
38 
39 
40 /* --- typedefs --- */
41 typedef struct _GtkSettingsClass GtkSettingsClass;
42 typedef struct _GtkSettingsValue GtkSettingsValue;
43 typedef struct _GtkSettingsPropertyValue GtkSettingsPropertyValue; /* Internal */
44 
45 
46 /* --- structures --- */
48 {
49  GObject parent_instance;
50 
51  GData *GSEAL (queued_settings); /* of type GtkSettingsValue* */
52  GtkSettingsPropertyValue *GSEAL (property_values);
53 
54  GtkRcContext *GSEAL (rc_context);
55  GdkScreen *GSEAL (screen);
56 };
57 
59 {
60  GObjectClass parent_class;
61 };
62 
64 {
65  /* origin should be something like "filename:linenumber" for rc files,
66  * or e.g. "XProperty" for other sources
67  */
68  gchar *origin;
69 
70  /* valid types are LONG, DOUBLE and STRING corresponding to the token parsed,
71  * or a GSTRING holding an unparsed statement
72  */
73  GValue value;
74 };
75 
76 
77 /* --- functions --- */
78 GType gtk_settings_get_type (void) G_GNUC_CONST;
79 #ifndef GDK_MULTIHEAD_SAFE
81 #endif
83 
84 void gtk_settings_install_property (GParamSpec *pspec);
85 void gtk_settings_install_property_parser (GParamSpec *pspec,
86  GtkRcPropertyParser parser);
87 
88 /* --- precoded parsing functions --- */
89 gboolean gtk_rc_property_parse_color (const GParamSpec *pspec,
90  const GString *gstring,
91  GValue *property_value);
92 gboolean gtk_rc_property_parse_enum (const GParamSpec *pspec,
93  const GString *gstring,
94  GValue *property_value);
95 gboolean gtk_rc_property_parse_flags (const GParamSpec *pspec,
96  const GString *gstring,
97  GValue *property_value);
98 gboolean gtk_rc_property_parse_requisition (const GParamSpec *pspec,
99  const GString *gstring,
100  GValue *property_value);
101 gboolean gtk_rc_property_parse_border (const GParamSpec *pspec,
102  const GString *gstring,
103  GValue *property_value);
104 
105 /*< private >*/
107  const gchar *name,
108  const GtkSettingsValue *svalue);
110  const gchar *name,
111  const gchar *v_string,
112  const gchar *origin);
114  const gchar *name,
115  glong v_long,
116  const gchar *origin);
118  const gchar *name,
119  gdouble v_double,
120  const gchar *origin);
121 
122 
123 /* implementation details */
125  const gchar *name,
126  const GtkSettingsValue *svalue);
128 
132  const GValue *src_value,
133  GParamSpec *pspec,
134  GValue *dest_value);
135 
136 
137 G_END_DECLS
138 
139 #endif /* __GTK_SETTINGS_H__ */
GtkImageIconNameData name
Definition: gtkimage.h:6
struct _GtkRcContext GtkRcContext
Definition: gtkrc.h:41
gboolean _gtk_settings_parse_convert(GtkRcPropertyParser parser, const GValue *src_value, GParamSpec *pspec, GValue *dest_value)
GtkSettings * gtk_settings_get_for_screen(GdkScreen *screen)
gboolean gtk_rc_property_parse_enum(const GParamSpec *pspec, const GString *gstring, GValue *property_value)
GtkSettings * gtk_settings_get_default(void)
gboolean gtk_rc_property_parse_requisition(const GParamSpec *pspec, const GString *gstring, GValue *property_value)
void gtk_settings_set_long_property(GtkSettings *settings, const gchar *name, glong v_long, const gchar *origin)
void _gtk_settings_set_property_value_from_rc(GtkSettings *settings, const gchar *name, const GtkSettingsValue *svalue)
void gtk_settings_install_property(GParamSpec *pspec)
void _gtk_settings_handle_event(GdkEventSetting *event)
gboolean gtk_rc_property_parse_flags(const GParamSpec *pspec, const GString *gstring, GValue *property_value)
void gtk_settings_set_string_property(GtkSettings *settings, const gchar *name, const gchar *v_string, const gchar *origin)
gboolean gtk_rc_property_parse_color(const GParamSpec *pspec, const GString *gstring, GValue *property_value)
gboolean gtk_rc_property_parse_border(const GParamSpec *pspec, const GString *gstring, GValue *property_value)
void gtk_settings_install_property_parser(GParamSpec *pspec, GtkRcPropertyParser parser)
void _gtk_settings_reset_rc_values(GtkSettings *settings)
void gtk_settings_set_double_property(GtkSettings *settings, const gchar *name, gdouble v_double, const gchar *origin)
struct _GtkSettingsPropertyValue GtkSettingsPropertyValue
Definition: gtksettings.h:43
void gtk_settings_set_property_value(GtkSettings *settings, const gchar *name, const GtkSettingsValue *svalue)
GtkRcPropertyParser _gtk_rc_property_parser_from_type(GType type)
GType gtk_settings_get_type(void) G_GNUC_CONST
gboolean(* GtkRcPropertyParser)(const GParamSpec *pspec, const GString *rc_string, GValue *property_value)
Definition: gtkstyle.h:62
#define svalue(o)
Definition: lobject.h:333
GObjectClass parent_class
Definition: gtksettings.h:60
GObject parent_instance
Definition: gtksettings.h:49
GtkSettingsPropertyValue * GSEAL(property_values)
GData * GSEAL(queued_settings)
GdkScreen * GSEAL(screen)
GtkRcContext * GSEAL(rc_context)