*/
#ifndef ELM_INTERNAL_API_ARGESFSDFEFC
-# 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."
+#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."
#endif
#define ELM_INTERNAL_API_VERSION 7000
-typedef struct _Elm_Tooltip Elm_Tooltip;
-typedef struct _Elm_Cursor Elm_Cursor;
-typedef struct _Elm_Widget_Item Elm_Widget_Item; /**< base structure for all widget items that are not Elm_Widget themselves */
+typedef struct _Elm_Tooltip Elm_Tooltip;
+typedef struct _Elm_Cursor Elm_Cursor;
+
+/**< base structure for all widget items that are not Elm_Widget themselves */
+typedef struct _Elm_Widget_Item Elm_Widget_Item;
+
+/**< 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);
+typedef void (*Elm_Widget_Disable_Cb)(void *data);
+typedef Eina_Bool (*Elm_Widget_Del_Pre_Cb)(void *data);
+
+#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
+
+#define ELM_ACCESS_DONE -1 // sentence done - send done event here
+#define ELM_ACCESS_CANCEL -2 // stop reading immediately
+
+typedef char *(*Elm_Access_Content_Cb)(void *data, Evas_Object *obj, Elm_Widget_Item *item);
+
+struct _Elm_Access_Item
+{
+ int type;
+ const void *data;
+ Elm_Access_Content_Cb func;
+};
+
+struct _Elm_Access_Info
+{
+ Eina_List *items;
+ Ecore_Timer *delay_timer;
+};
+
+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);
+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! */
+EAPI void _elm_access_read(Elm_Access_Info *ac, int type, Evas_Object *obj, Elm_Widget_Item *item);
+EAPI void _elm_access_say(const char *txt);
+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);
+EAPI void _elm_access_object_hilight(Evas_Object *obj);
+EAPI void _elm_access_object_unhilight(Evas_Object *obj);
+EAPI void _elm_access_object_hilight_disable(Evas *e);
+EAPI void _elm_access_object_register(Evas_Object *obj, Evas_Object *hoverobj);
+EAPI void _elm_access_item_register(Elm_Widget_Item *item, Evas_Object *hoverobj);
+EAPI Eina_Bool _elm_access_2nd_click_timeout(Evas_Object *obj);
+
+/**< put this as the first member in your widget item struct */
+#define ELM_WIDGET_ITEM Elm_Widget_Item base
struct _Elm_Widget_Item
{
- /* ef1 ~~ efl, el3 ~~ elm */
+/* ef1 ~~ efl, el3 ~~ elm */
#define ELM_WIDGET_ITEM_MAGIC 0xef1e1301
EINA_MAGIC;
-
- Evas_Object *widget; /**< the owner widget that owns this item */
- Evas_Object *view; /**< the base view object */
- const void *data; /**< item specific data */
- Evas_Smart_Cb del_cb; /**< used to notify the item is being deleted */
- void (*on_content_set_func)(Elm_Object_Item *item,
- const char *part,
- Evas_Object *content);
- Evas_Object *(*on_content_get_func)(const Elm_Object_Item *item,
- const char *part);
- Evas_Object *(*on_content_unset_func)(Elm_Object_Item *item,
- const char *part);
- void (*on_text_set_func)(Elm_Object_Item *item,
- const char *part,
- const char *label);
- const char *(*on_text_get_func)(const Elm_Object_Item *item,
- const char *part);
+/* simple accessor macros */
+#define VIEW(X) X->base.view
+#define WIDGET(X) X->base.widget
+ /**< the owner widget that owns this item */
+ Evas_Object *widget;
+ /**< the base view object */
+ Evas_Object *view;
+ /**< item specific data. used for del callback */
+ const void *data;
+ /**< user delete callback function */
+ Evas_Smart_Cb del_func;
+ /**< widget delete callback function. don't expose this callback call */
+ Elm_Widget_Del_Pre_Cb del_pre_func;
+
+ 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;
+ Elm_Widget_Disable_Cb disable_func;
+ Elm_Access_Info *access;
+ const char *access_info;
+ Eina_Bool disabled : 1;
/* widget variations should have data from here and on */
/* @todo: TODO check if this is enough for 1.0 release, maybe add padding! */
};
struct _Elm_Object_Item
{
- Elm_Widget_Item it;
+ ELM_WIDGET_ITEM;
};
#define ELM_NEW(t) calloc(1, sizeof(t))
-#define ELM_CAST(p) ((void *)(p))
-
-#define ELM_OBJ_ITEM_CHECK_OR_RETURN(it, ...) \
- ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *) (it), __VA_ARGS__); \
- ELM_CHECK_WIDTYPE(it->it.widget, widtype) __VA_ARGS__;
-
EAPI Eina_Bool elm_widget_api_check(int ver);
EAPI Evas_Object *elm_widget_add(Evas *evas);
-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));
-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));
+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));
+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));
EAPI void elm_widget_theme(Evas_Object *obj);
EAPI void elm_widget_theme_specific(Evas_Object *obj, Elm_Theme *th, Eina_Bool force);
-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));
-EAPI void elm_widget_text_set_hook_set(Evas_Object *obj, void (*func)(Evas_Object *obj, const char *part, const char *text));
-EAPI void elm_widget_text_get_hook_set(Evas_Object *obj, const char *(*func)(const Evas_Object *obj, const char *part));
-EAPI void elm_widget_content_set_hook_set(Evas_Object *obj, void (*func)(Evas_Object *obj, const char *part, Evas_Object *content));
-EAPI void elm_widget_content_get_hook_set(Evas_Object *obj, Evas_Object *(*func)(const Evas_Object *obj, const char *part));
-EAPI void elm_widget_content_unset_hook_set(Evas_Object *obj, Evas_Object *(*func)(Evas_Object *obj, const char *part));
-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));
+EAPI void elm_widget_translate(Evas_Object *obj);
+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));
+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))
+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));
EAPI void elm_widget_data_set(Evas_Object *obj, void *data);
EAPI void *elm_widget_data_get(const Evas_Object *obj);
EAPI void elm_widget_sub_object_add(Evas_Object *obj, Evas_Object *sobj);
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);
-EAPI void elm_widget_signal_callback_add(Evas_Object *obj, const char *emission, const char *source, void (*func) (void *data, Evas_Object *o, const char *emission, const char *source), void *data);
-EAPI void *elm_widget_signal_callback_del(Evas_Object *obj, const char *emission, const char *source, void (*func) (void *data, Evas_Object *o, const char *emission, const char *source));
+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);
EAPI void elm_widget_can_focus_set(Evas_Object *obj, Eina_Bool can_focus);
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);
EAPI void elm_widget_focus_cycle(Evas_Object *obj, Elm_Focus_Direction dir);
EAPI void elm_widget_focus_direction_go(Evas_Object *obj, int x, int y);
EAPI Eina_Bool elm_widget_focus_next_get(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next);
-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);
+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);
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);
EAPI Evas_Object *elm_widget_parent2_get(const Evas_Object *obj);
EAPI void elm_widget_parent2_set(Evas_Object *obj, Evas_Object *parent);
EAPI void elm_widget_focus_steal(Evas_Object *obj);
+
+/**
+ * @internal
+ *
+ * Restore the focus state of the sub-tree.
+ *
+ * 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
+ * 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);
+
EAPI void elm_widget_activate(Evas_Object *obj);
EAPI void elm_widget_change(Evas_Object *obj);
EAPI void elm_widget_disabled_set(Evas_Object *obj, Eina_Bool disabled);
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);
-EAPI Eina_Bool elm_widget_mirrored_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
-EAPI void elm_widget_mirrored_set(Evas_Object *obj, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
-EAPI Eina_Bool elm_widget_mirrored_automatic_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
-EAPI void elm_widget_mirrored_automatic_set(Evas_Object *obj, Eina_Bool automatic) EINA_ARG_NONNULL(1);
+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);
EAPI void elm_widget_theme_set(Evas_Object *obj, Elm_Theme *th);
EAPI Elm_Theme *elm_widget_theme_get(const Evas_Object *obj);
EAPI void elm_widget_style_set(Evas_Object *obj, const char *style);
EAPI Eina_Bool elm_widget_theme_object_set(Evas_Object *obj, Evas_Object *edj, const char *wname, const char *welement, const char *wstyle);
EAPI void elm_widget_type_register(const char **ptr);
EAPI void elm_widget_type_unregister(const char **ptr);
-EAPI Eina_Bool elm_widget_type_check(const Evas_Object *obj, const char *type);
+EAPI Eina_Bool elm_widget_is_check(const Evas_Object *obj);
+EAPI Eina_Bool elm_widget_type_check(const Evas_Object *obj, const char *type, const char *func);
+EAPI Evas_Object *elm_widget_name_find(const Evas_Object *obj, const char *name, int recurse);
EAPI Eina_List *elm_widget_stringlist_get(const char *str);
EAPI void elm_widget_stringlist_free(Eina_List *list);
EAPI void elm_widget_focus_hide_handle(Evas_Object *obj);
EAPI void elm_widget_focus_disabled_handle(Evas_Object *obj);
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);
+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);
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);
+EAPI void elm_widget_access_info_set(Evas_Object *obj, const char *txt);
+EAPI const char *elm_widget_access_info_get(const Evas_Object *obj);
EAPI Elm_Widget_Item *_elm_widget_item_new(Evas_Object *parent, size_t alloc_size);
+EAPI void _elm_widget_item_free(Elm_Widget_Item *item);
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);
+EAPI void _elm_widget_item_tooltip_translatable_text_set(Elm_Widget_Item *item, const char *text);
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);
-EAPI Eina_Bool _elm_widget_item_tooltip_size_restrict_disable(Elm_Widget_Item *item, Eina_Bool disable);
-EAPI Eina_Bool _elm_widget_item_tooltip_size_restrict_disabled_get(const Elm_Widget_Item *item);
+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);
EAPI const char *_elm_widget_item_tooltip_style_get(const Elm_Widget_Item *item);
EAPI void _elm_widget_item_cursor_set(Elm_Widget_Item *item, const char *cursor);
EAPI const char *_elm_widget_item_cursor_get(const Elm_Widget_Item *item);
EAPI Evas_Object *_elm_widget_item_content_part_unset(Elm_Widget_Item *item, const char *part);
EAPI void _elm_widget_item_text_part_set(Elm_Widget_Item *item, const char *part, const char *label);
EAPI const char *_elm_widget_item_text_part_get(const Elm_Widget_Item *item, const char *part);
-EAPI void _elm_widget_item_content_set_hook_set(Elm_Widget_Item *item, void (*func)(Elm_Object_Item *it, const char *part, Evas_Object *content));
-EAPI void _elm_widget_item_content_get_hook_set(Elm_Widget_Item *item, Evas_Object *(*func)(const Elm_Object_Item *it, const char *part));
-EAPI void _elm_widget_item_content_unset_hook_set(Elm_Widget_Item *item, Evas_Object *(*func)(Elm_Object_Item *it, const char *part));
-EAPI void _elm_widget_item_text_set_hook_set(Elm_Widget_Item *item, void (*func)(Elm_Object_Item *it, const char *part, const char *label));
-EAPI void _elm_widget_item_text_get_hook_set(Elm_Widget_Item *item, const char *(*func)(const Elm_Object_Item *it, const char *part));
-
+EAPI void _elm_widget_item_signal_emit(Elm_Widget_Item *item, const char *emission, const char *source);
+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);
+EAPI void _elm_widget_item_access_info_set(Elm_Widget_Item *item, const char *txt);
+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);
+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);
/* debug function. don't use it unless you are tracking parenting issues */
EAPI void elm_widget_tree_dump(const Evas_Object *top);
#define elm_widget_item_new(parent, type) \
(type *)_elm_widget_item_new((parent), sizeof(type))
/**
+ * 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)
+
+/**
* Convenience macro to delete widget item, doing casts for you.
* @see _elm_widget_item_del()
* @param item a valid item.
#define elm_widget_item_tooltip_text_set(item, text) \
_elm_widget_item_tooltip_text_set((Elm_Widget_Item *)item, text)
/**
+ * 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)
+/**
* 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) \
- _elm_widget_item_tooltip_content_cb_set((Elm_Widget_Item *)item, \
+ _elm_widget_item_tooltip_content_cb_set((Elm_Widget_Item *)item, \
func, data, del_cb)
/**
* Convenience function to unset widget item tooltip.
#define elm_widget_item_tooltip_style_set(item, style) \
_elm_widget_item_tooltip_style_set((Elm_Widget_Item *)item, style)
-#define elm_widget_item_tooltip_size_restrict_disable(item, disable) \
- _elm_widget_item_tooltip_size_restrict_disable((Elm_Widget_Item *)item, disable)
+#define elm_widget_item_tooltip_window_mode_set(item, disable) \
+ _elm_widget_item_tooltip_window_mode_set((Elm_Widget_Item *)item, disable)
-#define elm_widget_item_tooltip_size_restrict_disabled_get(item) \
- _elm_widget_item_tooltip_size_restrict_disabled_get((Elm_Widget_Item *)item)
+#define elm_widget_item_tooltip_window_mode_get(item) \
+ _elm_widget_item_tooltip_window_mode_get((Elm_Widget_Item *)item)
/**
* Convenience function to query item's tooltip style.
* @see _elm_widget_item_tooltip_style_get()
#define elm_widget_item_cursor_engine_only_get(item) \
_elm_widget_item_cursor_engine_only_get((const Elm_Widget_Item *)item)
/**
- * Convenience function to query item's content part set.
- * @see _elm_widget_item_content_part_set()
- */
-#define elm_widget_item_content_part_set(item, part, content) \
- _elm_widget_item_content_part_set((Elm_Widget_Item *)item, part, content)
-/**
- * Convenience function to query item's content part get.
- * @see _elm_widget_item_content_part_get()
- */
-#define elm_widget_item_content_part_get(item, part) \
- _elm_widget_item_content_part_get((const Elm_Widget_Item *)item, part)
-/**
- * Convenience function to query item's content part unset.
- * @see _elm_widget_item_content_part_unset()
- */
-#define elm_widget_item_content_part_unset(item, part) \
- _elm_widget_item_content_part_unset((Elm_Widget_Item *)item, part)
-/**
- * Convenience function to query item's text part set.
- * @see _elm_widget_item_text_part_set()
- */
-#define elm_widget_item_text_part_set(item, part, label) \
- _elm_widget_item_text_part_set((Elm_Widget_Item *)item, part, label)
-/**
- * Convenience function to query item's text part get.
- * @see _elm_widget_item_text_part_get()
- */
-#define elm_widget_item_text_part_get(item, part) \
- _elm_widget_item_text_part_get((const Elm_Widget_Item *)item, part)
-/**
* 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) \
- _elm_widget_item_content_set_hook_set((Elm_Widget_Item *)item, func)
+ _elm_widget_item_content_set_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Content_Set_Cb)func)
/**
* 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) \
- _elm_widget_item_content_get_hook_set((Elm_Widget_Item *)item, func)
+ _elm_widget_item_content_get_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Content_Get_Cb)func)
/**
* 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) \
- _elm_widget_item_content_unset_hook_set((Elm_Widget_Item *)item, func)
+ _elm_widget_item_content_unset_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Content_Unset_Cb)func)
/**
* 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) \
- _elm_widget_item_text_set_hook_set((Elm_Widget_Item *)item, func)
+ _elm_widget_item_text_set_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Text_Set_Cb)func)
/**
* 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) \
- _elm_widget_item_text_get_hook_set((Elm_Widget_Item *)item, func)
-
+ _elm_widget_item_text_get_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Text_Get_Cb)func)
+/**
+ * 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) \
+ _elm_widget_item_signal_emit_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Signal_Emit_Cb)func)
/**
- * Cast and ensure the given pointer is an Elm_Widget_Item or return NULL.
- */
-#define ELM_WIDGET_ITEM(item) \
- (((item) && (EINA_MAGIC_CHECK(item, ELM_WIDGET_ITEM_MAGIC))) ? \
- ((Elm_Widget_Item *)(item)) : NULL)
-
-#define ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, ...) \
- 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); \
- return __VA_ARGS__; \
- } \
- } while (0)
-
-#define ELM_WIDGET_ITEM_CHECK_OR_GOTO(item, label) \
- do { \
- if (!item) { \
- CRITICAL("Elm_Widget_Item " # item " is NULL!"); \
- goto label; \
- } \
- if (!EINA_MAGIC_CHECK(item, ELM_WIDGET_ITEM_MAGIC)) { \
- EINA_MAGIC_FAIL(item, ELM_WIDGET_ITEM_MAGIC); \
- goto label; \
- } \
- } while (0)
-
-#define ELM_SET_WIDTYPE(widtype, type) \
- do { \
- if (!widtype) { \
- widtype = eina_stringshare_add(type); \
- elm_widget_type_register(&widtype); \
- } \
- } while (0)
+ * 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.
+ * @see _elm_widget_item_disable_hook_set()
+ */
+#define elm_widget_item_disable_hook_set(item, func) \
+ _elm_widget_item_disable_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Disable_Cb)func)
+/**
+ * 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) \
+ _elm_widget_item_del_pre_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Del_Pre_Cb)func)
+
+#define ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, ...) \
+ 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); \
+ return __VA_ARGS__; \
+ } \
+ } while (0)
+
+#define ELM_WIDGET_ITEM_CHECK_OR_GOTO(item, label) \
+ do { \
+ if (!item) { \
+ CRITICAL("Elm_Widget_Item " # item " is NULL!"); \
+ goto label; \
+ } \
+ if (!EINA_MAGIC_CHECK(item, ELM_WIDGET_ITEM_MAGIC)) { \
+ EINA_MAGIC_FAIL(item, ELM_WIDGET_ITEM_MAGIC); \
+ goto label; \
+ } \
+ } while (0)
+
+#define ELM_SET_WIDTYPE(widtype, type) \
+ do { \
+ if (!widtype) { \
+ widtype = eina_stringshare_add(type); \
+ elm_widget_type_register(&widtype); \
+ } \
+ } while (0)
+
+#define ELM_CHECK_WID_IS(obj) \
+ if (!elm_widget_is_check(obj)) return
#define ELM_CHECK_WIDTYPE(obj, widtype) \
- if (!elm_widget_type_check((obj), (widtype))) return
+ if (!obj || !elm_widget_type_check((obj), (widtype), __func__)) return
-#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__;
+#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__;
-#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))) goto label;
+#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;
-#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); \
- ob = elm_widget_add(evas); if (!(ob)) { free(wdat); return (ret); } \
- } while (0)
+#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); \
+ ob = elm_widget_add(evas); if (!(ob)) { free(wdat); return (ret); } \
+ } while (0)
+
+#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);
/**
* The drag and drop API.
* And yes, elm_widget, should probably be elm_experimental...
* Complaints about this code should go to /dev/null, or failing that nash.
*/
-typedef struct _Elm_Selection_Data Elm_Selection_Data;
-
-typedef Eina_Bool (*Elm_Drop_Cb) (void *d, Evas_Object *o, Elm_Selection_Data *data);
-
-typedef enum _Elm_Sel_Type
-{
- ELM_SEL_PRIMARY,
- ELM_SEL_SECONDARY,
- ELM_SEL_CLIPBOARD,
- ELM_SEL_XDND,
-
- ELM_SEL_MAX,
-} Elm_Sel_Type;
-
-typedef enum _Elm_Sel_Format
-{
- /** Plain unformated text: Used for things that don't want rich markup */
- ELM_SEL_FORMAT_TEXT = 0x01,
- /** Edje textblock markup, including inline images */
- ELM_SEL_FORMAT_MARKUP = 0x02,
- /** Images */
- ELM_SEL_FORMAT_IMAGE = 0x04,
- /** Vcards */
- ELM_SEL_FORMAT_VCARD = 0x08,
- /** Raw HTMLish things for widgets that want that stuff (hello webkit!) */
- ELM_SEL_FORMAT_HTML = 0x10,
-} Elm_Sel_Format;
-
-struct _Elm_Selection_Data
-{
- int x, y;
- Elm_Sel_Format format;
- void *data;
- int len;
-};
-
-Eina_Bool elm_selection_set(Elm_Sel_Type selection, Evas_Object *widget, Elm_Sel_Format format, const char *buf);
-Eina_Bool elm_selection_clear(Elm_Sel_Type selection, Evas_Object *widget);
-Eina_Bool elm_selection_get(Elm_Sel_Type selection, Elm_Sel_Format format, Evas_Object *widget, Elm_Drop_Cb datacb, void *udata);
-Eina_Bool elm_selection_selection_has_owner(void);
-Eina_Bool elm_drop_target_add(Evas_Object *widget, Elm_Sel_Type, Elm_Drop_Cb, void *);
-Eina_Bool elm_drop_target_del(Evas_Object *widget);
-Eina_Bool elm_drag_start(Evas_Object *, Elm_Sel_Format, const char *, void (*)(void *,Evas_Object*),void*);
+Eina_Bool elm_selection_selection_has_owner(void);
+Eina_Bool elm_drop_target_add(Evas_Object *widget, Elm_Sel_Type, Elm_Drop_Cb, void *);
+Eina_Bool elm_drop_target_del(Evas_Object *widget);
+Eina_Bool elm_drag_start(Evas_Object *, Elm_Sel_Format, const char *, void (*)(void *, Evas_Object *), void *);
#endif