1 #ifndef ELM_WIDGET_SLIDER_H 2 #define ELM_WIDGET_SLIDER_H 3 4 #include "Elementary.h" 5 6 /* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR 7 * CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT 8 * FINAL. CALL elm_widget_api_check(ELM_INTERNAL_API_VERSION) TO CHECK 9 * IT AT RUNTIME. 10 */ 11 12 /** 13 * @addtogroup Widget 14 * @{ 15 * 16 * @section elm-slider-class The Elementary Slider Class 17 * 18 * Elementary, besides having the @ref Slider widget, exposes its 19 * foundation -- the Elementary Slider Class -- in order to create other 20 * widgets which are a slider with some more logic on top. 21 */ 22 23 /** 24 * Base layout smart data extended with slider instance data. 25 */ 26 typedef struct _Elm_Slider_Data Elm_Slider_Data; 27 struct _Elm_Slider_Data 28 { 29 Evas_Object *popup, *popup2, *track, *track2, *spacer; 30 31 double val, val_min, val_max, step; 32 double intvl_from, intvl_to; 33 double wheel_indicator_duration; 34 int intvl_flag; 35 36 Evas_Coord downx, downy; 37 Efl_Ui_Layout_Orientation dir; 38 39 Ecore_Timer *wheel_indicator_timer, *delay; 40 41 Elm_Slider_Indicator_Visible_Mode indicator_visible_mode; /**< indicator_visible_mode of the slider. 42 This indicates when to show an indicator */ 43 44 Evas_Coord size; 45 46 Efl_Ui_Format_Func format_cb; 47 Eina_Free_Cb format_free_cb; 48 void *format_cb_data; 49 Eina_Strbuf *format_strbuf; 50 51 Efl_Ui_Format_Func indi_format_cb; 52 Eina_Free_Cb indi_format_free_cb; 53 void *indi_format_cb_data; 54 Eina_Strbuf *indi_format_strbuf; 55 const char *indi_template; 56 57 58 Eina_Bool indicator_show : 1; 59 Eina_Bool units_show : 1; 60 Eina_Bool popup_visible : 1; 61 Eina_Bool intvl_enable : 1; 62 Eina_Bool spacer_down : 1; 63 Eina_Bool frozen : 1; 64 }; 65 66 /** 67 * @} 68 */ 69 70 #define ELM_SLIDER_DATA_GET(o, sd) \ 71 Elm_Slider_Data * sd = efl_data_scope_get(o, ELM_SLIDER_CLASS) 72 73 #define ELM_SLIDER_DATA_GET_OR_RETURN(o, sd, ...) \ 74 Elm_Slider_Data * sd = efl_data_scope_safe_get(o, ELM_SLIDER_CLASS); \ 75 if (EINA_UNLIKELY(!sd)) \ 76 { \ 77 ERR("No widget data for object %p (%s)", \ 78 o, evas_object_type_get(o)); \ 79 return __VA_ARGS__; \ 80 } 81 82 #endif 83