From ac2906621033b9f804d7bea37a8ca10e37ecd8c1 Mon Sep 17 00:00:00 2001 From: Wonki Kim Date: Tue, 16 Jan 2018 22:04:47 +0900 Subject: [PATCH] win/conform: Improve a behavior of indicator and conformant this patch improves a behavior of indicator and conformant to meet tizen ux guidelines @tizen_feature Change-Id: I65b242d470f3e789edd1c3f73bfe0cecc1371d57 Signed-off-by: Wonki Kim --- src/lib/elementary/efl_ui_win.c | 37 ++- src/lib/elementary/efl_ui_win.eo | 2 + src/lib/elementary/elm_conform.c | 457 +++++++++++++++++++++++++++++++- src/lib/elementary/elm_plug.eo | 1 + src/lib/elementary/elm_plug.h | 18 ++ src/lib/elementary/elm_widget_conform.h | 40 +++ 6 files changed, 542 insertions(+), 13 deletions(-) diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 9c51f5a..ae2cc06 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -106,6 +106,9 @@ struct _Efl_Ui_Win_Data Ecore_Event_Handler *effect_start_handler; Ecore_Event_Handler *effect_end_handler; // + // TIZEN_ONLY(20160801): indicator implementation + Ecore_Event_Handler *indicator_flick_handler; + // // TIZEN_ONLY(20150722): added signal for aux_hint(auxiliary hint) Ecore_Event_Handler *aux_msg_handler; // @@ -354,7 +357,12 @@ static const char SIG_INDICATOR_PROP_CHANGED[] = "indicator,prop,changed"; static const char SIG_ROTATION_CHANGED[] = "rotation,changed"; static const char SIG_PROFILE_CHANGED[] = "profile,changed"; static const char SIG_WM_ROTATION_CHANGED[] = "wm,rotation,changed"; -//TIZEN_ONLY(20171110): added signal for effect start and done + +// TIZEN_ONLY(20160801): indicator implementation +#ifdef HAVE_ELEMENTARY_WL2 +static const char SIG_INDICATOR_FLICK_DONE[] = "indicator,flick,done"; +#endif +// static const char SIG_EFFECT_STARTED[] = "effect,started"; static const char SIG_EFFECT_DONE[] = "effect,done"; // @@ -3220,6 +3228,9 @@ _efl_ui_win_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Win_Data *sd) ecore_event_handler_del(sd->wl.effect_start_handler); ecore_event_handler_del(sd->wl.effect_end_handler); // + // TIZEN_ONLY(20160801): indicator implementation + ecore_event_handler_del(sd->wl.indicator_flick_handler); + // // TIZEN_ONLY(20150722): added signal for aux_hint(auxiliary hint) ecore_event_handler_del(sd->wl.aux_msg_handler); // @@ -5263,6 +5274,18 @@ elm_win_precreated_object_get(void) } // +// TIZEN_ONLY(20160728): Indicator Implementation +#ifdef HAVE_ELEMENTARY_WL2 +static Eina_Bool +_elm_win_wl_indicator_flick(void *data, int type EINA_UNUSED, void *event EINA_UNUSED) +{ + ELM_WIN_DATA_GET(data, sd); + evas_object_smart_callback_call(sd->obj, SIG_INDICATOR_FLICK_DONE, NULL); + return ECORE_CALLBACK_PASS_ON; +} +#endif +// END + static void _elm_win_cb_hide(void *data EINA_UNUSED, Evas *e EINA_UNUSED, @@ -5814,6 +5837,10 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U (ECORE_WL2_EVENT_EFFECT_START, _elm_win_wl_effect_start, obj); sd->wl.effect_end_handler = ecore_event_handler_add (ECORE_WL2_EVENT_EFFECT_END, _elm_win_wl_effect_end, obj); + // TIZEN_ONLY(20160801): indicator implementation + sd->wl.indicator_flick_handler = ecore_event_handler_add + (ECORE_WL2_EVENT_INDICATOR_FLICK, _elm_win_wl_indicator_flick, obj); + // END // TIZEN_ONLY(20150722): added signal for aux_hint(auxiliary hint) sd->wl.aux_msg_handler = ecore_event_handler_add (ECORE_WL2_EVENT_AUX_MESSAGE, _elm_win_wl_aux_message, obj); @@ -5926,6 +5953,14 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U evas_object_event_callback_add (sd->parent, EVAS_CALLBACK_DEL, _elm_win_on_parent_del, obj); } + +// TIZEN_ONLY(20161114): Sync the state of indicator with window manager +#ifdef HAVE_ELEMENTARY_WL2 + if (sd->wl.win) + ecore_wl2_indicator_visible_type_set(sd->wl.win, ECORE_WL2_INDICATOR_VISIBLE_TYPE_SHOWN); +#endif +// END + sd->evas = ecore_evas_get(sd->ee); evas_object_color_set(obj, 0, 0, 0, 0); diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo index 74f101d..8043777 100644 --- a/src/lib/elementary/efl_ui_win.eo +++ b/src/lib/elementary/efl_ui_win.eo @@ -82,6 +82,8 @@ enum Efl.Ui.Win.Indicator_Mode bg_opaque, [[The indicator icon is opaque, as is the indicator background. The content of window is located at the end of the indicator. The area of indicator and window content are not overlapped]] + translucent, [[Be translucent the indicator]] + transparent, [[Transparentizes the indicator]] bg_transparent, [[The icon of indicator is opaque, but the background is transparent. The content of window is located under the indicator in Z-order. The area of indicator and window content are overlapped]] diff --git a/src/lib/elementary/elm_conform.c b/src/lib/elementary/elm_conform.c index be2ab96..0561882 100644 --- a/src/lib/elementary/elm_conform.c +++ b/src/lib/elementary/elm_conform.c @@ -64,6 +64,92 @@ static Evas_Object *_precreated_conform_obj = NULL; * ILLUME_IND="0, 0, 800, 32" * ILLUME_STK="0, 568, 800, 32" */ + +// TIZEN_ONLY(20161208): Support quickpanel callback +static void _indicator_hide_effect_del(void *data); +static void _indicator_hide_effect_set(void *data, double duration); +static void _indicator_show_effect(Evas_Object *conformant, double duration); + +static int conform_mod_init_cnt = 0; +static Elm_Conformant_Mod_Api *qp_mod = NULL; + +static void +_conform_mod_init(void) +{ + Elm_Module *mod = NULL; + + if (conform_mod_init_cnt++ > 0) return; + + if(!(mod = _elm_module_find_as("quickpanel_callback/api"))) goto on_init_fail; + + if (!mod->init_func) goto on_init_fail; + mod->init_func(mod); + + mod->api = malloc(sizeof(Elm_Conformant_Mod_Api)); + if (!mod->api) goto on_init_fail; + + + ((Elm_Conformant_Mod_Api *)(mod->api))->quickpanel_callback_add = + _elm_module_symbol_get(mod, "module_quickpanel_status_callback_add"); + + ((Elm_Conformant_Mod_Api *)(mod->api))->quickpanel_event_visible_get = + _elm_module_symbol_get(mod, "module_quickpanel_event_visible_get"); + + qp_mod = mod->api; + return; + + on_init_fail: + conform_mod_init_cnt--; +} + +static void +_quickpanel_visibility_changed_cb(int type EINA_UNUSED, void *event_info, void *user_data) +{ + Evas_Object *conform = user_data; + Elm_Win_Indicator_Mode indmode = ELM_WIN_INDICATOR_UNKNOWN; + Elm_Win_Indicator_Opacity_Mode ind_o_mode = ELM_WIN_INDICATOR_OPACITY_UNKNOWN; + int visible = -1; + + ELM_CONFORMANT_DATA_GET_OR_RETURN(conform, sd); + + indmode = elm_win_indicator_mode_get(sd->win); + ind_o_mode = elm_win_indicator_opacity_get(sd->win); + + if(qp_mod && qp_mod->quickpanel_event_visible_get) + qp_mod->quickpanel_event_visible_get(event_info, &visible); + + if (sd->quickpanel_state == visible) return; + sd->quickpanel_state = visible; + + if ((visible == CONFORM_QUICKPANEL_STATE_VISIBILITY_SHOWN) || + (visible == CONFORM_QUICKPANEL_STATE_VISIBILITY_PARTIALY_SHOWN)) + { + elm_object_signal_emit(conform, "elm,state,quickpanel,visible", "elm"); + } + else if( visible == CONFORM_QUICKPANEL_STATE_VISIBILITY_HIDDEN) + { + elm_object_signal_emit(conform, "elm,state,quickpanel,hidden", "elm"); + } + + // Actual manipulation works only when transparent indicator is showing + if (!((indmode == ELM_WIN_INDICATOR_SHOW) && (ind_o_mode == ELM_WIN_INDICATOR_TRANSPARENT))) + { + if ((sd->rot == 0) || (sd->rot == 180)) + return; + } + + if ((visible == CONFORM_QUICKPANEL_STATE_VISIBILITY_SHOWN) || + (visible == CONFORM_QUICKPANEL_STATE_VISIBILITY_PARTIALY_SHOWN)) + { + _indicator_hide_effect_del(conform); + } + else if( visible == CONFORM_QUICKPANEL_STATE_VISIBILITY_HIDDEN) + { + _indicator_hide_effect_set(conform, 0.5); + } +} +// END + #ifdef HAVE_ELEMENTARY_X static Eina_Bool _conformant_part_geometry_get_from_env(const char *part, @@ -179,11 +265,14 @@ _conformant_part_sizing_eval(Evas_Object *obj, if (wlwin) ecore_wl2_window_indicator_geometry_get(wlwin, &sx, &sy, &sw, &sh); #endif - // - if (((sd->rot == 90) || (sd->rot == 270)) && sd->landscape_indicator) - _conformant_part_size_hints_set(obj, sd->landscape_indicator, sx, sy, sw, sh); - else if (((sd->rot == 0) || (sd->rot == 180)) && sd->portrait_indicator) - _conformant_part_size_hints_set(obj, sd->portrait_indicator, sx, sy, sw, sh); +// + // TIZEN_ONLY(20170228): Remove legacy to coraborate with current indicator properly + //if (((sd->rot == 90) || (sd->rot == 270)) && sd->landscape_indicator) + // _conformant_part_size_hints_set(obj, sd->landscape_indicator, sx, sy, sw, sh); + //else if (((sd->rot == 0) || (sd->rot == 180)) && sd->portrait_indicator) + // _conformant_part_size_hints_set(obj, sd->portrait_indicator, sx, sy, sw, sh); + _conformant_part_size_hints_set(obj, sd->indicator, sx, sy, sw, sh); + //END } if (part_type & ELM_CONFORMANT_VIRTUAL_KEYPAD_PART) @@ -398,6 +487,8 @@ _conformant_parts_swallow(Evas_Object *obj) ELM_SAFE_FREE(sd->softkey, evas_object_del); } +// TIZEN_ONLY(20170228): Remove legacy to coraborate with current indicator properly +/* static Eina_Bool _port_indicator_connect_cb(void *data) { @@ -489,7 +580,99 @@ _port_indicator_disconnected(void *data, const Efl_Event *event EINA_UNUSED) sd->port_indi_timer = ecore_timer_add(ELM_CONFORM_INDICATOR_TIME, _port_indicator_connect_cb, conform); } +*/ +static Eina_Bool +_indicator_connect_cb(void *data) +{ + const char *indicator_serv_name; + ELM_CONFORMANT_DATA_GET(data, sd); + + if (!sd) return ECORE_CALLBACK_CANCEL; + if (sd->indmode != ELM_WIN_INDICATOR_SHOW) + { + sd->indi_timer = NULL; + return ECORE_CALLBACK_CANCEL; + } + indicator_serv_name = elm_config_indicator_service_get(0); + if (!indicator_serv_name) + { + DBG("Conformant cannot find indicator service name\n"); + sd->indi_timer = NULL; + return ECORE_CALLBACK_CANCEL; + } + if (strchr(indicator_serv_name, '/')) + { + sd->indi_timer = NULL; + return ECORE_CALLBACK_CANCEL; + } + if (elm_plug_connect(sd->indicator, indicator_serv_name, 0, EINA_FALSE)) + { + DBG("Conformant connect to server[%s]\n", indicator_serv_name); + sd->indi_timer = NULL; + return ECORE_CALLBACK_CANCEL; + } + return ECORE_CALLBACK_RENEW; +} + +static void +_indicator_disconnected(void *data, + Efl_Event *event) +{ + Evas_Object *conform = data; + + ELM_CONFORMANT_DATA_GET(conform, sd); + + sd->indi_timer = ecore_timer_add(ELM_CONFORM_INDICATOR_TIME, + _indicator_connect_cb, conform); +} +// END + +//TIZEN_ONLY(20170104): add plug message feature. +// procotol version - change this as needed +#define MSG_DOMAIN_CONTROL_INDICATOR 0x10001 +#define MSG_ID_INDICATOR_REPEAT_EVENT 0x10002 +#define MSG_ID_INDICATOR_ROTATION 0x10003 +#define MSG_ID_INDICATOR_OPACITY 0X1004 +#define MSG_ID_INDICATOR_TYPE 0X1005 +#define MSG_ID_INDICATOR_START_ANIMATION 0X10006 + +typedef struct _Indicator_Data_Animation Indicator_Data_Animation; + +struct _Indicator_Data_Animation +{ + double duration; +}; + +static void +_plug_msg_handle(void *data, + Efl_Event *event) +{ + Evas_Object *conformant = data; + Elm_Plug_Message *pm = event->info; + int msg_domain = 0; + int msg_id = 0; + void *msg_data = NULL; + int msg_data_size = 0; + + msg_domain = pm->msg_domain; + msg_id = pm->msg_id; + msg_data = pm->data; + msg_data_size = pm->size; + + if (msg_domain == MSG_DOMAIN_CONTROL_INDICATOR) + { + if (msg_id == MSG_ID_INDICATOR_START_ANIMATION) + { + if (msg_data_size != (int)sizeof(Indicator_Data_Animation)) return EINA_FALSE; + + Indicator_Data_Animation *anim_data = msg_data; + _indicator_show_effect(conformant, anim_data->duration); + } + } +} +// TIZEN_ONLY(20170228): Remove legacy to coraborate with current indicator properly +/* static Evas_Object * _create_portrait_indicator(Evas_Object *obj) { @@ -524,6 +707,10 @@ _create_portrait_indicator(Evas_Object *obj) } elm_widget_sub_object_add(obj, port_indicator); + //TIZEN_ONLY(20170104): add plug message feature. + efl_event_callback_add + (port_indicator, ELM_PLUG_EVENT_MESSAGE_RECEIVED, _plug_msg_handle, obj); + // efl_event_callback_add (port_indicator, ELM_PLUG_EVENT_IMAGE_DELETED, _port_indicator_disconnected, obj); evas_object_size_hint_min_set(port_indicator, -1, 0); @@ -566,13 +753,184 @@ _create_landscape_indicator(Evas_Object *obj) } elm_widget_sub_object_add(obj, land_indicator); + //TIZEN_ONLY(20170104): add plug message feature. + efl_event_callback_add + (land_indicator, ELM_PLUG_EVENT_MESSAGE_RECEIVED, _plug_msg_handle, obj); + // efl_event_callback_add (land_indicator, ELM_PLUG_EVENT_IMAGE_DELETED, _land_indicator_disconnected, obj); evas_object_size_hint_min_set(land_indicator, -1, 0); evas_object_size_hint_max_set(land_indicator, -1, 0); return land_indicator; } +*/ +static Evas_Object * +_create_indicator(Evas_Object *obj) +{ + Evas_Object *indicator = NULL; + const char *indicator_serv_name; + + ELM_CONFORMANT_DATA_GET(obj, sd); + indicator_serv_name = elm_config_indicator_service_get(0); + if (!indicator_serv_name) + { + DBG("Conformant cannot get indicator service name\n"); + return NULL; + } + if (strchr(indicator_serv_name, '/')) + { + return NULL; + } + + indicator = elm_plug_add(obj); + if (!indicator) + { + DBG("Conformant cannot create plug to server[%s]\n", indicator_serv_name); + return NULL; + } + + if (!elm_plug_connect(indicator, indicator_serv_name, 0, EINA_FALSE)) + { + DBG("Conformant cannot connect to server[%s]\n", indicator_serv_name); + sd->indi_timer = ecore_timer_add(ELM_CONFORM_INDICATOR_TIME, + _indicator_connect_cb, obj); + } + + elm_widget_sub_object_add(obj, indicator); + //TIZEN_ONLY(20170104): add plug message feature. + efl_event_callback_add(indicator, ELM_PLUG_EVENT_MESSAGE_RECEIVED, _plug_msg_handle, obj); + // + efl_event_callback_add(indicator, ELM_PLUG_EVENT_IMAGE_DELETED, _indicator_disconnected,obj); + evas_object_size_hint_min_set(indicator, -1, 0); + evas_object_size_hint_max_set(indicator, -1, 0); + + return indicator; +} +//END + +// TIZEN_ONLY(20160801): indicator implementation +#ifdef defined(HAVE_ELEMENTARY_WAYLAND) || defined(HAVE_ELEMENTARY_WL2) +static Eina_Bool +_indicator_visible_type_set(Evas_Object *obj, Eina_Bool visible) +{ + Evas_Object *top = elm_widget_top_get(obj); + if (!top) return EINA_FALSE; + + Ecore_Wl2_Window *wlwin = elm_win_wl_window_get(top); + if (!wlwin) return EINA_FALSE; + + if (visible) + { + ecore_wl2_indicator_visible_type_set(wlwin, ECORE_WL2_INDICATOR_VISIBLE_TYPE_SHOWN); + } + else + { + ecore_wl2_indicator_visible_type_set(wlwin, ECORE_WL2_INDICATOR_VISIBLE_TYPE_HIDDEN); + } + return EINA_TRUE; +} +#endif +static Eina_Bool +_indicator_hide_effect_done_cb(void *data) +{ + Evas_Object *conformant = data; + ELM_CONFORMANT_DATA_GET(conformant, sd); + DBG("[INDICATOR]Hide effect "); + + sd->on_indicator_effect = EINA_FALSE; + sd->indicator_effect_timer = NULL; + elm_object_signal_emit(conformant, "indicator,hide,effect", "elm"); + +#ifdef defined(HAVE_ELEMENTARY_WAYLAND) || defined(HAVE_ELEMENTARY_WL2) + _indicator_visible_type_set(conformant, EINA_FALSE); +#endif + return ECORE_CALLBACK_CANCEL; +} +static void +_indicator_hide_effect_del(void *data) +{ + Evas_Object *conformant = data; + ELM_CONFORMANT_DATA_GET(conformant, sd); + + if (sd->indicator_effect_timer) + { + ecore_timer_del(sd->indicator_effect_timer); + sd->indicator_effect_timer = NULL; + } +} +static void +_indicator_hide_effect_set(void *data, double duration) +{ + Evas_Object *conformant = data; + ELM_CONFORMANT_DATA_GET(conformant, sd); + + _indicator_hide_effect_del(conformant); + if (duration) + sd->indicator_effect_timer = ecore_timer_add(duration, _indicator_hide_effect_done_cb, conformant); +} +static void +_indicator_show_effect(Evas_Object *conformant, double duration) +{ + ELM_CONFORMANT_DATA_GET(conformant, sd); + DBG("[IND]Show effect "); + + sd->on_indicator_effect = EINA_TRUE; + elm_object_signal_emit(conformant, "indicator,show,effect", "elm"); + +#ifdef defined(HAVE_ELEMENTARY_WAYLAND) || defined(HAVE_ELEMENTARY_WL2) + _indicator_visible_type_set(conformant, EINA_TRUE); +#endif + _indicator_hide_effect_set(conformant, duration); +} +static void +_indicator_post_appearance_changed(Evas_Object *conformant) +{ + ELM_CONFORMANT_DATA_GET(conformant, sd); + + // Ignore when quickpanel is visible + if ((sd->quickpanel_state == CONFORM_QUICKPANEL_STATE_VISIBILITY_SHOWN) || + (sd->quickpanel_state == CONFORM_QUICKPANEL_STATE_VISIBILITY_PARTIALY_SHOWN)) + { + return; + } + + _indicator_hide_effect_del(conformant); + + if((sd->indmode != ELM_WIN_INDICATOR_SHOW)) + { +#ifdef defined(HAVE_ELEMENTARY_WAYLAND) || defined(HAVE_ELEMENTARY_WL2) + _indicator_visible_type_set(conformant, EINA_FALSE); +#endif + return; + } + + if ( sd->rot == 90 || sd->rot == 270 ) + { +#ifdef defined(HAVE_ELEMENTARY_WAYLAND) || defined(HAVE_ELEMENTARY_WL2) + _indicator_visible_type_set(conformant, EINA_FALSE); +#endif + return; + } + + if ((sd->ind_o_mode == ELM_WIN_INDICATOR_OPACITY_UNKNOWN) || + (sd->indmode == ELM_WIN_INDICATOR_UNKNOWN)) + return; + + if (sd->ind_o_mode == ELM_WIN_INDICATOR_TRANSPARENT) + { +#ifdef defined(HAVE_ELEMENTARY_WAYLAND) || defined(HAVE_ELEMENTARY_WL2) + _indicator_visible_type_set(conformant, EINA_FALSE); +#endif + } + else + { +#ifdef defined(HAVE_ELEMENTARY_WAYLAND) || defined(HAVE_ELEMENTARY_WL2) + _indicator_visible_type_set(conformant, EINA_TRUE); +#endif + } +} +// END static void _indicator_mode_set(Evas_Object *conformant, Elm_Win_Indicator_Mode indmode) { @@ -592,6 +950,8 @@ _indicator_mode_set(Evas_Object *conformant, Elm_Win_Indicator_Mode indmode) //create new indicator if (!old_indi) { + // TIZEN_ONLY(20170228): Remove legacy to coraborate with current indicator properly + /* if ((sd->rot == 90)||(sd->rot == 270)) { if (!sd->landscape_indicator) @@ -608,6 +968,12 @@ _indicator_mode_set(Evas_Object *conformant, Elm_Win_Indicator_Mode indmode) if (!sd->portrait_indicator) return; elm_layout_content_set(conformant, INDICATOR_PART, sd->portrait_indicator); } + */ + if (!sd->indicator) + sd->indicator = _create_indicator(conformant); + if (!sd->indicator) return; + elm_layout_content_set(conformant, INDICATOR_PART, sd->indicator); + //END } elm_object_signal_emit(conformant, "elm,state,indicator,show", "elm"); @@ -622,6 +988,17 @@ _indicator_opacity_set(Evas_Object *conformant, Elm_Win_Indicator_Opacity_Mode i ELM_CONFORMANT_DATA_GET(conformant, sd); sd->ind_o_mode = ind_o_mode; //TODO: opacity change + //TIZEN_ONLY(20160615): Sending signal to edje with indiecator type + DBG("[INDICATOR]The opacity mode of indicator was changed:(%d->%d) rot=%d", sd->ind_o_mode, ind_o_mode, sd->rot); + if (ind_o_mode == ELM_WIN_INDICATOR_TRANSLUCENT) + elm_object_signal_emit(conformant, "elm,state,indicator,translucent", "elm"); + else if (ind_o_mode == ELM_WIN_INDICATOR_TRANSPARENT) + elm_object_signal_emit(conformant, "elm,state,indicator,transparent", "elm"); + else if (ind_o_mode == ELM_WIN_INDICATOR_BG_TRANSPARENT) + elm_object_signal_emit(conformant, "elm,state,indicator,bg_transparent", "elm"); + else + elm_object_signal_emit(conformant, "elm,state,indicator,opaque", "elm"); + ///////////////////////////////////////////////////////////////////////////// } static void @@ -637,10 +1014,18 @@ _on_indicator_mode_changed(void *data, const Efl_Event *event) indmode = elm_win_indicator_mode_get(win); ind_o_mode = elm_win_indicator_opacity_get(win); + // TIZEN_ONLY(20160801):indicator implementation + Eina_Bool dirty = ((indmode != sd->indmode) | (ind_o_mode != sd->ind_o_mode)) ; // TIZEN_ONLY(20160801):indicator implementation + // END if (indmode != sd->indmode) _indicator_mode_set(conformant, indmode); if (ind_o_mode != sd->ind_o_mode) _indicator_opacity_set(conformant, ind_o_mode); + // TIZEN_ONLY(20160801):indicator implementation + if (dirty) + _indicator_post_appearance_changed(conformant); + // END + return; } static void @@ -658,9 +1043,13 @@ _on_rotation_changed(void *data, const Efl_Event *event EINA_UNUSED) if (rot == sd->rot) return; sd->rot = rot; - old_indi = elm_layout_content_unset(conformant, INDICATOR_PART); + _indicator_post_appearance_changed(conformant); // TIZEN_ONLY(20160801):indicator implementation + return; + // TIZEN_ONLY(20170228): Remove legacy to coraborate with current indicator properly + //old_indi = elm_layout_content_unset(conformant, INDICATOR_PART); /* this means ELM_WIN_INDICATOR_SHOW never be set.we don't need to change indicator type*/ - if (!old_indi) return; + /* + if (!old_indi) return EINA_TRUE; evas_object_hide(old_indi); if ((rot == 90) || (rot == 270)) @@ -685,7 +1074,19 @@ _on_rotation_changed(void *data, const Efl_Event *event EINA_UNUSED) evas_object_data_set(sd->portrait_indicator, CONFORMANT_KEY, (void *) (intptr_t) rot); elm_layout_content_set(conformant, INDICATOR_PART, sd->portrait_indicator); } + */ + //END +} +// TIZEN_ONLY(20160801):indicator implementation +static void +_on_indicator_flick_done(void *data, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Evas_Object *conformant = data; + _indicator_show_effect(conformant, 3); } +// END EOLIAN static Efl_Ui_Theme_Apply _elm_conformant_efl_ui_widget_theme_apply(Eo *obj, Elm_Conformant_Data *_pd EINA_UNUSED) @@ -1085,12 +1486,30 @@ _elm_conformant_efl_canvas_group_group_del(Eo *obj, Elm_Conformant_Data *sd) ecore_timer_del(sd->land_indi_timer); evas_object_del(sd->portrait_indicator); evas_object_del(sd->landscape_indicator); + evas_object_del(sd->indicator); evas_object_data_set(sd->win, "\377 elm,conformant", NULL); efl_event_callback_del(sd->win, EFL_UI_WIN_EVENT_INDICATOR_PROP_CHANGED, _on_indicator_mode_changed, obj); efl_event_callback_del(sd->win, EFL_UI_WIN_EVENT_ROTATION_CHANGED, _on_rotation_changed, obj); + // TIZEN_ONLY(20150707): implemented elm_win_conformant_set/get for wayland +#ifdef defined(HAVE_ELEMENTARY_WAYLAND) || defined(HAVE_ELEMENTARY_WL2) + evas_object_smart_callback_del_full + (sd->win, "conformant,changed", _on_conformant_changed, obj); +#endif + // END + // TIZEN_ONLY(20160801): indicator implementation +#ifdef defined(HAVE_ELEMENTARY_WAYLAND) || defined(HAVE_ELEMENTARY_WL2) + evas_object_smart_callback_del_full + (sd->win, "indicator,flick,done", _on_indicator_flick_done, obj); +#endif + if (sd->indicator_effect_timer) + { + ecore_timer_del(sd->indicator_effect_timer); + sd->indicator_effect_timer = NULL ; + } + //END efl_canvas_group_del(efl_super(obj, MY_CLASS)); } @@ -1169,8 +1588,8 @@ _elm_conformant_efl_object_constructor(Eo *obj, Elm_Conformant_Data *sd) Efl_Event event = {}; event.object = sd->win; sd->win = elm_widget_top_get(obj); - _on_indicator_mode_changed(obj, &event); - _on_rotation_changed(obj, &event); +// _on_indicator_mode_changed(obj, sd->win, NULL, NULL); +// _on_rotation_changed(obj, sd->win, NULL, NULL); sd->indmode = elm_win_indicator_mode_get(sd->win); sd->ind_o_mode = elm_win_indicator_opacity_get(sd->win); @@ -1179,11 +1598,25 @@ _elm_conformant_efl_object_constructor(Eo *obj, Elm_Conformant_Data *sd) efl_event_callback_add(sd->win, EFL_UI_WIN_EVENT_INDICATOR_PROP_CHANGED, _on_indicator_mode_changed, obj); efl_event_callback_add(sd->win, EFL_UI_WIN_EVENT_ROTATION_CHANGED, _on_rotation_changed, obj); - - // TIZEN_ONLY(20150707): elm_conform for wayland, and signal if parts are changed + // TIZEN_ONLY(20150707): implemented elm_win_conformant_set/get for wayland +#ifdef defined(HAVE_ELEMENTARY_WAYLAND) || defined(HAVE_ELEMENTARY_WL2) evas_object_smart_callback_add (sd->win, "conformant,changed", _on_conformant_changed, obj); - // END of TIZEN_ONLY(20150707) + // END + // TIZEN_ONLY(20160801): indicator implementation + evas_object_smart_callback_add + (sd->win, "indicator,flick,done", _on_indicator_flick_done, obj); + // END +#endif + + // TIZEN_ONLY(20161208): Support quickpanel callback + _conform_mod_init(); + if(sd->win && qp_mod && qp_mod->quickpanel_callback_add) + { + qp_mod->quickpanel_callback_add + (sd->win, CONFORM_QUICKPANEL_EVENT_VISIBILITY_CHANGED, _quickpanel_visibility_changed_cb, obj); + } + // END return obj; } diff --git a/src/lib/elementary/elm_plug.eo b/src/lib/elementary/elm_plug.eo index 2d5c087..4b991b0 100644 --- a/src/lib/elementary/elm_plug.eo +++ b/src/lib/elementary/elm_plug.eo @@ -42,5 +42,6 @@ class Elm.Plug (Efl.Ui.Widget, Efl.Ui.Clickable) events { image,deleted; [[Called when image was deleted]] image,resized; [[Called when image was resized]] + message,received; } } diff --git a/src/lib/elementary/elm_plug.h b/src/lib/elementary/elm_plug.h index 88ff450..ce609e5 100644 --- a/src/lib/elementary/elm_plug.h +++ b/src/lib/elementary/elm_plug.h @@ -25,6 +25,24 @@ * */ +//TIZEN_ONLY(20170104): add plug message feature +/** + * @typedef Elm_Plug_Message + * + * @brief The structure type holding the message + * which elm plug received from ecore evas + * + */ +struct _Elm_Plug_Message +{ + int msg_domain; + int msg_id; + void *data; + int size; +}; +typedef struct _Elm_Plug_Message Elm_Plug_Message; +// + /** * @addtogroup Plug diff --git a/src/lib/elementary/elm_widget_conform.h b/src/lib/elementary/elm_widget_conform.h index 1eda4c2..2fe6f78 100644 --- a/src/lib/elementary/elm_widget_conform.h +++ b/src/lib/elementary/elm_widget_conform.h @@ -51,8 +51,20 @@ struct _Elm_Conformant_Data Ecore_Timer *land_indi_timer; Ecore_Timer *port_indi_timer; + //TIZEN_ONLY(20160728) : indicator opacity mode implementation// + Ecore_Timer *indicator_effect_timer; + Eina_Bool on_indicator_effect : 1; + //END + //TIZEN_ONLY(20161220) : quickpanel visibility// + int quickpanel_state; + //END + int rot; Eina_Bool win_hidden; + //TIZEN_ONLY(20161220) : quickpanel visibility + Evas_Object *indicator; + Ecore_Timer *indi_timer; + //END }; /* Enum to identify conformant swallow parts */ @@ -65,6 +77,34 @@ enum _Conformant_Part_Type ELM_CONFORMANT_CLIPBOARD_PART = 8 }; + +// TIZEN_ONLY(20161208): Support quickpanel callback +typedef void (*quickpanel_callback_cb)(int event_type, void *event_info, void *user_data); + +typedef enum _Conformant_Quickpanel_Event Conformant_Quickpanel_Event; +enum _Conformant_Quickpanel_Event +{ + CONFORM_QUICKPANEL_EVENT_UNKNOWN, + CONFORM_QUICKPANEL_EVENT_VISIBILITY_CHANGED, +}; + +typedef enum _Conformant_Quickpanel_State Conformant_Quickpanel_State; +enum _Conformant_Quickpanel_State +{ + CONFORM_QUICKPANEL_STATE_VISIBILITY_UNKNOWN, // Unknown state + CONFORM_QUICKPANEL_STATE_VISIBILITY_SHOWN, // Shown state + CONFORM_QUICKPANEL_STATE_VISIBILITY_HIDDEN, // Hidden state + CONFORM_QUICKPANEL_STATE_VISIBILITY_PARTIALY_SHOWN, // Partialy shown state (Quickpanel is dragging now) +}; + +typedef struct _Elm_Conformant_Mod_Api Elm_Conformant_Mod_Api; +struct _Elm_Conformant_Mod_Api +{ + void (*quickpanel_callback_add)(Evas_Object *win, int event_type, quickpanel_callback_cb callback_cb, void *user_data); + void (*quickpanel_event_visible_get)(void *event_info, void *visible); +}; +// END + /** * @} */ -- 2.7.4