summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_config.eo
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-06-21 17:54:56 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-06-24 16:57:04 +0900
commit47a1fae200c824672c06c6b63a098dc54af033a4 (patch)
tree530596e24977f3780a213b2af34fffe1d437724c /src/lib/efl/interfaces/efl_config.eo
parente1d5d5e4a1817e148e51a8e1ae15969f826f4b1d (diff)
efl: Introduce general Efl.Config API
This is to port elm_config to EO APIs. The current implementation relies on the legacy API, by simply forwarding calls. The new API is simply efl_config_set("config_name", value) where value is an Eina_Value (aka. generic_value). The C interface proposes a few helpers like config_int_set, config_double_set, etc... Unfortunately at the moment, not all config options are supported, as some rely on more complex types: - lists - color class and multiple arguments - unset functions - enums Profiles are also not handled at this point. @feature
Diffstat (limited to 'src/lib/efl/interfaces/efl_config.eo')
-rw-r--r--src/lib/efl/interfaces/efl_config.eo119
1 files changed, 119 insertions, 0 deletions
diff --git a/src/lib/efl/interfaces/efl_config.eo b/src/lib/efl/interfaces/efl_config.eo
new file mode 100644
index 0000000..9726672
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_config.eo
@@ -0,0 +1,119 @@
1mixin Efl.Config (Eo.Interface)
2{
3 [[A generic configuration interface, that holds key-value pairs.]]
4 data: null;
5 methods {
6 /* FIXME: make this a property -- @own is a problem */
7 /*
8 @property config @virtual_pure {
9 [[Holds a generic value under a given key.
10
11 Most common value types are: string, int, uint, bool, double.
12 ]]
13 keys {
14 name: string;
15 }
16 values {
17 val: const(generic_value)*;
18 }
19 get {
20 return: free(own(generic_value *), eina_value_free);
21 }
22 }
23 */
24 config_set @virtual_pure {
25 params {
26 name: string;
27 val: const(generic_value)*;
28 }
29 return: bool; [[$false in case of error: value type was invalid, the
30 config can't be changed, config does not exist...]]
31 }
32 config_get @virtual_pure @const {
33 params {
34 name: string;
35 }
36 return: free(own(generic_value *), eina_value_free);
37 }
38 config_list_get @virtual_pure @const {
39 [[Returns a list of generic values under a given key.]]
40 params {
41 @in name: string;
42 }
43 return: free(own(iterator<generic_value*>), eina_iterator_free);
44 }
45 @property config_bool {
46 [[Helper for boolean properties (most useful in C).]]
47 keys {
48 name: string;
49 }
50 values {
51 val: bool;
52 }
53 get {}
54 set { return: bool; }
55 }
56 @property config_int {
57 [[Helper for int properties (most useful in C).]]
58 keys {
59 name: string;
60 }
61 values {
62 val: int;
63 }
64 get {}
65 set { return: bool; }
66 }
67 @property config_uint {
68 [[Helper for unsigned int properties (most useful in C).]]
69 keys {
70 name: string;
71 }
72 values {
73 val: uint;
74 }
75 get {}
76 set { return: bool; }
77 }
78 @property config_double {
79 [[Helper for double properties (most useful in C).]]
80 keys {
81 name: string;
82 }
83 values {
84 val: double;
85 }
86 get {}
87 set { return: bool; }
88 }
89 @property config_string {
90 [[Helper for string properties (most useful in C).]]
91 keys {
92 name: string;
93 }
94 values {
95 val: string;
96 }
97 set { return: bool; }
98 }
99 config_string_get {
100 [[Helper for string properties (most useful in C).]]
101 params {
102 name: string;
103 }
104 return: stringshare;
105 }
106 config_global_get @class {
107 [[Get a handle on the main configuration.]]
108 return: Efl.Config;
109 }
110 }
111}
112
113/* NOTES:
114 - Elm_Color_Class list -> no need to return the struct, only the name matters
115 but also provide func to get desc from name
116 - Elm_Color_Overlay -> see with Jee-Yong and his color patch (common intf)
117 - elm_config_font_overlay_set -> ?
118 - what else?
119*/