[elm_colorselector]: merged from Opensource 2. config/slp updated with
[framework/uifw/elementary.git] / src / lib / elm_config.c
index 2422d1b..b5895aa 100644 (file)
@@ -15,6 +15,8 @@ Elm_Config *_elm_config = NULL;
 char *_elm_profile = NULL;
 static Eet_Data_Descriptor *_config_edd = NULL;
 static Eet_Data_Descriptor *_config_font_overlay_edd = NULL;
+static Eet_Data_Descriptor *_config_color_edd = NULL;
+static Eet_Data_Descriptor *_config_color_palette_edd = NULL;
 const char *_elm_preferred_engine = NULL;
 
 static Ecore_Poller *_elm_cache_flush_poller = NULL;
@@ -259,6 +261,33 @@ _desc_init(void)
         eet_data_descriptor_free(_config_edd);
         return;
      }
+
+   memset(&eddc, 0, sizeof(eddc)); /* just in case... */
+   EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Elm_Color_RGBA);
+   eddc.func.str_direct_alloc = NULL;
+   eddc.func.str_direct_free = NULL;
+
+   _config_color_edd = eet_data_descriptor_stream_new(&eddc);
+   if (!_config_color_edd)
+     {
+        printf("EEEK! eet_data_descriptor_stream_new() failed\n");
+        eet_data_descriptor_free(_config_edd);
+        return;
+     }
+
+   memset(&eddc, 0, sizeof(eddc)); /* just in case... */
+   EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Elm_Custom_Palette);
+   eddc.func.str_direct_alloc = NULL;
+   eddc.func.str_direct_free = NULL;
+
+   _config_color_palette_edd = eet_data_descriptor_stream_new(&eddc);
+   if (!_config_color_palette_edd)
+     {
+        printf("EEEK! eet_data_descriptor_stream_new() failed\n");
+        eet_data_descriptor_free(_config_edd);
+        return;
+     }
+
 #define T_INT    EET_T_INT
 #define T_DOUBLE EET_T_DOUBLE
 #define T_STRING EET_T_STRING
@@ -272,6 +301,22 @@ _desc_init(void)
 #undef T
 #undef D
 
+#define T Elm_Color_RGBA
+#define D _config_color_edd
+   ELM_CONFIG_VAL(D, T, r, EET_T_UINT);
+   ELM_CONFIG_VAL(D, T, g, EET_T_UINT);
+   ELM_CONFIG_VAL(D, T, b, EET_T_UINT);
+   ELM_CONFIG_VAL(D, T, a, EET_T_UINT);
+#undef T
+#undef D
+
+#define T Elm_Custom_Palette
+#define D _config_color_palette_edd
+   ELM_CONFIG_VAL(D, T, palette_name, EET_T_STRING);
+   ELM_CONFIG_LIST(D, T, color_list, _config_color_edd);
+#undef T
+#undef D
+
 #define T Elm_Config
 #define D _config_edd
    ELM_CONFIG_VAL(D, T, config_version, T_INT);
@@ -288,6 +333,7 @@ _desc_init(void)
    ELM_CONFIG_VAL(D, T, bring_in_scroll_friction, T_DOUBLE);
    ELM_CONFIG_VAL(D, T, zoom_friction, T_DOUBLE);
    ELM_CONFIG_VAL(D, T, thumbscroll_bounce_enable, T_UCHAR);
+   ELM_CONFIG_VAL(D, T, scroll_smooth_time_interval, T_DOUBLE);
    ELM_CONFIG_VAL(D, T, scroll_smooth_amount, T_DOUBLE);
    ELM_CONFIG_VAL(D, T, scroll_smooth_history_weight, T_DOUBLE);
    ELM_CONFIG_VAL(D, T, scroll_smooth_future_time, T_DOUBLE);
@@ -334,6 +380,10 @@ _desc_init(void)
    ELM_CONFIG_VAL(D, T, glayer_long_tap_start_timeout, T_DOUBLE);
    ELM_CONFIG_VAL(D, T, access_mode, T_INT);
    ELM_CONFIG_VAL(D, T, glayer_continues_enable, T_UCHAR);
