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;
}
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);
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)
{
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);
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),
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.
}
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);
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.
/* 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