2019-03-05 14:00:37 -08:00
|
|
|
#ifndef _ELM_SYS_NOTIFY_EO_H_
|
|
|
|
#define _ELM_SYS_NOTIFY_EO_H_
|
|
|
|
|
|
|
|
#ifndef _ELM_SYS_NOTIFY_EO_CLASS_TYPE
|
|
|
|
#define _ELM_SYS_NOTIFY_EO_CLASS_TYPE
|
|
|
|
|
|
|
|
typedef Eo Elm_Sys_Notify;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _ELM_SYS_NOTIFY_EO_TYPES
|
|
|
|
#define _ELM_SYS_NOTIFY_EO_TYPES
|
|
|
|
|
|
|
|
/** System notification server types
|
|
|
|
*
|
|
|
|
* @ingroup Elm_Sys_Notify
|
|
|
|
*/
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
ELM_SYS_NOTIFY_SERVER_NONE = 0, /**< No notificationserver (disables
|
|
|
|
* notifications) */
|
|
|
|
ELM_SYS_NOTIFY_SERVER_DBUS = 1 /* 1 >> 0 */ /**< Use DBus as a notification
|
|
|
|
* server */
|
|
|
|
} Elm_Sys_Notify_Server;
|
|
|
|
|
|
|
|
/** The reason the notification was closed
|
|
|
|
*
|
|
|
|
* @since 1.8
|
|
|
|
*
|
|
|
|
* @ingroup Elm_Sys_Notify
|
|
|
|
*/
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
ELM_SYS_NOTIFY_CLOSED_EXPIRED = 0, /**< The notification expired */
|
|
|
|
ELM_SYS_NOTIFY_CLOSED_DISMISSED, /**< The notification was dismissed by the
|
|
|
|
* user */
|
|
|
|
ELM_SYS_NOTIFY_CLOSED_REQUESTED, /**< The notification was closed by a call to
|
|
|
|
* CloseNotification method */
|
|
|
|
ELM_SYS_NOTIFY_CLOSED_UNDEFINED /**< Undefined/reserved reasons */
|
|
|
|
} Elm_Sys_Notify_Closed_Reason;
|
|
|
|
|
|
|
|
/** Data on event when notification closed is emitted
|
|
|
|
*
|
|
|
|
* @since 1.8
|
|
|
|
*
|
|
|
|
* @ingroup Elm_Sys_Notify
|
|
|
|
*/
|
|
|
|
typedef struct _Elm_Sys_Notify_Notification_Closed
|
|
|
|
{
|
|
|
|
unsigned int id; /**< ID of the notification */
|
|
|
|
Elm_Sys_Notify_Closed_Reason reason; /**< The reason the notification was
|
|
|
|
* closed */
|
|
|
|
} Elm_Sys_Notify_Notification_Closed;
|
|
|
|
|
|
|
|
/** Data on event when the action invoked is emitted
|
|
|
|
*
|
|
|
|
* @since 1.8
|
|
|
|
*
|
|
|
|
* @ingroup Elm_Sys_Notify
|
|
|
|
*/
|
|
|
|
typedef struct _Elm_Sys_Notify_Action_Invoked
|
|
|
|
{
|
|
|
|
unsigned int id; /**< ID of the notification */
|
|
|
|
char *action_key; /**< The key of the action invoked. These match the keys
|
|
|
|
* sent over in the list of actions */
|
|
|
|
} Elm_Sys_Notify_Action_Invoked;
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
/** Elementary system notification class
|
|
|
|
*
|
|
|
|
* @ingroup Elm_Sys_Notify
|
|
|
|
*/
|
|
|
|
#define ELM_SYS_NOTIFY_CLASS elm_sys_notify_class_get()
|
|
|
|
|
efl: make all _class_get() functions const
please note, not the return type, but the function.
When appending __attribute__((const)) to a function, the compiler is
told that its enough to call this function once in a function.
This is quite often happening when we are efl_data_scope_get and
efl_super in a function that is different from a implemented function.
The compiler now starts to remove the calls that aggressivly that we
need to ensure that these calls are not removed, which means, the static
function calls, and the eo init are now checking the return value of
these functions, to ensure that they are called.
Please note that you now have to be carefull when your app calls
eo_shutdown, if it does so, you *must* call it at the end of a function,
or never call class_get after that anymore.
Overall this improves elm test runs 0.1s which is fair i guess, the main
thing that is faster is textrendering, where is also the point where
this is the most beneficial.
Please note, this replaces 42 occurences of double _class_get() ... THAT
is a sign!
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Reviewed-by: Daniel Kolesa <daniel@octaforge.org>
Differential Revision: https://phab.enlightenment.org/D12057
2020-07-16 03:39:23 -07:00
|
|
|
EWAPI const Efl_Class *elm_sys_notify_class_get(void) EINA_CONST;
|
2019-03-05 14:00:37 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Set the notifications server to be used.
|
|
|
|
*
|
2019-04-02 04:28:48 -07:00
|
|
|
* @note This is an advanced function that should be used only to fulfill very
|
2019-03-05 14:00:37 -08:00
|
|
|
* specific purposes. Use elm_need_sys_notify() which activates the default
|
|
|
|
* available notification servers.
|
|
|
|
*
|
|
|
|
* @param[in] obj The object.
|
|
|
|
* @param[in] servers Binary mask of servers to enable. If a server is not
|
|
|
|
* present in the binary mask but was previously registered, it will be
|
|
|
|
* unregistered.
|
|
|
|
*
|
|
|
|
* @return @c true on success, @c false on failure
|
|
|
|
*
|
|
|
|
* @since 1.17
|
|
|
|
*
|
|
|
|
* @ingroup Elm_Sys_Notify
|
|
|
|
*/
|
|
|
|
EOAPI Eina_Bool elm_obj_sys_notify_servers_set(Eo *obj, Elm_Sys_Notify_Server servers);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Get the notification servers that have been registered
|
|
|
|
*
|
|
|
|
* @param[in] obj The object.
|
|
|
|
*
|
|
|
|
* @return Binary mask of servers to enable. If a server is not present in the
|
|
|
|
* binary mask but was previously registered, it will be unregistered.
|
|
|
|
*
|
|
|
|
* @since 1.17
|
|
|
|
*
|
|
|
|
* @ingroup Elm_Sys_Notify
|
|
|
|
*/
|
|
|
|
EOAPI Elm_Sys_Notify_Server elm_obj_sys_notify_servers_get(const Eo *obj);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Returns the singleton instance of the notification manager
|
|
|
|
* Elm.Sys_Notify. It is initialized upon the first call of this function
|
|
|
|
*
|
|
|
|
* @return The unique notification manager
|
|
|
|
*
|
|
|
|
* @since 1.17
|
|
|
|
*
|
|
|
|
* @ingroup Elm_Sys_Notify
|
|
|
|
*/
|
|
|
|
EOAPI Elm_Sys_Notify *elm_obj_sys_notify_singleton_get(void);
|
|
|
|
|
|
|
|
#endif
|