4 /* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR
5 * CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT
6 * FINAL. CALL elm_widget_api_check(ELM_INTERNAL_API_VERSION) TO CHECK
9 * How to make your own widget? like this (where wname is your widget
10 * name (space) and wparentname is you widget's parent widget name
11 * (the base widget class if its a 'root' one).
13 * #include <Elementary.h>
14 * #include "elm_priv.h"
16 * static const char ELM_WNAME_SMART_NAME[] = "elm_wname";
18 * #define ELM_WNAME_DATA_GET(o, sd) \
19 * Elm_WName_Smart_Data * sd = evas_object_smart_data_get(o)
21 * #define ELM_WNAME_CHECK(obj) \
22 * if (!obj || !elm_widget_type_check((obj), ELM_WNAME_SMART_NAME, \
26 * typedef struct _Elm_WName_Smart_Class
28 * Elm_WParentName_Smart_Class base;
29 * } Elm_WName_Smart_Class;
31 * typedef struct _Elm_WName_Smart_Data Elm_WName_Smart_Data;
32 * struct _Elm_WName_Smart_Data
34 * Elm_WParentName_Smart_Data base;
35 * Evas_Object *sub; // or any private data needed for an instance
36 * // add any other instance data here too
39 * static const char SIG_CLICKED[] = "clicked";
40 * static const Evas_Smart_Cb_Description _smart_callbacks[] = {
45 * EVAS_SMART_SUBCLASS_NEW
46 * (ELM_WNAME_SMART_NAME, _elm_wname, Elm_WName_Smart_Class,
47 * Elm_WParentName_Smart_Class, elm_wparentname_smart_class_get,
51 * _elm_wname_smart_on_focus(Evas_Object *obj)
53 * ELM_WNAME_DATA_GET(obj, sd);
55 * // handle focus going in and out - optional, but if you want to,
56 * // define this virtual function to handle it (e.g. to emit a
57 * // signal to an edje object)
59 * if (elm_widget_focus_get(obj))
61 * edje_object_signal_emit(sd->sub, "elm,action,focus", "elm");
62 * evas_object_focus_set(sd->sub, EINA_TRUE);
66 * edje_object_signal_emit(sd->sub, "elm,action,unfocus", "elm");
67 * evas_object_focus_set(sd->sub, EINA_FALSE);
74 * _elm_wname_smart_theme(Evas_Object *obj)
76 * ELM_WNAME_DATA_GET(obj, sd);
78 * if (!ELM_WIDGET_CLASS(_elm_wname_parent_sc)->theme(obj))
81 * // handle changes in theme/scale etc here. always call the
82 * // parent class's version, as even the base class implements it.
84 * elm_widget_theme_object_set(obj, sd->sub, "wname", "base",
85 * elm_widget_style_get(obj));
91 * _elm_widget_smart_disable(Evas_Object *obj)
93 * ELM_WNAME_DATA_GET(obj, sd);
95 * // optional, but handle if the widget gets disabled or not
96 * if (elm_widget_disabled_get(obj))
97 * edje_object_signal_emit(sd->sub, "elm,state,disabled", "elm");
99 * edje_object_signal_emit(sd->sub, "elm,state,enabled", "elm");
105 * _elm_wname_smart_add(Evas_Object *obj)
107 * EVAS_SMART_DATA_ALLOC(obj, Elm_WName_Smart_Data);
109 * ELM_WIDGET_CLASS(_elm_wname_parent_sc)->base.add(obj);
111 * priv->sub = edje_object_add(evas_object_evas_get(obj));
112 * // just an example having an Edje object here. if it's really the case
113 * // you have a sub edje object as a resize object, consider inheriting
114 * // from @ref elm-layout-class.
115 * elm_widget_can_focus_set(obj, EINA_TRUE);
117 * // for this widget we will add 1 sub object that is an edje object
118 * priv->sub = edje_object_add(e);
119 * // set the theme. this follows a scheme for group name like this:
120 * // "elm/WIDGETNAME/ELEMENT/STYLE"
121 * // so here it will be:
122 * // "elm/wname/base/default"
123 * // changing style changes style name from default (all widgets start
124 * // with the default style) and element is for your widget internal
125 * // structure as you see fit
126 * elm_widget_theme_object_set
127 * (obj, priv->sub, "wname", "base", "default");
128 * // listen to a signal from the edje object to produce widget smart
129 * // callback (like click)
130 * edje_object_signal_callback_add
131 * (priv->sub, "elm,action,click", "", _clicked_signal_cb, obj);
132 * // set this sub object as the "resize object". widgets get 1 resize
133 * // object that is resized along with the object wrapper.
134 * elm_widget_resize_object_set(obj, priv->sub);
138 * _elm_wname_smart_del(Evas_Object *obj)
140 * ELM_WNAME_DATA_GET(obj, sd);
142 * // deleting 'virtual' function implementation - on deletion of
143 * // object delete object struct, etc.
145 * ELM_WIDGET_CLASS(_elm_wname_parent_sc)->base.del(obj);
149 * _elm_wname_smart_set_user(Elm_WName_Smart_Class *sc)
151 * ELM_WIDGET_CLASS(sc)->base.add = _elm_wname_smart_add;
152 * ELM_WIDGET_CLASS(sc)->base.del = _elm_wname_smart_del;
154 * ELM_WIDGET_CLASS(sc)->theme = _elm_wname_smart_theme;
155 * ELM_WIDGET_CLASS(sc)->disable = _elm_wname_smart_disable;
156 * ELM_WIDGET_CLASS(sc)->on_focus = _elm_wname_smart_on_focus;
159 * // actual API to create your widget. add more to manipulate it as
160 * // needed mark your calls with EAPI to make them "external api"
164 * elm_wname_add(Evas_Object *parent)
168 * EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
170 * obj = elm_widget_add(_elm_check_smart_class_new(), parent);
171 * if (!obj) return NULL;
173 * if (!elm_widget_sub_object_add(parent, obj))
174 * ERR("could not add %p as sub object of %p", obj, parent);
179 * // example - do "whatever" to the widget (here just emit a signal)
181 * elm_wname_whatever(Evas_Object *obj)
183 * // check if type is correct - check will return if it fails
184 * ELM_WNAME_CHECK(obj);
185 * // get widget data - type is correct and sane by this point, so this
186 * // should never fail
187 * ELM_WNAME_DATA_GET(obj, sd);
188 * // do whatever you like
189 * edje_object_signal_emit(sd->sub, "elm,state,action,whatever", "elm");
192 * // you can add more - you need to see elementary's code to know how
193 * // to handle all cases. remember this api is not stable and may
194 * change. it's internal
197 #ifndef ELM_INTERNAL_API_ARGESFSDFEFC
198 #warning "You are using an internal elementary API. This API is not stable"
199 #warning "and is subject to change. You use this at your own risk."
200 #warning "Remember to call elm_widget_api_check(ELM_INTERNAL_API_VERSION);"
201 #warning "in your widgets before you call any other elm_widget calls to do"
202 #warning "a correct runtime version check. Also remember - you don't NEED"
203 #warning "to make an Elementary widget is almost ALL cases. You can easily"
204 #warning "make a smart object with Evas's API and do everything you need"
205 #warning "there. You only need a widget if you want to seamlessly be part"
206 #warning "of the focus tree and want to transparently become a container"
207 #warning "for any number of child Elementary widgets"
208 //#error "ERROR. Compile aborted."
210 #define ELM_INTERNAL_API_VERSION 7000
213 * @defgroup Widget Widgets Extension Infrastructure
215 * This section is intended for people willing to create @b custom
216 * Elementary widgets or to contribute new (useful, unique) widgets
217 * upstream. If neither is your case, this text won't be of any use
220 * Elementary widgets are built in a @b hierarchical fashion. The idea
221 * is to factorize as much code as possible between widgets with
222 * behavioral similarities, as long as to facilitate the creation of
223 * @b custom, new widgets, may the user need them.
225 * It all starts with a base class, which aggregates behaviour
226 * @b every Elementary widget is supposed to have:
227 * #Elm_Widget_Smart_Class. Every Elementary widget will be of that
228 * type, be it directly or by means of @b inheriting from it.
230 * #Elm_Widget_Smart_Class happens to be an @c Evas_Smart_Class. If
231 * you check out Evas' documentation on it, you'll see it's how one is
232 * supposed to create custom Evas objects, what Elementary widgets
235 * Once one instantiates an Elementary widget, since it inherits from
236 * #Elm_Widget_Smart_Class, the system will raise a class instance of
237 * that type for you. But that happens only @b once: the first time
238 * you ask for an Elementary widget (of a given type). All subsequent
239 * ones will only point to the very same class instance. Since it's
240 * the class which points to the functions implementing the behavior
241 * of objects of that type, all of the live instances of Elementary
242 * widgets (of that type) will share the same blob of code loaded in
243 * memory to execute their routines.
245 * Now go and take a look at #Elm_Widget_Smart_Class's fields. Because
246 * it inherits from Evas' base smart class, we got a field of that
247 * type as the first member, so that Evas can handle Elementary
248 * objects internally as if they were 'normal' Evas objects. Evas has
249 * the Evas-only behavior function pointers in there, so it's all it
252 * Then, comes a version field, so that whenever we got to update or
253 * change the fields on our base smart class, there'll be a runtime
254 * check of the version expected by Elementary and the one provided by
255 * any code linking with it. A mismatch will show the developer of
256 * that code he/she needs to recompile and link its code to a newer
257 * version of Elementary.
259 * The next fields are the class functions themselves. We call them
260 * 'virtual' because, as in object-oriented languages, one is supposed
261 * here to override them on inheriting classes. On most of
262 * inheritances you'll probably want to call the parent's version of
263 * the class function too: you must analyse each case to tell.
265 * Take a look at #Elm_Widget_Smart_Data. That's private data bound to
266 * each Elementary object @b instance. It aggregates data needed for
267 * all widgets, since it's meant for the #Elm_Widget_Smart_Class-typed
270 * When inheriting from that base type, instance data for this new
271 * class has to have, as the first member, a field of type
272 * #Elm_Widget_Smart_Data. This has to be respected recursively -- if
273 * a third class is to be created inheriting from the one that is a
274 * direct 'child' of #Elm_Widget_Smart_Class, then the private data on
275 * this third class has to have, as its first field, a variable of the
276 * type of the private data of the second class (its parent), direct
277 * child of #Elm_Widget_Smart_Class.
279 * It is from the base private data, #Elm_Widget_Smart_Data, that we
280 * reach an object's class functions, by the given object
281 * instance. This is the reason of the first field of that struct: a
282 * pointer set to point to its class when the object is instantiated.
284 * The following figure illustrates the widget inheritance schema.
286 * @image html elm-widget-hierarchy.png
287 * @image rtf elm-widget-hierarchy.png
288 * @image latex elm-widget-hierarchy.eps
290 * @section elm-hierarchy-tree Elementary Widgets Hierarchy Tree
292 * The following figure illustrates the Elementary widget inheritance
295 * @image html elm-widget-tree.png
296 * @image rtf elm-widget-tree.png
297 * @image latex elm-widget-tree.eps
306 * @def ELM_WIDGET_CLASS
308 * Use this macro to cast whichever subclass of
309 * #Elm_Widget_Smart_Class into it, so to access its fields.
313 #define ELM_WIDGET_CLASS(x) ((Elm_Widget_Smart_Class *) x)
316 * @def ELM_WIDGET_DATA
318 * Use this macro to cast whichever subdata of
319 * #Elm_Widget_Smart_Data into it, so to access its fields.
323 #define ELM_WIDGET_DATA(x) ((Elm_Widget_Smart_Data *) x)
326 * @def ELM_WIDGET_SMART_CLASS_VERSION
328 * Current version for Elementary widget @b base smart class, a value
329 * which goes to _Elm_Widget_Smart_Class::version.
333 #define ELM_WIDGET_SMART_CLASS_VERSION 1
336 * @def ELM_WIDGET_SMART_CLASS_INIT
338 * Initializer for a whole #Elm_Widget_Smart_Class structure, with
339 * @c NULL values on its specific fields.
341 * @param smart_class_init initializer to use for the "base" field
342 * (#Evas_Smart_Class).
344 * @see EVAS_SMART_CLASS_INIT_NULL
345 * @see EVAS_SMART_CLASS_INIT_VERSION
346 * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
347 * @see ELM_WIDGET_SMART_CLASS_INIT_NULL
348 * @see ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION
352 #define ELM_WIDGET_SMART_CLASS_INIT(smart_class_init) \
353 {smart_class_init, ELM_WIDGET_SMART_CLASS_VERSION, NULL, NULL, NULL, NULL, \
354 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
357 * @def ELM_WIDGET_SMART_CLASS_INIT_NULL
359 * Initializer to zero out a whole #Elm_Widget_Smart_Class structure.
361 * @see ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION
362 * @see ELM_WIDGET_SMART_CLASS_INIT
366 #define ELM_WIDGET_SMART_CLASS_INIT_NULL \
367 ELM_WIDGET_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
370 * @def ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION
372 * Initializer to zero out a whole #Elm_Widget_Smart_Class structure and
373 * set its name and version.
375 * This is similar to #ELM_WIDGET_SMART_CLASS_INIT_NULL, but it will
376 * also set the version field of #Elm_Widget_Smart_Class (base field)
377 * to the latest #ELM_WIDGET_SMART_CLASS_VERSION and name it to the
380 * It will keep a reference to the name field as a <c>"const char *"</c>,
381 * i.e., the name must be available while the structure is
382 * used (hint: static or global variable!) and must not be modified.
384 * @see ELM_WIDGET_SMART_CLASS_INIT_NULL
385 * @see ELM_WIDGET_SMART_CLASS_INIT
389 #define ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name) \
390 ELM_WIDGET_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
392 /* Elm_Activate is used in 'Virtual' function Eina_Bool (*activate)
393 * (Evas_Object *obj, Elm_Activate act); of Elm_Widget_Smart_Class */
396 ELM_ACTIVATE_DEFAULT = 0,
403 /* Please, ALWAYS update the ELM_WIDGET_SMART_CLASS_INIT macro
404 * whenever you change the following struct! */
407 * Base widget smart class. It has the 'virtual' functions for all
408 * general, common actions on Elementary widgets.
410 typedef struct _Elm_Widget_Smart_Class
412 Evas_Smart_Class base; /**< Base smart class struct, needed for all smart objects */
413 int version; /**< Version of this smart class definition */
415 void (*parent_set)(Evas_Object *obj,
416 Evas_Object *parent); /**< 'Virtual' function handling parent widget attachment to new object */
417 Eina_Bool (*on_focus)(Evas_Object *obj); /**< 'Virtual' function handling focus in/out events on the widget */
418 Eina_Bool (*disable)(Evas_Object *obj); /**< 'Virtual' function on the widget being disabled */
419 Eina_Bool (*theme)(Evas_Object *obj); /**< 'Virtual' function on the widget being re-themed */
420 Eina_Bool (*translate)(Evas_Object *obj); /**< 'Virtual' function handling language changes on Elementary */
421 Eina_Bool (*event)(Evas_Object *obj,
423 Evas_Callback_Type type,
424 void *event_info); /**< 'Virtual' function handling input events on the widget */
425 Eina_Bool (*on_focus_region)(const Evas_Object *obj,
429 Evas_Coord *h); /**< 'Virtual' function returning an inner area of a widget that should be brought into the visible are 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. */
430 Eina_Bool (*focus_next)(const Evas_Object *obj,
431 Elm_Focus_Direction dir,
432 Evas_Object **next); /**< 'Virtual' function handling passing focus to sub-objects */
433 Eina_Bool (*focus_direction)(const Evas_Object *obj,
434 const Evas_Object *base,
436 Evas_Object **target,
437 double *weight); /**< 'Virtual' function handling passing focus to sub-objects <b>given a direction, in degrees</b> */
439 Eina_Bool (*sub_object_add)(Evas_Object *obj,
440 Evas_Object *sobj); /**< 'Virtual' function handling sub objects being added */
442 Eina_Bool (*sub_object_del)(Evas_Object *obj,
443 Evas_Object *sobj); /**< 'Virtual' function handling sub objects being removed */
444 void (*access)(Evas_Object *obj,
445 Eina_Bool is_access); /**< 'Virtual' function on the widget being set access */
446 Eina_Bool (*activate)(Evas_Object *obj,
447 Elm_Activate act); /**< 'Virtual' function to activate widget */
448 } Elm_Widget_Smart_Class;
451 * Base widget smart data. This is data bound to an Elementary object
452 * @b instance, so its particular to that specific object and not
453 * shared between all objects in its class. It is here, though, that
454 * we got a pointer to the object's class, the first field -- @c
457 typedef struct _Elm_Widget_Smart_Data
459 const Elm_Widget_Smart_Class *api; /**< This is the pointer to the object's class, from where we can reach/call its class functions */
462 Evas_Object *parent_obj;
463 Evas_Object *parent2;
464 Evas_Coord x, y, w, h;
466 Evas_Object *resize_obj;
467 Evas_Object *hover_obj;
468 Eina_List *tooltips, *cursors;
469 Evas_Object *focus_previous, *focus_next;
470 Evas_Object *focus_up, *focus_down, *focus_right, *focus_left;
472 /* "show region" coordinates. all widgets got those because this
473 * info may be set and queried recursively through the widget
475 Evas_Coord rx, ry, rw, rh;
477 /* scrolling hold/freeze hints. all widgets got those because this
478 * info may be set and queried recursively through the widget
486 const char *access_info;
487 unsigned int focus_order;
488 Eina_Bool focus_order_on_calc;
490 int child_drag_x_locked;
491 int child_drag_y_locked;
493 Eina_List *translate_strings;
494 Eina_List *focus_chain;
497 /* this is a hook to be set on-the-fly on widgets. this is code
498 * handling the request of showing a specific region from an inner
499 * widget (mainly issued by entries, on cursor moving) */
500 void *on_show_region_data;
501 void (*on_show_region)(void *data,
505 int orient_mode; /* -1 is disabled */
507 Eina_Bool drag_x_locked : 1;
508 Eina_Bool drag_y_locked : 1;
510 Eina_Bool can_focus : 1;
511 Eina_Bool child_can_focus : 1;
512 Eina_Bool focused : 1;
513 Eina_Bool top_win_focused : 1;
514 Eina_Bool tree_unfocusable : 1;
515 Eina_Bool highlight_ignore : 1;
516 Eina_Bool highlight_in_theme : 1;
517 Eina_Bool disabled : 1;
518 Eina_Bool is_mirrored : 1;
519 Eina_Bool mirrored_auto_mode : 1; /* This is
522 Eina_Bool still_in : 1;
523 Eina_Bool can_access : 1;
524 Eina_Bool highlighted : 1;
525 Eina_Bool highlight_root : 1;
526 } Elm_Widget_Smart_Data;
532 typedef struct _Elm_Tooltip Elm_Tooltip;
533 typedef struct _Elm_Cursor Elm_Cursor;
535 /**< base structure for all widget items that are not Elm_Widget themselves */
536 typedef struct _Elm_Widget_Item Elm_Widget_Item;
538 /**< accessibility information to be able to set and get from the access API */
539 typedef struct _Elm_Access_Info Elm_Access_Info;
541 /**< accessibility info item */
542 typedef struct _Elm_Access_Item Elm_Access_Item;
544 typedef void (*Elm_Widget_Text_Set_Cb)(void *data, const char *part, const char *text);
545 typedef void (*Elm_Widget_Content_Set_Cb)(void *data, const char *part, Evas_Object *content);
546 typedef const char *(*Elm_Widget_Text_Get_Cb)(const void *data, const char *part);
547 typedef Evas_Object *(*Elm_Widget_Content_Get_Cb)(const void *data, const char *part);
548 typedef Evas_Object *(*Elm_Widget_Content_Unset_Cb)(const void *data, const char *part);
549 typedef void (*Elm_Widget_Signal_Emit_Cb)(void *data, const char *emission, const char *source);
550 typedef void (*Elm_Widget_Disable_Cb)(void *data);
551 typedef Eina_Bool (*Elm_Widget_Del_Pre_Cb)(void *data);
553 #define ELM_ACCESS_DONE -1 /* sentence done - send done event here */
554 #define ELM_ACCESS_CANCEL -2 /* stop reading immediately */
556 typedef void (*Elm_Access_On_Highlight_Cb)(void *data);
558 struct _Elm_Access_Item
562 Elm_Access_Info_Cb func;
565 struct _Elm_Access_Info
567 Evas_Object *hoverobj;
569 Ecore_Timer *delay_timer;
570 void *on_highlight_data;
571 Elm_Access_On_Highlight_Cb on_highlight;
574 Elm_Access_Activate_Cb activate;
576 /* the owner widget item that owns this access info */
577 Elm_Widget_Item *widget_item;
579 /* the owner part object that owns this access info */
580 Evas_Object *part_object;
583 void _elm_access_shutdown();
584 void _elm_access_mouse_event_enabled_set(Eina_Bool enabled);
585 /* elm_widget_focus_list_next_get();, elm_widget_focus_next_get();
586 and elm_widget_focus_cycle(); use _elm_access_read_mode to use
588 void _elm_access_read_mode_set(Eina_Bool enabled);
589 Eina_Bool _elm_access_read_mode_get();
590 void _elm_access_widget_item_access_order_set(Elm_Widget_Item *item, Eina_List *objs);
591 const Eina_List *_elm_access_widget_item_access_order_get(const Elm_Widget_Item *item);
592 void _elm_access_widget_item_access_order_unset(Elm_Widget_Item *item);
594 EAPI void _elm_access_clear(Elm_Access_Info *ac);
595 EAPI void _elm_access_text_set(Elm_Access_Info *ac, int type, const char *text);
596 EAPI void _elm_access_callback_set(Elm_Access_Info *ac, int type, Elm_Access_Info_Cb func, const void *data);
597 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! */
598 EAPI void _elm_access_read(Elm_Access_Info *ac, int type, const Evas_Object *obj);
599 EAPI void _elm_access_say(const char *txt);
600 EAPI Elm_Access_Info *_elm_access_object_get(const Evas_Object *obj);
601 EAPI void _elm_access_object_hilight(Evas_Object *obj);
602 EAPI void _elm_access_object_unhilight(Evas_Object *obj);
603 EAPI void _elm_access_object_hilight_disable(Evas *e);
604 EAPI void _elm_access_object_register(Evas_Object *obj, Evas_Object *hoverobj);
605 EAPI void _elm_access_object_unregister(Evas_Object *obj, Evas_Object *hoverobj);
606 EAPI Eina_Bool _elm_access_2nd_click_timeout(Evas_Object *obj);
607 EAPI void _elm_access_highlight_set(Evas_Object* obj);
608 EAPI Evas_Object * _elm_access_edje_object_part_object_register(Evas_Object *obj, const Evas_Object *partobj, const char* part);
609 EAPI void _elm_access_edje_object_part_object_unregister(Evas_Object* obj, const Evas_Object *eobj, const char* part);
610 EAPI void _elm_access_widget_item_register(Elm_Widget_Item *item);
611 EAPI void _elm_access_widget_item_unregister(Elm_Widget_Item *item);
612 EAPI void _elm_access_on_highlight_hook_set(Elm_Access_Info *ac, Elm_Access_On_Highlight_Cb func, void *data);
613 EAPI void _elm_access_activate_callback_set(Elm_Access_Info *ac, Elm_Access_Activate_Cb func, void *data);
614 EAPI void _elm_access_highlight_object_activate(Evas_Object *obj, Elm_Activate act);
615 EAPI void _elm_access_highlight_cycle(Evas_Object *obj, Elm_Focus_Direction dir);
617 /**< put this as the first member in your widget item struct */
618 #define ELM_WIDGET_ITEM Elm_Widget_Item base
620 struct _Elm_Widget_Item
622 /* ef1 ~~ efl, el3 ~~ elm */
623 #define ELM_WIDGET_ITEM_MAGIC 0xef1e1301
625 /* simple accessor macros */
626 #define VIEW(X) X->base.view
627 #define WIDGET(X) X->base.widget
628 /**< the owner widget that owns this item */
630 /**< the base view object */
632 /**< item specific data. used for del callback */
634 /**< user delete callback function */
635 Evas_Smart_Cb del_func;
636 /**< widget delete callback function. don't expose this callback call */
637 Elm_Widget_Del_Pre_Cb del_pre_func;
639 Elm_Widget_Content_Set_Cb content_set_func;
640 Elm_Widget_Content_Get_Cb content_get_func;
641 Elm_Widget_Content_Unset_Cb content_unset_func;
642 Elm_Widget_Text_Set_Cb text_set_func;
643 Elm_Widget_Text_Get_Cb text_get_func;
644 Elm_Widget_Signal_Emit_Cb signal_emit_func;
645 Elm_Widget_Disable_Cb disable_func;
646 Evas_Object *access_obj;
647 const char *access_info;
648 Eina_List *access_order;
650 Eina_Bool disabled : 1;
651 Eina_Bool on_deletion : 1;
654 struct _Elm_Object_Item
659 #define ELM_NEW(t) calloc(1, sizeof(t))
661 EAPI Evas_Object *elm_widget_add(Evas_Smart *, Evas_Object *);
662 EAPI void elm_widget_parent_set(Evas_Object *, Evas_Object *);
663 EAPI Eina_Bool elm_widget_api_check(int ver);
664 EAPI Eina_Bool elm_widget_access(Evas_Object *obj, Eina_Bool is_access);
665 EAPI Eina_Bool elm_widget_theme(Evas_Object *obj);
666 EAPI void elm_widget_theme_specific(Evas_Object *obj, Elm_Theme *th, Eina_Bool force);
667 EAPI void elm_widget_translate(Evas_Object *obj);
668 EAPI void elm_widget_on_show_region_hook_set(Evas_Object *obj, void (*func)(void *data, Evas_Object *obj), void *data);
669 EAPI Eina_Bool elm_widget_sub_object_add(Evas_Object *obj, Evas_Object *sobj);
670 EAPI Eina_Bool elm_widget_sub_object_del(Evas_Object *obj, Evas_Object *sobj);
672 //SHKWAK : This is temp for Indicator Issue
673 //THIS MUST BE REMOVED
675 EAPI const Eina_List *elm_widget_sub_object_list_get(const Evas_Object *obj);
679 EAPI void elm_widget_resize_object_set(Evas_Object *obj, Evas_Object *sobj);
680 EAPI void elm_widget_hover_object_set(Evas_Object *obj, Evas_Object *sobj);
681 EAPI void elm_widget_signal_emit(Evas_Object *obj, const char *emission, const char *source);
682 EAPI void elm_widget_signal_callback_add(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data);
683 EAPI void *elm_widget_signal_callback_del(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func);
684 EAPI void elm_widget_can_focus_set(Evas_Object *obj, Eina_Bool can_focus);
685 EAPI Eina_Bool elm_widget_can_focus_get(const Evas_Object *obj);
686 EAPI Eina_Bool elm_widget_child_can_focus_get(const Evas_Object *obj);
687 EAPI Eina_List *elm_widget_can_focus_child_list_get(const Evas_Object *obj);
688 EAPI void elm_widget_tree_unfocusable_set(Evas_Object *obj, Eina_Bool tree_unfocusable);
689 EAPI Eina_Bool elm_widget_tree_unfocusable_get(const Evas_Object *obj);
690 EAPI void elm_widget_highlight_ignore_set(Evas_Object *obj, Eina_Bool ignore);
691 EAPI Eina_Bool elm_widget_highlight_ignore_get(const Evas_Object *obj);
692 EAPI void elm_widget_highlight_in_theme_set(Evas_Object *obj, Eina_Bool highlight);
693 EAPI Eina_Bool elm_widget_highlight_in_theme_get(const Evas_Object *obj);
694 EAPI Eina_Bool elm_widget_focus_get(const Evas_Object *obj);
695 EAPI Evas_Object *elm_widget_focused_object_get(const Evas_Object *obj);
696 EAPI Evas_Object *elm_widget_top_get(const Evas_Object *obj);
697 EAPI Eina_Bool elm_widget_is(const Evas_Object *obj);
698 EAPI Evas_Object *elm_widget_parent_widget_get(const Evas_Object *obj);
699 EAPI void elm_widget_event_callback_add(Evas_Object *obj, Elm_Event_Cb func, const void *data);
700 EAPI void *elm_widget_event_callback_del(Evas_Object *obj, Elm_Event_Cb func, const void *data);
701 EAPI Eina_Bool elm_widget_event_propagate(Evas_Object *obj, Evas_Callback_Type type, void *event_info, Evas_Event_Flags *event_flags);
702 EAPI void elm_widget_focus_custom_chain_set(Evas_Object *obj, Eina_List *objs);
703 EAPI void elm_widget_focus_custom_chain_unset(Evas_Object *obj);
704 EAPI const Eina_List *elm_widget_focus_custom_chain_get(const Evas_Object *obj);
705 EAPI void elm_widget_focus_custom_chain_append(Evas_Object *obj, Evas_Object *child, Evas_Object *relative_child);
706 EAPI void elm_widget_focus_custom_chain_prepend(Evas_Object *obj, Evas_Object *child, Evas_Object *relative_child);
707 EAPI void elm_widget_focus_cycle(Evas_Object *obj, Elm_Focus_Direction dir);
708 EAPI Eina_Bool elm_widget_focus_direction_go(Evas_Object *obj, double degree);
709 EAPI Eina_Bool elm_widget_focus_direction_get(const Evas_Object *obj, const Evas_Object *base, double degree, Evas_Object **direction, double *weight);
710 EAPI Eina_Bool elm_widget_focus_next_get(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next);
711 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);
712 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);
713 EAPI Evas_Object *elm_widget_focus_next_object_get(const Evas_Object *obj, Elm_Focus_Direction dir);
714 EAPI void elm_widget_focus_next_object_set(Evas_Object *obj, Evas_Object *next, Elm_Focus_Direction dir);
715 EAPI void elm_widget_focus_set(Evas_Object *obj, int first);
716 EAPI void elm_widget_focused_object_clear(Evas_Object *obj);
717 EAPI Evas_Object *elm_widget_parent_get(const Evas_Object *obj);
718 EAPI Evas_Object *elm_widget_parent2_get(const Evas_Object *obj);
719 EAPI void elm_widget_parent2_set(Evas_Object *obj, Evas_Object *parent);
720 EAPI void elm_widget_focus_steal(Evas_Object *obj);
721 EAPI Evas_Display_Mode elm_widget_display_mode_get(const Evas_Object *obj);
722 EAPI void elm_widget_display_mode_set(Evas_Object *obj, Evas_Display_Mode dispmode);
723 EAPI const Elm_Widget_Smart_Class *elm_widget_smart_class_get(void);
725 EAPI Eina_Bool elm_widget_highlight_get(const Evas_Object *obj);
726 EAPI void elm_widget_parent_highlight_set(Evas_Object *obj, Eina_Bool highlighted);
730 * Restore the focus state of the sub-tree.
732 * This API will restore the focus state of the sub-tree to the latest
733 * state. If a sub-tree is unfocused and wants to get back to the latest
734 * focus state, this API will be helpful.
736 * @param obj The widget root of sub-tree
740 EAPI void elm_widget_focus_restore(Evas_Object *obj);
742 EAPI void elm_widget_disabled_set(Evas_Object *obj, Eina_Bool disabled);
743 EAPI Eina_Bool elm_widget_disabled_get(const Evas_Object *obj);
744 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);
745 EAPI void elm_widget_show_region_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
746 EAPI Eina_Bool elm_widget_focus_region_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
747 EAPI void elm_widget_scroll_hold_push(Evas_Object *obj);
748 EAPI void elm_widget_scroll_hold_pop(Evas_Object *obj);
749 EAPI int elm_widget_scroll_hold_get(const Evas_Object *obj);
750 EAPI void elm_widget_scroll_freeze_push(Evas_Object *obj);
751 EAPI void elm_widget_scroll_freeze_pop(Evas_Object *obj);
752 EAPI int elm_widget_scroll_freeze_get(const Evas_Object *obj);
753 EAPI void elm_widget_scale_set(Evas_Object *obj, double scale);
754 EAPI double elm_widget_scale_get(const Evas_Object *obj);
755 EAPI Eina_Bool elm_widget_mirrored_get(const Evas_Object *obj);
756 EAPI void elm_widget_mirrored_set(Evas_Object *obj, Eina_Bool mirrored);
757 EAPI Eina_Bool elm_widget_mirrored_automatic_get(const Evas_Object *obj);
758 EAPI void elm_widget_mirrored_automatic_set(Evas_Object *obj, Eina_Bool automatic);
759 EAPI void elm_widget_theme_set(Evas_Object *obj, Elm_Theme *th);
760 EAPI Elm_Theme *elm_widget_theme_get(const Evas_Object *obj);
761 EAPI Eina_Bool elm_widget_style_set(Evas_Object *obj, const char *style);
762 EAPI const char *elm_widget_style_get(const Evas_Object *obj);
763 EAPI void elm_widget_type_set(Evas_Object *obj, const char *type);
764 EAPI const char *elm_widget_type_get(const Evas_Object *obj);
765 EAPI void elm_widget_tooltip_add(Evas_Object *obj, Elm_Tooltip *tt);
766 EAPI void elm_widget_tooltip_del(Evas_Object *obj, Elm_Tooltip *tt);
767 EAPI void elm_widget_cursor_add(Evas_Object *obj, Elm_Cursor *cur);
768 EAPI void elm_widget_cursor_del(Evas_Object *obj, Elm_Cursor *cur);
769 EAPI void elm_widget_drag_lock_x_set(Evas_Object *obj, Eina_Bool lock);
770 EAPI void elm_widget_drag_lock_y_set(Evas_Object *obj, Eina_Bool lock);
771 EAPI Eina_Bool elm_widget_drag_lock_x_get(const Evas_Object *obj);
772 EAPI Eina_Bool elm_widget_drag_lock_y_get(const Evas_Object *obj);
773 EAPI int elm_widget_drag_child_locked_x_get(const Evas_Object *obj);
774 EAPI int elm_widget_drag_child_locked_y_get(const Evas_Object *obj);
775 EAPI Eina_Bool elm_widget_theme_object_set(Evas_Object *obj, Evas_Object *edj, const char *wname, const char *welement, const char *wstyle);
776 EAPI Eina_Bool elm_widget_type_check(const Evas_Object *obj, const char *type, const char *func);
777 EAPI Evas_Object *elm_widget_name_find(const Evas_Object *obj, const char *name, int recurse);
778 EAPI Eina_List *elm_widget_stringlist_get(const char *str);
779 EAPI void elm_widget_stringlist_free(Eina_List *list);
780 EAPI void elm_widget_focus_hide_handle(Evas_Object *obj);
781 EAPI void elm_widget_focus_mouse_up_handle(Evas_Object *obj);
782 EAPI void elm_widget_focus_tree_unfocusable_handle(Evas_Object *obj);
783 EAPI void elm_widget_focus_disabled_handle(Evas_Object *obj);
784 EAPI unsigned int elm_widget_focus_order_get(const Evas_Object *obj);
785 EAPI Evas_Object *elm_widget_newest_focus_order_get(const Evas_Object *obj, unsigned int *newest_focus_order, Eina_Bool can_focus_only);
786 EAPI void elm_widget_activate(Evas_Object *obj, Elm_Activate act);
787 EAPI void elm_widget_text_part_set(Evas_Object *obj, const char *part, const char *label);
788 EAPI const char *elm_widget_text_part_get(const Evas_Object *obj, const char *part);
789 EAPI void elm_widget_domain_translatable_text_part_set(Evas_Object *obj, const char *part, const char *domain, const char *text);
790 EAPI const char *elm_widget_translatable_text_part_get(const Evas_Object *obj, const char *part);
791 EAPI void elm_widget_content_part_set(Evas_Object *obj, const char *part, Evas_Object *content);
792 EAPI Evas_Object *elm_widget_content_part_get(const Evas_Object *obj, const char *part);
793 EAPI Evas_Object *elm_widget_content_part_unset(Evas_Object *obj, const char *part);
794 EAPI void elm_widget_access_info_set(Evas_Object *obj, const char *txt);
795 EAPI const char *elm_widget_access_info_get(const Evas_Object *obj);
796 EAPI void elm_widget_orientation_set(Evas_Object *obj, int rotation);
797 EAPI void elm_widget_orientation_mode_disabled_set(Evas_Object *obj, Eina_Bool disabled);
798 EAPI Eina_Bool elm_widget_orientation_mode_disabled_get(const Evas_Object *obj);
799 EAPI Elm_Widget_Item *_elm_widget_item_new(Evas_Object *parent, size_t alloc_size);
800 EAPI void _elm_widget_item_free(Elm_Widget_Item *item);
801 EAPI Evas_Object *_elm_widget_item_widget_get(const Elm_Widget_Item *item);
802 EAPI void _elm_widget_item_del(Elm_Widget_Item *item);
803 EAPI void _elm_widget_item_pre_notify_del(Elm_Widget_Item *item);
804 EAPI void _elm_widget_item_del_cb_set(Elm_Widget_Item *item, Evas_Smart_Cb del_cb);
805 EAPI void _elm_widget_item_data_set(Elm_Widget_Item *item, const void *data);
806 EAPI void *_elm_widget_item_data_get(const Elm_Widget_Item *item);
807 EAPI void _elm_widget_item_tooltip_text_set(Elm_Widget_Item *item, const char *text);
808 EAPI void _elm_widget_item_tooltip_translatable_text_set(Elm_Widget_Item *item, const char *text);
809 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);
810 EAPI void _elm_widget_item_tooltip_unset(Elm_Widget_Item *item);
811 EAPI void _elm_widget_item_tooltip_style_set(Elm_Widget_Item *item, const char *style);
812 EAPI Eina_Bool _elm_widget_item_tooltip_window_mode_set(Elm_Widget_Item *item, Eina_Bool disable);
813 EAPI Eina_Bool _elm_widget_item_tooltip_window_mode_get(const Elm_Widget_Item *item);
814 EAPI const char *_elm_widget_item_tooltip_style_get(const Elm_Widget_Item *item);
815 EAPI void _elm_widget_item_cursor_set(Elm_Widget_Item *item, const char *cursor);
816 EAPI const char *_elm_widget_item_cursor_get(const Elm_Widget_Item *item);
817 EAPI void _elm_widget_item_cursor_unset(Elm_Widget_Item *item);
818 EAPI void _elm_widget_item_cursor_style_set(Elm_Widget_Item *item, const char *style);
819 EAPI const char *_elm_widget_item_cursor_style_get(const Elm_Widget_Item *item);
820 EAPI void _elm_widget_item_cursor_engine_only_set(Elm_Widget_Item *item, Eina_Bool engine_only);
821 EAPI Eina_Bool _elm_widget_item_cursor_engine_only_get(const Elm_Widget_Item *item);
822 EAPI void _elm_widget_item_part_content_set(Elm_Widget_Item *item, const char *part, Evas_Object *content);
823 EAPI Evas_Object *_elm_widget_item_part_content_get(const Elm_Widget_Item *item, const char *part);
824 EAPI Evas_Object *_elm_widget_item_part_content_unset(Elm_Widget_Item *item, const char *part);
825 EAPI void _elm_widget_item_part_text_set(Elm_Widget_Item *item, const char *part, const char *label);
826 EAPI const char *_elm_widget_item_part_text_get(const Elm_Widget_Item *item, const char *part);
827 EAPI void _elm_widget_item_signal_emit(Elm_Widget_Item *item, const char *emission, const char *source);
828 EAPI void _elm_widget_item_content_set_hook_set(Elm_Widget_Item *item, Elm_Widget_Content_Set_Cb func);
829 EAPI void _elm_widget_item_content_get_hook_set(Elm_Widget_Item *item, Elm_Widget_Content_Get_Cb func);
830 EAPI void _elm_widget_item_content_unset_hook_set(Elm_Widget_Item *item, Elm_Widget_Content_Unset_Cb func);
831 EAPI void _elm_widget_item_text_set_hook_set(Elm_Widget_Item *item, Elm_Widget_Text_Set_Cb func);
832 EAPI void _elm_widget_item_text_get_hook_set(Elm_Widget_Item *item, Elm_Widget_Text_Get_Cb func);
833 EAPI void _elm_widget_item_signal_emit_hook_set(Elm_Widget_Item *it, Elm_Widget_Signal_Emit_Cb func);
834 EAPI void _elm_widget_item_access_info_set(Elm_Widget_Item *item, const char *txt);
835 EAPI void _elm_widget_item_disabled_set(Elm_Widget_Item *item, Eina_Bool disabled);
836 EAPI Eina_Bool _elm_widget_item_disabled_get(const Elm_Widget_Item *item);
837 EAPI void _elm_widget_item_disable_hook_set(Elm_Widget_Item *item, Elm_Widget_Disable_Cb func);
838 EAPI void _elm_widget_item_del_pre_hook_set(Elm_Widget_Item *item, Elm_Widget_Del_Pre_Cb func);
841 * Function to operate on a given widget's scrollabe children when necessary.
842 * @warning free the returned list with eina_list_free().
844 EAPI Eina_List *elm_widget_scrollable_children_get(Evas_Object *obj);
846 /* debug function. don't use it unless you are tracking parenting issues */
847 EAPI void elm_widget_tree_dump(const Evas_Object *top);
848 EAPI void elm_widget_tree_dot_dump(const Evas_Object *top, FILE *output);
850 #define ELM_WIDGET_DATA_GET(o, sd) \
851 Elm_Widget_Smart_Data * sd = evas_object_smart_data_get(o)
853 #define ELM_WIDGET_DATA_GET_OR_RETURN(o, ptr) \
854 ELM_WIDGET_DATA_GET(o, ptr); \
857 CRITICAL("no widget data for object %p (%s)", \
858 o, evas_object_type_get(o)); \
863 * Convenience macro to create new widget item, doing casts for you.
864 * @see _elm_widget_item_new()
865 * @param parent a valid elm_widget variant.
866 * @param type the C type that extends Elm_Widget_Item
868 #define elm_widget_item_new(parent, type) \
869 (type *)_elm_widget_item_new((parent), sizeof(type))
871 * Convenience macro to free widget item, doing casts for you.
872 * @see _elm_widget_item_free()
873 * @param item a valid item.
875 #define elm_widget_item_free(item) \
876 _elm_widget_item_free((Elm_Widget_Item *)item)
879 * Convenience macro to delete widget item, doing casts for you.
880 * @see _elm_widget_item_del()
881 * @param item a valid item.
883 #define elm_widget_item_del(item) \
884 _elm_widget_item_del((Elm_Widget_Item *)item)
886 * Convenience macro to notify deletion of widget item, doing casts for you.
887 * @see _elm_widget_item_pre_notify_del()
889 #define elm_widget_item_pre_notify_del(item) \
890 _elm_widget_item_pre_notify_del((Elm_Widget_Item *)item)
892 * Convenience macro to set deletion callback of widget item, doing casts for you.
893 * @see _elm_widget_item_del_cb_set()
895 #define elm_widget_item_del_cb_set(item, del_cb) \
896 _elm_widget_item_del_cb_set((Elm_Widget_Item *)item, del_cb)
899 * Get item's owner widget
900 * @see _elm_widget_item_widget_get()
902 #define elm_widget_item_widget_get(item) \
903 _elm_widget_item_widget_get((const Elm_Widget_Item *)item)
907 * @see _elm_widget_item_data_set()
909 #define elm_widget_item_data_set(item, data) \
910 _elm_widget_item_data_set((Elm_Widget_Item *)item, data)
913 * @see _elm_widget_item_data_get()
915 #define elm_widget_item_data_get(item) \
916 _elm_widget_item_data_get((const Elm_Widget_Item *)item)
919 * Convenience function to set widget item tooltip as a text string.
920 * @see _elm_widget_item_tooltip_text_set()
922 #define elm_widget_item_tooltip_text_set(item, text) \
923 _elm_widget_item_tooltip_text_set((Elm_Widget_Item *)item, text)
925 * Convenience function to set widget item tooltip as a text string.
926 * @see _elm_widget_item_tooltip_text_set()
928 #define elm_widget_item_tooltip_translatable_text_set(item, text) \
929 _elm_widget_item_tooltip_translatable_text_set((Elm_Widget_Item *)item, text)
931 * Convenience function to set widget item tooltip.
932 * @see _elm_widget_item_tooltip_content_cb_set()
934 #define elm_widget_item_tooltip_content_cb_set(item, func, data, del_cb) \
935 _elm_widget_item_tooltip_content_cb_set((Elm_Widget_Item *)item, \
938 * Convenience function to unset widget item tooltip.
939 * @see _elm_widget_item_tooltip_unset()
941 #define elm_widget_item_tooltip_unset(item) \
942 _elm_widget_item_tooltip_unset((Elm_Widget_Item *)item)
944 * Convenience function to change item's tooltip style.
945 * @see _elm_widget_item_tooltip_style_set()
947 #define elm_widget_item_tooltip_style_set(item, style) \
948 _elm_widget_item_tooltip_style_set((Elm_Widget_Item *)item, style)
950 #define elm_widget_item_tooltip_window_mode_set(item, disable) \
951 _elm_widget_item_tooltip_window_mode_set((Elm_Widget_Item *)item, disable)
953 #define elm_widget_item_tooltip_window_mode_get(item) \
954 _elm_widget_item_tooltip_window_mode_get((Elm_Widget_Item *)item)
956 * Convenience function to query item's tooltip style.
957 * @see _elm_widget_item_tooltip_style_get()
959 #define elm_widget_item_tooltip_style_get(item) \
960 _elm_widget_item_tooltip_style_get((const Elm_Widget_Item *)item)
962 * Convenience function to set widget item cursor.
963 * @see _elm_widget_item_cursor_set()
965 #define elm_widget_item_cursor_set(item, cursor) \
966 _elm_widget_item_cursor_set((Elm_Widget_Item *)item, cursor)
968 * Convenience function to get widget item cursor.
969 * @see _elm_widget_item_cursor_get()
971 #define elm_widget_item_cursor_get(item) \
972 _elm_widget_item_cursor_get((const Elm_Widget_Item *)item)
974 * Convenience function to unset widget item cursor.
975 * @see _elm_widget_item_cursor_unset()
977 #define elm_widget_item_cursor_unset(item) \
978 _elm_widget_item_cursor_unset((Elm_Widget_Item *)item)
980 * Convenience function to change item's cursor style.
981 * @see _elm_widget_item_cursor_style_set()
983 #define elm_widget_item_cursor_style_set(item, style) \
984 _elm_widget_item_cursor_style_set((Elm_Widget_Item *)item, style)
986 * Convenience function to query item's cursor style.
987 * @see _elm_widget_item_cursor_style_get()
989 #define elm_widget_item_cursor_style_get(item) \
990 _elm_widget_item_cursor_style_get((const Elm_Widget_Item *)item)
992 * Convenience function to change item's cursor engine_only.
993 * @see _elm_widget_item_cursor_engine_only_set()
995 #define elm_widget_item_cursor_engine_only_set(item, engine_only) \
996 _elm_widget_item_cursor_engine_only_set((Elm_Widget_Item *)item, engine_only)
998 * Convenience function to query item's cursor engine_only.
999 * @see _elm_widget_item_cursor_engine_only_get()
1001 #define elm_widget_item_cursor_engine_only_get(item) \
1002 _elm_widget_item_cursor_engine_only_get((const Elm_Widget_Item *)item)
1004 * Convenience function to query item's content set hook.
1005 * @see _elm_widget_item_content_set_hook_set()
1007 #define elm_widget_item_content_set_hook_set(item, func) \
1008 _elm_widget_item_content_set_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Content_Set_Cb)func)
1010 * Convenience function to query item's content get hook.
1011 * @see _elm_widget_item_content_get_hook_set()
1013 #define elm_widget_item_content_get_hook_set(item, func) \
1014 _elm_widget_item_content_get_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Content_Get_Cb)func)
1016 * Convenience function to query item's content unset hook.
1017 * @see _elm_widget_item_content_unset_hook_set()
1019 #define elm_widget_item_content_unset_hook_set(item, func) \
1020 _elm_widget_item_content_unset_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Content_Unset_Cb)func)
1022 * Convenience function to query item's text set hook.
1023 * @see _elm_widget_item_text_set_hook_set()
1025 #define elm_widget_item_text_set_hook_set(item, func) \
1026 _elm_widget_item_text_set_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Text_Set_Cb)func)
1028 * Convenience function to query item's text get hook.
1029 * @see _elm_widget_item_text_get_hook_set()
1031 #define elm_widget_item_text_get_hook_set(item, func) \
1032 _elm_widget_item_text_get_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Text_Get_Cb)func)
1034 * Convenience function to query item's signal emit hook.
1035 * @see _elm_widget_item_signal_emit_hook_set()
1037 #define elm_widget_item_signal_emit_hook_set(item, func) \
1038 _elm_widget_item_signal_emit_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Signal_Emit_Cb)func)
1040 * Convenience function to query disable get hook.
1041 * @see _elm_widget_item_disabled_get()
1043 #define elm_widget_item_disabled_get(item) \
1044 _elm_widget_item_disabled_get((Elm_Widget_Item *)item)
1046 * Convenience function to query disable set hook.
1047 * @see _elm_widget_item_disable_hook_set()
1049 #define elm_widget_item_disable_hook_set(item, func) \
1050 _elm_widget_item_disable_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Disable_Cb)func)
1052 * Convenience function to query del pre hook.
1053 * @see _elm_widget_item_del_pre_hook_set()
1055 #define elm_widget_item_del_pre_hook_set(item, func) \
1056 _elm_widget_item_del_pre_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Del_Pre_Cb)func)
1058 #define ELM_WIDGET_CHECK_OR_RETURN(obj, ...) \
1060 if (!obj || !evas_object_smart_data_get(obj)) \
1062 WRN("Object [%p] is already deleted", obj); \
1063 return __VA_ARGS__; \
1067 #define ELM_WIDGET_CHECK_OR_GOTO(obj, label) \
1069 if (!obj || !evas_object_smart_data_get(obj)) \
1071 WRN("Object [%p] is already deleted", obj); \
1076 #define ELM_WIDGET_ITEM_RETURN_IF_ONDEL(item, ...) \
1078 if (item && (item)->on_deletion) { \
1079 CRITICAL("Elm_Widget_Item " # item " is deleting"); \
1080 return __VA_ARGS__; \
1082 ELM_WIDGET_CHECK_OR_RETURN((item)->widget, __VA_ARGS__); \
1086 #define ELM_WIDGET_ITEM_GOTO_IF_ONDEL(item, label) \
1088 if (item && (item)->on_deletion) { \
1089 CRITICAL("Elm_Widget_Item " # item " is deleting"); \
1092 ELM_WIDGET_CHECK_OR_GOTO((item)->widget, label); \
1095 #define ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, ...) \
1098 CRITICAL("Elm_Widget_Item " # item " is NULL"); \
1099 return __VA_ARGS__; \
1101 if (!EINA_MAGIC_CHECK(item, ELM_WIDGET_ITEM_MAGIC)) { \
1102 EINA_MAGIC_FAIL(item, ELM_WIDGET_ITEM_MAGIC); \
1103 return __VA_ARGS__; \
1105 ELM_WIDGET_CHECK_OR_RETURN((item)->widget, __VA_ARGS__); \
1108 #define ELM_WIDGET_ITEM_CHECK_OR_GOTO(item, label) \
1111 CRITICAL("Elm_Widget_Item " # item " is NULL"); \
1114 if (!EINA_MAGIC_CHECK(item, ELM_WIDGET_ITEM_MAGIC)) { \
1115 EINA_MAGIC_FAIL(item, ELM_WIDGET_ITEM_MAGIC); \
1118 ELM_WIDGET_CHECK_OR_GOTO((item)->widget, label); \
1121 /* to be used by INTERNAL classes on Elementary, so that the widgets
1122 * parsing script skips it */
1123 #define ELM_INTERNAL_SMART_SUBCLASS_NEW EVAS_SMART_SUBCLASS_NEW
1126 * The drag and drop API.
1127 * Currently experimental, and will change when it does dynamic type
1130 * Here so applications can start to use it, if they ask elm nicely.
1132 * And yes, elm_widget, should probably be elm_experimental...
1133 * Complaints about this code should go to /dev/null, or failing that nash.
1135 EAPI Eina_Bool elm_drop_target_add(Evas_Object *widget, Elm_Sel_Type, Elm_Drop_Cb, void *);
1136 EAPI Eina_Bool elm_drop_target_del(Evas_Object *widget);
1137 EAPI Eina_Bool elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data, void (*dragdone) (void *data, Evas_Object *), void *donecbdata);
1138 EAPI Eina_Bool elm_selection_selection_has_owner(Evas_Object *obj);