static void
my_bt_gesture(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
- elm_photocam_gesture_set(data, !elm_photocam_gesture_get(data));
+ elm_photocam_gesture_enabled_set(data, !elm_photocam_gesture_enabled_get(data));
}
static void
Eina_Bool on_hold : 1;
Eina_Bool paused : 1;
Eina_Bool do_region : 1;
+ Eina_Bool do_gesture : 1;
Eina_Bool zoom_gest : 1;
};
}
EAPI void
-elm_photocam_gesture_set(Evas_Object *obj, Eina_Bool gesture)
+elm_photocam_gesture_enabled_set(Evas_Object *obj, Eina_Bool gesture)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if ((wd->gest && !!gesture) || (!wd->gest && !gesture)) return;
+ if (wd->do_gesture == !!gesture) return;
if (wd->gest)
{
if (gesture)
{
wd->gest = elm_gesture_layer_add(wd->obj);
+ if (!wd->gest) return;
elm_gesture_layer_attach(wd->gest, wd->obj);
elm_gesture_layer_cb_set(wd->gest, ELM_GESTURE_ZOOM, ELM_GESTURE_STATE_START,
_gzoom_start, wd);
elm_gesture_layer_cb_set(wd->gest, ELM_GESTURE_ZOOM, ELM_GESTURE_STATE_ABORT,
_gzoom_end, wd);
}
+
+ wd->do_gesture = !!gesture;
}
EAPI Eina_Bool
-elm_photocam_gesture_get(const Evas_Object *obj)
+elm_photocam_gesture_enabled_get(const Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return EINA_FALSE;
- if (wd->gest)
- return EINA_TRUE;
- return EINA_FALSE;
+ return wd->do_gesture;
}
* This sets the gesture state to on(EINA_TRUE) or off (EINA_FALSE) for
* photocam. The default is off. This will start multi touch zooming.
*/
-EAPI void elm_photocam_gesture_set(Evas_Object *obj, Eina_Bool gesture);
+EAPI void elm_photocam_gesture_enabled_set(Evas_Object *obj, Eina_Bool gesture);
/**
* @brief Get the gesture state for photocam.
*
* This gets the current gesture state for the photocam object.
*
- * @see elm_photocam_gesture_set()
+ * @see elm_photocam_gesture_enabled_set()
*/
-EAPI Eina_Bool elm_photocam_gesture_get(const Evas_Object *obj);
+EAPI Eina_Bool elm_photocam_gesture_enabled_get(const Evas_Object *obj);
/**
* @}
*/