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.
This commit is contained in:
parent
315e865f18
commit
24c0eced77
|
@ -2,30 +2,29 @@ interface Efl.Config ()
|
|||
{
|
||||
[[A generic configuration interface, that holds key-value pairs.]]
|
||||
methods {
|
||||
/* FIXME: make this a property -- @own is a problem */
|
||||
config_set {
|
||||
[[Set configuration]]
|
||||
params {
|
||||
name: string; [[Configuration option name]]
|
||||
val: const(any_value_ptr); [[Configuration option value]]
|
||||
@property config {
|
||||
[[A generic configuration value, refered to by name.]]
|
||||
get {
|
||||
keys {
|
||||
name: string; [[Configuration option name.]]
|
||||
}
|
||||
values {
|
||||
value: any_value_ptr @owned;
|
||||
[[The value. It will be empty if it doesn't exist. The caller
|
||||
must free it after use (using $eina_value_free() in C).]]
|
||||
}
|
||||
}
|
||||
set {
|
||||
keys {
|
||||
name: string; [[Configuration option name.]]
|
||||
}
|
||||
values {
|
||||
value: const(any_value_ptr);
|
||||
[[Configuration option value. May be $null if not found.]]
|
||||
}
|
||||
return: bool; [[$false in case of error: value type was invalid, the
|
||||
config can't be changed, config does not exist...]]
|
||||
}
|
||||
config_get @const {
|
||||
[[Get configuration]]
|
||||
params {
|
||||
name: string; [[Configuration option name]]
|
||||
}
|
||||
return: any_value_ptr @owned; [[Configuration option value]]
|
||||
}
|
||||
config_list_get @const {
|
||||
[[Returns a list of generic values under a given key.]]
|
||||
params {
|
||||
@in name: string; [[Configuration option name]]
|
||||
}
|
||||
return: iterator<any_value_ptr> @owned; [[
|
||||
List of configuration option values]]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,8 +106,6 @@ class Efl.Config.Global (Efl.Object, Efl.Config)
|
|||
}
|
||||
}
|
||||
implements {
|
||||
Efl.Config.config_set;
|
||||
Efl.Config.config_get;
|
||||
Efl.Config.config_list_get;
|
||||
Efl.Config.config { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4639,7 +4639,7 @@ _efl_config_global_efl_config_config_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNU
|
|||
}
|
||||
|
||||
EOLIAN static Eina_Value *
|
||||
_efl_config_global_efl_config_config_get(const Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED,
|
||||
_efl_config_global_efl_config_config_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED,
|
||||
const char *name)
|
||||
{
|
||||
Eina_Value *val = NULL;
|
||||
|
@ -4766,15 +4766,6 @@ _efl_config_global_efl_config_config_get(const Eo *obj EINA_UNUSED, void *_pd EI
|
|||
return NULL;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Iterator *
|
||||
_efl_config_global_efl_config_config_list_get(const Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED,
|
||||
const char *name)
|
||||
{
|
||||
// Not implemented: none of the elm_config functions returns a list of primitive types
|
||||
(void) name;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_config_global_profile_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, const char *profile)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue