2008-09-29 23:58:56 -07:00
|
|
|
#include <Elementary.h>
|
|
|
|
#include "elm_priv.h"
|
|
|
|
|
|
|
|
char *_elm_appname = NULL;
|
|
|
|
Elm_Config *_elm_config = NULL;
|
|
|
|
|
|
|
|
static int
|
|
|
|
_elm_signal_exit(void *data, int ev_type, void *ev)
|
|
|
|
{
|
|
|
|
elm_exit();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_init(int argc, char **argv)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
eet_init();
|
|
|
|
ecore_init();
|
|
|
|
ecore_app_args_set(argc, (const char **)argv);
|
|
|
|
ecore_file_init();
|
|
|
|
evas_init();
|
|
|
|
edje_init();
|
|
|
|
ecore_evas_init(); // FIXME: check errors
|
|
|
|
|
|
|
|
ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _elm_signal_exit, NULL);
|
|
|
|
|
|
|
|
_elm_appname = strdup(ecore_file_file_get(argv[0]));
|
|
|
|
|
|
|
|
// FIXME: actually load config
|
|
|
|
_elm_config = ELM_NEW(Elm_Config);
|
|
|
|
_elm_config->engine = ELM_SOFTWARE_X11;
|
|
|
|
_elm_config->thumbscroll_enable = 1;
|
|
|
|
_elm_config->thumbscroll_threshhold = 24;
|
|
|
|
_elm_config->thumbscroll_momentum_threshhold = 100.0;
|
|
|
|
_elm_config->thumbscroll_friction = 1.0;
|
|
|
|
_elm_config->scale = 1.0;
|
2008-11-01 20:47:45 -07:00
|
|
|
_elm_config->bgpixmap = 0;
|
2008-10-16 05:03:01 -07:00
|
|
|
_elm_config->compositing = 1;
|
2008-09-29 23:58:56 -07:00
|
|
|
|
|
|
|
if ((_elm_config->engine == ELM_SOFTWARE_X11) ||
|
|
|
|
(_elm_config->engine == ELM_SOFTWARE_16_X11) ||
|
|
|
|
(_elm_config->engine == ELM_XRENDER_X11) ||
|
|
|
|
(_elm_config->engine == ELM_OPENGL_X11))
|
|
|
|
{
|
2008-10-07 23:38:20 -07:00
|
|
|
int val = 1000;
|
2008-09-29 23:58:56 -07:00
|
|
|
|
|
|
|
ecore_x_init(NULL);
|
|
|
|
if (ecore_x_window_prop_card32_get(ecore_x_window_root_first_get(),
|
|
|
|
ecore_x_atom_get("ENLIGHTENMENT_SCALE"),
|
2008-10-07 23:38:20 -07:00
|
|
|
&val, 1) > 0)
|
|
|
|
{
|
|
|
|
if (val > 0) _elm_config->scale = (double)val / 1000.0;
|
|
|
|
}
|
2008-10-16 05:03:01 -07:00
|
|
|
if (!ecore_x_screen_is_composited(0))
|
|
|
|
_elm_config->compositing = 0;
|
2008-09-29 23:58:56 -07:00
|
|
|
}
|
2008-10-16 05:03:01 -07:00
|
|
|
|
2008-09-29 23:58:56 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_shutdown(void)
|
|
|
|
{
|
2008-10-06 18:23:49 -07:00
|
|
|
_elm_win_shutdown();
|
|
|
|
|
2008-09-29 23:58:56 -07:00
|
|
|
free(_elm_config);
|
|
|
|
free(_elm_appname);
|
|
|
|
ecore_evas_shutdown();
|
|
|
|
edje_shutdown();
|
|
|
|
evas_shutdown();
|
|
|
|
ecore_file_shutdown();
|
|
|
|
ecore_shutdown();
|
|
|
|
eet_shutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_run(void)
|
|
|
|
{
|
|
|
|
ecore_main_loop_begin();
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_exit(void)
|
|
|
|
{
|
|
|
|
ecore_main_loop_quit();
|
|
|
|
}
|