summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Stanislawski <l.stanislaws@samsung.com>2014-11-29 15:31:25 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-11-29 15:34:08 +0900
commit96c80e7162aaa43ae53e0080c2610bbdd9312292 (patch)
tree53f867c1dbfcd008c92e4dfbb3ca027a1d461161
parenta4f7a90453da0dc56e88d32792849f69d7eb22b1 (diff)
elm config: add key bindings for elm_actionslider
Allow changing value of actionslider with keyboard. Make actionslider focusable widget. @feature Conflicts: config/default/base.src.in config/mobile/base.src.in config/standard/base.src.in
-rw-r--r--config/default/base.src.in2
-rw-r--r--config/mobile/base.src.in2
-rw-r--r--config/standard/base.src.in2
-rw-r--r--src/lib/elm_config.c117
-rw-r--r--src/lib/elm_priv.h3
5 files changed, 24 insertions, 102 deletions
diff --git a/config/default/base.src.in b/config/default/base.src.in
index 0f4fcb34b..64b278313 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: 65539; 2 value "config_version" int: 131073;
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;
diff --git a/config/mobile/base.src.in b/config/mobile/base.src.in
index 6a7f665ae..ff6624303 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: 65539; 2 value "config_version" int: 131073;
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;
diff --git a/config/standard/base.src.in b/config/standard/base.src.in
index 91656a09e..7df943717 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: 65539; 2 value "config_version" int: 131073;
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;
diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index e4b72daae..661aaf808 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -1477,19 +1477,18 @@ _config_load(void)
1477 _elm_config = _config_user_load(); 1477 _elm_config = _config_user_load();
1478 if (_elm_config) 1478 if (_elm_config)
1479 { 1479 {
1480 if (_elm_config->config_version < ELM_CONFIG_VERSION) 1480 if ((_elm_config->config_version >> ELM_CONFIG_VERSION_EPOCH_OFFSET) < ELM_CONFIG_EPOCH)
1481 _config_update(); 1481 {
1482 1482 WRN("User's elementary config seems outdated and unusable. Fallback to load system config.");
1483 /* set the default value if the configuration was just added and the 1483 _config_free(_elm_config);
1484 * value is zero which means it was not supported before and invalid. */ 1484 _elm_config = NULL;
1485 if (_elm_config->thumbscroll_min_friction == 0.0) 1485 }
1486 _elm_config->thumbscroll_min_friction = 0.5; 1486 else
1487 if (_elm_config->thumbscroll_friction_standard == 0.0) 1487 {
1488 _elm_config->thumbscroll_friction_standard = 1000.0; 1488 if (_elm_config->config_version < ELM_CONFIG_VERSION)
1489 if (_elm_config->thumbscroll_flick_distance_tolerance == 0) 1489 _config_update();
1490 _elm_config->thumbscroll_flick_distance_tolerance = 1000; 1490 return;
1491 1491 }
1492 return;
1493 } 1492 }
1494 1493
1495 /* no user config, fallback for system. No need to check version for 1494 /* no user config, fallback for system. No need to check version for
@@ -1813,8 +1812,6 @@ static void
1813_config_update(void) 1812_config_update(void)
1814{ 1813{
1815 Elm_Config *tcfg; 1814 Elm_Config *tcfg;
1816 const char *s = NULL;
1817
1818 tcfg = _config_system_load(); 1815 tcfg = _config_system_load();
1819 if (!tcfg) 1816 if (!tcfg)
1820 { 1817 {
@@ -1829,89 +1826,13 @@ _config_update(void)
1829#define COPYPTR(x) do {_elm_config->x = tcfg->x; tcfg->x = NULL; } while (0) 1826#define COPYPTR(x) do {_elm_config->x = tcfg->x; tcfg->x = NULL; } while (0)
1830#define COPYSTR(x) COPYPTR(x) 1827#define COPYSTR(x) COPYPTR(x)
1831 1828
1832 /* we also need to update for property changes in the root window 1829 /* we also need to update for property changes in the root window
1833 * if needed, but that will be dependent on new properties added 1830 * if needed, but that will be dependent on new properties added
1834 * with each version */ 1831 * with each version */
1835 1832
1836 IFCFG(0x0003); 1833 /**
1837 COPYVAL(longpress_timeout); 1834 * Fix user config for current ELM_CONFIG_EPOCH here.
1838 IFCFGEND; 1835 **/
1839
1840 IFCFG(0x0004);
1841#define PREFS_IFACE_MODULE_STR "prefs>prefs_iface"
1842 if (!_elm_config->modules)
1843 s = eina_stringshare_add(PREFS_IFACE_MODULE_STR);
1844 else
1845 {
1846 if (!strstr(_elm_config->modules, PREFS_IFACE_MODULE_STR))
1847 s = eina_stringshare_printf
1848 ("%s:%s", _elm_config->modules, PREFS_IFACE_MODULE_STR);
1849 }
1850 if (s)
1851 {
1852 eina_stringshare_del(_elm_config->modules);
1853 _elm_config->modules = s;
1854 }
1855 IFCFGEND;
1856
1857 IFCFG(0x0005);
1858 COPYVAL(magnifier_scale);
1859 if (!_elm_config->bindings)
1860 {
1861 Elm_Config_Bindings_Widget *wb;
1862 Eina_List *l;
1863
1864 EINA_LIST_FOREACH(tcfg->bindings, l, wb)
1865 {
1866 Elm_Config_Bindings_Widget *wb2;
1867
1868 wb2 = calloc(1, sizeof(Elm_Config_Bindings_Widget));
1869 if (wb2)
1870 {
1871 Elm_Config_Binding_Key *kb;
1872 Eina_List *l2;
1873
1874 *wb2 = *wb;
1875#define DUPSHARE(x) if (wb->x) wb2->x = eina_stringshare_add(wb->x)
1876 DUPSHARE(name);
1877#undef DUPSHARE
1878 wb->key_bindings = NULL;
1879 EINA_LIST_FOREACH(wb->key_bindings, l2, kb)
1880 {
1881 Elm_Config_Binding_Key *kb2;
1882
1883 kb2 = calloc(1, sizeof(Elm_Config_Binding_Key));
1884 if (kb2)
1885 {
1886 Elm_Config_Binding_Modifier *mb;
1887 Eina_List *l3;
1888
1889#define DUPSHARE(x) if (kb->x) kb2->x = eina_stringshare_add(kb->x)
1890 DUPSHARE(key);
1891 DUPSHARE(action);
1892 DUPSHARE(params);
1893#undef DUPSHARE
1894 EINA_LIST_FOREACH(kb2->modifiers, l3, mb)
1895 {
1896 Elm_Config_Binding_Modifier *mb2;
1897
1898 mb2 = calloc(1, sizeof(Elm_Config_Bindings_Widget));
1899 if (mb2)
1900 {
1901#define DUPSHARE(x) if (mb->x) mb2->x = eina_stringshare_add(mb->x)
1902 DUPSHARE(mod);
1903#undef DUPSHARE
1904 kb->modifiers = eina_list_append(kb->modifiers, mb2);
1905 }
1906 }
1907 wb->key_bindings = eina_list_append(wb->key_bindings, kb2);
1908 }
1909 }
1910 _elm_config->bindings = eina_list_append(_elm_config->bindings, wb2);
1911 }
1912 }
1913 }
1914 IFCFGEND;
1915 1836
1916#undef COPYSTR 1837#undef COPYSTR
1917#undef COPYPTR 1838#undef COPYPTR
diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h
index b27da79cf..5d1c6fa07 100644
--- a/src/lib/elm_priv.h
+++ b/src/lib/elm_priv.h
@@ -125,7 +125,8 @@ struct _Elm_Theme
125 * to be put in 125 * to be put in
126 */ 126 */
127#define ELM_CONFIG_FILE_GENERATION 0x0001 127#define ELM_CONFIG_FILE_GENERATION 0x0001
128#define ELM_CONFIG_VERSION ((ELM_CONFIG_EPOCH << 16) | \ 128#define ELM_CONFIG_VERSION_EPOCH_OFFSET 16
129#define ELM_CONFIG_VERSION ((ELM_CONFIG_EPOCH << ELM_CONFIG_VERSION_EPOCH_OFFSET) | \
129 ELM_CONFIG_FILE_GENERATION) 130 ELM_CONFIG_FILE_GENERATION)
130/* NB: profile configuration files (.src) must have their 131/* NB: profile configuration files (.src) must have their
131 * "config_version" entry's value up-to-date with ELM_CONFIG_VERSION 132 * "config_version" entry's value up-to-date with ELM_CONFIG_VERSION