2012-03-28 18:43:17 -07:00
|
|
|
#include "e.h"
|
2014-03-11 02:01:01 -07:00
|
|
|
#include <Ecore_Drm.h>
|
|
|
|
#include "e_comp_wl.h"
|
|
|
|
#include <Ecore_Wayland.h>
|
2012-03-28 18:43:17 -07:00
|
|
|
|
2014-03-11 02:01:01 -07:00
|
|
|
#define SCREEN_WIDTH 1920
|
|
|
|
#define SCREEN_HEIGHT 1200
|
2012-03-28 18:43:17 -07:00
|
|
|
|
2014-03-11 02:01:01 -07:00
|
|
|
EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Wl_Drm" };
|
2012-03-28 18:43:17 -07:00
|
|
|
|
|
|
|
EAPI void *
|
|
|
|
e_modapi_init(E_Module *m)
|
|
|
|
{
|
2014-03-11 02:01:01 -07:00
|
|
|
E_Comp *comp;
|
2012-03-28 18:43:17 -07:00
|
|
|
|
2014-03-11 02:01:01 -07:00
|
|
|
printf("LOAD WL_DRM MODULE\n");
|
2012-03-28 18:43:17 -07:00
|
|
|
|
2014-03-11 02:01:01 -07:00
|
|
|
/* try to init ecore_drm */
|
|
|
|
/* if (!ecore_drm_init()) */
|
|
|
|
/* { */
|
|
|
|
/* fprintf(stderr, "Could not initialize ecore_drm"); */
|
|
|
|
/* return NULL; */
|
|
|
|
/* } */
|
2012-03-28 18:43:17 -07:00
|
|
|
|
2014-03-11 02:01:01 -07:00
|
|
|
comp = e_comp_new();
|
|
|
|
comp->comp_type = E_PIXMAP_TYPE_WL;
|
|
|
|
comp->ee = ecore_evas_drm_new(NULL, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
|
|
|
if (!comp->ee)
|
2012-03-28 18:43:17 -07:00
|
|
|
{
|
2014-03-11 02:01:01 -07:00
|
|
|
fprintf(stderr, "Could not create ecore_evas_drm canvas");
|
2012-03-28 18:43:17 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2014-03-11 02:01:01 -07:00
|
|
|
if (!e_xinerama_fake_screens_exist())
|
2012-03-28 18:43:17 -07:00
|
|
|
{
|
2014-03-11 02:01:01 -07:00
|
|
|
E_Screen *screen;
|
2012-03-28 18:43:17 -07:00
|
|
|
|
2014-03-11 02:01:01 -07:00
|
|
|
screen = E_NEW(E_Screen, 1);
|
|
|
|
screen->escreen = screen->screen = 0;
|
|
|
|
screen->x = 0;
|
|
|
|
screen->y = 0;
|
|
|
|
screen->w = SCREEN_WIDTH;
|
|
|
|
screen->h = SCREEN_HEIGHT;
|
|
|
|
e_xinerama_screens_set(eina_list_append(NULL, screen));
|
2012-03-28 18:43:17 -07:00
|
|
|
}
|
2014-03-11 02:01:01 -07:00
|
|
|
comp->man = e_manager_new(0, comp, SCREEN_WIDTH, SCREEN_HEIGHT);
|
2014-03-17 06:57:56 -07:00
|
|
|
if (!e_comp_wl_init()) return NULL;
|
2014-03-11 02:01:01 -07:00
|
|
|
e_comp_canvas_init(comp);
|
|
|
|
e_comp_canvas_fake_layers_init(comp);
|
|
|
|
comp->pointer = e_pointer_canvas_new(comp->evas, 1);
|
2012-03-28 18:43:17 -07:00
|
|
|
|
2014-03-17 06:57:56 -07:00
|
|
|
ecore_wl_server_mode_set(1);
|
2014-03-18 00:41:47 -07:00
|
|
|
ecore_wl_init(NULL);
|
2014-03-17 06:57:56 -07:00
|
|
|
|
2014-03-11 02:01:01 -07:00
|
|
|
return m;
|
2012-03-28 18:43:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
2014-03-11 02:01:01 -07:00
|
|
|
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
2012-03-28 18:43:17 -07:00
|
|
|
{
|
2014-03-11 02:01:01 -07:00
|
|
|
/* shutdown ecore_drm */
|
|
|
|
/* ecore_drm_shutdown(); */
|
2012-03-28 18:43:17 -07:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|