summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2014-11-18 21:42:31 +0100
committerDave Andreoli <dave@gurumeditation.it>2014-11-18 21:42:31 +0100
commitda1807c379b981ea54733385afc59b205198a8a7 (patch)
treea0cce0bb02188debae080350a6e6cb78c8ef7c33
parent5668d3049851cb6ed8204987e6bbf46a50c047cf (diff)
New 1.12 API: elm_process_state_get
-rw-r--r--TODO1
-rw-r--r--efl/elementary/enums.pxd4
-rw-r--r--efl/elementary/general.pxd4
-rw-r--r--efl/elementary/general.pyx38
4 files changed, 46 insertions, 1 deletions
diff --git a/TODO b/TODO
index 6dd0f1d..8f260d3 100644
--- a/TODO
+++ b/TODO
@@ -44,3 +44,4 @@ Elm
44 - video 44 - video
45 - web 45 - web
46 - window ? 46 - window ?
47* How are the ecore events managed? for example: ELM_EVENT_PROCESS_FOREGROUND
diff --git a/efl/elementary/enums.pxd b/efl/elementary/enums.pxd
index 09db4e1..a676c6b 100644
--- a/efl/elementary/enums.pxd
+++ b/efl/elementary/enums.pxd
@@ -417,6 +417,10 @@ cdef extern from "Elementary.h":
417 ELM_POPUP_ORIENT_BOTTOM_RIGHT 417 ELM_POPUP_ORIENT_BOTTOM_RIGHT
418 ELM_POPUP_ORIENT_LAST 418 ELM_POPUP_ORIENT_LAST
419 419
420 ctypedef enum Elm_Process_State:
421 ELM_PROCESS_STATE_FOREGROUND
422 ELM_PROCESS_STATE_BACKGROUND
423
420 ctypedef enum Elm_Scroller_Policy: 424 ctypedef enum Elm_Scroller_Policy:
421 ELM_SCROLLER_POLICY_AUTO 425 ELM_SCROLLER_POLICY_AUTO
422 ELM_SCROLLER_POLICY_ON 426 ELM_SCROLLER_POLICY_ON
diff --git a/efl/elementary/general.pxd b/efl/elementary/general.pxd
index afb06a0..90e10e1 100644
--- a/efl/elementary/general.pxd
+++ b/efl/elementary/general.pxd
@@ -19,7 +19,8 @@
19from efl.evas cimport Eina_List, Eina_Bool 19from efl.evas cimport Eina_List, Eina_Bool
20from efl.evas cimport Evas_Object, Evas_Font_Size, Evas_Coord 20from efl.evas cimport Evas_Object, Evas_Font_Size, Evas_Coord
21from efl.evas.enums cimport Evas_Callback_Type 21from efl.evas.enums cimport Evas_Callback_Type
22from enums cimport Elm_Sys_Notify_Closed_Reason, Elm_Sys_Notify_Urgency 22from enums cimport Elm_Sys_Notify_Closed_Reason, Elm_Sys_Notify_Urgency, \
23 Elm_Process_State
23 24
24cdef extern from "time.h": 25cdef extern from "time.h":
25 struct tm: 26 struct tm:
@@ -81,6 +82,7 @@ cdef extern from "Elementary.h":
81 int elm_shutdown() 82 int elm_shutdown()
82 void elm_run() nogil 83 void elm_run() nogil
83 void elm_exit() 84 void elm_exit()
85 Elm_Process_State elm_process_state_get()
84 86
85 # General - Quicklaunch (XXX: Only used by macros?) 87 # General - Quicklaunch (XXX: Only used by macros?)
86 # void elm_quicklaunch_init(int argc, char **argv) 88 # void elm_quicklaunch_init(int argc, char **argv)
diff --git a/efl/elementary/general.pyx b/efl/elementary/general.pyx
index be3a096..eb6e6e4 100644
--- a/efl/elementary/general.pyx
+++ b/efl/elementary/general.pyx
@@ -117,6 +117,25 @@ Possible values for the #ELM_POLICY_THROTTLE policy.
117 Never throttle when windows are all hidden, regardless of config settings. 117 Never throttle when windows are all hidden, regardless of config settings.
118 118
119 119
120.. _Elm_Process_State:
121
122Elm_Process_State
123-----------------
124
125.. data:: ELM_PROCESS_STATE_FOREGROUND
126
127 The process is in a foreground/active/running state - work as normal.
128
129 ..versionadded:: 1.12
130
131.. data:: ELM_PROCESS_STATE_BACKGROUND
132
133 The process is in the bacgkround, so you may want to stop animating,
134 fetching data as often etc.
135
136 ..versionadded:: 1.12
137
138
120.. _Elm_Sys_Notify_Closed_Reason: 139.. _Elm_Sys_Notify_Closed_Reason:
121 140
122Notify close reasons 141Notify close reasons
@@ -270,6 +289,9 @@ ELM_GLOB_MATCH_PATH = enums.ELM_GLOB_MATCH_PATH
270ELM_GLOB_MATCH_PERIOD = enums.ELM_GLOB_MATCH_PERIOD 289ELM_GLOB_MATCH_PERIOD = enums.ELM_GLOB_MATCH_PERIOD
271ELM_GLOB_MATCH_NOCASE = enums.ELM_GLOB_MATCH_NOCASE 290ELM_GLOB_MATCH_NOCASE = enums.ELM_GLOB_MATCH_NOCASE
272 291
292ELM_PROCESS_STATE_FOREGROUND = enums.ELM_PROCESS_STATE_FOREGROUND
293ELM_PROCESS_STATE_BACKGROUND = enums.ELM_PROCESS_STATE_BACKGROUND
294
273import traceback 295import traceback
274 296
275cdef void py_elm_sys_notify_send_cb(void *data, unsigned int id): 297cdef void py_elm_sys_notify_send_cb(void *data, unsigned int id):
@@ -508,6 +530,22 @@ def policy_get(Elm_Policy policy):
508 """ 530 """
509 return elm_policy_get(policy) 531 return elm_policy_get(policy)
510 532
533def process_state_get():
534 """Get the process state as a while.
535
536 The process may logically be some runnable state. a "foreground" application
537 runs as normal and may be user-visible or "active" in some way. A
538 background application is not user-visible or otherwise important and
539 likely should release resources and not wake up often or process much.
540
541 :return: The current process state
542 :rtype: Elm_Process_State
543
544 .. versionadded: 1.12
545
546 """
547 return elm_process_state_get()
548
511def coords_finger_size_adjust(int times_w, int w, int times_h, int h): 549def coords_finger_size_adjust(int times_w, int w, int times_h, int h):
512 """Adjust size of an element for finger usage. 550 """Adjust size of an element for finger usage.
513 551