2005-02-07 05:51:09 -08:00
|
|
|
/*
|
|
|
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
|
|
|
*/
|
2004-11-24 19:37:45 -08:00
|
|
|
#include "e.h"
|
|
|
|
|
2005-02-07 07:09:37 -08:00
|
|
|
EAPI void _e_init_icons_del(void);
|
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
/* local subsystem globals */
|
|
|
|
static Ecore_X_Window _e_init_win = 0;
|
|
|
|
static Ecore_Evas *_e_init_ecore_evas = NULL;
|
|
|
|
static Evas *_e_init_evas = NULL;
|
|
|
|
static Evas_Object *_e_init_object = NULL;
|
|
|
|
|
2005-02-07 07:09:37 -08:00
|
|
|
/* startup icons */
|
|
|
|
static Evas_Coord _e_init_icon_x, _e_init_icon_y;
|
|
|
|
static int _e_init_icon_size, _e_init_icon_wrap;
|
|
|
|
static Evas_List *_e_init_icon_list;
|
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
/* externally accessible functions */
|
|
|
|
int
|
|
|
|
e_init_init(void)
|
|
|
|
{
|
2005-01-11 06:17:36 -08:00
|
|
|
int x, y, w, h;
|
2004-11-24 19:37:45 -08:00
|
|
|
Ecore_X_Window root;
|
|
|
|
Ecore_X_Window *roots;
|
2005-02-07 05:51:09 -08:00
|
|
|
int num;
|
2004-11-24 19:37:45 -08:00
|
|
|
Evas_Object *o;
|
2005-01-11 06:17:36 -08:00
|
|
|
int n;
|
2004-11-24 19:37:45 -08:00
|
|
|
|
|
|
|
num = 0;
|
|
|
|
roots = ecore_x_window_root_list(&num);
|
|
|
|
if ((!roots) || (num <= 0))
|
|
|
|
{
|
|
|
|
e_error_message_show("X reports there are no root windows and %i screens!\n",
|
|
|
|
num);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
root = roots[0];
|
2005-01-11 06:23:31 -08:00
|
|
|
|
2005-01-11 06:17:36 -08:00
|
|
|
ecore_x_window_size_get(root, &w, &h);
|
2004-11-24 19:37:45 -08:00
|
|
|
_e_init_ecore_evas = ecore_evas_software_x11_new(NULL, root, 0, 0, w, h);
|
|
|
|
e_canvas_add(_e_init_ecore_evas);
|
|
|
|
_e_init_evas = ecore_evas_get(_e_init_ecore_evas);
|
|
|
|
_e_init_win = ecore_evas_software_x11_window_get(_e_init_ecore_evas);
|
|
|
|
ecore_evas_override_set(_e_init_ecore_evas, 1);
|
|
|
|
ecore_evas_name_class_set(_e_init_ecore_evas, "E", "Init_Window");
|
|
|
|
ecore_evas_title_set(_e_init_ecore_evas, "Enlightenment Init");
|
|
|
|
e_path_evas_append(path_fonts, _e_init_ecore_evas);
|
|
|
|
e_pointer_ecore_evas_set(_e_init_ecore_evas);
|
|
|
|
ecore_evas_raise(_e_init_ecore_evas);
|
|
|
|
ecore_evas_show(_e_init_ecore_evas);
|
|
|
|
|
2005-02-07 07:09:37 -08:00
|
|
|
_e_init_icon_size = 64;
|
|
|
|
_e_init_icon_wrap = w;
|
|
|
|
_e_init_icon_x = 0;
|
|
|
|
_e_init_icon_y = h - _e_init_icon_size;
|
|
|
|
|
2005-01-11 06:17:36 -08:00
|
|
|
n = ecore_x_xinerama_screen_count_get();
|
|
|
|
if (n == 0)
|
|
|
|
{
|
|
|
|
o = edje_object_add(_e_init_evas);
|
|
|
|
edje_object_file_set(o,
|
|
|
|
/* FIXME: "init.eet" needs to come from config */
|
|
|
|
e_path_find(path_init, "init.eet"),
|
|
|
|
"init/splash");
|
2005-01-11 06:23:31 -08:00
|
|
|
evas_object_move(o, 0, 0);
|
2005-01-11 06:17:36 -08:00
|
|
|
evas_object_resize(o, w, h);
|
|
|
|
evas_object_show(o);
|
|
|
|
_e_init_object = o;
|
|
|
|
}
|
|
|
|
else
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-01-11 06:17:36 -08:00
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < n; i++)
|
|
|
|
{
|
|
|
|
ecore_x_xinerama_screen_geometry_get(i, &x, &y, &w, &h);
|
|
|
|
if (i == 0)
|
|
|
|
{
|
|
|
|
o = edje_object_add(_e_init_evas);
|
|
|
|
edje_object_file_set(o,
|
|
|
|
/* FIXME: "init.eet" needs to come from config */
|
|
|
|
e_path_find(path_init, "init.eet"),
|
|
|
|
"init/splash");
|
|
|
|
evas_object_move(o, x, y);
|
|
|
|
evas_object_resize(o, w, h);
|
|
|
|
evas_object_show(o);
|
|
|
|
_e_init_object = o;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
o = edje_object_add(_e_init_evas);
|
|
|
|
edje_object_file_set(o,
|
|
|
|
/* FIXME: "init.eet" needs to come from config */
|
|
|
|
e_path_find(path_init, "init.eet"),
|
2005-01-11 07:40:53 -08:00
|
|
|
"init/extra_screen");
|
2005-01-11 06:17:36 -08:00
|
|
|
evas_object_move(o, x, y);
|
|
|
|
evas_object_resize(o, w, h);
|
|
|
|
evas_object_show(o);
|
|
|
|
}
|
|
|
|
}
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
free(roots);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
e_init_shutdown(void)
|
|
|
|
{
|
|
|
|
e_init_hide();
|
|
|
|
e_canvas_cache_flush();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
e_init_show(void)
|
|
|
|
{
|
|
|
|
if (!_e_init_ecore_evas) return;
|
|
|
|
ecore_evas_raise(_e_init_ecore_evas);
|
|
|
|
ecore_evas_show(_e_init_ecore_evas);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
e_init_hide(void)
|
|
|
|
{
|
|
|
|
/* FIXME: emit signal to edje and wait for it to respond or until a */
|
|
|
|
/* in case the edje was badly created and never responds */
|
|
|
|
if (!_e_init_ecore_evas) return;
|
|
|
|
ecore_evas_hide(_e_init_ecore_evas);
|
|
|
|
evas_object_del(_e_init_object);
|
|
|
|
e_canvas_del(_e_init_ecore_evas);
|
|
|
|
ecore_evas_free(_e_init_ecore_evas);
|
|
|
|
_e_init_ecore_evas = NULL;
|
|
|
|
_e_init_evas = NULL;
|
|
|
|
_e_init_win = 0;
|
|
|
|
_e_init_object = NULL;
|
2005-02-07 07:09:37 -08:00
|
|
|
|
|
|
|
_e_init_icons_del();
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
e_init_title_set(const char *str)
|
|
|
|
{
|
|
|
|
if (!_e_init_object) return;
|
|
|
|
edje_object_part_text_set(_e_init_object, "title", str);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
e_init_version_set(const char *str)
|
|
|
|
{
|
|
|
|
if (!_e_init_object) return;
|
|
|
|
edje_object_part_text_set(_e_init_object, "version", str);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
e_init_status_set(const char *str)
|
|
|
|
{
|
|
|
|
if (!_e_init_object) return;
|
|
|
|
edje_object_part_text_set(_e_init_object, "status", str);
|
|
|
|
}
|
|
|
|
|
|
|
|
Ecore_X_Window
|
|
|
|
e_init_window_get(void)
|
|
|
|
{
|
|
|
|
return _e_init_win;
|
|
|
|
}
|
2005-02-07 07:09:37 -08:00
|
|
|
|
|
|
|
/* code for displaying startup icons */
|
|
|
|
|
|
|
|
void
|
|
|
|
e_init_icons_app_add(E_App *app)
|
|
|
|
{
|
|
|
|
Evas_Object *o;
|
|
|
|
|
|
|
|
E_OBJECT_CHECK(app);
|
|
|
|
E_OBJECT_TYPE_CHECK(app, E_APP_TYPE);
|
|
|
|
|
|
|
|
o = edje_object_add(_e_init_evas);
|
|
|
|
edje_object_file_set(o,app->path, "icon");
|
|
|
|
evas_object_resize(o, _e_init_icon_size, _e_init_icon_size);
|
|
|
|
evas_object_move(o, _e_init_icon_x, _e_init_icon_y);
|
|
|
|
evas_object_show(o);
|
|
|
|
_e_init_icon_list = evas_list_append(_e_init_icon_list, o);
|
|
|
|
|
|
|
|
_e_init_icon_x += _e_init_icon_size;
|
|
|
|
if (_e_init_icon_x + _e_init_icon_size > _e_init_icon_wrap)
|
|
|
|
{
|
|
|
|
_e_init_icon_x = 0;
|
|
|
|
_e_init_icon_y -= _e_init_icon_size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_e_init_icons_del(void)
|
|
|
|
{
|
|
|
|
Evas_Object *next;
|
|
|
|
|
|
|
|
while(_e_init_icon_list)
|
|
|
|
{
|
|
|
|
next = _e_init_icon_list->data;
|
|
|
|
evas_object_del(next);
|
|
|
|
_e_init_icon_list = evas_list_remove(_e_init_icon_list, next);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|