1 #ifndef EFL_UI_PROGRESSBAR_PRIVATE_H
2 #define EFL_UI_PROGRESSBAR_PRIVATE_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-progressbar-class The Elementary Progressbar Class
17  *
18  * Elementary, besides having the @ref Progressbar widget, exposes its
19  * foundation -- the Elementary Progressbar Class -- in order to create other
20  * widgets which are a progressbar with some more logic on top.
21  */
22 
23 /**
24  * Base layout smart data extended with progressbar instance data.
25  */
26 typedef struct _Efl_Ui_Progressbar_Data Efl_Ui_Progressbar_Data;
27 typedef struct _Efl_Ui_Progress_Status Efl_Ui_Progress_Status;
28 
29 struct _Efl_Ui_Progressbar_Data
30 {
31    Evas_Object          *spacer; /**< The rect actual progressbar area, gets the progressbar size and gets the events */
32 
33    Evas_Coord            size; /**< Width or height of progressbar */
34    double                val; /**< Value of progressbar */
35 
36    double                val_min;
37    double                val_max;
38 
39    Eina_List            *progress_status; /**< The list of _Elm_Progress_Status. To save the progress value(in percentage) each part of given progress bar */
40 
41    Eina_Strbuf           *format_strbuf;
42 
43    Efl_Ui_Layout_Orientation dir; /**< Orientation of the progressbar  */
44 
45    Eina_Bool             pulse : 1; /**< Whether object is put in the pulsing mode */
46    Eina_Bool             pulse_state : 1; /**< To start the pulsing animation, otherwise to stop it */
47    Eina_Bool             is_legacy_format_string : 1;
48    Eina_Bool             is_legacy_format_cb : 1;
49    Eina_Bool             has_status_text_part : 1;
50    Eina_Bool             has_cur_progressbar_part : 1;
51    Eina_Bool             show_progress_label : 1; /**< Show a progress text label besides the progressbar */
52 };
53 
54 struct _Efl_Ui_Progress_Status
55 {
56    const char           *part_name;
57    double                val;
58    double                val_min, val_max;
59    Eina_Bool part_exists : 1;
60 };
61 
62 /**
63  * @}
64  */
65 
66 #define EFL_UI_PROGRESSBAR_DATA_GET(o, sd) \
67   Efl_Ui_Progressbar_Data * sd = efl_data_scope_get(o, EFL_UI_PROGRESSBAR_CLASS)
68 
69 #define EFL_UI_PROGRESSBAR_DATA_GET_OR_RETURN(o, sd, ...) \
70   Efl_Ui_Progressbar_Data *sd = efl_data_scope_safe_get(o, EFL_UI_PROGRESSBAR_CLASS); \
71   if (EINA_UNLIKELY(!sd))                            \
72     {                                                \
73        ERR("No widget data for object %p (%s)",      \
74            o, evas_object_type_get(o));              \
75        return __VA_ARGS__;                           \
76     }
77 
78 #endif
79