styles
{
style { name: "entry_textblock_style";
- base: "font=Sans font_size=10 align=left color=#000 wrap=word";
+ base: "font=Sans font_size=10 align=left color=#000 wrap=word";
tag: "br" "\n";
tag: "tab" "\t";
tag: "em" "+ font=Sans:style=Oblique";
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "anchorblock");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_pre_hook_set(obj, _del_pre_hook);
elm_widget_del_hook_set(obj, _del_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "anchorview");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_pre_hook_set(obj, _del_pre_hook);
elm_widget_del_hook_set(obj, _del_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "hoversel");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_pre_hook_set(obj, _del_pre_hook);
elm_widget_del_hook_set(obj, _del_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "notepad");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "bg");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "box");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "bubble");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "button");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "carousel");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "check");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "clock");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
{
evas_object_focus_set(wd->ent, 1);
edje_object_signal_emit(wd->ent, "elm,action,focus", "elm");
- elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
+ if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
}
else
{
edje_object_signal_emit(wd->ent, "elm,action,unfocus", "elm");
evas_object_focus_set(wd->ent, 0);
- elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF);
+ if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF);
}
}
if (wd->sel_notify_handler)
{
#ifdef HAVE_ELEMENTARY_X
- if (elm_win_xwindow_get(elm_widget_top_get(data)))
+ Evas_Object *top;
+
+ top = elm_widget_top_get(data);
+ if ((top) && (elm_win_xwindow_get(top)))
{
ecore_x_selection_primary_request
- (elm_win_xwindow_get(elm_widget_top_get(data)),
+ (elm_win_xwindow_get(top),
ECORE_X_SELECTION_TARGET_UTF8_STRING);
wd->selection_asked = 1;
}
_long_press(void *data)
{
Widget_Data *wd = elm_widget_data_get(data);
+ Evas_Object *top;
if (wd->hoversel) evas_object_del(wd->hoversel);
wd->hoversel = elm_hoversel_add(data);
elm_widget_sub_object_add(data, wd->hoversel);
elm_hoversel_label_set(wd->hoversel, "Text");
- elm_hoversel_hover_parent_set(wd->hoversel, elm_widget_top_get(data));
+ top = elm_widget_top_get(data);
+ if (top) elm_hoversel_hover_parent_set(wd->hoversel, top);
evas_object_smart_callback_add(wd->hoversel, "dismissed", _dismissed, data);
if (!wd->selmode)
{
if (txt)
{
#ifdef HAVE_ELEMENTARY_X
- if (elm_win_xwindow_get(elm_widget_top_get(data)))
- ecore_x_selection_primary_set
- (elm_win_xwindow_get(elm_widget_top_get(data)),
- txt, strlen(txt));
+ Evas_Object *top;
+
+ top = elm_widget_top_get(data);
+ if ((top) && (elm_win_xwindow_get(top)))
+ ecore_x_selection_primary_set
+ (elm_win_xwindow_get(top), txt, strlen(txt));
#endif
free(txt);
}
if (txt)
{
#ifdef HAVE_ELEMENTARY_X
- if (elm_win_xwindow_get(elm_widget_top_get(data)))
+ Evas_Object *top;
+
+ top = elm_widget_top_get(data);
+ if ((top) && (elm_win_xwindow_get(top)))
ecore_x_selection_primary_set
- (elm_win_xwindow_get(elm_widget_top_get(data)),
- txt, strlen(txt));
+ (elm_win_xwindow_get(top), txt, strlen(txt));
#endif
free(txt);
}
if (wd->cut_sel)
{
#ifdef HAVE_ELEMENTARY_X
- if (elm_win_xwindow_get(elm_widget_top_get(data)))
+ Evas_Object *top;
+
+ top = elm_widget_top_get(data);
+ if ((top) && (elm_win_xwindow_get(top)))
{
char *t;
if (t)
{
ecore_x_selection_primary_set
- (elm_win_xwindow_get(elm_widget_top_get(data)),
- t, strlen(t));
+ (elm_win_xwindow_get(top), t, strlen(t));
free(t);
}
}
else
{
#ifdef HAVE_ELEMENTARY_X
- if (elm_win_xwindow_get(elm_widget_top_get(data)))
+ Evas_Object *top;
+
+ top = elm_widget_top_get(data);
+ if ((top) && (elm_win_xwindow_get(top)))
ecore_x_selection_primary_clear();
#endif
}
if (wd->sel_notify_handler)
{
#ifdef HAVE_ELEMENTARY_X
- if (elm_win_xwindow_get(elm_widget_top_get(data)))
+ Evas_Object *top;
+
+ top = elm_widget_top_get(data);
+ if ((top) && (elm_win_xwindow_get(top)))
{
ecore_x_selection_primary_request
- (elm_win_xwindow_get(elm_widget_top_get(data)),
+ (elm_win_xwindow_get(top),
ECORE_X_SELECTION_TARGET_UTF8_STRING);
wd->selection_asked = 1;
}
EAPI Evas_Object *
elm_entry_add(Evas_Object *parent)
{
- Evas_Object *obj;
+ Evas_Object *obj, *top;
Evas *e;
Widget_Data *wd;
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "entry");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
_sizing_eval(obj);
#ifdef HAVE_ELEMENTARY_X
- if (elm_win_xwindow_get(elm_widget_top_get(parent)) != 0)
+ top = elm_widget_top_get(obj);
+ if ((top) && (elm_win_xwindow_get(top)))
{
wd->sel_notify_handler =
ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY,
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "frame");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "genlist");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "hover");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_pre_hook_set(obj, _del_pre_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "icon");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "image");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "label");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "layout");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "list");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "pager");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "photo");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
EAPI double elm_widget_scale_get(const Evas_Object *obj);
EAPI void elm_widget_style_set(Evas_Object *obj, const char *style);
EAPI const char *elm_widget_style_get(const Evas_Object *obj);
+EAPI void elm_widget_type_set(Evas_Object *obj, const char *type);
+EAPI const char *elm_widget_type_get(const Evas_Object *obj);
extern char *_elm_appname;
extern Elm_Config *_elm_config;
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "radio");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "scroller");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "slider");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "table");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "toggle");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
+ elm_widget_type_set(obj, "toolbar");
+ elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
struct _Smart_Data
{
Evas_Object *obj;
+ const char *type;
Evas_Object *parent_obj;
Evas_Coord x, y, w, h;
Eina_List *subobjs;
{
sd->subobjs = eina_list_remove(sd->subobjs, obj);
}
- if (sd->style) eina_stringshare_del(sd->style);
evas_object_smart_callback_call(sd->obj, "sub-object-del", obj);
}
return "default";
}
+EAPI void
+elm_widget_type_set(Evas_Object *obj, const char *type)
+{
+ const char *old;
+ API_ENTRY return;
+ old = sd->type;
+ sd->type = eina_stringshare_add(type);
+ if (old) eina_stringshare_del(old);
+}
+
+EAPI const char *
+elm_widget_type_get(const Evas_Object *obj)
+{
+ API_ENTRY return "";
+ if (sd->type) return sd->type;
+ return "";
+}
+
/* local subsystem functions */
static void
_smart_reconfigure(Smart_Data *sd)
evas_object_del(sobj);
}
if (sd->del_func) sd->del_func(obj);
+ if (sd->style) eina_stringshare_del(sd->style);
+ if (sd->type) eina_stringshare_del(sd->type);
free(sd);
}
win->evas = ecore_evas_get(win->ee);
win->win_obj = elm_widget_add(win->evas);
+ elm_widget_type_set(win->win_obj, "win");
elm_widget_data_set(win->win_obj, win);
evas_object_color_set(win->win_obj, 0, 0, 0, 0);
evas_object_move(win->win_obj, 0, 0);
if (!win) return NULL;
wd = ELM_NEW(Widget_Data);
obj2 = elm_widget_add(win->evas);
+ elm_widget_type_set(obj2, "inwin");
+ elm_widget_sub_object_add(obj, obj2);
evas_object_size_hint_weight_set(obj2, 1.0, 1.0);
evas_object_size_hint_align_set(obj2, -1.0, -1.0);
elm_win_resize_object_add(obj, obj2);