2010-09-13 00:56:23 -07:00
# ifndef ELM_WIDGET_H
# define ELM_WIDGET_H
2010-10-13 10:50:20 -07:00
/* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR
2010-09-13 00:56:23 -07:00
* CODE . THIS IS ELEMENTARY ' S INTERNAL WIDGET API ( for now ) AND IS NOT
2012-08-30 09:46:59 -07:00
* FINAL . CALL elm_widget_api_check ( ELM_INTERNAL_API_VERSION ) TO CHECK
* IT AT RUNTIME .
2011-04-01 01:05:24 -07:00
*
2012-08-30 09:46:59 -07:00
* How to make your own widget ? like this ( where wname is your widget
* name ( space ) and wparentname is you widget ' s parent widget name
* ( the base widget class if its a ' root ' one ) .
2011-04-01 01:05:24 -07:00
*
2010-09-13 00:56:23 -07:00
* # include < Elementary . h >
* # include " elm_priv.h "
2011-04-01 01:05:24 -07:00
*
2012-08-30 09:46:59 -07:00
* static const char ELM_WNAME_SMART_NAME [ ] = " elm_wname " ;
2011-04-01 01:05:24 -07:00
*
2012-08-30 09:46:59 -07:00
* # define ELM_WNAME_DATA_GET ( o , sd ) \
* Elm_WName_Smart_Data * sd = evas_object_smart_data_get ( o )
*
* # define ELM_WNAME_CHECK ( obj ) \
* if ( ! obj | | ! elm_widget_type_check ( ( obj ) , ELM_WNAME_SMART_NAME , \
* __func__ ) ) \
* return
*
* typedef struct _Elm_WName_Smart_Class
2010-09-13 00:56:23 -07:00
* {
2012-08-30 09:46:59 -07:00
* Elm_WParentName_Smart_Class base ;
* } Elm_WName_Smart_Class ;
2011-04-01 01:05:24 -07:00
*
2012-08-30 09:46:59 -07:00
* typedef struct _Elm_WName_Smart_Data Elm_WName_Smart_Data ;
* struct _Elm_WName_Smart_Data
* {
* Elm_WParentName_Smart_Data base ;
* Evas_Object * sub ; // or any private data needed for an instance
* // add any other instance data here too
* } ;
2011-04-01 01:05:24 -07:00
*
2010-09-13 00:56:23 -07:00
* static const char SIG_CLICKED [ ] = " clicked " ;
2012-08-30 09:46:59 -07:00
* static const Evas_Smart_Cb_Description _smart_callbacks [ ] = {
2010-09-13 00:56:23 -07:00
* { SIG_CLICKED , " " } ,
* { NULL , NULL }
* } ;
2011-04-01 01:05:24 -07:00
*
2012-08-30 09:46:59 -07:00
* EVAS_SMART_SUBCLASS_NEW
* ( ELM_WNAME_SMART_NAME , _elm_wname , Elm_WName_Smart_Class ,
* Elm_WParentName_Smart_Class , elm_wparentname_smart_class_get ,
* _smart_callbacks ) ;
2011-04-01 01:05:24 -07:00
*
2012-08-30 09:46:59 -07:00
* static Eina_Bool
* _elm_wname_smart_on_focus ( Evas_Object * obj )
2010-09-13 00:56:23 -07:00
* {
2012-08-30 09:46:59 -07:00
* ELM_WNAME_DATA_GET ( obj , sd ) ;
*
* // handle focus going in and out - optional, but if you want to,
* // define this virtual function to handle it (e.g. to emit a
* // signal to an edje object)
*
2017-11-29 00:39:42 -08:00
* if ( efl_ui_focus_object_focus_get ( obj ) )
2010-09-13 00:56:23 -07:00
* {
2012-08-30 09:46:59 -07:00
* edje_object_signal_emit ( sd - > sub , " elm,action,focus " , " elm " ) ;
* evas_object_focus_set ( sd - > sub , EINA_TRUE ) ;
2010-09-13 00:56:23 -07:00
* }
* else
* {
2012-08-30 09:46:59 -07:00
* edje_object_signal_emit ( sd - > sub , " elm,action,unfocus " , " elm " ) ;
* evas_object_focus_set ( sd - > sub , EINA_FALSE ) ;
2010-09-13 00:56:23 -07:00
* }
2012-08-30 09:46:59 -07:00
*
* return EINA_TRUE ;
2010-09-13 00:56:23 -07:00
* }
2011-04-01 01:05:24 -07:00
*
2012-08-30 09:46:59 -07:00
* static Eina_Bool
* _elm_wname_smart_theme ( Evas_Object * obj )
2010-09-13 00:56:23 -07:00
* {
2012-08-30 09:46:59 -07:00
* ELM_WNAME_DATA_GET ( obj , sd ) ;
*
* if ( ! ELM_WIDGET_CLASS ( _elm_wname_parent_sc ) - > theme ( obj ) )
* return EINA_FALSE ;
*
* // handle changes in theme/scale etc here. always call the
* // parent class's version, as even the base class implements it.
*
* elm_widget_theme_object_set ( obj , sd - > sub , " wname " , " base " ,
2010-09-14 04:56:48 -07:00
* elm_widget_style_get ( obj ) ) ;
2012-08-30 09:46:59 -07:00
*
* return EINA_TRUE ;
2010-09-13 00:56:23 -07:00
* }
2011-04-01 01:05:24 -07:00
*
2012-08-30 09:46:59 -07:00
* static Eina_Bool
* _elm_widget_smart_disable ( Evas_Object * obj )
2010-09-13 00:56:23 -07:00
* {
2012-08-30 09:46:59 -07:00
* ELM_WNAME_DATA_GET ( obj , sd ) ;
*
2010-12-31 00:45:45 -08:00
* // optional, but handle if the widget gets disabled or not
2010-09-13 00:56:23 -07:00
* if ( elm_widget_disabled_get ( obj ) )
2012-08-30 09:46:59 -07:00
* edje_object_signal_emit ( sd - > sub , " elm,state,disabled " , " elm " ) ;
2010-09-13 00:56:23 -07:00
* else
2012-08-30 09:46:59 -07:00
* edje_object_signal_emit ( sd - > sub , " elm,state,enabled " , " elm " ) ;
*
* return EINA_TRUE ;
2010-09-13 00:56:23 -07:00
* }
2011-04-01 01:05:24 -07:00
*
2010-09-13 00:56:23 -07:00
* static void
2012-08-30 09:46:59 -07:00
* _elm_wname_smart_add ( Evas_Object * obj )
2010-09-13 00:56:23 -07:00
* {
2012-08-30 09:46:59 -07:00
* EVAS_SMART_DATA_ALLOC ( obj , Elm_WName_Smart_Data ) ;
2011-04-01 01:05:24 -07:00
*
2012-08-30 09:46:59 -07:00
* ELM_WIDGET_CLASS ( _elm_wname_parent_sc ) - > base . add ( obj ) ;
*
* priv - > sub = edje_object_add ( evas_object_evas_get ( obj ) ) ;
* // just an example having an Edje object here. if it's really the case
* // you have a sub edje object as a resize object, consider inheriting
* // from @ref elm-layout-class.
2010-09-27 21:28:14 -07:00
* elm_widget_can_focus_set ( obj , EINA_TRUE ) ;
2011-04-01 01:05:24 -07:00
*
2010-12-31 00:45:45 -08:00
* // for this widget we will add 1 sub object that is an edje object
2012-08-30 09:46:59 -07:00
* priv - > sub = edje_object_add ( e ) ;
2010-09-13 00:56:23 -07:00
* // set the theme. this follows a scheme for group name like this:
* // "elm/WIDGETNAME/ELEMENT/STYLE"
* // so here it will be:
2012-08-30 09:46:59 -07:00
* // "elm/wname/base/default"
2010-09-13 00:56:23 -07:00
* // changing style changes style name from default (all widgets start
* // with the default style) and element is for your widget internal
* // structure as you see fit
2012-08-30 09:46:59 -07:00
* elm_widget_theme_object_set
* ( obj , priv - > sub , " wname " , " base " , " default " ) ;
2010-09-13 00:56:23 -07:00
* // listen to a signal from the edje object to produce widget smart
* // callback (like click)
2012-08-30 09:46:59 -07:00
* edje_object_signal_callback_add
* ( priv - > sub , " elm,action,click " , " " , _clicked_signal_cb , obj ) ;
2010-09-13 00:56:23 -07:00
* // set this sub object as the "resize object". widgets get 1 resize
2010-12-31 00:45:45 -08:00
* // object that is resized along with the object wrapper.
2017-08-08 05:06:43 -07:00
* elm_widget_resize_object_set ( obj , priv - > sub ) ;
2012-08-30 09:46:59 -07:00
* }
2011-04-01 01:05:24 -07:00
*
2012-08-30 09:46:59 -07:00
* static void
* _elm_wname_smart_del ( Evas_Object * obj )
* {
* ELM_WNAME_DATA_GET ( obj , sd ) ;
*
* // deleting 'virtual' function implementation - on deletion of
* // object delete object struct, etc.
*
* ELM_WIDGET_CLASS ( _elm_wname_parent_sc ) - > base . del ( obj ) ;
* }
*
* static void
* _elm_wname_smart_set_user ( Elm_WName_Smart_Class * sc )
* {
* ELM_WIDGET_CLASS ( sc ) - > base . add = _elm_wname_smart_add ;
* ELM_WIDGET_CLASS ( sc ) - > base . del = _elm_wname_smart_del ;
*
* ELM_WIDGET_CLASS ( sc ) - > theme = _elm_wname_smart_theme ;
* ELM_WIDGET_CLASS ( sc ) - > disable = _elm_wname_smart_disable ;
* ELM_WIDGET_CLASS ( sc ) - > on_focus = _elm_wname_smart_on_focus ;
* }
*
* // actual API to create your widget. add more to manipulate it as
* // needed mark your calls with EAPI to make them "external api"
* // calls.
*
* EAPI Evas_Object *
* elm_wname_add ( Evas_Object * parent )
* {
* Evas_Object * obj ;
*
* EINA_SAFETY_ON_NULL_RETURN_VAL ( parent , NULL ) ;
*
* obj = elm_widget_add ( _elm_check_smart_class_new ( ) , parent ) ;
* if ( ! obj ) return NULL ;
*
* if ( ! elm_widget_sub_object_add ( parent , obj ) )
* ERR ( " could not add %p as sub object of %p " , obj , parent ) ;
2011-04-01 01:05:24 -07:00
*
2010-09-13 00:56:23 -07:00
* return obj ;
* }
2011-04-01 01:05:24 -07:00
*
2010-09-13 00:56:23 -07:00
* // example - do "whatever" to the widget (here just emit a signal)
* EAPI void
2012-08-30 09:46:59 -07:00
* elm_wname_whatever ( Evas_Object * obj )
2010-09-13 00:56:23 -07:00
* {
* // check if type is correct - check will return if it fails
2012-08-30 09:46:59 -07:00
* ELM_WNAME_CHECK ( obj ) ;
2010-12-31 00:45:45 -08:00
* // get widget data - type is correct and sane by this point, so this
2010-09-13 00:56:23 -07:00
* // should never fail
2012-08-30 09:46:59 -07:00
* ELM_WNAME_DATA_GET ( obj , sd ) ;
2010-09-13 00:56:23 -07:00
* // do whatever you like
2012-08-30 09:46:59 -07:00
* edje_object_signal_emit ( sd - > sub , " elm,state,action,whatever " , " elm " ) ;
2010-09-13 00:56:23 -07:00
* }
2011-04-01 01:05:24 -07:00
*
2012-08-30 09:46:59 -07:00
* // you can add more - you need to see elementary's code to know how
* // to handle all cases. remember this api is not stable and may
* change . it ' s internal
2010-09-13 00:56:23 -07:00
*/
2011-02-13 17:47:51 -08:00
# ifndef ELM_INTERNAL_API_ARGESFSDFEFC
2011-12-29 23:20:48 -08:00
# warning "You are using an internal elementary API. This API is not stable"
# warning "and is subject to change. You use this at your own risk."
# warning "Remember to call elm_widget_api_check(ELM_INTERNAL_API_VERSION);"
# warning "in your widgets before you call any other elm_widget calls to do"
# warning "a correct runtime version check. Also remember - you don't NEED"
# warning "to make an Elementary widget is almost ALL cases. You can easily"
# warning "make a smart object with Evas's API and do everything you need"
# warning "there. You only need a widget if you want to seamlessly be part"
# warning "of the focus tree and want to transparently become a container"
# warning "for any number of child Elementary widgets"
# error "ERROR. Compile aborted."
2010-09-13 00:56:23 -07:00
# endif
# define ELM_INTERNAL_API_VERSION 7000
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
/**
* @ defgroup Widget Widgets Extension Infrastructure
*
* This section is intended for people willing to create @ b custom
* Elementary widgets or to contribute new ( useful , unique ) widgets
* upstream . If neither is your case , this text won ' t be of any use
* for you .
*
* Elementary widgets are built in a @ b hierarchical fashion . The idea
* is to factorize as much code as possible between widgets with
* behavioral similarities , as long as to facilitate the creation of
* @ b custom , new widgets , may the user need them .
*
* It all starts with a base class , which aggregates behaviour
* @ b every Elementary widget is supposed to have :
* # Elm_Widget_Smart_Class . Every Elementary widget will be of that
* type , be it directly or by means of @ b inheriting from it .
*
* # Elm_Widget_Smart_Class happens to be an @ c Evas_Smart_Class . If
* you check out Evas ' documentation on it , you ' ll see it ' s how one is
* supposed to create custom Evas objects , what Elementary widgets
* are .
*
* Once one instantiates an Elementary widget , since it inherits from
* # Elm_Widget_Smart_Class , the system will raise a class instance of
* that type for you . But that happens only @ b once : the first time
* you ask for an Elementary widget ( of a given type ) . All subsequent
* ones will only point to the very same class instance . Since it ' s
* the class which points to the functions implementing the behavior
* of objects of that type , all of the live instances of Elementary
* widgets ( of that type ) will share the same blob of code loaded in
* memory to execute their routines .
*
* Now go and take a look at # Elm_Widget_Smart_Class ' s fields . Because
* it inherits from Evas ' base smart class , we got a field of that
* type as the first member , so that Evas can handle Elementary
* objects internally as if they were ' normal ' Evas objects . Evas has
* the Evas - only behavior function pointers in there , so it ' s all it
* needs .
*
* Then , comes a version field , so that whenever we got to update or
* change the fields on our base smart class , there ' ll be a runtime
* check of the version expected by Elementary and the one provided by
* any code linking with it . A mismatch will show the developer of
* that code he / she needs to recompile and link its code to a newer
* version of Elementary .
*
2012-08-30 09:47:31 -07:00
* The next fields are the class functions themselves . We call them
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
* ' virtual ' because , as in object - oriented languages , one is supposed
* here to override them on inheriting classes . On most of
* inheritances you ' ll probably want to call the parent ' s version of
2012-05-31 16:02:54 -07:00
* the class function too : you must analyse each case to tell .
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
*
* Take a look at # Elm_Widget_Smart_Data . That ' s private data bound to
* each Elementary object @ b instance . It aggregates data needed for
* all widgets , since it ' s meant for the # Elm_Widget_Smart_Class - typed
* ones .
*
* When inheriting from that base type , instance data for this new
* class has to have , as the first member , a field of type
* # Elm_Widget_Smart_Data . This has to be respected recursively - - if
* a third class is to be created inheriting from the one that is a
* direct ' child ' of # Elm_Widget_Smart_Class , then the private data on
* this third class has to have , as its first field , a variable of the
* type of the private data of the second class ( its parent ) , direct
* child of # Elm_Widget_Smart_Class .
*
* It is from the base private data , # Elm_Widget_Smart_Data , that we
* reach an object ' s class functions , by the given object
* instance . This is the reason of the first field of that struct : a
* pointer set to point to its class when the object is instantiated .
*
2012-08-30 09:47:31 -07:00
* The following figure illustrates the widget inheritance schema .
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
*
* @ image html elm - widget - hierarchy . png
* @ image rtf elm - widget - hierarchy . png
* @ image latex elm - widget - hierarchy . eps
2012-06-05 15:41:21 -07:00
*
* @ section elm - hierarchy - tree Elementary Widgets Hierarchy Tree
*
2012-08-30 09:47:31 -07:00
* The following figure illustrates the Elementary widget inheritance
* tree .
2012-06-05 15:41:21 -07:00
*
* @ image html elm - widget - tree . png
* @ image rtf elm - widget - tree . png
* @ image latex elm - widget - tree . eps
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
*/
2017-11-14 20:12:36 -08:00
# include "elm_object_item.h"
2016-02-15 17:57:10 -08:00
typedef void ( * Elm_Widget_Text_Set_Cb ) ( void * data , const char * part , const char * text ) ;
typedef void ( * Elm_Widget_Content_Set_Cb ) ( void * data , const char * part , Evas_Object * content ) ;
typedef const char * ( * Elm_Widget_Text_Get_Cb ) ( const void * data , const char * part ) ;
typedef Evas_Object * ( * Elm_Widget_Content_Get_Cb ) ( const void * data , const char * part ) ;
typedef Evas_Object * ( * Elm_Widget_Content_Unset_Cb ) ( const void * data , const char * part ) ;
typedef void ( * Elm_Widget_Signal_Emit_Cb ) ( void * data , const char * emission , const char * source ) ;
typedef void ( * Elm_Widget_Disable_Cb ) ( void * data ) ;
typedef Eina_Bool ( * Elm_Widget_Del_Pre_Cb ) ( void * data ) ;
typedef void ( * Elm_Widget_Item_Signal_Cb ) ( void * data , Elm_Object_Item * item , const char * emission , const char * source ) ;
typedef void ( * Elm_Widget_Style_Set_Cb ) ( void * data , const char * style ) ;
typedef const char * ( * Elm_Widget_Style_Get_Cb ) ( const void * data ) ;
typedef void ( * Elm_Widget_Focus_Set_Cb ) ( void * data , Eina_Bool focused ) ;
typedef Eina_Bool ( * Elm_Widget_Focus_Get_Cb ) ( const void * data ) ;
typedef void ( * Elm_Access_On_Highlight_Cb ) ( void * data ) ;
typedef void * ( * list_data_get_func_type ) ( const Eina_List * l ) ;
# include "elm_widget.eo.h"
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
/**
* @ addtogroup Widget
* @ {
*/
2012-07-05 07:37:18 -07:00
/* Please, ALWAYS update the ELM_WIDGET_SMART_CLASS_INIT macro
* whenever you change the following struct ! */
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
/**
* Base widget smart class . It has the ' virtual ' functions for all
* general , common actions on Elementary widgets .
*/
typedef struct _Elm_Widget_Smart_Class
{
Evas_Smart_Class base ; /**< Base smart class struct, needed for all smart objects */
int version ; /**< Version of this smart class definition */
2012-07-18 14:03:28 -07:00
void ( * parent_set ) ( Evas_Object * obj ,
Evas_Object * parent ) ; /**< 'Virtual' function handling parent widget attachment to new object */
2012-08-03 09:43:41 -07:00
Eina_Bool ( * on_focus ) ( Evas_Object * obj ) ; /**< 'Virtual' function handling focus in/out events on the widget */
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
Eina_Bool ( * disable ) ( Evas_Object * obj ) ; /**< 'Virtual' function on the widget being disabled */
Eina_Bool ( * theme ) ( Evas_Object * obj ) ; /**< 'Virtual' function on the widget being re-themed */
Eina_Bool ( * translate ) ( Evas_Object * obj ) ; /**< 'Virtual' function handling language changes on Elementary */
Eina_Bool ( * event ) ( Evas_Object * obj ,
Evas_Object * source ,
Evas_Callback_Type type ,
void * event_info ) ; /**< 'Virtual' function handling input events on the widget */
2012-10-17 03:09:52 -07:00
Eina_Bool ( * on_focus_region ) ( const Evas_Object * obj ,
2012-08-30 09:47:16 -07:00
Evas_Coord * x ,
Evas_Coord * y ,
Evas_Coord * w ,
2013-06-09 01:14:31 -07:00
Evas_Coord * h ) ; /**< 'Virtual' function returning an inner area of a widget that should be brought into the visible area of a broader viewport, may this context arise. On the base Elementary widget class, it defaults to the object's total area, so only override it if you have to. */
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
Eina_Bool ( * focus_next ) ( const Evas_Object * obj ,
Elm_Focus_Direction dir ,
2015-09-24 23:24:53 -07:00
Evas_Object * * next ,
Elm_Object_Item * * next_item ) ; /**< 'Virtual' function handling passing focus to sub-objects */
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
Eina_Bool ( * focus_direction ) ( const Evas_Object * obj ,
const Evas_Object * base ,
double degree ,
Evas_Object * * target ,
2015-09-24 23:24:53 -07:00
Elm_Object_Item * * target_item ,
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
double * weight ) ; /**< 'Virtual' function handling passing focus to sub-objects <b>given a direction, in degrees</b> */
2017-08-23 04:41:37 -07:00
Eina_Bool ( * widget_sub_object_add ) ( Evas_Object * obj ,
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
Evas_Object * sobj ) ; /**< 'Virtual' function handling sub objects being added */
2017-08-23 04:41:37 -07:00
Eina_Bool ( * widget_sub_object_del ) ( Evas_Object * obj ,
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
Evas_Object * sobj ) ; /**< 'Virtual' function handling sub objects being removed */
2012-07-18 14:03:28 -07:00
void ( * access ) ( Evas_Object * obj ,
Eina_Bool is_access ) ; /**< 'Virtual' function on the widget being set access */
2012-09-16 20:01:46 -07:00
Eina_Bool ( * activate ) ( Evas_Object * obj ,
2017-10-15 21:33:52 -07:00
Efl_Ui_Activate act ) ; /**< 'Virtual' function to activate widget */
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
} Elm_Widget_Smart_Class ;
/**
* Base widget smart data . This is data bound to an Elementary object
* @ b instance , so its particular to that specific object and not
* shared between all objects in its class . It is here , though , that
* we got a pointer to the object ' s class , the first field - - @ c
* ' api ' .
*/
typedef struct _Elm_Widget_Smart_Data
{
2014-11-29 20:17:24 -08:00
Evas_Object * obj ; /**< object pointer for this widget smart data */
Evas_Object * parent_obj ; /**< parent object of a widget in the elementary tree */
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
Evas_Coord x , y , w , h ;
2014-11-29 20:17:24 -08:00
Eina_List * subobjs ; /**< list of widgets' sub objects in the elementary tree */
Evas_Object * resize_obj ; /**< an unique object for each widget that shows the look of a widget. Resize object's geometry is same as the widget. This resize object is different from that of window's resize object. */
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
Evas_Object * hover_obj ;
2017-11-23 21:41:31 -08:00
Evas_Object * bg ;
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
Eina_List * tooltips , * cursors ;
2013-03-22 17:36:21 -07:00
Evas_Object * focus_previous , * focus_next ;
Evas_Object * focus_up , * focus_down , * focus_right , * focus_left ;
2015-09-15 03:41:51 -07:00
Elm_Object_Item * item_focus_previous , * item_focus_next ;
Elm_Object_Item * item_focus_up , * item_focus_down , * item_focus_right , * item_focus_left ;
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
2012-08-30 09:47:23 -07:00
/* "show region" coordinates. all widgets got those because this
* info may be set and queried recursively through the widget
* parenting tree */
2017-09-13 19:59:44 -07:00
Eina_Rect show_region ;
2012-08-30 09:47:23 -07:00
/* scrolling hold/freeze hints. all widgets got those because this
* info may be set and queried recursively through the widget
* parenting tree */
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
int scroll_hold ;
int scroll_freeze ;
2012-08-30 09:47:23 -07:00
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
double scale ;
Elm_Theme * theme ;
2017-11-14 01:42:48 -08:00
const char * klass ; /**< 1st identifier of an edje object group which is used in theme_set. klass and group are used together. */
const char * group ; /**< 2nd identifier of an edje object group which is used in theme_set. klass and group are used together. */
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
const char * style ;
const char * access_info ;
2016-11-09 17:58:41 -08:00
const char * accessible_name ;
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
unsigned int focus_order ;
Eina_Bool focus_order_on_calc ;
int child_drag_x_locked ;
int child_drag_y_locked ;
2013-07-16 23:05:40 -07:00
Eina_Inlist * translate_strings ;
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
Eina_List * focus_chain ;
Eina_List * event_cb ;
2012-08-30 09:47:23 -07:00
/* this is a hook to be set on-the-fly on widgets. this is code
* handling the request of showing a specific region from an inner
* widget ( mainly issued by entries , on cursor moving ) */
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
void * on_show_region_data ;
2017-08-21 23:16:54 -07:00
Efl_Ui_Scrollable_On_Show_Region on_show_region ;
Eina_Free_Cb on_show_region_data_free ;
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
2013-02-14 20:45:53 -08:00
int orient_mode ; /* -1 is disabled */
2015-06-01 21:42:00 -07:00
Elm_Focus_Move_Policy focus_move_policy ;
2015-08-12 01:25:15 -07:00
Elm_Focus_Region_Show_Mode focus_region_show_mode ;
2012-07-30 00:14:33 -07:00
2017-09-02 10:08:18 -07:00
Elm_Widget_Focus_State focus ;
2017-05-29 23:36:17 -07:00
struct {
int child_count ;
Efl_Ui_Focus_Object * parent ;
} logical ;
struct {
Efl_Ui_Focus_Manager * manager ;
Efl_Ui_Focus_User * provider ;
} manager ;
2017-08-29 00:49:43 -07:00
Eina_Bool scroll_x_locked : 1 ;
Eina_Bool scroll_y_locked : 1 ;
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
Eina_Bool can_focus : 1 ;
Eina_Bool child_can_focus : 1 ;
Eina_Bool focused : 1 ;
Eina_Bool top_win_focused : 1 ;
Eina_Bool tree_unfocusable : 1 ;
2016-03-18 00:38:26 -07:00
Eina_Bool focus_move_policy_auto_mode : 1 ; /* This is TRUE by default */
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
Eina_Bool highlight_ignore : 1 ;
Eina_Bool highlight_in_theme : 1 ;
2014-02-07 19:27:41 -08:00
Eina_Bool access_highlight_in_theme : 1 ;
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
Eina_Bool disabled : 1 ;
Eina_Bool is_mirrored : 1 ;
2017-06-14 19:12:00 -07:00
Eina_Bool mirrored_auto_mode : 1 ; /* This is TRUE by default */
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
Eina_Bool still_in : 1 ;
2013-01-28 03:13:18 -08:00
Eina_Bool highlighted : 1 ;
2013-02-14 01:20:54 -08:00
Eina_Bool highlight_root : 1 ;
2014-02-10 05:27:08 -08:00
Eina_Bool on_translate : 1 ; /**< This is true when any types of elm translate function is being called. */
Eina_Bool on_create : 1 ; /**< This is true when the widget is on creation(general widget constructor). */
2015-10-08 03:23:15 -07:00
Eina_Bool on_destroy : 1 ; /**< This is true when the widget is on destruction(general widget destructor). */
2016-08-10 07:23:04 -07:00
Eina_Bool provider_lookup : 1 ; /**< This is true when efl_provider_find is currently walking the tree */
2017-08-09 00:22:48 -07:00
Eina_Bool legacy : 1 ; /**< Widget was created with a legacy API, not efl_add() */
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
} Elm_Widget_Smart_Data ;
2017-10-23 22:29:16 -07:00
typedef Elm_Widget_Smart_Data Efl_Ui_Widget_Data ;
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
/**
* @ }
*/
2012-01-09 16:33:51 -08:00
/**< base structure for all widget items that are not Elm_Widget themselves */
2014-08-13 06:36:29 -07:00
typedef struct _Elm_Widget_Item_Data Elm_Widget_Item_Data ;
2013-03-06 04:33:13 -08:00
typedef struct _Elm_Widget_Item_Signal_Data Elm_Widget_Item_Signal_Data ;
2011-08-19 04:07:42 -07:00
2012-01-09 16:33:51 -08:00
/**< accessibility information to be able to set and get from the access API */
typedef struct _Elm_Access_Info Elm_Access_Info ;
/**< accessibility info item */
typedef struct _Elm_Access_Item Elm_Access_Item ;
2014-02-27 17:36:15 -08:00
typedef struct _Elm_Action Elm_Action ;
2017-06-14 04:17:29 -07:00
/** Internal type for mouse cursors */
typedef struct _Elm_Cursor Elm_Cursor ;
2017-08-23 00:04:49 -07:00
/** Internal type for tooltips */
typedef struct _Elm_Tooltip Elm_Tooltip ;
2012-12-06 02:56:29 -08:00
# define ELM_ACCESS_DONE -1 /* sentence done - send done event here */
# define ELM_ACCESS_CANCEL -2 /* stop reading immediately */
2011-08-19 04:07:42 -07:00
struct _Elm_Access_Item
{
2011-12-29 23:20:48 -08:00
int type ;
const void * data ;
2013-01-14 20:20:37 -08:00
Elm_Access_Info_Cb func ;
2011-08-19 04:07:42 -07:00
} ;
struct _Elm_Access_Info
{
2012-06-29 23:21:14 -07:00
Evas_Object * hoverobj ;
Eina_List * items ;
Ecore_Timer * delay_timer ;
void * on_highlight_data ;
Elm_Access_On_Highlight_Cb on_highlight ;
2012-11-12 21:50:08 -08:00
void * activate_data ;
Elm_Access_Activate_Cb activate ;
/* the owner widget item that owns this access info */
2014-08-13 06:36:29 -07:00
Elm_Widget_Item_Data * widget_item ;
2012-11-12 21:50:08 -08:00
/* the owner part object that owns this access info */
Evas_Object * part_object ;
2013-07-05 22:41:00 -07:00
Evas_Object * next ;
Evas_Object * prev ;
2011-08-19 04:07:42 -07:00
} ;
2014-02-27 17:36:15 -08:00
struct _Elm_Action
{
const char * name ;
2014-03-31 05:28:05 -07:00
Eina_Bool ( * func ) ( Evas_Object * obj , const char * params ) ;
2014-02-27 17:36:15 -08:00
} ;
2015-11-26 08:50:14 -08:00
void _elm_access_shutdown ( void ) ;
2013-01-17 03:32:14 -08:00
void _elm_access_mouse_event_enabled_set ( Eina_Bool enabled ) ;
2013-09-09 22:01:50 -07:00
/* if auto_higlight is EINA_TRUE, it does not steal a focus, it just moves a highlight */
void _elm_access_auto_highlight_set ( Eina_Bool enabled ) ;
Eina_Bool _elm_access_auto_highlight_get ( void ) ;
2014-08-13 06:36:29 -07:00
void _elm_access_widget_item_access_order_set ( Elm_Widget_Item_Data * item , Eina_List * objs ) ;
const Eina_List * _elm_access_widget_item_access_order_get ( const Elm_Widget_Item_Data * item ) ;
void _elm_access_widget_item_access_order_unset ( Elm_Widget_Item_Data * item ) ;
2014-11-06 09:21:02 -08:00
// widget focus highlight
2014-02-18 06:40:48 -08:00
void _elm_widget_focus_highlight_start ( const Evas_Object * obj ) ;
2014-05-11 09:04:25 -07:00
void _elm_widget_highlight_in_theme_update ( Eo * obj ) ;
2014-11-06 09:21:02 -08:00
// win focus highlight
void _elm_win_focus_highlight_start ( Evas_Object * obj ) ;
void _elm_win_focus_highlight_in_theme_update ( Evas_Object * obj , Eina_Bool in_theme ) ;
2015-08-12 21:45:21 -07:00
Evas_Object * _elm_win_focus_highlight_object_get ( Evas_Object * obj ) ;
2015-03-04 00:47:54 -08:00
void _elm_win_focus_auto_show ( Evas_Object * obj ) ;
void _elm_win_focus_auto_hide ( Evas_Object * obj ) ;
2013-02-07 05:01:34 -08:00
2011-08-19 04:07:42 -07:00
EAPI void _elm_access_clear ( Elm_Access_Info * ac ) ;
EAPI void _elm_access_text_set ( Elm_Access_Info * ac , int type , const char * text ) ;
2013-01-14 20:20:37 -08:00
EAPI void _elm_access_callback_set ( Elm_Access_Info * ac , int type , Elm_Access_Info_Cb func , const void * data ) ;
2013-01-10 13:11:59 -08:00
EAPI char * _elm_access_text_get ( const Elm_Access_Info * ac , int type , const Evas_Object * obj ) ; /* this is ok it actually returns a strduped string - it's meant to! */
EAPI void _elm_access_read ( Elm_Access_Info * ac , int type , const Evas_Object * obj ) ;
2011-08-19 04:47:30 -07:00
EAPI void _elm_access_say ( const char * txt ) ;
2013-07-30 20:53:04 -07:00
EAPI Elm_Access_Info * _elm_access_info_get ( const Evas_Object * obj ) ;
2013-10-31 07:01:56 -07:00
EAPI void _elm_access_object_highlight ( Evas_Object * obj ) ;
2014-05-07 19:14:36 -07:00
EAPI void _elm_access_object_unhighlight ( Evas_Object * obj ) ;
2013-10-31 07:01:56 -07:00
EAPI void _elm_access_object_highlight_disable ( Evas * e ) ;
2011-08-19 04:07:42 -07:00
EAPI void _elm_access_object_register ( Evas_Object * obj , Evas_Object * hoverobj ) ;
2012-11-19 05:08:54 -08:00
EAPI void _elm_access_object_unregister ( Evas_Object * obj , Evas_Object * hoverobj ) ;
2011-08-19 07:39:27 -07:00
EAPI Eina_Bool _elm_access_2nd_click_timeout ( Evas_Object * obj ) ;
2012-06-25 22:54:45 -07:00
EAPI void _elm_access_highlight_set ( Evas_Object * obj ) ;
EAPI Evas_Object * _elm_access_edje_object_part_object_register ( Evas_Object * obj , const Evas_Object * partobj , const char * part ) ;
2012-09-12 01:25:10 -07:00
EAPI void _elm_access_edje_object_part_object_unregister ( Evas_Object * obj , const Evas_Object * eobj , const char * part ) ;
2014-08-13 06:36:29 -07:00
EAPI void _elm_access_widget_item_register ( Elm_Widget_Item_Data * item ) ;
EAPI void _elm_access_widget_item_unregister ( Elm_Widget_Item_Data * item ) ;
2012-06-29 23:21:14 -07:00
EAPI void _elm_access_on_highlight_hook_set ( Elm_Access_Info * ac , Elm_Access_On_Highlight_Cb func , void * data ) ;
2012-11-12 21:50:08 -08:00
EAPI void _elm_access_activate_callback_set ( Elm_Access_Info * ac , Elm_Access_Activate_Cb func , void * data ) ;
2017-10-15 21:33:52 -07:00
EAPI void _elm_access_highlight_object_activate ( Evas_Object * obj , Efl_Ui_Activate act ) ;
2012-11-30 03:50:52 -08:00
EAPI void _elm_access_highlight_cycle ( Evas_Object * obj , Elm_Focus_Direction dir ) ;
2011-08-10 16:43:50 -07:00
2013-07-30 20:53:04 -07:00
EINA_DEPRECATED EAPI Elm_Access_Info * _elm_access_object_get ( const Evas_Object * obj ) ;
2012-11-30 06:41:39 -08:00
# define ELM_PREFS_DATA_MAGIC 0xe1f5da7a
2012-01-09 16:02:58 -08:00
/**< put this as the first member in your widget item struct */
2014-08-13 06:36:29 -07:00
# define ELM_WIDGET_ITEM Elm_Widget_Item_Data base
2012-01-09 16:02:58 -08:00
2013-03-06 04:33:13 -08:00
struct _Elm_Widget_Item_Signal_Data
{
2015-03-19 00:40:18 -07:00
Elm_Object_Item * item ;
2013-03-06 04:33:13 -08:00
Elm_Widget_Item_Signal_Cb func ;
const char * emission ;
const char * source ;
void * data ;
} ;
2014-09-14 04:51:26 -07:00
# define WIDGET_ITEM_DATA_GET(eo_obj) \
2016-08-10 07:23:04 -07:00
efl_key_data_get ( ( Eo * ) eo_obj , " __elm_widget_item_data " )
2014-09-14 04:51:26 -07:00
# define WIDGET_ITEM_DATA_SET(eo_obj, data) \
2016-08-10 07:23:04 -07:00
efl_key_data_set ( ( Eo * ) eo_obj , " __elm_widget_item_data " , data )
2014-09-14 04:51:26 -07:00
2014-08-13 06:36:29 -07:00
struct _Elm_Widget_Item_Data
2010-09-13 00:56:23 -07:00
{
2012-01-09 16:02:58 -08:00
/* ef1 ~~ efl, el3 ~~ elm */
2010-09-13 00:56:23 -07:00
# define ELM_WIDGET_ITEM_MAGIC 0xef1e1301
EINA_MAGIC ;
2011-10-20 18:08:01 -07:00
/* simple accessor macros */
2014-08-18 23:04:07 -07:00
# define VIEW(X) X->base->view
# define WIDGET(X) X->base->widget
2014-08-19 00:52:24 -07:00
# define EO_OBJ(X) ((X)?X->base->eo_obj:NULL)
2012-01-09 16:02:58 -08:00
/**< the owner widget that owns this item */
Evas_Object * widget ;
2014-08-13 06:36:29 -07:00
/**< The Eo item, useful to invoke eo_do when only the item data is available */
Eo * eo_obj ;
2012-01-09 16:02:58 -08:00
/**< the base view object */
Evas_Object * view ;
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
/**< user delete callback function */
2012-01-09 16:33:51 -08:00
Evas_Smart_Cb del_func ;
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
/**< widget delete callback function. don't expose this callback call */
2012-01-09 17:00:23 -08:00
Elm_Widget_Del_Pre_Cb del_pre_func ;
2012-01-09 16:33:51 -08:00
2015-09-15 03:41:51 -07:00
Evas_Object * focus_previous , * focus_next ;
Evas_Object * focus_up , * focus_down , * focus_right , * focus_left ;
Elm_Object_Item * item_focus_previous , * item_focus_next ;
Elm_Object_Item * item_focus_up , * item_focus_down , * item_focus_right , * item_focus_left ;
2012-06-29 23:21:14 -07:00
Evas_Object * access_obj ;
2011-12-29 23:20:48 -08:00
const char * access_info ;
2016-11-09 17:58:41 -08:00
const char * accessible_name ;
2013-02-07 05:01:34 -08:00
Eina_List * access_order ;
2013-07-16 23:05:40 -07:00
Eina_Inlist * translate_strings ;
2013-03-06 04:33:13 -08:00
Eina_List * signals ;
2013-09-17 15:46:46 -07:00
Eina_Hash * labels ;
2013-09-12 07:24:02 -07:00
Evas_Object * track_obj ;
2012-02-23 20:31:03 -08:00
2011-12-29 23:20:48 -08:00
Eina_Bool disabled : 1 ;
2014-02-07 01:09:46 -08:00
Eina_Bool on_deletion : 1 ;
2013-04-23 00:49:49 -07:00
Eina_Bool on_translate : 1 ;
elm_list & elm_genlist & elm_gengrid: fix the behavior of using the mouse.
Summary:
Elementary widgets have different behavior of using the mouse, they need to be unified.
- swipe : without checking on hold, just checking drag state.
- longpress : after longpress, _item_unhighlight(), _item_unselect() are called.
- select : when the mouse pointer leaves item area, _item_unhighlight(), _item_unselect() are called.
First, apply this commit https://phab.enlightenment.org/D2550
Test Plan: elementary_test -> list
Reviewers: seoz, Hermet, CHAN, woohyun, kimcinoo, jaehwan, SanghyeonLee, cedric
Reviewed By: cedric
Differential Revision: https://phab.enlightenment.org/D2622
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-06-25 07:33:57 -07:00
Eina_Bool still_in : 1 ;
2010-09-13 00:56:23 -07:00
} ;
# define ELM_NEW(t) calloc(1, sizeof(t))
2011-08-04 01:52:49 -07:00
2012-07-18 14:03:28 -07:00
EAPI Evas_Object * elm_widget_add ( Evas_Smart * , Evas_Object * ) ;
2010-09-13 00:56:23 -07:00
EAPI Eina_Bool elm_widget_api_check ( int ver ) ;
2012-07-03 05:09:34 -07:00
EAPI Eina_Bool elm_widget_access ( Evas_Object * obj , Eina_Bool is_access ) ;
2017-08-09 00:13:06 -07:00
EAPI Efl_Ui_Theme_Apply elm_widget_theme ( Evas_Object * obj ) ;
2010-11-05 01:37:31 -07:00
EAPI void elm_widget_theme_specific ( Evas_Object * obj , Elm_Theme * th , Eina_Bool force ) ;
2017-08-21 23:16:54 -07:00
EAPI void elm_widget_on_show_region_hook_set ( Evas_Object * obj , void * data , Efl_Ui_Scrollable_On_Show_Region func , Eina_Free_Cb data_free ) ;
2013-09-24 21:33:39 -07:00
EAPI Eina_Bool elm_widget_sub_object_parent_add ( Evas_Object * sobj ) ;
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
EAPI Eina_Bool elm_widget_sub_object_add ( Evas_Object * obj , Evas_Object * sobj ) ;
EAPI Eina_Bool elm_widget_sub_object_del ( Evas_Object * obj , Evas_Object * sobj ) ;
2017-08-08 05:06:43 -07:00
EAPI void elm_widget_resize_object_set ( Evas_Object * obj , Evas_Object * sobj ) ;
2010-09-13 00:56:23 -07:00
EAPI void elm_widget_hover_object_set ( Evas_Object * obj , Evas_Object * sobj ) ;
EAPI void elm_widget_signal_emit ( Evas_Object * obj , const char * emission , const char * source ) ;
2011-08-10 16:43:50 -07:00
EAPI void elm_widget_signal_callback_add ( Evas_Object * obj , const char * emission , const char * source , Edje_Signal_Cb func , void * data ) ;
EAPI void * elm_widget_signal_callback_del ( Evas_Object * obj , const char * emission , const char * source , Edje_Signal_Cb func ) ;
2010-09-27 21:28:14 -07:00
EAPI void elm_widget_can_focus_set ( Evas_Object * obj , Eina_Bool can_focus ) ;
2010-09-24 07:47:52 -07:00
EAPI Eina_Bool elm_widget_can_focus_get ( const Evas_Object * obj ) ;
EAPI Eina_Bool elm_widget_child_can_focus_get ( const Evas_Object * obj ) ;
2011-08-05 01:25:07 -07:00
EAPI Eina_List * elm_widget_can_focus_child_list_get ( const Evas_Object * obj ) ;
2011-07-27 23:58:29 -07:00
EAPI void elm_widget_tree_unfocusable_set ( Evas_Object * obj , Eina_Bool tree_unfocusable ) ;
EAPI Eina_Bool elm_widget_tree_unfocusable_get ( const Evas_Object * obj ) ;
Begins highlight on focused object.
There's still work to do here, particularly in the theme, but it has
something nice and fun to see the code working.
The idea behind this:
Window tracks focused object and sends the highlight object(s) to it. These
are simple edje objects, one on top, one below the focused widget for nice
effects. Widgets can choose to ignore the highlight and this will be sent to
the parent object, if it doesn't ignore it as well.
About the bottom object, it doesn't work now. For the most part, focused
widget will always be a member of some smart object, so stacking won't work
and the desired effect is nowhere to be seen. This will be worked out later.
To be done now:
- Let the theme for a widget define its own highlight, disabling if needed
the standard one for those objects.
- Needed base in code to allow animations when switching focus. All in theme.
- Properly test all widgets and fix some things that will most likely work
in weird ways, given the nature of Evas/Edje and how Elementary makes use
of them.
- Forgot the rest, stay tuned, test, report, give ideas, plant a tree.
Work started by glima, continued with some refactors by me when he
decided he needed vacations.
SVN revision: 52524
2010-09-20 15:18:58 -07:00
EAPI void elm_widget_highlight_ignore_set ( Evas_Object * obj , Eina_Bool ignore ) ;
EAPI Eina_Bool elm_widget_highlight_ignore_get ( const Evas_Object * obj ) ;
2010-09-22 15:33:57 -07:00
EAPI void elm_widget_highlight_in_theme_set ( Evas_Object * obj , Eina_Bool highlight ) ;
EAPI Eina_Bool elm_widget_highlight_in_theme_get ( const Evas_Object * obj ) ;
2014-02-07 19:27:41 -08:00
EAPI void elm_widget_access_highlight_in_theme_set ( Evas_Object * obj , Eina_Bool highlight ) ;
EAPI Eina_Bool elm_widget_access_highlight_in_theme_get ( const Evas_Object * obj ) ;
2013-01-28 03:13:18 -08:00
EAPI Eina_Bool elm_widget_highlight_get ( const Evas_Object * obj ) ;
2010-09-13 00:56:23 -07:00
EAPI Evas_Object * elm_widget_top_get ( const Evas_Object * obj ) ;
EAPI Eina_Bool elm_widget_is ( const Evas_Object * obj ) ;
EAPI Evas_Object * elm_widget_parent_widget_get ( const Evas_Object * obj ) ;
2010-11-29 05:56:30 -08:00
EAPI void elm_widget_event_callback_add ( Evas_Object * obj , Elm_Event_Cb func , const void * data ) ;
EAPI void * elm_widget_event_callback_del ( Evas_Object * obj , Elm_Event_Cb func , const void * data ) ;
2014-02-05 02:17:41 -08:00
EAPI Eina_Bool elm_widget_focus_highlight_style_set ( Evas_Object * obj , const char * style ) ;
EAPI const char * elm_widget_focus_highlight_style_get ( const Evas_Object * obj ) ;
2013-01-28 03:13:18 -08:00
EAPI void elm_widget_parent_highlight_set ( Evas_Object * obj , Eina_Bool highlighted ) ;
2013-12-31 01:14:41 -08:00
EAPI void elm_widget_focus_set ( Evas_Object * obj , Eina_Bool focus ) ;
2010-09-13 00:56:23 -07:00
EAPI Evas_Object * elm_widget_parent_get ( const Evas_Object * obj ) ;
2012-10-14 07:48:02 -07:00
EAPI void elm_widget_display_mode_set ( Evas_Object * obj , Evas_Display_Mode dispmode ) ;
2014-02-18 06:40:48 -08:00
EAPI Eina_Bool elm_widget_focus_highlight_enabled_get ( const Evas_Object * obj ) ;
EAPI void elm_widget_focus_highlight_focus_part_geometry_get ( const Evas_Object * obj , Evas_Coord * x , Evas_Coord * y , Evas_Coord * w , Evas_Coord * h ) ;
2015-08-12 21:45:21 -07:00
Evas_Object * _elm_widget_focus_highlight_object_get ( const Evas_Object * obj ) ;
[Elm] Creating base smart class, to be extended
properly by real widgets.
I'm also creating a *compatibility* class on top of it, which extends
the old (unique) one to its old components, so that everything goes
unnoticed for the widgets.
Next, we'll be accessing class functions for widget hooks *on the base
class*, which will be proxied back to the instance ones.
Then, one by one the widgets will be translated to a proper
hierarchical smart class parentage, making extensibility and reuse
much better.
Last, but not least, since we'll be moving these hooks to the class,
where (almost) everything is a function, let's adapt to the future --
take away the "_func" suffix from them.
NB: there is ONE hook and associated data which was kept on the base,
for now: "show_region" stuff. I did that because scrollers need that
in order to work, right now. Keep in mind, though, the scrollers will
be reworked, so that fields ought to be changed soon, too.
SVN revision: 70704
2012-05-03 15:41:04 -07:00
EAPI const Elm_Widget_Smart_Class * elm_widget_smart_class_get ( void ) ;
2011-08-09 01:36:02 -07:00
/**
* @ internal
*
* Restore the focus state of the sub - tree .
2011-08-09 21:35:31 -07:00
*
2012-02-14 00:50:53 -08:00
* This API will restore the focus state of the sub - tree to the latest
* state . If a sub - tree is unfocused and wants to get back to the latest
2011-08-09 01:36:02 -07:00
* focus state , this API will be helpful .
*
* @ param obj The widget root of sub - tree
*
* @ ingroup Widget
*/
2011-04-27 09:12:56 -07:00
EAPI void elm_widget_disabled_set ( Evas_Object * obj , Eina_Bool disabled ) ;
EAPI Eina_Bool elm_widget_disabled_get ( const Evas_Object * obj ) ;
2017-09-13 19:59:44 -07:00
EAPI void elm_widget_show_region_set ( Evas_Object * obj , Eina_Rect sr , Eina_Bool forceshow ) ;
EAPI Eina_Rect elm_widget_show_region_get ( const Evas_Object * obj ) ;
EAPI Eina_Rect elm_widget_focus_region_get ( const Evas_Object * obj ) ;
2017-08-28 22:48:48 -07:00
EAPI void elm_widget_focus_region_show ( Evas_Object * obj ) ;
2010-09-13 00:56:23 -07:00
EAPI void elm_widget_scroll_hold_push ( Evas_Object * obj ) ;
EAPI void elm_widget_scroll_hold_pop ( Evas_Object * obj ) ;
EAPI int elm_widget_scroll_hold_get ( const Evas_Object * obj ) ;
EAPI void elm_widget_scroll_freeze_push ( Evas_Object * obj ) ;
EAPI void elm_widget_scroll_freeze_pop ( Evas_Object * obj ) ;
EAPI int elm_widget_scroll_freeze_get ( const Evas_Object * obj ) ;
EAPI void elm_widget_theme_set ( Evas_Object * obj , Elm_Theme * th ) ;
EAPI Elm_Theme * elm_widget_theme_get ( const Evas_Object * obj ) ;
2017-08-09 00:13:06 -07:00
EAPI Efl_Ui_Theme_Apply elm_widget_style_set ( Evas_Object * obj , const char * style ) ;
2010-09-13 00:56:23 -07:00
EAPI const char * elm_widget_style_get ( const Evas_Object * obj ) ;
EAPI void elm_widget_type_set ( Evas_Object * obj , const char * type ) ;
EAPI const char * elm_widget_type_get ( const Evas_Object * obj ) ;
EAPI void elm_widget_tooltip_add ( Evas_Object * obj , Elm_Tooltip * tt ) ;
EAPI void elm_widget_tooltip_del ( Evas_Object * obj , Elm_Tooltip * tt ) ;
2010-09-25 15:01:19 -07:00
EAPI void elm_widget_cursor_add ( Evas_Object * obj , Elm_Cursor * cur ) ;
EAPI void elm_widget_cursor_del ( Evas_Object * obj , Elm_Cursor * cur ) ;
2017-08-29 02:15:33 -07:00
EAPI void elm_widget_scroll_lock_set ( Evas_Object * obj , Efl_Ui_Scroll_Block block ) ;
EAPI Efl_Ui_Scroll_Block elm_widget_scroll_lock_get ( const Evas_Object * obj ) ;
2017-08-29 00:49:43 -07:00
EAPI int elm_widget_scroll_child_locked_x_get ( const Evas_Object * obj ) ;
EAPI int elm_widget_scroll_child_locked_y_get ( const Evas_Object * obj ) ;
2017-08-09 00:13:06 -07:00
EAPI Efl_Ui_Theme_Apply elm_widget_theme_object_set ( Evas_Object * obj , Evas_Object * edj , const char * wname , const char * welement , const char * wstyle ) ;
2011-09-11 19:06:27 -07:00
EAPI Eina_Bool elm_widget_type_check ( const Evas_Object * obj , const char * type , const char * func ) ;
2011-12-27 22:01:31 -08:00
EAPI Evas_Object * elm_widget_name_find ( const Evas_Object * obj , const char * name , int recurse ) ;
2010-09-13 00:56:23 -07:00
EAPI Eina_List * elm_widget_stringlist_get ( const char * str ) ;
EAPI void elm_widget_stringlist_free ( Eina_List * list ) ;
2011-08-08 03:32:32 -07:00
EAPI void elm_widget_focus_mouse_up_handle ( Evas_Object * obj ) ;
2017-10-15 21:33:52 -07:00
EAPI void elm_widget_activate ( Evas_Object * obj , Efl_Ui_Activate act ) ;
2013-02-13 03:02:36 -08:00
EAPI void elm_widget_part_text_set ( Evas_Object * obj , const char * part , const char * label ) ;
EAPI const char * elm_widget_part_text_get ( const Evas_Object * obj , const char * part ) ;
2013-02-12 03:43:39 -08:00
EAPI const char * elm_widget_translatable_part_text_get ( const Evas_Object * obj , const char * part ) ;
2013-04-23 00:49:49 -07:00
EAPI void elm_widget_domain_part_text_translatable_set ( Evas_Object * obj , const char * part , const char * domain , Eina_Bool translatable ) ;
2011-08-03 05:27:57 -07:00
EAPI void elm_widget_content_part_set ( Evas_Object * obj , const char * part , Evas_Object * content ) ;
EAPI Evas_Object * elm_widget_content_part_get ( const Evas_Object * obj , const char * part ) ;
EAPI Evas_Object * elm_widget_content_part_unset ( Evas_Object * obj , const char * part ) ;
2011-08-19 04:47:30 -07:00
EAPI void elm_widget_access_info_set ( Evas_Object * obj , const char * txt ) ;
2012-02-20 04:13:08 -08:00
EAPI const char * elm_widget_access_info_get ( const Evas_Object * obj ) ;
2013-02-13 21:38:26 -08:00
EAPI void elm_widget_orientation_mode_disabled_set ( Evas_Object * obj , Eina_Bool disabled ) ;
EAPI Eina_Bool elm_widget_orientation_mode_disabled_get ( const Evas_Object * obj ) ;
2017-09-13 19:59:44 -07:00
EAPI Eina_Rect elm_widget_focus_highlight_geometry_get ( const Evas_Object * obj ) ;
2014-02-21 11:09:46 -08:00
void _elm_widget_item_highlight_in_theme ( Evas_Object * obj , Elm_Object_Item * it ) ;
2015-08-12 01:25:15 -07:00
EAPI void elm_widget_focus_region_show_mode_set ( Evas_Object * obj , Elm_Focus_Region_Show_Mode mode ) ;
EAPI Elm_Focus_Region_Show_Mode elm_widget_focus_region_show_mode_get ( const Evas_Object * obj ) ;
2017-09-24 23:33:31 -07:00
const char * elm_widget_part_translatable_text_get ( const Eo * obj , const char * part , const char * * domain ) ;
void elm_widget_part_translatable_text_set ( Eo * obj , const char * part , const char * label , const char * domain ) ;
2013-09-12 07:24:02 -07:00
2017-11-14 01:42:48 -08:00
EAPI Eina_Bool elm_widget_theme_klass_set ( Evas_Object * obj , const char * name ) ;
EAPI const char * elm_widget_theme_klass_get ( const Evas_Object * obj ) ;
EAPI Eina_Bool elm_widget_theme_element_set ( Evas_Object * obj , const char * name ) ;
EAPI const char * elm_widget_theme_element_get ( const Evas_Object * obj ) ;
EAPI Eina_Bool elm_widget_theme_style_set ( Evas_Object * obj , const char * name ) ;
EAPI const char * elm_widget_theme_style_get ( const Evas_Object * obj ) ;
EAPI Efl_Ui_Theme_Apply elm_widget_element_update ( Evas_Object * obj , Evas_Object * component , const char * name ) ;
2010-09-28 12:35:12 -07:00
/* debug function. don't use it unless you are tracking parenting issues */
EAPI void elm_widget_tree_dump ( const Evas_Object * top ) ;
2010-10-04 11:37:48 -07:00
EAPI void elm_widget_tree_dot_dump ( const Evas_Object * top , FILE * output ) ;
2015-05-19 04:33:19 -07:00
EAPI Eina_Bool _elm_widget_onscreen_is ( Evas_Object * widget ) ;
EAPI Eina_Bool _elm_widget_item_onscreen_is ( Elm_Object_Item * item ) ;
2017-09-06 03:54:59 -07:00
const char * _elm_widget_accessible_plain_name_get ( Evas_Object * obj , const char * name ) ;
const char * _elm_widget_item_accessible_plain_name_get ( Elm_Object_Item * item , const char * name ) ;
2010-09-28 12:35:12 -07:00
2017-11-23 22:17:05 -08:00
Efl_Canvas_Object * _efl_ui_widget_bg_get ( Elm_Widget * obj ) ;
2013-10-05 00:25:40 -07:00
# define ELM_WIDGET_DATA_GET_OR_RETURN(o, ptr, ...) \
2014-01-13 04:11:04 -08:00
Elm_Widget_Smart_Data * ptr ; \
2016-08-15 06:44:41 -07:00
ptr = efl_data_scope_get ( o , ELM_WIDGET_CLASS ) ; \
2014-01-13 04:11:04 -08:00
if ( EINA_UNLIKELY ( ! ptr ) ) \
2012-08-30 09:46:59 -07:00
{ \
2014-01-13 04:11:04 -08:00
CRI ( " no widget data for object %p (%s) " , \
o , evas_object_type_get ( o ) ) ; \
2013-10-05 00:25:40 -07:00
return __VA_ARGS__ ; \
2012-08-30 09:46:59 -07:00
}
2014-01-13 04:11:04 -08:00
# define ELM_WIDGET_CHECK(obj) \
2016-08-15 06:44:41 -07:00
if ( EINA_UNLIKELY ( ! efl_isa ( ( obj ) , ELM_WIDGET_CLASS ) ) ) \
2012-11-25 22:32:53 -08:00
return
2014-02-07 01:09:46 -08:00
# define ELM_WIDGET_ITEM_RETURN_IF_ONDEL(item, ...) \
do { \
if ( item & & ( item ) - > on_deletion ) { \
WRN ( " Elm_Widget_Item " # item " is deleting " ) ; \
return __VA_ARGS__ ; \
} \
} while ( 0 )
2012-02-23 22:53:03 -08:00
# define ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, ...) \
2012-04-03 00:30:11 -07:00
do { \
if ( ! item ) { \
2013-12-25 20:03:55 -08:00
CRI ( " Elm_Widget_Item " # item " is NULL " ) ; \
2012-04-03 00:30:11 -07:00
return __VA_ARGS__ ; \
} \
2014-08-13 06:36:29 -07:00
if ( ( item ) - > eo_obj & & \
2016-08-15 06:44:41 -07:00
efl_isa ( ( item ) - > eo_obj , ELM_WIDGET_ITEM_CLASS ) ) break ; \
2012-04-03 00:30:11 -07:00
if ( ! EINA_MAGIC_CHECK ( item , ELM_WIDGET_ITEM_MAGIC ) ) { \
EINA_MAGIC_FAIL ( item , ELM_WIDGET_ITEM_MAGIC ) ; \
2012-02-23 22:53:03 -08:00
return __VA_ARGS__ ; \
} \
} while ( 0 )
# define ELM_WIDGET_ITEM_CHECK_OR_GOTO(item, label) \
do { \
2012-04-03 00:30:11 -07:00
if ( ! item ) { \
2013-12-25 20:03:55 -08:00
CRI ( " Elm_Widget_Item " # item " is NULL " ) ; \
2012-04-03 00:30:11 -07:00
goto label ; \
} \
2014-08-13 06:36:29 -07:00
if ( ( item ) - > eo_obj & & \
2016-08-15 06:44:41 -07:00
efl_isa ( ( item ) - > eo_obj , ELM_WIDGET_ITEM_CLASS ) ) break ; \
2012-02-23 22:53:03 -08:00
if ( ! EINA_MAGIC_CHECK ( item , ELM_WIDGET_ITEM_MAGIC ) ) { \
EINA_MAGIC_FAIL ( item , ELM_WIDGET_ITEM_MAGIC ) ; \
2012-04-03 00:30:11 -07:00
goto label ; \
2012-02-23 22:53:03 -08:00
} \
} while ( 0 )
2011-12-29 23:20:48 -08:00
2016-05-29 17:47:39 -07:00
static inline Eina_Bool
_elm_widget_sub_object_redirect_to_top ( Evas_Object * obj , Evas_Object * sobj )
{
Eina_Bool ret = elm_widget_sub_object_del ( obj , sobj ) ;
2017-08-11 15:43:15 -07:00
if ( ! ret ) return ret ;
if ( elm_widget_is ( sobj ) )
2016-05-29 19:36:49 -07:00
ret = elm_widget_sub_object_add ( elm_widget_top_get ( obj ) , sobj ) ;
2016-05-29 17:47:39 -07:00
return ret ;
}
2017-11-06 21:00:43 -08:00
/* Internal hack to mark legacy objects as such before construction.
* No need for TLS : Only UI objects created in the main loop matter . */
2017-11-22 22:20:00 -08:00
EAPI extern Eina_Bool _elm_legacy_add ;
2017-11-06 21:00:43 -08:00
# define elm_legacy_add(k, p, ...) ({ _elm_legacy_add = 1; \
efl_add ( k , p , efl_canvas_object_legacy_ctor ( efl_added ) , # # __VA_ARGS__ ) ; } )
2017-08-09 00:22:48 -07:00
static inline Eina_Bool
elm_widget_is_legacy ( const Eo * obj )
{
2017-11-06 21:00:43 -08:00
Elm_Widget_Smart_Data * sd ;
if ( _elm_legacy_add ) return EINA_TRUE ;
sd = ( Elm_Widget_Smart_Data * ) efl_data_scope_safe_get ( obj , ELM_WIDGET_CLASS ) ;
2017-08-09 00:22:48 -07:00
return sd ? sd - > legacy : EINA_FALSE ;
}
2017-08-30 19:27:49 -07:00
/** Takes in any canvas object and returns the first smart parent that is a widget */
static inline Elm_Widget *
evas_object_widget_parent_find ( Evas_Object * o )
{
while ( o & & ! efl_isa ( o , ELM_WIDGET_CLASS ) )
evas_object_smart_parent_get ( o ) ;
return o ;
}
2012-07-04 14:41:01 -07:00
/* to be used by INTERNAL classes on Elementary, so that the widgets
* parsing script skips it */
# define ELM_INTERNAL_SMART_SUBCLASS_NEW EVAS_SMART_SUBCLASS_NEW
2012-08-22 01:33:43 -07:00
EAPI Eina_Bool elm_selection_selection_has_owner ( Evas_Object * obj ) ;
2010-09-16 22:39:04 -07:00
2017-06-29 03:32:19 -07:00
EAPI Eina_Bool _elm_layout_part_aliasing_eval ( const Evas_Object * obj ,
const char * * part ,
Eina_Bool is_text ) ;
2017-06-29 04:02:59 -07:00
/* Internal EO APIs */
const char * elm_widget_default_content_part_get ( const Eo * obj ) ;
2017-07-04 02:54:44 -07:00
const char * elm_widget_default_text_part_get ( const Eo * obj ) ;
2017-06-29 04:02:59 -07:00
2017-06-29 03:32:19 -07:00
2014-08-13 06:36:29 -07:00
# define ELM_WIDGET_ITEM_PROTECTED
# include "elm_widget_item.eo.h"
2014-03-14 02:13:29 -07:00
# endif