2017-05-21 20:48:12 -07:00
|
|
|
#ifndef EFL_UI_BUTTON_PRIVATE_H
|
|
|
|
#define EFL_UI_BUTTON_PRIVATE_H
|
2012-05-03 15:41:42 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
#include "Elementary.h"
|
2012-05-03 15:41:42 -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-05-03 15:41:42 -07:00
|
|
|
/**
|
|
|
|
* @addtogroup Widget
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @section elm-button-class The Elementary Button Class
|
|
|
|
*
|
|
|
|
* Elementary, besides having the @ref Button widget, exposes its
|
|
|
|
* foundation -- the Elementary Button Class -- in order to create
|
|
|
|
* other widgets which are, basically, a button with some more logic
|
|
|
|
* on top.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2012-05-25 12:53:51 -07:00
|
|
|
* Base widget smart data extended with button instance data.
|
2012-05-03 15:41:42 -07:00
|
|
|
*/
|
2017-05-21 20:48:12 -07:00
|
|
|
typedef struct _Efl_Ui_button_Data
|
2012-05-03 15:41:42 -07:00
|
|
|
{
|
|
|
|
/* auto-repeat stuff */
|
2014-04-12 20:43:41 -07:00
|
|
|
double ar_initial_timeout; /**< Time to wait until first auto-repeated click is generated */
|
|
|
|
double ar_gap_timeout; /**< Time frame for subsequent auto-repeated clicks, after the first automatic one is triggerred */
|
2012-05-03 15:41:42 -07:00
|
|
|
|
|
|
|
Ecore_Timer *timer; /**< Internal timer object for auto-repeat behavior */
|
|
|
|
|
|
|
|
Eina_Bool autorepeat : 1; /**< Whether auto-repetition of clicks is enabled or not (bound to _Elm_Button_Smart_Class::admits_autorepeat) */
|
|
|
|
Eina_Bool repeating : 1; /**< Whether auto-repetition is going on */
|
2017-05-21 20:48:12 -07:00
|
|
|
} Efl_Ui_Button_Data;
|
2012-05-03 15:41:42 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
2012-08-01 14:04:14 -07:00
|
|
|
#define ELM_BUTTON_DATA_GET(o, sd) \
|
2017-05-21 20:48:12 -07:00
|
|
|
Efl_Ui_Button_Data * sd = efl_data_scope_get(o, EFL_UI_BUTTON_CLASS)
|
2012-08-01 14:04:14 -07:00
|
|
|
|
|
|
|
#define ELM_BUTTON_DATA_GET_OR_RETURN(o, ptr) \
|
|
|
|
ELM_BUTTON_DATA_GET(o, ptr); \
|
2014-01-15 10:33:40 -08:00
|
|
|
if (EINA_UNLIKELY(!ptr)) \
|
2012-08-01 14:04:14 -07:00
|
|
|
{ \
|
2018-01-31 19:16:28 -08:00
|
|
|
ERR("No widget data for object %p (%s)", \
|
2014-01-15 10:33:40 -08:00
|
|
|
o, evas_object_type_get(o)); \
|
2012-08-01 14:04:14 -07:00
|
|
|
return; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define ELM_BUTTON_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
|
|
|
|
ELM_BUTTON_DATA_GET(o, ptr); \
|
2014-01-15 10:33:40 -08:00
|
|
|
if (EINA_UNLIKELY(!ptr)) \
|
2012-08-01 14:04:14 -07:00
|
|
|
{ \
|
2018-01-31 19:16:28 -08:00
|
|
|
ERR("No widget data for object %p (%s)", \
|
2014-01-15 10:33:40 -08:00
|
|
|
o, evas_object_type_get(o)); \
|
2012-08-01 14:04:14 -07:00
|
|
|
return val; \
|
|
|
|
}
|
|
|
|
|
2014-01-15 10:33:40 -08:00
|
|
|
#define ELM_BUTTON_CHECK(obj) \
|
2017-05-21 20:48:12 -07:00
|
|
|
if (EINA_UNLIKELY(!efl_isa((obj), EFL_UI_BUTTON_CLASS))) \
|
2012-08-01 14:04:14 -07:00
|
|
|
return
|
|
|
|
|
2012-05-03 15:41:42 -07:00
|
|
|
#endif
|