+   ELM_CONFIG_VAL(D, T, week_start, T_INT);
+   ELM_CONFIG_VAL(D, T, weekend_start, T_INT);
+   ELM_CONFIG_VAL(D, T, weekend_len, T_INT);
+   ELM_CONFIG_LIST(D, T, color_palette, _config_color_palette_edd);
 #undef T
 #undef D
 #undef T_INT
@@ -356,6 +406,18 @@ _desc_shutdown(void)
         eet_data_descriptor_free(_config_font_overlay_edd);
         _config_font_overlay_edd = NULL;
      }
+
+   if (_config_color_edd)
+     {
+        eet_data_descriptor_free(_config_color_edd);
+        _config_color_edd = NULL;
+     }
+
+   if (_config_color_palette_edd)
+     {
+        eet_data_descriptor_free(_config_color_palette_edd);
+        _config_color_palette_edd = NULL;
+     }
 }
 
 static int
@@ -558,9 +620,66 @@ _elm_config_text_classes_free(Eina_List *l)
 }
 
 Eina_List *
+_elm_config_color_list_get(const char *palette_name)
+{
+    Eina_List *plist;
+    Elm_Custom_Palette *cpalette;
+    EINA_LIST_FOREACH(_elm_config->color_palette, plist, cpalette)
+      {
+         if (strcmp(cpalette->palette_name, palette_name))
+           continue;
+         return cpalette->color_list;
+      }
+    return NULL;
+}
+
+void
+_elm_config_color_set(const char *palette_name,
+                      int r,
+                      int g,
+                      int b,
+                      int a)
+{
+   Eina_List *plist;
+   Elm_Custom_Palette *cpalette;
+   Elm_Color_RGBA *color;
+   EINA_LIST_FOREACH(_elm_config->color_palette, plist, cpalette)
+     {
+        if (strcmp(cpalette->palette_name, palette_name))
+          continue;
+
+        color = calloc(1, sizeof(Elm_Color_RGBA));
+        color->r = r;
+        color->g = g;
+        color->b = b;
+        color->a = a;
+        cpalette->color_list = eina_list_prepend(cpalette->color_list,
+                                                       color);
+     }
+}
+
+void
+_elm_config_colors_free(const char *palette_name)
+{
+   Eina_List *plist;
+   Elm_Custom_Palette *cpalette;
+   Elm_Color_RGBA *color;
+   EINA_LIST_FOREACH(_elm_config->color_palette, plist, cpalette)
+     {
+        if (strcmp(cpalette->palette_name, palette_name))
+          continue;
+
+        EINA_LIST_FREE(cpalette->color_list, color)
+          {
+             free(color);
+          }
+     }
+}
+
+Eina_List *
 _elm_config_profiles_list(void)
 {
-   const Eina_File_Direct_Info *info;
+   Eina_File_Direct_Info *info;
    Eina_List *flist = NULL;
    Eina_Iterator *file_it;
    char buf[PATH_MAX];
@@ -580,6 +699,13 @@ _elm_config_profiles_list(void)
 
    EINA_ITERATOR_FOREACH(file_it, info)
      {
+        Eina_Stat st;
+
+        if (eina_file_statat(eina_iterator_container_get(file_it), info, &st))
+          {
+             ERR("this is bad.");
+             continue;
+          }
         if (info->name_length >= len)
           continue;
 
@@ -705,6 +831,8 @@ _config_free(void)
 {
    Elm_Font_Overlay *fo;
    const char *fontdir;
+   Elm_Custom_Palette *palette;
+   Elm_Color_RGBA *color;
 
    if (!_elm_config) return;
    EINA_LIST_FREE(_elm_config->font_dirs, fontdir)
@@ -718,6 +846,12 @@ _config_free(void)
         if (fo->font) eina_stringshare_del(fo->font);
         free(fo);
      }
+   EINA_LIST_FREE(_elm_config->color_palette, palette)
+     {
+        if (palette->palette_name) eina_stringshare_del(palette->palette_name);
+        EINA_LIST_FREE(palette->color_list, color) free(color);
+        free(palette);
+     }
    if (_elm_config->theme) eina_stringshare_del(_elm_config->theme);
    if (_elm_config->modules) eina_stringshare_del(_elm_config->modules);
    free(_elm_config);
@@ -860,6 +994,7 @@ _config_load(void)
    _elm_config->zoom_friction = 0.5;
    _elm_config->thumbscroll_border_friction = 0.5;
    _elm_config->thumbscroll_sensitivity_friction = 0.25; // magic number! just trial and error shows this makes it behave "nicer" and not run off at high speed all the time
+   _elm_config->scroll_smooth_time_interval = 0.008;
    _elm_config->scroll_smooth_amount = 1.0;
    _elm_config->scroll_smooth_history_weight = 0.3;
    _elm_config->scroll_smooth_future_time = 0.0;
@@ -905,6 +1040,10 @@ _config_load(void)
    _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 */
+   _elm_config->week_start = 1; /* monday */
+   _elm_config->weekend_start = 6; /* saturday */
+   _elm_config->weekend_len = 2;
+   _elm_config->color_palette = NULL;
 }
 
 static const char *
@@ -1257,6 +1396,8 @@ _env_get(void)
 
         _elm_config->thumbscroll_sensitivity_friction = friction;
      }
