summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-10-18 18:12:13 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-10-18 19:32:00 +0900
commit24c0eced7724f435cec0e5b81e45f1485d08c64e (patch)
tree76cd4c69a6b4cb30c6367c6a3b998e939504334b
parent315e865f18efbab4b3e68171e631912fbd5705fd (diff)
config: Simplify EO API
This is: - using a property (but terribly ugly due to the ownership on the returned value) - removing an unused function Note: This interface Efl.Config covers only elm_config for now. But it's very generic and could be used in the future for application specific configuration.
-rw-r--r--src/lib/efl/interfaces/efl_config.eo43
-rw-r--r--src/lib/elementary/efl_config_global.eo4
-rw-r--r--src/lib/elementary/elm_config.c13
3 files changed, 24 insertions, 36 deletions
diff --git a/src/lib/efl/interfaces/efl_config.eo b/src/lib/efl/interfaces/efl_config.eo
index 7dec728efd..aa19dfad48 100644
--- a/src/lib/efl/interfaces/efl_config.eo
+++ b/src/lib/efl/interfaces/efl_config.eo
@@ -2,30 +2,29 @@ interface Efl.Config ()
2{ 2{
3 [[A generic configuration interface, that holds key-value pairs.]] 3 [[A generic configuration interface, that holds key-value pairs.]]
4 methods { 4 methods {
5 /* FIXME: make this a property -- @own is a problem */ 5 @property config {
6 config_set { 6 [[A generic configuration value, refered to by name.]]
7 [[Set configuration]] 7 get {
8 params { 8 keys {
9 name: string; [[Configuration option name]] 9 name: string; [[Configuration option name.]]
10 val: const(any_value_ptr); [[Configuration option value]] 10 }
11 values {
12 value: any_value_ptr @owned;
13 [[The value. It will be empty if it doesn't exist. The caller
14 must free it after use (using $eina_value_free() in C).]]
15 }
11 } 16 }
12 return: bool; [[$false in case of error: value type was invalid, the 17 set {
13 config can't be changed, config does not exist...]] 18 keys {
14 } 19 name: string; [[Configuration option name.]]
15 config_get @const { 20 }
16 [[Get configuration]] 21 values {
17 params { 22 value: const(any_value_ptr);
18 name: string; [[Configuration option name]] 23 [[Configuration option value. May be $null if not found.]]
19 } 24 }
20 return: any_value_ptr @owned; [[Configuration option value]] 25 return: bool; [[$false in case of error: value type was invalid, the
21 } 26 config can't be changed, config does not exist...]]
22 config_list_get @const {
23 [[Returns a list of generic values under a given key.]]
24 params {
25 @in name: string; [[Configuration option name]]
26 } 27 }
27 return: iterator<any_value_ptr> @owned; [[
28 List of configuration option values]]
29 } 28 }
30 } 29 }
31} 30}
diff --git a/src/lib/elementary/efl_config_global.eo b/src/lib/elementary/efl_config_global.eo
index 99ba68eb2b..2114036039 100644
--- a/src/lib/elementary/efl_config_global.eo
+++ b/src/lib/elementary/efl_config_global.eo
@@ -106,8 +106,6 @@ class Efl.Config.Global (Efl.Object, Efl.Config)
106 } 106 }
107 } 107 }
108 implements { 108 implements {
109 Efl.Config.config_set; 109 Efl.Config.config { get; set; }
110 Efl.Config.config_get;
111 Efl.Config.config_list_get;
112 } 110 }
113} 111}
diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index cfbfc0f871..9f6df2b6f8 100644
--- a/src/lib/elementary/elm_config.c
+++ b/src/lib/elementary/elm_config.c
@@ -4639,8 +4639,8 @@ _efl_config_global_efl_config_config_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNU
4639} 4639}
4640 4640
4641EOLIAN static Eina_Value * 4641EOLIAN static Eina_Value *
4642_efl_config_global_efl_config_config_get(const Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, 4642_efl_config_global_efl_config_config_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED,
4643 const char *name) 4643 const char *name)
4644{ 4644{
4645 Eina_Value *val = NULL; 4645 Eina_Value *val = NULL;
4646 4646
@@ -4766,15 +4766,6 @@ _efl_config_global_efl_config_config_get(const Eo *obj EINA_UNUSED, void *_pd EI
4766 return NULL; 4766 return NULL;
4767} 4767}
4768 4768
4769EOLIAN static Eina_Iterator *
4770_efl_config_global_efl_config_config_list_get(const Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED,
4771 const char *name)
4772{
4773 // Not implemented: none of the elm_config functions returns a list of primitive types
4774 (void) name;
4775 return NULL;
4776}
4777
4778EOLIAN static void 4769EOLIAN static void
4779_efl_config_global_profile_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, const char *profile) 4770_efl_config_global_profile_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, const char *profile)
4780{ 4771{