summaryrefslogtreecommitdiff
path: root/src/wkb-ibus-config-eet.c
diff options
context:
space:
mode:
authorRobert Erickson <rerickso@jaguarlandrover.com>2014-10-13 11:24:01 -0700
committerEduardo Lima (Etrunko) <eduardo.lima@intel.com>2014-10-22 20:25:43 -0200
commit7b75c61b1fc2a8d49e10c141fdc255f83ef8da94 (patch)
tree12c47377f03fc2628050eda0ece7266f52b118b3 /src/wkb-ibus-config-eet.c
parent21db0338cd2a006e8abdf2e22688cdcc2d696f88 (diff)
downloadweekeyboard-7b75c61b1fc2a8d49e10c141fdc255f83ef8da94.tar.gz
weekeyboard-7b75c61b1fc2a8d49e10c141fdc255f83ef8da94.tar.bz2
weekeyboard-7b75c61b1fc2a8d49e10c141fdc255f83ef8da94.zip
Add access to ibus-config settings from the application.
Change-Id: Id9ad93d5d3f71226675cc65247f51d749442c15e Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
Diffstat (limited to 'src/wkb-ibus-config-eet.c')
-rw-r--r--src/wkb-ibus-config-eet.c55
1 files changed, 50 insertions, 5 deletions
diff --git a/src/wkb-ibus-config-eet.c b/src/wkb-ibus-config-eet.c
index 1ce0d80..ed0f8e9 100644
--- a/src/wkb-ibus-config-eet.c
+++ b/src/wkb-ibus-config-eet.c
@@ -1,5 +1,6 @@
/*
* Copyright © 2013 Intel Corporation
+ * Copyright © 2014 Jaguar Landrover
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -821,19 +822,63 @@ end:
Eina_Bool
wkb_ibus_config_eet_get_value(struct wkb_ibus_config_eet *config_eet, const char *section, const char *name, Eldbus_Message_Iter *reply)
{
- Eina_Bool ret = EINA_FALSE;
struct wkb_config_key *key;
if (!(key = _config_section_find_key(config_eet->ibus_config, section, name)))
{
ERR("Config key with id '%s' not found", name);
- goto end;
+ return EINA_FALSE;
}
- ret = wkb_config_key_get(key, reply);
+ return wkb_config_key_get(key, reply);
+}
-end:
- return ret;
+int
+wkb_ibus_config_eet_get_value_int(struct wkb_ibus_config_eet *config_eet, const char *section, const char *name)
+{
+ struct wkb_config_key *key;
+
+ if (!(key = _config_section_find_key(config_eet->ibus_config, section, name)))
+ {
+ ERR("Config key with id '%s' not found", name);
+ return -1;
+ }
+
+ DBG("Found key: section = <%s> name = <%s>", section, name);
+
+ return wkb_config_key_get_int(key);
+}
+
+Eina_Bool
+wkb_ibus_config_eet_get_value_bool(struct wkb_ibus_config_eet *config_eet, const char *section, const char *name)
+{
+ struct wkb_config_key *key;
+
+ if (!(key = _config_section_find_key(config_eet->ibus_config, section, name)))
+ {
+ ERR("Config key with id '%s' not found", name);
+ return EINA_FALSE;
+ }
+
+ DBG("Found key: section = <%s> name = <%s>", section, name);
+
+ return wkb_config_key_get_bool(key);
+}
+
+const char *
+wkb_ibus_config_eet_get_value_string(struct wkb_ibus_config_eet *config_eet, const char *section, const char *name)
+{
+ struct wkb_config_key *key;
+
+ if (!(key = _config_section_find_key(config_eet->ibus_config, section, name)))
+ {
+ ERR("Config key with id '%s' not found", name);
+ return NULL;
+ }
+
+ DBG("Found key: section = <%s> name = <%s>", section, name);
+
+ return wkb_config_key_get_string(key);
}
Eina_Bool