From: Dheeraj Reddy Date: Thu, 2 May 2019 17:09:50 +0000 (+0530) Subject: elm_gengrid: Add logpress_timeout set and get APIs. X-Git-Tag: accepted/tizen/unified/20190503.040753~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2269f0257b74bd39cab603d603f63842be7d100b;p=platform%2Fupstream%2Fefl.git elm_gengrid: Add logpress_timeout set and get APIs. Summary: Setter and getter APIs added for "longpress_timeout" as requested for FLIP product. (APIs similar to elm_genlist) Change-Id: I7d3ebfdc860eb212da9b3ad678b49e1bf83e6bc5 Signed-off-by: Dheeraj Reddy --- diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c old mode 100644 new mode 100755 index c8c4a50..b7126da --- a/src/lib/elementary/elm_gengrid.c +++ b/src/lib/elementary/elm_gengrid.c @@ -1085,7 +1085,7 @@ _item_mouse_down_cb(void *data, ELM_SAFE_FREE(it->long_timer, ecore_timer_del); if (it->realized) it->long_timer = ecore_timer_add - (_elm_config->longpress_timeout, _long_press_cb, it); + (sd->longpress_timeout, _long_press_cb, it); else it->long_timer = NULL; } @@ -5474,6 +5474,7 @@ _elm_gengrid_efl_canvas_group_group_add(Eo *obj, Elm_Gengrid_Data *priv) priv->align_y = 0.0; priv->highlight = EINA_TRUE; priv->item_cache_max = CACHE_MAX; + priv->longpress_timeout = _elm_config->longpress_timeout; priv->pan_obj = efl_add(MY_PAN_CLASS, evas_object_evas_get(obj)); pan_data = efl_data_scope_get(priv->pan_obj, MY_PAN_CLASS); @@ -6821,6 +6822,18 @@ _elm_gengrid_items_count(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd) return sd->item_count; } +EOLIAN static void +_elm_gengrid_longpress_timeout_set(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, double timeout) +{ + sd->longpress_timeout = timeout; +} + +EOLIAN static double +_elm_gengrid_longpress_timeout_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd) +{ + return sd->longpress_timeout; +} + EAPI Elm_Gengrid_Item_Class * elm_gengrid_item_class_new(void) { diff --git a/src/lib/elementary/elm_gengrid_eo.c b/src/lib/elementary/elm_gengrid_eo.c old mode 100644 new mode 100755 index 177399b..b5c5ed4 --- a/src/lib/elementary/elm_gengrid_eo.c +++ b/src/lib/elementary/elm_gengrid_eo.c @@ -113,6 +113,14 @@ void _elm_gengrid_group_item_size_get(const Eo *obj, Elm_Gengrid_Data *pd, int * EOAPI EFL_VOID_FUNC_BODYV_CONST(elm_obj_gengrid_group_item_size_get, EFL_FUNC_CALL(w, h), int *w, int *h); +void _elm_gengrid_longpress_timeout_set(Eo *obj, Elm_Gengrid_Data *pd, double timeout); + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_longpress_timeout_set, EFL_FUNC_CALL(timeout), double timeout); + +double _elm_gengrid_longpress_timeout_get(const Eo *obj, Elm_Gengrid_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_gengrid_longpress_timeout_get, double, 0); + void _elm_gengrid_select_mode_set(Eo *obj, Elm_Gengrid_Data *pd, Elm_Object_Select_Mode mode); EOAPI EFL_VOID_FUNC_BODYV(elm_obj_gengrid_select_mode_set, EFL_FUNC_CALL(mode), Elm_Object_Select_Mode mode); @@ -448,6 +456,8 @@ _elm_gengrid_class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(elm_obj_gengrid_multi_select_get, _elm_gengrid_multi_select_get), EFL_OBJECT_OP_FUNC(elm_obj_gengrid_group_item_size_set, _elm_gengrid_group_item_size_set), EFL_OBJECT_OP_FUNC(elm_obj_gengrid_group_item_size_get, _elm_gengrid_group_item_size_get), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_longpress_timeout_set, _elm_gengrid_longpress_timeout_set), + EFL_OBJECT_OP_FUNC(elm_obj_gengrid_longpress_timeout_get, _elm_gengrid_longpress_timeout_get), EFL_OBJECT_OP_FUNC(elm_obj_gengrid_select_mode_set, _elm_gengrid_select_mode_set), EFL_OBJECT_OP_FUNC(elm_obj_gengrid_select_mode_get, _elm_gengrid_select_mode_get), EFL_OBJECT_OP_FUNC(elm_obj_gengrid_reorder_mode_set, _elm_gengrid_reorder_mode_set), diff --git a/src/lib/elementary/elm_gengrid_eo.h b/src/lib/elementary/elm_gengrid_eo.h old mode 100644 new mode 100755 index 340a273..cc94d12 --- a/src/lib/elementary/elm_gengrid_eo.h +++ b/src/lib/elementary/elm_gengrid_eo.h @@ -154,6 +154,35 @@ EOAPI void elm_obj_gengrid_group_item_size_set(Eo *obj, int w, int h); EOAPI void elm_obj_gengrid_group_item_size_get(const Eo *obj, int *w, int *h); /** + * @brief Set the timeout in seconds for the longpress event. + * + * This option will change how long it takes to send an event "longpressed" + * after the mouse down signal is sent to the list. If this event occurs, no + * "clicked" event will be sent. + * + * @warning If you set the longpress timeout value with this API, your gengrid + * will not be affected by the longpress value of elementary config value + * later. + * + * @param[in] obj The object. + * @param[in] timeout Timeout in seconds. Default is elm config value (1.0). + * + * @ingroup Elm_Gengrid + */ +EOAPI void elm_obj_gengrid_longpress_timeout_set(Eo *obj, double timeout); + +/** + * @brief Get the timeout in seconds for the longpress event. + * + * @param[in] obj The object. + * + * @return Timeout in seconds. Default is elm config value (1.0). + * + * @ingroup Elm_Gengrid + */ +EOAPI double elm_obj_gengrid_longpress_timeout_get(const Eo *obj); + +/** * @brief Set the gengrid select mode. * * This changes item select mode in the gengrid widget. diff --git a/src/lib/elementary/elm_gengrid_eo.legacy.c b/src/lib/elementary/elm_gengrid_eo.legacy.c old mode 100644 new mode 100755 index b823e8d..d116560 --- a/src/lib/elementary/elm_gengrid_eo.legacy.c +++ b/src/lib/elementary/elm_gengrid_eo.legacy.c @@ -48,6 +48,18 @@ elm_gengrid_group_item_size_get(const Elm_Gengrid *obj, int *w, int *h) } EAPI void +elm_gengrid_longpress_timeout_set(Elm_Gengrid *obj, double timeout) +{ + elm_obj_gengrid_longpress_timeout_set(obj, timeout); +} + +EAPI double +elm_gengrid_longpress_timeout_get(const Elm_Gengrid *obj) +{ + return elm_obj_gengrid_longpress_timeout_get(obj); +} + +EAPI void elm_gengrid_select_mode_set(Elm_Gengrid *obj, Elm_Object_Select_Mode mode) { elm_obj_gengrid_select_mode_set(obj, mode); diff --git a/src/lib/elementary/elm_gengrid_eo.legacy.h b/src/lib/elementary/elm_gengrid_eo.legacy.h old mode 100644 new mode 100755 index b454ac0..dbbe6cc --- a/src/lib/elementary/elm_gengrid_eo.legacy.h +++ b/src/lib/elementary/elm_gengrid_eo.legacy.h @@ -147,6 +147,35 @@ EAPI void elm_gengrid_group_item_size_set(Elm_Gengrid *obj, int w, int h); EAPI void elm_gengrid_group_item_size_get(const Elm_Gengrid *obj, int *w, int *h); /** + * @brief Set the timeout in seconds for the longpress event. + * + * This option will change how long it takes to send an event "longpressed" + * after the mouse down signal is sent to the list. If this event occurs, no + * "clicked" event will be sent. + * + * @warning If you set the longpress timeout value with this API, your gengrid + * will not be affected by the longpress value of elementary config value + * later. + * + * @param[in] obj The object. + * @param[in] timeout Timeout in seconds. Default is elm config value (1.0). + * + * @ingroup Elm_Gengrid_Group + */ +EAPI void elm_gengrid_longpress_timeout_set(Elm_Gengrid *obj, double timeout); + +/** + * @brief Get the timeout in seconds for the longpress event. + * + * @param[in] obj The object. + * + * @return Timeout in seconds. Default is elm config value (1.0). + * + * @ingroup Elm_Gengrid_Group + */ +EAPI double elm_gengrid_longpress_timeout_get(const Elm_Gengrid *obj); + +/** * @brief Set the gengrid select mode. * * This changes item select mode in the gengrid widget. diff --git a/src/lib/elementary/elm_widget_gengrid.h b/src/lib/elementary/elm_widget_gengrid.h old mode 100644 new mode 100755 index 00dd04b..87dbc0097 --- a/src/lib/elementary/elm_widget_gengrid.h +++ b/src/lib/elementary/elm_widget_gengrid.h @@ -73,7 +73,7 @@ struct _Elm_Gengrid_Data /* longpress timeout. this value comes from _elm_config by * default. this can be changed by - * elm_config_longpress_timeout_set() */ + * elm_gengrid_longpress_timeout_set() */ double longpress_timeout; /* a generation of gengrid. when gengrid is cleared, this value