2017-05-23 02:30:00 -07:00
|
|
|
#ifndef EFL_UI_PROGRESSBAR_PRIVATE_H
|
|
|
|
#define EFL_UI_PROGRESSBAR_PRIVATE_H
|
2012-07-31 15:06:41 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
#include "Elementary.h"
|
2012-07-31 15:06:41 -07:00
|
|
|
|
2014-08-07 09:26:47 -07:00
|
|
|
/* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR
|
|
|
|
* CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT
|
|
|
|
* FINAL. CALL elm_widget_api_check(ELM_INTERNAL_API_VERSION) TO CHECK
|
|
|
|
* IT AT RUNTIME.
|
|
|
|
*/
|
|
|
|
|
2012-07-31 15:06:41 -07:00
|
|
|
/**
|
|
|
|
* @addtogroup Widget
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @section elm-progressbar-class The Elementary Progressbar Class
|
|
|
|
*
|
|
|
|
* Elementary, besides having the @ref Progressbar widget, exposes its
|
|
|
|
* foundation -- the Elementary Progressbar Class -- in order to create other
|
|
|
|
* widgets which are a progressbar with some more logic on top.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Base layout smart data extended with progressbar instance data.
|
|
|
|
*/
|
2017-05-23 02:30:00 -07:00
|
|
|
typedef struct _Efl_Ui_Progressbar_Data Efl_Ui_Progressbar_Data;
|
|
|
|
typedef struct _Efl_Ui_Progress_Status Efl_Ui_Progress_Status;
|
2013-09-09 23:47:13 -07:00
|
|
|
|
2017-05-23 02:30:00 -07:00
|
|
|
struct _Efl_Ui_Progressbar_Data
|
2012-07-31 15:06:41 -07:00
|
|
|
{
|
2014-12-10 06:46:18 -08:00
|
|
|
Evas_Object *spacer; /**< The rect actual progressbar area, gets the progressbar size and gets the events */
|
|
|
|
const char *units; /**< The units will be displayed on progressbar */
|
2012-07-31 15:06:41 -07:00
|
|
|
|
2014-12-10 06:46:18 -08:00
|
|
|
Evas_Coord size; /**< Width or height of progressbar */
|
|
|
|
double val; /**< Value of progressbar */
|
2012-07-31 15:06:41 -07:00
|
|
|
|
2016-04-07 00:50:03 -07:00
|
|
|
Efl_Orient orientation; /**< Orientation of the progressbar */
|
2014-12-10 06:46:18 -08:00
|
|
|
Eina_Bool pulse : 1; /**< Whether object is put in the pulsing mode */
|
|
|
|
Eina_Bool pulse_state : 1; /**< To start the pulsing animation, otherwise to stop it */
|
|
|
|
Eina_List *progress_status; /**< The list of _Elm_Progress_Status. To save the progress value(in percentage) each part of given progress bar */
|
2012-07-31 15:06:41 -07:00
|
|
|
|
2014-12-10 06:46:18 -08:00
|
|
|
char *(*unit_format_func)(double val); /**< The function pointer will be called when user wants to set a customized unit format */
|
|
|
|
void (*unit_format_free)(char *str); /**< The freeing function for the format string */
|
2012-07-31 15:06:41 -07:00
|
|
|
};
|
|
|
|
|
2017-05-23 02:30:00 -07:00
|
|
|
struct _Efl_Ui_Progress_Status
|
2013-09-09 23:47:13 -07:00
|
|
|
{
|
2013-09-10 00:30:44 -07:00
|
|
|
const char *part_name;
|
2013-09-09 23:47:13 -07:00
|
|
|
double val;
|
|
|
|
};
|
|
|
|
|
2012-07-31 15:06:41 -07:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
2017-06-16 00:14:37 -07:00
|
|
|
#define EFL_UI_PROGRESSBAR_DATA_GET(o, sd) \
|
2017-05-23 02:30:00 -07:00
|
|
|
Efl_Ui_Progressbar_Data * sd = efl_data_scope_get(o, EFL_UI_PROGRESSBAR_CLASS)
|
2012-07-31 15:06:41 -07:00
|
|
|
|
2017-06-16 00:14:37 -07:00
|
|
|
#define EFL_UI_PROGRESSBAR_DATA_GET_OR_RETURN(o, ptr) \
|
|
|
|
EFL_UI_PROGRESSBAR_DATA_GET(o, ptr); \
|
2014-01-15 10:33:40 -08:00
|
|
|
if (EINA_UNLIKELY(!ptr)) \
|
2012-07-31 15:06:41 -07:00
|
|
|
{ \
|
2014-01-15 10:33:40 -08:00
|
|
|
CRI("No widget data for object %p (%s)", \
|
|
|
|
o, evas_object_type_get(o)); \
|
2012-07-31 15:06:41 -07:00
|
|
|
return; \
|
|
|
|
}
|
|
|
|
|
2017-06-16 00:14:37 -07:00
|
|
|
#define EFL_UI_PROGRESSBAR_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
|
|
|
|
EFL_UI_PROGRESSBAR_DATA_GET(o, ptr); \
|
2014-01-15 10:33:40 -08:00
|
|
|
if (EINA_UNLIKELY(!ptr)) \
|
|
|
|
{ \
|
|
|
|
CRI("No widget data for object %p (%s)", \
|
|
|
|
o, evas_object_type_get(o)); \
|
|
|
|
return val; \
|
2012-07-31 15:06:41 -07:00
|
|
|
}
|
|
|
|
|
2017-06-16 00:14:37 -07:00
|
|
|
#define EFL_UI_PROGRESSBAR_CHECK(obj) \
|
2017-05-23 02:30:00 -07:00
|
|
|
if (EINA_UNLIKELY(!efl_isa((obj), EFL_UI_PROGRESSBAR_CLASS))) \
|
2012-07-31 15:06:41 -07:00
|
|
|
return
|
|
|
|
|
|
|
|
#endif
|