aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-02-01 10:35:33 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-02-01 10:35:33 +0000
commit4ad2b363edaa4c3b6bd13c2b35a5d3d481010673 (patch)
tree2435e3592dab5957e4472dd8783ac45c1132f71c
parentgiant commit that wipes all bindi^W^W^Wsplits out binding configs into a sepa... (diff)
downloadenlightenment-4ad2b363edaa4c3b6bd13c2b35a5d3d481010673.tar.gz
add functions for freeing binding config structs
SVN revision: 83545
-rw-r--r--ChangeLog1
-rw-r--r--NEWS1
-rw-r--r--src/bin/e_config.c124
-rw-r--r--src/bin/e_config.h9
4 files changed, 82 insertions, 53 deletions
diff --git a/ChangeLog b/ChangeLog
index e9584db89..0d98285d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
2013-02-01 Mike Blumenkrantz
* split out binding configs into separate config domain
+ * added functions for freeing binding config structs
2013-01-31 Mike Blumenkrantz
diff --git a/NEWS b/NEWS
index 11c047ba9..9272505f5 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,7 @@ Additions:
* Added e_comp namespace and E_EVENT_COMP events
* Added API for fetching module .desktop files
* e_config_xkb functions
+ * added functions for freeing binding config structs
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.c b/src/bin/e_config.c
index a79eb75d9..db442292c 100644
--- a/src/bin/e_config.c
+++ b/src/bin/e_config.c
@@ -109,58 +109,6 @@ _e_config_profile_name_get(Eet_File *ef)
return s;
}
-static void
-_e_config_bindings_free(E_Config_Bindings *ecb)
-{
- E_Config_Binding_Signal *ebs;
- E_Config_Binding_Mouse *ebm;
- E_Config_Binding_Wheel *ebw;
- E_Config_Binding_Key *ebk;
- E_Config_Binding_Edge *ebe;
- E_Config_Binding_Acpi *eba;
-
- EINA_LIST_FREE(ecb->mouse_bindings, ebm)
- {
- eina_stringshare_del(ebm->action);
- eina_stringshare_del(ebm->params);
- free(ebm);
- }
- EINA_LIST_FREE(ecb->key_bindings, ebk)
- {
- eina_stringshare_del(ebk->key);
- eina_stringshare_del(ebk->action);
- eina_stringshare_del(ebk->params);
- free(ebk);
- }
- EINA_LIST_FREE(ecb->edge_bindings, ebe)
- {
- eina_stringshare_del(ebe->action);
- eina_stringshare_del(ebe->params);
- free(ebe);
- }
- EINA_LIST_FREE(ecb->signal_bindings, ebs)
- {
- eina_stringshare_del(ebs->signal);
- eina_stringshare_del(ebs->source);
- eina_stringshare_del(ebs->action);
- eina_stringshare_del(ebs->params);
- free(ebs);
- }
- EINA_LIST_FREE(ecb->wheel_bindings, ebw)
- {
- eina_stringshare_del(ebw->action);
- eina_stringshare_del(ebw->params);
- free(ebw);
- }
- EINA_LIST_FREE(ecb->acpi_bindings, eba)
- {
- eina_stringshare_del(eba->action);
- eina_stringshare_del(eba->params);
- free(eba);
- }
- free(ecb);
-}
-
/* externally accessible functions */
EINTERN int
e_config_init(void)
@@ -1138,7 +1086,7 @@ e_config_load(void)
{
Eina_Stringshare *prof;
- _e_config_bindings_free(e_bindings);
+ e_config_bindings_free(e_bindings);
prof = eina_stringshare_ref(e_config_profile_get());
e_config_profile_set("default");
e_bindings = e_config_domain_load("e_bindings", _e_config_binding_edd);
@@ -1911,6 +1859,76 @@ e_config_mode_changed(void)
ecore_event_add(E_EVENT_CONFIG_MODE_CHANGED, NULL, NULL, NULL);
}
+EAPI void
+e_config_binding_acpi_free(E_Config_Binding_Acpi *eba)
+{
+ if (!eba) return;
+ eina_stringshare_del(eba->action);
+ eina_stringshare_del(eba->params);
+ free(eba);
+}
+
+EAPI void
+e_config_binding_key_free(E_Config_Binding_Key *ebk)
+{
+ if (!ebk) return;
+ eina_stringshare_del(ebk->key);
+ eina_stringshare_del(ebk->action);
+ eina_stringshare_del(ebk->params);
+ free(ebk);
+}
+
+EAPI void
+e_config_binding_edge_free(E_Config_Binding_Edge *ebe)
+{
+ if (!ebe) return;
+ eina_stringshare_del(ebe->action);
+ eina_stringshare_del(ebe->params);
+ free(ebe);
+}
+
+EAPI void
+e_config_binding_mouse_free(E_Config_Binding_Mouse *ebm)
+{
+ if (!ebm) return;
+ eina_stringshare_del(ebm->action);
+ eina_stringshare_del(ebm->params);
+ free(ebm);
+}
+
+EAPI void
+e_config_binding_wheel_free(E_Config_Binding_Wheel *ebw)
+{
+ if (!ebw) return;
+ eina_stringshare_del(ebw->action);
+ eina_stringshare_del(ebw->params);
+ free(ebw);
+}
+
+EAPI void
+e_config_binding_signal_free(E_Config_Binding_Signal *ebs)
+{
+ if (!ebs) return;
+ eina_stringshare_del(ebs->signal);
+ eina_stringshare_del(ebs->source);
+ eina_stringshare_del(ebs->action);
+ eina_stringshare_del(ebs->params);
+ free(ebs);
+}
+
+EAPI void
+e_config_bindings_free(E_Config_Bindings *ecb)
+{
+ if (!ecb) return;
+ E_FREE_LIST(ecb->mouse_bindings, e_config_binding_mouse_free);
+ E_FREE_LIST(ecb->key_bindings, e_config_binding_key_free);
+ E_FREE_LIST(ecb->edge_bindings, e_config_binding_edge_free);
+ E_FREE_LIST(ecb->signal_bindings, e_config_binding_signal_free);
+ E_FREE_LIST(ecb->wheel_bindings, e_config_binding_wheel_free);
+ E_FREE_LIST(ecb->acpi_bindings, e_config_binding_acpi_free);
+ free(ecb);
+}
+
/* local subsystem functions */
static void
_e_config_save_cb(void *data __UNUSED__)
diff --git a/src/bin/e_config.h b/src/bin/e_config.h
index 0dbe53451..eaecdab30 100644
--- a/src/bin/e_config.h
+++ b/src/bin/e_config.h
@@ -662,6 +662,15 @@ EAPI E_Config_Binding_Wheel *e_config_binding_wheel_match(E_Config_Binding_Whee
EAPI E_Config_Binding_Acpi *e_config_binding_acpi_match(E_Config_Binding_Acpi *eb_in);
EAPI void e_config_mode_changed(void);
+
+EAPI void e_config_bindings_free(E_Config_Bindings *ecb);
+EAPI void e_config_binding_signal_free(E_Config_Binding_Signal *ebs);
+EAPI void e_config_binding_wheel_free(E_Config_Binding_Wheel *ebw);
+EAPI void e_config_binding_mouse_free(E_Config_Binding_Mouse *ebm);
+EAPI void e_config_binding_edge_free(E_Config_Binding_Edge *ebe);
+EAPI void e_config_binding_key_free(E_Config_Binding_Key *ebk);
+EAPI void e_config_binding_acpi_free(E_Config_Binding_Acpi *eba);
+
extern EAPI E_Config *e_config;
extern EAPI E_Config_Bindings *e_bindings;