Longpress timeout is now configurable.

Patch by WooHyun Jung <wh0705.jung@samsung.com>


SVN revision: 54939
This commit is contained in:
Iván Briano 2010-11-24 17:11:34 +00:00
parent f4218d5fda
commit 77b0cb3ff0
7 changed files with 46 additions and 10 deletions

View File

@ -1,5 +1,5 @@
group "Elm_Config" struct {
value "config_version" int: 65538;
value "config_version" int: 65539;
value "engine" string: "software_x11";
value "thumbscroll_enable" uchar: 1;
value "thumbscroll_threshold" int: 24;
@ -32,4 +32,5 @@ group "Elm_Config" struct {
value "fileselector_expand_enable" uchar: 0;
value "inwin_dialogs_enable" uchar: 1;
value "icon_size" int: 32;
value "longpress_timeout" double: 1.0;
}

View File

@ -1,5 +1,5 @@
group "Elm_Config" struct {
value "config_version" int: 65538;
value "config_version" int: 65539;
value "engine" string: "software_x11";
value "thumbscroll_enable" uchar: 1;
value "thumbscroll_threshold" int: 24;
@ -32,4 +32,5 @@ group "Elm_Config" struct {
value "fileselector_expand_enable" uchar: 0;
value "inwin_dialogs_enable" uchar: 1;
value "icon_size" int: 32;
value "longpress_timeout" double: 1.0;
}

View File

@ -1,5 +1,5 @@
group "Elm_Config" struct {
value "config_version" int: 65538;
value "config_version" int: 65539;
value "engine" string: "software_x11";
value "thumbscroll_enable" uchar: 0;
value "thumbscroll_threshold" int: 4;
@ -32,4 +32,5 @@ group "Elm_Config" struct {
value "fileselector_expand_enable" uchar: 1;
value "inwin_dialogs_enable" uchar: 0;
value "icon_size" int: 32;
value "longpress_timeout" double: 1.0;
}

View File

@ -370,12 +370,16 @@ extern "C" {
EAPI void elm_coords_finger_size_adjust(int times_w, Evas_Coord *w, int times_h, Evas_Coord *h);
EAPI double elm_longpress_timeout_get(void);
EAPI void elm_longpress_timeout_set(double longpress_timeout);
/* debug
* don't use it unless you are sure
*/
EAPI void elm_object_tree_dump(const Evas_Object *top);
EAPI void elm_object_tree_dot_dump(const Evas_Object *top, const char *file);
/* theme */
typedef struct _Elm_Theme Elm_Theme;

View File

@ -426,6 +426,7 @@ _desc_init(void)
ELM_CONFIG_VAL(D, T, fileselector_expand_enable, T_UCHAR);
ELM_CONFIG_VAL(D, T, inwin_dialogs_enable, T_UCHAR);
ELM_CONFIG_VAL(D, T, icon_size, T_INT);
ELM_CONFIG_VAL(D, T, longpress_timeout, T_DOUBLE);
#undef T
#undef D
#undef T_INT
@ -955,6 +956,7 @@ _config_load(void)
_elm_config->fileselector_expand_enable = EINA_FALSE;
_elm_config->inwin_dialogs_enable = EINA_FALSE;
_elm_config->icon_size = 32;
_elm_config->longpress_timeout = 1.0;
}
static const char *
@ -1156,12 +1158,9 @@ _config_update(void)
* if needed, but that will be dependent on new properties added
* with each version */
/* nothing here, just an example */
/*
IFCFG(0x0002);
COPYVAL(some_value);
IFCFGEND;
*/
IFCFG(0x0003);
COPYVAL(longpress_timeout);
IFCFGEND;
#undef COPYSTR
#undef COPYPTR
@ -1352,6 +1351,10 @@ _env_get(void)
s = getenv("ELM_ICON_SIZE");
if (s) _elm_config->icon_size = atoi(s);
s = getenv("ELM_LONGPRESS_TIMEOUT");
if (s) _elm_config->longpress_timeout = atof(s);
if (_elm_config->longpress_timeout < 0.0) _elm_config->longpress_timeout = 0.0;
}
void

View File

@ -2654,3 +2654,28 @@ elm_object_tree_dot_dump(const Evas_Object *top, const char *file)
(void)file;
#endif
}
/**
* Set the duration for occuring long press event.
*
* @param lonpress_timeout Timeout for long press event
* @ingroup Longpress
*/
EAPI void
elm_longpress_timeout_set(double longpress_timeout)
{
_elm_config->longpress_timeout = longpress_timeout;
}
/**
* Get the duration for occuring long press event.
*
* @return Timeout for long press event
* @ingroup Longpress
*/
EAPI double
elm_longpress_timeout_get(void)
{
return _elm_config->longpress_timeout;
}

View File

@ -48,7 +48,7 @@ struct _Elm_Theme
/* increment this whenever a new set of config values are added but the users
* config doesn't need to be wiped - simply new values need to be put in
*/
#define ELM_CONFIG_FILE_GENERATION 0x0002
#define ELM_CONFIG_FILE_GENERATION 0x0003
#define ELM_CONFIG_VERSION ((ELM_CONFIG_EPOCH << 16) | ELM_CONFIG_FILE_GENERATION)
/* NB: profile configuration files (.src) must have their
* "config_version" entry's value up-to-date with ELM_CONFIG_VERSION
@ -109,6 +109,7 @@ struct _Elm_Config
Eina_Bool fileselector_expand_enable;
Eina_Bool inwin_dialogs_enable;
int icon_size;
double longpress_timeout;
};
struct _Elm_Module