forked from enlightenment/enlightenment
track config edds, add e_config_descriptor_find() for retrieving them
SVN revision: 83550
This commit is contained in:
parent
226ec15f2d
commit
813496a865
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
* split out binding configs into separate config domain
|
* split out binding configs into separate config domain
|
||||||
* added functions for freeing binding config structs
|
* added functions for freeing binding config structs
|
||||||
|
* E_Config_DD structs are now tracked and retrievable through e_config_descriptor_find
|
||||||
|
|
||||||
2013-01-31 Mike Blumenkrantz
|
2013-01-31 Mike Blumenkrantz
|
||||||
|
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -21,6 +21,7 @@ Additions:
|
||||||
* Added API for fetching module .desktop files
|
* Added API for fetching module .desktop files
|
||||||
* e_config_xkb functions
|
* e_config_xkb functions
|
||||||
* added functions for freeing binding config structs
|
* added functions for freeing binding config structs
|
||||||
|
* E_Config_DD structs are now tracked and retrievable through e_config_descriptor_find
|
||||||
Config:
|
Config:
|
||||||
* Added option for disabling icons in menus
|
* Added option for disabling icons in menus
|
||||||
* Added option for disabling pointer warping when performing directional focus changes using winlist
|
* Added option for disabling pointer warping when performing directional focus changes using winlist
|
||||||
|
|
|
@ -1,9 +1,23 @@
|
||||||
#include "e.h"
|
#include "e.h"
|
||||||
|
|
||||||
|
static Eina_Hash *config_hash = NULL;
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
e_config_descriptor_free(E_Config_DD *edd)
|
||||||
|
{
|
||||||
|
#if (EET_VERSION_MAJOR > 1) || (EET_VERSION_MINOR >= 8)
|
||||||
|
eina_hash_del_by_key(config_hash, eet_data_descriptor_name_get((Eet_Data_Descriptor*)edd));
|
||||||
|
#else
|
||||||
|
eina_hash_del_by_data(config_hash, edd);
|
||||||
|
#endif
|
||||||
|
eet_data_descriptor_free((Eet_Data_Descriptor*)edd);
|
||||||
|
}
|
||||||
|
|
||||||
EAPI E_Config_DD *
|
EAPI E_Config_DD *
|
||||||
e_config_descriptor_new(const char *name, int size)
|
e_config_descriptor_new(const char *name, int size)
|
||||||
{
|
{
|
||||||
Eet_Data_Descriptor_Class eddc;
|
Eet_Data_Descriptor_Class eddc;
|
||||||
|
E_Config_DD *edd;
|
||||||
|
|
||||||
if (!eet_eina_stream_data_descriptor_class_set(&eddc, sizeof (eddc), name, size))
|
if (!eet_eina_stream_data_descriptor_class_set(&eddc, sizeof (eddc), name, size))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -12,6 +26,16 @@ e_config_descriptor_new(const char *name, int size)
|
||||||
But this need a break in all user of config every where in E.
|
But this need a break in all user of config every where in E.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return (E_Config_DD *)eet_data_descriptor_stream_new(&eddc);
|
edd = (E_Config_DD *)eet_data_descriptor_stream_new(&eddc);
|
||||||
|
|
||||||
|
if (!config_hash) config_hash = eina_hash_string_superfast_new(NULL);
|
||||||
|
eina_hash_set(config_hash, name, edd);
|
||||||
|
return edd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI E_Config_DD *
|
||||||
|
e_config_descriptor_find(const char *name)
|
||||||
|
{
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
|
||||||
|
return eina_hash_find(config_hash, name);
|
||||||
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
* is used to free definition of a struct
|
* is used to free definition of a struct
|
||||||
* \eed eed the pointer created by \link #E_CONFIG_DD_NEW
|
* \eed eed the pointer created by \link #E_CONFIG_DD_NEW
|
||||||
*/
|
*/
|
||||||
#define E_CONFIG_DD_FREE(eed) if (eed) { eet_data_descriptor_free((eed)); (eed) = NULL; }
|
#define E_CONFIG_DD_FREE(eed) if (eed) { e_config_descriptor_free((eed)); (eed) = NULL; }
|
||||||
#define E_CONFIG_VAL(edd, type, member, dtype) EET_DATA_DESCRIPTOR_ADD_BASIC(edd, type, #member, member, dtype)
|
#define E_CONFIG_VAL(edd, type, member, dtype) EET_DATA_DESCRIPTOR_ADD_BASIC(edd, type, #member, member, dtype)
|
||||||
#define E_CONFIG_SUB(edd, type, member, eddtype) EET_DATA_DESCRIPTOR_ADD_SUB(edd, type, #member, member, eddtype)
|
#define E_CONFIG_SUB(edd, type, member, eddtype) EET_DATA_DESCRIPTOR_ADD_SUB(edd, type, #member, member, eddtype)
|
||||||
|
|
||||||
|
@ -55,6 +55,8 @@ typedef Eet_Data_Descriptor E_Config_DD;
|
||||||
#define E_CONFIG_DATA_H
|
#define E_CONFIG_DATA_H
|
||||||
|
|
||||||
EAPI E_Config_DD *e_config_descriptor_new(const char *name, int size);
|
EAPI E_Config_DD *e_config_descriptor_new(const char *name, int size);
|
||||||
|
EAPI void e_config_descriptor_free(E_Config_DD *edd);
|
||||||
|
EAPI E_Config_DD *e_config_descriptor_find(const char *name);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue