#define API_ENTRY \
Smart_Data * sd = evas_object_smart_data_get(obj); \
- if ((!obj) || (!sd) || (!_elm_widget_is(obj)))
+ if ((!sd) || (!_elm_widget_is(obj)))
#define INTERNAL_ENTRY \
Smart_Data * sd = evas_object_smart_data_get(obj); \
- if (!sd) return;
+ if (!sd) return
#undef elm_widget_text_set_hook_set
#undef elm_widget_text_get_hook_set
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;
+ Elm_Widget_Text_Set_Cb text_set_func;
+ Elm_Widget_Text_Get_Cb text_get_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;
void *data;
Evas_Coord rx, ry, rw, rh;
int scroll_hold;
{
for (; obj; obj = elm_widget_parent_get(obj))
{
- INTERNAL_ENTRY
+ INTERNAL_ENTRY;
if (!sd->focused) return;
sd->focused = 0;
}
{
for (; obj; obj = elm_widget_parent_get(obj))
{
- INTERNAL_ENTRY
+ INTERNAL_ENTRY;
if (sd->focused) return;
sd->focused = 1;
}
_propagate_x_drag_lock(Evas_Object *obj,
int dir)
{
- INTERNAL_ENTRY
+ INTERNAL_ENTRY;
if (sd->parent_obj)
{
Smart_Data *sd2 = evas_object_smart_data_get(sd->parent_obj);
_propagate_y_drag_lock(Evas_Object *obj,
int dir)
{
- INTERNAL_ENTRY
+ INTERNAL_ENTRY;
if (sd->parent_obj)
{
Smart_Data *sd2 = evas_object_smart_data_get(sd->parent_obj);
Evas_Object *obj,
void *event_info)
{
- INTERNAL_ENTRY
+ INTERNAL_ENTRY;
Evas_Callback_Type type = (Evas_Callback_Type)(long)data;
Evas_Event_Flags *event_flags = NULL;
EAPI void
elm_widget_text_set_hook_set(Evas_Object *obj,
- Elm_Widget_On_Text_Set_Cb func)
+ Elm_Widget_Text_Set_Cb func)
{
API_ENTRY return;
- sd->on_text_set_func = func;
+ sd->text_set_func = func;
}
EAPI void
elm_widget_text_get_hook_set(Evas_Object *obj,
- Elm_Widget_On_Text_Get_Cb func)
+ Elm_Widget_Text_Get_Cb func)
{
API_ENTRY return;
- sd->on_text_get_func = func;
+ sd->text_get_func = func;
}
EAPI void
elm_widget_content_set_hook_set(Evas_Object *obj,
- Elm_Widget_On_Content_Set_Cb func)
+ Elm_Widget_Content_Set_Cb func)
{
API_ENTRY return;
- sd->on_content_set_func = func;
+ sd->content_set_func = func;
}
EAPI void
elm_widget_content_get_hook_set(Evas_Object *obj,
- Elm_Widget_On_Content_Get_Cb func)
+ Elm_Widget_Content_Get_Cb func)
{
API_ENTRY return;
- sd->on_content_get_func = func;
+ sd->content_get_func = func;
}
EAPI void
elm_widget_content_unset_hook_set(Evas_Object *obj,
- Elm_Widget_On_Content_Unset_Cb func)
+ Elm_Widget_Content_Unset_Cb func)
{
API_ENTRY return;
- sd->on_content_unset_func = func;
+ sd->content_unset_func = func;
}
EAPI void
_sub_obj_del);
}
}
-
sd->subobjs = eina_list_append(sd->subobjs, sobj);
evas_object_data_set(sobj, "elm-parent", obj);
evas_object_event_callback_add(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd);
if (sobj_parent != obj)
{
static int abort_on_warn = -1;
- ERR("removing sub object %p from parent %p, "
- "but elm-parent is different %p!",
- sobj, obj, sobj_parent);
+ ERR("removing sub object %p (%s) from parent %p (%s), "
+ "but elm-parent is different %p (%s)!",
+ sobj, elm_widget_type_get(sobj), obj, elm_widget_type_get(obj),
+ sobj_parent, elm_widget_type_get(sobj_parent));
if (EINA_UNLIKELY(abort_on_warn == -1))
{
if (getenv("ELM_ERROR_ABORT")) abort_on_warn = 1;
}
if (_elm_widget_is(sobj))
{
- Smart_Data *sd2 = evas_object_smart_data_get(sobj);
- if (sd2)
+ if (elm_widget_focus_get(sobj))
{
- sd2->parent_obj = NULL;
- if (sd2->resize_obj == sobj)
- sd2->resize_obj = NULL;
- else
- sd->subobjs = eina_list_remove(sd->subobjs, sobj);
+ elm_widget_tree_unfocusable_set(sobj, EINA_TRUE);
+ elm_widget_tree_unfocusable_set(sobj, EINA_FALSE);
}
- 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;
}
}
}
+ Smart_Data *sd2 = evas_object_smart_data_get(sobj);
+ if (sd2)
+ {
+ sd2->parent_obj = NULL;
+ if (sd2->resize_obj == sobj)
+ sd2->resize_obj = NULL;
+ else
+ sd->subobjs = eina_list_remove(sd->subobjs, sobj);
+ }
+ else
+ sd->subobjs = eina_list_remove(sd->subobjs, sobj);
}
else
sd->subobjs = eina_list_remove(sd->subobjs, sobj);
{
API_ENTRY return;
if (!sd->focused) return;
- if (elm_widget_focus_get(sd->resize_obj))
+ if (sd->resize_obj && elm_widget_focus_get(sd->resize_obj))
elm_widget_focused_object_clear(sd->resize_obj);
else
{
Evas_Object *parent_obj, *child_obj;
Evas_Coord px, py, cx, cy;
+ evas_smart_objects_calculate(evas_object_evas_get(obj));
+
API_ENTRY return;
if (!forceshow && (x == sd->rx) && (y == sd->ry)
&& (w == sd->rw) && (h == sd->rh)) return;
{
API_ENTRY return;
sd->scroll_hold--;
- if (sd->scroll_hold < 0) sd->scroll_hold = 0;
if (!sd->scroll_hold)
evas_object_smart_callback_call(obj, "scroll-hold-off", obj);
if (sd->parent_obj) elm_widget_scroll_hold_pop(sd->parent_obj);
+ if (sd->scroll_hold < 0) sd->scroll_hold = 0;
}
EAPI int
{
API_ENTRY return;
sd->scroll_freeze--;
- if (sd->scroll_freeze < 0) sd->scroll_freeze = 0;
if (!sd->scroll_freeze)
evas_object_smart_callback_call(obj, "scroll-freeze-off", obj);
if (sd->parent_obj) elm_widget_scroll_freeze_pop(sd->parent_obj);
+ if (sd->scroll_freeze < 0) sd->scroll_freeze = 0;
}
EAPI int
{
API_ENTRY return;
- if (!sd->on_text_set_func)
+ if (!sd->text_set_func)
return;
- sd->on_text_set_func(obj, part, label);
+ sd->text_set_func(obj, part, label);
}
EAPI const char *
{
API_ENTRY return NULL;
- if (!sd->on_text_get_func)
+ if (!sd->text_get_func)
return NULL;
- return sd->on_text_get_func(obj, part);
+ return sd->text_get_func(obj, part);
}
EAPI void
{
const Eina_List *l;
Evas_Object *child;
+#ifdef HAVE_GETTEXT
Elm_Translate_String_Data *ts;
+#endif
API_ENTRY return;
EINA_LIST_FOREACH(sd->subobjs, l, child) elm_widget_translate(child);
{
API_ENTRY return;
- if (!sd->on_content_set_func) return;
- sd->on_content_set_func(obj, part, content);
+ if (!sd->content_set_func) return;
+ sd->content_set_func(obj, part, content);
}
EAPI Evas_Object *
{
API_ENTRY return NULL;
- if (!sd->on_content_get_func) return NULL;
- return sd->on_content_get_func(obj, part);
+ if (!sd->content_get_func) return NULL;
+ return sd->content_get_func(obj, part);
}
EAPI Evas_Object *
{
API_ENTRY return NULL;
- if (!sd->on_content_unset_func) return NULL;
- return sd->on_content_unset_func(obj, part);
+ if (!sd->content_unset_func) return NULL;
+ return sd->content_unset_func(obj, part);
}
EAPI void
return EINA_FALSE;
}
+static Evas_Object *
+_widget_name_find(const Evas_Object *obj, const char *name, int recurse)
+{
+ Eina_List *l;
+ Evas_Object *child;
+ const char *s;
+ INTERNAL_ENTRY NULL;
+
+ if (!_elm_widget_is(obj)) return NULL;
+ if (sd->resize_obj)
+ {
+ s = evas_object_name_get(sd->resize_obj);
+ if ((s) && (!strcmp(s, name))) return sd->resize_obj;
+ if ((recurse != 0) &&
+ ((child = _widget_name_find(sd->resize_obj, name, recurse - 1))))
+ return child;
+ }
+ EINA_LIST_FOREACH(sd->subobjs, l, child)
+ {
+ s = evas_object_name_get(child);
+ if ((s) && (!strcmp(s, name))) return child;
+ if ((recurse != 0) &&
+ ((child = _widget_name_find(child, name, recurse - 1))))
+ return child;
+ }
+ if (sd->hover_obj)
+ {
+ s = evas_object_name_get(sd->hover_obj);
+ if ((s) && (!strcmp(s, name))) return sd->hover_obj;
+ if ((recurse != 0) &&
+ ((child = _widget_name_find(sd->hover_obj, name, recurse - 1))))
+ return child;
+ }
+ return NULL;
+}
+
+EAPI Evas_Object *
+elm_widget_name_find(const Evas_Object *obj, const char *name, int recurse)
+{
+ API_ENTRY return NULL;
+ if (!name) return NULL;
+ return _widget_name_find(obj, name, recurse);
+}
+
/**
* @internal
*
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
- if (item->del_cb)
- item->del_cb((void *)item->data, item->widget, item);
+ if (item->del_func)
+ item->del_func((void *)item->data, item->widget, item);
+
+ if (item->del_pre_func)
+ item->del_pre_func((Elm_Object_Item *) item);
if (item->view)
evas_object_del(item->view);
/**
* @internal
*
+ * Set the function to notify to widgets when item is being deleted by user.
+ *
+ * This function will complain if there was a callback set already,
+ * however it will set the new one.
+ *
+ * @param item a valid #Elm_Widget_Item to be notified
+ * @see elm_widget_item_del_pre_hook_set() convenience macro.
+ * @ingroup Widget
+ */
+EAPI void
+_elm_widget_item_del_pre_hook_set(Elm_Widget_Item *item, Elm_Widget_Item_Del_Pre_Cb func)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ if ((item->del_pre_func) && (item->del_pre_func != func))
+ WRN("You're replacing a previously set del_pre_cb %p of item %p with %p", item->del_pre_func, item, func);
+ item->del_pre_func = func;
+}
+
+/**
+ * @internal
+ *
* Notify object will be deleted without actually deleting it.
*
* This function will callback Elm_Widget_Item::del_cb if it is set
_elm_widget_item_pre_notify_del(Elm_Widget_Item *item)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
- if (!item->del_cb) return;
- item->del_cb((void *)item->data, item->widget, item);
- item->del_cb = NULL;
+ if (!item->del_func) return;
+ item->del_func((void *)item->data, item->widget, item);
+ item->del_func = NULL;
}
/**
*/
EAPI void
_elm_widget_item_del_cb_set(Elm_Widget_Item *item,
- Evas_Smart_Cb del_cb)
+ Evas_Smart_Cb func)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
- if ((item->del_cb) && (item->del_cb != del_cb))
+ if ((item->del_func) && (item->del_func != func))
WRN("You're replacing a previously set del_cb %p of item %p with %p",
- item->del_cb, item, del_cb);
+ item->del_func, item, func);
- item->del_cb = del_cb;
+ item->del_func = func;
}
/**
return (void *)item->data;
}
+EAPI void
+_elm_widget_item_disabled_set(Elm_Widget_Item *item, Eina_Bool disabled)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+
+ if (item->disabled == disabled) return;
+ item->disabled = !!disabled;
+ if (item->disable_func) item->disable_func(item);
+}
+
+EAPI Eina_Bool
+_elm_widget_item_disabled_get(const Elm_Widget_Item *item)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, EINA_FALSE);
+ return item->disabled;
+}
+
+EAPI void
+_elm_widget_item_disable_set_hook_set(Elm_Widget_Item *item,
+ Elm_Widget_Disable_Set_Cb func)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ item->disable_func = func;
+}
+
typedef struct _Elm_Widget_Item_Tooltip Elm_Widget_Item_Tooltip;
struct _Elm_Widget_Item_Tooltip
}
EAPI Eina_Bool
-_elm_widget_item_tooltip_size_restrict_disable(Elm_Widget_Item *item, Eina_Bool disable)
+_elm_widget_item_tooltip_window_mode_set(Elm_Widget_Item *item, Eina_Bool disable)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, EINA_FALSE);
- return elm_tooltip_size_restrict_disable(item->view, disable);
+ return elm_object_tooltip_window_mode_set(item->view, disable);
}
EAPI Eina_Bool
-_elm_widget_item_tooltip_size_restrict_disabled_get(const Elm_Widget_Item *item)
+_elm_widget_item_tooltip_window_mode_get(const Elm_Widget_Item *item)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, EINA_FALSE);
- return elm_tooltip_size_restrict_disabled_get(item->view);
+ return elm_object_tooltip_window_mode_get(item->view);
}
/**
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);
+ if (!item->content_set_func) return;
+ item->content_set_func((Elm_Object_Item *) item, part, content);
}
EAPI Evas_Object *
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);
+ if (!item->content_get_func) return NULL;
+ return item->content_get_func((Elm_Object_Item *) item, part);
}
EAPI Evas_Object *
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);
+ if (!item->content_unset_func) return NULL;
+ return item->content_unset_func((Elm_Object_Item *) item, part);
}
EAPI void
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);
+ if (!item->text_set_func) return;
+ item->text_set_func((Elm_Object_Item *) item, part, label);
}
EAPI void
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);
+ if (item->signal_emit_func)
+ item->signal_emit_func((Elm_Object_Item *) item, emission, source);
}
EAPI const char *
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);
+ if (!item->text_get_func) return NULL;
+ return item->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_Content_Set_Cb func)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
- item->on_content_set_func = func;
+ item->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_Content_Get_Cb func)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
- item->on_content_get_func = func;
+ item->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_Content_Unset_Cb func)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
- item->on_content_unset_func = func;
+ item->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_Text_Set_Cb func)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
- item->on_text_set_func = func;
+ item->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_Text_Get_Cb func)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
- item->on_text_get_func = func;
+ item->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_Signal_Emit_Cb func)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
- item->on_signal_emit_func = func;
+ item->signal_emit_func = func;
}
EAPI void
Evas_Object *newest = NULL;
unsigned int newest_focus_order = 0;
- INTERNAL_ENTRY
+ INTERNAL_ENTRY;
if (!sd->focused) return;
if (!sd->parent_obj) return;
Edje_Signal_Data *esd;
Elm_Translate_String_Data *ts;
- INTERNAL_ENTRY
+ INTERNAL_ENTRY;
if (sd->del_pre_func) sd->del_pre_func(obj);
if (sd->resize_obj)
Evas_Coord x,
Evas_Coord y)
{
- INTERNAL_ENTRY
+ INTERNAL_ENTRY;
sd->x = x;
sd->y = y;
_smart_reconfigure(sd);
Evas_Coord w,
Evas_Coord h)
{
- INTERNAL_ENTRY
+ INTERNAL_ENTRY;
sd->w = w;
sd->h = h;
_smart_reconfigure(sd);
{
Eina_List *list;
Evas_Object *o;
- INTERNAL_ENTRY
+ INTERNAL_ENTRY;
if ((list = evas_object_smart_members_get(obj)))
{
EINA_LIST_FREE(list, o)
{
Eina_List *list;
Evas_Object *o;
- INTERNAL_ENTRY
+ INTERNAL_ENTRY;
list = evas_object_smart_members_get(obj);
EINA_LIST_FREE(list, o)
{
Eina_List *list;
Evas_Object *o;
- INTERNAL_ENTRY
+ INTERNAL_ENTRY;
if ((list = evas_object_smart_members_get(obj)))
{
EINA_LIST_FREE(list, o)
{
Eina_List *list;
Evas_Object *o;
- INTERNAL_ENTRY
+ INTERNAL_ENTRY;
if ((list = evas_object_smart_members_get(obj)))
{
EINA_LIST_FREE(list, o)
{
Eina_List *list;
Evas_Object *o;
- INTERNAL_ENTRY
+ INTERNAL_ENTRY;
if ((list = evas_object_smart_members_get(obj)))
{
EINA_LIST_FREE(list, o)
static void
_smart_calculate(Evas_Object *obj)
{
- INTERNAL_ENTRY
+ INTERNAL_ENTRY;
if (sd->changed_func) sd->changed_func(obj);
}
if (_elm_widget_is(obj))
{
Eina_List *l;
- INTERNAL_ENTRY
+ INTERNAL_ENTRY;
printf("+ %s(%p)\n",
sd->type,
obj);
{
if (!_elm_widget_is(obj))
return;
- INTERNAL_ENTRY
+ INTERNAL_ENTRY;
Eina_Bool visible = evas_object_visible_get(obj);
Eina_Bool disabled = elm_widget_disabled_get(obj);