Smart_Data * sd = evas_object_smart_data_get(obj); \
if (!sd) return;
+#undef elm_widget_text_set_hook_set
+#undef elm_widget_text_get_hook_set
+#undef elm_widget_content_set_hook_set
+#undef elm_widget_content_get_hook_set
+#undef elm_widget_content_unset_hook_set
+
typedef struct _Smart_Data Smart_Data;
typedef struct _Edje_Signal_Data Edje_Signal_Data;
typedef struct _Elm_Event_Cb_Data Elm_Event_Cb_Data;
+typedef struct _Elm_Translate_String_Data Elm_Translate_String_Data;
struct _Smart_Data
{
void (*activate_func)(Evas_Object *obj);
void (*disable_func)(Evas_Object *obj);
void (*theme_func)(Evas_Object *obj);
+ void (*translate_func)(Evas_Object *obj);
Eina_Bool (*event_func)(Evas_Object *obj,
Evas_Object *source,
Evas_Callback_Type type,
Evas_Coord *y,
Evas_Coord *w,
Evas_Coord *h);
+ Elm_Widget_On_Text_Set_Cb on_text_set_func;
+ Elm_Widget_On_Text_Get_Cb on_text_get_func;
+ Elm_Widget_On_Content_Set_Cb on_content_set_func;
+ Elm_Widget_On_Content_Get_Cb on_content_get_func;
+ Elm_Widget_On_Content_Unset_Cb on_content_unset_func;
void *data;
Evas_Coord rx, ry, rw, rh;
int scroll_hold;
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_y_locked;
Eina_List *edje_signals;
+ Eina_List *translate_strings;
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;
Eina_List *focus_chain;
Eina_List *event_cb;
const void *data;
};
+struct _Elm_Translate_String_Data
+{
+ const char *id;
+ const char *domain;
+ const char *string;
+};
+
/* local subsystem functions */
static void _smart_reconfigure(Smart_Data *sd);
static void _smart_add(Evas_Object *obj);
}
static void
-_sub_obj_mouse_down(void *data __UNUSED__,
+_sub_obj_mouse_down(void *data,
+ Evas *e __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ void *event_info)
+{
+ Smart_Data *sd = data;
+ Evas_Event_Mouse_Down *ev = event_info;
+ if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
+ sd->still_in = EINA_TRUE;
+}
+
+static void
+_sub_obj_mouse_move(void *data,
Evas *e __UNUSED__,
Evas_Object *obj,
- void *event_info __UNUSED__)
+ void *event_info)
+{
+ Smart_Data *sd = data;
+ Evas_Event_Mouse_Move *ev = event_info;
+ if (sd->still_in)
+ {
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
+ sd->still_in = EINA_FALSE;
+ else
+ {
+ Evas_Coord x, y, w, h;
+ evas_object_geometry_get(obj, &x, &y, &w, &h);
+ if ((ev->cur.canvas.x < x) || (ev->cur.canvas.y < y) ||
+ (ev->cur.canvas.x >= (x + w)) || (ev->cur.canvas.y >= (y + h)))
+ sd->still_in = EINA_FALSE;
+ }
+ }
+}
+
+static void
+_sub_obj_mouse_up(void *data,
+ Evas *e __UNUSED__,
+ Evas_Object *obj,
+ void *event_info __UNUSED__)
{
- elm_widget_focus_mouse_down_handle(obj);
+ Smart_Data *sd = data;
+ if (sd->still_in)
+ elm_widget_focus_mouse_up_handle(obj);
+ sd->still_in = EINA_FALSE;
}
static void
focus_order++;
sd->focus_order = focus_order;
- sd->focused = EINA_TRUE;
- if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj);
- if (sd->focus_func) sd->focus_func(obj);
-
- _elm_widget_focus_region_show(obj);
-
+ if (sd->top_win_focused)
+ {
+ sd->focused = EINA_TRUE;
+ if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj);
+ if (sd->focus_func) sd->focus_func(obj);
+ _elm_widget_focus_region_show(obj);
+ }
sd->focus_order_on_calc = EINA_FALSE;
}
widtypes = eina_list_append(widtypes, (void *)ptr);
}
+/**
+ * @defgroup Widget Widget
+ *
+ * @internal
+ * Disposed api for making widgets
+ */
+EAPI void
+elm_widget_type_unregister(const char **ptr)
+{
+ widtypes = eina_list_remove(widtypes, (void *)ptr);
+}
+
EAPI Eina_Bool
elm_widget_api_check(int ver)
{
}
EAPI void
+elm_widget_translate_hook_set(Evas_Object *obj,
+ void (*func)(Evas_Object *obj))
+{
+ API_ENTRY return;
+ sd->translate_func = func;
+}
+
+EAPI void
elm_widget_event_hook_set(Evas_Object *obj,
Eina_Bool (*func)(Evas_Object *obj,
Evas_Object *source,
}
EAPI void
+elm_widget_text_set_hook_set(Evas_Object *obj,
+ Elm_Widget_On_Text_Set_Cb func)
+{
+ API_ENTRY return;
+ sd->on_text_set_func = func;
+}
+
+EAPI void
+elm_widget_text_get_hook_set(Evas_Object *obj,
+ Elm_Widget_On_Text_Get_Cb func)
+{
+ API_ENTRY return;
+ sd->on_text_get_func = func;
+}
+
+EAPI void
+elm_widget_content_set_hook_set(Evas_Object *obj,
+ Elm_Widget_On_Content_Set_Cb func)
+{
+ API_ENTRY return;
+ sd->on_content_set_func = func;
+}
+
+EAPI void
+elm_widget_content_get_hook_set(Evas_Object *obj,
+ Elm_Widget_On_Content_Get_Cb func)
+{
+ API_ENTRY return;
+ sd->on_content_get_func = func;
+}
+
+EAPI void
+elm_widget_content_unset_hook_set(Evas_Object *obj,
+ Elm_Widget_On_Content_Unset_Cb func)
+{
+ API_ENTRY return;
+ sd->on_content_unset_func = func;
+}
+
+EAPI void
elm_widget_changed_hook_set(Evas_Object *obj,
void (*func)(Evas_Object *obj))
{
if (sd2->parent_obj)
elm_widget_sub_object_del(sd2->parent_obj, sobj);
sd2->parent_obj = obj;
+ sd2->top_win_focused = sd->top_win_focused;
if (!sd->child_can_focus && (_is_focusable(sobj)))
sd->child_can_focus = EINA_TRUE;
}
}
if (abort_on_warn == 1) abort();
}
- if (!sd->child_can_focus)
- {
- if (_is_focusable(sobj)) sd->child_can_focus = 0;
- }
if (_elm_widget_is(sobj))
{
Smart_Data *sd2 = evas_object_smart_data_get(sobj);
else
sd->subobjs = eina_list_remove(sd->subobjs, sobj);
if (elm_widget_focus_get(sobj)) _unfocus_parents(obj);
+ if ((sd->child_can_focus) && (_is_focusable(sobj)))
+ {
+ Evas_Object *subobj;
+ const Eina_List *l;
+ sd->child_can_focus = EINA_FALSE;
+ EINA_LIST_FOREACH(sd->subobjs, l, subobj)
+ {
+ if (_is_focusable(subobj))
+ {
+ sd->child_can_focus = EINA_TRUE;
+ break;
+ }
+ }
+ }
}
else
sd->subobjs = eina_list_remove(sd->subobjs, sobj);
_sub_obj_del, sd);
evas_object_event_callback_del_full(sd->resize_obj, EVAS_CALLBACK_MOUSE_DOWN,
_sub_obj_mouse_down, sd);
+ evas_object_event_callback_del_full(sd->resize_obj, EVAS_CALLBACK_MOUSE_MOVE,
+ _sub_obj_mouse_move, sd);
+ evas_object_event_callback_del_full(sd->resize_obj, EVAS_CALLBACK_MOUSE_UP,
+ _sub_obj_mouse_up, sd);
evas_object_smart_member_del(sd->resize_obj);
if (_elm_widget_is(sd->resize_obj))
{
_sub_obj_del, sd);
evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_MOUSE_DOWN,
_sub_obj_mouse_down, sd);
+ evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_MOUSE_MOVE,
+ _sub_obj_mouse_move, sd);
+ evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_MOUSE_UP,
+ _sub_obj_mouse_up, sd);
evas_object_smart_member_del(sobj);
if (_elm_widget_is(sobj))
{
if (_elm_widget_is(sd->resize_obj))
{
Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj);
- if (sd2) sd2->parent_obj = obj;
+ if (sd2)
+ {
+ sd2->parent_obj = obj;
+ sd2->top_win_focused = sd->top_win_focused;
+ }
evas_object_event_callback_add(sobj, EVAS_CALLBACK_HIDE,
_sub_obj_hide, sd);
}
_sub_obj_del, sd);
evas_object_event_callback_add(sobj, EVAS_CALLBACK_MOUSE_DOWN,
_sub_obj_mouse_down, sd);
+ evas_object_event_callback_add(sobj, EVAS_CALLBACK_MOUSE_MOVE,
+ _sub_obj_mouse_move, sd);
+ evas_object_event_callback_add(sobj, EVAS_CALLBACK_MOUSE_UP,
+ _sub_obj_mouse_up, sd);
_smart_reconfigure(sd);
evas_object_data_set(sobj, "elm-parent", obj);
evas_object_smart_callback_call(obj, "sub-object-add", sobj);
return sd->child_can_focus;
}
+/**
+ * @internal
+ *
+ * This API makes the widget object and its children to be unfocusable.
+ *
+ * This API can be helpful for an object to be deleted.
+ * When an object will be deleted soon, it and its children may not
+ * want to get focus (by focus reverting or by other focus controls).
+ * Then, just use this API before deleting.
+ *
+ * @param obj The widget root of sub-tree
+ * @param tree_unfocusable If true, set the object sub-tree as unfocusable
+ *
+ * @ingroup Widget
+ */
+EAPI void
+elm_widget_tree_unfocusable_set(Evas_Object *obj,
+ Eina_Bool tree_unfocusable)
+{
+ API_ENTRY return;
+
+ if (sd->tree_unfocusable == tree_unfocusable) return;
+ sd->tree_unfocusable = !!tree_unfocusable;
+ elm_widget_focus_tree_unfocusable_handle(obj);
+}
+
+/**
+ * @internal
+ *
+ * This returns true, if the object sub-tree is unfocusable.
+ *
+ * @param obj The widget root of sub-tree
+ * @return EINA_TRUE if the object sub-tree is unfocusable
+ *
+ * @ingroup Widget
+ */
+EAPI Eina_Bool
+elm_widget_tree_unfocusable_get(const Evas_Object *obj)
+{
+ API_ENTRY return EINA_FALSE;
+ return sd->tree_unfocusable;
+}
+
EAPI void
elm_widget_highlight_ignore_set(Evas_Object *obj,
Eina_Bool ignore)
API_ENTRY return EINA_FALSE;
/* Ignore if disabled */
- if ((!evas_object_visible_get(obj)) || (elm_widget_disabled_get(obj)))
+ if ((!evas_object_visible_get(obj))
+ || (elm_widget_disabled_get(obj))
+ || (elm_widget_tree_unfocusable_get(obj)))
return EINA_FALSE;
/* Try use hook */
break;
}
}
- sd->callback_del_func(obj, emission, source, _edje_signal_callback, esd);
+ sd->callback_del_func(obj, emission, source, _edje_signal_callback, data);
return data;
}
if (sd->focused) return;
if (sd->disabled) return;
+ if (!sd->can_focus) return;
+ if (sd->tree_unfocusable) return;
parent = obj;
for (;;)
{
o = elm_widget_parent_get(parent);
if (!o) break;
sd = evas_object_smart_data_get(o);
+ if (sd->disabled || sd->tree_unfocusable) return;
if (sd->focused) break;
parent = o;
}
}
EAPI void
+elm_widget_focus_restore(Evas_Object *obj)
+{
+ Evas_Object *newest = NULL;
+ unsigned int newest_focus_order = 0;
+ API_ENTRY return;
+
+ newest = _newest_focus_order_get(obj, &newest_focus_order, EINA_TRUE);
+ if (newest)
+ {
+ elm_object_unfocus(newest);
+ elm_object_focus(newest);
+ }
+}
+
+void
+_elm_widget_top_win_focused_set(Evas_Object *obj, Eina_Bool top_win_focused)
+{
+ const Eina_List *l;
+ Evas_Object *child;
+ API_ENTRY return;
+
+ if (sd->top_win_focused == top_win_focused) return;
+ if (sd->resize_obj)
+ _elm_widget_top_win_focused_set(sd->resize_obj, top_win_focused);
+ EINA_LIST_FOREACH(sd->subobjs, l, child)
+ {
+ _elm_widget_top_win_focused_set(child, top_win_focused);
+ }
+ sd->top_win_focused = top_win_focused;
+}
+
+Eina_Bool
+_elm_widget_top_win_focused_get(const Evas_Object *obj)
+{
+ API_ENTRY return EINA_FALSE;
+ return sd->top_win_focused;
+}
+
+EAPI void
elm_widget_activate(Evas_Object *obj)
{
API_ENTRY return;
if (sd->disabled == disabled) return;
sd->disabled = !!disabled;
- if (sd->focused)
- {
- Evas_Object *o, *parent;
-
- parent = obj;
- for (;;)
- {
- o = elm_widget_parent_get(parent);
- if (!o) break;
- parent = o;
- }
- if (elm_widget_focus_get(obj))
- elm_widget_focus_cycle(parent, ELM_FOCUS_NEXT);
- }
+ elm_widget_focus_disabled_handle(obj);
if (sd->disable_func) sd->disable_func(obj);
}
Evas_Coord x,
Evas_Coord y,
Evas_Coord w,
- Evas_Coord h)
+ Evas_Coord h,
+ Eina_Bool forceshow)
{
Evas_Object *parent_obj, *child_obj;
Evas_Coord px, py, cx, cy;
API_ENTRY return;
- if ((x == sd->rx) && (y == sd->ry) && (w == sd->rw) && (h == sd->rh)) return;
+ if (!forceshow && (x == sd->rx) && (y == sd->ry)
+ && (w == sd->rw) && (h == sd->rh)) return;
sd->rx = x;
sd->ry = y;
sd->rw = w;
}
}
+EAPI void
+elm_widget_text_part_set(Evas_Object *obj, const char *item, const char *label)
+{
+ API_ENTRY return;
+
+ if (!sd->on_text_set_func)
+ return;
+
+ sd->on_text_set_func(obj, item, label);
+}
+
+EAPI const char *
+elm_widget_text_part_get(const Evas_Object *obj, const char *item)
+{
+ API_ENTRY return NULL;
+
+ if (!sd->on_text_get_func)
+ return NULL;
+
+ return sd->on_text_get_func(obj, item);
+}
+
+EAPI void
+elm_widget_domain_translatable_text_part_set(Evas_Object *obj, const char *part, const char *domain, const char *label)
+{
+ const char *str;
+ Eina_List *l;
+ Elm_Translate_String_Data *ts = NULL;
+ API_ENTRY return;
+
+ str = eina_stringshare_add(part);
+ EINA_LIST_FOREACH(sd->translate_strings, l, ts)
+ if (ts->id == str)
+ break;
+ else
+ ts = NULL;
+
+ if (!ts && !label)
+ eina_stringshare_del(str);
+ else if (!ts)
+ {
+ ts = malloc(sizeof(Elm_Translate_String_Data));
+ if (!ts) return;
+
+ ts->id = str;
+ ts->domain = eina_stringshare_add(domain);
+ ts->string = eina_stringshare_add(label);
+ sd->translate_strings = eina_list_append(sd->translate_strings, ts);
+ }
+ else
+ {
+ if (label)
+ {
+ eina_stringshare_replace(&ts->domain, domain);
+ eina_stringshare_replace(&ts->string, label);
+ }
+ else
+ {
+ sd->translate_strings = eina_list_remove_list(
+ sd->translate_strings, l);
+ eina_stringshare_del(ts->id);
+ eina_stringshare_del(ts->domain);
+ eina_stringshare_del(ts->string);
+ free(ts);
+ }
+ eina_stringshare_del(str);
+ }
+
+#ifdef HAVE_GETTEXT
+ if (label && label[0])
+ label = dgettext(domain, label);
+#endif
+ elm_widget_text_part_set(obj, part, label);
+}
+
+EAPI const char *
+elm_widget_translatable_text_part_get(const Evas_Object *obj, const char *part)
+{
+ const char *str, *ret = NULL;
+ Eina_List *l;
+ Elm_Translate_String_Data *ts;
+ API_ENTRY return NULL;
+
+ str = eina_stringshare_add(part);
+ EINA_LIST_FOREACH(sd->translate_strings, l, ts)
+ if (ts->id == str)
+ {
+ ret = ts->string;
+ break;
+ }
+ eina_stringshare_del(str);
+ return ret;
+}
+
+EAPI void
+elm_widget_translate(Evas_Object *obj)
+{
+ const Eina_List *l;
+ Evas_Object *child;
+ Elm_Translate_String_Data *ts;
+
+ API_ENTRY return;
+ EINA_LIST_FOREACH(sd->subobjs, l, child) elm_widget_translate(child);
+ if (sd->resize_obj) elm_widget_translate(sd->resize_obj);
+ if (sd->hover_obj) elm_widget_translate(sd->hover_obj);
+ if (sd->translate_func) sd->translate_func(obj);
+
+#ifdef HAVE_GETTEXT
+ EINA_LIST_FOREACH(sd->translate_strings, l, ts)
+ {
+ const char *s = dgettext(ts->domain, ts->string);
+ elm_widget_text_part_set(obj, ts->id, s);
+ }
+#endif
+}
+
+EAPI void
+elm_widget_content_part_set(Evas_Object *obj, const char *part, Evas_Object *content)
+{
+ API_ENTRY return;
+
+ if (!sd->on_content_set_func) return;
+ sd->on_content_set_func(obj, part, content);
+}
+
+EAPI Evas_Object *
+elm_widget_content_part_get(const Evas_Object *obj, const char *part)
+{
+ API_ENTRY return NULL;
+
+ if (!sd->on_content_get_func) return NULL;
+ return sd->on_content_get_func(obj, part);
+}
+
+EAPI Evas_Object *
+elm_widget_content_part_unset(Evas_Object *obj, const char *part)
+{
+ API_ENTRY return NULL;
+
+ if (!sd->on_content_unset_func) return NULL;
+ return sd->on_content_unset_func(obj, part);
+}
+
+EAPI void
+elm_widget_access_info_set(Evas_Object *obj, const char *txt)
+{
+ API_ENTRY return;
+ if (sd->access_info) eina_stringshare_del(sd->access_info);
+ if (!txt) sd->access_info = NULL;
+ else sd->access_info = eina_stringshare_add(txt);
+}
+
+EAPI const char *
+elm_widget_access_info_get(Evas_Object *obj)
+{
+ API_ENTRY return NULL;
+ return sd->access_info;
+}
+
+
EAPI Elm_Theme *
elm_widget_theme_get(const Evas_Object *obj)
{
}
EAPI void
-elm_widget_focus_mouse_down_handle(Evas_Object *obj)
+elm_widget_focus_mouse_up_handle(Evas_Object *obj)
{
Evas_Object *o = obj;
do
elm_widget_focus_steal(o);
}
+EAPI void
+elm_widget_focus_tree_unfocusable_handle(Evas_Object *obj)
+{
+ API_ENTRY return;
+
+ if (!elm_widget_parent_get(obj))
+ elm_widget_focused_object_clear(obj);
+ else
+ _if_focused_revert(obj, EINA_TRUE);
+}
+
+EAPI void
+elm_widget_focus_disabled_handle(Evas_Object *obj)
+{
+ API_ENTRY return;
+
+ elm_widget_focus_tree_unfocusable_handle(obj);
+}
+
/**
* @internal
*
if (item->view)
evas_object_del(item->view);
+
+ if (item->access)
+ {
+ _elm_access_clear(item->access);
+ free(item->access);
+ item->access = NULL;
+ }
+ if (item->access_info)
+ {
+ eina_stringshare_del(item->access_info);
+ item->access_info = NULL;
+ }
+
+ if (item->access)
+ {
+ _elm_access_clear(item->access);
+ free(item->access);
+ item->access = NULL;
+ }
+ if (item->access_info)
+ {
+ eina_stringshare_del(item->access_info);
+ item->access_info = NULL;
+ }
EINA_MAGIC_SET(item, EINA_MAGIC_NONE);
free(item);
if (!label)
return NULL;
elm_object_style_set(label, "tooltip");
- elm_label_label_set(label, data);
+ elm_object_text_set(label, data);
+ return label;
+}
+
+static Evas_Object *
+_elm_widget_item_tooltip_trans_label_create(void *data,
+ Evas_Object *obj __UNUSED__,
+ void *item __UNUSED__)
+{
+ Evas_Object *label = elm_label_add(obj);
+ if (!label)
+ return NULL;
+ elm_object_style_set(label, "tooltip");
+ elm_object_translatable_text_set(label, data);
return label;
}
_elm_widget_item_tooltip_label_del_cb);
}
+EAPI void
+_elm_widget_item_tooltip_translatable_text_set(Elm_Widget_Item *item,
+ const char *text)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ EINA_SAFETY_ON_NULL_RETURN(text);
+
+ text = eina_stringshare_add(text);
+ _elm_widget_item_tooltip_content_cb_set
+ (item, _elm_widget_item_tooltip_trans_label_create, text,
+ _elm_widget_item_tooltip_label_del_cb);
+}
+
static Evas_Object *
_elm_widget_item_tooltip_create(void *data,
Evas_Object *obj)
}
}
+EAPI void
+_elm_widget_item_content_part_set(Elm_Widget_Item *item,
+ const char *part,
+ Evas_Object *content)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ if (!item->on_content_set_func) return;
+ item->on_content_set_func((Elm_Object_Item *) item, part, content);
+}
+
+EAPI Evas_Object *
+_elm_widget_item_content_part_get(const Elm_Widget_Item *item,
+ const char *part)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL);
+ if (!item->on_content_get_func) return NULL;
+ return item->on_content_get_func((Elm_Object_Item *) item, part);
+}
+
+EAPI Evas_Object *
+_elm_widget_item_content_part_unset(Elm_Widget_Item *item,
+ const char *part)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL);
+ if (!item->on_content_unset_func) return NULL;
+ return item->on_content_unset_func((Elm_Object_Item *) item, part);
+}
+
+EAPI void
+_elm_widget_item_text_part_set(Elm_Widget_Item *item,
+ const char *part,
+ const char *label)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ if (!item->on_text_set_func) return;
+ item->on_text_set_func((Elm_Object_Item *) item, part, label);
+}
+
+EAPI void
+_elm_widget_item_signal_emit(Elm_Widget_Item *item,
+ const char *emission,
+ const char *source)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ if (item->on_signal_emit_func)
+ item->on_signal_emit_func((Elm_Object_Item *) item, emission, source);
+}
+
+EAPI const char *
+_elm_widget_item_text_part_get(const Elm_Widget_Item *item,
+ const char *part)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL);
+ if (!item->on_text_get_func) return NULL;
+ return item->on_text_get_func((Elm_Object_Item *) item, part);
+}
+
+EAPI void
+_elm_widget_item_content_set_hook_set(Elm_Widget_Item *item,
+ Elm_Widget_On_Content_Set_Cb func)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ item->on_content_set_func = func;
+}
+
+EAPI void
+_elm_widget_item_content_get_hook_set(Elm_Widget_Item *item,
+ Elm_Widget_On_Content_Get_Cb func)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ item->on_content_get_func = func;
+}
+
+EAPI void
+_elm_widget_item_content_unset_hook_set(Elm_Widget_Item *item,
+ Elm_Widget_On_Content_Unset_Cb func)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ item->on_content_unset_func = func;
+}
+
+EAPI void
+_elm_widget_item_text_set_hook_set(Elm_Widget_Item *item,
+ Elm_Widget_On_Text_Set_Cb func)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ item->on_text_set_func = func;
+}
+
+EAPI void
+_elm_widget_item_text_get_hook_set(Elm_Widget_Item *item,
+ Elm_Widget_On_Text_Get_Cb func)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ item->on_text_get_func = func;
+}
+
+EAPI void
+_elm_widget_item_signal_emit_hook_set(Elm_Widget_Item *item,
+ Elm_Widget_On_Signal_Emit_Cb func)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ item->on_signal_emit_func = func;
+}
+
+EAPI void
+_elm_widget_item_access_info_set(Elm_Widget_Item *item, const char *txt)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ if (item->access_info) eina_stringshare_del(item->access_info);
+ if (!txt) item->access_info = NULL;
+ else item->access_info = eina_stringshare_add(txt);
+}
+
+
static void
_smart_add(Evas_Object *obj)
{
Evas_Object *child, *ret, *best;
API_ENTRY return NULL;
- if (!evas_object_visible_get(obj)) return NULL;
+
+ if (!evas_object_visible_get(obj)
+ || (elm_widget_disabled_get(obj))
+ || (elm_widget_tree_unfocusable_get(obj)))
+ return NULL;
+
best = NULL;
if (*newest_focus_order < sd->focus_order)
{
newest = _newest_focus_order_get(top, &newest_focus_order, can_focus_only);
if (newest)
{
- elm_object_unfocus(newest);
- elm_object_focus(newest);
+ elm_object_focus_set(newest, EINA_FALSE);
+ elm_object_focus_set(newest, EINA_TRUE);
}
}
}
{
Evas_Object *sobj;
Edje_Signal_Data *esd;
+ Elm_Translate_String_Data *ts;
INTERNAL_ENTRY
eina_stringshare_del(esd->source);
free(esd);
}
+ EINA_LIST_FREE(sd->translate_strings, ts)
+ {
+ eina_stringshare_del(ts->id);
+ eina_stringshare_del(ts->domain);
+ eina_stringshare_del(ts->string);
+ free(ts);
+ }
eina_list_free(sd->event_cb); /* should be empty anyway */
if (sd->del_func) sd->del_func(obj);
if (sd->style) eina_stringshare_del(sd->style);
if (sd->type) eina_stringshare_del(sd->type);
if (sd->theme) elm_theme_free(sd->theme);
_if_focused_revert(obj, EINA_TRUE);
+ if (sd->access_info) eina_stringshare_del(sd->access_info);
free(sd);
}
_smart_init(void)
{
if (_e_smart) return;
- {
- static const Evas_Smart_Class sc =
- {
- SMART_NAME,
- EVAS_SMART_CLASS_VERSION,
- _smart_add,
- _smart_del,
- _smart_move,
- _smart_resize,
- _smart_show,
- _smart_hide,
- _smart_color_set,
- _smart_clip_set,
- _smart_clip_unset,
- _smart_calculate,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
- };
- _e_smart = evas_smart_class_new(&sc);
- }
+ {
+ static const Evas_Smart_Class sc =
+ {
+ SMART_NAME,
+ EVAS_SMART_CLASS_VERSION,
+ _smart_add,
+ _smart_del,
+ _smart_move,
+ _smart_resize,
+ _smart_show,
+ _smart_hide,
+ _smart_color_set,
+ _smart_clip_set,
+ _smart_clip_unset,
+ _smart_calculate,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ };
+ _e_smart = evas_smart_class_new(&sc);
+ }
}
/* happy debug functions */