src/bin/e_user.h \
src/bin/e_utils.h \
src/bin/e_win.h \
-src/bin/e_xinerama.h \
src/bin/e_zoomap.h \
src/bin/e_zone.h \
src/bin/e_util_transform.h \
src/bin/e_user.c \
src/bin/e_utils.c \
src/bin/e_win.c \
-src/bin/e_xinerama.c \
src/bin/e_zoomap.c \
src/bin/e_zone.c \
src/bin/e_util_transform.c \
int ly_total = 0, ly_cnt = 0;
E_Hwc_Mode mode = E_HWC_MODE_INVALID;
- if (zone->output) ly_total = zone->output->plane_count;
+ if (zone->screen) ly_total = zone->screen->plane_count;
E_CLIENT_REVERSE_FOREACH(ec)
{
EINA_LIST_FOREACH_SAFE(e_comp->zones, l, ll, zone)
{
E_Client *ec;
- E_Output *eout;
+ E_Output_Screen *eout;
int mode = E_HWC_MODE_INVALID;
int num_of_ly = 0, ly_cnt = 0;
Eina_List *clist = NULL;
- if (!zone && !zone->output) continue;
+ if (!zone && !zone->screen) continue;
- eout = zone->output;
+ eout = zone->screen;
printf("reassign all clients from zone %p\n", zone);
num_of_ly = eout->plane_count;
EINA_LIST_FOREACH(e_comp->zones, l, zone)
{
- if(zone->output) mode_set |= e_output_update(zone->output);
+ if(zone->screen) mode_set |= e_output_update(zone->screen);
}
#endif
if (!mode_set) return;
// e_comp->canvases will be replace e_comp->zones
EINA_LIST_FOREACH_SAFE(e_comp->zones, l, ll, zone)
{
- if (zone->output)
+ if (zone->screen)
{
- e_output_planes_clear(zone->output);
- mode_set |= e_output_update(zone->output);
+ e_output_planes_clear(zone->screen);
+ mode_set |= e_output_update(zone->screen);
}
}
#endif
e_comp_new();
+ e_main_ts("\tE_Comp_DRM Init");
if (!e_comp_drm_init())
{
ERR("Fail to init e_comp_drm");
E_FREE_FUNC(ignores, eina_hash_free);
return EINA_FALSE;
}
+ e_main_ts("\tE_Comp_DRM Init Done");
e_comp->comp_type = E_PIXMAP_TYPE_WL;
e_comp->hwc = e_comp_hwc_init();
if (!e_comp->hwc)
WRN("fail to init hwc.");
-
- E_LIST_FOREACH(e_comp->zones, e_comp_hwc_plane_init);
}
#endif
/* stop listening for screen events */
void (*shutdown)(void);
/* gather screen info */
- E_Drm_Output *(*create)(void);
+ E_Output *(*create)(void);
/* apply current config */
void (*apply)(void);
/* set dpms (on, standby, suspend, off) */
static void
_e_comp_canvas_resize(Ecore_Evas *ee EINA_UNUSED)
{
- e_drm_output_screens_setup(e_comp->w, e_comp->h);
+ e_output_screens_setup(e_comp->w, e_comp->h);
e_comp_canvas_update();
}
e_comp->ee_win = ecore_evas_window_get(e_comp->ee);
- screens = (Eina_List *)e_xinerama_screens_get();
+ screens = (Eina_List *)e_output_screens_get();
if (screens)
{
E_Screen *scr;
{
E_Zone *zone = e_zone_new(scr->screen, scr->escreen,
scr->x, scr->y, scr->w, scr->h);
- if (scr->id) zone->randr2_id = strdup(scr->id);
+ if (scr->id)
+ {
+ zone->randr2_id = strdup(scr->id);
+ zone->screen = e_output_screen_id_find(scr->id);
+ }
}
}
else
ecore_evas_callback_pre_render_set(e_comp->ee, _e_comp_canvas_prerender);
ecore_evas_callback_resize_set(e_comp->ee, _e_comp_canvas_resize);
- ecore_evas_resize(e_comp->ee, w, h);
TRACE_DS_END();
return EINA_TRUE;
//////////////////////////////////////////////
E_API void
-e_comp_canvas_resize(int w, int h)
-{
- e_comp->w = w;
- e_comp->h = h;
- ecore_evas_resize(e_comp->ee, w, h);
-}
-
-E_API void
e_comp_all_freeze(void)
{
evas_event_freeze(e_comp->evas);
int i;
Eina_Bool changed = EINA_FALSE;
- screens = (Eina_List *)e_xinerama_screens_get();
+ screens = (Eina_List *)e_output_screens_get();
if (screens)
{
zone->num = scr->screen;
free(zone->randr2_id);
zone->randr2_id = NULL;
- if (scr->id) zone->randr2_id = strdup(scr->id);
+ zone->screen = NULL;
+ if (scr->id)
+ {
+ zone->randr2_id = strdup(scr->id);
+ zone->screen = e_output_screen_id_find(scr->id);
+ }
}
else
{
zone = e_zone_new(scr->screen, scr->escreen,
scr->x, scr->y, scr->w, scr->h);
- if (scr->id) zone->randr2_id = strdup(scr->id);
+ if (scr->id)
+ {
+ zone->randr2_id = strdup(scr->id);
+ zone->screen = e_output_screen_id_find(scr->id);
+ }
+
printf("@@@ NEW ZONE = %p\n", zone);
changed = EINA_TRUE;
}
E_API Eina_Bool e_comp_canvas_init(int w, int h);
EINTERN void e_comp_canvas_clear(void);
-E_API void e_comp_canvas_resize(int w, int h);
E_API void e_comp_all_freeze(void);
E_API void e_comp_all_thaw(void);
E_API E_Zone * e_comp_zone_xy_get(Evas_Coord x, Evas_Coord y);
DBG("WL_DRM OUTPUT CHANGE");
- EINA_LIST_FOREACH(e_drm_output->screens, l, screen)
+ EINA_LIST_FOREACH(e_output->screens, l, screen)
{
- if ((!strcmp(screen->info.name, e->name)) &&
+ if ((!strcmp(screen->info.name, e->name)) &&
(!strcmp(screen->info.screen, e->model)))
{
if (e->plug)
{
if (!e_comp_wl_output_init(screen->id, e->make, e->model,
- e->x, e->y, e->w, e->h,
+ e->x, e->y, e->w, e->h,
e->phys_width, e->phys_height,
e->refresh, e->subpixel_order,
e->transform))
}
end:
- if (!e_drm_output->ignore_hotplug_events)
- e_drm_output_screen_refresh_queue(EINA_TRUE);
return ECORE_CALLBACK_PASS_ON;
}
return strdup(model);
}
-EINTERN E_Drm_Output *
+EINTERN E_Output *
e_comp_drm_create(void)
{
Ecore_Drm_Device *dev;
Ecore_Drm_Output *output;
const Eina_List *l, *ll;
- E_Drm_Output *r = NULL;
+ E_Output *r = NULL;
- r = E_NEW(E_Drm_Output, 1);
+ r = E_NEW(E_Output, 1);
if (!r) return NULL;
EINA_LIST_FOREACH(ecore_drm_devices_get(), l, dev)
&s->config.mode.h,
&refresh);
s->config.mode.refresh = refresh;
- s->config.enabled =
+ s->config.enabled =
((s->config.mode.w != 0) && (s->config.mode.h != 0));
printf("COMP DRM: '%s' %i %i %ix%i\n", s->info.name,
s->config.geom.x, s->config.geom.y,
s->config.geom.w, s->config.geom.h);
+
}
/* TODO: are rotations possible ?? */
}
+ // TODO: assign s->plane_count
+ printf("COMP DRM: planes %i\n", s->plane_count);
+ for (j = 0; j < s->plane_count; j++)
+ {
+ printf("COMP DRM: added plane %i\n", j);
+ e_plane_new(s);
+ }
r->screens = eina_list_append(r->screens, s);
}
return EINA_TRUE;
}
+// TODO: will remove out after removing dependant e pkgs with E_Comp_Screen_Iface
EINTERN void
e_comp_drm_stub(void)
{}
int top_priority = 0;
/* TODO: what the actual fuck */
- nw = e_drm_output->w;
- nh = e_drm_output->h;
+ nw = e_output->w;
+ nh = e_output->h;
EINA_LIST_FOREACH(ecore_drm_devices_get(), l, dev)
{
ecore_drm_screen_size_range_get(dev, &minw, &minh, &maxw, &maxh);
printf("COMP DRM: set vsize: %ix%i\n", ww, hh);
- EINA_LIST_FOREACH(e_drm_output->screens, ll, s)
+ EINA_LIST_FOREACH(e_output->screens, ll, s)
{
Ecore_Drm_Output_Mode *mode = NULL;
printf("COMP DRM: find output for '%s'\n", s->info.name);
out = ecore_drm_device_output_name_find(dev, s->info.name);
if (!out) continue;
- if (s->config.configured)
- {
- printf("\tCOMP DRM: configured by E\n");
-
- if (s->config.enabled)
- {
- printf("\tCOMP DRM: Enabled\n");
- mode = _e_comp_drm_mode_screen_find(s, out);
- }
- else
- {
- printf("\tCOMP DRM: Disabled\n");
- }
-
- if (s->config.priority > top_priority)
- top_priority = s->config.priority;
+ mode = _e_comp_drm_mode_screen_find(s, out);
- printf("\tCOMP DRM: Priority: %d\n", s->config.priority);
+ if (s->config.priority > top_priority)
+ top_priority = s->config.priority;
- printf("\tCOMP DRM: Geom: %d %d %d %d\n",
- s->config.geom.x, s->config.geom.y,
- s->config.geom.w, s->config.geom.h);
+ printf("\tCOMP DRM: Priority: %d\n", s->config.priority);
- if (mode)
- {
- printf("\tCOMP DRM: Found Valid Drm Mode\n");
- printf("\t\tCOMP DRM: %dx%d\n", mode->width, mode->height);
- }
- else
- printf("\tCOMP DRM: No Valid Drm Mode Found\n");
+ printf("\tCOMP DRM: Geom: %d %d %d %d\n",
+ s->config.geom.x, s->config.geom.y,
+ s->config.geom.w, s->config.geom.h);
- ecore_drm_output_mode_set(out, mode,
- s->config.geom.x, s->config.geom.y);
- if (s->config.priority == top_priority)
- ecore_drm_output_primary_set(out);
+ if (mode)
+ {
+ printf("\tCOMP DRM: Found Valid Drm Mode\n");
+ printf("\t\tCOMP DRM: %dx%d\n", mode->width, mode->height);
+ }
+ else
+ printf("\tCOMP DRM: No Valid Drm Mode Found\n");
- if (s->config.enabled)
- ecore_drm_output_enable(out);
- else
- ecore_drm_output_disable(out);
+ ecore_drm_output_mode_set(out, mode,
+ s->config.geom.x, s->config.geom.y);
+ if (s->config.priority == top_priority)
+ ecore_drm_output_primary_set(out);
- printf("\tCOMP DRM: Mode\n");
- printf("\t\tCOMP DRM: Geom: %d %d\n",
- s->config.mode.w, s->config.mode.h);
- printf("\t\tCOMP DRM: Refresh: %f\n", s->config.mode.refresh);
- printf("\t\tCOMP DRM: Preferred: %d\n",
- s->config.mode.preferred);
+ ecore_drm_output_enable(out);
- }
+ printf("\tCOMP DRM: Mode\n");
+ printf("\t\tCOMP DRM: Geom: %d %d\n",
+ s->config.mode.w, s->config.mode.h);
+ printf("\t\tCOMP DRM: Refresh: %f\n", s->config.mode.refresh);
+ printf("\t\tCOMP DRM: Preferred: %d\n",
+ s->config.mode.preferred);
}
}
}
EINA_LIST_FOREACH(ecore_drm_devices_get(), l, dev)
{
- EINA_LIST_FOREACH(e_drm_output->screens, ll, s)
+ EINA_LIST_FOREACH(e_output->screens, ll, s)
{
out = ecore_drm_device_output_name_find(dev, s->info.name);
if (!out) continue;
- if ((!s->config.configured) || s->config.enabled)
- ecore_drm_output_dpms_set(out, set);
+ //if ((!s->config.configured) || s->config.enabled)
+ ecore_drm_output_dpms_set(out, set);
}
}
}
e_comp_drm_init()
{
E_Comp *comp;
- int w = 0, h = 0, scr_w = 0, scr_h = 0;
- const char *env_w, *env_h;
+ int w = 0, h = 0, scr_w = 1, scr_h = 1;
struct xkb_context *ctx = NULL;
struct xkb_keymap *map = NULL;
char buf[1024];
if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_OPENGL_DRM))
e_comp_gl_set(EINA_TRUE);
- env_w = getenv("E_SCREEN_WIDTH");
- if (env_w)
- {
- snprintf(buf, sizeof(buf), "%s", env_w);
- scr_w = atoi(buf);
- }
-
- env_h = getenv("E_SCREEN_HEIGHT");
- if (env_h)
- {
- snprintf(buf, sizeof(buf), "%s", env_h);
- scr_h = atoi(buf);
- }
-
- if (scr_w <= 0) scr_w = 1;
- if (scr_h <= 0) scr_h = 1;
-
- //DBG("GL available:%d config engine:%d screen size:%dx%d",
INF("GL available:%d config engine:%d screen size:%dx%d",
e_comp_gl_get(), e_comp_config_get()->engine, scr_w, scr_h);
ecore_evas_callback_resize_set(e_comp->ee, _e_comp_drm_cb_ee_resize);
+ //TODO: will be remove out
e_comp->screen = &drmiface;
+ e_main_ts("\tE_Output Init");
+ if (!e_output_init())
+ {
+ e_error_message_show(_("Enlightenment cannot initialize drm output!\n"));
+ TRACE_DS_END();
+ return EINA_FALSE;
+ }
+ e_output_screens_setup(-1, -1);
+ e_main_ts("\tE_Output Init Done");
+
e_main_ts("\tE_Comp_Wl Init");
if (!e_comp_wl_init())
{
{
/* shutdown ecore_drm */
/* ecore_drm_shutdown(); */
+ e_output_shutdown();
dont_set_ecore_drm_keymap = EINA_FALSE;
dont_use_xkb_cache = EINA_FALSE;
EINTERN Eina_Bool e_comp_drm_available(void);
EINTERN void e_comp_drm_stub(void);
EINTERN void e_comp_drm_apply(void);
-EINTERN E_Drm_Output * e_comp_drm_create(void);
+EINTERN E_Output * e_comp_drm_create(void);
EINTERN void e_comp_drm_dpms(int set);
E_API Eina_Bool e_comp_drm_init(void);
///////////////////////////////////////////
/* local subsystem functions */
-static void
-_e_output_free(E_Output *output)
-{
- E_Plane *ep;
- /* Delete the object event callbacks */
-
- /* remove planes */
- EINA_LIST_FREE(output->planes, ep)
- {
- if (!e_object_is_del(E_OBJECT(ep)))
- e_object_free(E_OBJECT(ep));
- }
- free(output);
-}
static tbm_surface_h
_e_comp_hwc_create_copied_surface(E_Client *ec, Eina_Bool refresh)
EINA_LIST_FOREACH(ecore_drm_devices_get(), l, dev)
{
- EINA_LIST_FOREACH(e_drm_output->screens, ll, s)
+ EINA_LIST_FOREACH(e_output->screens, ll, s)
{
ELOGF("HWC", "find output for '%s'", NULL, NULL, s->info.name);
}
}
-EINTERN Eina_Bool
-e_comp_hwc_plane_init(E_Zone *zone)
-{
- E_Comp_Hwc_Output *hwc_output = NULL;
- Ecore_Drm_Device *dev;
- Ecore_Drm_Output *drm_output;
- E_Output_Screen *s;
- const Eina_List *l, *ll;
- E_Output * eout = NULL;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(zone, EINA_FALSE);
-
- // TODO: canvas, zone shall match with one output
- EINA_LIST_FOREACH(ecore_drm_devices_get(), l, dev)
- {
- EINA_LIST_FOREACH(e_drm_output->screens, ll, s)
- {
- int len;
-
- if (!s->config.enabled) continue;
-
- drm_output = ecore_drm_device_output_name_find(dev, s->info.name);
- if (!drm_output) continue;
-
- len = strlen(zone->randr2_id);
- if (strncmp(s->info.name, zone->randr2_id, len -1) != 0) continue;
- // DSI-0/(randr2_id) DSI-0(s->info.name)
-
- hwc_output = _e_comp_hwc_output_find(drm_output);
- if (hwc_output) break;
- }
- }
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_output, EINA_FALSE);
- eout = e_output_new(zone);
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(eout, EINA_FALSE);
- zone->output = eout;
-
- for (int i = 0; i < hwc_output->num_layers; i++)
- {
- e_plane_new(eout);
- }
-
- return EINA_TRUE;
-}
-
-E_API E_Output *
-e_output_new(E_Zone *zone)
-{
- E_Output *output;
-
- if (!zone) return NULL;
-
- output = E_OBJECT_ALLOC(E_Output, E_OUTPUT_TYPE, _e_output_free);
- if (!output) return NULL;
-
- output->zone = zone;
- output->geom.x = zone->x;
- output->geom.y = zone->y;
- output->geom.w = zone->w;
- output->geom.h = zone->h;
- output->plane_count = 0;
-
- return output;
-}
-
-E_API Eina_Bool
-e_output_planes_clear(E_Output * output)
-{
- Eina_List *l, *ll;
- E_Plane *ep;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(output->planes, EINA_FALSE);
-
- EINA_LIST_FOREACH_SAFE(output->planes, l, ll, ep)
- {
- ep->ec = NULL;
- }
- return EINA_TRUE;
-}
-
-E_API Eina_Bool
-e_output_planes_set(E_Output * output, E_Hwc_Mode mode, Eina_List* clist)
-{
- Eina_List *l_p, *l_ec;
- Eina_List *l, *ll;
- E_Plane *ep;
- int num_c;
-
- num_c = eina_list_count(clist);
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(output->planes, EINA_FALSE);
- if ((num_c > output->plane_count) ||
- (num_c < 1))
- return EINA_FALSE;
-
- l_p = output->planes;
- l_ec = clist;
- if ((mode == E_HWC_MODE_COMPOSITE) ||
- (mode == E_HWC_MODE_HWC_COMPOSITE))
- {
- ep = eina_list_data_get(l_p);
- if (ep) ep->ec = NULL; // 1st plane is assigned for e_comp->evas
- l_p = eina_list_next(l_p);
- }
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(l_p, EINA_FALSE);
- EINA_LIST_FOREACH_SAFE(l_p, l, ll, ep)
- {
- E_Client *ec = NULL;
-
- if (!l_ec) break;
- ec = eina_list_data_get(l_ec);
-
- if(ec)
- {
- ep->ec = ec;
- }
- l_ec = eina_list_next(l_ec);
- }
-
- return EINA_TRUE;
-}
-
-E_API Eina_Bool
-e_output_update(E_Output * output)
-{
-
- Eina_List *l, *ll;
- E_Plane *ep;
- E_Client *ec;
- EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(output->planes, EINA_FALSE);
-
- EINA_LIST_FOREACH_SAFE(output->planes, l, ll, ep)
- {
- ec = ep->ec;
- if (ec) INF("HWC:\t|---\t %s 0x%08x\n", ec->icccm.title, (unsigned int)ec->frame);
- }
-
- // TODO: hwc mode change
- return EINA_FALSE; // SHALL BE EINA_TRUE after hwc multi plane implementation
-}
#else /* HAVE_HWC */
EINTERN Eina_Bool
e_comp_hwc_init(void)
;
}
-EINTERN Eina_Bool
-e_comp_hwc_plane_init(E_Zone *zone)
-{
- return EINA_TRUE;
-}
-
-E_API E_Output *
-e_output_new(E_Zone *zone)
-{
- return NULL;
-}
-
-E_API Eina_Bool
-e_output_planes_clear(E_Output * output)
-{
- return EINA_FALSE;
-}
-
-E_API Eina_Bool
-e_output_planes_set(E_Output * output, E_Hwc_Mode mode, Eina_List* clist)
-{
- return EINA_FALSE;
-}
-
-E_API Eina_Bool
-e_output_update(E_Output * output)
-{
- return EINA_FALSE;
-}
#endif /* endo of HAVE_HWC */
#ifdef E_TYPEDEFS
-typedef struct _E_Output E_Output;
-
#else
# ifndef E_COMP_HWC_H
# define E_COMP_HWC_H
-#define E_OUTPUT_TYPE (int)0xE0b11002
-
typedef enum _E_Hwc_Mode
{
E_HWC_MODE_COMPOSITE = 1, /* display only canvas */
E_HWC_MODE_INVALID
} E_Hwc_Mode;
-struct _E_Output
-{
- E_Object e_obj_inherit;
-
- Eina_Rectangle geom;
- Eina_List *planes;
- int plane_count;
-
- E_Zone *zone;
-};
-
EINTERN Eina_Bool e_comp_hwc_init(void);
EINTERN void e_comp_hwc_shutdown(void);
EINTERN Eina_Bool e_comp_hwc_mode_nocomp(E_Client *ec);
EINTERN void e_comp_hwc_trace_debug(Eina_Bool onoff);
Eina_Bool e_comp_hwc_native_surface_set(E_Client *ec);
void e_comp_hwc_client_commit(E_Client *ec);
-
-EINTERN Eina_Bool e_comp_hwc_plane_init(E_Zone *zone);
-
-E_API E_Output * e_output_new(E_Zone *zone);
-E_API Eina_Bool e_output_planes_clear(E_Output * output);
-E_API Eina_Bool e_output_planes_set(E_Output * output, E_Hwc_Mode mode, Eina_List* clist);
-E_API Eina_Bool e_output_update(E_Output * output);
-
# endif
#endif
E_Output_Screen *screen;
unsigned int transform = WL_OUTPUT_TRANSFORM_NORMAL;
- if (!e_drm_output) return ECORE_CALLBACK_RENEW;
+ if (!e_output) return ECORE_CALLBACK_RENEW;
- EINA_LIST_FOREACH(e_drm_output->screens, l, screen)
+ EINA_LIST_FOREACH(e_output->screens, l, screen)
{
if (!screen->config.enabled)
{
e_comp_wl_tbm_init();
#endif
- if (!e_drm_output_init())
- {
- e_error_message_show(_("Enlightenment cannot initialize drm output!\n"));
- TRACE_DS_END();
- return EINA_FALSE;
- }
-
- e_drm_output_screens_setup(-1, -1);
-
/* add event handlers to catch E events */
E_LIST_HANDLER_APPEND(handlers, E_EVENT_SCREEN_CHANGE, _e_comp_wl_cb_randr_change, NULL);
E_LIST_HANDLER_APPEND(handlers, E_EVENT_COMP_OBJECT_ADD, _e_comp_wl_cb_comp_object_add, NULL);
#include "e_place.h"
#include "e_resist.h"
#include "e_signals.h"
-#include "e_xinerama.h"
#include "e_layout.h"
#include "e_theme.h"
#include "e_dnd.h"
e_screensaver_preinit();
e_zone_init();
e_desk_init();
- e_plane_init();
TRACE_DS_BEGIN(MAIN:SCREEN INIT);
TS("Screens Init");
i++;
e_util_env_set("DISPLAY", argv[i]);
}
- else if ((!strcmp(argv[i], "-fake-xinerama-screen")) && (i < (argc - 1)))
- {
- int x, y, w, h;
-
- i++;
- if (sscanf(argv[i], "%ix%i+%i+%i", &w, &h, &x, &y) == 4)
- e_xinerama_fake_screen_add(x, y, w, h);
- }
else if (!strcmp(argv[i], "-good"))
{
good = EINA_TRUE;
e_comp_shutdown();
e_client_shutdown();
- e_plane_shutdown();
e_desk_shutdown();
e_zone_shutdown();
return 1;
/////////////////////////////////////////////////////////////////////////
-static void _animated_apply_abort(void);
-static Eina_Bool _cb_delay_timer(void *data);
-static Eina_Bool _cb_fade_animator(void *data);
-static void _animated_apply(void);
static void _do_apply(void);
-static void _info_free(E_Drm_Output *r);
-static char *_screens_fingerprint(E_Drm_Output *r);
-static Eina_Bool _screens_differ(E_Drm_Output *r1, E_Drm_Output *r2);
-static Eina_Bool _cb_screen_change_delay(void *data);
-static void _screen_config_takeover(void);
+static void _info_free(E_Output *r);
static void _screen_config_eval(void);
static void _screen_config_maxsize(void);
/////////////////////////////////////////////////////////////////////////
-static Eina_List *_ev_handlers = NULL;
-static Ecore_Timer *_screen_delay_timer = NULL;
-static Eina_Bool event_screen = EINA_FALSE;
-static Eina_Bool event_ignore = EINA_FALSE;
+E_API E_Output *e_output = NULL;
-/////////////////////////////////////////////////////////////////////////
-
-E_API E_Drm_Output *e_drm_output = NULL;
-
-E_API int E_EVENT_RANDR_CHANGE = 0;
E_API int E_EVENT_SCREEN_CHANGE = 0;
+static Eina_List *all_screens = NULL; // e_screen list
+
/////////////////////////////////////////////////////////////////////////
EINTERN Eina_Bool
-e_drm_output_init(void)
+e_output_init(void)
{
if (!E_EVENT_SCREEN_CHANGE) E_EVENT_SCREEN_CHANGE = ecore_event_type_new();
if (!e_comp_drm_available()) return EINA_FALSE;
}
EINTERN int
-e_drm_output_shutdown(void)
+e_output_shutdown(void)
{
- _animated_apply_abort();
- // nuke any screen config delay handler
- if (_screen_delay_timer) ecore_timer_del(_screen_delay_timer);
- _screen_delay_timer = NULL;
- // clear up all event handlers
- E_FREE_LIST(_ev_handlers, ecore_event_handler_del);
// free up screen info
- _info_free(e_drm_output);
- e_drm_output = NULL;
+ _info_free(e_output);
+ e_output = NULL;
return 1;
}
-E_API void
-e_drm_output_config_apply(void)
-{
- _animated_apply();
-}
-
-E_API void
-e_drm_output_screeninfo_update(void)
-{
- // re-fetch/update current screen info
- _info_free(e_drm_output);
- e_drm_output = e_comp_drm_create();
- _screen_config_maxsize();
-}
-
/////////////////////////////////////////////////////////////////////////
-static double _start_time = 0.0;
-static Ecore_Animator *_fade_animator = NULL;
-static Ecore_Timer *_apply_delay = NULL;
-Eina_Bool _applying = EINA_FALSE;
-static int _target_from = 0;
-static int _target_to = 0;
-static Evas_Object *_fade_obj = NULL;
-
-static void
-_animated_apply_abort(void)
-{
- if (_apply_delay) ecore_timer_del(_apply_delay);
- if (_fade_animator) ecore_animator_del(_fade_animator);
- _apply_delay = NULL;
- _fade_animator = NULL;
- _applying = EINA_FALSE;
- _fade_obj = NULL;
-}
-
-static Eina_Bool
-_cb_delay_timer(void *data EINA_UNUSED)
-{
- _apply_delay = NULL;
- _target_from = 255;
- _target_to = 0;
- _start_time = ecore_loop_time_get();
- _fade_animator = ecore_animator_add(_cb_fade_animator, NULL);
- return EINA_FALSE;
-}
-
-static Eina_Bool
-_cb_fade_animator(void *data EINA_UNUSED)
-{
- double t = ecore_loop_time_get() - _start_time;
- int v;
-
- t = t / 0.5;
- if (t < 0.0) t = 0.0;
- v = _target_from + ((_target_to - _target_from) * t);
- if (t >= 1.0) v = _target_to;
- evas_object_color_set(_fade_obj, 0, 0, 0, v);
- if (v == _target_to)
- {
- if (_target_to == 255)
- {
- _apply_delay = ecore_timer_add(3.0, _cb_delay_timer, NULL);
- _do_apply();
- }
- else
- {
- evas_object_del(_fade_obj);
- _fade_obj = NULL;
- _applying = EINA_FALSE;
- }
- _fade_animator = NULL;
- return EINA_FALSE;
- }
- return EINA_TRUE;
-}
-
-static void
-_animated_apply(void)
-{
- Evas *e;
-
- // fade out, config, wait 3 seconds, fade back in
- if (_applying) return;
- _applying = EINA_TRUE;
- _start_time = ecore_loop_time_get();
- e = e_comp->evas;
- _fade_obj = evas_object_rectangle_add(e);
- evas_object_pass_events_set(_fade_obj, EINA_TRUE);
- evas_object_color_set(_fade_obj, 0, 0, 0, 0);
- evas_object_move(_fade_obj, 0, 0);
- evas_object_resize(_fade_obj, 999999, 999999);
- evas_object_layer_set(_fade_obj, EVAS_LAYER_MAX);
- evas_object_show(_fade_obj);
- _target_from = 0;
- _target_to = 255;
- _fade_animator = ecore_animator_add(_cb_fade_animator, NULL);
-}
static void
_do_apply(void)
{
// take current screen config and apply it to the driver
printf("OUTPUT: re-get info before applying..\n");
- _info_free(e_drm_output);
- e_drm_output = e_comp_drm_create();
+ _info_free(e_output);
+ e_output = e_comp_drm_create();
_screen_config_maxsize();
- printf("OUTPUT: takeover config...\n");
- _screen_config_takeover();
printf("OUTPUT: eval config...\n");
_screen_config_eval();
printf("OUTPUT: really apply config...\n");
}
static void
-_info_free(E_Drm_Output *r)
+_info_free(E_Output *r)
{
E_Output_Screen *s;
E_Output_Mode *m;
+ E_Plane *ep;
if (!r) return;
- // free up our randr screen data
+ // free up our output screen data
EINA_LIST_FREE(r->screens, s)
{
free(s->id);
free(s->info.name);
free(s->info.edid);
EINA_LIST_FREE(s->info.modes, m) free(m);
+ EINA_LIST_FREE(s->planes, ep) e_plane_free(ep);
free(s);
}
free(r);
}
-static char *
-_screens_fingerprint(E_Drm_Output *r)
-{
- Eina_List *l;
- E_Output_Screen *s;
- Eina_Strbuf *buf;
- char *str;
-
- buf = eina_strbuf_new();
- if (!buf) return NULL;
- EINA_LIST_FOREACH(r->screens, l, s)
- {
- if (!s->id) eina_strbuf_append(buf, ":NULL:");
- else
- {
- eina_strbuf_append(buf, ":");
- eina_strbuf_append(buf, s->id);
- eina_strbuf_append(buf, ":");
- eina_strbuf_append(buf, ":LO:");
- }
- }
- str = eina_strbuf_string_steal(buf);
- eina_strbuf_free(buf);
- return str;
-}
-
-static Eina_Bool
-_screens_differ(E_Drm_Output *r1, E_Drm_Output *r2)
-{
- char *s1, *s2;
- Eina_Bool changed = EINA_FALSE;
- Eina_List *l, *ll;
- E_Output_Screen *s, *ss;
-
- // check monitor outputs and edids, plugged in things
- s1 = _screens_fingerprint(r1);
- s2 = _screens_fingerprint(r2);
- if ((!s1) && (!s2)) return EINA_FALSE;
- printf("OUTPUT: check fingerprint...\n");
- if ((s1) && (s2) && (strcmp(s1, s2))) changed = EINA_TRUE;
- printf("OUTPUT: ... fingerprint says %i\n", changed);
- free(s1);
- free(s2);
- // check screen config
- EINA_LIST_FOREACH(r2->screens, l, s)
- {
- if (!s->id) continue;
- EINA_LIST_FOREACH(r2->screens, ll, ss)
- {
- if ((ss->id) && (!strcmp(s->id, ss->id))) break;
- ss = NULL;
- }
- if (!ss) changed = EINA_TRUE;
- else if ((s->config.geom.x != ss->config.geom.x) ||
- (s->config.geom.y != ss->config.geom.y) ||
- (s->config.geom.w != ss->config.geom.w) ||
- (s->config.geom.h != ss->config.geom.h) ||
- (s->config.mode.w != ss->config.mode.w) ||
- (s->config.mode.h != ss->config.mode.h) ||
- (s->config.enabled != ss->config.enabled))
- changed = EINA_TRUE;
- }
- printf("OUTPUT: changed = %i\n", changed);
- return changed;
-}
-
-static Eina_Bool
-_cb_screen_change_delay(void *data EINA_UNUSED)
-{
- _screen_delay_timer = NULL;
- printf("OUTPUT: ... %i %i\n", event_screen, event_ignore);
- // if we had a screen plug/unplug etc. event and we shouldnt ignore it...
- if ((event_screen) && (!event_ignore))
- {
- E_Drm_Output *rtemp;
- Eina_Bool change = EINA_FALSE;
-
- printf("OUTPUT: reconfigure screens due to event...\n");
- rtemp = e_comp_drm_create();
- if (rtemp)
- {
- if (_screens_differ(e_drm_output, rtemp)) change = EINA_TRUE;
- _info_free(rtemp);
- }
- printf("OUTPUT: change = %i\n", change);
- // we plugged or unplugged some monitor - re-apply config so
- // known screens can be configured
- if (change) e_drm_output_config_apply();
- }
- // update screen info after the above apply or due to external changes
- e_drm_output_screeninfo_update();
- e_comp_canvas_resize(e_drm_output->w, e_drm_output->h);
- e_drm_output_screens_setup(e_comp->w, e_comp->h);
- e_comp_canvas_update();
- // tell the rest of e some screen reconfigure thing happened
- ecore_event_add(E_EVENT_SCREEN_CHANGE, NULL, NULL, NULL);
- event_screen = EINA_FALSE;
- event_ignore = EINA_FALSE;
- return EINA_FALSE;
-}
-
-static void
-_screen_config_takeover(void)
-{
- Eina_List *l;
- E_Output_Screen *s;
- EINA_LIST_FOREACH(e_drm_output->screens, l, s)
- {
- s->config.configured = EINA_TRUE;
- s->config.enabled = EINA_TRUE;
- }
-}
-
static void
_screen_config_eval(void)
{
maxx = -65536;
maxy = -65536;
- EINA_LIST_FOREACH(e_drm_output->screens, l, s)
+ EINA_LIST_FOREACH(e_output->screens, l, s)
{
if (!s->config.enabled) continue;
if (s->config.geom.x < minx) minx = s->config.geom.x;
s->config.geom.w, s->config.geom.h);
}
printf("OUTPUT:--- %i %i -> %i %i\n", minx, miny, maxx, maxy);
- EINA_LIST_FOREACH(e_drm_output->screens, l, s)
+ EINA_LIST_FOREACH(e_output->screens, l, s)
{
s->config.geom.x -= minx;
s->config.geom.y -= miny;
}
- e_drm_output->w = maxx - minx;
- e_drm_output->h = maxy - miny;
+ e_output->w = maxx - minx;
+ e_output->h = maxy - miny;
}
static void
maxx = -65536;
maxy = -65536;
- EINA_LIST_FOREACH(e_drm_output->screens, l, s)
+ EINA_LIST_FOREACH(e_output->screens, l, s)
{
if (!s->config.enabled) continue;
if ((s->config.geom.x + s->config.geom.w) > maxx)
s->config.geom.w, s->config.geom.h);
}
printf("OUTPUT: result max: %ix%i\n", maxx, maxy);
- e_drm_output->w = maxx;
- e_drm_output->h = maxy;
+ e_output->w = maxx;
+ e_output->h = maxy;
}
static int
return dif;
}
-E_API void
-e_drm_output_screen_refresh_queue(Eina_Bool lid_event)
-{
- // delay handling of screen shances as they can come in in a series over
- // time and thus we can batch up responding to them by waiting 1.0 sec
- if (_screen_delay_timer)
- ecore_timer_reset(_screen_delay_timer);
- else
- _screen_delay_timer = ecore_timer_add(1.0, _cb_screen_change_delay, NULL);
- event_screen |= !!lid_event;
+static void
+_escreen_free(E_Screen *scr)
+{
+ free(scr->id);
+ free(scr);
+}
+
+void
+_escreens_set(Eina_List *screens)
+{
+ E_FREE_LIST(all_screens, _escreen_free);
+ all_screens = screens;
}
E_API void
-e_drm_output_screens_setup(int rw, int rh)
+e_output_screens_setup(int rw, int rh)
{
int i;
E_Screen *screen;
Eina_List *screens = NULL, *screens_rem;
- Eina_List *all_screens = NULL;
+ Eina_List *e_screens = NULL;
Eina_List *l, *ll;
E_Output_Screen *s, *s2, *s_chosen;
Eina_Bool removed;
- if ((!e_drm_output) || (!e_drm_output->screens)) goto out;
+ if ((!e_output) || (!e_output->screens)) goto out;
// put screens in tmp list
- EINA_LIST_FOREACH(e_drm_output->screens, l, s)
+ EINA_LIST_FOREACH(e_output->screens, l, s)
{
if ((s->config.enabled) &&
(s->config.geom.w > 0) &&
screen->h = s->config.geom.h;
if (s->id) screen->id = strdup(s->id);
- all_screens = eina_list_append(all_screens, screen);
- printf("xinerama screen %i %i %ix%i\n", screen->x, screen->y, screen->w, screen->h);
- INF("E INIT: XINERAMA SCREEN: [%i][%i], %ix%i+%i+%i",
+ e_screens = eina_list_append(e_screens, screen);
+ INF("E INIT: SCREEN: [%i][%i], %ix%i+%i+%i",
i, i, screen->w, screen->h, screen->x, screen->y);
i++;
}
// laptop lid), in which case as long as at least one screen is configured
// in xinerama, it will be left-as is until next time we re-eval screen
// setup and have at least one screen
- printf("xinerama setup............... %i %p\n", i, e_xinerama_screens_all_get());
- if ((i == 0) && (!e_xinerama_screens_all_get()))
+ printf("e_output_screens_setup............... %i %p\n", i, all_screens);
+ if ((i == 0) && (!all_screens))
{
out:
screen = E_NEW(E_Screen, 1);
screen->w = rw, screen->h = rh;
else
ecore_evas_screen_geometry_get(e_comp->ee, NULL, NULL, &screen->w, &screen->h);
- all_screens = eina_list_append(all_screens, screen);
+ e_screens = eina_list_append(e_screens, screen);
+ }
+ _escreens_set(e_screens);
+}
+
+E_API const Eina_List *
+e_output_screens_get(void)
+{
+ return all_screens;
+}
+
+EINTERN E_Output_Screen *
+e_output_screen_id_find(const char *id)
+{
+ E_Output_Screen *s;
+ Eina_List *l;
+ EINA_LIST_FOREACH(e_output->screens, l, s)
+ {
+ if (!strcmp(s->id, id)) return s;
+ }
+ return NULL;
+}
+
+E_API Eina_Bool
+e_output_planes_clear(E_Output_Screen * screen)
+{
+ Eina_List *l, *ll;
+ E_Plane *ep;
+ INF("HWC : %s\n",__FUNCTION__);
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(screen, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(screen->planes, EINA_FALSE);
+
+ EINA_LIST_FOREACH_SAFE(screen->planes, l, ll, ep)
+ {
+ ep->ec = NULL;
+ }
+ return EINA_TRUE;
+}
+
+E_API Eina_Bool
+e_output_planes_set(E_Output_Screen * screen, E_Hwc_Mode mode, Eina_List* clist)
+{
+ Eina_List *l_p, *l_ec;
+ Eina_List *l, *ll;
+ E_Plane *ep;
+ int num_c;
+ INF("HWC : %s\n",__FUNCTION__);
+
+ num_c = eina_list_count(clist);
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(screen, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(screen->planes, EINA_FALSE);
+ if ((num_c > screen->plane_count) ||
+ (num_c < 1))
+ return EINA_FALSE;
+
+ l_p = screen->planes;
+ l_ec = clist;
+ if ((mode == E_HWC_MODE_COMPOSITE) ||
+ (mode == E_HWC_MODE_HWC_COMPOSITE))
+ {
+ ep = eina_list_data_get(l_p);
+ if (ep) ep->ec = NULL; // 1st plane is assigned for e_comp->evas
+ l_p = eina_list_next(l_p);
+ }
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(l_p, EINA_FALSE);
+ EINA_LIST_FOREACH_SAFE(l_p, l, ll, ep)
+ {
+ E_Client *ec = NULL;
+
+ if (!l_ec) break;
+ ec = eina_list_data_get(l_ec);
+
+ if(ec)
+ {
+ ep->ec = ec;
+ }
+ l_ec = eina_list_next(l_ec);
}
- e_xinerama_screens_set(all_screens);
+
+ return EINA_TRUE;
+}
+
+E_API Eina_Bool
+e_output_update(E_Output_Screen * screen)
+{
+ Eina_List *l, *ll;
+ E_Plane *ep;
+ E_Client *ec;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(screen, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(screen->planes, EINA_FALSE);
+
+ EINA_LIST_FOREACH_SAFE(screen->planes, l, ll, ep)
+ {
+ ec = ep->ec;
+ if (ec) INF("HWC:\t|---\t %s 0x%08x\n", ec->icccm.title, (unsigned int)ec->frame);
+ }
+
+ // TODO: hwc mode change
+ return EINA_FALSE; // SHALL BE EINA_TRUE after hwc multi plane implementation
}
#ifdef E_TYPEDEFS
-typedef struct _E_Drm_Output E_Drm_Output;
+//typedef struct _E_Output E_Output;
+typedef struct _E_Output E_Output;
typedef struct _E_Output_Screen E_Output_Screen;
typedef struct _E_Output_Mode E_Output_Mode;
+typedef struct _E_Screen E_Screen;
#else
#ifndef E_OUTPUT_H
#define E_OUTPUT_H
-struct _E_Drm_Output
+#define E_OUTPUT_TYPE (int)0xE0b11002
+
+struct _E_Output
{
Eina_List *screens; // available screens
int w, h; // virtual resolution needed for screens (calculated)
unsigned char ignore_hotplug_events;
- unsigned char ignore_acpi_events;
+ unsigned char ignore_acpi_events;
};
struct _E_Output_Mode
{
char *id; // string id which is "name/edid";
struct {
- char *screen; // name of the screen device attached
- char *name; // name of the output itself
- char *edid; // full edid data
- Eina_Bool connected : 1; // some screen is plugged in or not
- Eina_List *modes; // available screen modes here
- struct {
- int w, h; // physical width and height in mm
- } size;
+ char *screen; // name of the screen device attached
+ char *name; // name of the output itself
+ char *edid; // full edid data
+ Eina_Bool connected : 1; // some screen is plugged in or not
+ Eina_List *modes; // available screen modes here
+ struct {
+ int w, h; // physical width and height in mm
+ } size;
} info;
struct {
- Eina_Rectangle geom; // the geometry that is set (as a result)
- E_Output_Mode mode; // screen res/refresh to use
- int rotation; // 0, 90, 180, 270
- int priority; // larger num == more important
- Eina_Bool enabled : 1; // should this monitor be enabled?
- Eina_Bool configured : 1; // has screen been configured by e?
+ Eina_Rectangle geom; // the geometry that is set (as a result)
+ E_Output_Mode mode; // screen res/refresh to use
+ int rotation; // 0, 90, 180, 270
+ int priority; // larger num == more important
+ Eina_Bool enabled : 1; // should this monitor be enabled?
} config;
- Eina_List *planes;
+
int plane_count;
+ Eina_List *planes;
E_Zone *zone;
};
-extern E_API E_Drm_Output *e_drm_output;
+struct _E_Screen
+{
+ int screen, escreen;
+ int x, y, w, h;
+ char *id; // this is the same id we get from _E_Output_Screen so look it up there
+};
+
+extern E_API E_Output *e_output;
extern E_API int E_EVENT_SCREEN_CHANGE;
-extern E_API int E_EVENT_RANDR_CHANGE; // x randr
-EINTERN Eina_Bool e_drm_output_init(void);
-EINTERN int e_drm_output_shutdown(void);
-E_API void e_drm_output_config_apply(void);
-E_API void e_drm_output_screeninfo_update(void);
-E_API void e_drm_output_screen_refresh_queue(Eina_Bool lid_event);
-E_API void e_drm_output_screens_setup(int rw, int rh);
+EINTERN Eina_Bool e_output_init(void);
+EINTERN int e_output_shutdown(void);
+EINTERN E_Output_Screen * e_output_screen_new(E_Zone *zone, int nlayer);
+E_API void e_output_screens_setup(int rw, int rh);
+E_API const Eina_List * e_output_screens_get(void);
+EINTERN E_Output_Screen * e_output_screen_id_find(const char *id);
+E_API Eina_Bool e_output_planes_clear(E_Output_Screen * screen);
+E_API Eina_Bool e_output_planes_set(E_Output_Screen * screen, E_Hwc_Mode mode, Eina_List* clist);
+E_API Eina_Bool e_output_update(E_Output_Screen * screen);
#endif
#endif
#include "e.h"
-/* E_Plane is a child object of E_Output. There is one Output per screen
+/* E_Plane is a child object of E_Output_Screen. There is one Output per screen
* E_plane represents hw overlay and a surface is assigned to disable composition
* Each Output always has dedicated canvas and a zone
*/
/* local subsystem functions */
static void
-_e_plane_free(E_Plane *plane)
-{
- //printf("@@@@@@@@@@ e_plane_free: %i %i | %i %i %ix%i = %p\n", zone->num, zone->id, zone->x, zone->y, zone->w, zone->h, zone);
-
- if (!plane) return;
- if (plane->output) plane->output->plane_count--;
-
- /* remove handlers */
- E_FREE_LIST(plane->handlers, ecore_event_handler_del);
-
- if (plane->name) eina_stringshare_del(plane->name);
-
- free(plane);
-}
-
-static void
_e_plane_reconfigure_clients(E_Plane *plane, int dx, int dy, int dw, int dh)
{
EINA_SAFETY_ON_NULL_RETURN(plane->ec);
}
///////////////////////////////////////////
-
+/*
EINTERN int
e_plane_init(void)
{
{
return 1;
}
+*/
+E_API void
+e_plane_free(E_Plane *plane)
+{
+ //printf("@@@@@@@@@@ e_plane_free: %i %i | %i %i %ix%i = %p\n", zone->num, zone->id, zone->x, zone->y, zone->w, zone->h, zone);
+
+ if (!plane) return;
+ if (plane->name) eina_stringshare_del(plane->name);
+
+ free(plane);
+}
E_API E_Plane *
-e_plane_new(E_Output *output)
+e_plane_new(E_Output_Screen *screen)
{
E_Plane *plane;
char name[40];
- if (!output) return NULL;
+ if (!screen) return NULL;
- plane = E_OBJECT_ALLOC(E_Plane, E_PLANE_TYPE, _e_plane_free);
+ //plane = E_OBJECT_ALLOC(E_Plane, E_PLANE_TYPE, _e_plane_free);
+ plane = E_NEW(E_Plane, 1);
if (!plane) return NULL;
+ printf("%s 2", __FUNCTION__);
- snprintf(name, sizeof(name), "Plane %d", output->zone->num);
+ snprintf(name, sizeof(name), "Plane %s", screen->id);
plane->name = eina_stringshare_add(name);
plane->type = E_PLANE_TYPE_INVALID;
- plane->output = output;
+ plane->screen = screen;
/* config default resolution with output size*/
- plane->resolution.x = output->geom.x;
- plane->resolution.y = output->geom.y;
- plane->resolution.w = output->geom.w;
- plane->resolution.h = output->geom.h;
+ plane->resolution.x = screen->config.geom.x;
+ plane->resolution.y = screen->config.geom.y;
+ plane->resolution.w = screen->config.geom.w;
+ plane->resolution.h = screen->config.geom.h;
- output->planes = eina_list_append(output->planes, plane);
- output->plane_count++;
+ screen->planes = eina_list_append(screen->planes, plane);
- printf("@@@@@@@@@@ e_plane_new: %s | %i %i %ix%i = %p\n", output->zone->randr2_id, plane->resolution.x , plane->resolution.y, plane->resolution.w, plane->resolution.h, output);
+ printf("@@@@@@@@@@ e_plane_new:| %i %i %ix%i\n", plane->resolution.x , plane->resolution.y, plane->resolution.w, plane->resolution.h);
return plane;
}
struct _E_Plane
{
- E_Object e_obj_inherit;
-
struct
- {
- int x, y, w, h; // FIXME
- } resolution;
-
- const char *name;
- E_Plane_Type_State type;
- E_Client *ec;
- Eina_List *handlers;
-
- E_Output *output;
+ {
+ int x, y, w, h; // FIXME
+ } resolution;
+
+ const char *name;
+ E_Plane_Type_State type;
+ E_Client *ec;
+ E_Output_Screen *screen;
};
extern E_API int E_EVENT_PLANE_ADD;
EINTERN int e_plane_init(void);
EINTERN int e_plane_shutdown(void);
-E_API E_Plane * e_plane_new(E_Output *zone);
+E_API E_Plane * e_plane_new(E_Output_Screen *screen);
+E_API void e_plane_free(E_Plane *plane);
E_API Eina_Bool e_plane_resolution_set(E_Plane *plane, int x, int y, int w, int h);
E_API void e_plane_type_set(E_Plane *plane, E_Plane_Type_State type);
E_API E_Plane_Type_State e_plane_type_get(E_Plane *plane);
+++ /dev/null
-#include "e.h"
-
-static void _e_xinerama_clean(void);
-static void _e_xinerama_update(void);
-static int _e_xinerama_cb_screen_sort(const void *data1, const void *data2);
-
-static Eina_List *all_screens = NULL;
-static Eina_List *chosen_screens = NULL;
-static Eina_List *fake_screens = NULL;
-
-static void
-_screen_free(E_Screen *scr)
-{
- free(scr->id);
- free(scr);
-}
-
-EINTERN int
-e_xinerama_init(void)
-{
- return 1;
-}
-
-EINTERN int
-e_xinerama_shutdown(void)
-{
- _e_xinerama_clean();
- return 1;
-}
-
-E_API void
-e_xinerama_update(void)
-{
- _e_xinerama_clean();
- _e_xinerama_update();
-}
-
-E_API const Eina_List *
-e_xinerama_screens_get(void)
-{
- if (fake_screens) return fake_screens;
- return chosen_screens;
-}
-
-E_API const Eina_List *
-e_xinerama_screens_all_get(void)
-{
- if (fake_screens) return fake_screens;
- return all_screens;
-}
-
-E_API void
-e_xinerama_screens_set(Eina_List *screens)
-{
- E_FREE_LIST(all_screens, _screen_free);
- chosen_screens = eina_list_free(chosen_screens);
- all_screens = screens;
- _e_xinerama_update();
-}
-
-E_API void
-e_xinerama_fake_screen_add(int x, int y, int w, int h)
-{
- E_Screen *scr;
-
- scr = E_NEW(E_Screen, 1);
- scr->screen = eina_list_count(fake_screens);
- scr->escreen = scr->screen;
- scr->x = x;
- scr->y = y;
- scr->w = w;
- scr->h = h;
- fake_screens = eina_list_append(fake_screens, scr);
-}
-
-E_API Eina_Bool
-e_xinerama_fake_screens_exist(void)
-{
- return !!fake_screens;
-}
-
-/* local subsystem functions */
-static void
-_e_xinerama_clean(void)
-{
- E_FREE_LIST(all_screens, _screen_free);
- chosen_screens = eina_list_free(chosen_screens);
- E_FREE_LIST(fake_screens, _screen_free);
-}
-
-static void
-_e_xinerama_update(void)
-{
- Eina_List *l;
- E_Screen *scr;
- unsigned int n = 0;
-
- /* now go through all_screens... and build a list of chosen screens */
- EINA_LIST_FOREACH(all_screens, l, scr)
- {
- Eina_List *ll;
- E_Screen *scr2;
- int add = 1;
- Eina_List *removes;
-
- removes = NULL;
- /* does this screen intersect with any we have chosen? */
- EINA_LIST_FOREACH(chosen_screens, ll, scr2)
- {
- /* if they intersect */
- if (E_INTERSECTS(scr->x, scr->y, scr->w, scr->h,
- scr2->x, scr2->y, scr2->w, scr2->h))
- {
- int sz, sz2;
-
- /* calculate pixel area */
- sz = scr->w * scr->h;
- sz2 = scr2->w * scr2->h;
- /* if the one we already have is bigger, DON'T add the new */
- if (sz > sz2)
- removes = eina_list_append(removes, scr2);
- /* add the old to a list to remove */
- else
- add = 0;
- }
- }
- /* if there are screens to remove - remove them */
- EINA_LIST_FREE(removes, scr2)
- {
- chosen_screens = eina_list_remove(chosen_screens, scr2);
- }
- /* if this screen is to be added, add it */
- if (add)
- chosen_screens = eina_list_append(chosen_screens, scr);
- }
- chosen_screens = eina_list_sort(chosen_screens,
- eina_list_count(chosen_screens),
- _e_xinerama_cb_screen_sort);
- INF("======================= screens:");
- EINA_LIST_FOREACH(chosen_screens, l, scr)
- {
- INF("E INIT: XINERAMA CHOSEN: [%i][%i], %ix%i+%i+%i",
- scr->screen, scr->escreen, scr->w, scr->h, scr->x, scr->y);
- n++;
- }
-}
-
-static int
-_e_xinerama_cb_screen_sort(const void *data1, const void *data2)
-{
- const E_Screen *scr, *scr2;
- int dif;
-
- scr = data1;
- scr2 = data2;
- if (scr->x != scr2->x)
- return scr->x - scr2->x;
- else if (scr->y != scr2->y)
- return scr->y - scr2->y;
- else
- {
- dif = (scr2->w * scr2->h) - (scr->w * scr->h);
- if (dif == 0) return scr->screen - scr2->screen;
- }
- return dif;
-}
-
+++ /dev/null
-#ifdef E_TYPEDEFS
-
-typedef struct _E_Screen E_Screen;
-
-#else
-#ifndef E_XINERAMA_H
-#define E_XINERAMA_H
-
-struct _E_Screen
-{
- int screen, escreen;
- int x, y, w, h;
- char *id; // this is the same id we get from randr2 so look it up there
-};
-
-EINTERN int e_xinerama_init(void);
-EINTERN int e_xinerama_shutdown(void);
-E_API void e_xinerama_update(void);
-E_API const Eina_List *e_xinerama_screens_get(void);
-E_API const Eina_List *e_xinerama_screens_all_get(void);
-E_API void e_xinerama_screens_set(Eina_List *screens);
-E_API void e_xinerama_fake_screen_add(int x, int y, int w, int h);
-E_API Eina_Bool e_xinerama_fake_screens_exist(void);
-
-#endif
-#endif
#endif
E_Zone_Display_State display_state;
- char *randr2_id; // same id we get from randr2 so look it up there
-
- E_Output *output;
- E_Plane *primary_plane;
+ char *randr2_id; // same id we get from randr2 so look it up there
+ E_Output_Screen *screen;
};
struct _E_Event_Zone_Generic