Enlightenment CVS committal
Author : raster
Project : e17
Module : apps/e
Dir : e17/apps/e/src/modules/cpufreq
Modified Files:
e_mod_main.c e_mod_main.h
Log Message:
fix fade out for if you dont have cpufreq control :)
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/cpufreq/e_mod_main.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_mod_main.c 19 Apr 2005 02:52:56 -0000 1.3
+++ e_mod_main.c 19 Apr 2005 03:51:49 -0000 1.4
@@ -2,10 +2,9 @@
#include <errno.h>
#include "e_mod_main.h"
-/* FIXME: need to handle performance and powersave convernors (only
auto/manual now)
- * FIXME: check permissions (can execute) before trying
+/* FIXME: need to handle performance and powersave gonvernors (only
auto(ondemand)/manual(userspace) supported now)
+ * FIXME: check permissions (can execute) setfreq before trying
* FIXME: display throttling state
- * FIXME: if system doesnt support cpufreq - fade out
*/
static Cpufreq *_cpufreq_new(E_Module *module);
@@ -496,9 +495,10 @@
Cpufreq *e;
Cpufreq_Face *face;
Evas_List *l;
-
+ int active;
+
e = data;
-
+ active = e->status->active;
if (_cpufreq_status_check_current(e->status))
{
for (l = e->faces; l; l = l->next)
@@ -506,7 +506,18 @@
face = l->data;
_cpufreq_face_update_current(face);
}
- }
+ }
+ if (active != e->status->active)
+ {
+ for (l = e->faces; l; l = l->next)
+ {
+ face = l->data;
+ if (e->status->active == 0)
+ edje_object_signal_emit(face->freq_object, "passive", "");
+ else if (e->status->active == 1)
+ edje_object_signal_emit(face->freq_object, "active", "");
+ }
+ }
return 1;
}
@@ -524,6 +535,7 @@
e->cur_frequency = 0;
e->can_set_frequency = 0;
e->cur_governor = NULL;
+ e->active = -1;
return e;
}
@@ -649,17 +661,20 @@
int frequency;
ret = 0;
+ e->active = 0;
f = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", "r");
if (f)
{
- fgets(buf, sizeof(buf), f); buf[sizeof(buf) - 1] = 0;
+ fgets(buf, sizeof(buf), f);
+ buf[sizeof(buf) - 1] = 0;
fclose(f);
frequency = atoi(buf);
- if(frequency != e->cur_frequency)
+ if (frequency != e->cur_frequency)
ret = 1;
e->cur_frequency = frequency;
+ e->active = 1;
}
f = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed", "r");
@@ -676,14 +691,15 @@
f = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor", "r");
if (f)
{
- fgets(buf, sizeof(buf), f); buf[sizeof(buf) - 1] = 0;
+ fgets(buf, sizeof(buf), f);
+ buf[sizeof(buf) - 1] = 0;
fclose(f);
if ((e->cur_governor == NULL) || (strcmp(buf, e->cur_governor)))
{
ret = 1;
- if(e->cur_governor)
+ if (e->cur_governor)
free(e->cur_governor);
e->cur_governor = strdup(buf);
@@ -696,7 +712,7 @@
}
}
}
-
+
return ret;
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/cpufreq/e_mod_main.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- e_mod_main.h 18 Apr 2005 14:33:24 -0000 1.1
+++ e_mod_main.h 19 Apr 2005 03:51:49 -0000 1.2
@@ -17,6 +17,7 @@
int cur_frequency;
int can_set_frequency;
char *cur_governor;
+ unsigned char active;
};
struct _Config
@@ -41,7 +42,7 @@
Config *conf;
Status *status;
- char *set_exe_path;
+ char *set_exe_path;
Ecore_Timer *frequency_check_timer;
};
-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs