1 #ifndef ELM_WIDGET_NOTIFY_H 2 #define ELM_WIDGET_NOTIFY_H 3 4 #include "Elementary.h" 5 6 #include <elm_notify_eo.h> 7 8 /* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR 9 * CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT 10 * FINAL. CALL elm_widget_api_check(ELM_INTERNAL_API_VERSION) TO CHECK 11 * IT AT RUNTIME. 12 */ 13 14 /** 15 * @addtogroup Widget 16 * @{ 17 * 18 * @section elm-notify-class The Elementary Notify Class 19 * 20 * Elementary, besides having the @ref Notify widget, exposes its 21 * foundation -- the Elementary Notify Class -- in order to create other 22 * widgets which are a notify with some more logic on top. 23 */ 24 25 26 /** 27 * Base widget smart data extended with notify instance data. 28 */ 29 typedef struct _Elm_Notify_Data Elm_Notify_Data; 30 struct _Elm_Notify_Data 31 { 32 Evas_Object *notify, *content, *parent; 33 Evas_Object *block_events; 34 double timeout; 35 double horizontal_align, vertical_align; 36 Ecore_Timer *timer; 37 38 Eina_Bool allow_events : 1; 39 Eina_Bool had_hidden : 1; 40 Eina_Bool in_timeout : 1; 41 }; 42 43 /** 44 * @} 45 */ 46 47 #define ELM_NOTIFY_DATA_GET(o, sd) \ 48 Elm_Notify_Data * sd = efl_data_scope_get(o, ELM_NOTIFY_CLASS) 49 50 #define ELM_NOTIFY_DATA_GET_OR_RETURN(o, ptr) \ 51 ELM_NOTIFY_DATA_GET(o, ptr); \ 52 if (EINA_UNLIKELY(!ptr)) \ 53 { \ 54 ERR("No widget data for object %p (%s)", \ 55 o, evas_object_type_get(o)); \ 56 return; \ 57 } 58 59 #define ELM_NOTIFY_DATA_GET_OR_RETURN_VAL(o, ptr, val) \ 60 ELM_NOTIFY_DATA_GET(o, ptr); \ 61 if (EINA_UNLIKELY(!ptr)) \ 62 { \ 63 ERR("No widget data for object %p (%s)", \ 64 o, evas_object_type_get(o)); \ 65 return val; \ 66 } 67 68 #define ELM_NOTIFY_CHECK(obj) \ 69 if (EINA_UNLIKELY(!efl_isa((obj), ELM_NOTIFY_CLASS))) \ 70 return 71 72 #endif 73