* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
typedef enum {
- GESTURE_EVENT_NONE = 0, /**< The gesture is not detected */
- GESTURE_EVENT_DETECTED = 1, /**< The gesture is detected */
+ GESTURE_EVENT_NONE = 0, /**< Detected nothing */
+ GESTURE_EVENT_DETECTED = 1, /**< Detected the gesture */
- GESTURE_SHAKE_DETECTED = 1, /**< Shake gesture is detected */
- GESTURE_SHAKE_FINISHED = 2, /**< Shake gesture finished */
+ GESTURE_SHAKE_DETECTED = 1, /**< Shake gesture started */
+ GESTURE_SHAKE_FINISHED = 2, /**< Shake gesture stopped */
- GESTURE_SNAP_X_NEGATIVE = 1, /**< -X snap is detected */
- GESTURE_SNAP_X_POSITIVE = 2, /**< +X snap is detected */
- GESTURE_SNAP_Y_NEGATIVE = 3, /**< -Y snap is detected */
- GESTURE_SNAP_Y_POSITIVE = 4, /**< +Y snap is detected */
- GESTURE_SNAP_Z_NEGATIVE = 5, /**< -Z snap is detected */
- GESTURE_SNAP_Z_POSITIVE = 6, /**< +Z snap is detected */
+ GESTURE_SNAP_X_NEGATIVE = 1, /**< Detected -X snap */
+ GESTURE_SNAP_X_POSITIVE = 2, /**< Detected +X snap */
+ GESTURE_SNAP_Y_NEGATIVE = 3, /**< Detected -Y snap */
+ GESTURE_SNAP_Y_POSITIVE = 4, /**< Detected +Y snap */
+ GESTURE_SNAP_Z_NEGATIVE = 5, /**< Detected -Z snap */
+ GESTURE_SNAP_Z_POSITIVE = 6, /**< Detected +Z snap */
} gesture_event_e;
/**
#include "motion_engine.h"
#include "gesture.h"
+using namespace ctx::gesture;
+
static ctx::handle_map_t<_cx_gesture_h> handle_map;
void cx_gesture_deliver_data(int req_id, _cx_gesture_data data, double timestamp, int error)
ASSERT_SUPPORTED(FEATURE_KEY_GESTURE);
ASSERT_NULL(supported);
- if (!ctx::gesture::me_check_coverage(gesture))
- return GESTURE_ERROR_NONE;
+ int ret = GESTURE_ERROR_NONE;
- int ret = ctx::gesture::me_is_supported(gesture);
- if (ret == GESTURE_ERROR_NONE)
- *supported = true;
+ if (motion_engine::check_coverage(gesture)) {
+ ret = motion_engine::is_supported(gesture);
+ *supported = (ret == GESTURE_ERROR_NONE);
+ }
- return GESTURE_ERROR_NONE;
+ return ret;
}
EXTAPI int gesture_create(gesture_h *handle)
int ret;
- if (ctx::gesture::me_check_coverage(gesture)) {
- ret = ctx::gesture::me_start(handle, gesture, option);
+ if (motion_engine::check_coverage(gesture)) {
+ ret = motion_engine::start(handle, gesture, option);
} else {
ret = GESTURE_ERROR_INVALID_PARAMETER;
}
int ret = GESTURE_ERROR_NOT_STARTED;
if (handle_map.find(handle->req_id) != NULL) {
- if (ctx::gesture::me_check_coverage(handle->gesture))
- ctx::gesture::me_stop(handle);
+ if (motion_engine::check_coverage(handle->gesture))
+ motion_engine::stop(handle);
handle_map.remove(handle->req_id);
ret = GESTURE_ERROR_NONE;
return CTX_VALUE_UNDEFINED;
}
-bool ctx::gesture::me_check_coverage(int motion)
+bool ctx::gesture::motion_engine::check_coverage(int motion)
{
switch (motion) {
case GESTURE_SHAKE:
}
}
-int ctx::gesture::me_is_supported(int motion)
+int ctx::gesture::motion_engine::is_supported(int motion)
{
int handle = -1, res;
int ev_type = get_event_type(motion);
return res;
}
-int ctx::gesture::me_start(_cx_gesture_h *handle, int gesture, int option)
+int ctx::gesture::motion_engine::start(_cx_gesture_h *handle, int gesture, int option)
{
int ev_type = get_event_type(gesture);
int me_opt = get_me_option(option);
return GESTURE_ERROR_NONE;
}
-int ctx::gesture::me_stop(_cx_gesture_h *handle)
+int ctx::gesture::motion_engine::stop(_cx_gesture_h *handle)
{
LOGI("Stopping MotionEngine Event %d", handle->me_event);
#include <stdbool.h>
#include "gesture.h"
-namespace ctx { namespace gesture{
+namespace ctx { namespace gesture { namespace motion_engine {
- bool me_check_coverage(int gesture);
- int me_is_supported(int gesture);
- int me_start(_cx_gesture_h *handle, int gesture, int mode);
- int me_stop(_cx_gesture_h *handle);
+ bool check_coverage(int gesture);
+ int is_supported(int gesture);
+ int start(_cx_gesture_h *handle, int gesture, int mode);
+ int stop(_cx_gesture_h *handle);
-} } /* namespace ctx::gesture */
+} } }
#endif /* End of _CX_GESTURE_MOTION_ENGINE_H_ */