From: Hosang Kim Date: Fri, 13 Sep 2013 11:23:09 +0000 (+0900) Subject: [indicator] change way to receive indicator event X-Git-Tag: 2.2.1_release~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5c74cc455c72e65da8e8a5895e6ca6c0f1f6e5a;p=framework%2Fuifw%2Felementary.git [indicator] change way to receive indicator event Change-Id: I6dbcbbb791e08a8292f3f8f90f23b04a7e5e4a66 Conflicts: packaging/elementary.spec src/lib/elm_conform.c src/lib/elm_win.c --- diff --git a/src/lib/elm_conform.c b/src/lib/elm_conform.c index d9e66e0..226717f 100644 --- a/src/lib/elm_conform.c +++ b/src/lib/elm_conform.c @@ -284,71 +284,6 @@ _check_indicator_event(Evas_Object *conformant) } static void -_on_indicator_event_mouse_down(void *data, - Evas *e __UNUSED__, - Evas_Object *obj __UNUSED__, - void *event_info) -{ - Evas_Event_Mouse_Down *ev = event_info; - Evas_Object *conformant = data; - ELM_CONFORMANT_DATA_GET(conformant, sd); - - if (ev->button != 1) return; - if (_check_indicator_event(conformant)) - { - sd->down_y = ev->canvas.y; - if (sd->on_indicator_effect && sd->indicator_effect_timer) - { - ecore_timer_del(sd->indicator_effect_timer); - sd->indicator_effect_timer = NULL; - } - } -} - -static void -_on_indicator_event_mouse_move(void *data, - Evas *e __UNUSED__, - Evas_Object *obj __UNUSED__, - void *event_info) -{ - Evas_Event_Mouse_Move *ev = event_info; - Evas_Object *conformant = data; - - ELM_CONFORMANT_DATA_GET(conformant, sd); - - if (ev->buttons != 1) return; - if (sd->on_indicator_effect) return; - - if (_check_indicator_event(conformant)) - { - if ((ev->cur.canvas.y - sd->down_y) > 40) - { - _indicator_show_effect(conformant, 3); - } - } - -} - -static void -_on_indicator_event_mouse_up(void *data, - Evas *e __UNUSED__, - Evas_Object *obj __UNUSED__, - void *event_info) -{ - Evas_Event_Mouse_Up *ev = event_info; - Evas_Object *conformant = data; - - ELM_CONFORMANT_DATA_GET(conformant, sd); - if (ev->button != 1) return; - if (_check_indicator_event(conformant)) - { - sd->down_y = 0; - if (sd->on_indicator_effect && !sd->indicator_effect_timer) - _indicator_hide_effect(conformant); - } -} - -static void _conformant_parts_swallow(Evas_Object *obj) { Evas *e; @@ -423,29 +358,6 @@ _conformant_parts_swallow(Evas_Object *obj) evas_object_del(sd->softkey); sd->softkey = NULL; } - - //Event indicator - if (edje_object_part_exists(wd->resize_obj, INDICATOR_EVENT_PART)) - { - if (!sd->indicator_event) - { - sd->indicator_event = evas_object_rectangle_add(e); - evas_object_size_hint_min_set(sd->indicator_event, -1, 0); - evas_object_size_hint_max_set(sd->indicator_event, -1, 0); - evas_object_event_callback_add(sd->indicator_event, EVAS_CALLBACK_MOUSE_DOWN, _on_indicator_event_mouse_down, obj); - evas_object_event_callback_add(sd->indicator_event, EVAS_CALLBACK_MOUSE_MOVE, _on_indicator_event_mouse_move, obj); - evas_object_event_callback_add(sd->indicator_event, EVAS_CALLBACK_MOUSE_UP, _on_indicator_event_mouse_up, obj); - evas_object_color_set(sd->indicator_event, 0, 0, 0, 0); - evas_object_repeat_events_set(sd->indicator_event, EINA_TRUE); - } - - elm_layout_content_set(obj, INDICATOR_EVENT_PART, sd->indicator_event); - } - else if (sd->indicator_event) - { - evas_object_del(sd->indicator_event); - sd->indicator_event = NULL; - } } static Eina_Bool @@ -823,6 +735,18 @@ _on_rotation_changed(void *data, } static void +_on_indicator_flick_done(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) +{ + Evas_Object *conformant = data; + + ELM_CONFORMANT_DATA_GET(conformant, sd); + _indicator_show_effect(conformant, 3); + +} + +static void _signals_emit(Evas_Object *obj) { ELM_CONFORMANT_DATA_GET(obj, sd); @@ -1246,14 +1170,6 @@ _elm_conformant_smart_del(Evas_Object *obj) evas_object_del(sd->landscape_indicator); } - if (sd->indicator_event) - { - evas_object_event_callback_del(sd->indicator_event, EVAS_CALLBACK_MOUSE_DOWN, _on_indicator_event_mouse_down); - evas_object_event_callback_del(sd->indicator_event, EVAS_CALLBACK_MOUSE_MOVE, _on_indicator_event_mouse_move); - evas_object_event_callback_del(sd->indicator_event, EVAS_CALLBACK_MOUSE_UP, _on_indicator_event_mouse_up); - evas_object_del(sd->indicator_event); - } - top = sd->win; evas_object_data_set(top, "\377 elm,conformant", NULL); @@ -1366,6 +1282,8 @@ elm_conformant_add(Evas_Object *parent) (sd->win, "indicator,prop,changed", (Evas_Smart_Cb)_on_indicator_mode_changed, obj); evas_object_smart_callback_add (sd->win, "rotation,changed", (Evas_Smart_Cb)_on_rotation_changed, obj); + evas_object_smart_callback_add + (sd->win, "indicator,flick,done", (Evas_Smart_Cb)_on_indicator_flick_done, obj); return obj; } diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index 90c5405..48eeeec 100644 --- a/src/lib/elm_win.c +++ b/src/lib/elm_win.c @@ -188,6 +188,7 @@ static const char SIG_UNMAXIMIZED[] = "unmaximized"; static const char SIG_IOERR[] = "ioerr"; static const char SIG_INDICATOR_PROP_CHANGED[] = "indicator,prop,changed"; static const char SIG_ROTATION_CHANGED[] = "rotation,changed"; +static const char SIG_INDICATOR_FLICK_DONE[] = "indicator,flick,done"; static const char SIG_PROFILE_CHANGED[] = "profile,changed"; static const char SIG_WM_ROTATION_CHANGED[] = "wm,rotation,changed"; @@ -2146,8 +2147,24 @@ _elm_win_client_message(void *data, ELM_ACCESS_ACTION_MOUSE, a); free(a); } + else if ((unsigned int)e->data.l[1] == + ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ENABLE) + { + elm_access_action(ELM_WIDGET_DATA(sd)->obj, + ELM_ACCESS_ACTION_ENABLE, NULL); + } + else if ((unsigned int)e->data.l[1] == + ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_DISABLE) + { + elm_access_action(ELM_WIDGET_DATA(sd)->obj, + ELM_ACCESS_ACTION_DISABLE, NULL); + } } } + else if (e->message_type == ECORE_X_ATOM_E_INDICATOR_FLICK_DONE) + { + evas_object_smart_callback_call(ELM_WIDGET_DATA(sd)->obj, SIG_INDICATOR_FLICK_DONE, NULL); + } return ECORE_CALLBACK_PASS_ON; }