2013-09-11 06:32:00 -07:00
|
|
|
#include "e.h"
|
2014-05-09 05:58:20 -07:00
|
|
|
#include <Ecore_X.h>
|
2013-09-11 06:32:00 -07:00
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Wl_X11" };
|
2014-05-09 02:53:53 -07:00
|
|
|
|
|
|
|
static Ecore_Event_Handler *kbd_hdlr;
|
|
|
|
|
2013-09-11 06:32:00 -07:00
|
|
|
static void
|
|
|
|
_cb_delete_request(Ecore_Evas *ee EINA_UNUSED)
|
|
|
|
{
|
|
|
|
ecore_main_loop_quit();
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void *
|
2013-09-11 06:32:00 -07:00
|
|
|
e_modapi_init(E_Module *m)
|
|
|
|
{
|
2015-01-22 07:06:26 -08:00
|
|
|
int w = 0, h = 0;
|
2013-09-11 06:32:00 -07:00
|
|
|
|
|
|
|
printf("LOAD WL_X11 MODULE\n");
|
|
|
|
|
2015-12-10 08:34:15 -08:00
|
|
|
if (!ecore_x_init(NULL))
|
|
|
|
{
|
|
|
|
fprintf(stderr, "X11 connect failed!\n");
|
|
|
|
return NULL;
|
|
|
|
}
|
2015-04-22 15:12:22 -07:00
|
|
|
e_comp_x_randr_canvas_new(ecore_x_window_root_first_get(), 1, 1);
|
2014-05-09 02:53:53 -07:00
|
|
|
|
2015-04-22 13:58:00 -07:00
|
|
|
if (!e_comp->ee)
|
2015-01-22 07:06:26 -08:00
|
|
|
{
|
|
|
|
ERR("Could not create ecore_evas canvas");
|
|
|
|
return NULL;
|
|
|
|
}
|
2015-04-22 15:12:22 -07:00
|
|
|
ecore_evas_callback_delete_request_set(e_comp->ee, _cb_delete_request);
|
2015-07-02 13:52:11 -07:00
|
|
|
ecore_evas_title_set(e_comp->ee, "Enlightenment: WL-X11");
|
|
|
|
ecore_evas_name_class_set(e_comp->ee, "E", "compositor");
|
2015-01-22 07:06:26 -08:00
|
|
|
|
2015-04-22 13:58:00 -07:00
|
|
|
ecore_evas_screen_geometry_get(e_comp->ee, NULL, NULL, &w, &h);
|
2015-12-10 08:54:50 -08:00
|
|
|
if (!ecore_x_screen_is_composited(0))
|
|
|
|
e_comp_x_randr_screen_iface_set();
|
2014-05-09 02:53:53 -07:00
|
|
|
if (!e_comp_wl_init()) return NULL;
|
2015-04-22 16:27:36 -07:00
|
|
|
if (!e_comp_canvas_init(w, h)) return NULL;
|
2014-05-09 02:53:53 -07:00
|
|
|
|
2015-05-13 09:05:57 -07:00
|
|
|
e_comp_wl_input_pointer_enabled_set(EINA_TRUE);
|
|
|
|
e_comp_wl_input_keyboard_enabled_set(EINA_TRUE);
|
|
|
|
e_comp_wl_input_touch_enabled_set(EINA_TRUE);
|
2014-05-09 02:53:53 -07:00
|
|
|
|
2015-04-22 13:58:00 -07:00
|
|
|
/* e_comp->pointer = */
|
|
|
|
/* e_pointer_window_new(ecore_evas_window_get(e_comp->ee), EINA_TRUE); */
|
|
|
|
e_comp->pointer = e_pointer_canvas_new(e_comp->ee, EINA_TRUE);
|
|
|
|
e_comp->pointer->color = EINA_TRUE;
|
2014-05-09 02:53:53 -07:00
|
|
|
|
2013-09-11 06:32:00 -07:00
|
|
|
return m;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int
|
2013-09-11 06:32:00 -07:00
|
|
|
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
|
|
|
{
|
2014-05-09 02:53:53 -07:00
|
|
|
/* delete handler for keymap change */
|
|
|
|
if (kbd_hdlr) ecore_event_handler_del(kbd_hdlr);
|
2015-12-10 08:34:15 -08:00
|
|
|
ecore_x_shutdown();
|
2013-09-11 06:32:00 -07:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|