summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjiin.moon <jiin.moon@samsung.com>2015-06-26 13:54:47 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-06-26 13:54:48 +0900
commit30f8e83bdb8ed4e75fe4044dd4a8b61464aba4e3 (patch)
treec7302aeee2b833eb40d3721c90972ce1c262b48c
parent538f3f992008b71662c1213293ba777425c69d63 (diff)
elm_config: Add feature to control transition scale for edje
Summary: If the transition scale flag is enable in edje, this value affect the transition scale for edje. @feature Test Plan: test elementary_config with enventor tool Reviewers: raster, Hermet Subscribers: raster Differential Revision: https://phab.enlightenment.org/D2288
-rw-r--r--config/default/base.src.in3
-rw-r--r--config/mobile/base.src.in3
-rw-r--r--config/standard/base.src.in3
-rw-r--r--src/bin/config.c45
-rw-r--r--src/lib/elm_config.c26
-rw-r--r--src/lib/elm_config.h25
-rw-r--r--src/lib/elm_priv.h3
7 files changed, 102 insertions, 6 deletions
diff --git a/config/default/base.src.in b/config/default/base.src.in
index a0245f3b9..48fab232a 100644
--- a/config/default/base.src.in
+++ b/config/default/base.src.in
@@ -1,5 +1,5 @@
1group "Elm_Config" struct { 1group "Elm_Config" struct {
2 value "config_version" int: 131074; 2 value "config_version" int: 131075;
3 value "engine" string: ""; 3 value "engine" string: "";
4 value "vsync" uchar: 0; 4 value "vsync" uchar: 0;
5 value "thumbscroll_enable" uchar: 1; 5 value "thumbscroll_enable" uchar: 1;
@@ -96,6 +96,7 @@ group "Elm_Config" struct {
96 value "audio_mute_all" uchar: 0; 96 value "audio_mute_all" uchar: 0;
97 value "win_auto_focus_enable" uchar: 1; 97 value "win_auto_focus_enable" uchar: 1;
98 value "win_auto_focus_animate" uchar: 1; 98 value "win_auto_focus_animate" uchar: 1;
99 value "transition_duration_factor" double:1.0;
99 group "color_palette" list { 100 group "color_palette" list {
100 group "Elm_Custom_Palette" struct { 101 group "Elm_Custom_Palette" struct {
101 value "palette_name" string: "default"; 102 value "palette_name" string: "default";
diff --git a/config/mobile/base.src.in b/config/mobile/base.src.in
index e9db0a20d..772aca06a 100644
--- a/config/mobile/base.src.in
+++ b/config/mobile/base.src.in
@@ -1,5 +1,5 @@
1group "Elm_Config" struct { 1group "Elm_Config" struct {
2 value "config_version" int: 131074; 2 value "config_version" int: 131075;
3 value "engine" string: ""; 3 value "engine" string: "";
4 value "vsync" uchar: 0; 4 value "vsync" uchar: 0;
5 value "thumbscroll_enable" uchar: 1; 5 value "thumbscroll_enable" uchar: 1;
@@ -100,6 +100,7 @@ group "Elm_Config" struct {
100 value "audio_mute_all" uchar: 0; 100 value "audio_mute_all" uchar: 0;
101 value "win_auto_focus_enable" uchar: 1; 101 value "win_auto_focus_enable" uchar: 1;
102 value "win_auto_focus_animate" uchar: 1; 102 value "win_auto_focus_animate" uchar: 1;
103 value "transition_duration_factor" double: 1.0;
103 group "color_palette" list { 104 group "color_palette" list {
104 group "Elm_Custom_Palette" struct { 105 group "Elm_Custom_Palette" struct {
105 value "palette_name" string: "default"; 106 value "palette_name" string: "default";
diff --git a/config/standard/base.src.in b/config/standard/base.src.in
index 9cae3a1cd..af5ab6748 100644
--- a/config/standard/base.src.in
+++ b/config/standard/base.src.in
@@ -1,5 +1,5 @@
1group "Elm_Config" struct { 1group "Elm_Config" struct {
2 value "config_version" int: 131074; 2 value "config_version" int: 131075;
3 value "engine" string: ""; 3 value "engine" string: "";
4 value "vsync" uchar: 0; 4 value "vsync" uchar: 0;
5 value "thumbscroll_enable" uchar: 0; 5 value "thumbscroll_enable" uchar: 0;
@@ -97,6 +97,7 @@ group "Elm_Config" struct {
97 value "audio_mute_all" uchar: 0; 97 value "audio_mute_all" uchar: 0;
98 value "win_auto_focus_enable" uchar: 1; 98 value "win_auto_focus_enable" uchar: 1;
99 value "win_auto_focus_animate" uchar: 1; 99 value "win_auto_focus_animate" uchar: 1;
100 value "transition_duration_factor" double: 1.0;
100 group "color_palette" list { 101 group "color_palette" list {
101 group "Elm_Custom_Palette" struct { 102 group "Elm_Custom_Palette" struct {
102 value "palette_name" string: "default"; 103 value "palette_name" string: "default";
diff --git a/src/bin/config.c b/src/bin/config.c
index 1663d4d64..d1740248d 100644
--- a/src/bin/config.c
+++ b/src/bin/config.c
@@ -825,6 +825,20 @@ atspi_change(void *data EINA_UNUSED,
825} 825}
826 826
827static void 827static void
828transition_duration_change(void *data EINA_UNUSED,
829 Evas_Object *obj,
830 void *event_info EINA_UNUSED)
831{
832 double val = elm_slider_value_get(obj);
833 Eina_Bool scale = elm_config_transition_duration_factor_get();
834
835 if (scale == val) return;
836 elm_config_transition_duration_factor_set(val);
837 elm_config_save();
838 elm_config_all_flush();
839}
840
841static void
828_status_basic(Evas_Object *win, 842_status_basic(Evas_Object *win,
829 Evas_Object *bx0) 843 Evas_Object *bx0)
830{ 844{
@@ -1177,7 +1191,7 @@ _config_display_update(Evas_Object *win)
1177 ts_min_friction, ts_friction_standard, ts_border_friction, 1191 ts_min_friction, ts_friction_standard, ts_border_friction,
1178 ts_sensitivity_friction, ts_acceleration_threshold, 1192 ts_sensitivity_friction, ts_acceleration_threshold,
1179 ts_acceleration_time_limit, ts_acceleration_weight, page_friction, 1193 ts_acceleration_time_limit, ts_acceleration_weight, page_friction,
1180 bring_in_friction, zoom_friction; 1194 bring_in_friction, zoom_friction, transition_duration;
1181 const char *curr_theme; 1195 const char *curr_theme;
1182 Eina_Bool s_bounce, ts; 1196 Eina_Bool s_bounce, ts;
1183 Elm_Theme *th; 1197 Elm_Theme *th;
@@ -1188,6 +1202,7 @@ _config_display_update(Evas_Object *win)
1188 flush_interval = elm_config_cache_flush_interval_get(); 1202 flush_interval = elm_config_cache_flush_interval_get();
1189 font_c = elm_config_cache_font_cache_size_get(); 1203 font_c = elm_config_cache_font_cache_size_get();
1190 image_c = elm_config_cache_image_cache_size_get(); 1204 image_c = elm_config_cache_image_cache_size_get();
1205 transition_duration = elm_config_transition_duration_factor_get();
1191 edje_file_c = elm_config_cache_edje_file_cache_size_get(); 1206 edje_file_c = elm_config_cache_edje_file_cache_size_get();
1192 edje_col_c = elm_config_cache_edje_collection_cache_size_get(); 1207 edje_col_c = elm_config_cache_edje_collection_cache_size_get();
1193 1208
@@ -1279,6 +1294,7 @@ _config_display_update(Evas_Object *win)
1279 elm_theme_set(th, curr_theme); 1294 elm_theme_set(th, curr_theme);
1280 elm_object_theme_set(evas_object_data_get(win, "theme_preview"), th); 1295 elm_object_theme_set(evas_object_data_get(win, "theme_preview"), th);
1281 elm_theme_free(th); 1296 elm_theme_free(th);
1297 elm_config_transition_duration_factor_set(transition_duration);
1282 eina_stringshare_del(curr_theme); 1298 eina_stringshare_del(curr_theme);
1283} 1299}
1284 1300
@@ -1718,7 +1734,7 @@ static void
1718_status_config_etc(Evas_Object *win, 1734_status_config_etc(Evas_Object *win,
1719 Evas_Object *naviframe) 1735 Evas_Object *naviframe)
1720{ 1736{
1721 Evas_Object *bx, *ck; 1737 Evas_Object *bx, *ck, *sl, *fr, *bx2;
1722 1738
1723 bx = elm_box_add(win); 1739 bx = elm_box_add(win);
1724 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0); 1740 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
@@ -1741,6 +1757,31 @@ _status_config_etc(Evas_Object *win,
1741 CHECK_ADD("Enable ATSPI support", "Set atspi mode", atspi_change, NULL); 1757 CHECK_ADD("Enable ATSPI support", "Set atspi mode", atspi_change, NULL);
1742 elm_check_state_set(ck, elm_config_atspi_mode_get()); 1758 elm_check_state_set(ck, elm_config_atspi_mode_get());
1743 1759
1760 // transition duration in edje
1761 fr = elm_frame_add(bx);
1762 elm_object_text_set(fr, "Edje Transition Duration Factor");
1763 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
1764 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, 0.5);
1765 elm_box_pack_end(bx, fr);
1766 evas_object_show(fr);
1767
1768 bx2 = elm_box_add(fr);
1769 elm_object_content_set(fr, bx2);
1770 evas_object_show(bx2);
1771
1772 sl = elm_slider_add(bx2);
1773 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
1774 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
1775 elm_slider_span_size_set(sl, 120);
1776 elm_slider_unit_format_set(sl, "%1.1f");
1777 elm_slider_indicator_format_set(sl, "%1.1f");
1778 elm_slider_min_max_set(sl, 0, 20.0);
1779 elm_slider_value_set(sl, elm_config_transition_duration_factor_get());
1780 elm_box_pack_end(bx2, sl);
1781 evas_object_show(sl);
1782 evas_object_smart_callback_add(sl, "changed", sc_round, NULL);
1783 evas_object_smart_callback_add(sl, "delay,changed", transition_duration_change, NULL);
1784
1744 evas_object_data_set(win, "etc", bx); 1785 evas_object_data_set(win, "etc", bx);
1745 1786
1746 elm_naviframe_item_simple_push(naviframe, bx); 1787 elm_naviframe_item_simple_push(naviframe, bx);
diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index b44729692..c4a566ce7 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -437,6 +437,7 @@ _desc_init(void)
437 ELM_CONFIG_VAL(D, T, atspi_mode, T_UCHAR); 437 ELM_CONFIG_VAL(D, T, atspi_mode, T_UCHAR);
438 ELM_CONFIG_VAL(D, T, win_auto_focus_enable, T_UCHAR); 438 ELM_CONFIG_VAL(D, T, win_auto_focus_enable, T_UCHAR);
439 ELM_CONFIG_VAL(D, T, win_auto_focus_animate, T_UCHAR); 439 ELM_CONFIG_VAL(D, T, win_auto_focus_animate, T_UCHAR);
440 ELM_CONFIG_VAL(D, T, transition_duration_factor, T_DOUBLE);
440#undef T 441#undef T
441#undef D 442#undef D
442#undef T_INT 443#undef T_INT
@@ -1221,6 +1222,7 @@ _config_sub_apply(void)
1221 edje_scale_set(_elm_config->scale); 1222 edje_scale_set(_elm_config->scale);
1222 edje_password_show_last_set(_elm_config->password_show_last); 1223 edje_password_show_last_set(_elm_config->password_show_last);
1223 edje_password_show_last_timeout_set(_elm_config->password_show_last_timeout); 1224 edje_password_show_last_timeout_set(_elm_config->password_show_last_timeout);
1225 edje_transition_duration_factor_set(_elm_config->transition_duration_factor);
1224 if (_elm_config->modules) _elm_module_parse(_elm_config->modules); 1226 if (_elm_config->modules) _elm_module_parse(_elm_config->modules);
1225 edje_audio_channel_mute_set(EDJE_CHANNEL_EFFECT, _elm_config->audio_mute_effect); 1227 edje_audio_channel_mute_set(EDJE_CHANNEL_EFFECT, _elm_config->audio_mute_effect);
1226 edje_audio_channel_mute_set(EDJE_CHANNEL_BACKGROUND, _elm_config->audio_mute_background); 1228 edje_audio_channel_mute_set(EDJE_CHANNEL_BACKGROUND, _elm_config->audio_mute_background);
@@ -1464,6 +1466,7 @@ _config_load(void)
1464 _elm_config->gl_depth = 0; 1466 _elm_config->gl_depth = 0;
1465 _elm_config->gl_msaa = 0; 1467 _elm_config->gl_msaa = 0;
1466 _elm_config->gl_stencil = 0; 1468 _elm_config->gl_stencil = 0;
1469 _elm_config->transition_duration_factor = 1.0;
1467} 1470}
1468 1471
1469static void 1472static void
@@ -1750,6 +1753,10 @@ _config_update(void)
1750 _elm_config->win_auto_focus_animate = tcfg->win_auto_focus_animate; 1753 _elm_config->win_auto_focus_animate = tcfg->win_auto_focus_animate;
1751 IFCFGEND 1754 IFCFGEND
1752 1755
1756 IFCFG(0x0003)
1757 _elm_config->transition_duration_factor = tcfg->transition_duration_factor;
1758 IFCFGEND
1759
1753 /** 1760 /**
1754 * Fix user config for current ELM_CONFIG_EPOCH here. 1761 * Fix user config for current ELM_CONFIG_EPOCH here.
1755 **/ 1762 **/
@@ -2099,6 +2106,9 @@ _env_get(void)
2099 if (s) _elm_config->magnifier_scale = _elm_atof(s); 2106 if (s) _elm_config->magnifier_scale = _elm_atof(s);
2100 s = getenv("ELM_ATSPI_MODE"); 2107 s = getenv("ELM_ATSPI_MODE");
2101 if (s) _elm_config->atspi_mode = ELM_ATSPI_MODE_ON; 2108 if (s) _elm_config->atspi_mode = ELM_ATSPI_MODE_ON;
2109
2110 s = getenv("ELM_TRANSITION_DURATION_FACTOR");
2111 if (s) _elm_config->transition_duration_factor = atof(s);
2102} 2112}
2103 2113
2104static void 2114static void
@@ -3514,6 +3524,22 @@ elm_config_indicator_service_get(int rotation)
3514 } 3524 }
3515} 3525}
3516 3526
3527EAPI void
3528elm_config_transition_duration_factor_set(double factor)
3529{
3530 if (factor < 0.0) return;
3531 if (_elm_config->transition_duration_factor == factor) return;
3532 _elm_config->transition_duration_factor = factor;
3533 edje_transition_duration_factor_set(_elm_config->transition_duration_factor);
3534}
3535
3536
3537EAPI double
3538elm_config_transition_duration_factor_get(void)
3539{
3540 return _elm_config->transition_duration_factor;
3541}
3542
3517void 3543void
3518_elm_config_profile_set(const char *profile) 3544_elm_config_profile_set(const char *profile)
3519{ 3545{
diff --git a/src/lib/elm_config.h b/src/lib/elm_config.h
index 5718790d9..786174ea3 100644
--- a/src/lib/elm_config.h
+++ b/src/lib/elm_config.h
@@ -1839,6 +1839,31 @@ EAPI void elm_config_atspi_mode_set(Eina_Bool is_atspi);
1839 */ 1839 */
1840 1840
1841/** 1841/**
1842 * Set the transition duration factor
1843 *
1844 * This function sets the edje transition duration factor
1845 * It will affect the duration of edje transitions
1846 *
1847 * @param factor The duration factor for transition in edje
1848 *
1849 * @note This value affect duration of transitions in edje
1850 *
1851 * @since 1.15
1852 *
1853 * @see edje_transition_duration_set() for more details
1854 */
1855EAPI void elm_config_transition_duration_factor_set(double factor);
1856
1857/**
1858 * Get the duration factor of transitions
1859 *
1860 * @return The duration factor of transition in edje
1861 *
1862 * @since 1.15
1863 */
1864EAPI double elm_config_transition_duration_factor_get(void);
1865
1866/**
1842 * @} 1867 * @}
1843 */ 1868 */
1844 1869
diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h
index 9e7bc42ba..1ed943726 100644
--- a/src/lib/elm_priv.h
+++ b/src/lib/elm_priv.h
@@ -123,7 +123,7 @@ struct _Elm_Theme
123 * the users config doesn't need to be wiped - simply new values need 123 * the users config doesn't need to be wiped - simply new values need
124 * to be put in 124 * to be put in
125 */ 125 */
126#define ELM_CONFIG_FILE_GENERATION 0x0002 126#define ELM_CONFIG_FILE_GENERATION 0x0003
127#define ELM_CONFIG_VERSION_EPOCH_OFFSET 16 127#define ELM_CONFIG_VERSION_EPOCH_OFFSET 16
128#define ELM_CONFIG_VERSION ((ELM_CONFIG_EPOCH << ELM_CONFIG_VERSION_EPOCH_OFFSET) | \ 128#define ELM_CONFIG_VERSION ((ELM_CONFIG_EPOCH << ELM_CONFIG_VERSION_EPOCH_OFFSET) | \
129 ELM_CONFIG_FILE_GENERATION) 129 ELM_CONFIG_FILE_GENERATION)
@@ -292,6 +292,7 @@ struct _Elm_Config
292 unsigned char audio_mute_all; 292 unsigned char audio_mute_all;
293 unsigned char win_auto_focus_enable; 293 unsigned char win_auto_focus_enable;
294 unsigned char win_auto_focus_animate; 294 unsigned char win_auto_focus_animate;
295 double transition_duration_factor;
295 Eina_List *bindings; 296 Eina_List *bindings;
296 Eina_Bool atspi_mode; 297 Eina_Bool atspi_mode;
297 int gl_depth; 298 int gl_depth;