Elementary glayer: Added a config value to disable multitouch zoom.
[framework/uifw/elementary.git] / src / lib / elm_config.c
index 13a4ff6..29cc3e2 100644 (file)
@@ -33,6 +33,8 @@ const char *_elm_engines[] = {
    "opengl_sdl",
    "buffer",
    "ews",
+   "opengl_cocoa",
+   "psl1ght",
    NULL
 };
 
@@ -101,7 +103,7 @@ static Eina_Bool
 _prop_all_update_cb(void *data __UNUSED__)
 {
    _prop_config_set();
-   ecore_x_window_prop_string_set(_root_1st, _atom[ATOM_E_PROFILE], 
+   ecore_x_window_prop_string_set(_root_1st, _atom[ATOM_E_PROFILE],
                                   _elm_profile);
    _prop_all_update_timer = NULL;
    return EINA_FALSE;
@@ -166,13 +168,13 @@ _prop_config_set(void)
 {
    unsigned char *config_data = NULL;
    int size = 0;
-   
+
    config_data = eet_data_descriptor_encode(_config_edd, _elm_config, &size);
    if (config_data)
      {
         Ecore_X_Atom atom;
         char buf[512];
-        
+
         snprintf(buf, sizeof(buf), "ELM_CONFIG_%s", _elm_profile);
         atom = ecore_x_atom_get(buf);
         _atom_config = atom;
@@ -188,7 +190,7 @@ static Eina_Bool
 _prop_change_delay_cb(void *data __UNUSED__)
 {
    char *s;
-   
+
    s = ecore_x_window_prop_string_get(_root_1st, _atom[ATOM_E_PROFILE]);
    if (s)
      {
@@ -316,6 +318,7 @@ _desc_init(void)
    ELM_CONFIG_VAL(D, T, desktop_entry, T_UCHAR);
    ELM_CONFIG_VAL(D, T, password_show_last, T_UCHAR);
    ELM_CONFIG_VAL(D, T, password_show_last_timeout, T_DOUBLE);
+   ELM_CONFIG_VAL(D, T, glayer_zoom_finger_enable, T_UCHAR);
    ELM_CONFIG_VAL(D, T, glayer_zoom_finger_factor, T_DOUBLE);
    ELM_CONFIG_VAL(D, T, glayer_zoom_wheel_factor, T_DOUBLE);
    ELM_CONFIG_VAL(D, T, glayer_zoom_distance_tolerance, T_DOUBLE);
@@ -885,6 +888,7 @@ _config_load(void)
    _elm_config->is_mirrored = EINA_FALSE; /* Read sys value in env_get() */
    _elm_config->password_show_last = EINA_FALSE;
    _elm_config->password_show_last_timeout = 2.0;
+   _elm_config->glayer_zoom_finger_enable = EINA_FALSE;
    _elm_config->glayer_zoom_finger_factor = 1.0;
    _elm_config->glayer_zoom_wheel_factor = 0.05;
    _elm_config->glayer_zoom_distance_tolerance = 1.0; /* 1 times elm_finger_size_get() */
@@ -892,7 +896,7 @@ _config_load(void)
    _elm_config->glayer_line_min_length = 1.0;         /* 1 times elm_finger_size_get() */
    _elm_config->glayer_line_distance_tolerance = 3.0; /* 3 times elm_finger_size_get() */
    _elm_config->glayer_line_angular_tolerance = 0.34906585;       /* Represents 20 DEG */
-   _elm_config->glayer_flick_time_limit_ms = 60;              /* 60 ms to finish flick */
+   _elm_config->glayer_flick_time_limit_ms = 120;              /* ms to finish flick */
    _elm_config->glayer_long_tap_start_timeout = 1.2;   /* 1.2 second to start long-tap */
    _elm_config->glayer_continues_enable = EINA_TRUE;      /* Continue gestures default */
 }
@@ -1159,6 +1163,8 @@ _env_get(void)
         else if ((!strcasecmp(s, "directfb")) ||
                  (!strcasecmp(s, "dfb")))
           eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_DIRECTFB);
+        else if ((!strcasecmp(s, "psl1ght")))
+          eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_PSL1GHT);
         else if ((!strcasecmp(s, "sdl")) ||
                  (!strcasecmp(s, "software-sdl")) ||
                  (!strcasecmp(s, "software_sdl")))
@@ -1172,6 +1178,11 @@ _env_get(void)
                  (!strcasecmp(s, "gl-sdl")) ||
                  (!strcasecmp(s, "gl_sdl")))
           eina_stringshare_replace(&_elm_config->engine, ELM_OPENGL_SDL);
+        else if ((!strcasecmp(s, "opengl-cocoa")) ||
+                 (!strcasecmp(s, "opengl_cocoa")) ||
+                 (!strcasecmp(s, "gl-cocoa")) ||
+                 (!strcasecmp(s, "gl_cocoa")))
+          eina_stringshare_replace(&_elm_config->engine, ELM_OPENGL_COCOA);
         else if ((!strcasecmp(s, "gdi")) ||
                  (!strcasecmp(s, "software-gdi")) ||
                  (!strcasecmp(s, "software_gdi")))
@@ -1302,8 +1313,6 @@ _env_get(void)
    s = getenv("ELM_SCALE");
    if (s) _elm_config->scale = atof(s);
 
-   _elm_config->finger_size =
-     (double)_elm_config->finger_size * _elm_config->scale;
    s = getenv("ELM_FINGER_SIZE");
    if (s) _elm_config->finger_size = atoi(s);
 
@@ -1428,7 +1437,8 @@ _elm_config_sub_shutdown(void)
    if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
        ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
        ENGINE_COMPARE(ELM_XRENDER_X11) ||
-       ENGINE_COMPARE(ELM_OPENGL_X11))
+       ENGINE_COMPARE(ELM_OPENGL_X11) ||
+       ENGINE_COMPARE(ELM_OPENGL_COCOA))
 #undef ENGINE_COMPARE
      {
 #ifdef HAVE_ELEMENTARY_X
@@ -1444,7 +1454,8 @@ _elm_config_sub_init(void)
    if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
        ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
        ENGINE_COMPARE(ELM_XRENDER_X11) ||
-       ENGINE_COMPARE(ELM_OPENGL_X11))
+       ENGINE_COMPARE(ELM_OPENGL_X11) ||
+       ENGINE_COMPARE(ELM_OPENGL_COCOA))
 #undef ENGINE_COMPARE
      {
 #ifdef HAVE_ELEMENTARY_X
@@ -1514,9 +1525,9 @@ _elm_config_all_update(void)
    if (_prop_all_update_timer) ecore_timer_del(_prop_all_update_timer);
    _prop_all_update_timer = ecore_timer_add(0.1, _prop_all_update_cb, NULL);
    _prop_config_set();
-   ecore_x_window_prop_string_set(_root_1st, _atom[ATOM_E_PROFILE], 
+   ecore_x_window_prop_string_set(_root_1st, _atom[ATOM_E_PROFILE],
                                   _elm_profile);
-#endif   
+#endif
 }
 
 void
@@ -1557,7 +1568,7 @@ _elm_config_shutdown(void)
    if (_prop_change_delay_timer) ecore_timer_del(_prop_change_delay_timer);
    _prop_change_delay_timer = NULL;
 #endif
-   
+
 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
    if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
        ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||