From fc29e1f502b500318128be6d282063e36dbb8e0f Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Tue, 9 Mar 2010 06:15:39 +0000 Subject: [PATCH] patch from discomfitor <- check type of widget on api call and return if not the right type SVN revision: 47073 --- AUTHORS | 2 +- src/lib/elc_anchorblock.c | 6 ++++ src/lib/elc_anchorview.c | 7 +++++ src/lib/elc_fileselector.c | 11 ++++++++ src/lib/elc_hoversel.c | 13 +++++++++ src/lib/elc_notepad.c | 4 +++ src/lib/elc_scrolled_entry.c | 35 ++++++++++++++++++++++++ src/lib/elm_bg.c | 3 ++ src/lib/elm_box.c | 11 ++++++++ src/lib/elm_bubble.c | 9 ++++++ src/lib/elm_button.c | 9 ++++++ src/lib/elm_carousel.c | 3 ++ src/lib/elm_check.c | 9 ++++++ src/lib/elm_clock.c | 7 +++++ src/lib/elm_conform.c | 3 ++ src/lib/elm_entry.c | 33 ++++++++++++++++++++++ src/lib/elm_flip.c | 7 +++++ src/lib/elm_frame.c | 5 ++++ src/lib/elm_genlist.c | 21 ++++++++++++++ src/lib/elm_hover.c | 12 ++++++++ src/lib/elm_icon.c | 9 ++++++ src/lib/elm_image.c | 10 +++++++ src/lib/elm_index.c | 18 ++++++++++++ src/lib/elm_label.c | 9 ++++++ src/lib/elm_layout.c | 13 +++++++++ src/lib/elm_list.c | 30 ++++++++++++++++++++ src/lib/elm_main.c | 1 + src/lib/elm_map.c | 45 ++++++++++++++++++++++++++++++ src/lib/elm_mapbuf.c | 16 +++++++++++ src/lib/elm_menu.c | 15 ++++++++++ src/lib/elm_notify.c | 19 +++++++++++++ src/lib/elm_pager.c | 14 ++++++++++ src/lib/elm_panel.c | 9 ++++++ src/lib/elm_photo.c | 7 +++++ src/lib/elm_photocam.c | 39 ++++++++++++++++++++++++++ src/lib/elm_priv.h | 3 +- src/lib/elm_progressbar.c | 20 ++++++++++++++ src/lib/elm_radio.c | 19 +++++++++++++ src/lib/elm_scroller.c | 21 ++++++++++++++ src/lib/elm_separator.c | 7 +++++ src/lib/elm_slider.c | 25 +++++++++++++++++ src/lib/elm_slideshow.c | 19 +++++++++++++ src/lib/elm_spinner.c | 36 ++++++++++++++++++++++++ src/lib/elm_table.c | 11 ++++++++ src/lib/elm_toggle.c | 18 ++++++++++++ src/lib/elm_toolbar.c | 15 ++++++++++ src/lib/elm_widget.c | 1 + src/lib/elm_win.c | 53 ++++++++++++++++++++++++++++++++++++ 48 files changed, 710 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index cee771bb2..c99bb2bc7 100644 --- a/AUTHORS +++ b/AUTHORS @@ -10,4 +10,4 @@ Marco Trevisan (Treviño) Michael Bouchaud Jonathan Atton (Watchwolf) Brian Wang - +Mike Blumenkrantz (zmike) diff --git a/src/lib/elc_anchorblock.c b/src/lib/elc_anchorblock.c index a69f360c8..ac2e56ecf 100644 --- a/src/lib/elc_anchorblock.c +++ b/src/lib/elc_anchorblock.c @@ -25,6 +25,7 @@ struct _Widget_Data const char *hover_style; }; +static const char *widtype = NULL; static void _del_pre_hook(Evas_Object *obj); static void _del_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -154,6 +155,7 @@ elm_anchorblock_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "anchorblock"); elm_widget_type_set(obj, "anchorblock"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -193,6 +195,7 @@ elm_anchorblock_add(Evas_Object *parent) EAPI void elm_anchorblock_text_set(Evas_Object *obj, const char *text) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); elm_entry_entry_set(wd->entry, text); if (wd->hover) evas_object_del(wd->hover); @@ -216,6 +219,7 @@ elm_anchorblock_text_set(Evas_Object *obj, const char *text) EAPI void elm_anchorblock_hover_parent_set(Evas_Object *obj, Evas_Object *parent) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->hover_parent) evas_object_event_callback_del_full(wd->hover_parent, EVAS_CALLBACK_DEL, _parent_del, obj); @@ -238,6 +242,7 @@ elm_anchorblock_hover_parent_set(Evas_Object *obj, Evas_Object *parent) EAPI void elm_anchorblock_hover_style_set(Evas_Object *obj, const char *style) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->hover_style) eina_stringshare_del(wd->hover_style); wd->hover_style = NULL; @@ -256,6 +261,7 @@ elm_anchorblock_hover_style_set(Evas_Object *obj, const char *style) EAPI void elm_anchorblock_hover_end(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->hover) evas_object_del(wd->hover); if (wd->pop) evas_object_del(wd->pop); diff --git a/src/lib/elc_anchorview.c b/src/lib/elc_anchorview.c index bc45d168e..7ecbfdbb9 100644 --- a/src/lib/elc_anchorview.c +++ b/src/lib/elc_anchorview.c @@ -22,6 +22,7 @@ struct _Widget_Data const char *hover_style; }; +static const char *widtype = NULL; static void _del_pre_hook(Evas_Object *obj); static void _del_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -138,6 +139,7 @@ elm_anchorview_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "anchorview"); elm_widget_type_set(obj, "anchorview"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -180,6 +182,7 @@ elm_anchorview_add(Evas_Object *parent) EAPI void elm_anchorview_text_set(Evas_Object *obj, const char *text) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); elm_entry_entry_set(wd->entry, text); if (wd->hover) evas_object_del(wd->hover); @@ -203,6 +206,7 @@ elm_anchorview_text_set(Evas_Object *obj, const char *text) EAPI void elm_anchorview_hover_parent_set(Evas_Object *obj, Evas_Object *parent) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->hover_parent) evas_object_event_callback_del_full(wd->hover_parent, EVAS_CALLBACK_DEL, _parent_del, obj); @@ -225,6 +229,7 @@ elm_anchorview_hover_parent_set(Evas_Object *obj, Evas_Object *parent) EAPI void elm_anchorview_hover_style_set(Evas_Object *obj, const char *style) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->hover_style) eina_stringshare_del(wd->hover_style); wd->hover_style = NULL; @@ -243,6 +248,7 @@ elm_anchorview_hover_style_set(Evas_Object *obj, const char *style) EAPI void elm_anchorview_hover_end(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->hover) evas_object_del(wd->hover); if (wd->pop) evas_object_del(wd->pop); @@ -265,6 +271,7 @@ elm_anchorview_hover_end(Evas_Object *obj) EAPI void elm_anchorview_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); elm_scroller_bounce_set(wd->scroller, h_bounce, v_bounce); } diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c index 4d2e05c1d..4063931ce 100644 --- a/src/lib/elc_fileselector.c +++ b/src/lib/elc_fileselector.c @@ -32,6 +32,7 @@ struct _Widget_Data Elm_Genlist_Item_Class itc; +static const char *widtype = NULL; static void _populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent); static void _do_anchors(Evas_Object *obj, const char *path); @@ -336,6 +337,7 @@ elm_fileselector_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); wd->expand = EINA_FALSE; obj = elm_widget_add(evas_object_evas_get(parent)); + ELM_SET_WIDTYPE(widtype, "fileselector"); elm_widget_type_set(obj, "fileselector"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -438,6 +440,7 @@ elm_fileselector_add(Evas_Object *parent) EAPI void elm_fileselector_is_save_set(Evas_Object *obj, Eina_Bool is_save) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (is_save) @@ -462,6 +465,7 @@ elm_fileselector_is_save_set(Evas_Object *obj, Eina_Bool is_save) EAPI Eina_Bool elm_fileselector_is_save_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->entry2 ? EINA_TRUE : EINA_FALSE; } @@ -469,6 +473,7 @@ elm_fileselector_is_save_get(Evas_Object *obj) EAPI void elm_fileselector_folder_only_set(Evas_Object *obj, Eina_Bool only) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if(wd->only_folder == only) return ; @@ -479,6 +484,7 @@ elm_fileselector_folder_only_set(Evas_Object *obj, Eina_Bool only) EAPI Eina_Bool elm_fileselector_only_folder_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->only_folder; } @@ -486,6 +492,7 @@ elm_fileselector_only_folder_get(Evas_Object *obj) EAPI void elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, Eina_Bool only) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Evas_Object *box, *bt; @@ -530,6 +537,7 @@ elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, Eina_Bool only) EAPI Eina_Bool elm_fileselector_ok_cancel_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->buttons.bx ? EINA_TRUE : EINA_FALSE; } @@ -537,6 +545,7 @@ elm_fileselector_ok_cancel_get(Evas_Object *obj) EAPI void elm_fileselector_expandable_set(Evas_Object *obj, Eina_Bool expand) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->expand = expand; } @@ -550,6 +559,7 @@ elm_fileselector_path_set(Evas_Object *obj, const char *path) EAPI const char * elm_fileselector_path_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->path; } @@ -557,6 +567,7 @@ elm_fileselector_path_get(Evas_Object *obj) EAPI const char* elm_fileselector_selected_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Elm_Genlist_Item *it; diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c index 08569e7be..1c6017754 100644 --- a/src/lib/elc_hoversel.c +++ b/src/lib/elc_hoversel.c @@ -41,6 +41,7 @@ struct _Elm_Hoversel_Item void *data; }; +static const char *widtype = NULL; static void _del_pre_hook(Evas_Object *obj); static void _del_hook(Evas_Object *obj); static void _disable_hook(Evas_Object *obj); @@ -243,6 +244,7 @@ elm_hoversel_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "hoversel"); elm_widget_type_set(obj, "hoversel"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -278,6 +280,7 @@ elm_hoversel_add(Evas_Object *parent) EAPI void elm_hoversel_hover_parent_set(Evas_Object *obj, Evas_Object *parent) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -304,6 +307,7 @@ elm_hoversel_hover_parent_set(Evas_Object *obj, Evas_Object *parent) EAPI void elm_hoversel_label_set(Evas_Object *obj, const char *label) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -313,6 +317,7 @@ elm_hoversel_label_set(Evas_Object *obj, const char *label) EAPI void elm_hoversel_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->horizontal = !!horizontal; } @@ -328,6 +333,7 @@ elm_hoversel_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) EAPI const char* elm_hoversel_label_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if ((!wd) || (!wd->btn)) return NULL; @@ -348,6 +354,7 @@ elm_hoversel_label_get(Evas_Object *obj) EAPI void elm_hoversel_icon_set(Evas_Object *obj, Evas_Object *icon) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -368,6 +375,7 @@ elm_hoversel_icon_set(Evas_Object *obj, Evas_Object *icon) EAPI Evas_Object * elm_hoversel_icon_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if ((!wd) || (!wd->btn)) return NULL; @@ -386,6 +394,7 @@ elm_hoversel_icon_get(Evas_Object *obj) EAPI void elm_hoversel_hover_begin(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -405,6 +414,7 @@ elm_hoversel_hover_begin(Evas_Object *obj) EAPI void elm_hoversel_hover_end(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -429,6 +439,7 @@ elm_hoversel_clear(Evas_Object *obj) { Elm_Hoversel_Item *it; Eina_List *l, *ll; + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -449,6 +460,7 @@ elm_hoversel_items_get(Evas_Object *obj) { Elm_Hoversel_Item *it; Eina_List *l, *ll; + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; @@ -476,6 +488,7 @@ elm_hoversel_items_get(Evas_Object *obj) EAPI Elm_Hoversel_Item * elm_hoversel_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; Elm_Hoversel_Item *it = calloc(1, sizeof(Elm_Hoversel_Item)); diff --git a/src/lib/elc_notepad.c b/src/lib/elc_notepad.c index 2550ccdf8..1cff2e26f 100644 --- a/src/lib/elc_notepad.c +++ b/src/lib/elc_notepad.c @@ -28,6 +28,7 @@ struct _Widget_Data Eina_Bool auto_write : 1; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); static void _on_focus_hook(void *data, Evas_Object *obj); @@ -269,6 +270,7 @@ elm_notepad_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "notepad"); elm_widget_type_set(obj, "notepad"); elm_widget_sub_object_add(parent, obj); elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); @@ -313,6 +315,7 @@ elm_notepad_add(Evas_Object *parent) EAPI void elm_notepad_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->delay_write) { @@ -342,6 +345,7 @@ elm_notepad_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format) EAPI void elm_notepad_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); elm_scroller_bounce_set(wd->scr, h_bounce, v_bounce); } diff --git a/src/lib/elc_scrolled_entry.c b/src/lib/elc_scrolled_entry.c index bdeb88cdc..9854486c3 100644 --- a/src/lib/elc_scrolled_entry.c +++ b/src/lib/elc_scrolled_entry.c @@ -10,6 +10,7 @@ struct _Widget_Data Elm_Scroller_Policy policy_h, policy_v; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj) { @@ -140,6 +141,7 @@ elm_scrolled_entry_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "scrolled_entry"); elm_widget_type_set(obj, "scrolled_entry"); elm_widget_sub_object_add(parent, obj); elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); @@ -180,6 +182,7 @@ elm_scrolled_entry_add(Evas_Object *parent) EAPI void elm_scrolled_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_single_line_set(wd->entry, single_line); @@ -198,6 +201,7 @@ elm_scrolled_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line) EAPI void elm_scrolled_entry_password_set(Evas_Object *obj, Eina_Bool password) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_password_set(wd->entry, password); @@ -206,6 +210,7 @@ elm_scrolled_entry_password_set(Evas_Object *obj, Eina_Bool password) EAPI void elm_scrolled_entry_entry_set(Evas_Object *obj, const char *entry) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_entry_set(wd->entry, entry); @@ -214,6 +219,7 @@ elm_scrolled_entry_entry_set(Evas_Object *obj, const char *entry) EAPI const char * elm_scrolled_entry_entry_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; return elm_entry_entry_get(wd->entry); @@ -222,6 +228,7 @@ elm_scrolled_entry_entry_get(const Evas_Object *obj) EAPI const char * elm_scrolled_entry_selection_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; return elm_entry_selection_get(wd->entry); @@ -230,6 +237,7 @@ elm_scrolled_entry_selection_get(const Evas_Object *obj) EAPI void elm_scrolled_entry_entry_insert(Evas_Object *obj, const char *entry) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_entry_insert(wd->entry, entry); @@ -238,6 +246,7 @@ elm_scrolled_entry_entry_insert(Evas_Object *obj, const char *entry) EAPI void elm_scrolled_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_line_wrap_set(wd->entry, wrap); @@ -246,6 +255,7 @@ elm_scrolled_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap) EAPI void elm_scrolled_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_line_char_wrap_set(wd->entry, wrap); @@ -254,6 +264,7 @@ elm_scrolled_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap) EAPI void elm_scrolled_entry_editable_set(Evas_Object *obj, Eina_Bool editable) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_editable_set(wd->entry, editable); @@ -262,6 +273,7 @@ elm_scrolled_entry_editable_set(Evas_Object *obj, Eina_Bool editable) EAPI void elm_scrolled_entry_select_none(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_select_none(wd->entry); @@ -270,6 +282,7 @@ elm_scrolled_entry_select_none(Evas_Object *obj) EAPI void elm_scrolled_entry_select_all(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_select_all(wd->entry); @@ -278,6 +291,7 @@ elm_scrolled_entry_select_all(Evas_Object *obj) EAPI Eina_Bool elm_scrolled_entry_cursor_next(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return 0; return elm_entry_cursor_next(wd->entry); @@ -286,6 +300,7 @@ elm_scrolled_entry_cursor_next(Evas_Object *obj) EAPI Eina_Bool elm_scrolled_entry_cursor_prev(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return 0; return elm_entry_cursor_prev(wd->entry); @@ -294,6 +309,7 @@ elm_scrolled_entry_cursor_prev(Evas_Object *obj) EAPI Eina_Bool elm_scrolled_entry_cursor_up(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return 0; return elm_entry_cursor_up(wd->entry); @@ -302,6 +318,7 @@ elm_scrolled_entry_cursor_up(Evas_Object *obj) EAPI Eina_Bool elm_scrolled_entry_cursor_down(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return 0; return elm_entry_cursor_down(wd->entry); @@ -310,6 +327,7 @@ elm_scrolled_entry_cursor_down(Evas_Object *obj) EAPI void elm_scrolled_entry_cursor_begin_set(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_cursor_begin_set(wd->entry); @@ -318,6 +336,7 @@ elm_scrolled_entry_cursor_begin_set(Evas_Object *obj) EAPI void elm_scrolled_entry_cursor_end_set(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_cursor_end_set(wd->entry); @@ -326,6 +345,7 @@ elm_scrolled_entry_cursor_end_set(Evas_Object *obj) EAPI void elm_scrolled_entry_cursor_line_begin_set(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_cursor_line_begin_set(wd->entry); @@ -334,6 +354,7 @@ elm_scrolled_entry_cursor_line_begin_set(Evas_Object *obj) EAPI void elm_scrolled_entry_cursor_line_end_set(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_cursor_line_end_set(wd->entry); @@ -342,6 +363,7 @@ elm_scrolled_entry_cursor_line_end_set(Evas_Object *obj) EAPI void elm_scrolled_entry_cursor_selection_begin(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_cursor_selection_begin(wd->entry); @@ -350,6 +372,7 @@ elm_scrolled_entry_cursor_selection_begin(Evas_Object *obj) EAPI void elm_scrolled_entry_cursor_selection_end(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_cursor_selection_end(wd->entry); @@ -358,6 +381,7 @@ elm_scrolled_entry_cursor_selection_end(Evas_Object *obj) EAPI Eina_Bool elm_scrolled_entry_cursor_is_format_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return 0; return elm_entry_cursor_is_format_get(wd->entry); @@ -366,6 +390,7 @@ elm_scrolled_entry_cursor_is_format_get(Evas_Object *obj) EAPI Eina_Bool elm_scrolled_entry_cursor_is_visible_format_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return 0; return elm_entry_cursor_is_visible_format_get(wd->entry); @@ -374,6 +399,7 @@ elm_scrolled_entry_cursor_is_visible_format_get(Evas_Object *obj) EAPI const char * elm_scrolled_entry_cursor_content_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; return elm_entry_cursor_content_get(wd->entry); @@ -382,6 +408,7 @@ elm_scrolled_entry_cursor_content_get(Evas_Object *obj) EAPI void elm_scrolled_entry_selection_cut(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_selection_cut(wd->entry); @@ -390,6 +417,7 @@ elm_scrolled_entry_selection_cut(Evas_Object *obj) EAPI void elm_scrolled_entry_selection_copy(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_selection_copy(wd->entry); @@ -398,6 +426,7 @@ elm_scrolled_entry_selection_copy(Evas_Object *obj) EAPI void elm_scrolled_entry_selection_paste(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_selection_paste(wd->entry); @@ -406,6 +435,7 @@ elm_scrolled_entry_selection_paste(Evas_Object *obj) EAPI void elm_scrolled_entry_context_menu_clear(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_context_menu_clear(wd->entry); @@ -414,6 +444,7 @@ elm_scrolled_entry_context_menu_clear(Evas_Object *obj) EAPI void elm_scrolled_entry_context_menu_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_context_menu_item_add(wd->entry, label, icon_file, icon_type, func, data); @@ -422,6 +453,7 @@ elm_scrolled_entry_context_menu_item_add(Evas_Object *obj, const char *label, co EAPI void elm_scrolled_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_entry_context_menu_disabled_set(wd->entry, disabled); @@ -430,6 +462,7 @@ elm_scrolled_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disable EAPI Eina_Bool elm_scrolled_entry_context_menu_disabled_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return 0; return elm_entry_context_menu_disabled_get(wd->entry); @@ -438,6 +471,7 @@ elm_scrolled_entry_context_menu_disabled_get(Evas_Object *obj) EAPI void elm_scrolled_entry_scrollbar_policy_set(Evas_Object *obj, Elm_Scroller_Policy h, Elm_Scroller_Policy v) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; wd->policy_h = h; @@ -448,6 +482,7 @@ elm_scrolled_entry_scrollbar_policy_set(Evas_Object *obj, Elm_Scroller_Policy h, EAPI void elm_scrolled_entry_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_scroller_bounce_set(wd->scroller, h_bounce, v_bounce); diff --git a/src/lib/elm_bg.c b/src/lib/elm_bg.c index a2ce0948e..16b699aae 100644 --- a/src/lib/elm_bg.c +++ b/src/lib/elm_bg.c @@ -18,6 +18,7 @@ struct _Widget_Data const char *file, *group; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _custom_resize(void *data, Evas *a, Evas_Object *obj, void *event_info); @@ -77,6 +78,7 @@ elm_bg_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "bg"); elm_widget_type_set(obj, "bg"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -106,6 +108,7 @@ elm_bg_add(Evas_Object *parent) EAPI void elm_bg_file_set(Evas_Object *obj, const char *file, const char *group) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); const char *p; diff --git a/src/lib/elm_box.c b/src/lib/elm_box.c index ac78b0428..4e92da6af 100644 --- a/src/lib/elm_box.c +++ b/src/lib/elm_box.c @@ -25,6 +25,7 @@ struct _Widget_Data Eina_Bool homogeneous:1; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info); @@ -105,6 +106,7 @@ elm_box_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "box"); elm_widget_type_set(obj, "box"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -140,6 +142,7 @@ elm_box_add(Evas_Object *parent) EAPI void elm_box_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->horizontal = !!horizontal; evas_object_smart_calculate(wd->box); @@ -177,6 +180,7 @@ elm_box_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) EAPI void elm_box_homogenous_set(Evas_Object *obj, Eina_Bool homogenous) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->homogeneous = !!homogenous; evas_object_smart_calculate(wd->box); @@ -214,6 +218,7 @@ elm_box_homogenous_set(Evas_Object *obj, Eina_Bool homogenous) EAPI void elm_box_pack_start(Evas_Object *obj, Evas_Object *subobj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); elm_widget_sub_object_add(obj, subobj); evas_object_box_prepend(wd->box, subobj); @@ -233,6 +238,7 @@ elm_box_pack_start(Evas_Object *obj, Evas_Object *subobj) EAPI void elm_box_pack_end(Evas_Object *obj, Evas_Object *subobj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); elm_widget_sub_object_add(obj, subobj); evas_object_box_append(wd->box, subobj); @@ -255,6 +261,7 @@ elm_box_pack_end(Evas_Object *obj, Evas_Object *subobj) EAPI void elm_box_pack_before(Evas_Object *obj, Evas_Object *subobj, Evas_Object *before) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); elm_widget_sub_object_add(obj, subobj); evas_object_box_insert_before(wd->box, subobj, before); @@ -277,6 +284,7 @@ elm_box_pack_before(Evas_Object *obj, Evas_Object *subobj, Evas_Object *before) EAPI void elm_box_pack_after(Evas_Object *obj, Evas_Object *subobj, Evas_Object *after) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); elm_widget_sub_object_add(obj, subobj); evas_object_box_insert_after(wd->box, subobj, after); @@ -294,6 +302,7 @@ elm_box_pack_after(Evas_Object *obj, Evas_Object *subobj, Evas_Object *after) EAPI void elm_box_clear(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); evas_object_box_remove_all(wd->box, 1); } @@ -311,6 +320,7 @@ elm_box_clear(Evas_Object *obj) EAPI void elm_box_unpack(Evas_Object *obj, Evas_Object *subobj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); evas_object_box_remove(wd->box, subobj); } @@ -328,6 +338,7 @@ elm_box_unpack(Evas_Object *obj, Evas_Object *subobj) EAPI void elm_box_unpack_all(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); evas_object_box_remove_all(wd->box, 0); } diff --git a/src/lib/elm_bubble.c b/src/lib/elm_bubble.c index 21b5670dd..9ae6fda03 100644 --- a/src/lib/elm_bubble.c +++ b/src/lib/elm_bubble.c @@ -17,6 +17,7 @@ struct _Widget_Data const char *label, *info; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -94,6 +95,7 @@ elm_bubble_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "bubble"); elm_widget_type_set(obj, "bubble"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -124,6 +126,7 @@ elm_bubble_add(Evas_Object *parent) EAPI void elm_bubble_label_set(Evas_Object *obj, const char *label) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->label) eina_stringshare_del(wd->label); if (label) wd->label = eina_stringshare_add(label); @@ -135,6 +138,7 @@ elm_bubble_label_set(Evas_Object *obj, const char *label) EAPI const char* elm_bubble_label_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->label; @@ -156,6 +160,7 @@ elm_bubble_label_get(Evas_Object *obj) EAPI void elm_bubble_info_set(Evas_Object *obj, const char *info) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->info) eina_stringshare_del(wd->info); if (info) wd->info = eina_stringshare_add(info); @@ -178,6 +183,7 @@ elm_bubble_info_set(Evas_Object *obj, const char *info) EAPI void elm_bubble_content_set(Evas_Object *obj, Evas_Object *content) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if ((wd->content != content) && (wd->content)) elm_widget_sub_object_del(obj, wd->content); @@ -206,6 +212,7 @@ elm_bubble_content_set(Evas_Object *obj, Evas_Object *content) EAPI void elm_bubble_icon_set(Evas_Object *obj, Evas_Object *icon) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if ((wd->icon != icon) && (wd->icon)) elm_widget_sub_object_del(obj, wd->icon); @@ -223,6 +230,7 @@ elm_bubble_icon_set(Evas_Object *obj, Evas_Object *icon) EAPI Evas_Object * elm_bubble_icon_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->icon; @@ -241,6 +249,7 @@ elm_bubble_icon_get(Evas_Object *obj) EAPI void elm_bubble_corner_set(Evas_Object *obj, const char *corner) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); _elm_theme_set(wd->bbl, "bubble", corner, elm_widget_style_get(obj)); if (wd->icon) diff --git a/src/lib/elm_button.c b/src/lib/elm_button.c index ab87d140f..ff665b511 100644 --- a/src/lib/elm_button.c +++ b/src/lib/elm_button.c @@ -26,6 +26,7 @@ struct _Widget_Data Ecore_Timer *timer; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _disable_hook(Evas_Object *obj); @@ -210,6 +211,7 @@ elm_button_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "button"); elm_widget_type_set(obj, "button"); elm_widget_sub_object_add(parent, obj); elm_widget_on_focus_hook_set( obj, _on_focus_hook, NULL ); @@ -246,6 +248,7 @@ elm_button_add(Evas_Object *parent) EAPI void elm_button_label_set(Evas_Object *obj, const char *label) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord mw, mh; @@ -269,6 +272,7 @@ elm_button_label_set(Evas_Object *obj, const char *label) EAPI const char* elm_button_label_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->label; @@ -285,6 +289,7 @@ elm_button_label_get(Evas_Object *obj) EAPI void elm_button_icon_set(Evas_Object *obj, Evas_Object *icon) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if ((wd->icon != icon) && (wd->icon)) @@ -307,6 +312,7 @@ elm_button_icon_set(Evas_Object *obj, Evas_Object *icon) EAPI Evas_Object * elm_button_icon_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->icon; @@ -339,6 +345,7 @@ elm_button_style_set(Evas_Object *obj, const char *style) EAPI void elm_button_autorepeat_set(Evas_Object *obj, Eina_Bool on) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -360,6 +367,7 @@ elm_button_autorepeat_set(Evas_Object *obj, Eina_Bool on) EAPI void elm_button_autorepeat_initital_timeout_set(Evas_Object *obj, double t) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -386,6 +394,7 @@ elm_button_autorepeat_initital_timeout_set(Evas_Object *obj, double t) EAPI void elm_button_autorepeat_gap_timeout_set(Evas_Object *obj, double t) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; diff --git a/src/lib/elm_carousel.c b/src/lib/elm_carousel.c index 4351164d8..5f7b0680e 100644 --- a/src/lib/elm_carousel.c +++ b/src/lib/elm_carousel.c @@ -21,6 +21,7 @@ struct _Elm_Carousel_Item Eina_Bool selected : 1; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -159,6 +160,7 @@ elm_carousel_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "carousel"); elm_widget_type_set(obj, "carousel"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -192,6 +194,7 @@ elm_carousel_add(Evas_Object *parent) EAPI Elm_Carousel_Item * elm_carousel_item_add(Evas_Object *obj, Evas_Object *icon, const char *label, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord mw, mh; Elm_Carousel_Item *it = calloc(1, sizeof(Elm_Carousel_Item)); diff --git a/src/lib/elm_check.c b/src/lib/elm_check.c index 0e996f636..e330981ea 100644 --- a/src/lib/elm_check.c +++ b/src/lib/elm_check.c @@ -29,6 +29,7 @@ struct _Widget_Data const char *label; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _disable_hook(Evas_Object *obj); @@ -169,6 +170,7 @@ elm_check_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "check"); elm_widget_type_set(obj, "check"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -203,6 +205,7 @@ elm_check_add(Evas_Object *parent) EAPI void elm_check_label_set(Evas_Object *obj, const char *label) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord mw, mh; @@ -233,6 +236,7 @@ elm_check_label_set(Evas_Object *obj, const char *label) EAPI const char* elm_check_label_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->label; @@ -254,6 +258,7 @@ elm_check_label_get(Evas_Object *obj) EAPI void elm_check_icon_set(Evas_Object *obj, Evas_Object *icon) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if ((wd->icon != icon) && (wd->icon)) elm_widget_sub_object_del(obj, wd->icon); @@ -280,6 +285,7 @@ elm_check_icon_set(Evas_Object *obj, Evas_Object *icon) EAPI Evas_Object * elm_check_icon_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->icon; @@ -299,6 +305,7 @@ elm_check_icon_get(Evas_Object *obj) EAPI void elm_check_state_set(Evas_Object *obj, Eina_Bool state) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (state != wd->state) { @@ -322,6 +329,7 @@ elm_check_state_set(Evas_Object *obj, Eina_Bool state) EAPI Eina_Bool elm_check_state_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->state; } @@ -344,6 +352,7 @@ elm_check_state_get(const Evas_Object *obj) EAPI void elm_check_state_pointer_set(Evas_Object *obj, Eina_Bool *statep) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (statep) { diff --git a/src/lib/elm_clock.c b/src/lib/elm_clock.c index 9a141c31e..872745244 100644 --- a/src/lib/elm_clock.c +++ b/src/lib/elm_clock.c @@ -31,6 +31,7 @@ struct _Widget_Data } cur; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static int _ticker(void *data); @@ -389,6 +390,7 @@ elm_clock_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "clock"); elm_widget_type_set(obj, "clock"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -424,6 +426,7 @@ elm_clock_add(Evas_Object *parent) EAPI void elm_clock_time_set(Evas_Object *obj, int hrs, int min, int sec) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->hrs = hrs; wd->min = min; @@ -450,6 +453,7 @@ elm_clock_time_set(Evas_Object *obj, int hrs, int min, int sec) EAPI void elm_clock_time_get(const Evas_Object *obj, int *hrs, int *min, int *sec) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (hrs) *hrs = wd->hrs; if (min) *min = wd->min; @@ -469,6 +473,7 @@ elm_clock_time_get(const Evas_Object *obj, int *hrs, int *min, int *sec) EAPI void elm_clock_edit_set(Evas_Object *obj, Eina_Bool edit) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->edit = edit; _time_update(obj); @@ -491,6 +496,7 @@ elm_clock_edit_set(Evas_Object *obj, Eina_Bool edit) EAPI void elm_clock_show_am_pm_set(Evas_Object *obj, Eina_Bool am_pm) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->am_pm = am_pm; _time_update(obj); @@ -511,6 +517,7 @@ elm_clock_show_am_pm_set(Evas_Object *obj, Eina_Bool am_pm) EAPI void elm_clock_show_seconds_set(Evas_Object *obj, Eina_Bool seconds) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->seconds = seconds; _time_update(obj); diff --git a/src/lib/elm_conform.c b/src/lib/elm_conform.c index 88b434f64..9ff534e43 100644 --- a/src/lib/elm_conform.c +++ b/src/lib/elm_conform.c @@ -25,6 +25,7 @@ struct _Widget_Data }; /* local function prototypes */ +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -218,6 +219,7 @@ elm_conformant_add(Evas_Object *parent) evas = evas_object_evas_get(parent); obj = elm_widget_add(evas); + ELM_SET_WIDTYPE(widtype, "conform"); elm_widget_type_set(obj, "conformant"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -274,6 +276,7 @@ elm_conformant_add(Evas_Object *parent) EAPI void elm_conformant_content_set(Evas_Object *obj, Evas_Object *content) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if ((wd->content != content) && (wd->content)) diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index 5455931c6..3680dccbb 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -46,6 +46,7 @@ struct _Elm_Entry_Context_Menu_Item void *data; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _disable_hook(Evas_Object *obj); @@ -1091,6 +1092,7 @@ elm_entry_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "entry"); elm_widget_type_set(obj, "entry"); elm_widget_sub_object_add(parent, obj); elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); @@ -1181,6 +1183,7 @@ elm_entry_add(Evas_Object *parent) EAPI void elm_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); const char *t; @@ -1198,6 +1201,7 @@ elm_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line) EAPI void elm_entry_password_set(Evas_Object *obj, Eina_Bool password) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); const char *t; @@ -1216,6 +1220,7 @@ elm_entry_password_set(Evas_Object *obj, Eina_Bool password) EAPI void elm_entry_entry_set(Evas_Object *obj, const char *entry) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!entry) entry = "
"; @@ -1227,6 +1232,7 @@ elm_entry_entry_set(Evas_Object *obj, const char *entry) EAPI const char * elm_entry_entry_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); const char *text, *s = NULL; size_t len; @@ -1257,6 +1263,7 @@ elm_entry_entry_get(const Evas_Object *obj) EAPI const char * elm_entry_selection_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; @@ -1266,6 +1273,7 @@ elm_entry_selection_get(const Evas_Object *obj) EAPI void elm_entry_entry_insert(Evas_Object *obj, const char *entry) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); edje_object_part_text_insert(wd->ent, "elm.text", entry); @@ -1276,6 +1284,7 @@ elm_entry_entry_insert(Evas_Object *obj, const char *entry) EAPI void elm_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); const char *t; @@ -1293,6 +1302,7 @@ elm_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap) EAPI void elm_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); const char *t; @@ -1310,6 +1320,7 @@ elm_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap) EAPI void elm_entry_editable_set(Evas_Object *obj, Eina_Bool editable) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); const char *t; @@ -1325,6 +1336,7 @@ elm_entry_editable_set(Evas_Object *obj, Eina_Bool editable) EAPI void elm_entry_select_none(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->selmode) @@ -1340,6 +1352,7 @@ elm_entry_select_none(Evas_Object *obj) EAPI void elm_entry_select_all(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->selmode) @@ -1355,6 +1368,7 @@ elm_entry_select_all(Evas_Object *obj) EAPI Eina_Bool elm_entry_cursor_next(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return edje_object_part_text_cursor_next(wd->ent, "elm.text", EDJE_CURSOR_MAIN); } @@ -1362,6 +1376,7 @@ elm_entry_cursor_next(Evas_Object *obj) EAPI Eina_Bool elm_entry_cursor_prev(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return edje_object_part_text_cursor_prev(wd->ent, "elm.text", EDJE_CURSOR_MAIN); } @@ -1369,6 +1384,7 @@ elm_entry_cursor_prev(Evas_Object *obj) EAPI Eina_Bool elm_entry_cursor_up(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return edje_object_part_text_cursor_up(wd->ent, "elm.text", EDJE_CURSOR_MAIN); } @@ -1376,6 +1392,7 @@ elm_entry_cursor_up(Evas_Object *obj) EAPI Eina_Bool elm_entry_cursor_down(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return edje_object_part_text_cursor_down(wd->ent, "elm.text", EDJE_CURSOR_MAIN); } @@ -1383,6 +1400,7 @@ elm_entry_cursor_down(Evas_Object *obj) EAPI void elm_entry_cursor_begin_set(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); edje_object_part_text_cursor_begin_set(wd->ent, "elm.text", EDJE_CURSOR_MAIN); } @@ -1390,6 +1408,7 @@ elm_entry_cursor_begin_set(Evas_Object *obj) EAPI void elm_entry_cursor_end_set(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); edje_object_part_text_cursor_end_set(wd->ent, "elm.text", EDJE_CURSOR_MAIN); } @@ -1397,6 +1416,7 @@ elm_entry_cursor_end_set(Evas_Object *obj) EAPI void elm_entry_cursor_line_begin_set(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); edje_object_part_text_cursor_line_begin_set(wd->ent, "elm.text", EDJE_CURSOR_MAIN); } @@ -1404,6 +1424,7 @@ elm_entry_cursor_line_begin_set(Evas_Object *obj) EAPI void elm_entry_cursor_line_end_set(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); edje_object_part_text_cursor_line_end_set(wd->ent, "elm.text", EDJE_CURSOR_MAIN); } @@ -1411,6 +1432,7 @@ elm_entry_cursor_line_end_set(Evas_Object *obj) EAPI void elm_entry_cursor_selection_begin(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); edje_object_part_text_select_all(wd->ent, "elm.text"); edje_object_part_text_cursor_copy(wd->ent, "elm.text", EDJE_CURSOR_MAIN, EDJE_CURSOR_SELECTION_BEGIN); @@ -1420,6 +1442,7 @@ elm_entry_cursor_selection_begin(Evas_Object *obj) EAPI void elm_entry_cursor_selection_end(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); edje_object_part_text_cursor_copy(wd->ent, "elm.text", EDJE_CURSOR_MAIN, EDJE_CURSOR_SELECTION_END); } @@ -1427,6 +1450,7 @@ elm_entry_cursor_selection_end(Evas_Object *obj) EAPI Eina_Bool elm_entry_cursor_is_format_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return edje_object_part_text_cursor_is_format_get(wd->ent, "elm.text", EDJE_CURSOR_MAIN); } @@ -1434,6 +1458,7 @@ elm_entry_cursor_is_format_get(Evas_Object *obj) EAPI Eina_Bool elm_entry_cursor_is_visible_format_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return edje_object_part_text_cursor_is_visible_format_get(wd->ent, "elm.text", EDJE_CURSOR_MAIN); } @@ -1441,6 +1466,7 @@ elm_entry_cursor_is_visible_format_get(Evas_Object *obj) EAPI const char * elm_entry_cursor_content_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return edje_object_part_text_cursor_content_get(wd->ent, "elm.text", EDJE_CURSOR_MAIN); } @@ -1448,6 +1474,7 @@ elm_entry_cursor_content_get(Evas_Object *obj) EAPI void elm_entry_selection_cut(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); _cut(obj, NULL, NULL); } @@ -1455,6 +1482,7 @@ elm_entry_selection_cut(Evas_Object *obj) EAPI void elm_entry_selection_copy(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); _copy(obj, NULL, NULL); } @@ -1462,6 +1490,7 @@ elm_entry_selection_copy(Evas_Object *obj) EAPI void elm_entry_selection_paste(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); _paste(obj, NULL, NULL); } @@ -1469,6 +1498,7 @@ elm_entry_selection_paste(Evas_Object *obj) EAPI void elm_entry_context_menu_clear(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Eina_List *l; Elm_Entry_Context_Menu_Item *it; @@ -1486,6 +1516,7 @@ elm_entry_context_menu_clear(Evas_Object *obj) EAPI void elm_entry_context_menu_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Elm_Entry_Context_Menu_Item *it; @@ -1504,6 +1535,7 @@ elm_entry_context_menu_item_add(Evas_Object *obj, const char *label, const char EAPI void elm_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (wd->context_menu == !disabled) return; @@ -1513,6 +1545,7 @@ elm_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled) EAPI Eina_Bool elm_entry_context_menu_disabled_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return EINA_FALSE; return !wd->context_menu; diff --git a/src/lib/elm_flip.c b/src/lib/elm_flip.c index 7c5d6b0af..87beafe7a 100644 --- a/src/lib/elm_flip.c +++ b/src/lib/elm_flip.c @@ -21,6 +21,7 @@ struct _Widget_Data Eina_Bool state : 1; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -276,6 +277,7 @@ elm_flip_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "flip"); elm_widget_type_set(obj, "flip"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -317,6 +319,7 @@ elm_flip_add(Evas_Object *parent) EAPI void elm_flip_content_front_set(Evas_Object *obj, Evas_Object *content) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->front.content == content) return; @@ -355,6 +358,7 @@ elm_flip_content_front_set(Evas_Object *obj, Evas_Object *content) EAPI void elm_flip_content_back_set(Evas_Object *obj, Evas_Object *content) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->back.content == content) return; @@ -393,6 +397,7 @@ elm_flip_content_back_set(Evas_Object *obj, Evas_Object *content) EAPI Eina_Bool elm_flip_front_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->state; } @@ -400,12 +405,14 @@ elm_flip_front_get(Evas_Object *obj) EAPI void elm_flip_perspective_set(Evas_Object *obj, Evas_Coord foc, Evas_Coord x, Evas_Coord y) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); } EAPI void elm_flip_go(Evas_Object *obj, Elm_Flip_Mode mode) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd->animator) wd->animator = ecore_animator_add(_animate, obj); wd->mode = mode; diff --git a/src/lib/elm_frame.c b/src/lib/elm_frame.c index efab38fbe..a60c39468 100644 --- a/src/lib/elm_frame.c +++ b/src/lib/elm_frame.c @@ -16,6 +16,7 @@ struct _Widget_Data Evas_Object *content; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -94,6 +95,7 @@ elm_frame_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "frame"); elm_widget_type_set(obj, "frame"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -121,6 +123,7 @@ elm_frame_add(Evas_Object *parent) EAPI void elm_frame_label_set(Evas_Object *obj, const char *label) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); edje_object_part_text_set(wd->frm, "elm.text", label); @@ -139,6 +142,7 @@ elm_frame_label_set(Evas_Object *obj, const char *label) EAPI const char* elm_frame_label_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if ((!wd) || (!wd->frm)) return NULL; @@ -156,6 +160,7 @@ elm_frame_label_get(Evas_Object *obj) EAPI void elm_frame_content_set(Evas_Object *obj, Evas_Object *content) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if ((wd->content != content) && (wd->content)) diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index ad455fc05..5ef121742 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -333,6 +333,7 @@ struct _Pan Widget_Data *wd; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _show_region_hook(void *data, Evas_Object *obj); @@ -1439,6 +1440,7 @@ elm_genlist_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "genlist"); elm_widget_type_set(obj, "genlist"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -1734,6 +1736,7 @@ elm_genlist_item_append(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, Elm_Genlist_Item_Flags flags, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func, func_data); @@ -1785,6 +1788,7 @@ elm_genlist_item_prepend(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, Elm_Genlist_Item_Flags flags, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func, func_data); @@ -1824,6 +1828,7 @@ elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class *i Elm_Genlist_Item_Flags flags, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Elm_Genlist_Item *it = _item_new(wd, itc, data, NULL, flags, func, func_data); @@ -1865,6 +1870,7 @@ elm_genlist_item_insert_after(Evas_Object *obj, const Elm_Genlist_Item_Class *it Elm_Genlist_Item_Flags flags, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Elm_Genlist_Item *it = _item_new(wd, itc, data, NULL, flags, func, func_data); @@ -1895,6 +1901,7 @@ elm_genlist_item_insert_after(Evas_Object *obj, const Elm_Genlist_Item_Class *it EAPI void elm_genlist_clear(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); while (wd->items) @@ -1958,6 +1965,7 @@ elm_genlist_clear(Evas_Object *obj) EAPI void elm_genlist_multi_select_set(Evas_Object *obj, Eina_Bool multi) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->multi = multi; @@ -1980,6 +1988,7 @@ elm_genlist_multi_select_set(Evas_Object *obj, Eina_Bool multi) EAPI Elm_Genlist_Item * elm_genlist_selected_item_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->selected) return wd->selected->data; @@ -2001,6 +2010,7 @@ elm_genlist_selected_item_get(const Evas_Object *obj) EAPI const Eina_List * elm_genlist_selected_items_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->selected; @@ -2023,6 +2033,7 @@ elm_genlist_selected_items_get(const Evas_Object *obj) EAPI Eina_List * elm_genlist_realized_items_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Eina_List *list = NULL; Item_Block *itb; @@ -2072,6 +2083,7 @@ elm_genlist_realized_items_get(const Evas_Object *obj) EAPI Elm_Genlist_Item * elm_genlist_at_xy_item_get(const Evas_Object *obj, Evas_Coord x, Evas_Coord y, int *posret) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord ox, oy, ow, oh; Item_Block *itb; @@ -2128,6 +2140,7 @@ elm_genlist_at_xy_item_get(const Evas_Object *obj, Evas_Coord x, Evas_Coord y, i EAPI Elm_Genlist_Item * elm_genlist_first_item_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd->items) return NULL; Elm_Genlist_Item *it = (Elm_Genlist_Item *)(wd->items); @@ -2149,6 +2162,7 @@ elm_genlist_first_item_get(const Evas_Object *obj) EAPI Elm_Genlist_Item * elm_genlist_last_item_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd->items) return NULL; Elm_Genlist_Item *it = (Elm_Genlist_Item *)(wd->items->last); @@ -2797,6 +2811,7 @@ elm_genlist_item_update(Elm_Genlist_Item *it) EAPI void elm_genlist_horizontal_mode_set(Evas_Object *obj, Elm_List_Mode mode) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->mode == mode) return; @@ -2823,6 +2838,7 @@ elm_genlist_horizontal_mode_set(Evas_Object *obj, Elm_List_Mode mode) EAPI void elm_genlist_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->always_select = always_select; } @@ -2841,6 +2857,7 @@ elm_genlist_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select) EAPI void elm_genlist_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->no_select = no_select; } @@ -2859,6 +2876,7 @@ elm_genlist_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select) EAPI void elm_genlist_compress_mode_set(Evas_Object *obj, Eina_Bool compress) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->compress = compress; } @@ -2878,6 +2896,7 @@ elm_genlist_compress_mode_set(Evas_Object *obj, Eina_Bool compress) EAPI void elm_genlist_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); elm_smart_scroller_bounce_allow_set(wd->scr, h_bounce, v_bounce); } @@ -2896,6 +2915,7 @@ elm_genlist_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) EAPI void elm_genlist_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (homogeneous) @@ -2916,6 +2936,7 @@ elm_genlist_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous) EAPI void elm_genlist_block_count_set(Evas_Object *obj, int n) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->max_items_per_block = n; } diff --git a/src/lib/elm_hover.c b/src/lib/elm_hover.c index 6c5378485..4027822f0 100644 --- a/src/lib/elm_hover.c +++ b/src/lib/elm_hover.c @@ -18,6 +18,7 @@ struct _Subinfo Evas_Object *obj; }; +static const char *widtype = NULL; static void _del_pre_hook(Evas_Object *obj); static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); @@ -168,6 +169,7 @@ _hov_show(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _hov_hide(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); const Eina_List *l; const Subinfo *si; @@ -193,6 +195,7 @@ _hov_hide(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _target_del(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); wd->target = NULL; @@ -201,6 +204,7 @@ _target_del(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _signal_dismiss(void *data, Evas_Object *obj, const char *emission, const char *source) { + Widget_Data *wd = elm_widget_data_get(data); evas_object_hide(data); @@ -222,12 +226,14 @@ _parent_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _parent_show(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); } static void _parent_hide(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); if (wd) evas_object_hide(wd->cov); @@ -236,6 +242,7 @@ _parent_hide(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _parent_del(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); elm_hover_parent_set(data, NULL); @@ -252,6 +259,7 @@ elm_hover_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "hover"); elm_widget_type_set(obj, "hover"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -296,6 +304,7 @@ elm_hover_add(Evas_Object *parent) EAPI void elm_hover_target_set(Evas_Object *obj, Evas_Object *target) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->target) @@ -314,6 +323,7 @@ elm_hover_target_set(Evas_Object *obj, Evas_Object *target) EAPI void elm_hover_parent_set(Evas_Object *obj, Evas_Object *parent) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->parent) @@ -350,6 +360,7 @@ elm_hover_parent_set(Evas_Object *obj, Evas_Object *parent) EAPI void elm_hover_content_set(Evas_Object *obj, const char *swallow, Evas_Object *content) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Subinfo *si; const Eina_List *l; @@ -387,6 +398,7 @@ elm_hover_style_set(Evas_Object *obj, const char *style) EAPI const char * elm_hover_best_content_location_get(const Evas_Object *obj, Elm_Hover_Axis pref_axis) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord x = 0, y = 0, w = 0, h = 0, x2 = 0, y2 = 0, w2 = 0, h2 = 0; Evas_Coord spc_l, spc_r, spc_t, spc_b; diff --git a/src/lib/elm_icon.c b/src/lib/elm_icon.c index fab3d8d4c..4887395a3 100644 --- a/src/lib/elm_icon.c +++ b/src/lib/elm_icon.c @@ -27,6 +27,7 @@ struct _Widget_Data Eina_Bool no_scale : 1; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -113,6 +114,7 @@ elm_icon_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "icon"); elm_widget_type_set(obj, "icon"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -148,6 +150,7 @@ elm_icon_add(Evas_Object *parent) EAPI Eina_Bool elm_icon_file_set(Evas_Object *obj, const char *file, const char *group) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Eina_Bool ret; const char *p; @@ -176,6 +179,7 @@ elm_icon_file_set(Evas_Object *obj, const char *file, const char *group) EAPI Eina_Bool elm_icon_standard_set(Evas_Object *obj, const char *name) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Eina_Bool ret; @@ -199,6 +203,7 @@ elm_icon_standard_set(Evas_Object *obj, const char *name) EAPI void elm_icon_smooth_set(Evas_Object *obj, Eina_Bool smooth) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -218,6 +223,7 @@ elm_icon_smooth_set(Evas_Object *obj, Eina_Bool smooth) EAPI void elm_icon_no_scale_set(Evas_Object *obj, Eina_Bool no_scale) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -237,6 +243,7 @@ elm_icon_no_scale_set(Evas_Object *obj, Eina_Bool no_scale) EAPI void elm_icon_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -257,6 +264,7 @@ elm_icon_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down) EAPI void elm_icon_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -276,6 +284,7 @@ elm_icon_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside) EAPI void elm_icon_prescale_set(Evas_Object *obj, int size) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; diff --git a/src/lib/elm_image.c b/src/lib/elm_image.c index e1c0ecc0d..047c447d1 100644 --- a/src/lib/elm_image.c +++ b/src/lib/elm_image.c @@ -30,6 +30,7 @@ struct _Widget_Data Eina_Bool no_scale : 1; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -119,6 +120,7 @@ elm_image_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "image"); elm_widget_type_set(obj, "image"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -157,6 +159,7 @@ elm_image_add(Evas_Object *parent) EAPI Eina_Bool elm_image_file_set(Evas_Object *obj, const char *file, const char *group) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Eina_Bool ret; const char *p; @@ -182,6 +185,7 @@ elm_image_file_set(Evas_Object *obj, const char *file, const char *group) EAPI void elm_image_smooth_set(Evas_Object *obj, Eina_Bool smooth) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -192,6 +196,7 @@ elm_image_smooth_set(Evas_Object *obj, Eina_Bool smooth) EAPI void elm_image_object_size_get(const Evas_Object *obj, int *w, int *h) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); _els_smart_icon_size_get(wd->img, w, h); @@ -209,6 +214,7 @@ elm_image_object_size_get(const Evas_Object *obj, int *w, int *h) EAPI void elm_image_no_scale_set(Evas_Object *obj, Eina_Bool no_scale) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -229,6 +235,7 @@ elm_image_no_scale_set(Evas_Object *obj, Eina_Bool no_scale) EAPI void elm_image_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -249,6 +256,7 @@ elm_image_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down) EAPI void elm_image_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -267,6 +275,7 @@ elm_image_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside) EAPI void elm_image_prescale_set(Evas_Object *obj, int size) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -288,6 +297,7 @@ elm_image_prescale_set(Evas_Object *obj, int size) EAPI void elm_image_orient_set(Evas_Object *obj, Elm_Image_Orient orient) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; diff --git a/src/lib/elm_index.c b/src/lib/elm_index.c index db036859b..5ff74c724 100644 --- a/src/lib/elm_index.c +++ b/src/lib/elm_index.c @@ -41,6 +41,7 @@ struct _Item Eina_Bool selected : 1; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -258,6 +259,7 @@ _index_box_clear(Evas_Object *obj, Evas_Object *box, int level) static int _delay_change(void *data) { + Widget_Data *wd = elm_widget_data_get(data); void *d; @@ -383,6 +385,7 @@ _sel_eval(Evas_Object *obj, Evas_Coord evx, Evas_Coord evy) static void _wheel(void *data, Evas *e, Evas_Object *o, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); Evas_Event_Mouse_Wheel *ev = event_info; Evas_Object *obj = o; @@ -391,6 +394,7 @@ _wheel(void *data, Evas *e, Evas_Object *o, void *event_info) static void _mouse_down(void *data, Evas *e, Evas_Object *o, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); Evas_Event_Mouse_Down *ev = event_info; Evas_Coord x, y; @@ -409,6 +413,7 @@ _mouse_down(void *data, Evas *e, Evas_Object *o, void *event_info) static void _mouse_up(void *data, Evas *e, Evas_Object *o, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); Evas_Event_Mouse_Up *ev = event_info; void *d; @@ -424,6 +429,7 @@ _mouse_up(void *data, Evas *e, Evas_Object *o, void *event_info) static void _mouse_move(void *data, Evas *e, Evas_Object *o, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); Evas_Event_Mouse_Move *ev = event_info; Evas_Coord minw = 0, minh = 0, x, y, dx, dy, adx, ady; @@ -492,6 +498,7 @@ elm_index_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "index"); elm_widget_type_set(obj, "index"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -557,6 +564,7 @@ elm_index_add(Evas_Object *parent) EAPI void elm_index_active_set(Evas_Object *obj, Eina_Bool active) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -584,6 +592,7 @@ elm_index_active_set(Evas_Object *obj, Eina_Bool active) EAPI void elm_index_item_level_set(Evas_Object *obj, int level) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -601,6 +610,7 @@ elm_index_item_level_set(Evas_Object *obj, int level) EAPI int elm_index_item_level_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return 0; @@ -618,6 +628,7 @@ elm_index_item_level_get(Evas_Object *obj) EAPI const void * elm_index_item_selected_get(Evas_Object *obj, int level) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Eina_List *l; Item *it; @@ -640,6 +651,7 @@ elm_index_item_selected_get(Evas_Object *obj, int level) EAPI void elm_index_item_append(Evas_Object *obj, const char *letter, const void *item) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Item *it; @@ -662,6 +674,7 @@ elm_index_item_append(Evas_Object *obj, const char *letter, const void *item) EAPI void elm_index_item_prepend(Evas_Object *obj, const char *letter, const void *item) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Item *it; @@ -685,6 +698,7 @@ elm_index_item_prepend(Evas_Object *obj, const char *letter, const void *item) EAPI void elm_index_item_append_relative(Evas_Object *obj, const char *letter, const void *item, const void *relative) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Item *it, *it_rel; @@ -719,6 +733,7 @@ elm_index_item_append_relative(Evas_Object *obj, const char *letter, const void EAPI void elm_index_item_prepend_relative(Evas_Object *obj, const char *letter, const void *item, const void *relative) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Item *it, *it_rel; @@ -751,6 +766,7 @@ elm_index_item_prepend_relative(Evas_Object *obj, const char *letter, const void EAPI void elm_index_item_del(Evas_Object *obj, const void *item) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Item *it; @@ -771,6 +787,7 @@ elm_index_item_del(Evas_Object *obj, const void *item) EAPI void elm_index_item_clear(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Item *it; Eina_List *l, *clear = NULL; @@ -797,6 +814,7 @@ elm_index_item_clear(Evas_Object *obj) EAPI void elm_index_item_go(Evas_Object *obj, int level) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Item *it; diff --git a/src/lib/elm_label.c b/src/lib/elm_label.c index e48c0cc37..ec84d4898 100644 --- a/src/lib/elm_label.c +++ b/src/lib/elm_label.c @@ -21,6 +21,7 @@ struct _Widget_Data Eina_Bool changed : 1; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -110,6 +111,7 @@ _sizing_eval(Evas_Object *obj) static void _resize(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); if (wd->linewrap) @@ -135,6 +137,7 @@ elm_label_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "label"); elm_widget_type_set(obj, "label"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -168,6 +171,7 @@ elm_label_add(Evas_Object *parent) EAPI void elm_label_label_set(Evas_Object *obj, const char *label) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!label) label = ""; @@ -188,6 +192,7 @@ elm_label_label_set(Evas_Object *obj, const char *label) EAPI const char * elm_label_label_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; @@ -204,6 +209,7 @@ elm_label_label_get(Evas_Object *obj) EAPI void elm_label_line_wrap_set(Evas_Object *obj, Eina_Bool wrap) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); const char *t; if (wd->linewrap == wrap) return; @@ -229,6 +235,7 @@ elm_label_line_wrap_set(Evas_Object *obj, Eina_Bool wrap) EAPI Eina_Bool elm_label_line_wrap_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->linewrap; } @@ -243,6 +250,7 @@ elm_label_line_wrap_get(const Evas_Object *obj) EAPI void elm_label_wrap_width_set(Evas_Object *obj, Evas_Coord w) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->wrap_w == w) return; wd->wrap_w = w; @@ -259,6 +267,7 @@ elm_label_wrap_width_set(Evas_Object *obj, Evas_Coord w) EAPI Evas_Coord elm_label_wrap_width_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->wrap_w; } diff --git a/src/lib/elm_layout.c b/src/lib/elm_layout.c index bd7da960d..b6ea9ba14 100644 --- a/src/lib/elm_layout.c +++ b/src/lib/elm_layout.c @@ -26,6 +26,7 @@ struct _Subinfo Evas_Object *obj; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -35,6 +36,7 @@ static void _sub_del(void *data, Evas_Object *obj, void *event_info); static void _del_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Subinfo *si; @@ -49,6 +51,7 @@ _del_hook(Evas_Object *obj) static void _theme_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); edje_object_scale_set(wd->lay, elm_widget_scale_get(obj) * @@ -59,6 +62,7 @@ _theme_hook(Evas_Object *obj) static void _changed_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (wd->needs_size_calc) { @@ -70,6 +74,7 @@ _changed_hook(Evas_Object *obj) static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1; @@ -81,6 +86,7 @@ _sizing_eval(Evas_Object *obj) static void _request_sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (wd->needs_size_calc) return; wd->needs_size_calc = 1; @@ -96,6 +102,7 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _sub_del(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Object *sub = event_info; Eina_List *l; @@ -141,6 +148,7 @@ elm_layout_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "layout"); elm_widget_type_set(obj, "layout"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -173,6 +181,7 @@ elm_layout_add(Evas_Object *parent) EAPI Eina_Bool elm_layout_file_set(Evas_Object *obj, const char *file, const char *group) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Eina_Bool ret = edje_object_file_set(wd->lay, file, group); @@ -195,6 +204,7 @@ elm_layout_file_set(Evas_Object *obj, const char *file, const char *group) EAPI Eina_Bool elm_layout_theme_set(Evas_Object *obj, const char *clas, const char *group, const char *style) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Eina_Bool ret = _elm_theme_set(wd->lay, clas, group, style); @@ -214,6 +224,7 @@ elm_layout_theme_set(Evas_Object *obj, const char *clas, const char *group, cons EAPI void elm_layout_content_set(Evas_Object *obj, const char *swallow, Evas_Object *content) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Subinfo *si; const Eina_List *l; @@ -261,6 +272,7 @@ elm_layout_content_set(Evas_Object *obj, const char *swallow, Evas_Object *conte EAPI Evas_Object * elm_layout_edje_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->lay; @@ -281,6 +293,7 @@ elm_layout_edje_get(const Evas_Object *obj) EAPI void elm_layout_sizing_eval(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); _request_sizing_eval(obj); } diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c index 307490664..9ac441825 100644 --- a/src/lib/elm_list.c +++ b/src/lib/elm_list.c @@ -38,6 +38,7 @@ struct _Elm_List_Item Eina_Bool dummy_end : 1; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -156,6 +157,7 @@ _elm_list_unwalk(Widget_Data *wd) static void _del_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Elm_List_Item *it; Eina_List *n; @@ -183,6 +185,7 @@ _del_hook(Evas_Object *obj) static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; @@ -195,6 +198,7 @@ _sizing_eval(Evas_Object *obj) static void _theme_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Elm_List_Item *it; Eina_List *n; @@ -212,6 +216,7 @@ _theme_hook(Evas_Object *obj) static void _on_focus_hook(void *data, Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); // if (elm_widget_focus_get(obj)) // elm_widget_focus_steal(wd->entry); @@ -220,6 +225,7 @@ _on_focus_hook(void *data, Evas_Object *obj) static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); // _fix_items(data); // _sizing_eval(data); @@ -228,6 +234,7 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _sub_del(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Object *sub = event_info; const Eina_List *l; @@ -454,6 +461,7 @@ _mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info) static Elm_List_Item * _item_new(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data) { + Widget_Data *wd = elm_widget_data_get(obj); Elm_List_Item *it; @@ -491,6 +499,7 @@ _item_new(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *e static void _fix_items(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); const Eina_List *l; Elm_List_Item *it; @@ -640,6 +649,7 @@ _fix_items(Evas_Object *obj) static void _hold_on(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -649,6 +659,7 @@ _hold_on(void *data, Evas_Object *obj, void *event_info) static void _hold_off(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -658,6 +669,7 @@ _hold_off(void *data, Evas_Object *obj, void *event_info) static void _freeze_on(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -667,6 +679,7 @@ _freeze_on(void *data, Evas_Object *obj, void *event_info) static void _freeze_off(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -683,6 +696,7 @@ elm_list_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); wd->self = obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "list"); elm_widget_type_set(obj, "list"); elm_widget_sub_object_add(parent, obj); elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); @@ -718,6 +732,7 @@ elm_list_add(Evas_Object *parent) EAPI Elm_List_Item * elm_list_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Elm_List_Item *it = _item_new(obj, label, icon, end, func, data); @@ -730,6 +745,7 @@ elm_list_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Eva EAPI Elm_List_Item * elm_list_item_prepend(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Elm_List_Item *it = _item_new(obj, label, icon, end, func, data); @@ -748,6 +764,7 @@ elm_list_item_insert_before(Evas_Object *obj, Elm_List_Item *before, const char if ((!before) || (!before->node)) return NULL; ELM_LIST_ITEM_CHECK_DELETED_RETURN(before, NULL); + ELM_CHECK_WIDTYPE(obj, widtype); wd = elm_widget_data_get(obj); it = _item_new(obj, label, icon, end, func, data); wd->items = eina_list_prepend_relative_list(wd->items, it, before->node); @@ -765,6 +782,7 @@ elm_list_item_insert_after(Evas_Object *obj, Elm_List_Item *after, const char *l if ((!after) || (!after->node)) return NULL; ELM_LIST_ITEM_CHECK_DELETED_RETURN(after, NULL); + ELM_CHECK_WIDTYPE(obj, widtype); wd = elm_widget_data_get(obj); it = _item_new(obj, label, icon, end, func, data); wd->items = eina_list_append_relative_list(wd->items, it, after->node); @@ -776,6 +794,7 @@ elm_list_item_insert_after(Evas_Object *obj, Elm_List_Item *after, const char *l EAPI void elm_list_clear(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Elm_List_Item *it; @@ -816,6 +835,7 @@ elm_list_clear(Evas_Object *obj) EAPI void elm_list_go(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); _fix_items(obj); @@ -824,6 +844,7 @@ elm_list_go(Evas_Object *obj) EAPI void elm_list_multi_select_set(Evas_Object *obj, Eina_Bool multi) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->multi = multi; @@ -832,6 +853,7 @@ elm_list_multi_select_set(Evas_Object *obj, Eina_Bool multi) EAPI Eina_Bool elm_list_multi_select_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->multi; @@ -840,6 +862,7 @@ elm_list_multi_select_get(Evas_Object *obj) EAPI void elm_list_horizontal_mode_set(Evas_Object *obj, Elm_List_Mode mode) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->mode == mode) return; @@ -853,6 +876,7 @@ elm_list_horizontal_mode_set(Evas_Object *obj, Elm_List_Mode mode) EAPI Elm_List_Mode elm_list_horizontal_mode_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->mode; @@ -861,6 +885,7 @@ elm_list_horizontal_mode_get(Evas_Object *obj) EAPI void elm_list_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->always_select = always_select; @@ -869,6 +894,7 @@ elm_list_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select) EAPI const Eina_List * elm_list_items_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->items; @@ -877,6 +903,7 @@ elm_list_items_get(const Evas_Object *obj) EAPI Elm_List_Item * elm_list_selected_item_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->selected) return wd->selected->data; @@ -886,6 +913,7 @@ elm_list_selected_item_get(const Evas_Object *obj) EAPI const Eina_List * elm_list_selected_items_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->selected; @@ -1113,6 +1141,7 @@ elm_list_item_next(const Elm_List_Item *it) EAPI void elm_list_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); elm_smart_scroller_bounce_allow_set(wd->scr, h_bounce, v_bounce); } @@ -1135,6 +1164,7 @@ elm_list_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) EAPI void elm_list_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); elm_scroller_policy_set(wd->scr, policy_h, policy_v); } diff --git a/src/lib/elm_main.c b/src/lib/elm_main.c index 28b2e8345..d0731fae0 100644 --- a/src/lib/elm_main.c +++ b/src/lib/elm_main.c @@ -263,6 +263,7 @@ static int _elm_signal_exit(void *data, int ev_type, void *ev); #ifdef HAVE_ELEMENTARY_X static int _elm_window_property_change(void *data, int ev_type, void *ev); #endif +static const char *widtype = NULL; static void _elm_rescale(void); char *_elm_appname = NULL; diff --git a/src/lib/elm_map.c b/src/lib/elm_map.c index 2f333af5f..89d4db74e 100644 --- a/src/lib/elm_map.c +++ b/src/lib/elm_map.c @@ -268,6 +268,7 @@ struct _Pan }; +static const char *widtype = NULL; static void _pan_calculate(Evas_Object *obj); static void _del_hook(Evas_Object *obj); @@ -296,6 +297,7 @@ static void _bubble_sc_hits_changed_cb(void *data, Evas *e, Evas_Object *obj, vo static void rect_place(Evas_Object *obj, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_Coord oy, Evas_Coord ow, Evas_Coord oh) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord ax, ay, gw, gh, hh, ww; @@ -325,6 +327,7 @@ rect_place(Evas_Object *obj, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_C static void marker_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_Coord oy, Evas_Coord ow, Evas_Coord oh) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord ax, ay, gw, gh, tx, ty; Eina_List *l, *markers; @@ -488,6 +491,7 @@ marker_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord static void grid_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_Coord oy, Evas_Coord ow, Evas_Coord oh) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord ax, ay, gw, gh, tx, ty; int xx, yy, ww, hh; @@ -541,6 +545,7 @@ grid_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord o static void grid_clear(Evas_Object *obj, Grid *g) { + Widget_Data *wd = elm_widget_data_get(obj); char buf[PATH_MAX]; @@ -636,6 +641,7 @@ _tile_downloaded(void *data, const char *file, int status) static Grid * grid_create(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Grid *g; @@ -663,6 +669,7 @@ grid_create(Evas_Object *obj) static void grid_load(Evas_Object *obj, Grid *g) { + Widget_Data *wd = elm_widget_data_get(obj); int x, y; int size; @@ -860,6 +867,7 @@ grid_load(Evas_Object *obj, Grid *g) static void grid_clearall(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Grid *g; @@ -873,6 +881,7 @@ grid_clearall(Evas_Object *obj) static void _smooth_update(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Eina_List *l; Grid *g; @@ -912,6 +921,7 @@ _grid_raise(Grid *g) static int _scr_timeout(void *data) { + Widget_Data *wd = elm_widget_data_get(data); wd->nosmooth--; if (wd->nosmooth == 0) _smooth_update(data); @@ -922,6 +932,7 @@ _scr_timeout(void *data) static void _scr(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); if (!wd->scr_timer) { @@ -935,6 +946,7 @@ _scr(void *data, Evas_Object *obj, void *event_info) static int zoom_do(Evas_Object *obj, double t) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord xx, yy, ow, oh; @@ -981,6 +993,7 @@ static int _zoom_anim(void *data) { Evas_Object *obj = data; + Widget_Data *wd = elm_widget_data_get(obj); double t; int go; @@ -1008,6 +1021,7 @@ _zoom_anim(void *data) static int _long_press(void *data) { + Widget_Data *wd = elm_widget_data_get(data); wd->long_timer = NULL; wd->longpressed = EINA_TRUE; @@ -1018,6 +1032,7 @@ _long_press(void *data) static void _mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); Evas_Event_Mouse_Down *ev = event_info; if (ev->button != 1) return; @@ -1035,6 +1050,7 @@ _mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info) static void _mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); Evas_Event_Mouse_Up *ev = event_info; if (ev->button != 1) return; @@ -1058,6 +1074,7 @@ _del_hook(Evas_Object *obj) Elm_Map_Group_Class *group_clas; Elm_Map_Marker_Class *marker_clas; + Widget_Data *wd = elm_widget_data_get(obj); EINA_LIST_FREE(wd->groups_clas, group_clas) @@ -1092,6 +1109,7 @@ _del_pre_hook(Evas_Object *obj) Eina_Bool free_marker = EINA_TRUE; Eina_List *l; + Widget_Data *wd = elm_widget_data_get(obj); grid_clearall(obj); @@ -1130,6 +1148,7 @@ _del_pre_hook(Evas_Object *obj) static void _theme_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); elm_smart_scroller_theme_set(wd->scr, "map", "base", elm_widget_style_get(obj)); edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale); @@ -1139,6 +1158,7 @@ _theme_hook(Evas_Object *obj) static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; @@ -1282,6 +1302,7 @@ _pan_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) static void _hold_on(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_smart_scroller_hold_set(wd->scr, 1); @@ -1290,6 +1311,7 @@ _hold_on(void *data, Evas_Object *obj, void *event_info) static void _hold_off(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_smart_scroller_hold_set(wd->scr, 0); @@ -1298,6 +1320,7 @@ _hold_off(void *data, Evas_Object *obj, void *event_info) static void _freeze_on(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_smart_scroller_freeze_set(wd->scr, 1); @@ -1306,6 +1329,7 @@ _freeze_on(void *data, Evas_Object *obj, void *event_info) static void _freeze_off(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_smart_scroller_freeze_set(wd->scr, 0); @@ -1326,6 +1350,7 @@ _scr_anim_stop(void *data, Evas_Object *obj, void *event_info) static void _scr_drag_start(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); wd->center_on.enabled = EINA_FALSE; evas_object_smart_callback_call(data, "scroll,drag,start", NULL); @@ -1656,6 +1681,7 @@ elm_map_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "map"); elm_widget_type_set(obj, "map"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -1757,6 +1783,7 @@ elm_map_add(Evas_Object *parent) EAPI void elm_map_zoom_set(Evas_Object *obj, int zoom) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Eina_List *l; Grid *g, *g_zoom = NULL; @@ -1947,6 +1974,7 @@ done: EAPI double elm_map_zoom_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->zoom; } @@ -1972,6 +2000,7 @@ elm_map_zoom_get(Evas_Object *obj) EAPI void elm_map_zoom_mode_set(Evas_Object *obj, Elm_Map_Zoom_Mode mode) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->mode == mode) return; wd->mode = mode; @@ -1995,6 +2024,7 @@ elm_map_zoom_mode_set(Evas_Object *obj, Elm_Map_Zoom_Mode mode) EAPI Elm_Map_Zoom_Mode elm_map_zoom_mode_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->mode; } @@ -2002,6 +2032,7 @@ elm_map_zoom_mode_get(Evas_Object *obj) EAPI void elm_map_geo_region_bring_in(Evas_Object *obj, double lon, double lat) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); int rx, ry, rw, rh; @@ -2041,6 +2072,7 @@ elm_map_geo_region_bring_in(Evas_Object *obj, double lon, double lat) EAPI void elm_map_geo_region_show(Evas_Object *obj, double lon, double lat) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); int rx, ry, rw, rh; @@ -2079,6 +2111,7 @@ elm_map_geo_region_show(Evas_Object *obj, double lon, double lat) EAPI void elm_map_geo_region_get(Evas_Object *obj, double *lon, double *lat) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord sx, sy, sw, sh; @@ -2103,6 +2136,7 @@ elm_map_geo_region_get(Evas_Object *obj, double *lon, double *lat) EAPI void elm_map_paused_set(Evas_Object *obj, Eina_Bool paused) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->paused == !!paused) return; wd->paused = paused; @@ -2131,6 +2165,7 @@ elm_map_paused_set(Evas_Object *obj, Eina_Bool paused) EAPI void elm_map_paused_markers_set(Evas_Object *obj, Eina_Bool paused) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->paused_markers == !!paused) return; wd->paused_markers = paused; @@ -2147,6 +2182,7 @@ elm_map_paused_markers_set(Evas_Object *obj, Eina_Bool paused) EAPI Eina_Bool elm_map_paused_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->paused; } @@ -2162,6 +2198,7 @@ elm_map_paused_get(Evas_Object *obj) EAPI Eina_Bool elm_map_paused_markers_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->paused_markers; } @@ -2232,6 +2269,7 @@ elm_map_marker_add(Evas_Object *obj, double lon, double lat, Elm_Map_Marker_Clas int i, j; Eina_List *l; Marker_Group *group; + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); int mpi, mpj; int tabi[9]; @@ -2560,6 +2598,7 @@ elm_map_markers_list_show(Eina_List *markers) EAPI void elm_map_max_marker_per_group_set(Evas_Object *obj, int max) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->markers_max_num = max; } @@ -2605,6 +2644,7 @@ elm_map_marker_update(Elm_Map_Marker *marker) EAPI void elm_map_bubbles_close(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Marker_Group *group; Eina_List *l, *l_next; @@ -2629,6 +2669,7 @@ elm_map_bubbles_close(Evas_Object *obj) EAPI Elm_Map_Group_Class * elm_map_group_class_new(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Elm_Map_Group_Class *clas = calloc(1, sizeof(Elm_Map_Group_Class)); @@ -2720,6 +2761,7 @@ elm_map_group_class_zoom_grouped_set(Elm_Map_Group_Class *clas, int zoom) EAPI void elm_map_group_class_hide_set(Evas_Object *obj, Elm_Map_Group_Class *clas, Eina_Bool hide) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if(clas->hide == hide) return ; @@ -2747,6 +2789,7 @@ elm_map_group_class_hide_set(Evas_Object *obj, Elm_Map_Group_Class *clas, Eina_B EAPI Elm_Map_Marker_Class * elm_map_marker_class_new(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Elm_Map_Marker_Class *clas = calloc(1, sizeof(Elm_Map_Marker_Class)); @@ -2832,6 +2875,7 @@ elm_map_marker_class_del_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerDelFunc EAPI void elm_map_source_set(Evas_Object *obj, Elm_Map_Sources source) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Grid *grid; int zoom; @@ -2864,6 +2908,7 @@ elm_map_source_set(Evas_Object *obj, Elm_Map_Sources source) EAPI Elm_Map_Sources elm_map_source_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->source; } diff --git a/src/lib/elm_mapbuf.c b/src/lib/elm_mapbuf.c index 5f1199d20..b9ae82e62 100644 --- a/src/lib/elm_mapbuf.c +++ b/src/lib/elm_mapbuf.c @@ -19,6 +19,7 @@ struct _Widget_Data Eina_Bool smooth : 1; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -28,6 +29,7 @@ static void _sub_del(void *data, Evas_Object *obj, void *event_info); static void _del_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); free(wd); } @@ -35,6 +37,7 @@ _del_hook(Evas_Object *obj) static void _theme_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); _sizing_eval(obj); } @@ -42,6 +45,7 @@ _theme_hook(Evas_Object *obj) static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, minw2 = -1, minh2 = -1; Evas_Coord maxw = -1, maxh = -1, maxw2 = -1, maxh2 = -1; @@ -59,6 +63,7 @@ _sizing_eval(Evas_Object *obj) static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); _sizing_eval(data); } @@ -66,6 +71,7 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _sub_del(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Object *sub = event_info; @@ -81,6 +87,7 @@ _sub_del(void *data, Evas_Object *obj, void *event_info) static void _mapbuf(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord x, y, w, h; @@ -110,6 +117,7 @@ _mapbuf(Evas_Object *obj) static void _configure(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (wd->content) { @@ -152,6 +160,7 @@ elm_mapbuf_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "mapbuf"); elm_widget_type_set(obj, "mapbuf"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -181,6 +190,7 @@ elm_mapbuf_add(Evas_Object *parent) EAPI void elm_mapbuf_content_set(Evas_Object *obj, Evas_Object *content) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->content == content) return; @@ -205,6 +215,7 @@ elm_mapbuf_content_set(Evas_Object *obj, Evas_Object *content) EAPI void elm_mapbuf_enabled_set(Evas_Object *obj, Eina_Bool enabled) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->enabled == enabled) return; wd->enabled = enabled; @@ -214,6 +225,7 @@ elm_mapbuf_enabled_set(Evas_Object *obj, Eina_Bool enabled) EAPI Eina_Bool elm_mapbuf_enabled_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->enabled; } @@ -221,6 +233,7 @@ elm_mapbuf_enabled_get(const Evas_Object *obj) EAPI void elm_mapbuf_smooth_set(Evas_Object *obj, Eina_Bool smooth) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->smooth == smooth) return; wd->smooth = smooth; @@ -230,6 +243,7 @@ elm_mapbuf_smooth_set(Evas_Object *obj, Eina_Bool smooth) EAPI Eina_Bool elm_mapbuf_smooth_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->smooth; } @@ -237,6 +251,7 @@ elm_mapbuf_smooth_get(const Evas_Object *obj) EAPI void elm_mapbuf_alpha_set(Evas_Object *obj, Eina_Bool alpha) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->alpha == alpha) return; wd->alpha = alpha; @@ -246,6 +261,7 @@ elm_mapbuf_alpha_set(Evas_Object *obj, Eina_Bool alpha) EAPI Eina_Bool elm_mapbuf_alpha_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->alpha; } diff --git a/src/lib/elm_menu.c b/src/lib/elm_menu.c index 27b80dd9c..452a733e2 100644 --- a/src/lib/elm_menu.c +++ b/src/lib/elm_menu.c @@ -44,6 +44,7 @@ struct _Widget_Data Evas_Coord xloc, yloc; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -58,6 +59,7 @@ static void _menu_hide(void *data, Evas_Object *obj, void *event_info); static void _del_pre_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); evas_object_event_callback_del_full(wd->parent, EVAS_CALLBACK_RESIZE, _parent_resize, obj); @@ -68,6 +70,7 @@ _del_hook(Evas_Object *obj) { Eina_List *l, *ll = NULL; Elm_Menu_Item *item; + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -96,6 +99,7 @@ _theme_hook(Evas_Object *obj) { Eina_List *l, *_l, *ll = NULL; Elm_Menu_Item *item; + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -141,6 +145,7 @@ _sizing_eval(Evas_Object *obj) Eina_List *l; Elm_Menu_Item *item; Evas_Coord x_p,y_p,w_p,h_p,x2,y2,w2,h2,bx,by,bw,bh; + Widget_Data *wd = elm_widget_data_get(obj); if ((!wd) || (!wd->parent)) return; @@ -234,6 +239,7 @@ _item_sizing_eval(Elm_Menu_Item *item) static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) { + // Widget_Data *wd = elm_widget_data_get(data); _sizing_eval(data); @@ -242,6 +248,7 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _menu_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) { + // Widget_Data *wd = elm_widget_data_get(data); _sizing_eval(data); @@ -250,6 +257,7 @@ _menu_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _parent_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) { + // Widget_Data *wd = elm_widget_data_get(data); _sizing_eval(data); @@ -276,6 +284,7 @@ _menu_hide(void *data, Evas_Object *obj, void *event_info) { Eina_List *l; Elm_Menu_Item *item2; + Widget_Data *wd = elm_widget_data_get(data); evas_object_hide(wd->hv); @@ -360,6 +369,7 @@ _submenu_open(void *data, Evas_Object *obj, const char *emission, const char *so static void _show(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); evas_object_show(wd->hv); } @@ -439,6 +449,7 @@ elm_menu_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "menu"); elm_widget_type_set(obj, "menu"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -483,6 +494,7 @@ elm_menu_parent_set(Evas_Object *obj, Evas_Object *parent) { Eina_List *l, *_l, *ll = NULL; Elm_Menu_Item *item; + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -518,6 +530,7 @@ elm_menu_parent_set(Evas_Object *obj, Evas_Object *parent) EAPI void elm_menu_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -555,6 +568,7 @@ EAPI Elm_Menu_Item * elm_menu_item_add(Evas_Object *obj, Elm_Menu_Item *parent, Evas_Object *icon, const char *label, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data) { Elm_Menu_Item *subitem; + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; @@ -652,6 +666,7 @@ EAPI Elm_Menu_Item * elm_menu_item_separator_add(Evas_Object *obj, Elm_Menu_Item *parent) { Elm_Menu_Item *subitem; + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; diff --git a/src/lib/elm_notify.c b/src/lib/elm_notify.c index 266c12f64..e0a82601c 100644 --- a/src/lib/elm_notify.c +++ b/src/lib/elm_notify.c @@ -27,6 +27,7 @@ struct _Widget_Data Ecore_Timer *timer; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -51,6 +52,7 @@ _del_pre_hook(Evas_Object *obj) static void _del_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); elm_notify_content_set(obj, NULL); @@ -67,6 +69,7 @@ _del_hook(Evas_Object *obj) static void _theme_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -81,6 +84,7 @@ _theme_hook(Evas_Object *obj) static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord x,y,w,h; @@ -99,6 +103,7 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _sub_del(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); if (event_info == wd->content) @@ -108,6 +113,7 @@ _sub_del(void *data, Evas_Object *obj, void *event_info) static void _signal_block_clicked(void *data, Evas_Object *obj, const char *emission, const char *source) { + Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; evas_object_smart_callback_call(data, "block,clicked", NULL); @@ -128,6 +134,7 @@ _content_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _calc(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1; Evas_Coord x, y, w, h; @@ -179,6 +186,7 @@ static int _timer_cb(void *data) { Evas_Object *obj = data; + Widget_Data *wd = elm_widget_data_get(obj); wd->timer = NULL; @@ -189,6 +197,7 @@ _timer_cb(void *data) static void _show(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); evas_object_show(wd->notify); @@ -206,6 +215,7 @@ _show(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _hide(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); evas_object_hide(wd->notify); @@ -221,6 +231,7 @@ _hide(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _parent_del(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); wd->parent = NULL; @@ -230,6 +241,7 @@ _parent_del(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _parent_hide(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); wd->parent = NULL; @@ -254,6 +266,7 @@ elm_notify_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "notify"); elm_widget_type_set(obj, "notify"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -289,6 +302,7 @@ elm_notify_add(Evas_Object *parent) EAPI void elm_notify_content_set(Evas_Object *obj, Evas_Object *content) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->content) @@ -329,6 +343,7 @@ elm_notify_content_set(Evas_Object *obj, Evas_Object *content) EAPI void elm_notify_parent_set(Evas_Object *obj, Evas_Object *parent) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if(wd->parent) @@ -376,6 +391,7 @@ elm_notify_parent_set(Evas_Object *obj, Evas_Object *parent) EAPI void elm_notify_orient_set(Evas_Object *obj, Elm_Notify_Orient orient) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->orient = orient; @@ -423,6 +439,7 @@ elm_notify_orient_set(Evas_Object *obj, Elm_Notify_Orient orient) EAPI void elm_notify_timeout_set(Evas_Object *obj, int timeout) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->timeout = timeout; @@ -436,6 +453,7 @@ elm_notify_timeout_set(Evas_Object *obj, int timeout) EAPI void elm_notify_timer_init(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->timer) ecore_timer_del(wd->timer); @@ -457,6 +475,7 @@ elm_notify_timer_init(Evas_Object *obj) EAPI void elm_notify_repeat_events_set(Evas_Object *obj, Eina_Bool repeat) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (repeat == wd->repeat_events) return; diff --git a/src/lib/elm_pager.c b/src/lib/elm_pager.c index 5e10c4ce8..4def243a6 100644 --- a/src/lib/elm_pager.c +++ b/src/lib/elm_pager.c @@ -37,6 +37,7 @@ struct _Item Eina_Bool popme : 1; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -46,6 +47,7 @@ static void _sub_del(void *data, Evas_Object *obj, void *event_info); static void _del_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); free(wd); @@ -54,6 +56,7 @@ _del_hook(Evas_Object *obj) static void _theme_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Eina_List *l; Item *it; @@ -67,6 +70,7 @@ _theme_hook(Evas_Object *obj) static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1; Eina_List *l; @@ -98,6 +102,7 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _eval_top(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Item *it, *ittop; @@ -135,6 +140,7 @@ _eval_top(Evas_Object *obj) static void _move(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); Evas_Coord x, y; Eina_List *l; @@ -148,6 +154,7 @@ _move(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _sub_del(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); Evas_Object *sub = event_info; Eina_List *l; @@ -171,6 +178,7 @@ _sub_del(void *data, Evas_Object *obj, void *event_info) static void _resize(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); Evas_Coord w, h; Eina_List *l; @@ -213,6 +221,7 @@ elm_pager_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "pager"); elm_widget_type_set(obj, "pager"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -251,6 +260,7 @@ elm_pager_add(Evas_Object *parent) EAPI void elm_pager_content_push(Evas_Object *obj, Evas_Object *content) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Item *it = ELM_NEW(Item); Evas_Coord x, y, w, h; @@ -294,6 +304,7 @@ elm_pager_content_push(Evas_Object *obj, Evas_Object *content) EAPI void elm_pager_content_pop(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Eina_List *ll; Item *it; @@ -344,6 +355,7 @@ elm_pager_content_pop(Evas_Object *obj) EAPI void elm_pager_content_promote(Evas_Object *obj, Evas_Object *content) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Eina_List *l; Item *it; @@ -371,6 +383,7 @@ elm_pager_content_promote(Evas_Object *obj, Evas_Object *content) EAPI Evas_Object * elm_pager_content_bottom_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Item *it; @@ -390,6 +403,7 @@ elm_pager_content_bottom_get(Evas_Object *obj) EAPI Evas_Object * elm_pager_content_top_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Item *it; diff --git a/src/lib/elm_panel.c b/src/lib/elm_panel.c index 2f8b491f2..9b4df2b1f 100644 --- a/src/lib/elm_panel.c +++ b/src/lib/elm_panel.c @@ -9,6 +9,7 @@ struct _Widget_Data Eina_Bool hidden : 1; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -19,6 +20,7 @@ static void _toggle_panel(void *data, Evas_Object *obj, const char *emission, co static void _del_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); free(wd); @@ -27,6 +29,7 @@ _del_hook(Evas_Object *obj) static void _theme_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); int scale = 0; @@ -38,6 +41,7 @@ _theme_hook(Evas_Object *obj) static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord mw = -1, mh = -1; Evas_Coord vw = 0, vh = 0; @@ -66,6 +70,7 @@ _sizing_eval(Evas_Object *obj) static void _resize(void *data, Evas *evas, Evas_Object *obj, void *event) { + Widget_Data *wd = elm_widget_data_get(data); Evas_Coord mw, mh, vw, vh, w, h; @@ -89,6 +94,7 @@ _layout(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) static void _toggle_panel(void *data, Evas_Object *obj, const char *emission, const char *source) { + Widget_Data *wd = elm_widget_data_get(data); if (wd->hidden) @@ -115,6 +121,7 @@ elm_panel_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); evas = evas_object_evas_get(parent); obj = elm_widget_add(evas); + ELM_SET_WIDTYPE(widtype, "panel"); elm_widget_type_set(obj, "panel"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -152,6 +159,7 @@ elm_panel_add(Evas_Object *parent) EAPI void elm_panel_orient_set(Evas_Object *obj, Elm_Panel_Orient orient) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->orient = orient; @@ -173,6 +181,7 @@ elm_panel_orient_set(Evas_Object *obj, Elm_Panel_Orient orient) EAPI void elm_panel_content_set(Evas_Object *obj, Evas_Object *content) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); evas_object_box_remove_all(wd->bx, EINA_TRUE); diff --git a/src/lib/elm_photo.c b/src/lib/elm_photo.c index 9b989c352..7f35ceef0 100644 --- a/src/lib/elm_photo.c +++ b/src/lib/elm_photo.c @@ -22,6 +22,7 @@ struct _Widget_Data int size; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -30,6 +31,7 @@ static void _mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _del_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); free(wd); } @@ -37,6 +39,7 @@ _del_hook(Evas_Object *obj) static void _theme_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); edje_object_scale_set(wd->frm, elm_widget_scale_get(obj) * _elm_config->scale); _sizing_eval(obj); @@ -45,6 +48,7 @@ _theme_hook(Evas_Object *obj) static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; @@ -85,6 +89,7 @@ elm_photo_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "photo"); elm_widget_type_set(obj, "photo"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -128,6 +133,7 @@ elm_photo_add(Evas_Object *parent) EAPI Eina_Bool elm_photo_file_set(Evas_Object *obj, const char *file) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!_els_smart_icon_file_key_set(wd->img, file, NULL)) return 0; @@ -146,6 +152,7 @@ elm_photo_file_set(Evas_Object *obj, const char *file) EAPI void elm_photo_size_set(Evas_Object *obj, int size) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (size < 0) size = 0; wd->size = size; diff --git a/src/lib/elm_photocam.c b/src/lib/elm_photocam.c index e13cea095..ab047a711 100644 --- a/src/lib/elm_photocam.c +++ b/src/lib/elm_photocam.c @@ -136,6 +136,7 @@ struct _Pan Widget_Data *wd; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _show_region_hook(void *data, Evas_Object *obj); @@ -161,6 +162,7 @@ nearest_pow2(int num) static void img_place(Evas_Object *obj, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_Coord oy, Evas_Coord ow, Evas_Coord oh) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord ax, ay, gw, gh; int x, y; @@ -186,6 +188,7 @@ img_place(Evas_Object *obj, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_Co static void grid_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_Coord oy, Evas_Coord ow, Evas_Coord oh) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord ax, ay, gw, gh, tx, ty; int x, y; @@ -230,6 +233,7 @@ grid_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord o static void grid_clear(Evas_Object *obj, Grid *g) { + Widget_Data *wd = elm_widget_data_get(obj); int x, y; @@ -291,6 +295,7 @@ grid_zoom_calc(double zoom) static Grid * grid_create(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); int x, y; Grid *g; @@ -359,6 +364,7 @@ grid_create(Evas_Object *obj) static void grid_load(Evas_Object *obj, Grid *g) { + Widget_Data *wd = elm_widget_data_get(obj); int x, y; Evas_Coord ox, oy, ow, oh, cvx, cvy, cvw, cvh, gw, gh, ax, ay, tx, ty; @@ -451,6 +457,7 @@ grid_load(Evas_Object *obj, Grid *g) static void grid_clearall(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Grid *g; @@ -464,6 +471,7 @@ grid_clearall(Evas_Object *obj) static void _smooth_update(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); int x, y; Eina_List *l; @@ -505,6 +513,7 @@ _grid_raise(Grid *g) static int _scr_timeout(void *data) { + Widget_Data *wd = elm_widget_data_get(data); wd->nosmooth--; if (wd->nosmooth == 0) _smooth_update(data); @@ -515,6 +524,7 @@ _scr_timeout(void *data) static void _scr(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); if (!wd->scr_timer) { @@ -529,6 +539,7 @@ static void _main_preloaded(void *data, Evas *e, Evas_Object *o, void *event_info) { Evas_Object *obj = data; + Widget_Data *wd = elm_widget_data_get(obj); Grid *g; @@ -555,6 +566,7 @@ _main_preloaded(void *data, Evas *e, Evas_Object *o, void *event_info) static int zoom_do(Evas_Object *obj, double t) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord xx, yy, ow, oh; @@ -600,6 +612,7 @@ static int _zoom_anim(void *data) { Evas_Object *obj = data; + Widget_Data *wd = elm_widget_data_get(obj); double t; int go; @@ -627,6 +640,7 @@ _zoom_anim(void *data) static void _mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); Evas_Event_Mouse_Move *ev = event_info; } @@ -634,6 +648,7 @@ _mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event_info) static int _long_press(void *data) { + Widget_Data *wd = elm_widget_data_get(data); wd->long_timer = NULL; wd->longpressed = EINA_TRUE; @@ -644,6 +659,7 @@ _long_press(void *data) static void _mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); Evas_Event_Mouse_Down *ev = event_info; if (ev->button != 1) return; @@ -661,6 +677,7 @@ _mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info) static void _mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); Evas_Event_Mouse_Up *ev = event_info; if (ev->button != 1) return; @@ -681,6 +698,7 @@ static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_NULL; static void _del_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Grid *g; @@ -702,6 +720,7 @@ _del_hook(Evas_Object *obj) static void _theme_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); elm_smart_scroller_theme_set(wd->scr, "photocam", "base", elm_widget_style_get(obj)); edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale); @@ -711,6 +730,7 @@ _theme_hook(Evas_Object *obj) static void _show_region_hook(void *data, Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(data); Evas_Coord x, y, w, h; elm_widget_show_region_get(obj, &x, &y, &w, &h); @@ -720,6 +740,7 @@ _show_region_hook(void *data, Evas_Object *obj) static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; @@ -866,6 +887,7 @@ _pan_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) static void _hold_on(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_smart_scroller_hold_set(wd->scr, 1); @@ -874,6 +896,7 @@ _hold_on(void *data, Evas_Object *obj, void *event_info) static void _hold_off(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_smart_scroller_hold_set(wd->scr, 0); @@ -882,6 +905,7 @@ _hold_off(void *data, Evas_Object *obj, void *event_info) static void _freeze_on(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_smart_scroller_freeze_set(wd->scr, 1); @@ -890,6 +914,7 @@ _freeze_on(void *data, Evas_Object *obj, void *event_info) static void _freeze_off(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_smart_scroller_freeze_set(wd->scr, 0); @@ -946,6 +971,7 @@ elm_photocam_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "photocam"); elm_widget_type_set(obj, "photocam"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -1046,6 +1072,7 @@ elm_photocam_add(Evas_Object *parent) EAPI int elm_photocam_file_set(Evas_Object *obj, const char *file) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); int w, h; @@ -1103,6 +1130,7 @@ elm_photocam_file_set(Evas_Object *obj, const char *file) */ EAPI const char * elm_photocam_file_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->file; } @@ -1124,6 +1152,7 @@ EAPI const char * elm_photocam_file_get(Evas_Object *obj) EAPI void elm_photocam_zoom_set(Evas_Object *obj, double zoom) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Eina_List *l; Grid *g, *g_zoom = NULL; @@ -1321,6 +1350,7 @@ elm_photocam_zoom_set(Evas_Object *obj, double zoom) EAPI double elm_photocam_zoom_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->zoom; } @@ -1346,6 +1376,7 @@ elm_photocam_zoom_get(Evas_Object *obj) EAPI void elm_photocam_zoom_mode_set(Evas_Object *obj, Elm_Photocam_Zoom_Mode mode) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->mode == mode) return; wd->mode = mode; @@ -1369,6 +1400,7 @@ elm_photocam_zoom_mode_set(Evas_Object *obj, Elm_Photocam_Zoom_Mode mode) EAPI Elm_Photocam_Zoom_Mode elm_photocam_zoom_mode_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->mode; } @@ -1389,6 +1421,7 @@ elm_photocam_zoom_mode_get(Evas_Object *obj) EAPI void elm_photocam_image_size_get(Evas_Object *obj, int *w, int *h) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (w) *w = wd->size.imw; if (h) *h = wd->size.imh; @@ -1403,6 +1436,7 @@ elm_photocam_image_size_get(Evas_Object *obj, int *w, int *h) EAPI void elm_photocam_region_get(Evas_Object *obj, int *x, int *y, int *w, int *h) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord sx, sy, sw, sh; int iw, ih; @@ -1468,6 +1502,7 @@ elm_photocam_region_get(Evas_Object *obj, int *x, int *y, int *w, int *h) EAPI void elm_photocam_image_region_show(Evas_Object *obj, int x, int y, int w, int h) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); int rx, ry, rw, rh; @@ -1507,6 +1542,7 @@ elm_photocam_image_region_show(Evas_Object *obj, int x, int y, int w, int h) EAPI void elm_photocam_image_region_bring_in(Evas_Object *obj, int x, int y, int w, int h) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); int rx, ry, rw, rh; @@ -1544,6 +1580,7 @@ elm_photocam_image_region_bring_in(Evas_Object *obj, int x, int y, int w, int h) EAPI void elm_photocam_paused_set(Evas_Object *obj, Eina_Bool paused) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->paused == !!paused) return; wd->paused = paused; @@ -1570,6 +1607,7 @@ elm_photocam_paused_set(Evas_Object *obj, Eina_Bool paused) EAPI Eina_Bool elm_photocam_paused_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->paused; } @@ -1587,6 +1625,7 @@ elm_photocam_paused_get(Evas_Object *obj) EAPI Evas_Object * elm_photocam_internal_image_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->img; } diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h index c8a3e01d7..a976ab82d 100644 --- a/src/lib/elm_priv.h +++ b/src/lib/elm_priv.h @@ -151,7 +151,8 @@ EAPI const char *elm_widget_type_get(const Evas_Object *obj); EAPI Eina_List *_stringlist_get(const char *str); EAPI void _stringlist_free(Eina_List *list); - +#define ELM_SET_WIDTYPE(widtype, type) if (!widtype) widtype = eina_stringshare_add(type); +#define ELM_CHECK_WIDTYPE(obj, widtype) if (elm_widget_type_get(obj) != widtype) return; extern char *_elm_appname; extern Elm_Config *_elm_config; diff --git a/src/lib/elm_progressbar.c b/src/lib/elm_progressbar.c index 5c9a84991..3b2ae3197 100644 --- a/src/lib/elm_progressbar.c +++ b/src/lib/elm_progressbar.c @@ -43,6 +43,7 @@ struct _Widget_Data double val; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -54,6 +55,7 @@ static void _val_set(Evas_Object *obj); static void _del_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (wd->label) eina_stringshare_del(wd->label); if (wd->units) eina_stringshare_del(wd->units); @@ -63,6 +65,7 @@ _del_hook(Evas_Object *obj) static void _theme_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); edje_object_part_unswallow(NULL, wd->spacer); @@ -109,6 +112,7 @@ _theme_hook(Evas_Object *obj) static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1; @@ -120,6 +124,7 @@ _sizing_eval(Evas_Object *obj) static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); if (obj != wd->icon) return; _sizing_eval(data); @@ -128,6 +133,7 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _sub_del(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Object *sub = event_info; if (sub == wd->icon) @@ -143,6 +149,7 @@ _sub_del(void *data, Evas_Object *obj, void *event_info) static void _val_fetch(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); double posx = MIN_RATIO_LVL, posy = MIN_RATIO_LVL, pos = MIN_RATIO_LVL; @@ -161,6 +168,7 @@ _val_fetch(Evas_Object *obj) static void _val_set(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); double pos; pos = wd->val; @@ -171,6 +179,7 @@ _val_set(Evas_Object *obj) static void _units_set(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (wd->units) { @@ -201,6 +210,7 @@ elm_progressbar_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "progressbar"); elm_widget_type_set(obj, "progressbar"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -244,6 +254,7 @@ elm_progressbar_add(Evas_Object *parent) EAPI void elm_progressbar_pulse_set (Evas_Object *obj, Eina_Bool pulse) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); pulse = !!pulse; if (wd->pulse == pulse) return; @@ -264,6 +275,7 @@ elm_progressbar_pulse_set (Evas_Object *obj, Eina_Bool pulse) EAPI void elm_progressbar_pulse (Evas_Object *obj, Eina_Bool state) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); state = !!state; if (!wd->pulse && wd->pulse_state == state) return; @@ -285,6 +297,7 @@ elm_progressbar_pulse (Evas_Object *obj, Eina_Bool state) EAPI void elm_progressbar_value_set (Evas_Object *obj, double val) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->val == val) return; wd->val = val; @@ -306,6 +319,7 @@ elm_progressbar_value_set (Evas_Object *obj, double val) EAPI double elm_progressbar_value_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->val; } @@ -321,6 +335,7 @@ elm_progressbar_value_get(const Evas_Object *obj) EAPI void elm_progressbar_label_set(Evas_Object *obj, const char *label) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->label) eina_stringshare_del(wd->label); @@ -356,6 +371,7 @@ elm_progressbar_label_set(Evas_Object *obj, const char *label) EAPI void elm_progressbar_icon_set(Evas_Object *obj, Evas_Object *icon) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if ((wd->icon != icon) && (wd->icon)) elm_widget_sub_object_del(obj, wd->icon); @@ -387,6 +403,7 @@ elm_progressbar_icon_set(Evas_Object *obj, Evas_Object *icon) EAPI void elm_progressbar_span_size_set(Evas_Object *obj, Evas_Coord size) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->size == size) return; wd->size = size; @@ -414,6 +431,7 @@ elm_progressbar_span_size_set(Evas_Object *obj, Evas_Coord size) EAPI void elm_progressbar_unit_format_set(Evas_Object *obj, const char *units) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->units) eina_stringshare_del(wd->units); if (units) @@ -443,6 +461,7 @@ elm_progressbar_unit_format_set(Evas_Object *obj, const char *units) EAPI void elm_progressbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); horizontal = !!horizontal; if (wd->horizontal == horizontal) return; @@ -466,6 +485,7 @@ elm_progressbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) EAPI void elm_progressbar_inverted_set(Evas_Object *obj, Eina_Bool inverted) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); inverted = !!inverted; if (wd->inverted == inverted) return; diff --git a/src/lib/elm_radio.c b/src/lib/elm_radio.c index 8982a04b3..18aebe1a1 100644 --- a/src/lib/elm_radio.c +++ b/src/lib/elm_radio.c @@ -50,6 +50,7 @@ struct _Widget_Data Group *group; }; +static const char *widtype = NULL; static void _state_set(Evas_Object *obj, Eina_Bool state); static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); @@ -63,6 +64,7 @@ static void _signal_radio_toggle(void *data, Evas_Object *obj, const char *emiss static void _del_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (wd->label) eina_stringshare_del(wd->label); wd->group->radios = eina_list_remove(wd->group->radios, obj); @@ -74,6 +76,7 @@ _del_hook(Evas_Object *obj) static void _theme_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); _elm_theme_set(wd->chk, "radio", "base", elm_widget_style_get(obj)); if (wd->icon) @@ -97,6 +100,7 @@ _theme_hook(Evas_Object *obj) static void _disable_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (elm_widget_disabled_get(obj)) { @@ -110,6 +114,7 @@ _disable_hook(Evas_Object *obj) static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1; @@ -123,6 +128,7 @@ _sizing_eval(Evas_Object *obj) static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); if (obj != wd->icon) return; _sizing_eval(data); @@ -131,6 +137,7 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _sub_del(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Object *sub = event_info; if (sub == wd->icon) @@ -146,6 +153,7 @@ _sub_del(void *data, Evas_Object *obj, void *event_info) static void _state_set(Evas_Object *obj, Eina_Bool state) { + Widget_Data *wd = elm_widget_data_get(obj); if ((state != wd->state) && (!elm_widget_disabled_get(obj))) { @@ -182,6 +190,7 @@ _state_set_all(Widget_Data *wd) static void _signal_radio_on(void *data, Evas_Object *obj, const char *emission, const char *source) { + Widget_Data *wd = elm_widget_data_get(data); if (wd->group->value == wd->value) return; wd->group->value = wd->value; @@ -208,6 +217,7 @@ elm_radio_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "radio"); elm_widget_type_set(obj, "radio"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -242,6 +252,7 @@ elm_radio_add(Evas_Object *parent) EAPI void elm_radio_label_set(Evas_Object *obj, const char *label) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord mw, mh; @@ -273,6 +284,7 @@ elm_radio_label_set(Evas_Object *obj, const char *label) EAPI const char* elm_radio_label_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; @@ -295,6 +307,7 @@ elm_radio_label_get(Evas_Object *obj) EAPI void elm_radio_icon_set(Evas_Object *obj, Evas_Object *icon) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if ((wd->icon != icon) && (wd->icon)) elm_widget_sub_object_del(obj, wd->icon); @@ -321,6 +334,7 @@ elm_radio_icon_set(Evas_Object *obj, Evas_Object *icon) EAPI Evas_Object * elm_radio_icon_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->icon; @@ -342,6 +356,7 @@ elm_radio_icon_get(Evas_Object *obj) EAPI void elm_radio_group_add(Evas_Object *obj, Evas_Object *group) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Widget_Data *wd2 = elm_widget_data_get(group); Eina_Bool state = EINA_FALSE; @@ -378,6 +393,7 @@ elm_radio_group_add(Evas_Object *obj, Evas_Object *group) EAPI void elm_radio_state_value_set(Evas_Object *obj, int value) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); // if (wd->value == value) return; wd->value = value; @@ -399,6 +415,7 @@ elm_radio_state_value_set(Evas_Object *obj, int value) EAPI void elm_radio_value_set(Evas_Object *obj, int value) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); const Eina_List *l; Evas_Object *child; @@ -419,6 +436,7 @@ elm_radio_value_set(Evas_Object *obj, int value) EAPI int elm_radio_value_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->group->value; } @@ -441,6 +459,7 @@ elm_radio_value_get(const Evas_Object *obj) EAPI void elm_radio_value_pointer_set(Evas_Object *obj, int *valuep) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (valuep) diff --git a/src/lib/elm_scroller.c b/src/lib/elm_scroller.c index 690672bd1..986a9d18b 100644 --- a/src/lib/elm_scroller.c +++ b/src/lib/elm_scroller.c @@ -42,6 +42,7 @@ struct _Widget_Data Evas_Coord pagesize_h, pagesize_v; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _show_region_hook(void *data, Evas_Object *obj); @@ -51,6 +52,7 @@ static void _sub_del(void *data, Evas_Object *obj, void *event_info); static void _del_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; free(wd); @@ -59,6 +61,7 @@ _del_hook(Evas_Object *obj) static void _theme_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_smart_scroller_theme_set(wd->scr, "scroller", "base", elm_widget_style_get(obj)); @@ -69,6 +72,7 @@ _theme_hook(Evas_Object *obj) static void _show_region_hook(void *data, Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(data); Evas_Coord x, y, w, h; if (!wd) return; @@ -79,6 +83,7 @@ _show_region_hook(void *data, Evas_Object *obj) static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord vw, vh, minw, minh, maxw, maxh, w, h, vmw, vmh; double xw, xy; @@ -118,6 +123,7 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _sub_del(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Object *sub = event_info; @@ -135,6 +141,7 @@ _sub_del(void *data, Evas_Object *obj, void *event_info) static void _hold_on(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -144,6 +151,7 @@ _hold_on(void *data, Evas_Object *obj, void *event_info) static void _hold_off(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -153,6 +161,7 @@ _hold_off(void *data, Evas_Object *obj, void *event_info) static void _freeze_on(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -162,6 +171,7 @@ _freeze_on(void *data, Evas_Object *obj, void *event_info) static void _freeze_off(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -247,6 +257,7 @@ elm_scroller_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "scroller"); elm_widget_type_set(obj, "scroller"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -296,6 +307,7 @@ elm_scroller_add(Evas_Object *parent) EAPI void elm_scroller_content_set(Evas_Object *obj, Evas_Object *content) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if ((wd->content != content) && (wd->content)) @@ -328,6 +340,7 @@ elm_scroller_content_set(Evas_Object *obj, Evas_Object *content) EAPI void elm_scroller_content_min_limit(Evas_Object *obj, Eina_Bool w, Eina_Bool h) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; wd->min_w = w; @@ -353,6 +366,7 @@ elm_scroller_content_min_limit(Evas_Object *obj, Eina_Bool w, Eina_Bool h) EAPI void elm_scroller_region_show(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_smart_scroller_child_region_show(wd->scr, x, y, w, h); @@ -376,6 +390,7 @@ elm_scroller_region_show(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coor EAPI void elm_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); const Elm_Scroller_Policy map[3] = { @@ -407,6 +422,7 @@ elm_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scro EAPI void elm_scroller_region_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if ((x) && (y)) elm_smart_scroller_child_pos_get(wd->scr, x, y); @@ -429,6 +445,7 @@ elm_scroller_region_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coo EAPI void elm_scroller_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; evas_object_geometry_get(wd->content, NULL, NULL, w, h); @@ -455,6 +472,7 @@ elm_scroller_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EAPI void elm_scroller_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_smart_scroller_bounce_allow_set(wd->scr, h_bounce, v_bounce); @@ -483,6 +501,7 @@ elm_scroller_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce EAPI void elm_scroller_page_relative_set(Evas_Object *obj, double h_pagerel, double v_pagerel) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; wd->pagerel_h = h_pagerel; @@ -507,6 +526,7 @@ elm_scroller_page_relative_set(Evas_Object *obj, double h_pagerel, double v_page EAPI void elm_scroller_page_size_set(Evas_Object *obj, Evas_Coord h_pagesize, Evas_Coord v_pagesize) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; wd->pagesize_h = h_pagesize; @@ -537,6 +557,7 @@ elm_scroller_page_size_set(Evas_Object *obj, Evas_Coord h_pagesize, Evas_Coord v EAPI void elm_scroller_region_bring_in(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_smart_scroller_region_bring_in(wd->scr, x, y, w, h); diff --git a/src/lib/elm_separator.c b/src/lib/elm_separator.c index c4b6edf7b..612af236a 100644 --- a/src/lib/elm_separator.c +++ b/src/lib/elm_separator.c @@ -9,6 +9,7 @@ struct _Widget_Data Eina_Bool horizontal; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -16,6 +17,7 @@ static void _sizing_eval(Evas_Object *obj); static void _del_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); free(wd); } @@ -23,6 +25,7 @@ _del_hook(Evas_Object *obj) static void _theme_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (wd->horizontal) _elm_theme_set(wd->sep, "separator", "horizontal", elm_widget_style_get(obj)); @@ -35,6 +38,7 @@ _theme_hook(Evas_Object *obj) static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; @@ -54,6 +58,7 @@ elm_separator_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "separator"); wd->horizontal = EINA_FALSE; elm_widget_type_set(obj, "separator"); elm_widget_sub_object_add(parent, obj); @@ -72,6 +77,7 @@ elm_separator_add(Evas_Object *parent) EAPI void elm_separator_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; horizontal = !!horizontal; @@ -83,6 +89,7 @@ elm_separator_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) EAPI Eina_Bool elm_separator_horizontal_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return EINA_FALSE; return wd->horizontal; diff --git a/src/lib/elm_slider.c b/src/lib/elm_slider.c index d97a1485a..d2d47dd32 100644 --- a/src/lib/elm_slider.c +++ b/src/lib/elm_slider.c @@ -57,6 +57,7 @@ struct _Widget_Data Evas_Coord size; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -68,6 +69,7 @@ static void _indicator_set(Evas_Object *obj); static void _del_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (wd->label) eina_stringshare_del(wd->label); if (wd->indicator) eina_stringshare_del(wd->units); @@ -78,6 +80,7 @@ _del_hook(Evas_Object *obj) static void _theme_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (wd->horizontal) _elm_theme_set(wd->slider, "slider", "horizontal", elm_widget_style_get(obj)); @@ -114,6 +117,7 @@ _theme_hook(Evas_Object *obj) static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; @@ -127,6 +131,7 @@ _sizing_eval(Evas_Object *obj) static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); if (obj != wd->icon) return; _sizing_eval(data); @@ -135,6 +140,7 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _sub_del(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Object *sub = event_info; if (sub == wd->icon) @@ -150,6 +156,7 @@ _sub_del(void *data, Evas_Object *obj, void *event_info) static int _delay_change(void *data) { + Widget_Data *wd = elm_widget_data_get(data); wd->delay = NULL; evas_object_smart_callback_call(data, "delay,changed", NULL); @@ -159,6 +166,7 @@ _delay_change(void *data) static void _val_fetch(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); double posx = 0.0, posy = 0.0, pos = 0.0, val; @@ -180,6 +188,7 @@ _val_fetch(Evas_Object *obj) static void _val_set(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); double pos; if (wd->val_max > wd->val_min) @@ -195,6 +204,7 @@ _val_set(Evas_Object *obj) static void _units_set(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (wd->units) { @@ -210,6 +220,7 @@ _units_set(Evas_Object *obj) static void _indicator_set(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (wd->indicator_format_func) { @@ -273,6 +284,7 @@ elm_slider_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "slider"); elm_widget_type_set(obj, "slider"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -318,6 +330,7 @@ elm_slider_add(Evas_Object *parent) EAPI void elm_slider_label_set(Evas_Object *obj, const char *label) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->label) eina_stringshare_del(wd->label); @@ -348,6 +361,7 @@ elm_slider_label_set(Evas_Object *obj, const char *label) EAPI const char* elm_slider_label_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; @@ -370,6 +384,7 @@ elm_slider_label_get(Evas_Object *obj) EAPI void elm_slider_icon_set(Evas_Object *obj, Evas_Object *icon) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if ((wd->icon != icon) && (wd->icon)) elm_widget_sub_object_del(obj, wd->icon); @@ -396,6 +411,7 @@ elm_slider_icon_set(Evas_Object *obj, Evas_Object *icon) EAPI Evas_Object * elm_slider_icon_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->icon; @@ -417,6 +433,7 @@ elm_slider_icon_get(Evas_Object *obj) EAPI void elm_slider_span_size_set(Evas_Object *obj, Evas_Coord size) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->size == size) return; wd->size = size; @@ -444,6 +461,7 @@ elm_slider_span_size_set(Evas_Object *obj, Evas_Coord size) EAPI void elm_slider_unit_format_set(Evas_Object *obj, const char *units) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->units) eina_stringshare_del(wd->units); if (units) @@ -478,6 +496,7 @@ elm_slider_unit_format_set(Evas_Object *obj, const char *units) EAPI void elm_slider_indicator_format_set(Evas_Object *obj, const char *indicator) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->indicator) eina_stringshare_del(wd->indicator); if (indicator) wd->indicator = eina_stringshare_add(indicator); @@ -496,6 +515,7 @@ elm_slider_indicator_format_set(Evas_Object *obj, const char *indicator) EAPI void elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); horizontal = !!horizontal; if (wd->horizontal == horizontal) return; @@ -517,6 +537,7 @@ elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) EAPI void elm_slider_min_max_set(Evas_Object *obj, double min, double max) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if ((wd->val_min == min) && (wd->val_max == max)) return; wd->val_min = min; @@ -539,6 +560,7 @@ elm_slider_min_max_set(Evas_Object *obj, double min, double max) EAPI void elm_slider_value_set(Evas_Object *obj, double val) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->val == val) return; wd->val = val; @@ -560,6 +582,7 @@ elm_slider_value_set(Evas_Object *obj, double val) EAPI double elm_slider_value_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->val; } @@ -580,6 +603,7 @@ elm_slider_value_get(const Evas_Object *obj) EAPI void elm_slider_inverted_set(Evas_Object *obj, Eina_Bool inverted) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); inverted = !!inverted; if (wd->inverted == inverted) return; @@ -609,6 +633,7 @@ elm_slider_inverted_set(Evas_Object *obj, Eina_Bool inverted) EAPI void elm_slider_indicator_format_function_set(Evas_Object *obj, const char *(*func)(double val)) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->indicator_format_func = func; _indicator_set(obj); diff --git a/src/lib/elm_slideshow.c b/src/lib/elm_slideshow.c index 3e708faf9..0a6a39559 100644 --- a/src/lib/elm_slideshow.c +++ b/src/lib/elm_slideshow.c @@ -47,6 +47,7 @@ struct _Widget_Data int timeout; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -56,6 +57,7 @@ static int _timer_cb(void *data); static void _del_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); elm_slideshow_clear(obj); @@ -68,6 +70,7 @@ _del_hook(Evas_Object *obj) static void _theme_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if(!wd) return; @@ -80,6 +83,7 @@ _theme_hook(Evas_Object *obj) static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1; @@ -104,6 +108,7 @@ static void _end(void *data, Evas_Object *obj, const char *emission, const char *source) { Elm_Slideshow_Item *item; + Widget_Data *wd = elm_widget_data_get(data); item = wd->previous; @@ -127,6 +132,7 @@ static int _timer_cb(void *data) { Evas_Object *obj = data; + Widget_Data *wd = elm_widget_data_get(obj); wd->timer = NULL; @@ -139,6 +145,7 @@ _item_realize(Elm_Slideshow_Item *item) { Elm_Slideshow_Item *_item; Evas_Object *obj = item->obj; + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord w, h; @@ -217,6 +224,7 @@ elm_slideshow_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "slideshow"); elm_widget_type_set(obj, "slideshow"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -256,6 +264,7 @@ EAPI Elm_Slideshow_Item* elm_slideshow_item_add(Evas_Object *obj, const Elm_Slideshow_Item_Class *itc, const void *data) { Elm_Slideshow_Item *item; + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if(!wd) return NULL; @@ -307,6 +316,7 @@ elm_slideshow_next(Evas_Object *obj) { char buf[1024]; Elm_Slideshow_Item *next = NULL; + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -349,6 +359,7 @@ elm_slideshow_previous(Evas_Object *obj) { char buf[1024]; Elm_Slideshow_Item *prev; + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -390,6 +401,7 @@ elm_slideshow_previous(Evas_Object *obj) const Eina_List * elm_slideshow_transitions_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if(!wd) return NULL; @@ -405,6 +417,7 @@ elm_slideshow_transitions_get(Evas_Object *obj) EAPI void elm_slideshow_transition_set(Evas_Object *obj, const char *transition) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if(!wd) return; @@ -422,6 +435,7 @@ elm_slideshow_transition_set(Evas_Object *obj, const char *transition) EAPI void elm_slideshow_timeout_set(Evas_Object *obj ,int timeout) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if(!wd) return; @@ -441,6 +455,7 @@ elm_slideshow_timeout_set(Evas_Object *obj ,int timeout) EAPI int elm_slideshow_timeout_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if(!wd) return -1; @@ -456,6 +471,7 @@ elm_slideshow_timeout_get(Evas_Object *obj) EAPI void elm_slideshow_loop_set(Evas_Object *obj, int loop) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if(!wd) return; @@ -471,6 +487,7 @@ EAPI void elm_slideshow_clear(Evas_Object *obj) { Elm_Slideshow_Item *item; + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if(!wd) return; @@ -536,6 +553,7 @@ elm_slideshow_item_del(Elm_Slideshow_Item *item) EAPI const Eina_List* elm_slideshow_items_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; @@ -552,6 +570,7 @@ elm_slideshow_items_get(const Evas_Object *obj) EAPI Elm_Slideshow_Item* elm_slideshow_item_current_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c index 37fb33758..fe42dabb4 100644 --- a/src/lib/elm_spinner.c +++ b/src/lib/elm_spinner.c @@ -36,6 +36,7 @@ struct _Widget_Data Eina_Bool dragging : 1; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _disable_hook(Evas_Object *obj); static void _write_label(Evas_Object *obj); @@ -47,6 +48,7 @@ static Eina_Bool _value_set(Evas_Object *obj, double delta); static void _del_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (wd->label) eina_stringshare_del(wd->label); @@ -57,6 +59,7 @@ _del_hook(Evas_Object *obj) static void _disable_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (elm_widget_disabled_get(obj)) edje_object_signal_emit(wd->spinner, "elm,state,disabled", "elm"); @@ -67,6 +70,7 @@ _disable_hook(Evas_Object *obj) static void _theme_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); _elm_theme_set(wd->spinner, "spinner", "base", elm_widget_style_get(obj)); edje_object_part_swallow(wd->spinner, "elm.swallow.entry", wd->ent); @@ -79,6 +83,7 @@ _theme_hook(Evas_Object *obj) static int _delay_change(void *data) { + Widget_Data *wd = elm_widget_data_get(data); wd->delay = NULL; evas_object_smart_callback_call(data, "delay,changed", NULL); @@ -132,6 +137,7 @@ _entry_show(Widget_Data *wd) static void _write_label(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); char buf[1024]; @@ -148,6 +154,7 @@ _write_label(Evas_Object *obj) static Eina_Bool _value_set(Evas_Object *obj, double delta) { + Widget_Data *wd = elm_widget_data_get(obj); double new_val; @@ -180,6 +187,7 @@ _value_set(Evas_Object *obj, double delta) static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1; @@ -200,6 +208,7 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _val_set(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); double pos = 0.0; @@ -214,6 +223,7 @@ _val_set(Evas_Object *obj) static void _drag(void *data, Evas_Object *obj, const char *emission, const char *source) { + Widget_Data *wd = elm_widget_data_get(data); double pos = 0.0, offset, delta; @@ -232,6 +242,7 @@ _drag(void *data, Evas_Object *obj, const char *emission, const char *source) static void _drag_start(void *data, Evas_Object *obj, const char *emission, const char *source) { + Widget_Data *wd = elm_widget_data_get(data); double pos; @@ -243,6 +254,7 @@ _drag_start(void *data, Evas_Object *obj, const char *emission, const char *sour static void _drag_stop(void *data, Evas_Object *obj, const char *emission, const char *source) { + Widget_Data *wd = elm_widget_data_get(data); wd->drag_start_pos = 0; @@ -252,6 +264,7 @@ _drag_stop(void *data, Evas_Object *obj, const char *emission, const char *sourc static void _hide_entry(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -262,6 +275,7 @@ _hide_entry(Evas_Object *obj) static void _reset_value(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -272,6 +286,7 @@ _reset_value(Evas_Object *obj) static void _apply_entry_value(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); const char *str; char *end; @@ -290,6 +305,7 @@ _apply_entry_value(Evas_Object *obj) static void _toggle_entry(void *data, Evas_Object *obj, const char *emission, const char *source) { + Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; @@ -315,6 +331,7 @@ _toggle_entry(void *data, Evas_Object *obj, const char *emission, const char *so static int _spin_value(void *data) { + Widget_Data *wd = elm_widget_data_get(data); if (!wd) return ECORE_CALLBACK_CANCEL; @@ -329,6 +346,7 @@ _spin_value(void *data) static void _val_inc_start(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -342,6 +360,7 @@ _val_inc_start(Evas_Object *obj) static void _val_inc_stop(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -354,6 +373,7 @@ _val_inc_stop(Evas_Object *obj) static void _val_dec_start(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -367,6 +387,7 @@ _val_dec_start(Evas_Object *obj) static void _val_dec_stop(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -379,6 +400,7 @@ _val_dec_stop(Evas_Object *obj) static void _button_inc_start(void *data, Evas_Object *obj, const char *emission, const char *source) { + Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; @@ -393,6 +415,7 @@ _button_inc_start(void *data, Evas_Object *obj, const char *emission, const char static void _button_inc_stop(void *data, Evas_Object *obj, const char *emission, const char *source) { + Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; @@ -402,6 +425,7 @@ _button_inc_stop(void *data, Evas_Object *obj, const char *emission, const char static void _button_dec_start(void *data, Evas_Object *obj, const char *emission, const char *source) { + Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; @@ -416,6 +440,7 @@ _button_dec_start(void *data, Evas_Object *obj, const char *emission, const char static void _button_dec_stop(void *data, Evas_Object *obj, const char *emission, const char *source) { + Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; @@ -425,6 +450,7 @@ _button_dec_stop(void *data, Evas_Object *obj, const char *emission, const char static void _entry_activated(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; @@ -440,6 +466,7 @@ static void _entry_event_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info) { Evas_Event_Key_Down *ev = event_info; + Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; @@ -454,6 +481,7 @@ static void _entry_event_key_up(void *data, Evas *e, Evas_Object *obj, void *event_info) { Evas_Event_Key_Down *ev = event_info; + Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; @@ -484,6 +512,7 @@ elm_spinner_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "spinner"); elm_widget_type_set(obj, "spinner"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -555,6 +584,7 @@ elm_spinner_add(Evas_Object *parent) EAPI void elm_spinner_label_format_set(Evas_Object *obj, const char *fmt) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->label) eina_stringshare_del(wd->label); @@ -574,6 +604,7 @@ elm_spinner_label_format_set(Evas_Object *obj, const char *fmt) EAPI const char * elm_spinner_label_format_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; @@ -594,6 +625,7 @@ elm_spinner_label_format_get(Evas_Object *obj) EAPI void elm_spinner_min_max_set(Evas_Object *obj, double min, double max) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if ((wd->val_min == min) && (wd->val_max == max)) return; @@ -616,6 +648,7 @@ elm_spinner_min_max_set(Evas_Object *obj, double min, double max) EAPI void elm_spinner_step_set(Evas_Object *obj, double step) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->step = step; } @@ -631,6 +664,7 @@ elm_spinner_step_set(Evas_Object *obj, double step) EAPI void elm_spinner_value_set(Evas_Object *obj, double val) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->val == val) return; @@ -652,6 +686,7 @@ elm_spinner_value_set(Evas_Object *obj, double val) EAPI double elm_spinner_value_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->val; } @@ -668,6 +703,7 @@ elm_spinner_value_get(const Evas_Object *obj) EAPI void elm_spinner_wrap_set(Evas_Object *obj, Eina_Bool wrap) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); wd->wrap = wrap; } diff --git a/src/lib/elm_table.c b/src/lib/elm_table.c index 66aaee671..128a8cf80 100644 --- a/src/lib/elm_table.c +++ b/src/lib/elm_table.c @@ -16,6 +16,7 @@ struct _Widget_Data Evas_Object *tbl; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info); @@ -24,6 +25,7 @@ static void _sub_del(void *data, Evas_Object *obj, void *event_info); static void _del_pre_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); evas_object_event_callback_del_full @@ -34,6 +36,7 @@ _del_pre_hook(Evas_Object *obj) static void _del_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); free(wd); } @@ -41,6 +44,7 @@ _del_hook(Evas_Object *obj) static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; Evas_Coord w, h; @@ -67,6 +71,7 @@ static void _sub_del(void *data, Evas_Object *obj, void *event_info) { /* We do not add this callback, consequently we do not need to delete it + Widget_Data *wd = elm_widget_data_get(obj); evas_Object *sub = event_info; @@ -94,6 +99,7 @@ elm_table_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "table"); elm_widget_type_set(obj, "table"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -123,6 +129,7 @@ elm_table_add(Evas_Object *parent) EAPI void elm_table_homogenous_set(Evas_Object *obj, Eina_Bool homogenous) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); evas_object_table_homogeneous_set(wd->tbl, homogenous); } @@ -139,6 +146,7 @@ elm_table_homogenous_set(Evas_Object *obj, Eina_Bool homogenous) EAPI void elm_table_padding_set(Evas_Object *obj, Evas_Coord horizontal, Evas_Coord vertical) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); evas_object_table_padding_set(wd->tbl, horizontal, vertical); } @@ -158,6 +166,7 @@ elm_table_padding_set(Evas_Object *obj, Evas_Coord horizontal, Evas_Coord vertic EAPI void elm_table_pack(Evas_Object *obj, Evas_Object *subobj, int x, int y, int w, int h) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); elm_widget_sub_object_add(obj, subobj); evas_object_table_pack(wd->tbl, subobj, x, y, w, h); @@ -174,6 +183,7 @@ elm_table_pack(Evas_Object *obj, Evas_Object *subobj, int x, int y, int w, int h EAPI void elm_table_unpack(Evas_Object *obj, Evas_Object *subobj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); elm_widget_sub_object_del(obj, subobj); evas_object_table_unpack(wd->tbl, subobj); @@ -190,6 +200,7 @@ elm_table_unpack(Evas_Object *obj, Evas_Object *subobj) EAPI void elm_table_clear(Evas_Object *obj, Eina_Bool clear) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); evas_object_table_clear(wd->tbl, clear); } diff --git a/src/lib/elm_toggle.c b/src/lib/elm_toggle.c index 2c5744568..1f8c54c55 100644 --- a/src/lib/elm_toggle.c +++ b/src/lib/elm_toggle.c @@ -13,6 +13,7 @@ struct _Widget_Data const char *ontext, *offtext; }; +static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _disable_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); @@ -25,6 +26,7 @@ static void _signal_toggle_on(void *data, Evas_Object *obj, const char *emission static void _del_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (wd->label) eina_stringshare_del(wd->label); if (wd->ontext) eina_stringshare_del(wd->ontext); @@ -35,6 +37,7 @@ _del_hook(Evas_Object *obj) static void _disable_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (elm_widget_disabled_get(obj)) edje_object_signal_emit(wd->tgl, "elm,state,disabled", "elm"); @@ -45,6 +48,7 @@ _disable_hook(Evas_Object *obj) static void _theme_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); _elm_theme_set(wd->tgl, "toggle", "base", elm_widget_style_get(obj)); if (wd->icon) @@ -70,6 +74,7 @@ _theme_hook(Evas_Object *obj) static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1; @@ -83,6 +88,7 @@ _sizing_eval(Evas_Object *obj) static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); if (obj != wd->icon) return; _sizing_eval(data); @@ -91,6 +97,7 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _sub_del(void *data, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Object *sub = event_info; @@ -107,6 +114,7 @@ _sub_del(void *data, Evas_Object *obj, void *event_info) static void _signal_toggle_off(void *data, Evas_Object *obj, const char *emission, const char *source) { + Widget_Data *wd = elm_widget_data_get(data); wd->state = 0; @@ -117,6 +125,7 @@ _signal_toggle_off(void *data, Evas_Object *obj, const char *emission, const cha static void _signal_toggle_on(void *data, Evas_Object *obj, const char *emission, const char *source) { + Widget_Data *wd = elm_widget_data_get(data); wd->state = 1; @@ -134,6 +143,7 @@ elm_toggle_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "toggle"); elm_widget_type_set(obj, "toggle"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -162,6 +172,7 @@ elm_toggle_add(Evas_Object *parent) EAPI void elm_toggle_label_set(Evas_Object *obj, const char *label) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->label) eina_stringshare_del(wd->label); @@ -183,6 +194,7 @@ elm_toggle_label_set(Evas_Object *obj, const char *label) EAPI const char* elm_toggle_label_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; @@ -192,6 +204,7 @@ elm_toggle_label_get(Evas_Object *obj) EAPI void elm_toggle_icon_set(Evas_Object *obj, Evas_Object *icon) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if ((wd->icon != icon) && (wd->icon)) @@ -209,6 +222,7 @@ elm_toggle_icon_set(Evas_Object *obj, Evas_Object *icon) EAPI Evas_Object * elm_toggle_icon_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; @@ -218,6 +232,7 @@ elm_toggle_icon_get(Evas_Object *obj) EAPI void elm_toggle_states_labels_set(Evas_Object *obj, const char *onlabel, const char *offlabel) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (wd->ontext) eina_stringshare_del(wd->ontext); @@ -234,6 +249,7 @@ elm_toggle_states_labels_set(Evas_Object *obj, const char *onlabel, const char * EAPI void elm_toggle_state_set(Evas_Object *obj, Eina_Bool state) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (state != wd->state) @@ -250,6 +266,7 @@ elm_toggle_state_set(Evas_Object *obj, Eina_Bool state) EAPI Eina_Bool elm_toggle_state_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); return wd->state; @@ -258,6 +275,7 @@ elm_toggle_state_get(const Evas_Object *obj) EAPI void elm_toggle_state_pointer_set(Evas_Object *obj, Eina_Bool *statep) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (statep) diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c index a1355dd74..778f80b2e 100644 --- a/src/lib/elm_toolbar.c +++ b/src/lib/elm_toolbar.c @@ -33,6 +33,7 @@ struct _Elm_Toolbar_Item Evas_Object *o_menu; }; +static const char *widtype = NULL; static void _item_show(Elm_Toolbar_Item *it); static void _item_select(Elm_Toolbar_Item *it); static void _item_disable(Elm_Toolbar_Item *it, Eina_Bool disabled); @@ -140,6 +141,7 @@ _item_disable(Elm_Toolbar_Item *it, Eina_Bool disabled) static void _del_pre_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Elm_Toolbar_Item *it; @@ -158,6 +160,7 @@ _del_pre_hook(Evas_Object *obj) static void _del_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -167,6 +170,7 @@ _del_hook(Evas_Object *obj) static void _theme_hook(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); const Eina_List *l; Elm_Toolbar_Item *it; @@ -217,6 +221,7 @@ _theme_hook(Evas_Object *obj) static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1; Evas_Coord vw = 0, vh = 0; @@ -248,6 +253,7 @@ _sizing_eval(Evas_Object *obj) static void _resize(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(data); Evas_Coord mw, mh, vw, vh, x, y, w, h; const Eina_List *l; @@ -295,6 +301,7 @@ elm_toolbar_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); + ELM_SET_WIDTYPE(widtype, "toolbar"); elm_widget_type_set(obj, "toolbar"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -332,6 +339,7 @@ elm_toolbar_add(Evas_Object *parent) EAPI void elm_toolbar_icon_size_set(Evas_Object *obj, int icon_size) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -344,6 +352,7 @@ elm_toolbar_icon_size_set(Evas_Object *obj, int icon_size) EAPI int elm_toolbar_icon_size_get(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return 0; @@ -353,6 +362,7 @@ elm_toolbar_icon_size_get(Evas_Object *obj) EAPI Elm_Toolbar_Item * elm_toolbar_item_add(Evas_Object *obj, Evas_Object *icon, const char *label, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord mw, mh; Elm_Toolbar_Item *it; @@ -499,6 +509,7 @@ elm_toolbar_item_separator_get(Elm_Toolbar_Item *item) EAPI void elm_toolbar_scrollable_set(Evas_Object *obj, Eina_Bool scrollable) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -509,6 +520,7 @@ elm_toolbar_scrollable_set(Evas_Object *obj, Eina_Bool scrollable) EAPI void elm_toolbar_homogenous_set(Evas_Object *obj, Eina_Bool homogenous) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -521,6 +533,7 @@ elm_toolbar_menu_parent_set(Evas_Object *obj, Evas_Object *parent) { Eina_List *l; Elm_Toolbar_Item *it; + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if ((!wd) || (!parent)) return; @@ -537,6 +550,7 @@ elm_toolbar_item_unselect_all(Evas_Object *obj) { Eina_List *l; Elm_Toolbar_Item *it; + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -562,6 +576,7 @@ elm_toolbar_align_set(Evas_Object *obj, double align) { Eina_List *l; Elm_Toolbar_Item *it; + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c index 1bd51f28c..5e1082f9a 100644 --- a/src/lib/elm_widget.c +++ b/src/lib/elm_widget.c @@ -48,6 +48,7 @@ struct _Smart_Data }; /* local subsystem functions */ +static const char *widtype = NULL; static void _smart_reconfigure(Smart_Data *sd); static void _smart_add(Evas_Object *obj); static void _smart_del(Evas_Object *obj); diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index 104d75c3e..90abd769a 100644 --- a/src/lib/elm_win.c +++ b/src/lib/elm_win.c @@ -27,6 +27,7 @@ struct _Elm_Win } screen; }; +static const char *widtype = NULL; static void _elm_win_obj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _elm_win_obj_intercept_show(void *data, Evas_Object *obj); static void _elm_win_move(Ecore_Evas *ee); @@ -49,6 +50,7 @@ _elm_win_move(Ecore_Evas *ee) Elm_Win *win; int x, y; if (strcmp(elm_widget_type_get(obj), "win")) return; + win = elm_widget_data_get(obj); if (!win) return; ecore_evas_geometry_get(ee, &x, &y, NULL, NULL); @@ -63,6 +65,7 @@ _elm_win_resize(Ecore_Evas *ee) Evas_Object *obj = ecore_evas_object_associate_get(ee); Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + win = elm_widget_data_get(obj); if (!win) return; if (win->deferred_resize_job) ecore_job_del(win->deferred_resize_job); @@ -75,6 +78,7 @@ _elm_win_focus_in(Ecore_Evas *ee) Evas_Object *obj = ecore_evas_object_associate_get(ee); Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + win = elm_widget_data_get(obj); if (!win) return; /*NB: Why two different "focus signals" here ??? */ @@ -88,6 +92,7 @@ _elm_win_focus_out(Ecore_Evas *ee) Evas_Object *obj = ecore_evas_object_associate_get(ee); Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + win = elm_widget_data_get(obj); if (!win) return; evas_object_smart_callback_call(win->win_obj, "focus-out", NULL); // FIXME: remove me @@ -157,6 +162,7 @@ _elm_win_delete_request(Ecore_Evas *ee) Evas_Object *obj = ecore_evas_object_associate_get(ee); Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + win = elm_widget_data_get(obj); if (!win) return; int autodel = win->autodel; @@ -277,6 +283,7 @@ _elm_win_eval_subobjs(Evas_Object *obj) { const Eina_List *l; const Evas_Object *child; + Elm_Win *win = elm_widget_data_get(obj); Evas_Coord w, h, minw = -1, minh = -1, maxw = -1, maxh = -1; int xx = 1, xy = 1; @@ -442,6 +449,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_SET_WIDTYPE(widtype, "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); @@ -505,6 +513,7 @@ elm_win_resize_object_add(Evas_Object *obj, Evas_Object *subobj) Evas_Coord w, h; Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; win->subobjs = eina_list_append(win->subobjs, subobj); @@ -525,6 +534,7 @@ elm_win_resize_object_del(Evas_Object *obj, Evas_Object *subobj) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; evas_object_event_callback_del_full(subobj, @@ -543,6 +553,7 @@ elm_win_title_set(Evas_Object *obj, const char *title) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; ecore_evas_title_set(win->ee, title); @@ -553,6 +564,7 @@ elm_win_autodel_set(Evas_Object *obj, Eina_Bool autodel) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; win->autodel = autodel; @@ -563,6 +575,7 @@ elm_win_activate(Evas_Object *obj) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; ecore_evas_activate(win->ee); @@ -573,6 +586,7 @@ elm_win_lower(Evas_Object *obj) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; ecore_evas_lower(win->ee); @@ -583,6 +597,7 @@ elm_win_raise(Evas_Object *obj) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; ecore_evas_raise(win->ee); @@ -593,6 +608,7 @@ elm_win_borderless_set(Evas_Object *obj, Eina_Bool borderless) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; ecore_evas_borderless_set(win->ee, borderless); @@ -604,6 +620,7 @@ elm_win_borderless_get(Evas_Object *obj) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return EINA_FALSE; return ecore_evas_borderless_get(win->ee); @@ -614,6 +631,7 @@ elm_win_shaped_set(Evas_Object *obj, Eina_Bool shaped) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; ecore_evas_shaped_set(win->ee, shaped); @@ -625,6 +643,7 @@ elm_win_shaped_get(Evas_Object *obj) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return EINA_FALSE; return ecore_evas_shaped_get(win->ee); @@ -635,6 +654,7 @@ elm_win_alpha_set(Evas_Object *obj, Eina_Bool alpha) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; if (win->xwin) @@ -659,6 +679,7 @@ elm_win_alpha_get(Evas_Object *obj) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return EINA_FALSE; return ecore_evas_alpha_get(win->ee); @@ -669,6 +690,7 @@ elm_win_transparent_set(Evas_Object *obj, Eina_Bool transparent) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; @@ -686,6 +708,7 @@ elm_win_transparent_get(Evas_Object *obj) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return EINA_FALSE; @@ -697,6 +720,7 @@ elm_win_override_set(Evas_Object *obj, Eina_Bool override) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; ecore_evas_override_set(win->ee, override); @@ -708,6 +732,7 @@ elm_win_override_get(Evas_Object *obj) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return EINA_FALSE; return ecore_evas_override_get(win->ee); @@ -718,6 +743,7 @@ elm_win_fullscreen_set(Evas_Object *obj, Eina_Bool fullscreen) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; switch (_elm_config->engine) @@ -738,6 +764,7 @@ elm_win_fullscreen_get(Evas_Object *obj) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return EINA_FALSE; switch (_elm_config->engine) @@ -759,6 +786,7 @@ elm_win_maximized_set(Evas_Object *obj, Eina_Bool maximized) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; ecore_evas_maximized_set(win->ee, maximized); @@ -770,6 +798,7 @@ elm_win_maximized_get(Evas_Object *obj) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return EINA_FALSE; return ecore_evas_maximized_get(win->ee); @@ -780,6 +809,7 @@ elm_win_iconified_set(Evas_Object *obj, Eina_Bool iconified) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; ecore_evas_iconified_set(win->ee, iconified); @@ -791,6 +821,7 @@ elm_win_iconified_get(Evas_Object *obj) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return EINA_FALSE; return ecore_evas_iconified_get(win->ee); @@ -801,6 +832,7 @@ elm_win_layer_set(Evas_Object *obj, int layer) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; ecore_evas_layer_set(win->ee, layer); @@ -812,6 +844,7 @@ elm_win_layer_get(Evas_Object *obj) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return -1; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return -1; return ecore_evas_layer_get(win->ee); @@ -822,6 +855,7 @@ elm_win_rotation_set(Evas_Object *obj, int rotation) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; if (win->rot == rotation) return; @@ -838,6 +872,7 @@ elm_win_rotation_with_resize_set(Evas_Object *obj, int rotation) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; if (win->rot == rotation) return; @@ -854,6 +889,7 @@ elm_win_rotation_get(Evas_Object *obj) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return -1; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return -1; return win->rot; @@ -864,6 +900,7 @@ elm_win_sticky_set(Evas_Object *obj, Eina_Bool sticky) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; ecore_evas_sticky_set(win->ee, sticky); @@ -875,6 +912,7 @@ elm_win_sticky_get(Evas_Object *obj) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return EINA_FALSE; return ecore_evas_sticky_get(win->ee); @@ -885,6 +923,7 @@ elm_win_keyboard_mode_set(Evas_Object *obj, Elm_Win_Keyboard_Mode mode) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; if (mode == win->kbdmode) return; @@ -902,6 +941,7 @@ elm_win_keyboard_win_set(Evas_Object *obj, Eina_Bool is_keyboard) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; _elm_win_xwindow_get(win); @@ -916,6 +956,7 @@ elm_win_screen_position_get(Evas_Object *obj, int *x, int *y) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; if (x) *x = win->screen.x; @@ -935,6 +976,7 @@ elm_win_conformant_set(Evas_Object *obj, Eina_Bool conformant) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; _elm_win_xwindow_get(win); @@ -957,6 +999,7 @@ elm_win_conformant_get(Evas_Object *obj) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return EINA_FALSE; _elm_win_xwindow_get(win); @@ -982,6 +1025,7 @@ elm_win_quickpanel_set(Evas_Object *obj, Eina_Bool quickpanel) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; _elm_win_xwindow_get(win); @@ -1015,6 +1059,7 @@ elm_win_quickpanel_get(Evas_Object *obj) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return EINA_FALSE; _elm_win_xwindow_get(win); @@ -1038,6 +1083,7 @@ elm_win_quickpanel_priority_major_set(Evas_Object *obj, int priority) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; _elm_win_xwindow_get(win); @@ -1060,6 +1106,7 @@ elm_win_quickpanel_priority_major_get(Evas_Object *obj) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return -1; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return -1; _elm_win_xwindow_get(win); @@ -1083,6 +1130,7 @@ elm_win_quickpanel_priority_minor_set(Evas_Object *obj, int priority) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; _elm_win_xwindow_get(win); @@ -1105,6 +1153,7 @@ elm_win_quickpanel_priority_minor_get(Evas_Object *obj) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return -1; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return -1; _elm_win_xwindow_get(win); @@ -1128,6 +1177,7 @@ elm_win_quickpanel_zone_set(Evas_Object *obj, int zone) { Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return; _elm_win_xwindow_get(win); @@ -1208,6 +1258,7 @@ elm_win_inwin_add(Evas_Object *obj) Elm_Win *win; if (strcmp(elm_widget_type_get(obj), "win")) return NULL; + ELM_CHECK_WIDTYPE(obj, widtype); win = elm_widget_data_get(obj); if (!win) return NULL; wd = ELM_NEW(Widget_Data); @@ -1242,6 +1293,7 @@ elm_win_inwin_style_set(Evas_Object *obj, const char *style) EAPI void elm_win_inwin_activate(Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); evas_object_raise(obj); evas_object_show(obj); @@ -1252,6 +1304,7 @@ elm_win_inwin_activate(Evas_Object *obj) EAPI void elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if ((wd->content) && (wd->content != content)) elm_widget_sub_object_del(obj, wd->content); -- 2.34.1