Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: gconf/config.c

Issue 2860022: Add api to ibus for retreiving unused config values. (Closed) Base URL: ssh://gitrw.chromium.org/ibus.git
Patch Set: Code review changes Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ibus/config.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* vim:set et sts=4: */ 1 /* vim:set et sts=4: */
2 2
3 #include <string.h> 3 #include <string.h>
4 #include <ibus.h> 4 #include <ibus.h>
5 #include "config.h" 5 #include "config.h"
6 6
7 #define GCONF_PREFIX "/desktop/ibus" 7 #define GCONF_PREFIX "/desktop/ibus"
8 8
9 /* functions prototype */ 9 /* functions prototype */
10 static void ibus_config_gconf_class_init (IBusConfigGConfClass *klass); 10 static void ibus_config_gconf_class_init (IBusConfigGConfClass *klass);
11 static void ibus_config_gconf_init (IBusConfigGConf *config); 11 static void ibus_config_gconf_init (IBusConfigGConf *config);
12 static void ibus_config_gconf_destroy (IBusConfigGConf *config); 12 static void ibus_config_gconf_destroy (IBusConfigGConf *config);
13 static gboolean ibus_config_gconf_set_value (IBusConfigService *con fig, 13 static gboolean ibus_config_gconf_set_value (IBusConfigService *con fig,
14 const gchar *sec tion, 14 const gchar *sec tion,
15 const gchar *nam e, 15 const gchar *nam e,
16 const GValue *val ue, 16 const GValue *val ue,
17 IBusError **err or); 17 IBusError **err or);
18 static gboolean ibus_config_gconf_get_value (IBusConfigService *con fig, 18 static gboolean ibus_config_gconf_get_value (IBusConfigService *con fig,
19 const gchar *sec tion, 19 const gchar *sec tion,
20 const gchar *nam e, 20 const gchar *nam e,
21 GValue *val ue, 21 GValue *val ue,
22 IBusError **err or); 22 IBusError **err or);
23 static gboolean ibus_config_gconf_unset (IBusConfigService *config, 23 static gboolean ibus_config_gconf_unset (IBusConfigService *config,
24 const gchar *section , 24 const gchar *section ,
25 const gchar *name, 25 const gchar *name,
26 IBusError **error); 26 IBusError **error);
27 static gboolean ibus_config_gconf_get_unused (IBusConfigService *con fig,
28 GValue *unr ead,
29 GValue *unw ritten,
30 IBusError **err or);
27 31
28 static GConfValue *_to_gconf_value (const GValue *val ue); 32 static GConfValue *_to_gconf_value (const GValue *val ue);
29 static void _from_gconf_value (GValue *val ue, 33 static void _from_gconf_value (GValue *val ue,
30 const GConfValue *gva lue); 34 const GConfValue *gva lue);
31 35
32 static IBusConfigServiceClass *parent_class = NULL; 36 static IBusConfigServiceClass *parent_class = NULL;
33 37
34 GType 38 GType
35 ibus_config_gconf_get_type (void) 39 ibus_config_gconf_get_type (void)
36 { 40 {
(...skipping 25 matching lines...) Expand all
62 ibus_config_gconf_class_init (IBusConfigGConfClass *klass) 66 ibus_config_gconf_class_init (IBusConfigGConfClass *klass)
63 { 67 {
64 GObjectClass *object_class = G_OBJECT_CLASS (klass); 68 GObjectClass *object_class = G_OBJECT_CLASS (klass);
65 69
66 parent_class = (IBusConfigServiceClass *) g_type_class_peek_parent (klass); 70 parent_class = (IBusConfigServiceClass *) g_type_class_peek_parent (klass);
67 71
68 IBUS_OBJECT_CLASS (object_class)->destroy = (IBusObjectDestroyFunc) ibus _config_gconf_destroy; 72 IBUS_OBJECT_CLASS (object_class)->destroy = (IBusObjectDestroyFunc) ibus _config_gconf_destroy;
69 IBUS_CONFIG_SERVICE_CLASS (object_class)->set_value = ibus_config_gconf_set_ value; 73 IBUS_CONFIG_SERVICE_CLASS (object_class)->set_value = ibus_config_gconf_set_ value;
70 IBUS_CONFIG_SERVICE_CLASS (object_class)->get_value = ibus_config_gconf_get_ value; 74 IBUS_CONFIG_SERVICE_CLASS (object_class)->get_value = ibus_config_gconf_get_ value;
71 IBUS_CONFIG_SERVICE_CLASS (object_class)->unset = ibus_config_gconf_unset; 75 IBUS_CONFIG_SERVICE_CLASS (object_class)->unset = ibus_config_gconf_unset;
76 IBUS_CONFIG_SERVICE_CLASS (object_class)->get_unused = ibus_config_gconf_get _unused;
72 } 77 }
73 78
74 static void 79 static void
75 _value_changed_cb (GConfClient *client, 80 _value_changed_cb (GConfClient *client,
76 const gchar *key, 81 const gchar *key,
77 GConfValue *value, 82 GConfValue *value,
78 IBusConfigGConf *config) 83 IBusConfigGConf *config)
79 { 84 {
80 gchar *p, *section, *name; 85 gchar *p, *section, *name;
81 GValue v = { 0 }; 86 GValue v = { 0 };
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 if (error) { 329 if (error) {
325 *error = ibus_error_new_from_text (DBUS_ERROR_FAILED, gerror->messag e); 330 *error = ibus_error_new_from_text (DBUS_ERROR_FAILED, gerror->messag e);
326 g_error_free (gerror); 331 g_error_free (gerror);
327 } 332 }
328 return FALSE; 333 return FALSE;
329 } 334 }
330 335
331 return TRUE; 336 return TRUE;
332 } 337 }
333 338
339 static gboolean
340 ibus_config_gconf_get_unused (IBusConfigService *config,
341 GValue *unread,
342 GValue *unwritten,
343 IBusError **error) {
344 *error = ibus_error_new_from_printf(
345 DBUS_ERROR_FAILED, "get_unused: Not implemented.");
346 return FALSE;
347 }
348
334 IBusConfigGConf * 349 IBusConfigGConf *
335 ibus_config_gconf_new (IBusConnection *connection) 350 ibus_config_gconf_new (IBusConnection *connection)
336 { 351 {
337 IBusConfigGConf *config; 352 IBusConfigGConf *config;
338 353
339 config = (IBusConfigGConf *) g_object_new (IBUS_TYPE_CONFIG_GCONF, 354 config = (IBusConfigGConf *) g_object_new (IBUS_TYPE_CONFIG_GCONF,
340 "path", IBUS_PATH_CONFIG, 355 "path", IBUS_PATH_CONFIG,
341 "connection", connection, 356 "connection", connection,
342 NULL); 357 NULL);
343 return config; 358 return config;
344 } 359 }
OLDNEW
« no previous file with comments | « no previous file | ibus/config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698