Sync with open source about the config(min_friction, friction_standard)
authorJaehwan Kim <jae.hwan.kim@samsung.com>
Fri, 3 May 2013 04:19:27 +0000 (13:19 +0900)
committerSungho Kwak <sungho1.kwak@samsung.com>
Wed, 12 Jun 2013 04:48:30 +0000 (13:48 +0900)
Change-Id: I59964d643500133d8d5d95a813dcce15cb1bfb77

config/default/base.src
config/desktop/base.src
config/illume/base.src
config/mobile/base.src
config/standard/base.src
src/bin/config.c
src/lib/elm_config.c
src/lib/elm_config.h
src/lib/elm_priv.h

index af84256..31a50cd 100644 (file)
@@ -8,7 +8,7 @@ group "Elm_Config" struct {
   value "thumbscroll_momentum_threshold" double: 100.0;
   value "thumbscroll_friction" double: 1.0;
   value "thumbscroll_min_friction" double: 1.0;
-  value "thumbscroll_friction_standard" int: 2000;
+  value "thumbscroll_friction_standard" double: 2000.0;
   value "thumbscroll_bounce_friction" double: 0.5;
   value "thumbscroll_bounce_enable" uchar: 1;
   value "page_scroll_friction" double: 0.5;
index fb66a14..8f09b88 100644 (file)
@@ -7,7 +7,7 @@ group "Elm_Config" struct {
   value "thumbscroll_momentum_threshold" double: 100.0;
   value "thumbscroll_friction" double: 1.0;
   value "thumbscroll_min_friction" double: 1.0;
-  value "thumbscroll_friction_standard" int: 2000;
+  value "thumbscroll_friction_standard" double: 2000.0;
   value "thumbscroll_bounce_friction" double: 0.5;
   value "thumbscroll_bounce_enable" uchar: 0;
   value "page_scroll_friction" double: 0.5;
index bc51b2f..99249dc 100644 (file)
@@ -7,7 +7,7 @@ group "Elm_Config" struct {
   value "thumbscroll_momentum_threshold" double: 100.0;
   value "thumbscroll_friction" double: 1.0;
   value "thumbscroll_min_friction" double: 1.0;
-  value "thumbscroll_friction_standard" int: 2000;
+  value "thumbscroll_friction_standard" double: 2000.0;
   value "thumbscroll_bounce_friction" double: 0.5;
   value "thumbscroll_bounce_enable" uchar: 1;
   value "page_scroll_friction" double: 0.5;
index 702c1d5..3a29cbb 100644 (file)
@@ -8,7 +8,7 @@ group "Elm_Config" struct {
   value "thumbscroll_momentum_threshold" double: 100.0;
   value "thumbscroll_friction" double: 1.0;
   value "thumbscroll_min_friction" double: 0.3;
-  value "thumbscroll_friction_standard" int: 3000;
+  value "thumbscroll_friction_standard" double: 3000.0;
   value "thumbscroll_bounce_friction" double: 0.5;
   value "thumbscroll_bounce_enable" uchar: 0;
   value "page_scroll_friction" double: 0.5;
index 9da0314..0c20e3c 100644 (file)
@@ -7,6 +7,8 @@ group "Elm_Config" struct {
   value "thumbscroll_hold_threshold" int: 4;
   value "thumbscroll_momentum_threshold" double: 100.0;
   value "thumbscroll_friction" double: 1.0;
+  value "thumbscroll_min_friction" double: 1.0;
+  value "thumbscroll_friction_standard" double: 2000.0;
   value "thumbscroll_bounce_friction" double: 0.5;
   value "thumbscroll_bounce_enable" uchar: 0;
   value "page_scroll_friction" double: 0.5;
@@ -14,6 +16,7 @@ group "Elm_Config" struct {
   value "zoom_friction" double: 0.5;
   value "thumbscroll_border_friction" double: 0.5;
   value "thumbscroll_sensitivity_friction" double: 0.25;
+  value "scroll_smooth_start_enable" uchar: 0;
   value "scroll_smooth_amount" double: 0.0;
   value "scroll_smooth_history_weight" double: 0.1;
   value "scroll_smooth_future_time" double: 0.0;
index 5daca3a..244bb80 100644 (file)
@@ -372,6 +372,56 @@ tsf_change(void *data       __UNUSED__,
 }
 
 static void
+tsmf_round(void *data       __UNUSED__,
+           Evas_Object     *obj,
+           void *event_info __UNUSED__)
+{
+   double val = elm_slider_value_get(obj);
+   double v;
+
+   v = ((double)((int)(val * 10.0))) / 10.0;
+   if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+tsmf_change(void *data       __UNUSED__,
+            Evas_Object     *obj,
+            void *event_info __UNUSED__)
+{
+   double tsmf = elm_config_scroll_thumbscroll_min_friction_get();
+   double val = elm_slider_value_get(obj);
+
+   if (tsmf == val) return;
+   elm_config_scroll_thumbscroll_min_friction_set(val);
+   elm_config_all_flush();
+}
+
+static void
+tsfs_round(void *data       __UNUSED__,
+           Evas_Object     *obj,
+           void *event_info __UNUSED__)
+{
+   double val = elm_slider_value_get(obj);
+   double v;
+
+   v = ((double)((int)(val * 10.0))) / 10.0;
+   if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+tsfs_change(void *data       __UNUSED__,
+            Evas_Object     *obj,
+            void *event_info __UNUSED__)
+{
+   double tsfs = elm_config_scroll_thumbscroll_friction_standard_get();
+   double val = elm_slider_value_get(obj);
+
+   if (tsfs == val) return;
+   elm_config_scroll_thumbscroll_friction_standard_set(val);
+   elm_config_all_flush();
+}
+
+static void
 tsbf_round(void *data       __UNUSED__,
            Evas_Object     *obj,
            void *event_info __UNUSED__)
@@ -972,9 +1022,13 @@ _font_overlay_change(void *data       __UNUSED__,
 static void
 _config_display_update(Evas_Object *win)
 {
-   int flush_interval, font_c, image_c, edje_file_c, edje_col_c, ts_threshould, ts_hold_threshold;
+   int flush_interval, font_c, image_c, edje_file_c, edje_col_c, ts_threshould,
+       ts_hold_threshold;
    double scale, s_bounce_friction, ts_momentum_threshold, ts_friction,
-          ts_border_friction, ts_sensitivity_friction, page_friction, bring_in_friction, zoom_friction;
+          ts_min_friction, ts_friction_standard, ts_border_friction,
+          ts_sensitivity_friction, ts_acceleration_threshold,
+          ts_acceleration_time_limit, ts_acceleration_weight, page_friction,
+          bring_in_friction, zoom_friction;
    const char *curr_theme, *curr_engine;
    const Eina_List *l_items, *l;
    Eina_Bool s_bounce, ts;
@@ -997,6 +1051,8 @@ _config_display_update(Evas_Object *win)
    ts_hold_threshold = elm_config_scroll_thumbscroll_hold_threshold_get();
    ts_momentum_threshold = elm_config_scroll_thumbscroll_momentum_threshold_get();
    ts_friction = elm_config_scroll_thumbscroll_friction_get();
+   ts_min_friction = elm_config_scroll_thumbscroll_min_friction_get();
+   ts_friction_standard = elm_config_scroll_thumbscroll_friction_standard_get();
    ts_border_friction = elm_config_scroll_thumbscroll_border_friction_get();
    ts_sensitivity_friction = elm_config_scroll_thumbscroll_sensitivity_friction_get();
    page_friction = elm_config_scroll_page_scroll_friction_get();
@@ -1037,6 +1093,12 @@ _config_display_update(Evas_Object *win)
    elm_slider_value_set(evas_object_data_get(win,
                                              "thumbscroll_friction_slider"),
                         ts_friction);
+   elm_slider_value_set(evas_object_data_get(win,
+                                             "thumbscroll_min_friction_slider"),
+                        ts_min_friction);
+   elm_slider_value_set(evas_object_data_get(win,
+                                             "thumbscroll_friction__standard_slider"),
+                        ts_friction);
    elm_slider_value_set(evas_object_data_get(win, "ts_border_friction_slider"),
                         ts_border_friction);
    elm_slider_value_set(evas_object_data_get(win, "ts_sensitivity_friction_slider"),
@@ -2708,6 +2770,47 @@ _status_config_scrolling(Evas_Object *win,
    evas_object_smart_callback_add(sl, "changed", tsf_round, NULL);
    evas_object_smart_callback_add(sl, "delay,changed", tsf_change, NULL);
 
+   LABEL_FRAME_ADD("<hilight>Thumb scroll min friction</>");
+
+   sl = elm_slider_add(win);
+   elm_object_tooltip_text_set(sl, "This is the min amount of inertia a<br/>"
+                                   "scroller will impose at self scrolling<br/>"
+                                   "animations");
+   evas_object_data_set(win, "thumbscroll_min_friction_slider", sl);
+   evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+   evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+   elm_slider_span_size_set(sl, 120);
+   elm_slider_unit_format_set(sl, "%1.1f");
+   elm_slider_indicator_format_set(sl, "%1.1f");
+   elm_slider_min_max_set(sl, 0.0, 15.0);
+   elm_slider_value_set(sl, elm_config_scroll_thumbscroll_min_friction_get());
+   elm_box_pack_end(bx, sl);
+   evas_object_show(sl);
+
+   evas_object_smart_callback_add(sl, "changed", tsmf_round, NULL);
+   evas_object_smart_callback_add(sl, "delay,changed", tsmf_change, NULL);
+
+   LABEL_FRAME_ADD("<hilight>Thumb scroll friction standard</>");
+
+   sl = elm_slider_add(win);
+   elm_object_tooltip_text_set(sl, "This is the standard velocity of the scroller."
+                                   "<br/>The scroll animation time is same<br/>"
+                                   "with thumbscroll friction, if the velocity"
+                                   "<br/>is same with standard velocity.");
+   evas_object_data_set(win, "thumbscroll_friction_standard_slider", sl);
+   evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+   evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+   elm_slider_span_size_set(sl, 120);
+   elm_slider_unit_format_set(sl, "%1.0f pixel/s");
+   elm_slider_indicator_format_set(sl, "%1.0f");
+   elm_slider_min_max_set(sl, 10.0, 5000.0);
+   elm_slider_value_set(sl, elm_config_scroll_thumbscroll_friction_standard_get());
+   elm_box_pack_end(bx, sl);
+   evas_object_show(sl);
+
+   evas_object_smart_callback_add(sl, "changed", tsfs_round, NULL);
+   evas_object_smart_callback_add(sl, "delay,changed", tsfs_change, NULL);
+
    LABEL_FRAME_ADD("<hilight>Thumb scroll border friction</>");
 
    sl = elm_slider_add(win);
index 3c1976c..a337f9a 100644 (file)
@@ -333,7 +333,7 @@ _desc_init(void)
    ELM_CONFIG_VAL(D, T, thumbscroll_momentum_threshold, T_DOUBLE);
    ELM_CONFIG_VAL(D, T, thumbscroll_friction, T_DOUBLE);
    ELM_CONFIG_VAL(D, T, thumbscroll_min_friction, T_DOUBLE);
-   ELM_CONFIG_VAL(D, T, thumbscroll_friction_standard, T_INT);
+   ELM_CONFIG_VAL(D, T, thumbscroll_friction_standard, T_DOUBLE);
    ELM_CONFIG_VAL(D, T, thumbscroll_bounce_friction, T_DOUBLE);
    ELM_CONFIG_VAL(D, T, thumbscroll_border_friction, T_DOUBLE);
    ELM_CONFIG_VAL(D, T, thumbscroll_sensitivity_friction, T_DOUBLE);
@@ -1032,7 +1032,7 @@ _config_load(void)
    _elm_config->thumbscroll_momentum_threshold = 100.0;
    _elm_config->thumbscroll_friction = 1.0;
    _elm_config->thumbscroll_min_friction = 0.5;
-   _elm_config->thumbscroll_friction_standard = 1000;
+   _elm_config->thumbscroll_friction_standard = 1000.0;
    _elm_config->thumbscroll_bounce_friction = 0.5;
    _elm_config->thumbscroll_bounce_enable = EINA_TRUE;
    _elm_config->page_scroll_friction = 0.5;
@@ -1429,7 +1429,7 @@ _env_get(void)
    s = getenv("ELM_THUMBSCROLL_MIN_FRICTION");
    if (s) _elm_config->thumbscroll_min_friction = _elm_atof(s);
    s = getenv("ELM_THUMBSCROLL_FRICTION_STANDARD");
-   if (s) _elm_config->thumbscroll_friction_standard = atoi(s);
+   if (s) _elm_config->thumbscroll_friction_standard = _elm_atof(s);
    s = getenv("ELM_THUMBSCROLL_BOUNCE_ENABLE");
    if (s) _elm_config->thumbscroll_bounce_enable = !!atoi(s);
    s = getenv("ELM_THUMBSCROLL_BOUNCE_FRICTION");
@@ -2137,14 +2137,14 @@ elm_config_scroll_thumbscroll_min_friction_set(double friction)
    _elm_config->thumbscroll_min_friction = friction;
 }
 
-EAPI int
+EAPI double
 elm_config_scroll_thumbscroll_friction_standard_get(void)
 {
    return _elm_config->thumbscroll_friction_standard;
 }
 
 EAPI void
-elm_config_scroll_thumbscroll_friction_standard_set(int standard)
+elm_config_scroll_thumbscroll_friction_standard_set(double standard)
 {
    _elm_config->thumbscroll_friction_standard = standard;
 }
index 6aef84a..b7157b5 100644 (file)
@@ -410,7 +410,7 @@ EAPI void         elm_config_scroll_thumbscroll_min_friction_set(double friction
  *
  * @ingroup Scrolling
  */
-EAPI int          elm_config_scroll_thumbscroll_friction_standard_get(void);
+EAPI double       elm_config_scroll_thumbscroll_friction_standard_get(void);
 
 /**
  * Set the standard velocity of the scroller. The scroll animation time is
@@ -422,7 +422,7 @@ EAPI int          elm_config_scroll_thumbscroll_friction_standard_get(void);
  * @see elm_config_thumbscroll_friction_standard_get()
  * @ingroup Scrolling
  */
-EAPI void         elm_config_scroll_thumbscroll_friction_standard_set(int standard);
+EAPI void         elm_config_scroll_thumbscroll_friction_standard_set(double standard);
 
 /**
  * Get the amount of lag between your actual mouse cursor dragging
index f29cab6..b7567af 100644 (file)
@@ -163,7 +163,7 @@ struct _Elm_Config
    double        thumbscroll_momentum_threshold;
    double        thumbscroll_friction;
    double        thumbscroll_min_friction;
-   int           thumbscroll_friction_standard;
+   double        thumbscroll_friction_standard;
    double        thumbscroll_bounce_friction;
    double        page_scroll_friction;
    double        bring_in_scroll_friction;