From: Enlightenment S. <no-...@en...> - 2009-12-01 14:54:31
|
Log: Elm Policy Bidings Author: tiago Date: 2009-12-01 06:54:19 -0800 (Tue, 01 Dec 2009) New Revision: 44099 Modified: trunk/BINDINGS/python/python-elementary/elementary/__init__.py trunk/BINDINGS/python/python-elementary/elementary/elementary.c_elementary.pyx trunk/BINDINGS/python/python-elementary/include/elementary/c_elementary.pxd Modified: trunk/BINDINGS/python/python-elementary/elementary/__init__.py =================================================================== --- trunk/BINDINGS/python/python-elementary/elementary/__init__.py 2009-12-01 14:35:57 UTC (rev 44098) +++ trunk/BINDINGS/python/python-elementary/elementary/__init__.py 2009-12-01 14:54:19 UTC (rev 44099) @@ -23,7 +23,7 @@ Radio, Check, Pager, InnerWindow, Image, Spinner, Fileselector, Notify, \ Separator, Progressbar, init, shutdown, run, exit, scale_get, scale_set, \ finger_size_get, finger_size_set, coords_finger_size_adjust, \ - theme_overlay_add, theme_extension_add + theme_overlay_add, theme_extension_add, policy_set, policy_get ELM_WIN_BASIC = 0 ELM_WIN_DIALOG_BASIC = 1 @@ -38,6 +38,12 @@ ELM_WIN_KEYBOARD_TERMINAL = 7 ELM_WIN_KEYBOARD_PASSWORD = 8 +ELM_POLICY_QUIT = 0 +ELM_POLICY_LAST = 1 + +ELM_POLICY_QUIT_NONE = 0 +ELM_POLICY_QUIT_LAST_WINDOW_CLOSED = 1 + ELM_HOVER_AXIS_NONE = 0 ELM_HOVER_AXIS_HORIZONTAL = 1 ELM_HOVER_AXIS_VERTICAL = 2 Modified: trunk/BINDINGS/python/python-elementary/elementary/elementary.c_elementary.pyx =================================================================== --- trunk/BINDINGS/python/python-elementary/elementary/elementary.c_elementary.pyx 2009-12-01 14:35:57 UTC (rev 44098) +++ trunk/BINDINGS/python/python-elementary/elementary/elementary.c_elementary.pyx 2009-12-01 14:54:19 UTC (rev 44099) @@ -45,6 +45,34 @@ def exit(): elm_exit() +def policy_set(policy, value): + """Set new policy value. + + This will emit the ecore event ELM_EVENT_POLICY_CHANGED in the main + loop giving the event information Elm_Event_Policy_Changed with + policy identifier, new and old values. + + @param policy policy identifier as in Elm_Policy. + @param value policy value, depends on identifiers, usually there is + an enumeration with the same prefix as the policy name, for + example: ELM_POLICY_QUIT and Elm_Policy_Quit + (ELM_POLICY_QUIT_NONE, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED). + + @return @c EINA_TRUE on success or @c EINA_FALSE on error (right + now just invalid policy identifier, but in future policy + value might be enforced). + """ + return elm_policy_set(policy, value) + +def policy_get(policy): + """Gets the policy value set for given identifier. + + @param policy policy identifier as in Elm_Policy. + + @return policy value. Will be 0 if policy identifier is invalid. + """ + return elm_policy_get(policy) + def scale_get(): return elm_scale_get() Modified: trunk/BINDINGS/python/python-elementary/include/elementary/c_elementary.pxd =================================================================== --- trunk/BINDINGS/python/python-elementary/include/elementary/c_elementary.pxd 2009-12-01 14:35:57 UTC (rev 44098) +++ trunk/BINDINGS/python/python-elementary/include/elementary/c_elementary.pxd 2009-12-01 14:54:19 UTC (rev 44099) @@ -51,6 +51,14 @@ ELM_WIN_KEYBOARD_TERMINAL ELM_WIN_KEYBOARD_PASSWORD +cdef enum Elm_Policy: + ELM_POLICY_QUIT + ELM_POLICY_LAST + +cdef enum Elm_Policy_Quit: + ELM_POLICY_QUIT_NONE + ELM_POLICY_QUIT_LAST_WINDOW_CLOSED + cdef enum Elm_Hover_Axis: ELM_HOVER_AXIS_NONE ELM_HOVER_AXIS_HORIZONTAL @@ -174,6 +182,10 @@ int elm_quicklaunch_fallback(int argc, char **argv) char *elm_quicklaunch_exe_path_get(char *exe) + # Policy + evas.c_evas.Eina_Bool elm_policy_set(unsigned int policy, int value) + int elm_policy_get(unsigned int policy) + # Object handling void elm_object_scale_set(evas.c_evas.Evas_Object *obj, double scale) double elm_object_scale_get(evas.c_evas.Evas_Object *obj) |