char *_elm_profile = NULL;
static Eet_Data_Descriptor *_config_edd = NULL;
static Eet_Data_Descriptor *_config_font_overlay_edd = NULL;
+const char *_elm_preferred_engine = NULL;
static Ecore_Poller *_elm_cache_flush_poller = NULL;
#endif
}
-
static void
_translation_init()
{
_desc_init();
_profile_fetch_from_conf();
_config_load();
+ if (_elm_preferred_engine) eina_stringshare_del(_elm_preferred_engine);
+ if (_elm_config->engine)
+ _elm_preferred_engine = eina_stringshare_add(_elm_config->engine);
+ else
+ _elm_preferred_engine = NULL;
_translation_init();
_env_get();
_config_apply();
_elm_config->engine = eina_stringshare_add(engine);
}
+EAPI const char *
+elm_preferred_engine_get(void)
+{
+ return _elm_preferred_engine;
+}
+
+EAPI void
+elm_preferred_engine_set(const char *engine)
+{
+ eina_stringshare_replace(&(_elm_preferred_engine), engine);
+}
+
void
_elm_config_profile_set(const char *profile)
{
#endif
}
_config_free();
+ if (_elm_preferred_engine)
+ {
+ eina_stringshare_del(_elm_preferred_engine);
+ _elm_preferred_engine = NULL;
+ }
if (_elm_profile)
{
free(_elm_profile);
EAPI void elm_engine_set(const char *engine);
/**
+ * @brief Get Elementary's preferred engine to use.
+ *
+ * @return The rendering engine's name
+ * @note there's no need to free the returned string, here.
+ *
+ * This gets the global rendering engine that is applied to all Elementary
+ * applications and is PREFERRED by the application. This can (and will)
+ * override the engine configured for all applications which.
+ *
+ * @see elm_preferred_engine_set()
+ */
+EAPI const char *elm_preferred_engine_get(void);
+
+/**
+ * @brief Set Elementary's preferred rendering engine for use.
+ *
+ * @param engine The rendering engine's name
+ *
+ * Note that it will take effect only to Elementary windows created after
+ * this is called. This overrides the engine set by configuration at
+ * application startup. Note that it is a hint and may not be honored.
+ *
+ * @see elm_win_add()
+ */
+EAPI void elm_preferred_engine_set(const char *engine);
+
+/**
* @}
*/
extern int _elm_log_dom;
extern Eina_List *_elm_win_list;
extern int _elm_win_deferred_free;
+extern const char *_elm_preferred_engine;
#ifdef ENABLE_NLS
/* Our gettext wrapper, used to disable translation of elm if the app
{
win->xwin = 0;
-#define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
+#define ENGINE_COMPARE(name) (!strcmp(_elm_preferred_engine, name))
if (ENGINE_COMPARE(ELM_SOFTWARE_X11))
{
if (win->ee) win->xwin = ecore_evas_software_x11_window_get(win->ee);
if (win->ee) \
elm_engine_set(ecore_evas_engine_name_get(win->ee)); \
} while (0)
-#define ENGINE_COMPARE(name) (_elm_config->engine && !strcmp(_elm_config->engine, name))
+#define ENGINE_COMPARE(name) (_elm_preferred_engine && !strcmp(_elm_preferred_engine, name))
win->kbdmode = ELM_WIN_KEYBOARD_UNKNOWN;
win->indmode = ELM_WIN_INDICATOR_UNKNOWN;
_elm_win_frame_add(win, "default");
// _elm_win_pointer_add(win, "default");
}
- else if (!strncmp(_elm_config->engine, "shot:", 5))
+ else if (!strncmp(_elm_preferred_engine, "shot:", 5))
{
win->ee = ecore_evas_buffer_new(1, 1);
ecore_evas_manual_render_set(win->ee, EINA_TRUE);
- win->shot.info = eina_stringshare_add(_elm_config->engine + 5);
+ win->shot.info = eina_stringshare_add(_elm_preferred_engine + 5);
_shot_init(win);
}
#undef FALLBACK_TRY
win = elm_widget_data_get(obj);
if (!win) return;
// YYY: handle if win->img_obj
-#define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
+#define ENGINE_COMPARE(name) (!strcmp(_elm_preferred_engine, name))
if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
{
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
win = elm_widget_data_get(obj);
if (!win) return EINA_FALSE;
-#define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
+#define ENGINE_COMPARE(name) (!strcmp(_elm_preferred_engine, name))
if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
{