forked from enlightenment/efl
parent
d7a3bd786d
commit
0106f9ac05
|
@ -347,17 +347,12 @@ elm_shutdown(void)
|
||||||
elm_quicklaunch_shutdown();
|
elm_quicklaunch_shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *elm_engine, *elm_scale, *elm_theme, *elm_prefix, *elm_data_dir;
|
|
||||||
static const char *elm_font_hinting, *elm_font_path, *elm_image_cache;
|
|
||||||
static const char *elm_font_cache, *elm_finger_size, *elm_fps;
|
|
||||||
static const char *elm_thumbscroll_enabled, *elm_thumbscroll_threshhold;
|
|
||||||
static const char *elm_thumbscroll_momentum_threshhold, *elm_thumbscroll_friction;
|
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_quicklaunch_init(int argc, char **argv)
|
elm_quicklaunch_init(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
|
char *s;
|
||||||
|
|
||||||
eet_init();
|
eet_init();
|
||||||
ecore_init();
|
ecore_init();
|
||||||
|
@ -371,31 +366,17 @@ elm_quicklaunch_init(int argc, char **argv)
|
||||||
|
|
||||||
_elm_appname = strdup(ecore_file_file_get(argv[0]));
|
_elm_appname = strdup(ecore_file_file_get(argv[0]));
|
||||||
|
|
||||||
elm_engine = getenv("ELM_ENGINE");
|
|
||||||
elm_scale = getenv("ELM_SCALE");
|
|
||||||
elm_theme = getenv("ELM_THEME");
|
|
||||||
elm_prefix = getenv("ELM_PREFIX");
|
|
||||||
elm_data_dir = getenv("ELM_DATA_DIR");
|
|
||||||
elm_font_hinting = getenv("ELM_FONT_HINTING");
|
|
||||||
elm_font_path = getenv("ELM_FONT_PATH");
|
|
||||||
elm_image_cache = getenv("ELM_IMAGE_CACHE");
|
|
||||||
elm_font_cache = getenv("ELM_FONT_CACHE");
|
|
||||||
elm_finger_size = getenv("ELM_FINGER_SIZE");
|
|
||||||
elm_fps = getenv("ELM_FPS");
|
|
||||||
elm_thumbscroll_enabled = getenv("ELM_THUMBSCROLL_ENABLE");
|
|
||||||
elm_thumbscroll_threshhold = getenv("ELM_THUMBSCROLL_THRESHOLD");
|
|
||||||
elm_thumbscroll_momentum_threshhold = getenv("ELM_THUMBSCROLL_MOMENTUM_THRESHOLD");
|
|
||||||
elm_thumbscroll_friction = getenv("ELM_THUMBSCROLL_FRICTION");
|
|
||||||
|
|
||||||
if (!_elm_data_dir)
|
if (!_elm_data_dir)
|
||||||
{
|
{
|
||||||
_elm_data_dir = eina_stringshare_add(elm_data_dir);
|
s = getenv("ELM_DATA_DIR");
|
||||||
|
_elm_data_dir = eina_stringshare_add(s);
|
||||||
}
|
}
|
||||||
if (!_elm_data_dir)
|
if (!_elm_data_dir)
|
||||||
{
|
{
|
||||||
if (elm_prefix)
|
s = getenv("ELM_PREFIX");
|
||||||
|
if (s)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "%s/share/elementary", elm_prefix);
|
snprintf(buf, sizeof(buf), "%s/share/elementary", s);
|
||||||
_elm_data_dir = eina_stringshare_add(buf);
|
_elm_data_dir = eina_stringshare_add(buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -452,75 +433,77 @@ elm_quicklaunch_init(int argc, char **argv)
|
||||||
_elm_config->compositing = 1;
|
_elm_config->compositing = 1;
|
||||||
_elm_config->fps = 60.0;
|
_elm_config->fps = 60.0;
|
||||||
|
|
||||||
if (elm_engine)
|
s = getenv("ELM_ENGINE");
|
||||||
|
if (s)
|
||||||
{
|
{
|
||||||
if ((!strcasecmp(elm_engine, "x11")) ||
|
if ((!strcasecmp(s, "x11")) ||
|
||||||
(!strcasecmp(elm_engine, "x")) ||
|
(!strcasecmp(s, "x")) ||
|
||||||
(!strcasecmp(elm_engine, "software-x11")) ||
|
(!strcasecmp(s, "software-x11")) ||
|
||||||
(!strcasecmp(elm_engine, "software_x11")))
|
(!strcasecmp(s, "software_x11")))
|
||||||
_elm_config->engine = ELM_SOFTWARE_X11;
|
_elm_config->engine = ELM_SOFTWARE_X11;
|
||||||
else if ((!strcasecmp(elm_engine, "x11-16")) ||
|
else if ((!strcasecmp(s, "x11-16")) ||
|
||||||
(!strcasecmp(elm_engine, "x16")) ||
|
(!strcasecmp(s, "x16")) ||
|
||||||
(!strcasecmp(elm_engine, "software-16-x11")) ||
|
(!strcasecmp(s, "software-16-x11")) ||
|
||||||
(!strcasecmp(elm_engine, "software_16_x11")))
|
(!strcasecmp(s, "software_16_x11")))
|
||||||
_elm_config->engine = ELM_SOFTWARE_16_X11;
|
_elm_config->engine = ELM_SOFTWARE_16_X11;
|
||||||
else if ((!strcasecmp(elm_engine, "xrender")) ||
|
else if ((!strcasecmp(s, "xrender")) ||
|
||||||
(!strcasecmp(elm_engine, "xr")) ||
|
(!strcasecmp(s, "xr")) ||
|
||||||
(!strcasecmp(elm_engine, "xrender-x11")) ||
|
(!strcasecmp(s, "xrender-x11")) ||
|
||||||
(!strcasecmp(elm_engine, "xrender_x11")))
|
(!strcasecmp(s, "xrender_x11")))
|
||||||
_elm_config->engine = ELM_XRENDER_X11;
|
_elm_config->engine = ELM_XRENDER_X11;
|
||||||
else if ((!strcasecmp(elm_engine, "fb")) ||
|
else if ((!strcasecmp(s, "fb")) ||
|
||||||
(!strcasecmp(elm_engine, "software-fb")) ||
|
(!strcasecmp(s, "software-fb")) ||
|
||||||
(!strcasecmp(elm_engine, "software_fb")))
|
(!strcasecmp(s, "software_fb")))
|
||||||
_elm_config->engine = ELM_SOFTWARE_FB;
|
_elm_config->engine = ELM_SOFTWARE_FB;
|
||||||
else if ((!strcasecmp(elm_engine, "opengl")) ||
|
else if ((!strcasecmp(s, "opengl")) ||
|
||||||
(!strcasecmp(elm_engine, "gl")) ||
|
(!strcasecmp(s, "gl")) ||
|
||||||
(!strcasecmp(elm_engine, "opengl-x11")) ||
|
(!strcasecmp(s, "opengl-x11")) ||
|
||||||
(!strcasecmp(elm_engine, "opengl_x11")))
|
(!strcasecmp(s, "opengl_x11")))
|
||||||
_elm_config->engine = ELM_OPENGL_X11;
|
_elm_config->engine = ELM_OPENGL_X11;
|
||||||
else if ((!strcasecmp(elm_engine, "ddraw")) ||
|
else if ((!strcasecmp(s, "ddraw")) ||
|
||||||
(!strcasecmp(elm_engine, "software-ddraw")) ||
|
(!strcasecmp(s, "software-ddraw")) ||
|
||||||
(!strcasecmp(elm_engine, "software_ddraw")))
|
(!strcasecmp(s, "software_ddraw")))
|
||||||
_elm_config->engine = ELM_SOFTWARE_WIN32;
|
_elm_config->engine = ELM_SOFTWARE_WIN32;
|
||||||
else if ((!strcasecmp(elm_engine, "wince-gdi")) ||
|
else if ((!strcasecmp(s, "wince-gdi")) ||
|
||||||
(!strcasecmp(elm_engine, "software-16-wince-gdi")) ||
|
(!strcasecmp(s, "software-16-wince-gdi")) ||
|
||||||
(!strcasecmp(elm_engine, "software_16_wince_gdi")))
|
(!strcasecmp(s, "software_16_wince_gdi")))
|
||||||
_elm_config->engine = ELM_SOFTWARE_16_WINCE;
|
_elm_config->engine = ELM_SOFTWARE_16_WINCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elm_thumbscroll_enabled)
|
s = getenv("ELM_THUMBSCROLL_ENABLE");
|
||||||
_elm_config->thumbscroll_enable = atoi(elm_thumbscroll_enabled);
|
if (s) _elm_config->thumbscroll_enable = atoi(s);
|
||||||
if (elm_thumbscroll_threshhold)
|
s = getenv("ELM_THUMBSCROLL_THRESHOLD");
|
||||||
_elm_config->thumbscroll_threshhold = atoi(elm_thumbscroll_threshhold);
|
if (s) _elm_config->thumbscroll_threshhold = atoi(s);
|
||||||
// FIXME: floatformat locale issues here 1.0 vs 1,0 - should just be 1.0
|
// FIXME: floatformat locale issues here 1.0 vs 1,0 - should just be 1.0
|
||||||
if (elm_thumbscroll_momentum_threshhold)
|
s = getenv("ELM_THUMBSCROLL_MOMENTUM_THRESHOLD");
|
||||||
_elm_config->thumbscroll_momentum_threshhold = atof(elm_thumbscroll_momentum_threshhold);
|
if (s) _elm_config->thumbscroll_momentum_threshhold = atof(s);
|
||||||
if (elm_thumbscroll_friction)
|
s = getenv("ELM_THUMBSCROLL_FRICTION");
|
||||||
_elm_config->thumbscroll_friction = atof(elm_thumbscroll_friction);
|
if (s) _elm_config->thumbscroll_friction = atof(s);
|
||||||
|
|
||||||
if (elm_theme)
|
s = getenv("ELM_THEME");
|
||||||
_elm_theme_parse(elm_theme);
|
if (s) _elm_theme_parse(s);
|
||||||
else
|
else _elm_theme_parse("default");
|
||||||
_elm_theme_parse("default");
|
|
||||||
|
|
||||||
_elm_config->font_hinting = 2;
|
_elm_config->font_hinting = 2;
|
||||||
if (elm_font_hinting)
|
s= getenv("ELM_FONT_HINTING");
|
||||||
|
if (s)
|
||||||
{
|
{
|
||||||
if (!strcasecmp(elm_font_hinting, "none"))
|
if (!strcasecmp(s, "none"))
|
||||||
_elm_config->font_hinting = 0;
|
_elm_config->font_hinting = 0;
|
||||||
else if (!strcasecmp(elm_font_hinting, "auto"))
|
else if (!strcasecmp(s, "auto"))
|
||||||
_elm_config->font_hinting = 1;
|
_elm_config->font_hinting = 1;
|
||||||
else if (!strcasecmp(elm_font_hinting, "bytecode"))
|
else if (!strcasecmp(s, "bytecode"))
|
||||||
_elm_config->font_hinting = 2;
|
_elm_config->font_hinting = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elm_font_path)
|
s = getenv("ELM_FONT_PATH");
|
||||||
|
if (s)
|
||||||
{
|
{
|
||||||
const char *p, *pp, *s;
|
const char *p, *pp, *s;
|
||||||
char *buf;
|
char *buf;
|
||||||
|
|
||||||
buf = alloca(strlen(elm_font_path) + 1);
|
buf = alloca(strlen(s) + 1);
|
||||||
p = elm_font_path;
|
p = s;
|
||||||
pp = p;
|
pp = p;
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
@ -544,22 +527,22 @@ elm_quicklaunch_init(int argc, char **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elm_image_cache)
|
s = getenv("ELM_IMAGE_CACHE");
|
||||||
_elm_config->image_cache = atoi(elm_image_cache);
|
if (s) _elm_config->image_cache = atoi(s);
|
||||||
|
|
||||||
if (elm_font_cache)
|
s = getenv("ELM_FONT_CACHE");
|
||||||
_elm_config->font_cache = atoi(elm_font_cache);
|
if (s) _elm_config->font_cache = atoi(s);
|
||||||
|
|
||||||
if (elm_scale)
|
s = getenv("ELM_SCALE");
|
||||||
_elm_config->scale = atof(elm_scale);
|
if (s) _elm_config->scale = atof(s);
|
||||||
|
|
||||||
_elm_config->finger_size =
|
_elm_config->finger_size =
|
||||||
(double)_elm_config->finger_size * _elm_config->scale;
|
(double)_elm_config->finger_size * _elm_config->scale;
|
||||||
if (elm_finger_size)
|
s = getenv("ELM_FINGER_SIZE");
|
||||||
_elm_config->finger_size = atoi(elm_finger_size);
|
if (s) _elm_config->finger_size = atoi(s);
|
||||||
|
|
||||||
if (elm_fps)
|
s = getenv("ELM_FPS");
|
||||||
_elm_config->fps = atof(elm_fps);
|
if (s) _elm_config->fps = atof(s);
|
||||||
|
|
||||||
if (_elm_config->fps < 1.0)
|
if (_elm_config->fps < 1.0)
|
||||||
_elm_config->fps = 1.0;
|
_elm_config->fps = 1.0;
|
||||||
|
@ -591,7 +574,7 @@ elm_quicklaunch_sub_init(int argc, char **argv)
|
||||||
ECORE_X_EVENT_MASK_WINDOW_PROPERTY);
|
ECORE_X_EVENT_MASK_WINDOW_PROPERTY);
|
||||||
_elm_event_property_change = ecore_event_handler_add
|
_elm_event_property_change = ecore_event_handler_add
|
||||||
(ECORE_X_EVENT_WINDOW_PROPERTY, _elm_window_property_change, NULL);
|
(ECORE_X_EVENT_WINDOW_PROPERTY, _elm_window_property_change, NULL);
|
||||||
if (!elm_scale)
|
if (!getenv("ELM_SCALE"))
|
||||||
{
|
{
|
||||||
if (ecore_x_window_prop_card32_get(ecore_x_window_root_first_get(),
|
if (ecore_x_window_prop_card32_get(ecore_x_window_root_first_get(),
|
||||||
_elm_atom_enlightenment_scale,
|
_elm_atom_enlightenment_scale,
|
||||||
|
@ -601,7 +584,7 @@ elm_quicklaunch_sub_init(int argc, char **argv)
|
||||||
{
|
{
|
||||||
_elm_config->scale = (double)val / 1000.0;
|
_elm_config->scale = (double)val / 1000.0;
|
||||||
// FIXME: hack until e export finger size too
|
// FIXME: hack until e export finger size too
|
||||||
if (!elm_finger_size)
|
if (getenv("ELM_FINGER_SIZE"))
|
||||||
_elm_config->finger_size = 40.0 * _elm_config->scale;
|
_elm_config->finger_size = 40.0 * _elm_config->scale;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1067,7 +1050,6 @@ elm_finger_size_get(void)
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_finger_size_set(Evas_Coord size)
|
elm_finger_size_set(Evas_Coord size)
|
||||||
{
|
{
|
||||||
elm_finger_size = NULL;
|
|
||||||
if (_elm_config->finger_size == size) return;
|
if (_elm_config->finger_size == size) return;
|
||||||
_elm_config->finger_size = size;
|
_elm_config->finger_size = size;
|
||||||
_elm_rescale();
|
_elm_rescale();
|
||||||
|
|
Loading…
Reference in New Issue