forked from enlightenment/enlightenment
fix fade out for if you dont have cpufreq control :)
SVN revision: 14234
This commit is contained in:
parent
b7804422b4
commit
0a13d9ec3e
|
@ -100,6 +100,8 @@ group {
|
||||||
part {
|
part {
|
||||||
name: "meter";
|
name: "meter";
|
||||||
type: IMAGE;
|
type: IMAGE;
|
||||||
|
clip_to: "fade_clip";
|
||||||
|
mouse_events: 0;
|
||||||
|
|
||||||
description {
|
description {
|
||||||
state: "default" 0.0;
|
state: "default" 0.0;
|
||||||
|
@ -191,6 +193,7 @@ group {
|
||||||
name: "decrease_button";
|
name: "decrease_button";
|
||||||
type: IMAGE;
|
type: IMAGE;
|
||||||
mouse_events: 1;
|
mouse_events: 1;
|
||||||
|
clip_to: "fade_clip";
|
||||||
|
|
||||||
description {
|
description {
|
||||||
state: "default" 0.0;
|
state: "default" 0.0;
|
||||||
|
@ -224,6 +227,7 @@ group {
|
||||||
name: "increase_button";
|
name: "increase_button";
|
||||||
type: IMAGE;
|
type: IMAGE;
|
||||||
mouse_events: 1;
|
mouse_events: 1;
|
||||||
|
clip_to: "fade_clip";
|
||||||
|
|
||||||
description {
|
description {
|
||||||
state: "default" 0.0;
|
state: "default" 0.0;
|
||||||
|
@ -257,7 +261,7 @@ group {
|
||||||
name: "cpu";
|
name: "cpu";
|
||||||
type: IMAGE;
|
type: IMAGE;
|
||||||
mouse_events: 1;
|
mouse_events: 1;
|
||||||
|
clip_to: "fade_clip";
|
||||||
description {
|
description {
|
||||||
state: "default" 0.0;
|
state: "default" 0.0;
|
||||||
rel1 {
|
rel1 {
|
||||||
|
@ -286,6 +290,7 @@ group {
|
||||||
type: TEXT;
|
type: TEXT;
|
||||||
effect: SOFT_SHADOW;
|
effect: SOFT_SHADOW;
|
||||||
mouse_events: 0;
|
mouse_events: 0;
|
||||||
|
clip_to: "fade_clip";
|
||||||
description {
|
description {
|
||||||
state: "default" 0.0;
|
state: "default" 0.0;
|
||||||
rel1 {
|
rel1 {
|
||||||
|
@ -311,6 +316,7 @@ group {
|
||||||
part {
|
part {
|
||||||
name: "decrease";
|
name: "decrease";
|
||||||
type: RECT;
|
type: RECT;
|
||||||
|
clip_to: "fade_clip";
|
||||||
description {
|
description {
|
||||||
state: "default" 0.0;
|
state: "default" 0.0;
|
||||||
visible: 1;
|
visible: 1;
|
||||||
|
@ -334,6 +340,7 @@ group {
|
||||||
part {
|
part {
|
||||||
name: "increase";
|
name: "increase";
|
||||||
type: RECT;
|
type: RECT;
|
||||||
|
clip_to: "fade_clip";
|
||||||
description {
|
description {
|
||||||
state: "default" 0.0;
|
state: "default" 0.0;
|
||||||
visible: 1;
|
visible: 1;
|
||||||
|
@ -353,6 +360,19 @@ group {
|
||||||
visible: 0;
|
visible: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
part {
|
||||||
|
name: "fade_clip";
|
||||||
|
type: RECT;
|
||||||
|
mouse_events: 0;
|
||||||
|
description {
|
||||||
|
state: "default" 0.0;
|
||||||
|
color: 255 255 255 255;
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "faded" 0.0;
|
||||||
|
color: 255 255 255 128;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} /* end parts */
|
} /* end parts */
|
||||||
|
|
||||||
|
@ -417,5 +437,19 @@ group {
|
||||||
action: STATE_SET "default" 0.0;
|
action: STATE_SET "default" 0.0;
|
||||||
target: "decrease_button";
|
target: "decrease_button";
|
||||||
}
|
}
|
||||||
|
program {
|
||||||
|
name: "enabled";
|
||||||
|
signal: "active";
|
||||||
|
source: "";
|
||||||
|
action: STATE_SET "default" 0.0;
|
||||||
|
target: "fade_clip";
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "disabled";
|
||||||
|
signal: "passive";
|
||||||
|
source: "";
|
||||||
|
action: STATE_SET "faded" 0.0;
|
||||||
|
target: "fade_clip";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,9 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "e_mod_main.h"
|
#include "e_mod_main.h"
|
||||||
|
|
||||||
/* FIXME: need to handle performance and powersave convernors (only auto/manual now)
|
/* FIXME: need to handle performance and powersave gonvernors (only auto(ondemand)/manual(userspace) supported now)
|
||||||
* FIXME: check permissions (can execute) before trying
|
* FIXME: check permissions (can execute) setfreq before trying
|
||||||
* FIXME: display throttling state
|
* FIXME: display throttling state
|
||||||
* FIXME: if system doesnt support cpufreq - fade out
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static Cpufreq *_cpufreq_new(E_Module *module);
|
static Cpufreq *_cpufreq_new(E_Module *module);
|
||||||
|
@ -496,9 +495,10 @@ _cpufreq_cb_check(void *data)
|
||||||
Cpufreq *e;
|
Cpufreq *e;
|
||||||
Cpufreq_Face *face;
|
Cpufreq_Face *face;
|
||||||
Evas_List *l;
|
Evas_List *l;
|
||||||
|
int active;
|
||||||
|
|
||||||
e = data;
|
e = data;
|
||||||
|
active = e->status->active;
|
||||||
if (_cpufreq_status_check_current(e->status))
|
if (_cpufreq_status_check_current(e->status))
|
||||||
{
|
{
|
||||||
for (l = e->faces; l; l = l->next)
|
for (l = e->faces; l; l = l->next)
|
||||||
|
@ -507,6 +507,17 @@ _cpufreq_cb_check(void *data)
|
||||||
_cpufreq_face_update_current(face);
|
_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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -524,6 +535,7 @@ _cpufreq_status_new()
|
||||||
e->cur_frequency = 0;
|
e->cur_frequency = 0;
|
||||||
e->can_set_frequency = 0;
|
e->can_set_frequency = 0;
|
||||||
e->cur_governor = NULL;
|
e->cur_governor = NULL;
|
||||||
|
e->active = -1;
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
@ -649,17 +661,20 @@ _cpufreq_status_check_current(Status *e)
|
||||||
int frequency;
|
int frequency;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
e->active = 0;
|
||||||
|
|
||||||
f = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", "r");
|
f = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", "r");
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
fgets(buf, sizeof(buf), f); buf[sizeof(buf) - 1] = 0;
|
fgets(buf, sizeof(buf), f);
|
||||||
|
buf[sizeof(buf) - 1] = 0;
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
frequency = atoi(buf);
|
frequency = atoi(buf);
|
||||||
if (frequency != e->cur_frequency)
|
if (frequency != e->cur_frequency)
|
||||||
ret = 1;
|
ret = 1;
|
||||||
e->cur_frequency = frequency;
|
e->cur_frequency = frequency;
|
||||||
|
e->active = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
f = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed", "r");
|
f = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed", "r");
|
||||||
|
@ -676,7 +691,8 @@ _cpufreq_status_check_current(Status *e)
|
||||||
f = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor", "r");
|
f = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor", "r");
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
fgets(buf, sizeof(buf), f); buf[sizeof(buf) - 1] = 0;
|
fgets(buf, sizeof(buf), f);
|
||||||
|
buf[sizeof(buf) - 1] = 0;
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
if ((e->cur_governor == NULL) || (strcmp(buf, e->cur_governor)))
|
if ((e->cur_governor == NULL) || (strcmp(buf, e->cur_governor)))
|
||||||
|
|
|
@ -17,6 +17,7 @@ struct _Status
|
||||||
int cur_frequency;
|
int cur_frequency;
|
||||||
int can_set_frequency;
|
int can_set_frequency;
|
||||||
char *cur_governor;
|
char *cur_governor;
|
||||||
|
unsigned char active;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Config
|
struct _Config
|
||||||
|
|
Loading…
Reference in New Issue