Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/modules/temperature Modified Files: e_mod_config.c e_mod_main.c e_mod_main.h Log Message: 2 pending patches in my inbox. 1. "allow overlap" patch for modules - needs better names in the gui (Allow windows to overlap maybe - as allow overlap is very vague) 2. itray module (buggy - buggy - beware. i know why. beware i said!) 3. TODO items =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/temperature/e_mod_config.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- e_mod_config.c 14 Jan 2006 16:10:57 -0000 1.12 +++ e_mod_config.c 20 Jan 2006 04:04:14 -0000 1.13 @@ -32,6 +32,8 @@ int high_method; int high_temp; + int allow_overlap; + int sensor; }; @@ -146,6 +148,8 @@ { cfdata->sensor = 2; } + + cfdata->allow_overlap = t->conf->allow_overlap; } static void * @@ -248,6 +252,11 @@ e_widget_list_object_append(o, of, 1, 1, 0.5); } + of = e_widget_framelist_add(evas, _("Extras"), 0); + ob = e_widget_check_add(evas, _("Allow Overlap"), &(cfdata->allow_overlap)); + e_widget_framelist_object_append(of, ob); + e_widget_list_object_append(o, of, 1, 1, 0.5); + return o; } @@ -280,6 +289,11 @@ t->conf->high = cfdata->high_method; } + if (cfdata->allow_overlap && !t->conf->allow_overlap) + t->conf->allow_overlap = 1; + else if (!cfdata->allow_overlap && t->conf->allow_overlap) + t->conf->allow_overlap = 0; + e_border_button_bindings_grab_all(); e_config_save_queue(); @@ -392,6 +406,12 @@ e_widget_framelist_object_append(of, ob); e_widget_list_object_append(o, of, 1, 1, 0.5); } + + of = e_widget_framelist_add(evas, _("Extras"), 0); + ob = e_widget_check_add(evas, _("Allow Overlap"), &(cfdata->allow_overlap)); + e_widget_framelist_object_append(of, ob); + e_widget_list_object_append(o, of, 1, 1, 0.5); + return o; } @@ -446,6 +466,11 @@ break; } + if (cfdata->allow_overlap && !t->conf->allow_overlap) + t->conf->allow_overlap = 1; + else if (!cfdata->allow_overlap && t->conf->allow_overlap) + t->conf->allow_overlap = 0; + e_border_button_bindings_grab_all(); e_config_save_queue(); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/temperature/e_mod_main.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -3 -r1.51 -r1.52 --- e_mod_main.c 7 Jan 2006 10:39:46 -0000 1.51 +++ e_mod_main.c 20 Jan 2006 04:04:14 -0000 1.52 @@ -22,7 +22,7 @@ static void _temperature_config_menu_new(Temperature *e); static int _temperature_cb_check(void *data); -static Temperature_Face *_temperature_face_new(E_Container *con); +static Temperature_Face *_temperature_face_new(Temperature *t, E_Container *con); static void _temperature_face_free(Temperature_Face *ef); static void _temperature_face_enable(Temperature_Face *face); static void _temperature_face_disable(Temperature_Face *face); @@ -33,6 +33,8 @@ static void _temperature_face_cb_menu_edit(void *data, E_Menu *m, E_Menu_Item *mi); static void _temperature_face_cb_menu_configure(void *data, E_Menu *m, E_Menu_Item *mi); +static void _temperature_cb_update_policy(void *data); + static E_Config_DD *conf_edd; static E_Config_DD *conf_face_edd; @@ -160,6 +162,7 @@ E_CONFIG_LIST(D, T, faces, conf_face_edd); E_CONFIG_VAL(D, T, sensor_name, STR); E_CONFIG_VAL(D, T, units, INT); + E_CONFIG_VAL(D, T, allow_overlap, INT); e->conf = e_config_domain_load("module.temperature", conf_edd); if (!e->conf) @@ -170,11 +173,13 @@ e->conf->high = 80; e->conf->sensor_name = "temp1"; e->conf->units = CELCIUS; + e->conf->allow_overlap = 0; } E_CONFIG_LIMIT(e->conf->poll_time, 0.5, 1000.0); E_CONFIG_LIMIT(e->conf->low, 0, 100); E_CONFIG_LIMIT(e->conf->high, 0, 220); E_CONFIG_LIMIT(e->conf->units, CELCIUS, FAHRENHEIT); + E_CONFIG_LIMIT(e->conf->allow_overlap, 0, 1); _temperature_config_menu_new(e); e->have_temp = -1; @@ -193,7 +198,7 @@ Temperature_Face *ef; con = l2->data; - ef = _temperature_face_new(con); + ef = _temperature_face_new(e, con); if (ef) { ef->temp = e; @@ -270,10 +275,11 @@ } static Temperature_Face * -_temperature_face_new(E_Container *con) +_temperature_face_new(Temperature *t, E_Container *con) { Evas_Object *o; Temperature_Face *ef; + E_Gadman_Policy policy; ef = E_NEW(Temperature_Face, 1); if (!ef) return NULL; @@ -299,12 +305,19 @@ ef->gmc = e_gadman_client_new(ef->con->gadman); e_gadman_client_domain_set(ef->gmc, "module.temperature", temperature_count++); - e_gadman_client_policy_set(ef->gmc, - E_GADMAN_POLICY_ANYWHERE | - E_GADMAN_POLICY_HMOVE | - E_GADMAN_POLICY_VMOVE | - E_GADMAN_POLICY_HSIZE | - E_GADMAN_POLICY_VSIZE); + + policy = E_GADMAN_POLICY_ANYWHERE | + E_GADMAN_POLICY_HMOVE | + E_GADMAN_POLICY_VMOVE | + E_GADMAN_POLICY_HSIZE | + E_GADMAN_POLICY_VSIZE; + + if (t->conf->allow_overlap == 0) + policy &= ~E_GADMAN_POLICY_ALLOW_OVERLAP; + else + policy |= E_GADMAN_POLICY_ALLOW_OVERLAP; + + e_gadman_client_policy_set(ef->gmc, policy); e_gadman_client_min_size_set(ef->gmc, 4, 4); e_gadman_client_max_size_set(ef->gmc, 128, 128); e_gadman_client_auto_size_set(ef->gmc, 40, 40); @@ -623,5 +636,28 @@ /* Call all funcs needed to handle update */ ecore_timer_del(temp->temperature_check_timer); temp->temperature_check_timer = ecore_timer_add(temp->conf->poll_time, _temperature_cb_check, temp); + _temperature_cb_update_policy(temp); } +void +_temperature_cb_update_policy(void *data) +{ + Temperature *temp; + Temperature_Face *tf; + Evas_List *l; + E_Gadman_Policy policy; + + temp = data; + for (l = temp->faces; l; l = l->next) + { + tf = l->data; + policy = tf->gmc->policy; + + if (temp->conf->allow_overlap == 0) + policy &= ~E_GADMAN_POLICY_ALLOW_OVERLAP; + else + policy |= E_GADMAN_POLICY_ALLOW_OVERLAP; + + e_gadman_client_policy_set(tf->gmc, policy); + } +} =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/temperature/e_mod_main.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- e_mod_main.h 6 Jan 2006 21:43:50 -0000 1.14 +++ e_mod_main.h 20 Jan 2006 04:04:14 -0000 1.15 @@ -22,6 +22,7 @@ Evas_List *faces; char *sensor_name; Unit units; + int allow_overlap; }; struct _Config_Face ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs