2005-04-18 07:33:24 -07:00
|
|
|
images {
|
|
|
|
image: "e17_cpufreq_freq00.png" COMP;
|
|
|
|
image: "e17_cpufreq_freq01.png" COMP;
|
|
|
|
image: "e17_cpufreq_freq02.png" COMP;
|
|
|
|
image: "e17_cpufreq_freq03.png" COMP;
|
|
|
|
image: "e17_cpufreq_freq04.png" COMP;
|
|
|
|
image: "e17_cpufreq_freq05.png" COMP;
|
|
|
|
image: "e17_cpufreq_freq06.png" COMP;
|
|
|
|
image: "e17_cpufreq_freq07.png" COMP;
|
|
|
|
image: "e17_cpufreq_freq08.png" COMP;
|
|
|
|
image: "e17_cpufreq_freq09.png" COMP;
|
|
|
|
image: "e17_cpufreq_freq10.png" COMP;
|
|
|
|
image: "e17_cpufreq_increase1.png" COMP;
|
|
|
|
image: "e17_cpufreq_increase2.png" COMP;
|
|
|
|
image: "e17_cpufreq_decrease1.png" COMP;
|
|
|
|
image: "e17_cpufreq_decrease2.png" COMP;
|
|
|
|
image: "e17_cpufreq_cpu1.png" COMP;
|
|
|
|
image: "e17_cpufreq_cpu2.png" COMP;
|
|
|
|
}
|
|
|
|
|
|
|
|
group {
|
|
|
|
name: "modules/cpufreq/main";
|
|
|
|
min: 4 4;
|
|
|
|
max: 128 128;
|
|
|
|
|
|
|
|
script {
|
|
|
|
public available_frequencies;
|
|
|
|
public available_governors;
|
|
|
|
|
|
|
|
public message(Msg_Type:type, id, ...) {
|
|
|
|
if ((type == MSG_INT_SET) && (id == 1)) {
|
|
|
|
while (count(available_frequencies) > 0) {
|
|
|
|
remove(available_frequencies, 0);
|
|
|
|
}
|
|
|
|
for (new i = 2; i < numargs(); i++) {
|
|
|
|
append_int(available_frequencies, getarg(i));
|
|
|
|
}
|
|
|
|
} else if ((type == MSG_STRING_SET) && (id == 2)) {
|
|
|
|
new text[100];
|
|
|
|
|
|
|
|
while (count(available_governors) > 0) {
|
|
|
|
remove(available_governors, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (new i = 2; i < numargs(); i++) {
|
|
|
|
snprintf(text, 100, "%s", getarg(i));
|
|
|
|
append_str(available_governors, text);
|
|
|
|
}
|
|
|
|
} else if ((type == MSG_INT_SET) && (id == 3)) {
|
|
|
|
new f = getarg(2);
|
|
|
|
new use_buttons = getarg(3);
|
|
|
|
new Float:freq, Float:min_freq, Float:max_freq;
|
|
|
|
new text[100];
|
|
|
|
|
|
|
|
freq = f;
|
|
|
|
min_freq = fetch_int(available_frequencies, 0);
|
|
|
|
max_freq = fetch_int(available_frequencies,
|
|
|
|
count(available_frequencies) - 1);
|
|
|
|
|
|
|
|
freq = (freq - min_freq) / (max_freq - min_freq);
|
|
|
|
set_state(PART:"meter", "default", freq);
|
|
|
|
|
|
|
|
if (f < 1000000) {
|
|
|
|
snprintf(text, 100, "%i Mhz", f / 1000);
|
|
|
|
} else {
|
|
|
|
snprintf(text, 100, "%i.%i Ghz", f / 1000000,
|
|
|
|
(f % 1000000) / 100000);
|
|
|
|
}
|
|
|
|
set_text(PART:"readout", text);
|
|
|
|
|
|
|
|
if (use_buttons == 0) {
|
|
|
|
set_state(PART:"increase_button", "inactive", 0.0);
|
|
|
|
set_state(PART:"decrease_button", "inactive", 0.0);
|
|
|
|
set_state(PART:"increase", "inactive", 0.0);
|
|
|
|
set_state(PART:"decrease", "inactive", 0.0);
|
|
|
|
} else {
|
|
|
|
set_state(PART:"increase_button", "default", 0.0);
|
|
|
|
set_state(PART:"decrease_button", "default", 0.0);
|
|
|
|
set_state(PART:"increase", "default", 0.0);
|
|
|
|
set_state(PART:"decrease", "default", 0.0);
|
|
|
|
}
|
|
|
|
} else if((type == MSG_STRING) && (id == 4)) {
|
|
|
|
new text[100];
|
|
|
|
snprintf(text, 100, "%s", getarg(2));
|
|
|
|
/*
|
|
|
|
if (!strcmp(text, "performance") || !strcmp(text, "powersave") ||
|
|
|
|
!strcmp(text, "userspace") || !strcmp(text, "ondemand")) {
|
|
|
|
set_state(PART:"governor", text, 0.0);
|
|
|
|
set_state(PART:"governorbackground", text, 0.0);
|
|
|
|
} else {
|
|
|
|
set_state(PART:"governor", "default", 0.0);
|
|
|
|
set_state(PART:"governorbackground", "default", 0.0);
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
parts {
|
|
|
|
part {
|
|
|
|
name: "meter";
|
|
|
|
type: IMAGE;
|
2005-04-18 20:51:49 -07:00
|
|
|
clip_to: "fade_clip";
|
|
|
|
mouse_events: 0;
|
2005-04-18 07:33:24 -07:00
|
|
|
|
|
|
|
description {
|
|
|
|
state: "default" 0.0;
|
|
|
|
rel1 {
|
|
|
|
relative: 0.078125 0.0;
|
|
|
|
offset: 0 0;
|
|
|
|
}
|
|
|
|
rel2 {
|
|
|
|
relative: 0.921875 0.375;
|
|
|
|
offset: -1 -1;
|
|
|
|
}
|
|
|
|
image {
|
|
|
|
normal: "e17_cpufreq_freq00.png";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
description {
|
|
|
|
state: "default" 0.1;
|
|
|
|
inherit: "default" 0.0;
|
|
|
|
image {
|
|
|
|
normal: "e17_cpufreq_freq01.png";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
description {
|
|
|
|
state: "default" 0.2;
|
|
|
|
inherit: "default" 0.0;
|
|
|
|
image {
|
|
|
|
normal: "e17_cpufreq_freq02.png";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
description {
|
|
|
|
state: "default" 0.3;
|
|
|
|
inherit: "default" 0.0;
|
|
|
|
image {
|
|
|
|
normal: "e17_cpufreq_freq03.png";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
description {
|
|
|
|
state: "default" 0.4;
|
|
|
|
inherit: "default" 0.0;
|
|
|
|
image {
|
|
|
|
normal: "e17_cpufreq_freq04.png";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
description {
|
|
|
|
state: "default" 0.5;
|
|
|
|
inherit: "default" 0.0;
|
|
|
|
image {
|
|
|
|
normal: "e17_cpufreq_freq05.png";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
description {
|
|
|
|
state: "default" 0.6;
|
|
|
|
inherit: "default" 0.0;
|
|
|
|
image {
|
|
|
|
normal: "e17_cpufreq_freq06.png";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
description {
|
|
|
|
state: "default" 0.7;
|
|
|
|
inherit: "default" 0.0;
|
|
|
|
image {
|
|
|
|
normal: "e17_cpufreq_freq07.png";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
description {
|
|
|
|
state: "default" 0.8;
|
|
|
|
inherit: "default" 0.0;
|
|
|
|
image {
|
|
|
|
normal: "e17_cpufreq_freq08.png";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
description {
|
|
|
|
state: "default" 0.9;
|
|
|
|
inherit: "default" 0.0;
|
|
|
|
image {
|
|
|
|
normal: "e17_cpufreq_freq09.png";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
description {
|
|
|
|
state: "default" 1.00;
|
|
|
|
inherit: "default" 0.0;
|
|
|
|
image {
|
|
|
|
normal: "e17_cpufreq_freq10.png";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
part {
|
|
|
|
name: "decrease_button";
|
|
|
|
type: IMAGE;
|
|
|
|
mouse_events: 1;
|
2005-04-18 20:51:49 -07:00
|
|
|
clip_to: "fade_clip";
|
2005-04-18 07:33:24 -07:00
|
|
|
|
|
|
|
description {
|
|
|
|
state: "default" 0.0;
|
|
|
|
rel1 {
|
|
|
|
relative: 0.0 0.;
|
|
|
|
offset: 0 0;
|
|
|
|
}
|
|
|
|
rel2 {
|
|
|
|
relative: 1.0 0.375;
|
|
|
|
offset: -1 -1;
|
|
|
|
}
|
|
|
|
image {
|
|
|
|
normal: "e17_cpufreq_decrease1.png";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
description {
|
|
|
|
state: "clicked" 0.0;
|
|
|
|
inherit: "default" 0.0;
|
|
|
|
image {
|
|
|
|
normal: "e17_cpufreq_decrease2.png";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
description {
|
|
|
|
state: "inactive" 0.0;
|
|
|
|
inherit: "default" 0.0;
|
|
|
|
visible: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
part {
|
|
|
|
name: "increase_button";
|
|
|
|
type: IMAGE;
|
|
|
|
mouse_events: 1;
|
2005-04-18 20:51:49 -07:00
|
|
|
clip_to: "fade_clip";
|
2005-04-18 07:33:24 -07:00
|
|
|
|
|
|
|
description {
|
|
|
|
state: "default" 0.0;
|
|
|
|
rel1 {
|
|
|
|
relative: 0.0 0.;
|
|
|
|
offset: 0 0;
|
|
|
|
}
|
|
|
|
rel2 {
|
|
|
|
relative: 1.0 0.375;
|
|
|
|
offset: -1 -1;
|
|
|
|
}
|
|
|
|
image {
|
|
|
|
normal: "e17_cpufreq_increase1.png";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
description {
|
|
|
|
state: "clicked" 0.0;
|
|
|
|
inherit: "default" 0.0;
|
|
|
|
image {
|
|
|
|
normal: "e17_cpufreq_increase2.png";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
description {
|
|
|
|
state: "inactive" 0.0;
|
|
|
|
inherit: "default" 0.0;
|
|
|
|
visible: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
part {
|
|
|
|
name: "cpu";
|
|
|
|
type: IMAGE;
|
|
|
|
mouse_events: 1;
|
2005-04-18 20:51:49 -07:00
|
|
|
clip_to: "fade_clip";
|
2005-04-18 07:33:24 -07:00
|
|
|
description {
|
|
|
|
state: "default" 0.0;
|
|
|
|
rel1 {
|
|
|
|
relative: 0.1953125 0.3671875;
|
|
|
|
offset: 0 0;
|
|
|
|
}
|
|
|
|
rel2 {
|
|
|
|
relative: 0.8359375 1.0;
|
|
|
|
offset: -1 -1;
|
|
|
|
}
|
|
|
|
image {
|
|
|
|
normal: "e17_cpufreq_cpu1.png";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
description {
|
|
|
|
state: "clicked" 0.0;
|
|
|
|
inherit: "default" 0.0;
|
|
|
|
image {
|
|
|
|
normal: "e17_cpufreq_cpu2.png";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
part {
|
|
|
|
name: "readout";
|
|
|
|
type: TEXT;
|
|
|
|
effect: SOFT_SHADOW;
|
|
|
|
mouse_events: 0;
|
2005-04-18 20:51:49 -07:00
|
|
|
clip_to: "fade_clip";
|
2005-04-18 07:33:24 -07:00
|
|
|
description {
|
|
|
|
state: "default" 0.0;
|
|
|
|
rel1 {
|
|
|
|
relative: 0.5 0.7;
|
|
|
|
offset: 0 0;
|
|
|
|
}
|
|
|
|
rel2 {
|
|
|
|
relative: 0.5 0.7;
|
|
|
|
offset: 0 0;
|
|
|
|
}
|
|
|
|
color: 255 255 255 255;
|
|
|
|
color3: 0 0 0 32;
|
|
|
|
text {
|
|
|
|
text: "??? Ghz";
|
2005-09-17 23:27:48 -07:00
|
|
|
font: "Edje-Vera";
|
2005-04-18 07:33:24 -07:00
|
|
|
size: 7;
|
|
|
|
align: 0.5 0.5;
|
|
|
|
min: 1 1;
|
2006-03-19 04:24:19 -08:00
|
|
|
text_class: "cpufreq";
|
2005-04-18 07:33:24 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
part {
|
|
|
|
name: "decrease";
|
|
|
|
type: RECT;
|
2005-04-18 20:51:49 -07:00
|
|
|
clip_to: "fade_clip";
|
2005-04-18 07:33:24 -07:00
|
|
|
description {
|
|
|
|
state: "default" 0.0;
|
|
|
|
visible: 1;
|
|
|
|
rel1 {
|
|
|
|
relative: 0.0 0.0;
|
|
|
|
offset: 0 0;
|
|
|
|
}
|
|
|
|
rel2 {
|
|
|
|
relative: 0.5 0.375;
|
|
|
|
offset: -1 -1;
|
|
|
|
}
|
|
|
|
color: 0 0 0 0;
|
|
|
|
}
|
|
|
|
description {
|
|
|
|
state: "inactive" 0.0;
|
|
|
|
inherit: "default" 0.0;
|
|
|
|
visible: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
part {
|
|
|
|
name: "increase";
|
|
|
|
type: RECT;
|
2005-04-18 20:51:49 -07:00
|
|
|
clip_to: "fade_clip";
|
2005-04-18 07:33:24 -07:00
|
|
|
description {
|
|
|
|
state: "default" 0.0;
|
|
|
|
visible: 1;
|
|
|
|
rel1 {
|
|
|
|
relative: 0.5 0.0;
|
|
|
|
offset: 0 0;
|
|
|
|
}
|
|
|
|
rel2 {
|
|
|
|
relative: 1.0 0.375;
|
|
|
|
offset: -1 -1;
|
|
|
|
}
|
|
|
|
color: 0 0 0 0;
|
|
|
|
}
|
|
|
|
description {
|
|
|
|
state: "inactive" 0.0;
|
|
|
|
inherit: "default" 0.0;
|
|
|
|
visible: 0;
|
|
|
|
}
|
|
|
|
}
|
2005-04-18 20:51:49 -07:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
2005-04-18 07:33:24 -07:00
|
|
|
|
|
|
|
} /* end parts */
|
|
|
|
|
|
|
|
programs {
|
|
|
|
program {
|
|
|
|
name: "next_governor";
|
|
|
|
signal: "mouse,down,1";
|
|
|
|
source: "cpu";
|
|
|
|
action: SIGNAL_EMIT "next_governor" "governor";
|
|
|
|
}
|
|
|
|
program {
|
|
|
|
name: "next_governor2";
|
|
|
|
signal: "mouse,down,1";
|
|
|
|
source: "cpu";
|
|
|
|
action: STATE_SET "clicked" 0.0;
|
|
|
|
target: "cpu";
|
|
|
|
}
|
|
|
|
program {
|
|
|
|
name: "next_governor3";
|
|
|
|
signal: "mouse,up,1";
|
|
|
|
source: "cpu";
|
|
|
|
action: STATE_SET "default" 0.0;
|
|
|
|
target: "cpu";
|
|
|
|
}
|
|
|
|
program {
|
|
|
|
name: "increase_frequency";
|
|
|
|
signal: "mouse,down,1";
|
|
|
|
source: "increase";
|
|
|
|
action: SIGNAL_EMIT "increase_frequency" "frequency";
|
|
|
|
}
|
|
|
|
program {
|
|
|
|
name: "increase_frequency2";
|
|
|
|
signal: "mouse,down,1";
|
|
|
|
source: "increase";
|
|
|
|
action: STATE_SET "clicked" 0.0;
|
|
|
|
target: "increase_button";
|
|
|
|
}
|
|
|
|
program {
|
|
|
|
name: "increase_frequency3";
|
|
|
|
signal: "mouse,up,1";
|
|
|
|
source: "increase";
|
|
|
|
action: STATE_SET "default" 0.0;
|
|
|
|
target: "increase_button";
|
|
|
|
}
|
|
|
|
program {
|
|
|
|
name: "decrease_frequency";
|
|
|
|
signal: "mouse,down,1";
|
|
|
|
source: "decrease";
|
|
|
|
action: SIGNAL_EMIT "decrease_frequency" "frequency";
|
|
|
|
}
|
|
|
|
program {
|
|
|
|
name: "decrease_frequency2";
|
|
|
|
signal: "mouse,down,1";
|
|
|
|
source: "decrease";
|
|
|
|
action: STATE_SET "clicked" 0.0;
|
|
|
|
target: "decrease_button";
|
|
|
|
}
|
|
|
|
program {
|
|
|
|
name: "decrease_frequency3";
|
|
|
|
signal: "mouse,up,1";
|
|
|
|
source: "decrease";
|
|
|
|
action: STATE_SET "default" 0.0;
|
|
|
|
target: "decrease_button";
|
|
|
|
}
|
2005-04-18 20:51:49 -07:00
|
|
|
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";
|
|
|
|
}
|
2005-04-18 07:33:24 -07:00
|
|
|
}
|
|
|
|
}
|