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
* FINAL . CALL elm_widget_api_check ( ELM_INTERNAL_API_VERSION ) TO CHECK IT
* AT RUNTIME
2011-04-01 01:05:24 -07:00
*
2010-09-13 00:56:23 -07:00
* How to make your own widget ? like this :
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
*
2010-09-13 00:56:23 -07:00
* typedef struct _Widget_Data Widget_Data ;
2011-04-01 01:05:24 -07:00
*
2010-09-13 00:56:23 -07:00
* struct _Widget_Data
* {
* Evas_Object * sub ;
* // add any other widget data here too
* } ;
2011-04-01 01:05:24 -07:00
*
2010-09-13 00:56:23 -07:00
* static const char * widtype = NULL ;
* static void _del_hook ( Evas_Object * obj ) ;
* static void _theme_hook ( Evas_Object * obj ) ;
* static void _disable_hook ( Evas_Object * obj ) ;
* static void _sizing_eval ( Evas_Object * obj ) ;
* static void _on_focus_hook ( void * data , Evas_Object * obj ) ;
2011-04-01 01:05:24 -07:00
*
2010-09-13 00:56:23 -07:00
* static const char SIG_CLICKED [ ] = " clicked " ;
* static const Evas_Smart_Cb_Description _signals [ ] = {
* { SIG_CLICKED , " " } ,
* { NULL , NULL }
* } ;
2011-04-01 01:05:24 -07:00
*
2010-09-13 00:56:23 -07:00
* static void
* _del_hook ( Evas_Object * obj )
* {
* Widget_Data * wd = elm_widget_data_get ( obj ) ;
* if ( ! wd ) return ;
* // delete hook - on delete of object delete object struct etc.
* free ( wd ) ;
* }
2011-04-01 01:05:24 -07:00
*
2010-09-13 00:56:23 -07:00
* static void
* _on_focus_hook ( void * data __UNUSED__ , Evas_Object * obj )
* {
* Widget_Data * wd = elm_widget_data_get ( obj ) ;
* if ( ! wd ) return ;
* // handle focus going in and out - optional, but if you want to, set
* // this hook and handle it (eg emit a signal to an edje obj)
* if ( elm_widget_focus_get ( obj ) )
* {
* edje_object_signal_emit ( wd - > sub , " elm,action,focus " , " elm " ) ;
2010-09-18 19:30:14 -07:00
* evas_object_focus_set ( wd - > sub , EINA_TRUE ) ;
2010-09-13 00:56:23 -07:00
* }
* else
* {
* edje_object_signal_emit ( wd - > sub , " elm,action,unfocus " , " elm " ) ;
2010-09-18 19:30:14 -07:00
* evas_object_focus_set ( wd - > sub , EINA_FALSE ) ;
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
* _theme_hook ( Evas_Object * obj )
* {
* Widget_Data * wd = elm_widget_data_get ( obj ) ;
* if ( ! wd ) return ;
2010-12-31 00:45:45 -08:00
* // handle change in theme/scale etc.
2011-04-01 01:05:24 -07:00
* elm_widget_theme_object_set ( obj , wd - > sub , " mywidget " , " base " ,
2010-09-14 04:56:48 -07:00
* elm_widget_style_get ( obj ) ) ;
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
* _disable_hook ( Evas_Object * obj )
* {
* Widget_Data * wd = elm_widget_data_get ( obj ) ;
* if ( ! wd ) return ;
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 ) )
* edje_object_signal_emit ( wd - > sub , " elm,state,disabled " , " elm " ) ;
* else
* edje_object_signal_emit ( wd - > sub , " elm,state,enabled " , " elm " ) ;
* }
2011-04-01 01:05:24 -07:00
*
2010-09-13 00:56:23 -07:00
* static void
* _sizing_eval ( Evas_Object * obj )
* {
* Widget_Data * wd = elm_widget_data_get ( obj ) ;
* Evas_Coord minw = - 1 , minh = - 1 , maxw = - 1 , maxh = - 1 ;
* if ( ! wd ) return ;
* elm_coords_finger_size_adjust ( 1 , & minw , 1 , & minh ) ;
* edje_object_size_min_restricted_calc ( wd - > sub , & minw , & minh , minw , minh ) ;
* elm_coords_finger_size_adjust ( 1 , & minw , 1 , & minh ) ;
* evas_object_size_hint_min_set ( obj , minw , minh ) ;
* evas_object_size_hint_max_set ( obj , maxw , maxh ) ;
* }
2011-04-01 01:05:24 -07:00
*
2010-09-13 00:56:23 -07:00
* // 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_mywidget_add ( Evas_Object * parent )
* {
* Evas_Object * obj ;
* Evas * e ;
* Widget_Data * wd ;
2011-04-01 01:05:24 -07:00
*
2010-09-13 00:56:23 -07:00
* // ALWAYS call this - this checks that your widget matches that of
* // elementary and that the api hasn't broken. if it has this returns
* // false and you need to handle this error gracefully
* if ( ! elm_widget_api_check ( ELM_INTERNAL_API_VERSION ) ) return NULL ;
2011-03-31 23:08:02 -07:00
*
* // standard widget setup and allocate wd, create obj given parent etc.
* ELM_WIDGET_STANDARD_SETUP ( wd , Widget_Data , parent , e , obj , NULL ) ;
2011-04-01 01:05:24 -07:00
*
2010-12-31 00:45:45 -08:00
* // give it a type name and set up a mywidget type string if needed
2010-09-13 00:56:23 -07:00
* ELM_SET_WIDTYPE ( widtype , " mywidget " ) ;
* elm_widget_type_set ( obj , " mywidget " ) ;
* // tell the parent widget that we are a sub object
* elm_widget_sub_object_add ( parent , obj ) ;
* // setup hooks we need (some are optional)
* elm_widget_on_focus_hook_set ( obj , _on_focus_hook , NULL ) ;
* elm_widget_data_set ( obj , wd ) ;
* elm_widget_del_hook_set ( obj , _del_hook ) ;
* elm_widget_theme_hook_set ( obj , _theme_hook ) ;
* elm_widget_disable_hook_set ( obj , _disable_hook ) ;
2010-12-31 00:45:45 -08:00
* // this widget can focus (true means yes it can, false means it can't)
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
2010-09-13 00:56:23 -07:00
* wd - > sub = edje_object_add ( e ) ;
* // set the theme. this follows a scheme for group name like this:
* // "elm/WIDGETNAME/ELEMENT/STYLE"
* // so here it will be:
* // "elm/mywidget/base/default"
* // 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
* elm_widget_theme_object_set ( obj , wd - > sub , " mywidget " , " base " , " default " ) ;
* // listen to a signal from the edje object to produce widget smart
* // callback (like click)
* edje_object_signal_callback_add ( wd - > sub , " elm,action,click " , " " ,
* _signal_clicked , obj ) ;
* // 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.
2010-09-13 00:56:23 -07:00
* elm_widget_resize_object_set ( obj , wd - > sub ) ;
2011-04-01 01:05:24 -07:00
*
2010-09-13 00:56:23 -07:00
* // evaluate sizing of the widget (minimum size calc etc.). optional but
* // not a bad idea to do here. it will get queued for later anyway
* _sizing_eval ( obj ) ;
2011-04-01 01:05:24 -07:00
*
2010-09-13 00:56:23 -07:00
* // register the smart callback descriptions so we can have some runtime
* // info as to what the smart callback strings mean
* evas_object_smart_callbacks_descriptions_set ( obj , _signals ) ;
* 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
* elm_mywidget_whatever ( Evas_Object * obj )
* {
* // check if type is correct - check will return if it fails
* ELM_CHECK_WIDTYPE ( obj , widtype ) ;
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
* Widget_Data * wd = elm_widget_data_get ( obj ) ;
* // do whatever you like
* edje_object_signal_emit ( wd - > sub , " elm,state,action,whatever " , " elm " ) ;
* }
2011-04-01 01:05:24 -07:00
*
2010-09-13 00:56:23 -07:00
* // you can add more - you need to see elementary's code to know how to
2010-09-23 22:29:42 -07:00
* // handle all cases. remember this api is not stable and may change. it's
2010-09-13 00:56:23 -07:00
* // internal
2011-04-01 01:05:24 -07:00
*
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 .
*
* The next fields are the class functions itself . We call them
* ' 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 .
*
* @ section elm - migration Elementary ' s Migration to a hierarchical schema
*
* What ' s been stated before is a work in progress . Elementary 1.0 is
* @ b not hierarchical in this way , but the idea is to get at this
* shape , now . This section is here to explain the process of
* migration , and it will be taken off once it ' s completed .
*
* We want to migrate widgets to the new schema progressively , one by
* one . In order for this to happen without hurting anyone during the
* process , it was made a @ b compatibility class for Elementary
* widgets , to take place of the old , unique smart class for
* them . This is the role of # Elm_Widget_Compat_Smart_Class .
*
* All functions we had as ' hooks ' before will be migrated to class
* functions . As you can see , all calls to @ b instance hooks on the
* common code for widgets were replaced to < b > class function calls
* < / b > , now . It just happens that , for
* # Elm_Widget_Compat_Smart_Class - typed widgets , i . e . , the ones not
* migrated to the new schema yet , class calls are proxyed back to
* their instance ' hook ' calls , that live on
* # Elm_Widget_Compat_Smart_Data structs . Those structs are
* # Elm_Widget_Smart_Data augmented with what is needed to reach the
* original widget ' s data field set , so that things go on @ b unnoticed
* for the widgets awaiting translation to the new hierarchy .
*
* The following figure illustrates the old an new widget schemas ,
* with highlights on their differences .
*
* @ 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
*
* The following figure illustrates the current state on the
* Elementary widget inheriting tree .
*
* @ 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
*/
/**
* @ addtogroup Widget
* @ {
*/
/**
* @ def ELM_WIDGET_CLASS
*
* Use this macro to cast whichever subclass of
2012-05-31 10:55:07 -07:00
* # Elm_Widget_Smart_Class into it , so to access its fields .
[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
*
* @ ingroup Widget
*/
# define ELM_WIDGET_CLASS(x) ((Elm_Widget_Smart_Class *) x)
/**
* @ def ELM_WIDGET_DATA
*
* Use this macro to cast whichever subdata of
2012-05-31 10:55:07 -07:00
* # Elm_Widget_Smart_Data into it , so to access its fields .
[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
*
* @ ingroup Widget
*/
# define ELM_WIDGET_DATA(x) ((Elm_Widget_Smart_Data *) x)
/**
* @ def ELM_WIDGET_SMART_CLASS_VERSION
*
* Current version for Elementary widget @ b base smart class , a value
* which goes to _Elm_Widget_Smart_Class : : version .
*
* @ ingroup Wiget
*/
# define ELM_WIDGET_SMART_CLASS_VERSION 1
/**
* @ def ELM_WIDGET_SMART_CLASS_INIT
*
* Initializer for a whole # Elm_Widget_Smart_Class structure , with
* @ c NULL values on its specific fields .
*
* @ param smart_class_init initializer to use for the " base " field
* ( # Evas_Smart_Class ) .
*
* @ see EVAS_SMART_CLASS_INIT_NULL
* @ see EVAS_SMART_CLASS_INIT_VERSION
* @ see EVAS_SMART_CLASS_INIT_NAME_VERSION
* @ see ELM_WIDGET_SMART_CLASS_INIT_NULL
* @ see ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION
*
* @ ingroup Widget
*/
# define ELM_WIDGET_SMART_CLASS_INIT(smart_class_init) \
{ smart_class_init , ELM_WIDGET_SMART_CLASS_VERSION , NULL , NULL , NULL , NULL , \
2012-07-18 14:03:28 -07:00
NULL , NULL , NULL , NULL , NULL , NULL , NULL }
[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
/**
* @ def ELM_WIDGET_SMART_CLASS_INIT_NULL
*
* Initializer to zero out a whole # Elm_Widget_Smart_Class structure .
*
* @ see ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION
* @ see ELM_WIDGET_SMART_CLASS_INIT
*
* @ ingroup Widget
*/
# define ELM_WIDGET_SMART_CLASS_INIT_NULL \
ELM_WIDGET_SMART_CLASS_INIT ( EVAS_SMART_CLASS_INIT_NULL )
/**
* @ def ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION
*
* Initializer to zero out a whole # Elm_Widget_Smart_Class structure and
* set its name and version .
*
* This is similar to # ELM_WIDGET_SMART_CLASS_INIT_NULL , but it will
* also set the version field of # Elm_Widget_Smart_Class ( base field )
* to the latest # ELM_WIDGET_SMART_CLASS_VERSION and name it to the
* specific value .
*
* It will keep a reference to the name field as a < c > " const char * " < / c > ,
* i . e . , the name must be available while the structure is
* used ( hint : static or global variable ! ) and must not be modified .
*
* @ see ELM_WIDGET_SMART_CLASS_INIT_NULL
* @ see ELM_WIDGET_SMART_CLASS_INIT
*
* @ ingroup Widget
*/
# define ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name) \
ELM_WIDGET_SMART_CLASS_INIT ( EVAS_SMART_CLASS_INIT_NAME_VERSION ( name ) )
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 */
Eina_Bool ( * focus_next ) ( const Evas_Object * obj ,
Elm_Focus_Direction dir ,
Evas_Object * * next ) ; /**< 'Virtual' function handling passing focus to sub-objects */
Eina_Bool ( * focus_direction ) ( const Evas_Object * obj ,
const Evas_Object * base ,
double degree ,
Evas_Object * * target ,
double * weight ) ; /**< 'Virtual' function handling passing focus to sub-objects <b>given a direction, in degrees</b> */
Eina_Bool ( * sub_object_add ) ( Evas_Object * obj ,
Evas_Object * sobj ) ; /**< 'Virtual' function handling sub objects being added */
Eina_Bool ( * sub_object_del ) ( Evas_Object * obj ,
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 */
[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
{
const Elm_Widget_Smart_Class * api ; /**< This is the pointer to the object's class, from where we can reach/call its class functions */
Evas_Object * obj ;
Evas_Object * parent_obj ;
Evas_Object * parent2 ;
Evas_Coord x , y , w , h ;
Eina_List * subobjs ;
Evas_Object * resize_obj ;
Evas_Object * hover_obj ;
Eina_List * tooltips , * cursors ;
Evas_Coord rx , ry , rw , rh ;
int scroll_hold ;
int scroll_freeze ;
double scale ;
Elm_Theme * theme ;
const char * style ;
const char * access_info ;
unsigned int focus_order ;
Eina_Bool focus_order_on_calc ;
int child_drag_x_locked ;
int child_drag_y_locked ;
Eina_List * translate_strings ;
Eina_List * focus_chain ;
Eina_List * event_cb ;
2012-07-04 14:36:50 -07:00
/* this block is subject to later analysis: to be changed by
* something different */
[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 ;
void ( * on_show_region ) ( void * data ,
Evas_Object * obj ) ;
2012-07-04 14:36:50 -07:00
void ( * focus_region ) ( Evas_Object * obj ,
Evas_Coord x ,
Evas_Coord y ,
Evas_Coord w ,
Evas_Coord h ) ;
2012-07-25 15:03:15 -07:00
void ( * on_focus_region ) ( const Evas_Object * obj ,
Evas_Coord * x ,
Evas_Coord * y ,
Evas_Coord * w ,
Evas_Coord * 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
2012-07-30 00:14:33 -07:00
int frozen ;
[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 drag_x_locked : 1 ;
Eina_Bool drag_y_locked : 1 ;
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 ;
Eina_Bool highlight_ignore : 1 ;
Eina_Bool highlight_in_theme : 1 ;
Eina_Bool disabled : 1 ;
Eina_Bool is_mirrored : 1 ;
Eina_Bool mirrored_auto_mode : 1 ; /* This is
* TRUE by
* default */
Eina_Bool still_in : 1 ;
2012-07-05 21:03:21 -07:00
Eina_Bool can_access : 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
} Elm_Widget_Smart_Data ;
/**
* @ }
*/
2011-12-29 23:20:48 -08:00
typedef struct _Elm_Tooltip Elm_Tooltip ;
typedef struct _Elm_Cursor Elm_Cursor ;
2010-09-13 00:56:23 -07:00
2012-01-09 16:33:51 -08:00
/**< base structure for all widget items that are not Elm_Widget themselves */
typedef struct _Elm_Widget_Item Elm_Widget_Item ;
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 ;
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 ) ;
2012-01-09 17:00:23 -08:00
typedef void ( * Elm_Widget_Disable_Cb ) ( void * data ) ;
2012-01-27 03:56:14 -08:00
typedef Eina_Bool ( * Elm_Widget_Del_Pre_Cb ) ( void * data ) ;
2011-11-16 17:58:03 -08:00
2011-12-29 23:20:48 -08:00
# define ELM_ACCESS_TYPE 0 // when reading out widget or item this is read first
# define ELM_ACCESS_INFO 1 // next read is info - this is normally label
# define ELM_ACCESS_STATE 2 // if there is a state (eg checkbox) then read state out
# define ELM_ACCESS_CONTENT 3 // read ful content - eg all of the label, not a shortened version
2011-08-19 04:07:42 -07:00
2011-12-29 23:20:48 -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
2011-08-23 00:44:49 -07:00
typedef char * ( * Elm_Access_Content_Cb ) ( void * data , Evas_Object * obj , Elm_Widget_Item * item ) ;
2012-06-29 23:21:14 -07:00
typedef void ( * Elm_Access_On_Highlight_Cb ) ( void * data ) ;
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 ;
2011-08-19 04:07:42 -07:00
Elm_Access_Content_Cb func ;
} ;
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 ;
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 ) ;
EAPI void _elm_access_callback_set ( Elm_Access_Info * ac , int type , Elm_Access_Content_Cb func , const void * data ) ;
2012-02-20 04:13:08 -08:00
EAPI char * _elm_access_text_get ( const Elm_Access_Info * ac , int type , Evas_Object * obj , Elm_Widget_Item * item ) ; /* this is ok it actually returns a strduped string - it's meant to! */
2011-08-19 04:07:42 -07:00
EAPI void _elm_access_read ( Elm_Access_Info * ac , int type , Evas_Object * obj , Elm_Widget_Item * item ) ;
2011-08-19 04:47:30 -07:00
EAPI void _elm_access_say ( const char * txt ) ;
2012-02-20 04:13:08 -08:00
EAPI Elm_Access_Info * _elm_access_object_get ( const Evas_Object * obj ) ;
EAPI Elm_Access_Info * _elm_access_item_get ( const Elm_Widget_Item * it ) ;
2011-08-23 00:44:49 -07:00
EAPI void _elm_access_object_hilight ( Evas_Object * obj ) ;
EAPI void _elm_access_object_unhilight ( Evas_Object * obj ) ;
2011-08-23 01:46:01 -07:00
EAPI void _elm_access_object_hilight_disable ( Evas * e ) ;
2011-08-19 04:07:42 -07:00
EAPI void _elm_access_object_register ( Evas_Object * obj , Evas_Object * hoverobj ) ;
2012-03-29 02:54:21 -07:00
EAPI void _elm_access_item_unregister ( Elm_Widget_Item * item ) ;
2011-08-23 23:29:13 -07:00
EAPI void _elm_access_item_register ( Elm_Widget_Item * item , 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-06-29 23:21:14 -07:00
EAPI void _elm_access_widget_item_register ( Elm_Widget_Item * item ) ;
2012-08-18 06:52:03 -07:00
EAPI void _elm_access_widget_item_unregister ( Elm_Widget_Item * 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 ) ;
2011-08-10 16:43:50 -07:00
2012-01-09 16:02:58 -08:00
/**< put this as the first member in your widget item struct */
# define ELM_WIDGET_ITEM Elm_Widget_Item base
2010-09-13 00:56:23 -07:00
struct _Elm_Widget_Item
{
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 */
2011-12-29 23:20:48 -08:00
# define VIEW(X) X->base.view
2011-10-20 18:08:01 -07:00
# define WIDGET(X) X->base.widget
2012-01-09 16:02:58 -08:00
/**< the owner widget that owns this item */
Evas_Object * widget ;
/**< 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
/**< item specific data. used for del callback */
2012-01-09 16:02:58 -08:00
const void * data ;
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
Elm_Widget_Content_Set_Cb content_set_func ;
Elm_Widget_Content_Get_Cb content_get_func ;
Elm_Widget_Content_Unset_Cb content_unset_func ;
Elm_Widget_Text_Set_Cb text_set_func ;
Elm_Widget_Text_Get_Cb text_get_func ;
Elm_Widget_Signal_Emit_Cb signal_emit_func ;
2012-01-09 17:00:23 -08:00
Elm_Widget_Disable_Cb disable_func ;
2012-06-29 23:21:14 -07:00
Evas_Object * access_obj ;
2011-12-29 23:20:48 -08:00
Elm_Access_Info * access ;
const char * access_info ;
2012-02-23 20:31:03 -08:00
2011-12-29 23:20:48 -08:00
Eina_Bool disabled : 1 ;
2010-09-13 00:56:23 -07:00
} ;
2011-08-04 01:52:49 -07:00
struct _Elm_Object_Item
{
2011-10-20 17:45:19 -07:00
ELM_WIDGET_ITEM ;
2011-08-04 01:52:49 -07:00
} ;
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 * ) ;
EAPI void elm_widget_parent_set ( Evas_Object * , Evas_Object * ) ;
2010-09-13 00:56:23 -07:00
EAPI Eina_Bool elm_widget_api_check ( int ver ) ;
2012-07-18 14:03:28 -07:00
EAPI Evas_Object * elm_widget_compat_add ( Evas * evas ) ;
2011-12-29 23:20:48 -08:00
EAPI void elm_widget_del_hook_set ( Evas_Object * obj , void ( * func ) ( Evas_Object * obj ) ) ;
EAPI void elm_widget_del_pre_hook_set ( Evas_Object * obj , void ( * func ) ( Evas_Object * obj ) ) ;
EAPI void elm_widget_focus_hook_set ( Evas_Object * obj , void ( * func ) ( Evas_Object * obj ) ) ;
EAPI void elm_widget_activate_hook_set ( Evas_Object * obj , void ( * func ) ( Evas_Object * obj ) ) ;
EAPI void elm_widget_disable_hook_set ( Evas_Object * obj , void ( * func ) ( Evas_Object * obj ) ) ;
EAPI void elm_widget_theme_hook_set ( Evas_Object * obj , void ( * func ) ( Evas_Object * obj ) ) ;
2012-07-03 05:09:34 -07:00
EAPI void elm_widget_access_hook_set ( Evas_Object * obj , void ( * func ) ( Evas_Object * obj , Eina_Bool is_access ) ) ;
2011-12-29 23:20:48 -08:00
EAPI void elm_widget_translate_hook_set ( Evas_Object * obj , void ( * func ) ( Evas_Object * obj ) ) ;
EAPI void elm_widget_event_hook_set ( Evas_Object * obj , Eina_Bool ( * func ) ( Evas_Object * obj , Evas_Object * source , Evas_Callback_Type type , void * event_info ) ) ;
EAPI void elm_widget_changed_hook_set ( Evas_Object * obj , void ( * func ) ( Evas_Object * obj ) ) ;
EAPI void elm_widget_signal_emit_hook_set ( Evas_Object * obj , void ( * func ) ( Evas_Object * obj , const char * emission , const char * source ) ) ;
EAPI void elm_widget_signal_callback_add_hook_set ( Evas_Object * obj , void ( * func ) ( Evas_Object * obj , const char * emission , const char * source , Edje_Signal_Cb func_cb , void * data ) ) ;
EAPI void elm_widget_signal_callback_del_hook_set ( Evas_Object * obj , void ( * func ) ( Evas_Object * obj , const char * emission , const char * source , Edje_Signal_Cb func_cb , void * data ) ) ;
2012-07-03 05:09:34 -07:00
EAPI Eina_Bool elm_widget_access ( Evas_Object * obj , Eina_Bool is_access ) ;
2012-03-06 10:39:53 -08:00
EAPI Eina_Bool 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 ) ;
2011-10-19 07:17:14 -07:00
EAPI void elm_widget_translate ( Evas_Object * obj ) ;
2011-12-29 23:20:48 -08:00
EAPI void elm_widget_focus_next_hook_set ( Evas_Object * obj , Eina_Bool ( * func ) ( const Evas_Object * obj , Elm_Focus_Direction dir , Evas_Object * * next ) ) ;
EAPI void elm_widget_on_focus_hook_set ( Evas_Object * obj , void ( * func ) ( void * data , Evas_Object * obj ) , void * data ) ;
EAPI void elm_widget_on_change_hook_set ( Evas_Object * obj , void ( * func ) ( void * data , Evas_Object * obj ) , void * data ) ;
EAPI void elm_widget_on_show_region_hook_set ( Evas_Object * obj , void ( * func ) ( void * data , Evas_Object * obj ) , void * data ) ;
EAPI void elm_widget_focus_region_hook_set ( Evas_Object * obj , void ( * func ) ( Evas_Object * obj , Evas_Coord x , Evas_Coord y , Evas_Coord w , Evas_Coord h ) ) ;
2012-05-02 20:02:54 -07:00
EAPI void elm_widget_focus_direction_hook_set ( Evas_Object * obj , Eina_Bool ( * func ) ( const Evas_Object * obj , const Evas_Object * base , double degree , Evas_Object * * direction , double * weight ) ) ;
2012-01-09 16:33:51 -08:00
EAPI void elm_widget_text_set_hook_set ( Evas_Object * obj , Elm_Widget_Text_Set_Cb func ) ;
# define elm_widget_text_set_hook_set(obj, func) elm_widget_text_set_hook_set(obj, (Elm_Widget_Text_Set_Cb)(func))
EAPI void elm_widget_text_get_hook_set ( Evas_Object * obj , Elm_Widget_Text_Get_Cb func ) ;
# define elm_widget_text_get_hook_set(obj, func) elm_widget_text_get_hook_set(obj, (Elm_Widget_Text_Get_Cb)(func))
EAPI void elm_widget_content_set_hook_set ( Evas_Object * obj , Elm_Widget_Content_Set_Cb func ) ;
# define elm_widget_content_set_hook_set(obj, func) elm_widget_content_set_hook_set(obj, (Elm_Widget_Content_Set_Cb)(func))
EAPI void elm_widget_content_get_hook_set ( Evas_Object * obj , Elm_Widget_Content_Get_Cb func ) ;
# define elm_widget_content_get_hook_set(obj, func) elm_widget_content_get_hook_set(obj, (Elm_Widget_Content_Get_Cb)(func))
EAPI void elm_widget_content_unset_hook_set ( Evas_Object * obj , Elm_Widget_Content_Unset_Cb func ) ;
# define elm_widget_content_unset_hook_set(obj, func) elm_widget_content_unset_hook_set(obj, (Elm_Widget_Content_Unset_Cb)(func))
2011-12-29 23:20:48 -08:00
EAPI void elm_widget_on_focus_region_hook_set ( Evas_Object * obj , void ( * func ) ( const Evas_Object * obj , Evas_Coord * x , Evas_Coord * y , Evas_Coord * w , Evas_Coord * h ) ) ;
2010-09-13 00:56:23 -07:00
EAPI void elm_widget_data_set ( Evas_Object * obj , void * data ) ;
EAPI void * elm_widget_data_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 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 ) ;
2010-09-13 00:56:23 -07:00
EAPI void elm_widget_resize_object_set ( Evas_Object * obj , Evas_Object * sobj ) ;
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 ) ;
2010-09-27 21:28:14 -07:00
EAPI Eina_Bool elm_widget_focus_get ( const Evas_Object * obj ) ;
2010-09-13 00:56:23 -07:00
EAPI Evas_Object * elm_widget_focused_object_get ( const Evas_Object * obj ) ;
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 ) ;
EAPI Eina_Bool elm_widget_event_propagate ( Evas_Object * obj , Evas_Callback_Type type , void * event_info , Evas_Event_Flags * event_flags ) ;
2010-10-06 13:24:22 -07:00
EAPI void elm_widget_focus_custom_chain_set ( Evas_Object * obj , Eina_List * objs ) ;
EAPI void elm_widget_focus_custom_chain_unset ( Evas_Object * obj ) ;
EAPI const Eina_List * elm_widget_focus_custom_chain_get ( const Evas_Object * obj ) ;
EAPI void elm_widget_focus_custom_chain_append ( Evas_Object * obj , Evas_Object * child , Evas_Object * relative_child ) ;
EAPI void elm_widget_focus_custom_chain_prepend ( Evas_Object * obj , Evas_Object * child , Evas_Object * relative_child ) ;
2010-10-06 13:24:16 -07:00
EAPI void elm_widget_focus_cycle ( Evas_Object * obj , Elm_Focus_Direction dir ) ;
2012-05-02 20:02:54 -07:00
EAPI Eina_Bool elm_widget_focus_direction_go ( Evas_Object * obj , double degree ) ;
EAPI Eina_Bool elm_widget_focus_direction_get ( const Evas_Object * obj , const Evas_Object * base , double degree , Evas_Object * * direction , double * weight ) ;
2010-10-06 13:24:19 -07:00
EAPI Eina_Bool elm_widget_focus_next_get ( const Evas_Object * obj , Elm_Focus_Direction dir , Evas_Object * * next ) ;
2012-05-02 20:02:54 -07:00
EAPI Eina_Bool elm_widget_focus_list_direction_get ( const Evas_Object * obj , const Evas_Object * base , const Eina_List * items , void * ( * list_data_get ) ( const Eina_List * list ) , double degree , Evas_Object * * direction , double * weight ) ;
2011-12-29 23:20:48 -08:00
EAPI Eina_Bool elm_widget_focus_list_next_get ( const Evas_Object * obj , const Eina_List * items , void * ( * list_data_get ) ( const Eina_List * list ) , Elm_Focus_Direction dir , Evas_Object * * next ) ;
2010-09-13 00:56:23 -07:00
EAPI void elm_widget_focus_set ( Evas_Object * obj , int first ) ;
EAPI void elm_widget_focused_object_clear ( Evas_Object * obj ) ;
EAPI Evas_Object * elm_widget_parent_get ( const Evas_Object * obj ) ;
2011-08-02 03:34:30 -07:00
EAPI Evas_Object * elm_widget_parent2_get ( const Evas_Object * obj ) ;
EAPI void elm_widget_parent2_set ( Evas_Object * obj , Evas_Object * parent ) ;
2010-09-13 00:56:23 -07:00
EAPI void elm_widget_focus_steal ( 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
*/
EAPI void elm_widget_focus_restore ( Evas_Object * obj ) ;
2010-09-13 00:56:23 -07:00
EAPI void elm_widget_activate ( Evas_Object * obj ) ;
EAPI void elm_widget_change ( Evas_Object * obj ) ;
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 ) ;
2011-07-08 00:50:36 -07:00
EAPI void elm_widget_show_region_set ( Evas_Object * obj , Evas_Coord x , Evas_Coord y , Evas_Coord w , Evas_Coord h , Eina_Bool forceshow ) ;
2010-09-13 00:56:23 -07:00
EAPI void elm_widget_show_region_get ( const Evas_Object * obj , Evas_Coord * x , Evas_Coord * y , Evas_Coord * w , Evas_Coord * h ) ;
2010-10-22 11:29:51 -07:00
EAPI void elm_widget_focus_region_get ( const Evas_Object * obj , Evas_Coord * x , Evas_Coord * y , Evas_Coord * w , Evas_Coord * h ) ;
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_scale_set ( Evas_Object * obj , double scale ) ;
EAPI double elm_widget_scale_get ( const Evas_Object * obj ) ;
2011-12-30 01:48:46 -08:00
EAPI Eina_Bool elm_widget_mirrored_get ( const Evas_Object * obj ) ;
EAPI void elm_widget_mirrored_set ( Evas_Object * obj , Eina_Bool mirrored ) ;
EAPI Eina_Bool elm_widget_mirrored_automatic_get ( const Evas_Object * obj ) ;
EAPI void elm_widget_mirrored_automatic_set ( Evas_Object * obj , Eina_Bool automatic ) ;
2010-09-13 00:56:23 -07:00
EAPI void elm_widget_theme_set ( Evas_Object * obj , Elm_Theme * th ) ;
EAPI Elm_Theme * elm_widget_theme_get ( const Evas_Object * obj ) ;
2012-03-06 10:39:53 -08:00
EAPI Eina_Bool 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 ) ;
2010-09-13 00:56:23 -07:00
EAPI void elm_widget_drag_lock_x_set ( Evas_Object * obj , Eina_Bool lock ) ;
EAPI void elm_widget_drag_lock_y_set ( Evas_Object * obj , Eina_Bool lock ) ;
EAPI Eina_Bool elm_widget_drag_lock_x_get ( const Evas_Object * obj ) ;
EAPI Eina_Bool elm_widget_drag_lock_y_get ( const Evas_Object * obj ) ;
EAPI int elm_widget_drag_child_locked_x_get ( const Evas_Object * obj ) ;
EAPI int elm_widget_drag_child_locked_y_get ( const Evas_Object * obj ) ;
2010-10-21 11:58:40 -07:00
EAPI Eina_Bool elm_widget_theme_object_set ( Evas_Object * obj , Evas_Object * edj , const char * wname , const char * welement , const char * wstyle ) ;
2010-09-13 00:56:23 -07:00
EAPI void elm_widget_type_register ( const char * * ptr ) ;
2011-08-04 10:10:17 -07:00
EAPI void elm_widget_type_unregister ( const char * * ptr ) ;
2011-08-28 07:12:38 -07:00
EAPI Eina_Bool elm_widget_is_check ( const Evas_Object * obj ) ;
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-04-14 05:47:16 -07:00
EAPI void elm_widget_focus_hide_handle ( Evas_Object * obj ) ;
2011-08-08 03:32:32 -07:00
EAPI void elm_widget_focus_mouse_up_handle ( Evas_Object * obj ) ;
2011-07-27 23:58:29 -07:00
EAPI void elm_widget_focus_tree_unfocusable_handle ( Evas_Object * obj ) ;
2011-07-12 01:22:16 -07:00
EAPI void elm_widget_focus_disabled_handle ( Evas_Object * obj ) ;
2012-02-21 02:54:46 -08:00
EAPI unsigned int elm_widget_focus_order_get ( const Evas_Object * obj ) ;
2011-08-03 05:27:57 -07:00
EAPI void elm_widget_text_part_set ( Evas_Object * obj , const char * part , const char * label ) ;
EAPI const char * elm_widget_text_part_get ( const Evas_Object * obj , const char * part ) ;
2011-10-19 07:17:14 -07:00
EAPI void elm_widget_domain_translatable_text_part_set ( Evas_Object * obj , const char * part , const char * domain , const char * text ) ;
EAPI const char * elm_widget_translatable_text_part_get ( const Evas_Object * obj , const char * part ) ;
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 ) ;
2010-09-13 00:56:23 -07:00
EAPI Elm_Widget_Item * _elm_widget_item_new ( Evas_Object * parent , size_t alloc_size ) ;
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
EAPI void _elm_widget_item_free ( Elm_Widget_Item * item ) ;
2012-07-01 18:38:21 -07:00
EAPI Evas_Object * _elm_widget_item_widget_get ( const Elm_Widget_Item * item ) ;
2010-09-13 00:56:23 -07:00
EAPI void _elm_widget_item_del ( Elm_Widget_Item * item ) ;
EAPI void _elm_widget_item_pre_notify_del ( Elm_Widget_Item * item ) ;
EAPI void _elm_widget_item_del_cb_set ( Elm_Widget_Item * item , Evas_Smart_Cb del_cb ) ;
EAPI void _elm_widget_item_data_set ( Elm_Widget_Item * item , const void * data ) ;
EAPI void * _elm_widget_item_data_get ( const Elm_Widget_Item * item ) ;
EAPI void _elm_widget_item_tooltip_text_set ( Elm_Widget_Item * item , const char * text ) ;
2011-10-19 07:17:14 -07:00
EAPI void _elm_widget_item_tooltip_translatable_text_set ( Elm_Widget_Item * item , const char * text ) ;
2010-09-13 00:56:23 -07:00
EAPI void _elm_widget_item_tooltip_content_cb_set ( Elm_Widget_Item * item , Elm_Tooltip_Item_Content_Cb func , const void * data , Evas_Smart_Cb del_cb ) ;
EAPI void _elm_widget_item_tooltip_unset ( Elm_Widget_Item * item ) ;
EAPI void _elm_widget_item_tooltip_style_set ( Elm_Widget_Item * item , const char * style ) ;
2011-12-05 09:14:07 -08:00
EAPI Eina_Bool _elm_widget_item_tooltip_window_mode_set ( Elm_Widget_Item * item , Eina_Bool disable ) ;
EAPI Eina_Bool _elm_widget_item_tooltip_window_mode_get ( const Elm_Widget_Item * item ) ;
2010-09-13 00:56:23 -07:00
EAPI const char * _elm_widget_item_tooltip_style_get ( const Elm_Widget_Item * item ) ;
2010-09-17 11:24:10 -07:00
EAPI void _elm_widget_item_cursor_set ( Elm_Widget_Item * item , const char * cursor ) ;
2010-11-04 17:46:54 -07:00
EAPI const char * _elm_widget_item_cursor_get ( const Elm_Widget_Item * item ) ;
2010-09-17 11:24:10 -07:00
EAPI void _elm_widget_item_cursor_unset ( Elm_Widget_Item * item ) ;
2010-09-25 15:01:19 -07:00
EAPI void _elm_widget_item_cursor_style_set ( Elm_Widget_Item * item , const char * style ) ;
EAPI const char * _elm_widget_item_cursor_style_get ( const Elm_Widget_Item * item ) ;
2010-09-25 15:03:37 -07:00
EAPI void _elm_widget_item_cursor_engine_only_set ( Elm_Widget_Item * item , Eina_Bool engine_only ) ;
EAPI Eina_Bool _elm_widget_item_cursor_engine_only_get ( const Elm_Widget_Item * item ) ;
2012-04-12 16:39:36 -07:00
EAPI void _elm_widget_item_part_content_set ( Elm_Widget_Item * item , const char * part , Evas_Object * content ) ;
EAPI Evas_Object * _elm_widget_item_part_content_get ( const Elm_Widget_Item * item , const char * part ) ;
EAPI Evas_Object * _elm_widget_item_part_content_unset ( Elm_Widget_Item * item , const char * part ) ;
EAPI void _elm_widget_item_part_text_set ( Elm_Widget_Item * item , const char * part , const char * label ) ;
EAPI const char * _elm_widget_item_part_text_get ( const Elm_Widget_Item * item , const char * part ) ;
2011-09-18 21:59:43 -07:00
EAPI void _elm_widget_item_signal_emit ( Elm_Widget_Item * item , const char * emission , const char * source ) ;
2012-01-09 16:33:51 -08:00
EAPI void _elm_widget_item_content_set_hook_set ( Elm_Widget_Item * item , Elm_Widget_Content_Set_Cb func ) ;
EAPI void _elm_widget_item_content_get_hook_set ( Elm_Widget_Item * item , Elm_Widget_Content_Get_Cb func ) ;
EAPI void _elm_widget_item_content_unset_hook_set ( Elm_Widget_Item * item , Elm_Widget_Content_Unset_Cb func ) ;
EAPI void _elm_widget_item_text_set_hook_set ( Elm_Widget_Item * item , Elm_Widget_Text_Set_Cb func ) ;
EAPI void _elm_widget_item_text_get_hook_set ( Elm_Widget_Item * item , Elm_Widget_Text_Get_Cb func ) ;
EAPI void _elm_widget_item_signal_emit_hook_set ( Elm_Widget_Item * it , Elm_Widget_Signal_Emit_Cb func ) ;
2011-08-23 23:39:29 -07:00
EAPI void _elm_widget_item_access_info_set ( Elm_Widget_Item * item , const char * txt ) ;
2011-11-16 17:58:03 -08:00
EAPI void _elm_widget_item_disabled_set ( Elm_Widget_Item * item , Eina_Bool disabled ) ;
EAPI Eina_Bool _elm_widget_item_disabled_get ( const Elm_Widget_Item * item ) ;
2012-01-09 17:00:23 -08:00
EAPI void _elm_widget_item_disable_hook_set ( Elm_Widget_Item * item , Elm_Widget_Disable_Cb func ) ;
EAPI void _elm_widget_item_del_pre_hook_set ( Elm_Widget_Item * item , Elm_Widget_Del_Pre_Cb func ) ;
2011-08-03 02:34:00 -07:00
2012-08-30 09:45:34 -07:00
/**
* Function to operate on a given widget ' s scrollabe children when necessary .
* @ warning free the returned list with eina_list_free ( ) .
*/
EAPI Eina_List * elm_widget_scrollable_children_get ( Evas_Object * obj ) ;
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 ) ;
2010-09-28 12:35:12 -07:00
2010-09-13 00:56:23 -07:00
/**
* Convenience macro to create new widget item , doing casts for you .
* @ see _elm_widget_item_new ( )
* @ param parent a valid elm_widget variant .
* @ param type the C type that extends Elm_Widget_Item
*/
# define elm_widget_item_new(parent, type) \
( type * ) _elm_widget_item_new ( ( parent ) , sizeof ( type ) )
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
/**
* Convenience macro to free widget item , doing casts for you .
* @ see _elm_widget_item_free ( )
* @ param item a valid item .
*/
# define elm_widget_item_free(item) \
_elm_widget_item_free ( ( Elm_Widget_Item * ) item )
2010-09-13 00:56:23 -07:00
/**
* Convenience macro to delete widget item , doing casts for you .
* @ see _elm_widget_item_del ( )
* @ param item a valid item .
*/
# define elm_widget_item_del(item) \
_elm_widget_item_del ( ( Elm_Widget_Item * ) item )
/**
* Convenience macro to notify deletion of widget item , doing casts for you .
* @ see _elm_widget_item_pre_notify_del ( )
*/
# define elm_widget_item_pre_notify_del(item) \
_elm_widget_item_pre_notify_del ( ( Elm_Widget_Item * ) item )
/**
* Convenience macro to set deletion callback of widget item , doing casts for you .
* @ see _elm_widget_item_del_cb_set ( )
*/
# define elm_widget_item_del_cb_set(item, del_cb) \
_elm_widget_item_del_cb_set ( ( Elm_Widget_Item * ) item , del_cb )
2012-07-01 18:38:21 -07:00
/**
* Get item ' s owner widget
* @ see _elm_widget_item_widget_get ( )
*/
# define elm_widget_item_widget_get(item) \
_elm_widget_item_widget_get ( ( const Elm_Widget_Item * ) item )
2010-09-13 00:56:23 -07:00
/**
* Set item ' s data
* @ see _elm_widget_item_data_set ( )
*/
# define elm_widget_item_data_set(item, data) \
_elm_widget_item_data_set ( ( Elm_Widget_Item * ) item , data )
/**
* Get item ' s data
* @ see _elm_widget_item_data_get ( )
*/
# define elm_widget_item_data_get(item) \
_elm_widget_item_data_get ( ( const Elm_Widget_Item * ) item )
/**
* Convenience function to set widget item tooltip as a text string .
* @ see _elm_widget_item_tooltip_text_set ( )
*/
# define elm_widget_item_tooltip_text_set(item, text) \
_elm_widget_item_tooltip_text_set ( ( Elm_Widget_Item * ) item , text )
2011-10-19 07:17:14 -07:00
/**
* Convenience function to set widget item tooltip as a text string .
* @ see _elm_widget_item_tooltip_text_set ( )
*/
# define elm_widget_item_tooltip_translatable_text_set(item, text) \
_elm_widget_item_tooltip_translatable_text_set ( ( Elm_Widget_Item * ) item , text )
2010-09-13 00:56:23 -07:00
/**
* Convenience function to set widget item tooltip .
* @ see _elm_widget_item_tooltip_content_cb_set ( )
*/
# define elm_widget_item_tooltip_content_cb_set(item, func, data, del_cb) \
2011-12-29 23:20:48 -08:00
_elm_widget_item_tooltip_content_cb_set ( ( Elm_Widget_Item * ) item , \
2010-09-13 00:56:23 -07:00
func , data , del_cb )
/**
* Convenience function to unset widget item tooltip .
* @ see _elm_widget_item_tooltip_unset ( )
*/
# define elm_widget_item_tooltip_unset(item) \
_elm_widget_item_tooltip_unset ( ( Elm_Widget_Item * ) item )
/**
* Convenience function to change item ' s tooltip style .
* @ see _elm_widget_item_tooltip_style_set ( )
*/
# define elm_widget_item_tooltip_style_set(item, style) \
_elm_widget_item_tooltip_style_set ( ( Elm_Widget_Item * ) item , style )
2011-07-26 02:38:23 -07:00
2011-12-05 09:14:07 -08:00
# define elm_widget_item_tooltip_window_mode_set(item, disable) \
_elm_widget_item_tooltip_window_mode_set ( ( Elm_Widget_Item * ) item , disable )
2011-07-26 02:38:23 -07:00
2011-12-05 09:14:07 -08:00
# define elm_widget_item_tooltip_window_mode_get(item) \
_elm_widget_item_tooltip_window_mode_get ( ( Elm_Widget_Item * ) item )
2010-09-13 00:56:23 -07:00
/**
* Convenience function to query item ' s tooltip style .
* @ see _elm_widget_item_tooltip_style_get ( )
*/
# define elm_widget_item_tooltip_style_get(item) \
_elm_widget_item_tooltip_style_get ( ( const Elm_Widget_Item * ) item )
2010-09-17 11:24:10 -07:00
/**
* Convenience function to set widget item cursor .
* @ see _elm_widget_item_cursor_set ( )
*/
# define elm_widget_item_cursor_set(item, cursor) \
_elm_widget_item_cursor_set ( ( Elm_Widget_Item * ) item , cursor )
2010-11-04 17:46:54 -07:00
/**
* Convenience function to get widget item cursor .
* @ see _elm_widget_item_cursor_get ( )
*/
# define elm_widget_item_cursor_get(item) \
_elm_widget_item_cursor_get ( ( const Elm_Widget_Item * ) item )
2010-09-17 11:24:10 -07:00
/**
* Convenience function to unset widget item cursor .
* @ see _elm_widget_item_cursor_unset ( )
*/
# define elm_widget_item_cursor_unset(item) \
_elm_widget_item_cursor_unset ( ( Elm_Widget_Item * ) item )
2010-09-25 15:01:19 -07:00
/**
* Convenience function to change item ' s cursor style .
* @ see _elm_widget_item_cursor_style_set ( )
*/
# define elm_widget_item_cursor_style_set(item, style) \
_elm_widget_item_cursor_style_set ( ( Elm_Widget_Item * ) item , style )
/**
* Convenience function to query item ' s cursor style .
* @ see _elm_widget_item_cursor_style_get ( )
*/
# define elm_widget_item_cursor_style_get(item) \
_elm_widget_item_cursor_style_get ( ( const Elm_Widget_Item * ) item )
2010-09-25 15:03:37 -07:00
/**
* Convenience function to change item ' s cursor engine_only .
* @ see _elm_widget_item_cursor_engine_only_set ( )
*/
# define elm_widget_item_cursor_engine_only_set(item, engine_only) \
_elm_widget_item_cursor_engine_only_set ( ( Elm_Widget_Item * ) item , engine_only )
/**
* Convenience function to query item ' s cursor engine_only .
* @ see _elm_widget_item_cursor_engine_only_get ( )
*/
# define elm_widget_item_cursor_engine_only_get(item) \
_elm_widget_item_cursor_engine_only_get ( ( const Elm_Widget_Item * ) item )
2011-08-04 08:15:40 -07:00
/**
* Convenience function to query item ' s content set hook .
* @ see _elm_widget_item_content_set_hook_set ( )
*/
# define elm_widget_item_content_set_hook_set(item, func) \
2012-01-09 16:33:51 -08:00
_elm_widget_item_content_set_hook_set ( ( Elm_Widget_Item * ) item , ( Elm_Widget_Content_Set_Cb ) func )
2011-08-04 08:15:40 -07:00
/**
* Convenience function to query item ' s content get hook .
* @ see _elm_widget_item_content_get_hook_set ( )
*/
# define elm_widget_item_content_get_hook_set(item, func) \
2012-01-09 16:33:51 -08:00
_elm_widget_item_content_get_hook_set ( ( Elm_Widget_Item * ) item , ( Elm_Widget_Content_Get_Cb ) func )
2011-08-04 08:15:40 -07:00
/**
* Convenience function to query item ' s content unset hook .
* @ see _elm_widget_item_content_unset_hook_set ( )
*/
# define elm_widget_item_content_unset_hook_set(item, func) \
2012-01-09 16:33:51 -08:00
_elm_widget_item_content_unset_hook_set ( ( Elm_Widget_Item * ) item , ( Elm_Widget_Content_Unset_Cb ) func )
2011-08-04 08:15:40 -07:00
/**
* Convenience function to query item ' s text set hook .
* @ see _elm_widget_item_text_set_hook_set ( )
*/
# define elm_widget_item_text_set_hook_set(item, func) \
2012-01-09 16:33:51 -08:00
_elm_widget_item_text_set_hook_set ( ( Elm_Widget_Item * ) item , ( Elm_Widget_Text_Set_Cb ) func )
2011-08-04 08:15:40 -07:00
/**
* Convenience function to query item ' s text get hook .
* @ see _elm_widget_item_text_get_hook_set ( )
*/
# define elm_widget_item_text_get_hook_set(item, func) \
2012-01-09 16:33:51 -08:00
_elm_widget_item_text_get_hook_set ( ( Elm_Widget_Item * ) item , ( Elm_Widget_Text_Get_Cb ) func )
2011-09-15 19:10:07 -07:00
/**
* Convenience function to query item ' s signal emit hook .
* @ see _elm_widget_item_signal_emit_hook_set ( )
*/
# define elm_widget_item_signal_emit_hook_set(item, func) \
2012-01-09 16:33:51 -08:00
_elm_widget_item_signal_emit_hook_set ( ( Elm_Widget_Item * ) item , ( Elm_Widget_Signal_Emit_Cb ) func )
2011-11-16 17:58:03 -08:00
/**
* Convenience function to query disable get hook .
* @ see _elm_widget_item_disabled_get ( )
*/
# define elm_widget_item_disabled_get(item) \
_elm_widget_item_disabled_get ( ( Elm_Widget_Item * ) item )
/**
* Convenience function to query disable set hook .
2012-01-09 17:00:23 -08:00
* @ see _elm_widget_item_disable_hook_set ( )
2011-11-16 17:58:03 -08:00
*/
2012-01-09 17:00:23 -08:00
# define elm_widget_item_disable_hook_set(item, func) \
_elm_widget_item_disable_hook_set ( ( Elm_Widget_Item * ) item , ( Elm_Widget_Disable_Cb ) func )
2012-01-09 16:02:58 -08:00
/**
* Convenience function to query del pre hook .
* @ see _elm_widget_item_del_pre_hook_set ( )
*/
# define elm_widget_item_del_pre_hook_set(item, func) \
2012-01-09 17:00:23 -08:00
_elm_widget_item_del_pre_hook_set ( ( Elm_Widget_Item * ) item , ( Elm_Widget_Del_Pre_Cb ) func )
2011-12-29 23:20:48 -08:00
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 ) { \
CRITICAL ( " Elm_Widget_Item " # item " is NULL " ) ; \
return __VA_ARGS__ ; \
} \
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 ) { \
CRITICAL ( " Elm_Widget_Item " # item " is NULL " ) ; \
goto label ; \
} \
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
# define ELM_SET_WIDTYPE(widtype, type) \
do { \
if ( ! widtype ) { \
widtype = eina_stringshare_add ( type ) ; \
elm_widget_type_register ( & widtype ) ; \
} \
} while ( 0 )
2010-09-13 00:56:23 -07:00
2011-08-28 07:12:38 -07:00
# define ELM_CHECK_WID_IS(obj) \
2011-12-29 23:20:48 -08:00
if ( ! elm_widget_is_check ( obj ) ) return
2011-08-28 07:12:38 -07:00
2010-09-13 00:56:23 -07:00
# define ELM_CHECK_WIDTYPE(obj, widtype) \
2011-12-29 23:20:48 -08:00
if ( ! obj | | ! elm_widget_type_check ( ( obj ) , ( widtype ) , __func__ ) ) return
2010-09-13 00:56:23 -07:00
2011-12-29 23:20:48 -08:00
# define ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, ...) \
ELM_WIDGET_ITEM_CHECK_OR_RETURN ( ( Elm_Widget_Item * ) it , __VA_ARGS__ ) ; \
ELM_CHECK_WIDTYPE ( it - > base . widget , widtype ) __VA_ARGS__ ;
2010-11-02 04:26:44 -07:00
2011-12-29 23:20:48 -08:00
# define ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_GOTO(it, label) \
ELM_WIDGET_ITEM_CHECK_OR_GOTO ( ( Elm_Widget_Item * ) it , label ) ; \
if ( ! elm_widget_type_check ( ( it - > base . widget ) , ( widtype ) , __func__ ) ) goto label ;
2010-11-02 04:26:44 -07:00
2011-12-29 23:20:48 -08:00
# define ELM_WIDGET_STANDARD_SETUP(wdat, wdtype, par, evas, ob, ret) \
do { \
EINA_SAFETY_ON_NULL_RETURN_VAL ( ( par ) , ( ret ) ) ; \
evas = evas_object_evas_get ( par ) ; if ( ! ( evas ) ) return ( ret ) ; \
wdat = ELM_NEW ( wdtype ) ; if ( ! ( wdat ) ) return ( ret ) ; \
2012-07-18 14:03:28 -07:00
ob = elm_widget_compat_add ( evas ) ; if ( ! ( ob ) ) { free ( wdat ) ; return ( ret ) ; } \
2011-12-29 23:20:48 -08:00
} while ( 0 )
2010-09-16 22:39:04 -07:00
2012-01-31 19:07:53 -08:00
# define ELM_OBJ_ITEM_CHECK_OR_RETURN(it, ...) \
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN ( it , __VA_ARGS__ ) ;
# define ELM_OBJ_ITEM_CHECK_OR_GOTO(it, label) \
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_GOTO ( it , label ) ;
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
2010-09-16 22:39:04 -07:00
/**
* The drag and drop API .
* Currently experimental , and will change when it does dynamic type
* addition RSN .
*
* Here so applications can start to use it , if they ask elm nicely .
*
* And yes , elm_widget , should probably be elm_experimental . . .
* Complaints about this code should go to / dev / null , or failing that nash .
*/
2012-08-22 01:33:43 -07:00
EAPI Eina_Bool elm_drop_target_add ( Evas_Object * widget , Elm_Sel_Type , Elm_Drop_Cb , void * ) ;
2012-06-19 13:17:46 -07:00
EAPI Eina_Bool elm_drop_target_del ( Evas_Object * widget ) ;
2012-08-22 01:33:43 -07:00
EAPI Eina_Bool elm_drag_start ( Evas_Object * obj , Elm_Sel_Format format , const char * data , void ( * dragdone ) ( void * data , Evas_Object * ) , void * donecbdata ) ;
EAPI Eina_Bool elm_selection_selection_has_owner ( Evas_Object * obj ) ;
2010-09-16 22:39:04 -07:00
2010-09-13 00:56:23 -07:00
# endif