Enlightenment CVS committal

Author  : devilhorns
Project : e_modules
Module  : cpu

Dir     : e_modules/cpu


Modified Files:
        e_mod_main.h e_mod_main.c 


Log Message:
Make cpu module build again after nasa 4 cpu commit. Disable
Edje_Message_Float for now as it's not handled in the edc.

===================================================================
RCS file: /cvs/e/e_modules/cpu/e_mod_main.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- e_mod_main.h        9 Mar 2006 11:36:10 -0000       1.6
+++ e_mod_main.h        1 Apr 2006 23:38:34 -0000       1.7
@@ -36,7 +36,7 @@
    E_Container *con;
    E_Menu *menu;
    Cpu *cpu;
-   Evas_List *old_values;
+   Evas_List *old_values[4];
    
    Config_Face *conf;
    E_Config_DD *conf_face_edd;
===================================================================
RCS file: /cvs/e/e_modules/cpu/e_mod_main.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- e_mod_main.c        1 Apr 2006 22:30:16 -0000       1.14
+++ e_mod_main.c        1 Apr 2006 23:38:34 -0000       1.15
@@ -435,9 +435,10 @@
 {
    Cpu_Face *cf;
    char str[100];
-   Edje_Message_Float msg;
+   //Edje_Message_Float msg;
    int i = 0;
    char str_tmp[100];
+
    cf = data;
    _cpu_face_get_load(cf);
    
@@ -449,17 +450,18 @@
        snprintf(str, sizeof(str), "%d%%", cpu_stats[0]);
        i = 1;
        while (i < cpu_count)
-       {
-          snprintf(str_tmp, sizeof(str_tmp), " / %d%%", cpu_stats[i]);
-          strncat(str, str_tmp, sizeof(str));
-          i++;
-       }
+         {
+            snprintf(str_tmp, sizeof(str_tmp), " / %d%%", cpu_stats[i]);
+            strncat(str, str_tmp, sizeof(str));
+            i++;
+         }
        edje_object_part_text_set(cf->txt_obj, "in-text", str);   
      }
    else
      edje_object_part_text_set(cf->txt_obj, "in-text", "");   
      
-   if ((cf->cpu->conf->show_graph) && (edje_object_part_exists 
(cf->cpu_obj,"lines")))
+   if ((cf->cpu->conf->show_graph) && 
+       (edje_object_part_exists (cf->cpu_obj,"lines")))
      _cpu_face_graph_values(cf);
    else 
      _cpu_face_graph_clear(cf);
@@ -492,9 +494,8 @@
    int tmp_u, tmp_n, tmp_s, tmp_i;
    char dummy[16];
    FILE *stat;
-   //int cpu_count;
-   Edje_Message_Float msg;
-
+   int cpu_count;
+   //Edje_Message_Float msg;
    
    cpu_count = _cpu_face_get_cpu_count(cf);
    if (cpu_count == -1)
@@ -533,7 +534,7 @@
            tmp_i = 0;
         }
 
-   /* Update the values */   
+      /* Update the values */   
       cpu_stats[i] = (tmp_u + tmp_n + tmp_s) / cpu_count;
    
       old_u[i] = new_u;
@@ -547,13 +548,14 @@
       if (cpu_stats[i] >= 100)
         cpu_stats[i] = 100;
 
+      /*
       msg.val = cpu_stats[i];
       edje_object_message_send(cf->cpu_obj, EDJE_MESSAGE_FLOAT, i, &msg);
-
+      */
+      
       i++;
    }
-   fclose(stat);
-   
+   fclose(stat);   
 }
 
 static void 
@@ -573,19 +575,20 @@
    evas_object_geometry_get(cf->chart_obj, &x, &y, &w, &h);
 
    while (d < cpu_count)
-   {
-      v = (int)((double)cpu_stats[d] * ((double)h / (double)100));      
-      o = evas_object_line_add(cf->evas);
-      edje_object_part_swallow(cf->chart_obj, "lines", o);
-      evas_object_layer_set(o, 1);
-      if (cpu_stats[d] == 0)
-      evas_object_hide(o);
-      else 
-      {
-          evas_object_line_xy_set(o, (x + w), (y + h), (x + w), ((y + h) - v));
-          switch (d) {
-               case 0:
-                 evas_object_color_set(o, a, b, b, c);
+     {
+       v = (int)((double)cpu_stats[d] * ((double)h / (double)100));      
+       o = evas_object_line_add(cf->evas);
+       edje_object_part_swallow(cf->chart_obj, "lines", o);
+       evas_object_layer_set(o, 1);
+       if (cpu_stats[d] == 0)
+         evas_object_hide(o);
+       else 
+         {
+            evas_object_line_xy_set(o, (x + w), (y + h), (x + w), ((y + h) - 
v));
+            switch (d) 
+              {
+               case 0:
+                 evas_object_color_set(o, a, b, b, c);
                  break;
                case 1:
                   evas_object_color_set(o, b, a, b, c);
@@ -598,31 +601,31 @@
                   break;
                 default:
                   break;
-           }          
-          evas_object_pass_events_set(o, 1);
-          evas_object_show(o);
-      }
-   
-      cf->old_values[d] = evas_list_prepend(cf->old_values[d], o);
-      l = cf->old_values[d];
-      for (i = (x + w); l && (j -2) < w; l = l->next, j++) 
-      {
-          Evas_Coord oy;
-          Evas_Object *lo;
+              }               
+            evas_object_pass_events_set(o, 1);
+            evas_object_show(o);
+         }
+   
+       cf->old_values[d] = evas_list_prepend(cf->old_values[d], o);
+       l = cf->old_values[d];
+       for (i = (x + w); l && (j -2) < w; l = l->next, j++) 
+         {
+            Evas_Coord oy;
+            Evas_Object *lo;
        
-          lo = (Evas_Object *)evas_list_data(l);
-          evas_object_geometry_get(lo, NULL, &oy, NULL, NULL);
-          evas_object_move(lo, i--, oy);
-          last = lo;
-       }
-   
-      if ((j - 2) >= w) 
-      {
-          cf->old_values[d] = evas_list_remove(cf->old_values[d], last);
-          evas_object_del(last);
-      }
-      d++;
-   }
+            lo = (Evas_Object *)evas_list_data(l);
+            evas_object_geometry_get(lo, NULL, &oy, NULL, NULL);
+            evas_object_move(lo, i--, oy);
+            last = lo;
+         }
+   
+       if ((j - 2) >= w) 
+         {
+            cf->old_values[d] = evas_list_remove(cf->old_values[d], last);
+            evas_object_del(last);
+         }
+       d++;
+     }
 }
 
 static void 
@@ -632,17 +635,17 @@
    Evas_List *l;
 
    while (i < cpu_count)
-   {
-      for (l = cf->old_values[i]; l; l = l->next) 
-      {
-          Evas_Object *o;
-          o = evas_list_data(l);
-          evas_object_del(o);
-      }
-      evas_list_free(cf->old_values[i]);
-      cf->old_values[i] = NULL;
-      if (!cf->cpu->conf->show_graph)
-        evas_object_hide(cf->chart_obj);
-      i++;
-   }
+     {
+       for (l = cf->old_values[i]; l; l = l->next) 
+         {
+            Evas_Object *o;
+            o = evas_list_data(l);
+            evas_object_del(o);
+         }
+       evas_list_free(cf->old_values[i]);
+       cf->old_values[i] = NULL;
+       if (!cf->cpu->conf->show_graph)
+         evas_object_hide(cf->chart_obj);
+       i++;
+     }
 }




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to