aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore/ecore.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2013-08-08 20:09:37 -0300
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2013-08-09 12:14:00 -0300
commit0a9c78896b875c265c80177a6b5fde16b7820339 (patch)
tree044e6742edf2c8e91c5a690cecb1990b73fc6fbe /src/lib/ecore/ecore.c
parentEvas textblock: make an if look nicer (no logic change). (diff)
downloadefl-0a9c78896b875c265c80177a6b5fde16b7820339.tar.gz
ecore: add system-level events.
- ECORE_EVENT_LOW_MEMORY: Low memory state changed - ECORE_EVENT_LOW_BATTERY: Low battery state changed - ECORE_EVENT_LOCALE_CHANGED: Locale changed - ECORE_EVENT_HOSTNAME_CHANGED: Hostname changed - ECORE_EVENT_SYSTEM_TIMEDATE_CHANGED: Time or Date changed
Diffstat (limited to 'src/lib/ecore/ecore.c')
-rw-r--r--src/lib/ecore/ecore.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c
index 879f130d8d..28726a2229 100644
--- a/src/lib/ecore/ecore.c
+++ b/src/lib/ecore/ecore.c
@@ -98,6 +98,9 @@ static int _thread_id = -1;
static int _thread_id_max = 0;
static int _thread_id_update = 0;
+static Eina_Bool _ecore_low_memory = EINA_FALSE;
+static Eina_Bool _ecore_low_battery = EINA_FALSE;
+
#ifdef HAVE_SYSTEMD
static Ecore_Timer *_systemd_watchdog = NULL;
#endif
@@ -915,6 +918,37 @@ _thread_callback(void *data EINA_UNUSED,
_ecore_main_call_flush();
}
+EAPI Eina_Bool
+ecore_low_memory_get(void)
+{
+ return _ecore_low_memory;
+}
+
+EAPI void
+ecore_low_memory_set(Eina_Bool status)
+{
+ status = !!status;
+ if (_ecore_low_memory == status) return;
+ _ecore_low_memory = status;
+ ecore_event_add(ECORE_EVENT_LOW_MEMORY, NULL, NULL, NULL);
+}
+
+EAPI Eina_Bool
+ecore_low_battery_get(void)
+{
+ return _ecore_low_battery;
+}
+
+EAPI void
+ecore_low_battery_set(Eina_Bool status)
+{
+ status = !!status;
+ if (_ecore_low_battery == status) return;
+ _ecore_low_battery = status;
+ ecore_event_add(ECORE_EVENT_LOW_BATTERY, NULL, NULL, NULL);
+}
+
+
static const Eo_Class_Description parent_class_desc = {
EO_VERSION,
"ecore_parent",