2012-08-30 09:45:00 -07:00
# ifndef ELM_WIDGET_TOOLBAR_H
# define ELM_WIDGET_TOOLBAR_H
# include "elm_interface_scrollable.h"
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-08-30 09:45:00 -07:00
/**
* @ addtogroup Widget
* @ {
*
* @ section elm - toolbar - class The Elementary Toolbar Class
*
* Elementary , besides having the @ ref Toolbar widget , exposes its
* foundation - - the Elementary Toolbar Class - - in order to create other
* widgets which are a toolbar with some more logic on top .
*/
2014-09-27 22:15:56 -07:00
typedef struct _Elm_Toolbar_Item_Data Elm_Toolbar_Item_Data ;
2012-08-30 09:45:00 -07:00
/**
* Base widget smart data extended with toolbar instance data .
*/
2014-03-27 01:15:16 -07:00
typedef struct _Elm_Toolbar_Data Elm_Toolbar_Data ;
struct _Elm_Toolbar_Data
2012-08-30 09:45:00 -07:00
{
Evas_Object * hit_rect ;
Evas_Object * bx , * more , * bx_more , * bx_more2 ;
Evas_Object * menu_parent ;
Eina_Inlist * items ;
2014-09-27 22:15:56 -07:00
Elm_Toolbar_Item_Data * more_item ;
Elm_Object_Item * selected_item ; /**< a selected item by mouse click, return key, api, and etc. */
2014-05-26 06:06:23 -07:00
Elm_Object_Item * focused_item ; /**< a focused item by keypad arrow or mouse. This is set to NULL if widget looses focus. */
Elm_Object_Item * last_focused_item ; /**< This records the last focused item when widget looses focus. This is required to set the focus on last focused item when widgets gets focus. */
2014-09-27 22:15:56 -07:00
Elm_Toolbar_Item_Data * reorder_empty , * reorder_item ;
2012-08-30 09:45:00 -07:00
Elm_Toolbar_Shrink_Mode shrink_mode ;
int theme_icon_size , priv_icon_size ,
icon_size ;
int standard_priority ;
2016-04-25 03:38:03 -07:00
int minw_bx , minh_bx ;
2012-08-30 09:45:00 -07:00
unsigned int item_count ;
2012-11-13 21:55:43 -08:00
unsigned int separator_count ;
2012-08-30 09:45:00 -07:00
double align ;
Elm_Object_Select_Mode select_mode ;
Ecore_Timer * long_timer ;
Ecore_Job * resize_job ;
2017-08-09 21:54:05 -07:00
Efl_Ui_Dir dir ;
2012-08-30 09:45:00 -07:00
Eina_Bool long_press : 1 ;
Eina_Bool homogeneous : 1 ;
2012-12-08 10:39:24 -08:00
Eina_Bool delete_me : 1 ;
2012-09-18 22:23:22 -07:00
Eina_Bool reorder_mode : 1 ;
2012-09-26 20:05:50 -07:00
Eina_Bool transverse_expanded : 1 ;
2014-03-23 08:22:32 -07:00
Eina_Bool mouse_down : 1 ; /**< a flag that mouse is down on the toolbar at the moment. This flag is set to true on mouse and reset to false on mouse up. */
2012-08-30 09:45:00 -07:00
} ;
2014-09-27 22:15:56 -07:00
struct _Elm_Toolbar_Item_Data
2012-08-30 09:45:00 -07:00
{
2014-09-27 22:15:56 -07:00
Elm_Widget_Item_Data * base ;
2012-08-30 09:45:00 -07:00
EINA_INLIST ;
const char * label ;
const char * icon_str ;
Evas_Object * icon ;
Evas_Object * object ;
Evas_Object * o_menu ;
Evas_Object * in_box ;
2013-02-14 21:37:53 -08:00
Evas_Object * proxy ;
2012-08-30 09:45:00 -07:00
Evas_Smart_Cb func ;
2013-02-14 21:37:53 -08:00
Elm_Transit * trans ;
2014-09-27 22:15:56 -07:00
Elm_Toolbar_Item_Data * reorder_to ;
2012-08-30 09:45:00 -07:00
struct
{
int priority ;
Eina_Bool visible : 1 ;
} prio ;
Eina_List * states ;
Eina_List * current_state ;
Eina_Bool separator : 1 ;
Eina_Bool selected : 1 ;
Eina_Bool menu : 1 ;
2013-02-14 21:37:53 -08:00
Eina_Bool on_move : 1 ;
2012-08-30 09:45:00 -07:00
} ;
/**
* @ }
*/
# define ELM_TOOLBAR_DATA_GET(o, sd) \
2016-08-15 06:44:41 -07:00
Elm_Toolbar_Data * sd = efl_data_scope_get ( o , ELM_TOOLBAR_CLASS )
2012-08-30 09:45:00 -07:00
# define ELM_TOOLBAR_DATA_GET_OR_RETURN(o, ptr) \
ELM_TOOLBAR_DATA_GET ( o , ptr ) ; \
2014-01-15 10:33:40 -08:00
if ( EINA_UNLIKELY ( ! ptr ) ) \
2012-08-30 09:45:00 -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-30 09:45:00 -07:00
return ; \
}
# define ELM_TOOLBAR_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
ELM_TOOLBAR_DATA_GET ( o , ptr ) ; \
2014-01-15 10:33:40 -08:00
if ( EINA_UNLIKELY ( ! ptr ) ) \
2012-08-30 09:45:00 -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-30 09:45:00 -07:00
return val ; \
}
2014-01-15 10:33:40 -08:00
# define ELM_TOOLBAR_CHECK(obj) \
2016-08-15 06:44:41 -07:00
if ( EINA_UNLIKELY ( ! efl_isa ( ( obj ) , ELM_TOOLBAR_CLASS ) ) ) \
2012-08-30 09:45:00 -07:00
return
# define ELM_TOOLBAR_ITEM_CHECK(it) \
2014-09-27 22:15:56 -07:00
ELM_WIDGET_ITEM_CHECK_OR_RETURN ( it - > base , ) ; \
ELM_TOOLBAR_CHECK ( it - > base - > widget ) ;
2012-08-30 09:45:00 -07:00
# define ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, ...) \
2014-09-27 22:15:56 -07:00
ELM_WIDGET_ITEM_CHECK_OR_RETURN ( it - > base , __VA_ARGS__ ) ; \
ELM_TOOLBAR_CHECK ( it - > base - > widget ) __VA_ARGS__ ;
2012-08-30 09:45:00 -07:00
# define ELM_TOOLBAR_ITEM_CHECK_OR_GOTO(it, label) \
2014-09-27 22:15:56 -07:00
ELM_WIDGET_ITEM_CHECK_OR_GOTO ( it - > base , label ) ; \
2016-08-15 06:44:41 -07:00
if ( ! it - > base - > widget | | ! efl_isa ( ( it - > base - > widget ) , ELM_TOOLBAR_CLASS ) ) goto label ;
2014-09-27 22:15:56 -07:00
# define ELM_TOOLBAR_ITEM_DATA_GET(o, sd) \
2016-08-15 06:44:41 -07:00
Elm_Toolbar_Item_Data * sd = efl_data_scope_get ( o , ELM_TOOLBAR_ITEM_CLASS )
2012-08-30 09:45:00 -07:00
# endif