aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/e_powersave.c
diff options
context:
space:
mode:
authorViktor Kojouharov <vkojouharov@gmail.com>2008-11-24 08:32:34 +0000
committerViktor Kojouharov <vkojouharov@gmail.com>2008-11-24 08:32:34 +0000
commit8087cda39d272fcb0f6c275c84ebc6a1b3db1323 (patch)
tree89315b117c35f11cd2c86db7dd231294956d4259 /src/bin/e_powersave.c
parentMerged new pot files to all avaliable po files (diff)
downloadenlightenment-8087cda39d272fcb0f6c275c84ebc6a1b3db1323.tar.gz
E_EVENT_POWERSAVE_UPDATE for the masses
cpufreq auto-changes the governor depending on the powersave mode SVN revision: 37788
Diffstat (limited to 'src/bin/e_powersave.c')
-rw-r--r--src/bin/e_powersave.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/bin/e_powersave.c b/src/bin/e_powersave.c
index be5783aed..ecf4314ec 100644
--- a/src/bin/e_powersave.c
+++ b/src/bin/e_powersave.c
@@ -13,8 +13,10 @@ struct _E_Powersave_Deferred_Action
/* local subsystem functions */
static int _e_powersave_cb_deferred_timer(void *data);
static void _e_powersave_mode_eval(void);
+static void _e_powersave_event_update_free(void *data __UNUSED__, void *event);
/* local subsystem globals */
+EAPI int E_EVENT_POWERSAVE_UPDATE = 0;
static int walking_deferred_actions = 0;
static Eina_List *deferred_actions = NULL;
static Ecore_Timer *deferred_timer = NULL;
@@ -28,6 +30,7 @@ EAPI int
e_powersave_init(void)
{
_e_powersave_mode_eval();
+ E_EVENT_POWERSAVE_UPDATE = ecore_event_type_new();
return 1;
}
@@ -94,11 +97,17 @@ e_powersave_mode_max_set(E_Powersave_Mode mode)
EAPI void
e_powersave_mode_set(E_Powersave_Mode mode)
{
+ E_Event_Powersave_Update *ev;
+
if (mode < powersave_mode_min) mode = powersave_mode_min;
else if (mode > powersave_mode_max) mode = powersave_mode_max;
if (powersave_mode == mode) return;
printf("CHANGE PW SAVE MODE TO %i / %i\n", (int)mode, E_POWERSAVE_MODE_EXTREME);
powersave_mode = mode;
+
+ ev = E_NEW(E_Event_Powersave_Update, 1);
+ ev->mode = mode;
+ ecore_event_add(E_EVENT_POWERSAVE_UPDATE, ev, _e_powersave_event_update_free, NULL);
_e_powersave_mode_eval();
}
@@ -175,3 +184,9 @@ _e_powersave_mode_eval(void)
NULL);
}
}
+
+static void
+_e_powersave_event_update_free(void *data __UNUSED__, void *event)
+{
+ free(event);
+}