actually give widgets type name strings and set parent by default
SVN revision: 40618
This commit is contained in:
parent
0523f39faa
commit
26b4f340b6
|
@ -3734,7 +3734,7 @@ collections {
|
|||
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";
|
||||
|
|
|
@ -129,6 +129,8 @@ elm_anchorblock_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -118,6 +118,8 @@ elm_anchorview_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -159,6 +159,8 @@ elm_hoversel_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -215,6 +215,8 @@ elm_notepad_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -61,6 +61,8 @@ elm_bg_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -65,6 +65,8 @@ elm_box_add(Evas_Object *parent)
|
|||
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);
|
||||
|
||||
|
|
|
@ -89,6 +89,8 @@ elm_bubble_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -107,6 +107,8 @@ elm_button_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -158,6 +158,8 @@ elm_carousel_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -134,6 +134,8 @@ elm_check_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -368,6 +368,8 @@ elm_clock_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -126,13 +126,13 @@ _on_focus_hook(void *data, Evas_Object *obj)
|
|||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -205,10 +205,13 @@ _paste(void *data, Evas_Object *obj, void *event_info)
|
|||
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;
|
||||
}
|
||||
|
@ -265,11 +268,13 @@ static int
|
|||
_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)
|
||||
{
|
||||
|
@ -614,10 +619,12 @@ _signal_selection_start(void *data, Evas_Object *obj, const char *emission, cons
|
|||
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);
|
||||
}
|
||||
|
@ -636,10 +643,12 @@ _signal_selection_changed(void *data, Evas_Object *obj, const char *emission, co
|
|||
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);
|
||||
}
|
||||
|
@ -658,7 +667,10 @@ _signal_selection_cleared(void *data, Evas_Object *obj, const char *emission, co
|
|||
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;
|
||||
|
||||
|
@ -666,8 +678,7 @@ _signal_selection_cleared(void *data, Evas_Object *obj, const char *emission, co
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
@ -678,7 +689,10 @@ _signal_selection_cleared(void *data, Evas_Object *obj, const char *emission, co
|
|||
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
|
||||
}
|
||||
|
@ -693,10 +707,13 @@ _signal_entry_paste_request(void *data, Evas_Object *obj, const char *emission,
|
|||
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;
|
||||
}
|
||||
|
@ -880,13 +897,15 @@ _event_selection_clear(void *data, int type, void *event)
|
|||
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);
|
||||
|
@ -923,7 +942,8 @@ elm_entry_add(Evas_Object *parent)
|
|||
_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,
|
||||
|
|
|
@ -76,6 +76,8 @@ elm_frame_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -792,6 +792,8 @@ elm_genlist_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -258,6 +258,8 @@ elm_hover_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -87,6 +87,8 @@ elm_icon_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -87,6 +87,8 @@ elm_image_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -52,6 +52,8 @@ elm_label_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -102,6 +102,8 @@ elm_layout_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -395,6 +395,8 @@ elm_list_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -173,6 +173,8 @@ elm_pager_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -65,6 +65,8 @@ elm_photo_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -107,6 +107,8 @@ EAPI void elm_widget_scale_set(Evas_Object *obj, double scale);
|
|||
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;
|
||||
|
|
|
@ -151,6 +151,8 @@ elm_radio_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -178,6 +178,8 @@ elm_scroller_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -218,6 +218,8 @@ elm_slider_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -65,6 +65,8 @@ elm_table_add(Evas_Object *parent)
|
|||
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);
|
||||
|
||||
|
|
|
@ -123,6 +123,8 @@ elm_toggle_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -179,6 +179,8 @@ elm_toolbar_add(Evas_Object *parent)
|
|||
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);
|
||||
|
|
|
@ -16,6 +16,7 @@ typedef struct _Smart_Data Smart_Data;
|
|||
struct _Smart_Data
|
||||
{
|
||||
Evas_Object *obj;
|
||||
const char *type;
|
||||
Evas_Object *parent_obj;
|
||||
Evas_Coord x, y, w, h;
|
||||
Eina_List *subobjs;
|
||||
|
@ -74,7 +75,6 @@ _sub_obj_del(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -788,6 +788,24 @@ elm_widget_style_get(const Evas_Object *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)
|
||||
|
@ -850,6 +868,8 @@ _smart_del(Evas_Object *obj)
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -336,6 +336,7 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
|
|||
|
||||
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);
|
||||
|
@ -676,6 +677,8 @@ elm_win_inwin_add(Evas_Object *obj)
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue