1 #ifndef ELM_WIDGET_CLOCK_H 2 #define ELM_WIDGET_CLOCK_H 3 4 #include "Elementary.h" 5 6 #include <Eio.h> 7 8 #include "elm_clock_eo.h" 9 10 /* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR 11 * CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT 12 * FINAL. CALL elm_widget_api_check(ELM_INTERNAL_API_VERSION) TO CHECK 13 * IT AT RUNTIME. 14 */ 15 16 /** 17 * @addtogroup Widget 18 * @{ 19 * 20 * @section elm-clock-class The Elementary Clock Class 21 * 22 * Elementary, besides having the @ref Clock widget, exposes its 23 * foundation -- the Elementary Clock Class -- in order to create other 24 * widgets which are a clock with some more logic on top. 25 */ 26 27 /** 28 * Base layout smart data extended with clock instance data. 29 */ 30 typedef struct _Elm_Clock_Data Elm_Clock_Data; 31 struct _Elm_Clock_Data 32 { 33 double interval, first_interval; 34 Elm_Clock_Edit_Mode digedit; 35 int hrs, min, sec, timediff; 36 Evas_Object *digit[6]; 37 Evas_Object *am_pm_obj; 38 Evas_Object *sel_obj; 39 Ecore_Timer *ticker, *spin; 40 41 struct 42 { 43 int hrs, min, sec; 44 char ampm; 45 Elm_Clock_Edit_Mode digedit; 46 47 Eina_Bool seconds : 1; 48 Eina_Bool am_pm : 1; 49 Eina_Bool edit : 1; 50 } cur; 51 52 Eina_Bool paused : 1; /**< a flag whether clock is paused or not */ 53 Eina_Bool seconds : 1; 54 Eina_Bool am_pm : 1; 55 Eina_Bool edit : 1; 56 }; 57 58 /** 59 * @} 60 */ 61 62 #define ELM_CLOCK_DATA_GET(o, sd) \ 63 Elm_Clock_Data * sd = efl_data_scope_get(o, ELM_CLOCK_CLASS) 64 65 #define ELM_CLOCK_DATA_GET_OR_RETURN(o, ptr) \ 66 ELM_CLOCK_DATA_GET(o, ptr); \ 67 if (EINA_UNLIKELY(!ptr)) \ 68 { \ 69 ERR("No widget data for object %p (%s)", \ 70 o, evas_object_type_get(o)); \ 71 return; \ 72 } 73 74 #define ELM_CLOCK_DATA_GET_OR_RETURN_VAL(o, ptr, val) \ 75 ELM_CLOCK_DATA_GET(o, ptr); \ 76 if (EINA_UNLIKELY(!ptr)) \ 77 { \ 78 ERR("No widget data for object %p (%s)", \ 79 o, evas_object_type_get(o)); \ 80 return val; \ 81 } 82 83 #define ELM_CLOCK_CHECK(obj) \ 84 if (EINA_UNLIKELY(!efl_isa((obj), ELM_CLOCK_CLASS))) \ 85 return 86 87 #endif 88