ecore-drm: Add API function to get screen geometry

This adds a function that we can call from ecore_evas to get the
screen_geometry

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2014-09-04 10:02:24 -04:00
parent b59b3016e8
commit f76180a501
1 changed files with 27 additions and 0 deletions

View File

@ -767,3 +767,30 @@ ecore_drm_output_size_get(Ecore_Drm_Device *dev, int output, int *w, int *h)
if (h) *h = fb->height;
drmModeFreeFB(fb);
}
EAPI void
ecore_drm_outputs_geometry_get(Ecore_Drm_Device *dev, int *x, int *y, int *w, int *h)
{
Ecore_Drm_Output *output;
Eina_List *l;
int ox = 0, oy = 0, ow = 0, oh = 0;
if (x) *x = 0;
if (y) *y = 0;
if (w) *w = 0;
if (h) *h = 0;
if (!dev) return;
EINA_LIST_FOREACH(dev->outputs, l, output)
{
ox += output->x;
oy += output->y;
ow += MAX(ow, output->current_mode->width);
oh += MAX(oh, output->current_mode->height);
}
if (x) *x = ox;
if (y) *y = oy;
if (w) *w = ow;
if (h) *h = oh;
}