From: Christopher Michael Date: Fri, 20 Jan 2006 11:14:12 +0000 (+0000) Subject: Formatting. Make Start Module config work correctly using E_Config_Dialog_Data. No... X-Git-Tag: submit/efl/20131021.015651~14139 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=149d1895d4d746f90bb4cf1fe8a73f0da45a1682;p=platform%2Fupstream%2Fenlightenment.git Formatting. Make Start Module config work correctly using E_Config_Dialog_Data. No need to define the configure function with EAPI. Removed not needed include. Add missing e_mod_config.h include to e_mod_config.c SVN revision: 19924 --- diff --git a/src/modules/start/e_mod_config.c b/src/modules/start/e_mod_config.c index 50d8f87..9826570 100644 --- a/src/modules/start/e_mod_config.c +++ b/src/modules/start/e_mod_config.c @@ -1,11 +1,11 @@ #include "e.h" #include "e_mod_main.h" +#include "e_mod_config.h" #include "config.h" -typedef struct _cfdata CFData; typedef struct _Cfg_File_Data Cfg_File_Data; -struct _cfdata +struct _E_Config_Dialog_Data { int allow_overlap; }; @@ -17,11 +17,10 @@ struct _Cfg_File_Data }; /* Protos */ -static Evas_Object *_create_widgets(E_Config_Dialog *cfd, Evas *evas, Config *cfdata); static void *_create_data(E_Config_Dialog *cfd); -static void _free_data(E_Config_Dialog *cfd, CFData *cfdata); -static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata); -static int _basic_apply_data(E_Config_Dialog *cfd, CFData *cfdata); +static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); +static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata); +static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); void _config_start_module(E_Container *con, Start *start) @@ -40,31 +39,31 @@ _config_start_module(E_Container *con, Start *start) } static void -_fill_data(Start *s, CFData *cfdata) +_fill_data(Start *s, E_Config_Dialog_Data *cfdata) { cfdata->allow_overlap = s->conf->allow_overlap; } -static void -*_create_data(E_Config_Dialog *cfd) +static void * +_create_data(E_Config_Dialog *cfd) { - CFData *cfdata; + E_Config_Dialog_Data *cfdata; Start *s; s = cfd->data; - cfdata = E_NEW(CFData, 1); + cfdata = E_NEW(E_Config_Dialog_Data, 1); _fill_data(s, cfdata); return cfdata; } static void -_free_data(E_Config_Dialog *cfd, CFData *cfdata) +_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) { free(cfdata); } -static Evas_Object -*_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata) +static Evas_Object * +_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) { Evas_Object *o, *of, *ob; Start *s; @@ -82,7 +81,7 @@ static Evas_Object } static int -_basic_apply_data(E_Config_Dialog *cfd, CFData *cfdata) +_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) { Start *s; diff --git a/src/modules/start/e_mod_config.h b/src/modules/start/e_mod_config.h index 7106d7c..e733f3c 100644 --- a/src/modules/start/e_mod_config.h +++ b/src/modules/start/e_mod_config.h @@ -3,6 +3,8 @@ #ifndef E_MOD_CONFIG_H #define E_MOD_CONFIG_H #include "e_mod_main.h" -EAPI void _config_start_module(E_Container *con, Start *start); + +void _config_start_module(E_Container *con, Start *start); + #endif #endif diff --git a/src/modules/start/e_mod_main.c b/src/modules/start/e_mod_main.c index 476ccc1..a1c257d 100644 --- a/src/modules/start/e_mod_main.c +++ b/src/modules/start/e_mod_main.c @@ -3,7 +3,8 @@ */ #include "e.h" #include "e_mod_main.h" -#include "e_int_menus.h" +#include "e_mod_config.h" +//#include "e_int_menus.h" static Start *_start_new(void); static Start_Face *_start_face_new(Start *s, E_Container *con); @@ -27,7 +28,7 @@ static E_Config_DD *conf_face_edd; EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, - "Start" + "Start" }; EAPI void * @@ -85,16 +86,18 @@ e_modapi_about(E_Module *m) int e_modapi_config(E_Module *m) { - Start *s; - Start_Face *face; - - s = m->data; - if (s == NULL) return 0; - if (s->faces == NULL) return 0; - face = s->faces->data; - if (face == NULL) return 0; - _config_start_module(e_container_current_get(e_manager_current_get()), s); - return 1; + Start *s; + Start_Face *face; + + s = m->data; + if (!s) return 0; + if (!s->faces) return 0; + + face = s->faces->data; + if (!face) return 0; + + _config_start_module(e_container_current_get(e_manager_current_get()), s); + return 1; } static Start * @@ -126,8 +129,8 @@ _start_new(void) e->conf = e_config_domain_load("module.start", conf_edd); if (!e->conf) { - e->conf = E_NEW(Config, 1); - e->conf->allow_overlap = 0; + e->conf = E_NEW(Config, 1); + e->conf->allow_overlap = 0; } E_CONFIG_LIMIT(e->conf->allow_overlap, 0, 1); @@ -224,7 +227,7 @@ _start_face_new(Start *s, E_Container *con) E_GADMAN_POLICY_VSIZE; if (s->conf->allow_overlap == 0) - policy &= ~E_GADMAN_POLICY_ALLOW_OVERLAP; + policy &= E_GADMAN_POLICY_ALLOW_OVERLAP; else policy |= E_GADMAN_POLICY_ALLOW_OVERLAP; @@ -400,9 +403,11 @@ _start_menu_cb_post_deactivate(void *data, E_Menu *m) e_object_del(E_OBJECT(face->main_menu)); face->main_menu = NULL; } -void _start_cb_config_updated( void *data ) + +void +_start_cb_config_updated(void *data) { - _start_cb_update_policy(data); + _start_cb_update_policy(data); } void @@ -415,24 +420,25 @@ _start_face_cb_menu_configure(void *data, E_Menu *m, E_Menu_Item *mi) _config_start_module(face->con, face->start); } -static void _start_cb_update_policy(void *data) +static void +_start_cb_update_policy(void *data) { - Start *s; - Start_Face *sf; - Evas_List *l; - E_Gadman_Policy policy; - - s = data; - for (l = s->faces; l; l = l->next) - { - sf = l->data; - policy = sf->gmc->policy; - - if (s->conf->allow_overlap == 0) - policy &= ~E_GADMAN_POLICY_ALLOW_OVERLAP; - else - policy |= E_GADMAN_POLICY_ALLOW_OVERLAP; - e_gadman_client_policy_set(sf->gmc , policy); - } + Start *s; + Start_Face *sf; + Evas_List *l; + E_Gadman_Policy policy; + + s = data; + for (l = s->faces; l; l = l->next) + { + sf = l->data; + policy = sf->gmc->policy; + + if (s->conf->allow_overlap == 0) + policy &= E_GADMAN_POLICY_ALLOW_OVERLAP; + else + policy |= E_GADMAN_POLICY_ALLOW_OVERLAP; + e_gadman_client_policy_set(sf->gmc , policy); + } } diff --git a/src/modules/start/e_mod_main.h b/src/modules/start/e_mod_main.h index 0fa75d9..7edac6e 100644 --- a/src/modules/start/e_mod_main.h +++ b/src/modules/start/e_mod_main.h @@ -47,8 +47,8 @@ EAPI int e_modapi_shutdown (E_Module *m); EAPI int e_modapi_save (E_Module *m); EAPI int e_modapi_info (E_Module *m); EAPI int e_modapi_about (E_Module *m); -/* EAPI int e_modapi_config (E_Module *module); */ +EAPI int e_modapi_config (E_Module *m); -EAPI void _start_cb_config_updated(void *data); +void _start_cb_config_updated(void *data); #endif