summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjeon <jhyuni.kang@samsung.com>2020-07-27 19:12:02 +0900
committerjeon <jhyuni.kang@samsung.com>2020-07-27 19:12:02 +0900
commit7008ab05f7e1d1539b8436ad2ae11878021281f4 (patch)
tree5ceecff9b8444651ff6db6403157b7b0bc64ee7f
parentd2fe87a9c2e7b713a668e99b292d74872767382b (diff)
downloade-mod-tizen-gesture-7008ab05f7e1d1539b8436ad2ae11878021281f4.tar.gz
e-mod-tizen-gesture-7008ab05f7e1d1539b8436ad2ae11878021281f4.tar.bz2
e-mod-tizen-gesture-7008ab05f7e1d1539b8436ad2ae11878021281f4.zip
remove a cyclomatic complexity
Change-Id: I43157b1186484945a2e1c8e480076f6fc0b0281e
-rw-r--r--src/e_mod_gesture_conf.c42
1 files changed, 35 insertions, 7 deletions
diff --git a/src/e_mod_gesture_conf.c b/src/e_mod_gesture_conf.c
index d0ddb43..6f12268 100644
--- a/src/e_mod_gesture_conf.c
+++ b/src/e_mod_gesture_conf.c
@@ -2,14 +2,8 @@
#include "e_mod_main.h"
void
-_e_gesture_conf_value_check(E_Gesture_Config_Data* gconfig)
+_e_gesture_conf_edge_swipe_check(E_Gesture_Conf_Edd *conf)
{
- E_Gesture_Conf_Edd *conf;
- if (!gconfig->conf) gconfig->conf = E_NEW(E_Gesture_Conf_Edd, 1);
- EINA_SAFETY_ON_NULL_RETURN(gconfig->conf);
-
- conf = gconfig->conf;
-
if (!conf->key_device_name) conf->key_device_name = strdup(E_GESTURE_KEYBOARD_DEVICE);
if (conf->edge_swipe.time_done <= 0.0) conf->edge_swipe.time_done = E_GESTURE_EDGE_SWIPE_DONE_TIME;
if (conf->edge_swipe.time_begin <= 0.0) conf->edge_swipe.time_begin = E_GESTURE_EDGE_SWIPE_START_TIME;
@@ -18,23 +12,57 @@ _e_gesture_conf_value_check(E_Gesture_Config_Data* gconfig)
if (conf->edge_swipe.max_length <= 0) conf->edge_swipe.max_length = E_GESTURE_EDGE_SWIPE_DIFF_SUCCESS;
if (conf->edge_swipe.compose_key <= 0) conf->edge_swipe.compose_key = E_GESTURE_EDGE_SWIPE_COMBINE_KEY;
if (conf->edge_swipe.back_key <= 0) conf->edge_swipe.back_key = E_GESTURE_EDGE_SWIPE_BACK_KEY;
+}
+void
+_e_gesture_conf_edge_drag_check(E_Gesture_Conf_Edd *conf)
+{
if (conf->edge_drag.time_begin <= 0.0) conf->edge_drag.time_begin = E_GESTURE_EDGE_DRAG_START_TIME;
if (conf->edge_drag.area_offset <= 0) conf->edge_drag.area_offset = E_GESTURE_EDGE_DRAG_START_AREA;
if (conf->edge_drag.diff_length <= 0) conf->edge_drag.diff_length = E_GESTURE_EDGE_DRAG_DIFF;
+}
+void
+_e_gesture_conf_tap_check(E_Gesture_Conf_Edd *conf)
+{
if (conf->tap.repeats_max <= 0) conf->tap.repeats_max = E_GESTURE_TAP_REPEATS_MAX;
if (conf->tap.time_start <= 0.0) conf->tap.time_start = E_GESTURE_TAP_START_TIME;
if (conf->tap.time_done <= 0.0) conf->tap.time_done = E_GESTURE_TAP_DONE_TIME;
if (conf->tap.time_interval <= 0.0) conf->tap.time_interval = E_GESTURE_TAP_INTERVAL_TIME;
if (conf->tap.moving_range <= 0) conf->tap.moving_range = E_GESTURE_TAP_MOVING_RANGE;
+}
+void
+_e_gesture_conf_pan_check(E_Gesture_Conf_Edd *conf)
+{
if (conf->pan.time_start <= 0.0) conf->pan.time_start = E_GESTURE_PAN_START_TIME;
if (conf->pan.moving_range <= 0) conf->pan.moving_range = E_GESTURE_PAN_MOVING_RANGE;
+}
+void
+_e_gesture_conf_pinch_check(E_Gesture_Conf_Edd *conf)
+{
if (conf->pinch.moving_distance_range <= 0.0) conf->pinch.moving_distance_range = E_GESTURE_PINCH_MOVING_DISTANCE_RANGE;
}
+
+
+void
+_e_gesture_conf_value_check(E_Gesture_Config_Data* gconfig)
+{
+ E_Gesture_Conf_Edd *conf;
+ if (!gconfig->conf) gconfig->conf = E_NEW(E_Gesture_Conf_Edd, 1);
+ EINA_SAFETY_ON_NULL_RETURN(gconfig->conf);
+
+ conf = gconfig->conf;
+
+ _e_gesture_conf_edge_swipe_check(conf);
+ _e_gesture_conf_edge_drag_check(conf);
+ _e_gesture_conf_tap_check(conf);
+ _e_gesture_conf_pan_check(conf);
+ _e_gesture_conf_pinch_check(conf);
+}
+
void
e_gesture_conf_init(E_Gesture_Config_Data *gconfig)
{