+   s = getenv("ELM_SCROLL_SMOOTH_TIME_INTERVAL");
+   if (s) _elm_config->scroll_smooth_time_interval = atof(s);
    s = getenv("ELM_SCROLL_SMOOTH_AMOUNT");
    if (s) _elm_config->scroll_smooth_amount = atof(s);
    s = getenv("ELM_SCROLL_SMOOTH_HISTORY_WEIGHT");
@@ -1395,26 +1536,26 @@ _env_get(void)
 }
 
 EAPI Eina_Bool
-elm_mirrored_get(void)
+elm_config_mirrored_get(void)
 {
    return _elm_config->is_mirrored;
 }
 
 EAPI void
-elm_mirrored_set(Eina_Bool mirrored)
+elm_config_mirrored_set(Eina_Bool mirrored)
 {
    _elm_config->is_mirrored = mirrored;
    _elm_rescale();
 }
 
 EAPI Eina_Bool
-elm_cursor_engine_only_get(void)
+elm_config_cursor_engine_only_get(void)
 {
    return _elm_config->cursor_engine_only;
 }
 
 EAPI void
-elm_cursor_engine_only_set(Eina_Bool engine_only)
+elm_config_cursor_engine_only_set(Eina_Bool engine_only)
 {
    engine_only = !!engine_only;
    _elm_config->cursor_engine_only = engine_only;
@@ -1433,12 +1574,14 @@ elm_tooltip_delay_set(double delay)
    return EINA_TRUE;
 }
 
-EAPI double elm_config_tooltip_delay_get(void)
+EAPI double
+elm_config_tooltip_delay_get(void)
 {
    return _elm_config->tooltip_delay;
 }
 
