aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-02-01 11:31:59 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-02-01 11:31:59 +0000
commit813496a865bb65ebc7c9848228223f37e8f2720a (patch)
treea4891d169a7d9400ec1a6dc2d75c725a3ce9b84d
parent226ec15f2d97c70a0e99190781b80b5f6bbc551c (diff)
downloadenlightenment-813496a865bb65ebc7c9848228223f37e8f2720a.tar.gz
enlightenment-813496a865bb65ebc7c9848228223f37e8f2720a.tar.xz
enlightenment-813496a865bb65ebc7c9848228223f37e8f2720a.zip
track config edds, add e_config_descriptor_find() for retrieving them
SVN revision: 83550
-rw-r--r--ChangeLog1
-rw-r--r--NEWS1
-rw-r--r--src/bin/e_config_data.c26
-rw-r--r--src/bin/e_config_data.h4
4 files changed, 30 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0d98285d4..fa70ed2aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
* split out binding configs into separate config domain
* 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
diff --git a/NEWS b/NEWS
index 9272505f5..1908827cc 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,7 @@ Additions:
* Added API for fetching module .desktop files
* e_config_xkb functions
* added functions for freeing binding config structs
+ * E_Config_DD structs are now tracked and retrievable through e_config_descriptor_find
Config:
* Added option for disabling icons in menus
* Added option for disabling pointer warping when performing directional focus changes using winlist
diff --git a/src/bin/e_config_data.c b/src/bin/e_config_data.c
index 688e5fd57..6b11172e1 100644
--- a/src/bin/e_config_data.c
+++ b/src/bin/e_config_data.c
@@ -1,9 +1,23 @@
#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 *
e_config_descriptor_new(const char *name, int size)
{
Eet_Data_Descriptor_Class eddc;
+ E_Config_DD *edd;
if (!eet_eina_stream_data_descriptor_class_set(&eddc, sizeof (eddc), name, size))
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.
*/
- 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);
+}
diff --git a/src/bin/e_config_data.h b/src/bin/e_config_data.h
index 2a65a05ad..1f3d24424 100644
--- a/src/bin/e_config_data.h
+++ b/src/bin/e_config_data.h
@@ -12,7 +12,7 @@
* is used to free definition of a struct
* \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_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
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