Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/modules/battery


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/battery/e_mod_config.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- e_mod_config.c      14 Jan 2006 16:10:56 -0000      1.10
+++ e_mod_config.c      20 Jan 2006 04:04:12 -0000      1.11
@@ -10,6 +10,7 @@
    int show_alert;   
    double poll_time;   
    int alarm_time;
+   int allow_overlap;
 };
 
 struct _Cfg_File_Data 
@@ -56,6 +57,7 @@
      {
        cfdata->show_alert = 0;
      }
+   cfdata->allow_overlap = b->conf->allow_overlap;
 }
 
 static void *
@@ -94,6 +96,11 @@
    ob = e_widget_check_add(evas, _("Show alert when battery is low"), 
&(cfdata->show_alert));
    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;
 }
 
@@ -105,6 +112,12 @@
    b = cfd->data;
    e_border_button_bindings_ungrab_all();
    b->conf->poll_time = 10.0;   
+
+   if (cfdata->allow_overlap && !b->conf->allow_overlap)
+     b->conf->allow_overlap = 1;
+   else if (!cfdata->allow_overlap && b->conf->allow_overlap)
+     b->conf->allow_overlap = 0;
+
    e_border_button_bindings_grab_all();
    e_config_save_queue();
    
@@ -141,6 +154,11 @@
    e_widget_frametable_object_append(of, ob, 0, 5, 1, 1, 1, 0, 1, 0);
 
    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;
 }
 
@@ -161,6 +179,11 @@
      {
        b->conf->alarm = 0;
      }
+
+   if (cfdata->allow_overlap && !b->conf->allow_overlap)
+     b->conf->allow_overlap = 1;
+   else if (!cfdata->allow_overlap && b->conf->allow_overlap)
+     b->conf->allow_overlap = 0;
    
    e_border_button_bindings_grab_all();
    e_config_save_queue();
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/battery/e_mod_main.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -3 -r1.65 -r1.66
--- e_mod_main.c        7 Jan 2006 10:39:45 -0000       1.65
+++ e_mod_main.c        20 Jan 2006 04:04:12 -0000      1.66
@@ -49,7 +49,7 @@
 static Status       *_battery_darwin_check(Battery *ef);
 #endif
 
-static Battery_Face *_battery_face_new(E_Container *con);
+static Battery_Face *_battery_face_new(Battery *bat, E_Container *con);
 static void          _battery_face_free(Battery_Face *ef);
 static void          _battery_face_menu_new(Battery_Face *face);
 static void          _battery_face_enable(Battery_Face *face);
@@ -64,6 +64,8 @@
 
 static void          _battery_face_cb_menu_configure(void *data, E_Menu *m, 
E_Menu_Item *mi);
 
+static void        _battery_face_cb_update_policy(void *data);
+
 static E_Config_DD *conf_edd;
 static E_Config_DD *conf_face_edd;
 
@@ -189,6 +191,7 @@
 #define D conf_edd
    E_CONFIG_VAL(D, T, poll_time, DOUBLE);
    E_CONFIG_VAL(D, T, alarm, INT);
+   E_CONFIG_VAL(D, T, allow_overlap, INT);
    E_CONFIG_LIST(D, T, faces, conf_face_edd);
 
    e->conf = e_config_domain_load("module.battery", conf_edd);
@@ -197,9 +200,11 @@
        e->conf = E_NEW(Config, 1);
        e->conf->poll_time = 30.0;
        e->conf->alarm = 30;
+       e->conf->allow_overlap = 0;
      }
    E_CONFIG_LIMIT(e->conf->poll_time, 0.5, 1000.0);
    E_CONFIG_LIMIT(e->conf->alarm, 0, 60);
+   E_CONFIG_LIMIT(e->conf->allow_overlap, 0, 1);
 
    _battery_config_menu_new(e);
 
@@ -222,7 +227,7 @@
             Battery_Face *ef;
 
             con = l2->data;
-            ef = _battery_face_new(con);
+            ef = _battery_face_new(e, con);
             if (ef)
               {
                  ef->battery = e;
@@ -298,10 +303,11 @@
 }
 
 static Battery_Face *
-_battery_face_new(E_Container *con)
+_battery_face_new(Battery *bat, E_Container *con)
 {
    Evas_Object *o;
    Battery_Face *ef;
+   E_Gadman_Policy  policy;
 
    ef = E_NEW(Battery_Face, 1);
    if (!ef) return NULL;
@@ -327,12 +333,17 @@
 
    ef->gmc = e_gadman_client_new(con->gadman);
    e_gadman_client_domain_set(ef->gmc, "module.battery", battery_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 (bat->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);
@@ -1626,8 +1637,30 @@
 _battery_face_cb_config_updated(Battery *bat) 
 {
    /* Call all functions needed to update battery */
+   _battery_face_cb_update_policy((void*)bat);
    
    /* Update Poll Time */
    ecore_timer_del(bat->battery_check_timer);
    bat->battery_check_timer = ecore_timer_add(bat->conf->poll_time, 
_battery_cb_check, bat);   
 }
+
+static void _battery_face_cb_update_policy(void *data)
+{
+  Battery     *bat;
+  Battery_Face *bf;
+  Evas_List   *l;
+  E_Gadman_Policy policy;
+
+  bat = data;
+  for (l = bat->faces; l; l = l->next)
+    {
+      bf = l->data;
+      policy = bf->gmc->policy;
+
+      if (bat->conf->allow_overlap ==0)
+        policy &= ~E_GADMAN_POLICY_ALLOW_OVERLAP;
+      else
+        policy |= E_GADMAN_POLICY_ALLOW_OVERLAP;
+      e_gadman_client_policy_set(bf->gmc , policy);
+    }
+}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/battery/e_mod_main.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- e_mod_main.h        6 Jan 2006 21:21:48 -0000       1.18
+++ e_mod_main.h        20 Jan 2006 04:04:12 -0000      1.19
@@ -20,6 +20,7 @@
 {
    double     poll_time;
    int        alarm;
+   int       allow_overlap;
    Evas_List *faces;
 };
 




-------------------------------------------------------
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

Reply via email to