• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright © 2010 Codethink Limited
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.1 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, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __G_SETTINGS_SCHEMA_INTERNAL_H__
19 #define __G_SETTINGS_SCHEMA_INTERNAL_H__
20 
21 #include "gsettingsschema.h"
22 
23 struct _GSettingsSchemaKey
24 {
25   GSettingsSchema *schema;
26   const gchar *name;
27 
28   guint is_flags : 1;
29   guint is_enum  : 1;
30 
31   const guint32 *strinfo;
32   gsize strinfo_length;
33 
34   const gchar *unparsed;
35   gchar lc_char;
36 
37   const GVariantType *type;
38   GVariant *minimum, *maximum;
39   GVariant *default_value;
40   GVariant *desktop_overrides;
41 
42   gint ref_count;
43 };
44 
45 const gchar *           g_settings_schema_get_gettext_domain            (GSettingsSchema  *schema);
46 GVariantIter *          g_settings_schema_get_value                     (GSettingsSchema  *schema,
47                                                                          const gchar      *key);
48 const GQuark *          g_settings_schema_list                          (GSettingsSchema  *schema,
49                                                                          gint             *n_items);
50 const gchar *           g_settings_schema_get_string                    (GSettingsSchema  *schema,
51                                                                          const gchar      *key);
52 
53 void                    g_settings_schema_key_init                      (GSettingsSchemaKey *key,
54                                                                          GSettingsSchema    *schema,
55                                                                          const gchar        *name);
56 void                    g_settings_schema_key_clear                     (GSettingsSchemaKey *key);
57 gboolean                g_settings_schema_key_type_check                (GSettingsSchemaKey *key,
58                                                                          GVariant           *value);
59 GVariant *              g_settings_schema_key_range_fixup               (GSettingsSchemaKey *key,
60                                                                          GVariant           *value);
61 GVariant *              g_settings_schema_key_get_translated_default    (GSettingsSchemaKey *key);
62 GVariant *              g_settings_schema_key_get_per_desktop_default   (GSettingsSchemaKey *key);
63 
64 gint                    g_settings_schema_key_to_enum                   (GSettingsSchemaKey *key,
65                                                                          GVariant           *value);
66 GVariant *              g_settings_schema_key_from_enum                 (GSettingsSchemaKey *key,
67                                                                          gint                value);
68 guint                   g_settings_schema_key_to_flags                  (GSettingsSchemaKey *key,
69                                                                          GVariant           *value);
70 GVariant *              g_settings_schema_key_from_flags                (GSettingsSchemaKey *key,
71                                                                          guint               value);
72 
73 #endif /* __G_SETTINGS_SCHEMA_INTERNAL_H__ */
74