From 9c02f966a8d090f73028d14912092df023164dc8 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Wed, 30 Apr 2008 12:01:32 +0000 Subject: [PATCH] add generic cfg call SVN revision: 34409 --- src/bin/e_config_dialog.h | 3 ++- src/bin/e_configure.c | 18 ++++++++++++++++-- src/bin/e_configure.h | 2 ++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/bin/e_config_dialog.h b/src/bin/e_config_dialog.h index 218106b..1ae8298 100644 --- a/src/bin/e_config_dialog.h +++ b/src/bin/e_config_dialog.h @@ -6,7 +6,8 @@ typedef enum _E_Config_Dialog_CFData_Type { E_CONFIG_DIALOG_CFDATA_TYPE_BASIC, - E_CONFIG_DIALOG_CFDATA_TYPE_ADVANCED + E_CONFIG_DIALOG_CFDATA_TYPE_ADVANCED, + E_CONFIG_DIALOG_CFDATA_TYPE_NORMAL_WINDOW } E_Config_Dialog_CFData_Type; typedef struct _E_Config_Dialog E_Config_Dialog; diff --git a/src/bin/e_configure.c b/src/bin/e_configure.c index a2e0074..f01b2f7 100644 --- a/src/bin/e_configure.c +++ b/src/bin/e_configure.c @@ -9,8 +9,8 @@ e_configure_init(void) e_configure_registry_item_add("extensions/modules", 10, _("Modules"), NULL, "enlightenment/modules", e_int_config_modules); } -EAPI void -e_configure_registry_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func) (E_Container *con, const char *params)) +static void +_e_configure_registry_item_full_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func) (E_Container *con, const char *params), void (*generic_func) (E_Container *con, const char *params)) { Evas_List *l; char *cat; @@ -30,6 +30,7 @@ e_configure_registry_item_add(const char *path, int pri, const char *label, cons if (icon_file) eci->icon_file = evas_stringshare_add(icon_file); if (icon) eci->icon = evas_stringshare_add(icon); eci->func = func; + eci->generic_func = generic_func; for (l = e_configure_registry; l; l = l->next) { @@ -60,6 +61,18 @@ e_configure_registry_item_add(const char *path, int pri, const char *label, cons } EAPI void +e_configure_registry_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func) (E_Container *con, const char *params)) +{ + _e_configure_registry_item_full_add(path, pri, label, icon_file, icon, func, NULL); +} + +EAPI void +e_configure_registry_generic_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, void (*generic_func) (E_Container *con, const char *params)) +{ + _e_configure_registry_item_full_add(path, pri, label, icon_file, icon, NULL, generic_func); +} + +EAPI void e_configure_registry_item_del(const char *path) { Evas_List *l; @@ -187,6 +200,7 @@ e_configure_registry_call(const char *path, E_Container *con, const char *params if (!strcmp(item, eci->item)) { if (eci->func) eci->func(con, params); + else if (eci->generic_func) eci->generic_func(con, params); goto done; } } diff --git a/src/bin/e_configure.h b/src/bin/e_configure.h index 8f9132a..a8b8056 100644 --- a/src/bin/e_configure.h +++ b/src/bin/e_configure.h @@ -25,9 +25,11 @@ struct _E_Configure_It const char *icon_file; const char *icon; E_Config_Dialog *(*func) (E_Container *con, const char *params); + void (*generic_func) (E_Container *con, const char *params); }; EAPI void e_configure_registry_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func) (E_Container *con, const char *params)); +EAPI void e_configure_registry_generic_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, void (*generic_func) (E_Container *con, const char *params)); EAPI void e_configure_registry_item_del(const char *path); EAPI void e_configure_registry_category_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon); EAPI void e_configure_registry_category_del(const char *path); -- 2.7.4