ELM_CONFIG_VAL(D, T, year_min, T_INT);
ELM_CONFIG_VAL(D, T, year_max, T_INT);
ELM_CONFIG_LIST(D, T, color_palette, _config_color_palette_edd);
+ ELM_CONFIG_VAL(D, T, softcursor_mode, T_UCHAR);
#undef T
#undef D
#undef T_INT
_elm_config->weekend_len = 2;
_elm_config->year_min = 2;
_elm_config->year_max = 137;
+ _elm_config->softcursor_mode = 0; /* 0 = auto, 1 = on, 2 = off */
_elm_config->color_palette = NULL;
}
}
EAPI void
+elm_config_softcursor_mode_set(Elm_Softcursor_Mode mode)
+{
+ _elm_config->softcursor_mode = mode;
+}
+
+EAPI Elm_Softcursor_Mode
+elm_config_softcursor_mode_get(void)
+{
+ return _elm_config->softcursor_mode;
+}
+
+EAPI void
elm_config_all_flush(void)
{
#ifdef HAVE_ELEMENTARY_X
#undef ENGINE_COMPARE
{
#ifdef HAVE_ELEMENTARY_X
- if (!ecore_x_init(NULL))
+ if (ecore_x_init(NULL))
{
- ERR("Cannot connect to X11 display. check $DISPLAY variable");
- exit(1);
- }
- _root_1st = ecore_x_window_root_first_get();
-
- if (!ecore_x_screen_is_composited(0))
- _elm_config->compositing = 0;
-
- ecore_x_atoms_get(_atom_names, ATOM_COUNT, _atom);
- ecore_x_event_mask_set(_root_1st,
- ECORE_X_EVENT_MASK_WINDOW_PROPERTY);
- _prop_change_handler = ecore_event_handler_add
- (ECORE_X_EVENT_WINDOW_PROPERTY, _prop_change, NULL);
- if (!getenv("ELM_PROFILE"))
- {
- char *s;
-
- s = ecore_x_window_prop_string_get(_root_1st,
- _atom[ATOM_E_PROFILE]);
- if (s)
+ _root_1st = ecore_x_window_root_first_get();
+
+ if (!ecore_x_screen_is_composited(0))
+ _elm_config->compositing = 0;
+
+ ecore_x_atoms_get(_atom_names, ATOM_COUNT, _atom);
+ ecore_x_event_mask_set(_root_1st,
+ ECORE_X_EVENT_MASK_WINDOW_PROPERTY);
+ _prop_change_handler = ecore_event_handler_add
+ (ECORE_X_EVENT_WINDOW_PROPERTY, _prop_change, NULL);
+ if (!getenv("ELM_PROFILE"))
{
- int changed = 0;
-
- if (_elm_profile)
+ char *s;
+
+ s = ecore_x_window_prop_string_get(_root_1st,
+ _atom[ATOM_E_PROFILE]);
+ if (s)
{
- if (strcmp(_elm_profile, s)) changed = 1;
- free(_elm_profile);
+ int changed = 0;
+
+ if (_elm_profile)
+ {
+ if (strcmp(_elm_profile, s)) changed = 1;
+ free(_elm_profile);
+ }
+ _elm_profile = s;
+ if (changed) _prop_config_get();
}
- _elm_profile = s;
- if (changed) _prop_config_get();
}
}
+ else
+ ERR("Cannot connect to X11 display. check $DISPLAY variable");
#endif
}
_config_sub_apply();
elm_config_preferred_engine_set \
(ecore_evas_engine_name_get(tmp_sd.ee)); \
} while (0)
+#define FALLBACK_STORE(engine) \
+ if (tmp_sd.ee) \
+ do { \
+ CRITICAL(engine "Fallback to %s successful.", engine); \
+ elm_config_preferred_engine_set \
+ (ecore_evas_engine_name_get(tmp_sd.ee)); \
+ } while (0)
switch (type)
{
{
tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
FALLBACK_TRY("Sofware X11");
+ if (!tmp_sd.ee)
+ {
+ tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
+ FALLBACK_STORE("Sofware FB");
+ }
}
else if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
{
tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
FALLBACK_TRY("Sofware FB");
+ if (!tmp_sd.ee)
+ {
+ tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
+ FALLBACK_STORE("Sofware X11");
+ }
}
else if (ENGINE_COMPARE(ELM_SOFTWARE_DIRECTFB))
{
tmp_sd.ee = ecore_evas_directfb_new(NULL, 1, 0, 0, 1, 1);
FALLBACK_TRY("Sofware DirectFB");
+ if (!tmp_sd.ee)
+ {
+ tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
+ FALLBACK_STORE("Sofware X11");
+ if (!tmp_sd.ee)
+ {
+ tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
+ FALLBACK_STORE("Sofware FB");
+ }
+ }
}
else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11))
{
tmp_sd.ee = ecore_evas_software_x11_16_new(NULL, 0, 0, 0, 1, 1);
FALLBACK_TRY("Sofware-16");
+ if (!tmp_sd.ee)
+ {
+ tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
+ FALLBACK_STORE("Sofware X11");
+ if (!tmp_sd.ee)
+ {
+ tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
+ FALLBACK_STORE("Sofware FB");
+ }
+ }
}
else if (ENGINE_COMPARE(ELM_SOFTWARE_8_X11))
{
tmp_sd.ee = ecore_evas_software_x11_8_new(NULL, 0, 0, 0, 1, 1);
FALLBACK_TRY("Sofware-8");
+ if (!tmp_sd.ee)
+ {
+ tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
+ FALLBACK_STORE("Sofware X11");
+ if (!tmp_sd.ee)
+ {
+ tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
+ FALLBACK_STORE("Sofware FB");
+ }
+ }
}
else if (ENGINE_COMPARE(ELM_OPENGL_X11))
{
else
tmp_sd.ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1);
FALLBACK_TRY("OpenGL");
+ if (!tmp_sd.ee)
+ {
+ tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
+ FALLBACK_STORE("Sofware X11");
+ if (!tmp_sd.ee)
+ {
+ tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
+ FALLBACK_STORE("Sofware FB");
+ }
+ }
}
else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32))
{
{
tmp_sd.ee = ecore_evas_sdl_new(NULL, 0, 0, 0, 0, 0, 1);
FALLBACK_TRY("Sofware SDL");
+ if (!tmp_sd.ee)
+ {
+ tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
+ FALLBACK_STORE("Sofware X11");
+ if (!tmp_sd.ee)
+ {
+ tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
+ FALLBACK_STORE("Sofware FB");
+ }
+ }
}
else if (ENGINE_COMPARE(ELM_SOFTWARE_16_SDL))
{
tmp_sd.ee = ecore_evas_sdl16_new(NULL, 0, 0, 0, 0, 0, 1);
FALLBACK_TRY("Sofware-16-SDL");
+ if (!tmp_sd.ee)
+ {
+ tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
+ FALLBACK_STORE("Sofware X11");
+ if (!tmp_sd.ee)
+ {
+ tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
+ FALLBACK_STORE("Sofware FB");
+ }
+ }
}
else if (ENGINE_COMPARE(ELM_OPENGL_SDL))
{
tmp_sd.ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
FALLBACK_TRY("OpenGL SDL");
+ if (!tmp_sd.ee)
+ {
+ tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
+ FALLBACK_STORE("Sofware X11");
+ if (!tmp_sd.ee)
+ {
+ tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
+ FALLBACK_STORE("Sofware FB");
+ }
+ }
}
else if (ENGINE_COMPARE(ELM_OPENGL_COCOA))
{
ERR("Cannot create window.");
return NULL;
}
-
+
obj = evas_object_smart_add
(ecore_evas_get(tmp_sd.ee), _elm_win_smart_class_new());
ERR("failed to grab F12 key to elm widgets (dot) tree generation");
#endif
+ if ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_ON) ||
+ ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_AUTO) &&
+ elm_config_preferred_engine_get() &&
+ (!strcmp(elm_config_preferred_engine_get(), "fb"))))
+ {
+ Evas_Object *o;
+ Evas_Coord mw = 1, mh = 1, hx = 0, hy = 0;
+
+ sd->pointer.obj = o = edje_object_add(ecore_evas_get(tmp_sd.ee));
+ _elm_theme_object_set(obj, o, "pointer", "base", "default");
+ edje_object_size_min_calc(o, &mw, &mh);
+ evas_object_resize(o, mw, mh);
+ edje_object_part_geometry_get(o, "elm.swallow.hotspot",
+ &hx, &hy, NULL, NULL);
+ sd->pointer.hot_x = hx;
+ sd->pointer.hot_y = hy;
+ evas_object_show(o);
+ ecore_evas_object_cursor_set(tmp_sd.ee, o, EVAS_LAYER_MAX, hx, hy);
+ }
+ else if (_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_OFF)
+ {
+ // do nothing
+ }
+
return obj;
}