# Copyright (C) 2007-2014 various contributors (see AUTHORS)
#
# This file is part of Python-EFL.
#
# Python-EFL is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# Python-EFL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this Python-EFL. If not, see .
#
"""
.. _General:
General
=======
General Elementary API. Functions that don't relate to
Elementary objects specifically.
Here are documented functions which init/shutdown the library,
that apply to generic Elementary objects, that deal with
configuration, et cetera.
.. _Fingers:
Fingers
=======
Elementary is designed to be finger-friendly for touchscreens,
and so in addition to scaling for display resolution, it can
also scale based on finger "resolution" (or size). You can then
customize the granularity of the areas meant to receive clicks
on touchscreens.
Different profiles may have pre-set values for finger sizes.
Enumerations
============
.. _Elm_Policy:
Policy types
------------
.. data:: ELM_POLICY_QUIT
Under which circumstances the application should quit automatically.
.. data:: ELM_POLICY_EXIT
Defines elm_exit() behaviour. (since 1.8)
.. data:: ELM_POLICY_THROTTLE
Defines how throttling should work (since 1.8)
.. _Elm_Policy_Quit:
Quit policy types
-----------------
.. data:: ELM_POLICY_QUIT_NONE
Never quit the application automatically
.. data:: ELM_POLICY_QUIT_LAST_WINDOW_CLOSED
Quit when the application's last window is closed
.. _Elm_Policy_Exit:
Exit policy types
-----------------
Possible values for the ELM_POLICY_EXIT policy.
.. data:: ELM_POLICY_EXIT_NONE
Just quit the main loop on exit().
.. data:: ELM_POLICY_EXIT_WINDOWS_DEL
Delete all the windows after quitting the main loop.
.. _Elm_Policy_Throttle:
Throttle policy types
---------------------
Possible values for the #ELM_POLICY_THROTTLE policy.
.. data:: ELM_POLICY_THROTTLE_CONFIG
Do whatever elementary config is configured to do.
.. data:: ELM_POLICY_THROTTLE_HIDDEN_ALWAYS
Always throttle when all windows are no longer visible.
.. data:: ELM_POLICY_THROTTLE_NEVER
Never throttle when windows are all hidden, regardless of config settings.
.. _Elm_Process_State:
Elm_Process_State
-----------------
.. data:: ELM_PROCESS_STATE_FOREGROUND
The process is in a foreground/active/running state - work as normal.
..versionadded:: 1.12
.. data:: ELM_PROCESS_STATE_BACKGROUND
The process is in the bacgkround, so you may want to stop animating,
fetching data as often etc.
..versionadded:: 1.12
.. _Elm_Sys_Notify_Closed_Reason:
Notify close reasons
--------------------
The reason the notification was closed
.. data:: ELM_SYS_NOTIFY_CLOSED_EXPIRED
The notification expired.
.. versionadded:: 1.10
.. data:: ELM_SYS_NOTIFY_CLOSED_DISMISSED
The notification was dismissed by the user.
.. versionadded:: 1.10
.. data:: ELM_SYS_NOTIFY_CLOSED_REQUESTED
The notification was closed by a call to CloseNotification method.
.. versionadded:: 1.10
.. data:: ELM_SYS_NOTIFY_CLOSED_UNDEFINED
Undefined/reserved reasons.
.. versionadded:: 1.10
.. _Elm_Sys_Notify_Urgency:
Notify urgency levels
---------------------
Urgency levels of a notification
:see: :py:func:`sys_notify_send`
.. data:: ELM_SYS_NOTIFY_URGENCY_LOW
Low
.. versionadded:: 1.10
.. data:: ELM_SYS_NOTIFY_URGENCY_NORMAL
Normal
.. versionadded:: 1.10
.. data:: ELM_SYS_NOTIFY_URGENCY_CRITICAL
Critical
.. versionadded:: 1.10
.. _Elm_Glob_Match_Flags:
Glob matching
-------------
Glob matching bitfiled flags
.. data:: ELM_GLOB_MATCH_NO_ESCAPE
Treat backslash as an ordinary character instead of escape.
.. versionadded:: 1.11
.. data:: ELM_GLOB_MATCH_PATH
Match a slash in string only with a slash in pattern and not by an
asterisk (*) or a question mark (?) metacharacter, nor by a bracket
expression ([]) containing a slash.
.. versionadded:: 1.11
.. data:: ELM_GLOB_MATCH_PERIOD
Leading period in string has to be matched exactly by a period in
pattern. A period is considered to be leading if it is the first
character in string, or if both ELM_GLOB_MATCH_PATH is set and the
period immediately follows a slash.
.. versionadded:: 1.11
.. data:: ELM_GLOB_MATCH_NOCASE
The pattern is matched case-insensitively.
.. versionadded:: 1.11
"""
from cpython cimport PyUnicode_AsUTF8String, PyMem_Malloc, Py_DECREF, Py_INCREF
from libc.string cimport memcpy
from efl.evas cimport Object as evasObject
from efl.utils.conversions cimport _touni, _ctouni, \
python_list_strings_to_eina_list, \
eina_list_strings_to_python_list
from efl.utils.logger cimport add_logger
from efl.eina cimport EINA_LOG_DOM_DBG, EINA_LOG_DOM_INFO, \
EINA_LOG_DOM_WARN, EINA_LOG_DOM_ERR, EINA_LOG_DOM_CRIT
from efl.ecore cimport Event, EventHandler, _event_mapping_register
from efl.elementary.need cimport elm_need_sys_notify
cimport enums
from enums cimport Elm_Policy
import sys
ELM_POLICY_QUIT = enums.ELM_POLICY_QUIT
ELM_POLICY_EXIT = enums.ELM_POLICY_EXIT
ELM_POLICY_THROTTLE = enums.ELM_POLICY_THROTTLE
ELM_POLICY_QUIT_NONE = enums.ELM_POLICY_QUIT_NONE
ELM_POLICY_QUIT_LAST_WINDOW_CLOSED = enums.ELM_POLICY_QUIT_LAST_WINDOW_CLOSED
ELM_POLICY_EXIT_NONE = enums.ELM_POLICY_EXIT_NONE
ELM_POLICY_EXIT_WINDOWS_DEL = enums.ELM_POLICY_EXIT_WINDOWS_DEL
ELM_POLICY_THROTTLE_CONFIG = enums.ELM_POLICY_THROTTLE_CONFIG
ELM_POLICY_THROTTLE_HIDDEN_ALWAYS = enums.ELM_POLICY_THROTTLE_HIDDEN_ALWAYS
ELM_POLICY_THROTTLE_NEVER = enums.ELM_POLICY_THROTTLE_NEVER
ELM_SYS_NOTIFY_CLOSED_EXPIRED = enums.ELM_SYS_NOTIFY_CLOSED_EXPIRED
ELM_SYS_NOTIFY_CLOSED_DISMISSED = enums.ELM_SYS_NOTIFY_CLOSED_DISMISSED
ELM_SYS_NOTIFY_CLOSED_REQUESTED = enums.ELM_SYS_NOTIFY_CLOSED_REQUESTED
ELM_SYS_NOTIFY_CLOSED_UNDEFINED = enums.ELM_SYS_NOTIFY_CLOSED_UNDEFINED
ELM_SYS_NOTIFY_URGENCY_LOW = enums.ELM_SYS_NOTIFY_URGENCY_LOW
ELM_SYS_NOTIFY_URGENCY_NORMAL = enums.ELM_SYS_NOTIFY_URGENCY_NORMAL
ELM_SYS_NOTIFY_URGENCY_CRITICAL = enums.ELM_SYS_NOTIFY_URGENCY_CRITICAL
ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED = enums.ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED
ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED = enums.ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED
ELM_GLOB_MATCH_NO_ESCAPE = enums.ELM_GLOB_MATCH_NO_ESCAPE
ELM_GLOB_MATCH_PATH = enums.ELM_GLOB_MATCH_PATH
ELM_GLOB_MATCH_PERIOD = enums.ELM_GLOB_MATCH_PERIOD
ELM_GLOB_MATCH_NOCASE = enums.ELM_GLOB_MATCH_NOCASE
ELM_PROCESS_STATE_FOREGROUND = enums.ELM_PROCESS_STATE_FOREGROUND
ELM_PROCESS_STATE_BACKGROUND = enums.ELM_PROCESS_STATE_BACKGROUND
import traceback
cdef void py_elm_sys_notify_send_cb(void *data, unsigned int id):
cdef object func, func_data
func, func_data =