-EAPI void elm_config_tooltip_delay_set(double delay)
+EAPI void
+elm_config_tooltip_delay_set(double delay)
 {
    if (delay < 0.0) return;
    _elm_config->tooltip_delay = delay;
@@ -1447,25 +1590,37 @@ EAPI void elm_config_tooltip_delay_set(double delay)
 EAPI double
 elm_scale_get(void)
 {
+   return elm_config_scale_get();
+}
+
+EAPI double
+elm_config_scale_get(void)
+{
    return _elm_config->scale;
 }
 
 EAPI void
 elm_scale_set(double scale)
 {
+       elm_config_scale_set(scale);
+}
+
+EAPI void
+elm_config_scale_set(double scale)
+{
    if (_elm_config->scale == scale) return;
    _elm_config->scale = scale;
    _elm_rescale();
 }
 
 EAPI Eina_Bool
-elm_password_show_last_get(void)
+elm_config_password_show_last_get(void)
 {
    return _elm_config->password_show_last;
 }
 
 EAPI void
-elm_password_show_last_set(Eina_Bool password_show_last)
+elm_config_password_show_last_set(Eina_Bool password_show_last)
 {
    if (_elm_config->password_show_last == password_show_last) return;
    _elm_config->password_show_last = password_show_last;
@@ -1473,13 +1628,13 @@ elm_password_show_last_set(Eina_Bool password_show_last)
 }
 
 EAPI double
-elm_password_show_last_timeout_get(void)
+elm_config_password_show_last_timeout_get(void)
 {
    return _elm_config->password_show_last_timeout;
 }
 
 EAPI void
-elm_password_show_last_timeout_set(double password_show_last_timeout)
+elm_config_password_show_last_timeout_set(double password_show_last_timeout)
 {
    if (_elm_config->password_show_last_timeout == password_show_last_timeout) return;
    _elm_config->password_show_last_timeout = password_show_last_timeout;
@@ -1499,32 +1654,32 @@ elm_config_reload(void)
 }
 
 EAPI const char *
-elm_profile_current_get(void)
+elm_config_profile_get(void)
 {
    return _elm_config_current_profile_get();
 }
 
 EAPI const char *
-elm_profile_dir_get(const char *profile,
+elm_config_profile_dir_get(const char *profile,
                     Eina_Bool   is_user)
 {
    return _elm_config_profile_dir_get(profile, is_user);
 }
 
 EAPI void
-elm_profile_dir_free(const char *p_dir)
+elm_config_profile_dir_free(const char *p_dir)
 {
    free((void *)p_dir);
 }
 
 EAPI Eina_List *
-elm_profile_list_get(void)
+elm_config_profile_list_get(void)
 {
    return _elm_config_profiles_list();
 }
 
 EAPI void
-elm_profile_list_free(Eina_List *l)
+elm_config_profile_list_free(Eina_List *l)
 {
    const char *dir;
 
@@ -1533,20 +1688,20 @@ elm_profile_list_free(Eina_List *l)
 }
 
 EAPI void
-elm_profile_set(const char *profile)
+elm_config_profile_set(const char *profile)
 {
    EINA_SAFETY_ON_NULL_RETURN(profile);
    _elm_config_profile_set(profile);
 }
 
 EAPI const char *
-elm_engine_get(void)
+elm_config_engine_get(void)
 {
    return _elm_config->engine;
 }
 
 EAPI void
-elm_engine_set(const char *engine)
+elm_config_engine_set(const char *engine)
 {
    EINA_SAFETY_ON_NULL_RETURN(engine);
 
@@ -1554,25 +1709,25 @@ elm_engine_set(const char *engine)
 }
 
 EAPI Eina_List *
-elm_text_classes_list_get(void)
+elm_config_text_classes_list_get(void)
 {
    return _elm_config_text_classes_get();
 }
 
 EAPI void
-elm_text_classes_list_free(Eina_List *list)
+elm_config_text_classes_list_free(Eina_List *list)
 {
    _elm_config_text_classes_free(list);
 }
 
 EAPI const Eina_List *
-elm_font_overlay_list_get(void)
+elm_config_font_overlay_list_get(void)
 {
    return _elm_config_font_overlays_list();
 }
 
 EAPI void
-elm_font_overlay_set(const char    *text_class,
+elm_config_font_overlay_set(const char    *text_class,
                      const char    *font,
                      Evas_Font_Size size)
 {
@@ -1581,40 +1736,53 @@ elm_font_overlay_set(const char    *text_class,
 }
 
 EAPI void
-elm_font_overlay_unset(const char *text_class)
+elm_config_font_overlay_unset(const char *text_class)
 {
    EINA_SAFETY_ON_NULL_RETURN(text_class);
    _elm_config_font_overlay_remove(text_class);
 }
 
 EAPI void
-elm_font_overlay_apply(void)
+elm_config_font_overlay_apply(void)
 {
    _elm_config_font_overlay_apply();
 }
-
+// WRAPPER:: will be removed soon.
 EAPI Evas_Coord
 elm_finger_size_get(void)
 {
+   return elm_config_finger_size_get();
+}
+
+EAPI Evas_Coord
+elm_config_finger_size_get(void)
+{
    return _elm_config->finger_size;
 }
 
+// WRAPPER:: will be removed soon.
 EAPI void
 elm_finger_size_set(Evas_Coord size)
 {
+   elm_config_finger_size_set(size);
+}
+
+EAPI void
+elm_config_finger_size_set(Evas_Coord size)
+{
    if (_elm_config->finger_size == size) return;
    _elm_config->finger_size = size;
    _elm_rescale();
 }
 
 EAPI int
-elm_cache_flush_interval_get(void)
+elm_config_cache_flush_interval_get(void)
 {
    return _elm_config->cache_flush_poll_interval;
 }
 
 EAPI void
-elm_cache_flush_interval_set(int size)
+elm_config_cache_flush_interval_set(int size)
 {
    if (_elm_config->cache_flush_poll_interval == size) return;
    _elm_config->cache_flush_poll_interval = size;
@@ -1623,13 +1791,13 @@ elm_cache_flush_interval_set(int size)
 }
 
 EAPI Eina_Bool
-elm_cache_flush_enabled_get(void)
+elm_config_cache_flush_enabled_get(void)
 {
    return _elm_config->cache_flush_enable;
 }
 
 EAPI void
-elm_cache_flush_enabled_set(Eina_Bool enabled)
+elm_config_cache_flush_enabled_set(Eina_Bool enabled)
 {
    enabled = !!enabled;
    if (_elm_config->cache_flush_enable == enabled) return;
@@ -1641,11 +1809,11 @@ elm_cache_flush_enabled_set(Eina_Bool enabled)
 EINA_DEPRECATED EAPI int
 elm_font_cache_get(void)
 {
-   return elm_cache_font_cache_size_get();
+   return elm_config_cache_font_cache_size_get();
 }
 
 EAPI int
-elm_cache_font_cache_size_get(void)
+elm_config_cache_font_cache_size_get(void)
 {
    return _elm_config->font_cache;
 }
@@ -1653,11 +1821,11 @@ elm_cache_font_cache_size_get(void)
 EINA_DEPRECATED EAPI void
 elm_font_cache_set(int size)
 {
-   elm_cache_font_cache_size_set(size);
+   elm_config_cache_font_cache_size_set(size);
 }
 
 EAPI void 
-elm_cache_font_cache_size_set(int size)
+elm_config_cache_font_cache_size_set(int size)
 {
    if (_elm_config->font_cache == size) return;
    _elm_config->font_cache = size;
@@ -1668,11 +1836,11 @@ elm_cache_font_cache_size_set(int size)
 EINA_DEPRECATED EAPI int
 elm_image_cache_get(void)
 {
-   return elm_cache_image_cache_size_get();
+   return elm_config_cache_image_cache_size_get();
 }
 
 EAPI int
-elm_cache_image_cache_size_get(void)
+elm_config_cache_image_cache_size_get(void)
 {
    return _elm_config->image_cache;
 }
@@ -1680,11 +1848,11 @@ elm_cache_image_cache_size_get(void)
 EINA_DEPRECATED EAPI void
 elm_image_cache_set(int size)
 {
-   elm_cache_image_cache_size_set(size);
+   elm_config_cache_image_cache_size_set(size);
 }
 
 EAPI void
-elm_cache_image_cache_size_set(int size)
+elm_config_cache_image_cache_size_set(int size)
 {
    if (_elm_config->image_cache == size) return;
    _elm_config->image_cache = size;
@@ -1695,11 +1863,11 @@ elm_cache_image_cache_size_set(int size)
 EINA_DEPRECATED EAPI int
 elm_edje_file_cache_get(void)
 {
-   return elm_cache_edje_file_cache_size_get();
+   return elm_config_cache_edje_file_cache_size_get();
 }
 
 EAPI int
-elm_cache_edje_file_cache_size_get()
+elm_config_cache_edje_file_cache_size_get()
 {
    return _elm_config->edje_cache;
 }
@@ -1707,11 +1875,11 @@ elm_cache_edje_file_cache_size_get()
 EINA_DEPRECATED EAPI void
 elm_edje_file_cache_set(int size)
 {
-   elm_cache_edje_file_cache_size_set(size);
+   elm_config_cache_edje_file_cache_size_set(size);
 }
 
 EAPI void
-elm_cache_edje_file_cache_size_set(int size)
+elm_config_cache_edje_file_cache_size_set(int size)
 {
    if (_elm_config->edje_cache == size) return;
    _elm_config->edje_cache = size;
@@ -1722,11 +1890,11 @@ elm_cache_edje_file_cache_size_set(int size)
 EINA_DEPRECATED EAPI int
 elm_edje_collection_cache_get(void)
 {
-   return elm_cache_edje_collection_cache_size_get();
+   return elm_config_cache_edje_collection_cache_size_get();
 }
 
 EAPI int
-elm_cache_edje_collection_cache_size_get(void)
+elm_config_cache_edje_collection_cache_size_get(void)
 {
    return _elm_config->edje_collection_cache;
 }
@@ -1734,11 +1902,11 @@ elm_cache_edje_collection_cache_size_get(void)
 EINA_DEPRECATED EAPI void
 elm_edje_collection_cache_set(int size)
 {
-   elm_cache_edje_collection_cache_size_set(size);
+   elm_config_cache_edje_collection_cache_size_set(size);
 }
 
 EAPI void
-elm_cache_edje_collection_cache_size_set(int size)
+elm_config_cache_edje_collection_cache_size_set(int size)
 {
    if (_elm_config->edje_collection_cache == size) return;
    _elm_config->edje_collection_cache = size;
@@ -1747,145 +1915,145 @@ elm_cache_edje_collection_cache_size_set(int size)
 }
 
 EAPI Eina_Bool
-elm_focus_highlight_enabled_get(void)
+elm_config_focus_highlight_enabled_get(void)
 {
    return _elm_config->focus_highlight_enable;
 }
 
 EAPI void
-elm_focus_highlight_enabled_set(Eina_Bool enable)
+elm_config_focus_highlight_enabled_set(Eina_Bool enable)
 {
    _elm_config->focus_highlight_enable = !!enable;
 }
 
 EAPI Eina_Bool
-elm_focus_highlight_animate_get(void)
+elm_config_focus_highlight_animate_get(void)
 {
    return _elm_config->focus_highlight_animate;
 }
 
 EAPI void
-elm_focus_highlight_animate_set(Eina_Bool animate)
+elm_config_focus_highlight_animate_set(Eina_Bool animate)
 {
    _elm_config->focus_highlight_animate = !!animate;
 }
 
 EAPI Eina_Bool
-elm_scroll_bounce_enabled_get(void)
+elm_config_scroll_bounce_enabled_get(void)
 {
    return _elm_config->thumbscroll_bounce_enable;
 }
 
 EAPI void
-elm_scroll_bounce_enabled_set(Eina_Bool enabled)
+elm_config_scroll_bounce_enabled_set(Eina_Bool enabled)
 {
    _elm_config->thumbscroll_bounce_enable = enabled;
 }
 
 EAPI double
-elm_scroll_bounce_friction_get(void)
+elm_config_scroll_bounce_friction_get(void)
 {
    return _elm_config->thumbscroll_bounce_friction;
 }
 
 EAPI void
-elm_scroll_bounce_friction_set(double friction)
+elm_config_scroll_bounce_friction_set(double friction)
 {
    _elm_config->thumbscroll_bounce_friction = friction;
 }
 
 EAPI double
-elm_scroll_page_scroll_friction_get(void)
+elm_config_scroll_page_scroll_friction_get(void)
 {
    return _elm_config->page_scroll_friction;
 }
 
 EAPI void
-elm_scroll_page_scroll_friction_set(double friction)
+elm_config_scroll_page_scroll_friction_set(double friction)
 {
    _elm_config->page_scroll_friction = friction;
 }
 
 EAPI double
-elm_scroll_bring_in_scroll_friction_get(void)
+elm_config_scroll_bring_in_scroll_friction_get(void)
 {
    return _elm_config->bring_in_scroll_friction;
 }
 
 EAPI void
-elm_scroll_bring_in_scroll_friction_set(double friction)
+elm_config_scroll_bring_in_scroll_friction_set(double friction)
 {
    _elm_config->bring_in_scroll_friction = friction;
 }
 
 EAPI double
-elm_scroll_zoom_friction_get(void)
+elm_config_scroll_zoom_friction_get(void)
 {
    return _elm_config->zoom_friction;
 }
 
 EAPI void
-elm_scroll_zoom_friction_set(double friction)
+elm_config_scroll_zoom_friction_set(double friction)
 {
    _elm_config->zoom_friction = friction;
 }
 
 EAPI Eina_Bool
-elm_scroll_thumbscroll_enabled_get(void)
+elm_config_scroll_thumbscroll_enabled_get(void)
 {
    return _elm_config->thumbscroll_enable;
 }
 
 EAPI void
-elm_scroll_thumbscroll_enabled_set(Eina_Bool enabled)
+elm_config_scroll_thumbscroll_enabled_set(Eina_Bool enabled)
 {
    _elm_config->thumbscroll_enable = enabled;
 }
 
 EAPI unsigned int
-elm_scroll_thumbscroll_threshold_get(void)
+elm_config_scroll_thumbscroll_threshold_get(void)
 {
    return _elm_config->thumbscroll_threshold;
 }
 
 EAPI void
-elm_scroll_thumbscroll_threshold_set(unsigned int threshold)
+elm_config_scroll_thumbscroll_threshold_set(unsigned int threshold)
 {
    _elm_config->thumbscroll_threshold = threshold;
 }
 
 EAPI double
-elm_scroll_thumbscroll_momentum_threshold_get(void)
+elm_config_scroll_thumbscroll_momentum_threshold_get(void)
 {
    return _elm_config->thumbscroll_momentum_threshold;
 }
 
 EAPI void
-elm_scroll_thumbscroll_momentum_threshold_set(double threshold)
+elm_config_scroll_thumbscroll_momentum_threshold_set(double threshold)
 {
    _elm_config->thumbscroll_momentum_threshold = threshold;
 }
 
 EAPI double
-elm_scroll_thumbscroll_friction_get(void)
+elm_config_scroll_thumbscroll_friction_get(void)
 {
    return _elm_config->thumbscroll_friction;
 }
 
 EAPI void
-elm_scroll_thumbscroll_friction_set(double friction)
+elm_config_scroll_thumbscroll_friction_set(double friction)
 {
    _elm_config->thumbscroll_friction = friction;
 }
 
 EAPI double
-elm_scroll_thumbscroll_border_friction_get(void)
+elm_config_scroll_thumbscroll_border_friction_get(void)
 {
    return _elm_config->thumbscroll_border_friction;
 }
 
 EAPI void
-elm_scroll_thumbscroll_border_friction_set(double friction)
+elm_config_scroll_thumbscroll_border_friction_set(double friction)
 {
    if (friction < 0.0) friction = 0.0;
    if (friction > 1.0) friction = 1.0;
@@ -1893,13 +2061,13 @@ elm_scroll_thumbscroll_border_friction_set(double friction)
 }
 
 EAPI double
-elm_scroll_thumbscroll_sensitivity_friction_get(void)
+elm_config_scroll_thumbscroll_sensitivity_friction_get(void)
 {
    return _elm_config->thumbscroll_sensitivity_friction;
 }
 
 EAPI void
-elm_scroll_thumbscroll_sensitivity_friction_set(double friction)
+elm_config_scroll_thumbscroll_sensitivity_friction_set(double friction)
 {
    if (friction < 0.1) friction = 0.1;
    if (friction > 1.0) friction = 1.0;
@@ -1907,13 +2075,13 @@ elm_scroll_thumbscroll_sensitivity_friction_set(double friction)
 }
 
 EAPI void
-elm_longpress_timeout_set(double longpress_timeout)
+elm_config_longpress_timeout_set(double longpress_timeout)
 {
    _elm_config->longpress_timeout = longpress_timeout;
 }
 
 EAPI double
-elm_longpress_timeout_get(void)
+elm_config_longpress_timeout_get(void)
 {
    return _elm_config->longpress_timeout;
 }
@@ -2056,15 +2224,21 @@ _elm_config_engine_set(const char *engine)
 }
 
 EAPI const char *
-elm_preferred_engine_get(void)
+elm_config_preferred_engine_get(void)
 {
    return _elm_preferred_engine;
 }
 
 EAPI void
-elm_preferred_engine_set(const char *engine)
+elm_config_preferred_engine_set(const char *engine)
 {
-   eina_stringshare_replace(&(_elm_preferred_engine), engine);
+   if (engine)
+     eina_stringshare_replace(&(_elm_preferred_engine), engine);
+   else
+     {
+        if (_elm_preferred_engine) eina_stringshare_del(_elm_preferred_engine);
+        _elm_preferred_engine = eina_stringshare_add(_elm_config->engine);
+     }
 }
 
 void