From 5ab6a7739fdc8c37b59f0f88af73ded51c273b5b Mon Sep 17 00:00:00 2001 From: ChunEon Park Date: Wed, 16 Apr 2014 10:59:43 +0900 Subject: [PATCH] widgets - don't handle the events(key,mouse) if the object is disabled. we can prevent to handle the widget events from the widget infra, if the object is disabled. conceptually, disabled object should not be interacted to user input(key, mouse) --- legacy/elementary/src/lib/elc_ctxpopup.c | 1 - legacy/elementary/src/lib/elc_fileselector.c | 1 - legacy/elementary/src/lib/elc_hoversel.c | 1 - legacy/elementary/src/lib/elc_naviframe.c | 1 - legacy/elementary/src/lib/elc_player.c | 1 - legacy/elementary/src/lib/elc_popup.c | 1 - legacy/elementary/src/lib/elm_button.c | 1 - legacy/elementary/src/lib/elm_calendar.c | 1 - legacy/elementary/src/lib/elm_check.c | 1 - legacy/elementary/src/lib/elm_colorselector.c | 1 - legacy/elementary/src/lib/elm_diskselector.c | 1 - legacy/elementary/src/lib/elm_flipselector.c | 1 - legacy/elementary/src/lib/elm_gengrid.c | 1 - legacy/elementary/src/lib/elm_genlist.c | 1 - legacy/elementary/src/lib/elm_image.c | 1 - legacy/elementary/src/lib/elm_list.c | 1 - legacy/elementary/src/lib/elm_map.c | 1 - legacy/elementary/src/lib/elm_panel.c | 1 - legacy/elementary/src/lib/elm_photocam.c | 1 - legacy/elementary/src/lib/elm_radio.c | 1 - legacy/elementary/src/lib/elm_scroller.c | 1 - legacy/elementary/src/lib/elm_slider.c | 2 -- legacy/elementary/src/lib/elm_slideshow.c | 1 - legacy/elementary/src/lib/elm_spinner.c | 1 - legacy/elementary/src/lib/elm_toolbar.c | 1 - legacy/elementary/src/lib/elm_video.c | 1 - legacy/elementary/src/lib/elm_web.c | 1 - legacy/elementary/src/lib/elm_widget.c | 7 +++++++ 28 files changed, 7 insertions(+), 28 deletions(-) diff --git a/legacy/elementary/src/lib/elc_ctxpopup.c b/legacy/elementary/src/lib/elc_ctxpopup.c index 7530956..0812098 100644 --- a/legacy/elementary/src/lib/elc_ctxpopup.c +++ b/legacy/elementary/src/lib/elc_ctxpopup.c @@ -100,7 +100,6 @@ _elc_ctxpopup_elm_widget_event(Eo *obj, Elc_Ctxpopup_Data *sd, Evas_Object *src, Evas_Event_Key_Down *ev = event_info; (void)src; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elc_fileselector.c b/legacy/elementary/src/lib/elc_fileselector.c index 986b7f6..77cf118 100644 --- a/legacy/elementary/src/lib/elc_fileselector.c +++ b/legacy/elementary/src/lib/elc_fileselector.c @@ -166,7 +166,6 @@ _elc_fileselector_elm_widget_event(Eo *obj, Elc_Fileselector_Data *sd EINA_UNUSE Evas_Event_Key_Down *ev = event_info; (void) src; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elc_hoversel.c b/legacy/elementary/src/lib/elc_hoversel.c index c77d342..1b99a88 100644 --- a/legacy/elementary/src/lib/elc_hoversel.c +++ b/legacy/elementary/src/lib/elc_hoversel.c @@ -565,7 +565,6 @@ _elc_hoversel_elm_widget_event(Eo *obj, Elc_Hoversel_Data *sd, Evas_Object *src, if (int_ret) return EINA_FALSE; if (!sd || !sd->hover) return EINA_FALSE; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elc_naviframe.c b/legacy/elementary/src/lib/elc_naviframe.c index 902f16b..53369dd 100644 --- a/legacy/elementary/src/lib/elc_naviframe.c +++ b/legacy/elementary/src/lib/elc_naviframe.c @@ -1398,7 +1398,6 @@ _elc_naviframe_elm_widget_event(Eo *obj, Elc_Naviframe_Data *sd EINA_UNUSED, Eva (void)src; Evas_Event_Key_Down *ev = event_info; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; if (!_elm_config_key_binding_call(obj, ev, key_actions)) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elc_player.c b/legacy/elementary/src/lib/elc_player.c index 36fe2d3..cce4599 100644 --- a/legacy/elementary/src/lib/elc_player.c +++ b/legacy/elementary/src/lib/elc_player.c @@ -120,7 +120,6 @@ _elm_player_elm_widget_event(Eo *obj, Elm_Player_Data *sd, Evas_Object *src, Eva Evas_Event_Key_Down *ev = event_info; (void) src; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; if (!sd->video) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elc_popup.c b/legacy/elementary/src/lib/elc_popup.c index 9e142cb..83d1b9d 100644 --- a/legacy/elementary/src/lib/elc_popup.c +++ b/legacy/elementary/src/lib/elc_popup.c @@ -1467,7 +1467,6 @@ _elc_popup_elm_widget_event(Eo *obj, Elc_Popup_Data *_pd EINA_UNUSED, Evas_Objec (void)src; Evas_Event_Key_Down *ev = event_info; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elm_button.c b/legacy/elementary/src/lib/elm_button.c index 5d2f06e..5c489f5 100644 --- a/legacy/elementary/src/lib/elm_button.c +++ b/legacy/elementary/src/lib/elm_button.c @@ -170,7 +170,6 @@ _elm_button_elm_widget_event(Eo *obj, Elm_Button_Data *_pd EINA_UNUSED, Evas_Obj (void) src; Evas_Event_Key_Down *ev = event_info; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elm_calendar.c b/legacy/elementary/src/lib/elm_calendar.c index 41faa59..50fade4 100644 --- a/legacy/elementary/src/lib/elm_calendar.c +++ b/legacy/elementary/src/lib/elm_calendar.c @@ -913,7 +913,6 @@ _elm_calendar_elm_widget_event(Eo *obj, Elm_Calendar_Data *sd EINA_UNUSED, Evas_ (void) src; Evas_Event_Key_Down *ev = event_info; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (!_elm_config_key_binding_call(obj, ev, key_actions)) diff --git a/legacy/elementary/src/lib/elm_check.c b/legacy/elementary/src/lib/elm_check.c index 51a6088..b79af42 100644 --- a/legacy/elementary/src/lib/elm_check.c +++ b/legacy/elementary/src/lib/elm_check.c @@ -158,7 +158,6 @@ _elm_check_elm_widget_event(Eo *obj, Elm_Check_Data *_pd EINA_UNUSED, Evas_Objec (void) src; Evas_Event_Key_Down *ev = event_info; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elm_colorselector.c b/legacy/elementary/src/lib/elm_colorselector.c index 35a2126..d1345cb 100644 --- a/legacy/elementary/src/lib/elm_colorselector.c +++ b/legacy/elementary/src/lib/elm_colorselector.c @@ -1766,7 +1766,6 @@ _elm_colorselector_elm_widget_event(Eo *obj, Elm_Colorselector_Data *sd, Evas_Ob Evas_Event_Key_Down *ev = event_info; (void) src; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; if (!sd) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elm_diskselector.c b/legacy/elementary/src/lib/elm_diskselector.c index e7c75dc..fa3ed02 100644 --- a/legacy/elementary/src/lib/elm_diskselector.c +++ b/legacy/elementary/src/lib/elm_diskselector.c @@ -971,7 +971,6 @@ _elm_diskselector_elm_widget_event(Eo *obj, Elm_Diskselector_Data *sd, Evas_Obje (void) src; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elm_flipselector.c b/legacy/elementary/src/lib/elm_flipselector.c index cc942e0..135c6e0 100644 --- a/legacy/elementary/src/lib/elm_flipselector.c +++ b/legacy/elementary/src/lib/elm_flipselector.c @@ -435,7 +435,6 @@ _elm_flipselector_elm_widget_event(Eo *obj, Elm_Flipselector_Data *sd, Evas_Obje Evas_Event_Key_Down *ev = event_info; (void) src; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elm_gengrid.c b/legacy/elementary/src/lib/elm_gengrid.c index 7d4df95..dabc3b8 100644 --- a/legacy/elementary/src/lib/elm_gengrid.c +++ b/legacy/elementary/src/lib/elm_gengrid.c @@ -1907,7 +1907,6 @@ _elm_gengrid_elm_widget_event(Eo *obj, Elm_Gengrid_Data *sd, Evas_Object *src, E Eina_Bool sel_ret = EINA_FALSE; Eina_Bool edge_ret = EINA_FALSE; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; if (!sd->items) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elm_genlist.c b/legacy/elementary/src/lib/elm_genlist.c index 29254aa..6924b32 100644 --- a/legacy/elementary/src/lib/elm_genlist.c +++ b/legacy/elementary/src/lib/elm_genlist.c @@ -2580,7 +2580,6 @@ _elm_genlist_elm_widget_event(Eo *obj, Elm_Genlist_Data *sd, Evas_Object *src, E Evas_Coord pan_max_x = 0, pan_max_y = 0; Eina_Bool sel_ret = EINA_FALSE; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; if (!sd->items) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elm_image.c b/legacy/elementary/src/lib/elm_image.c index 5681f49..ce4d079 100644 --- a/legacy/elementary/src/lib/elm_image.c +++ b/legacy/elementary/src/lib/elm_image.c @@ -574,7 +574,6 @@ _elm_image_elm_widget_event(Eo *obj, Elm_Image_Data *_pd EINA_UNUSED, Evas_Objec (void) src; Evas_Event_Key_Down *ev = event_info; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elm_list.c b/legacy/elementary/src/lib/elm_list.c index cf098ba..49f7a87 100644 --- a/legacy/elementary/src/lib/elm_list.c +++ b/legacy/elementary/src/lib/elm_list.c @@ -578,7 +578,6 @@ _elm_list_elm_widget_event(Eo *obj, Elm_List_Data *sd, Evas_Object *src, Evas_Ca (void) src; Evas_Event_Key_Down *ev = event_info; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; if (!sd->items) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elm_map.c b/legacy/elementary/src/lib/elm_map.c index 1b89bae..ddae229 100644 --- a/legacy/elementary/src/lib/elm_map.c +++ b/legacy/elementary/src/lib/elm_map.c @@ -3890,7 +3890,6 @@ _elm_map_elm_widget_event(Eo *obj, Elm_Map_Data *sd EINA_UNUSED, Evas_Object *sr (void) src; Evas_Event_Key_Down *ev = event_info; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elm_panel.c b/legacy/elementary/src/lib/elm_panel.c index 412df7f..f44e790 100644 --- a/legacy/elementary/src/lib/elm_panel.c +++ b/legacy/elementary/src/lib/elm_panel.c @@ -249,7 +249,6 @@ EOLIAN static Eina_Bool _elm_panel_elm_widget_event(Eo *obj, Elm_Panel_Data *_pd EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info) { Evas_Event_Key_Down *ev = event_info; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; if (src != obj) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elm_photocam.c b/legacy/elementary/src/lib/elm_photocam.c index e023ed6..6e733c9 100644 --- a/legacy/elementary/src/lib/elm_photocam.c +++ b/legacy/elementary/src/lib/elm_photocam.c @@ -998,7 +998,6 @@ _elm_photocam_elm_widget_event(Eo *obj, Elm_Photocam_Data *_pd EINA_UNUSED, Evas (void) src; Evas_Event_Key_Down *ev = event_info; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elm_radio.c b/legacy/elementary/src/lib/elm_radio.c index cbeb153..c6183ef 100644 --- a/legacy/elementary/src/lib/elm_radio.c +++ b/legacy/elementary/src/lib/elm_radio.c @@ -164,7 +164,6 @@ _elm_radio_elm_widget_event(Eo *obj, Elm_Radio_Data *_pd EINA_UNUSED, Evas_Objec (void) src; Evas_Event_Key_Down *ev = event_info; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elm_scroller.c b/legacy/elementary/src/lib/elm_scroller.c index 7ecd050..9004f67 100644 --- a/legacy/elementary/src/lib/elm_scroller.c +++ b/legacy/elementary/src/lib/elm_scroller.c @@ -217,7 +217,6 @@ _elm_scroller_elm_widget_event(Eo *obj, Elm_Scroller_Data *sd EINA_UNUSED, Evas_ (void) src; Evas_Event_Key_Down *ev = event_info; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elm_slider.c b/legacy/elementary/src/lib/elm_slider.c index 1caace3..3ebe7f0 100644 --- a/legacy/elementary/src/lib/elm_slider.c +++ b/legacy/elementary/src/lib/elm_slider.c @@ -358,8 +358,6 @@ _elm_slider_elm_widget_event(Eo *obj, Elm_Slider_Data *sd, Evas_Object *src, Eva (void) src; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; - if (type == EVAS_CALLBACK_KEY_DOWN) goto key_down; else if (type == EVAS_CALLBACK_KEY_UP) { diff --git a/legacy/elementary/src/lib/elm_slideshow.c b/legacy/elementary/src/lib/elm_slideshow.c index e8ee4c7..7fefb3c 100644 --- a/legacy/elementary/src/lib/elm_slideshow.c +++ b/legacy/elementary/src/lib/elm_slideshow.c @@ -73,7 +73,6 @@ _elm_slideshow_elm_widget_event(Eo *obj, Elm_Slideshow_Data *sd EINA_UNUSED, Eva Evas_Event_Key_Down *ev = event_info; (void) src; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elm_spinner.c b/legacy/elementary/src/lib/elm_spinner.c index efc6113..3b32d41 100644 --- a/legacy/elementary/src/lib/elm_spinner.c +++ b/legacy/elementary/src/lib/elm_spinner.c @@ -460,7 +460,6 @@ _elm_spinner_elm_widget_event(Eo *obj, Elm_Spinner_Data *sd EINA_UNUSED, Evas_Ob Eina_Bool horz = !!strncmp(elm_widget_style_get(obj), "vertical", 8); - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; if (type == EVAS_CALLBACK_KEY_DOWN) diff --git a/legacy/elementary/src/lib/elm_toolbar.c b/legacy/elementary/src/lib/elm_toolbar.c index d17aaef..1d83ef2 100644 --- a/legacy/elementary/src/lib/elm_toolbar.c +++ b/legacy/elementary/src/lib/elm_toolbar.c @@ -890,7 +890,6 @@ _elm_toolbar_elm_widget_event(Eo *obj, Elm_Toolbar_Data *sd, Evas_Object *src, E (void) type; Evas_Event_Key_Down *ev = event_info; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; if (!sd->items) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elm_video.c b/legacy/elementary/src/lib/elm_video.c index 9cbb002..f0b9454 100644 --- a/legacy/elementary/src/lib/elm_video.c +++ b/legacy/elementary/src/lib/elm_video.c @@ -87,7 +87,6 @@ _elm_video_elm_widget_event(Eo *obj, Elm_Video_Data *_pd EINA_UNUSED, Evas_Objec (void) src; Evas_Event_Key_Down *ev = event_info; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; diff --git a/legacy/elementary/src/lib/elm_web.c b/legacy/elementary/src/lib/elm_web.c index 0e4a0b0..a13e7a3 100644 --- a/legacy/elementary/src/lib/elm_web.c +++ b/legacy/elementary/src/lib/elm_web.c @@ -182,7 +182,6 @@ _elm_web_elm_widget_event(Eo *obj, Elm_Web_Data *sd, Evas_Object *src, Evas_Call #ifdef HAVE_ELEMENTARY_WEB if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; if ((!strcmp(ev->key, "Tab")) && (!sd->tab_propagate)) { diff --git a/legacy/elementary/src/lib/elm_widget.c b/legacy/elementary/src/lib/elm_widget.c index 9256370..23448ec 100644 --- a/legacy/elementary/src/lib/elm_widget.c +++ b/legacy/elementary/src/lib/elm_widget.c @@ -1518,6 +1518,13 @@ _elm_widget_event_propagate(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Eva Elm_Widget_Smart_Data *sd = eo_data_scope_get(parent, MY_CLASS); Eina_Bool int_ret = EINA_FALSE; + + if (elm_widget_disabled_get(obj)) + { + parent = sd->parent_obj; + continue; + } + eo_do(parent, int_ret = elm_obj_widget_event(obj, type, event_info)); if (int_ret) return EINA_TRUE; -- 2.7.4