Enlightenment CVS committal

Author  : handyande
Project : misc
Module  : engage

Dir     : misc/engage/src


Modified Files:
        Makefile.am icon.c 
Added Files:
        battery.c battery.h 


Log Message:
Add the battery work from Nick Lanham, OK so it is over a year late, but it 
still rocks

===================================================================
RCS file: /cvs/e/misc/engage/src/Makefile.am,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- Makefile.am 3 Sep 2006 15:14:51 -0000       1.18
+++ Makefile.am 6 Sep 2006 21:23:45 -0000       1.19
@@ -27,6 +27,7 @@
 e_utils.h \
 engage.h \
 engage_element.h \
+battery.h \
 main.c \
 config.c \
 dock.c \
@@ -35,6 +36,7 @@
 window.c \
 tray.c \
 userconfig.c \
+battery.c \
 e_object.c \
 e_path.c \
 e_user.c \
===================================================================
RCS file: /cvs/e/misc/engage/src/icon.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -3 -r1.45 -r1.46
--- icon.c      1 Sep 2006 16:03:58 -0000       1.45
+++ icon.c      6 Sep 2006 21:23:45 -0000       1.46
@@ -1,6 +1,7 @@
 #include "engage.h"
 #include "limits.h"
 #include "config.h"
+#include "battery.h"
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #ifdef HAVE_IMLIB
@@ -162,7 +163,7 @@
 od_icon_reload(OD_Icon * in)
 {
   const char     *icon_part = NULL;
-  char           *path, *winclass, *name, *icon_file;
+  char           *path, *winclass, *name, *icon_file, *tmp;
 
   Evas_Object    *icon = NULL;
   Evas_Object    *pic = NULL;
@@ -239,6 +240,24 @@
     }
     evas_object_layer_set(icon, 100);
     evas_object_show(icon);
+
+    // set tmp to be the last thing in the path
+    tmp = path;
+    while(*tmp)tmp++;
+    while(*tmp != '/' && tmp != path)tmp--;
+    if(*tmp == '/') tmp++;
+    if(!strcmp(tmp,"default_battery.edj")) {
+      // hook up battery status if it's the battery icon
+      Battery *bat = malloc(sizeof(Battery));
+      memset(bat,0,sizeof(Battery));
+      bat->object = icon;
+      bat->battery_check_mode = CHECK_NONE;
+      bat->battery_prev_drain = 1;
+      bat->battery_prev_ac = -1;
+      bat->battery_prev_battery = -1;
+      _battery_cb_check(bat);
+      bat->battery_check_timer = ecore_timer_add(5.0, _battery_cb_check, bat);
+    }
   } else {
     evas_object_del(icon);
     in->icon = NULL;



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to