Improve Elementary's profiles.

This is still a work in progress. The idea is to have two different profiles:
one to be used on desktops and another for mobiles. To make it possible, I've
added some fields to the config struct and in the following commits the widgets
will start using that configuration so when they are created the default
configuration of the profile is applied.



SVN revision: 53726
This commit is contained in:
Rafael Fonseca 2010-10-21 18:26:14 +00:00
parent 7cc73d7568
commit 99191cda20
5 changed files with 68 additions and 32 deletions

View File

@ -1,15 +1,15 @@
group "Elm_Config" struct {
value "config_version" int: 65537;
value "engine" int: 0;
value "thumbscroll_enable" int: 1;
value "thumbscroll_enable" uchar: 1;
value "thumbscroll_threshhold" int: 24;
value "thumbscroll_momentum_threshhold" double: 100.0;
value "thumbscroll_friction" double: 1.0;
value "thumbscroll_bounce_friction" double: 0.5;
value "thumbscroll_bounce_enable" uchar: 1;
value "page_scroll_friction" double: 0.5;
value "bring_in_scroll_friction" double: 0.5;
value "zoom_friction" double: 0.5;
value "thumbscroll_bounce_enable" int: 1;
value "scale" double: 1.0;
value "bgpixmap" int: 0;
value "compositing" int: 1;
@ -22,6 +22,10 @@ group "Elm_Config" struct {
value "modules" string: "";
value "tooltip_delay" double: 1.0;
value "cursor_engine_only" int: 1;
value "focus_highlight_enable" int: 0;
value "focus_highlight_animate" int: 0;
value "focus_highlight_enable" uchar: 0;
value "focus_highlight_animate" uchar: 0;
value "toolbar_shrink_mode" int: 2;
value "fileselector_expand_enable" uchar: 0;
value "inwin_dialogs_enable" uchar: 1;
value "icon_size" int: 32;
}

View File

@ -1,15 +1,15 @@
group "Elm_Config" struct {
value "config_version" int: 65537;
value "engine" int: 0;
value "thumbscroll_enable" int: 1;
value "thumbscroll_enable" uchar: 1;
value "thumbscroll_threshhold" int: 24;
value "thumbscroll_momentum_threshhold" double: 100.0;
value "thumbscroll_friction" double: 1.0;
value "thumbscroll_bounce_friction" double: 0.5;
value "thumbscroll_bounce_enable" uchar: 1;
value "page_scroll_friction" double: 0.5;
value "bring_in_scroll_friction" double: 0.5;
value "zoom_friction" double: 0.5;
value "thumbscroll_bounce_enable" int: 1;
value "scale" double: 1.0;
value "bgpixmap" int: 0;
value "compositing" int: 1;
@ -21,7 +21,11 @@ group "Elm_Config" struct {
value "theme" string: "default";
value "modules" string: "";
value "tooltip_delay" double: 1.0;
value "cursor_engine_only" int: 1;
value "focus_highlight_enable" int: 0;
value "focus_highlight_animate" int: 0;
value "cursor_engine_only" uchar: 1;
value "focus_highlight_enable" uchar: 0;
value "focus_highlight_animate" uchar: 0;
value "toolbar_shrink_mode" int: 2;
value "fileselector_expand_enable" uchar: 0;
value "inwin_dialogs_enable" uchar: 1;
value "icon_size" int: 32;
}

View File

@ -1,15 +1,15 @@
group "Elm_Config" struct {
value "config_version" int: 65537;
value "engine" int: 0;
value "thumbscroll_enable" int: 1;
value "thumbscroll_enable" uchar: 0;
value "thumbscroll_threshhold" int: 4;
value "thumbscroll_momentum_threshhold" double: 100.0;
value "thumbscroll_friction" double: 1.0;
value "thumbscroll_bounce_friction" double: 0.5;
value "thumbscroll_bounce_enable" uchar: 0;
value "page_scroll_friction" double: 0.5;
value "bring_in_scroll_friction" double: 0.5;
value "zoom_friction" double: 0.5;
value "thumbscroll_bounce_enable" int: 1;
value "scale" double: 1.0;
value "bgpixmap" int: 0;
value "compositing" int: 1;
@ -22,6 +22,10 @@ group "Elm_Config" struct {
value "modules" string: "";
value "tooltip_delay" double: 1.0;
value "cursor_engine_only" int: 1;
value "focus_highlight_enable" int: 0;
value "focus_highlight_animate" int: 0;
value "focus_highlight_enable" uchar: 0;
value "focus_highlight_animate" uchar: 0;
value "toolbar_shrink_mode" int: 1;
value "fileselector_expand_enable" uchar: 1;
value "inwin_dialogs_enable" uchar: 0;
value "icon_size" int: 32;
}

View File

@ -204,7 +204,7 @@ _desc_init(void)
}
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "config_version", config_version, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "engine", engine, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "thumbscroll_enable", thumbscroll_enable, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "thumbscroll_enable", thumbscroll_enable, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "thumbscroll_threshhold", thumbscroll_threshhold, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "thumbscroll_momentum_threshhold", thumbscroll_momentum_threshhold, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "thumbscroll_friction", thumbscroll_friction, EET_T_DOUBLE);
@ -212,7 +212,7 @@ _desc_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "page_scroll_friction", page_scroll_friction, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "bring_in_scroll_friction", bring_in_scroll_friction, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "zoom_friction", zoom_friction, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "thumbscroll_bounce_enable", thumbscroll_bounce_enable, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "thumbscroll_bounce_enable", thumbscroll_bounce_enable, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "scale", scale, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "bgpixmap", bgpixmap, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "compositing", compositing, EET_T_INT);
@ -225,9 +225,13 @@ _desc_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "theme", theme, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "modules", modules, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "tooltip_delay", tooltip_delay, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "cursor_engine_only", cursor_engine_only, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "focus_highlight_enable", focus_highlight_enable, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "focus_highlight_animate", focus_highlight_animate, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "cursor_engine_only", cursor_engine_only, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "focus_highlight_enable", focus_highlight_enable, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "focus_highlight_animate", focus_highlight_animate, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "toolbar_shrink_mode", toolbar_shrink_mode, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "fileselector_expand_enable", fileselector_expand_enable, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "inwin_dialogs_enable", inwin_dialogs_enable, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_edd, Elm_Config, "icon_size", icon_size, EET_T_INT);
}
static void
@ -393,7 +397,7 @@ _config_load(void)
_elm_config = ELM_NEW(Elm_Config);
_elm_config->config_version = ELM_CONFIG_VERSION;
_elm_config->engine = ELM_SOFTWARE_X11;
_elm_config->thumbscroll_enable = 1;
_elm_config->thumbscroll_enable = EINA_TRUE;
_elm_config->thumbscroll_threshhold = 24;
_elm_config->thumbscroll_momentum_threshhold = 100.0;
_elm_config->thumbscroll_friction = 1.0;
@ -401,7 +405,7 @@ _config_load(void)
_elm_config->page_scroll_friction = 0.5;
_elm_config->bring_in_scroll_friction = 0.5;
_elm_config->zoom_friction = 0.5;
_elm_config->thumbscroll_bounce_enable = 1;
_elm_config->thumbscroll_bounce_enable = EINA_TRUE;
_elm_config->scale = 1.0;
_elm_config->bgpixmap = 0;
_elm_config->font_hinting = 2;
@ -414,9 +418,13 @@ _config_load(void)
_elm_config->theme = eina_stringshare_add("default");
_elm_config->modules = NULL;
_elm_config->tooltip_delay = 1.0;
_elm_config->cursor_engine_only = 1;
_elm_config->focus_highlight_enable = 0;
_elm_config->focus_highlight_animate = 1;
_elm_config->cursor_engine_only = EINA_TRUE;
_elm_config->focus_highlight_enable = EINA_FALSE;
_elm_config->focus_highlight_animate = EINA_TRUE;
_elm_config->toolbar_shrink_mode = 2;
_elm_config->fileselector_expand_enable = EINA_FALSE;
_elm_config->inwin_dialogs_enable = EINA_FALSE;
_elm_config->icon_size = 32;
}
static void
@ -523,7 +531,7 @@ _env_get(void)
}
s = getenv("ELM_THUMBSCROLL_ENABLE");
if (s) _elm_config->thumbscroll_enable = atoi(s);
if (s) _elm_config->thumbscroll_enable = !!atoi(s);
s = getenv("ELM_THUMBSCROLL_THRESHOLD");
if (s) _elm_config->thumbscroll_threshhold = atoi(s);
// FIXME: floatformat locale issues here 1.0 vs 1,0 - should just be 1.0
@ -616,13 +624,25 @@ _env_get(void)
}
s = getenv("ELM_CURSOR_ENGINE_ONLY");
if (s) _elm_config->cursor_engine_only = atoi(s);
if (s) _elm_config->cursor_engine_only = !!atoi(s);
s = getenv("ELM_FOCUS_HIGHLIGHT_ENABLE");
if (s) _elm_config->focus_highlight_enable = atoi(s);
if (s) _elm_config->focus_highlight_enable = !!atoi(s);
s = getenv("ELM_FOCUS_HIGHLIGHT_ANIMATE");
if (s) _elm_config->focus_highlight_animate = atoi(s);
if (s) _elm_config->focus_highlight_animate = !!atoi(s);
s = getenv("ELM_TOOLBAR_SHRINK_MODE");
if (s) _elm_config->toolbar_shrink_mode = atoi(s);
s = getenv("ELM_FILESELECTOR_EXPAND_ENABLE");
if (s) _elm_config->fileselector_expand_enable = !!atoi(s);
s = getenv("ELM_INWIN_DIALOGS_ENABLE");
if (s) _elm_config->inwin_dialogs_enable = !!atoi(s);
s = getenv("ELM_ICON_SIZE");
if (s) _elm_config->icon_size = atoi(s);
}
void

View File

@ -71,7 +71,7 @@ struct _Elm_Config
{
int config_version;
int engine;
int thumbscroll_enable;
Eina_Bool thumbscroll_enable;
int thumbscroll_threshhold;
double thumbscroll_momentum_threshhold;
double thumbscroll_friction;
@ -79,7 +79,7 @@ struct _Elm_Config
double page_scroll_friction;
double bring_in_scroll_friction;
double zoom_friction;
int thumbscroll_bounce_enable;
Eina_Bool thumbscroll_bounce_enable;
double scale;
int bgpixmap;
int compositing;
@ -92,9 +92,13 @@ struct _Elm_Config
const char *theme;
const char *modules;
double tooltip_delay;
int cursor_engine_only;
int focus_highlight_enable;
int focus_highlight_animate;
Eina_Bool cursor_engine_only;
Eina_Bool focus_highlight_enable;
Eina_Bool focus_highlight_animate;
int toolbar_shrink_mode;
Eina_Bool fileselector_expand_enable;
Eina_Bool inwin_dialogs_enable;
int icon_size;
};
struct _Elm_Module