2015-08-18 08:56:07 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "ecore_wl2_private.h"
|
|
|
|
|
2015-09-10 07:50:30 -07:00
|
|
|
static void
|
|
|
|
_xdg_shell_cb_ping(void *data EINA_UNUSED, struct xdg_shell *shell, uint32_t serial)
|
|
|
|
{
|
|
|
|
xdg_shell_pong(shell, serial);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct xdg_shell_listener _xdg_shell_listener =
|
|
|
|
{
|
|
|
|
_xdg_shell_cb_ping
|
|
|
|
};
|
|
|
|
|
2015-08-18 12:05:05 -07:00
|
|
|
static void
|
|
|
|
_cb_global_event_free(void *data EINA_UNUSED, void *event)
|
|
|
|
{
|
|
|
|
Ecore_Wl2_Event_Global *ev;
|
|
|
|
|
|
|
|
ev = event;
|
|
|
|
eina_stringshare_del(ev->interface);
|
|
|
|
free(ev);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_cb_global_add(void *data, struct wl_registry *registry, unsigned int id, const char *interface, unsigned int version)
|
|
|
|
{
|
|
|
|
Ecore_Wl2_Display *ewd;
|
|
|
|
Ecore_Wl2_Event_Global *ev;
|
|
|
|
|
|
|
|
ewd = data;
|
|
|
|
|
|
|
|
/* test to see if we have already added this global to our hash */
|
|
|
|
if (!eina_hash_find(ewd->globals, &id))
|
|
|
|
{
|
|
|
|
Ecore_Wl2_Global *global;
|
|
|
|
|
|
|
|
/* allocate space for new global */
|
|
|
|
global = calloc(1, sizeof(Ecore_Wl2_Global));
|
|
|
|
if (!global) return;
|
|
|
|
|
|
|
|
global->id = id;
|
|
|
|
global->interface = eina_stringshare_add(interface);
|
|
|
|
global->version = version;
|
|
|
|
|
|
|
|
/* add this global to our hash */
|
|
|
|
if (!eina_hash_add(ewd->globals, &global->id, global))
|
|
|
|
{
|
|
|
|
eina_stringshare_del(global->interface);
|
|
|
|
free(global);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-19 10:48:19 -07:00
|
|
|
if (!strcmp(interface, "wl_compositor"))
|
|
|
|
{
|
|
|
|
ewd->wl.compositor =
|
|
|
|
wl_registry_bind(registry, id, &wl_compositor_interface, 3);
|
|
|
|
}
|
|
|
|
else if (!strcmp(interface, "wl_subcompositor"))
|
|
|
|
{
|
|
|
|
ewd->wl.subcompositor =
|
|
|
|
wl_registry_bind(registry, id, &wl_subcompositor_interface, 1);
|
|
|
|
}
|
|
|
|
else if (!strcmp(interface, "wl_shm"))
|
|
|
|
{
|
|
|
|
ewd->wl.shm =
|
|
|
|
wl_registry_bind(registry, id, &wl_shm_interface, 1);
|
|
|
|
}
|
|
|
|
else if (!strcmp(interface, "wl_data_device_manager"))
|
|
|
|
{
|
|
|
|
ewd->wl.data_device_manager =
|
|
|
|
wl_registry_bind(registry, id, &wl_data_device_manager_interface, 1);
|
|
|
|
}
|
|
|
|
else if (!strcmp(interface, "wl_shell"))
|
|
|
|
{
|
|
|
|
ewd->wl.wl_shell =
|
|
|
|
wl_registry_bind(registry, id, &wl_shell_interface, 1);
|
|
|
|
}
|
|
|
|
else if ((!strcmp(interface, "xdg_shell")) &&
|
|
|
|
(!getenv("EFL_WAYLAND_DONT_USE_XDG_SHELL")))
|
|
|
|
{
|
|
|
|
ewd->wl.xdg_shell =
|
|
|
|
wl_registry_bind(registry, id, &xdg_shell_interface, 1);
|
|
|
|
xdg_shell_use_unstable_version(ewd->wl.xdg_shell, XDG_VERSION);
|
2015-09-10 07:50:30 -07:00
|
|
|
xdg_shell_add_listener(ewd->wl.xdg_shell, &_xdg_shell_listener, NULL);
|
2015-08-19 10:48:19 -07:00
|
|
|
}
|
2015-09-10 07:37:40 -07:00
|
|
|
else if (!strcmp(interface, "wl_output"))
|
|
|
|
_ecore_wl2_output_add(ewd, id);
|
2015-09-10 08:03:23 -07:00
|
|
|
else if (!strcmp(interface, "wl_seat"))
|
|
|
|
_ecore_wl2_input_add(ewd, id);
|
2015-08-19 10:48:19 -07:00
|
|
|
|
2015-08-18 12:05:05 -07:00
|
|
|
/* allocate space for event structure */
|
|
|
|
ev = calloc(1, sizeof(Ecore_Wl2_Event_Global));
|
|
|
|
if (!ev) return;
|
|
|
|
|
|
|
|
ev->id = id;
|
|
|
|
ev->version = version;
|
|
|
|
ev->interface = eina_stringshare_add(interface);
|
|
|
|
|
|
|
|
/* raise an event saying a new global has been added */
|
|
|
|
ecore_event_add(ECORE_WL2_EVENT_GLOBAL_ADDED, ev,
|
|
|
|
_cb_global_event_free, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_cb_global_remove(void *data, struct wl_registry *registry EINA_UNUSED, unsigned int id)
|
|
|
|
{
|
|
|
|
Ecore_Wl2_Display *ewd;
|
|
|
|
Ecore_Wl2_Global *global;
|
|
|
|
Ecore_Wl2_Event_Global *ev;
|
|
|
|
|
|
|
|
ewd = data;
|
|
|
|
|
|
|
|
/* try to find this global in our hash */
|
|
|
|
global = eina_hash_find(ewd->globals, &id);
|
|
|
|
if (!global) return;
|
|
|
|
|
|
|
|
/* allocate space for event structure */
|
|
|
|
ev = calloc(1, sizeof(Ecore_Wl2_Event_Global));
|
|
|
|
if (!ev) return;
|
|
|
|
|
|
|
|
ev->id = id;
|
|
|
|
ev->version = global->version;
|
|
|
|
ev->interface = eina_stringshare_add(global->interface);
|
|
|
|
|
|
|
|
/* raise an event saying a global has been removed */
|
|
|
|
ecore_event_add(ECORE_WL2_EVENT_GLOBAL_REMOVED, ev,
|
|
|
|
_cb_global_event_free, NULL);
|
|
|
|
|
|
|
|
/* delete this global from our hash */
|
|
|
|
eina_hash_del_by_key(ewd->globals, &id);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct wl_registry_listener _registry_listener =
|
|
|
|
{
|
|
|
|
_cb_global_add,
|
|
|
|
_cb_global_remove
|
|
|
|
};
|
|
|
|
|
2015-08-18 10:50:02 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_cb_create_data(void *data, Ecore_Fd_Handler *hdl)
|
|
|
|
{
|
|
|
|
Ecore_Wl2_Display *ewd;
|
|
|
|
struct wl_event_loop *loop;
|
|
|
|
|
|
|
|
ewd = data;
|
|
|
|
|
|
|
|
if (ecore_main_fd_handler_active_get(hdl, ECORE_FD_ERROR))
|
|
|
|
{
|
|
|
|
/* TODO: handle error case */
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
|
|
|
|
|
|
|
loop = wl_display_get_event_loop(ewd->wl.display);
|
2015-08-20 06:41:39 -07:00
|
|
|
wl_event_loop_dispatch(loop, 0);
|
2015-08-18 10:50:02 -07:00
|
|
|
wl_display_flush_clients(ewd->wl.display);
|
|
|
|
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_cb_connect_data(void *data, Ecore_Fd_Handler *hdl)
|
|
|
|
{
|
|
|
|
Ecore_Wl2_Display *ewd;
|
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
ewd = data;
|
|
|
|
|
|
|
|
if (ecore_main_fd_handler_active_get(hdl, ECORE_FD_ERROR))
|
|
|
|
{
|
|
|
|
/* TODO: handle error case */
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
|
|
|
|
2015-09-28 07:40:03 -07:00
|
|
|
if (ecore_main_fd_handler_active_get(hdl, ECORE_FD_READ))
|
|
|
|
ret = wl_display_dispatch(ewd->wl.display);
|
|
|
|
else if (ecore_main_fd_handler_active_get(hdl, ECORE_FD_WRITE))
|
|
|
|
{
|
|
|
|
ret = wl_display_flush(ewd->wl.display);
|
|
|
|
if (ret == 0)
|
|
|
|
ecore_main_fd_handler_active_set(hdl, ECORE_FD_READ);
|
|
|
|
}
|
2015-08-18 10:50:02 -07:00
|
|
|
|
|
|
|
if ((ret < 0) && ((errno != EAGAIN) && (errno != EINVAL)))
|
|
|
|
{
|
|
|
|
/* TODO: handle error case */
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
|
2015-08-18 12:05:05 -07:00
|
|
|
static void
|
|
|
|
_cb_globals_hash_del(void *data)
|
|
|
|
{
|
|
|
|
Ecore_Wl2_Global *global;
|
|
|
|
|
|
|
|
global = data;
|
|
|
|
|
|
|
|
eina_stringshare_del(global->interface);
|
|
|
|
|
|
|
|
free(global);
|
|
|
|
}
|
|
|
|
|
2015-09-09 08:19:02 -07:00
|
|
|
static void
|
|
|
|
_cb_sync_done(void *data, struct wl_callback *cb, uint32_t serial EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Ecore_Wl2_Display *ewd;
|
|
|
|
|
|
|
|
ewd = data;
|
|
|
|
ewd->sync_done = EINA_TRUE;
|
|
|
|
|
|
|
|
wl_callback_destroy(cb);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct wl_callback_listener _sync_listener =
|
|
|
|
{
|
|
|
|
_cb_sync_done
|
|
|
|
};
|
|
|
|
|
2015-09-25 11:31:30 -07:00
|
|
|
static void
|
|
|
|
_animator_tick_cb_begin(void *data)
|
|
|
|
{
|
|
|
|
Ecore_Wl2_Display *display;
|
|
|
|
Ecore_Wl2_Window *window;
|
|
|
|
|
|
|
|
display = data;
|
|
|
|
if (!display) return;
|
|
|
|
|
|
|
|
EINA_INLIST_FOREACH(display->windows, window)
|
|
|
|
_ecore_wl2_window_animator_add(window);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_animator_tick_cb_end(void *data)
|
|
|
|
{
|
|
|
|
Ecore_Wl2_Display *display;
|
|
|
|
|
|
|
|
display = data;
|
|
|
|
if (!display) return;
|
|
|
|
|
|
|
|
_ecore_wl2_window_animator_end();
|
|
|
|
}
|
|
|
|
|
2015-08-20 07:51:57 -07:00
|
|
|
static void
|
|
|
|
_ecore_wl2_display_cleanup(Ecore_Wl2_Display *ewd)
|
|
|
|
{
|
2015-09-10 07:37:40 -07:00
|
|
|
Ecore_Wl2_Output *output;
|
|
|
|
Eina_Inlist *tmp;
|
|
|
|
|
|
|
|
/* free each output */
|
|
|
|
EINA_INLIST_FOREACH_SAFE(ewd->outputs, tmp, output)
|
|
|
|
_ecore_wl2_output_del(output);
|
|
|
|
|
2015-08-20 07:51:57 -07:00
|
|
|
if (ewd->xkb_context) xkb_context_unref(ewd->xkb_context);
|
|
|
|
|
|
|
|
wl_registry_destroy(wl_display_get_registry(ewd->wl.display));
|
|
|
|
|
|
|
|
if (ewd->fd_hdl) ecore_main_fd_handler_del(ewd->fd_hdl);
|
|
|
|
|
|
|
|
eina_hash_free(ewd->globals);
|
|
|
|
}
|
|
|
|
|
2015-09-10 10:21:02 -07:00
|
|
|
Ecore_Wl2_Window *
|
|
|
|
_ecore_wl2_display_window_surface_find(Ecore_Wl2_Display *display, struct wl_surface *wl_surface)
|
|
|
|
{
|
|
|
|
Ecore_Wl2_Window *window;
|
|
|
|
|
|
|
|
if ((!display) || (!wl_surface)) return NULL;
|
|
|
|
|
|
|
|
EINA_INLIST_FOREACH(display->windows, window)
|
|
|
|
{
|
|
|
|
if ((window->surface) &&
|
|
|
|
(window->surface == wl_surface))
|
|
|
|
return window;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2015-08-18 10:50:02 -07:00
|
|
|
EAPI Ecore_Wl2_Display *
|
2015-08-18 12:55:24 -07:00
|
|
|
ecore_wl2_display_create(const char *name)
|
2015-08-18 08:56:07 -07:00
|
|
|
{
|
2015-08-18 10:50:02 -07:00
|
|
|
Ecore_Wl2_Display *ewd;
|
|
|
|
struct wl_event_loop *loop;
|
|
|
|
|
|
|
|
/* allocate space for display structure */
|
|
|
|
ewd = calloc(1, sizeof(Ecore_Wl2_Display));
|
|
|
|
if (!ewd) return NULL;
|
|
|
|
|
|
|
|
/* try to create new wayland display */
|
|
|
|
ewd->wl.display = wl_display_create();
|
|
|
|
if (!ewd->wl.display)
|
|
|
|
{
|
|
|
|
ERR("Could not create wayland display: %m");
|
|
|
|
goto create_err;
|
|
|
|
}
|
|
|
|
|
2015-08-18 12:55:24 -07:00
|
|
|
if (!name)
|
2015-08-18 10:50:02 -07:00
|
|
|
{
|
2015-08-18 12:55:24 -07:00
|
|
|
ewd->name = wl_display_add_socket_auto(ewd->wl.display);
|
|
|
|
if (!ewd->name)
|
|
|
|
{
|
|
|
|
ERR("Failed to add display socket: %m");
|
|
|
|
goto socket_err;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ewd->name = strdup(name);
|
|
|
|
if (wl_display_add_socket(ewd->wl.display, name))
|
|
|
|
{
|
|
|
|
ERR("Failed to add display socket: %m");
|
|
|
|
goto socket_err;
|
|
|
|
}
|
2015-08-18 10:50:02 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
loop = wl_display_get_event_loop(ewd->wl.display);
|
|
|
|
|
|
|
|
ewd->fd_hdl =
|
|
|
|
ecore_main_fd_handler_add(wl_event_loop_get_fd(loop),
|
|
|
|
ECORE_FD_READ | ECORE_FD_ERROR,
|
|
|
|
_cb_create_data, ewd, NULL, NULL);
|
|
|
|
|
|
|
|
return ewd;
|
|
|
|
|
|
|
|
socket_err:
|
|
|
|
wl_display_destroy(ewd->wl.display);
|
|
|
|
|
|
|
|
create_err:
|
|
|
|
free(ewd);
|
|
|
|
return NULL;
|
2015-08-18 08:56:07 -07:00
|
|
|
}
|
|
|
|
|
2015-08-18 10:50:02 -07:00
|
|
|
EAPI Ecore_Wl2_Display *
|
2015-08-18 08:56:07 -07:00
|
|
|
ecore_wl2_display_connect(const char *name)
|
|
|
|
{
|
2015-08-18 10:50:02 -07:00
|
|
|
Ecore_Wl2_Display *ewd;
|
2015-09-09 08:19:02 -07:00
|
|
|
struct wl_callback *cb;
|
2015-08-18 10:50:02 -07:00
|
|
|
|
|
|
|
/* allocate space for display structure */
|
|
|
|
ewd = calloc(1, sizeof(Ecore_Wl2_Display));
|
|
|
|
if (!ewd) return NULL;
|
2015-08-18 08:56:07 -07:00
|
|
|
|
2015-08-18 12:05:05 -07:00
|
|
|
ewd->globals = eina_hash_int32_new(_cb_globals_hash_del);
|
|
|
|
|
2015-08-18 08:56:07 -07:00
|
|
|
/* try to connect to wayland display with this name */
|
2015-08-18 10:50:02 -07:00
|
|
|
ewd->wl.display = wl_display_connect(name);
|
|
|
|
if (!ewd->wl.display)
|
2015-08-18 08:56:07 -07:00
|
|
|
{
|
|
|
|
ERR("Could not connect to display %s: %m", name);
|
2015-08-20 07:35:24 -07:00
|
|
|
goto connect_err;
|
2015-08-18 08:56:07 -07:00
|
|
|
}
|
|
|
|
|
2015-08-18 10:50:02 -07:00
|
|
|
ewd->fd_hdl =
|
|
|
|
ecore_main_fd_handler_add(wl_display_get_fd(ewd->wl.display),
|
2015-09-28 07:40:03 -07:00
|
|
|
ECORE_FD_READ | ECORE_FD_WRITE | ECORE_FD_ERROR,
|
2015-08-18 10:50:02 -07:00
|
|
|
_cb_connect_data, ewd, NULL, NULL);
|
|
|
|
|
2015-08-18 12:05:05 -07:00
|
|
|
wl_registry_add_listener(wl_display_get_registry(ewd->wl.display),
|
|
|
|
&_registry_listener, ewd);
|
|
|
|
|
2015-08-20 07:35:24 -07:00
|
|
|
ewd->xkb_context = xkb_context_new(0);
|
|
|
|
if (!ewd->xkb_context) goto context_err;
|
|
|
|
|
2015-09-09 08:19:02 -07:00
|
|
|
/* NB: If we are connecting (as a client), then we will need to setup
|
|
|
|
* a callback for display_sync and wait for it to complete. There is no
|
|
|
|
* other option here as we need the compositor, shell, etc, to be setup
|
|
|
|
* before we can allow a user to make use of the API functions we provide */
|
|
|
|
cb = wl_display_sync(ewd->wl.display);
|
|
|
|
wl_callback_add_listener(cb, &_sync_listener, ewd);
|
|
|
|
|
|
|
|
while (!ewd->sync_done)
|
|
|
|
wl_display_dispatch(ewd->wl.display);
|
|
|
|
|
2015-08-18 10:50:02 -07:00
|
|
|
return ewd;
|
2015-08-18 12:05:05 -07:00
|
|
|
|
2015-08-20 07:35:24 -07:00
|
|
|
context_err:
|
|
|
|
ecore_main_fd_handler_del(ewd->fd_hdl);
|
|
|
|
wl_registry_destroy(wl_display_get_registry(ewd->wl.display));
|
|
|
|
wl_display_disconnect(ewd->wl.display);
|
|
|
|
|
|
|
|
connect_err:
|
2015-08-18 12:05:05 -07:00
|
|
|
eina_hash_free(ewd->globals);
|
|
|
|
free(ewd);
|
|
|
|
return NULL;
|
2015-08-18 08:56:07 -07:00
|
|
|
}
|
2015-08-19 10:41:01 -07:00
|
|
|
|
2015-08-20 07:15:07 -07:00
|
|
|
EAPI void
|
|
|
|
ecore_wl2_display_disconnect(Ecore_Wl2_Display *display)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(display);
|
2015-08-20 07:51:57 -07:00
|
|
|
_ecore_wl2_display_cleanup(display);
|
2015-08-20 07:15:07 -07:00
|
|
|
wl_display_disconnect(display->wl.display);
|
|
|
|
}
|
2015-08-20 07:22:03 -07:00
|
|
|
|
|
|
|
EAPI void
|
|
|
|
ecore_wl2_display_destroy(Ecore_Wl2_Display *display)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(display);
|
2015-08-20 07:51:57 -07:00
|
|
|
_ecore_wl2_display_cleanup(display);
|
2015-08-20 07:22:03 -07:00
|
|
|
wl_display_destroy(display->wl.display);
|
|
|
|
}
|
2015-08-20 07:41:33 -07:00
|
|
|
|
|
|
|
EAPI void
|
|
|
|
ecore_wl2_display_terminate(Ecore_Wl2_Display *display)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(display);
|
|
|
|
wl_display_terminate(display->wl.display);
|
|
|
|
}
|
2015-08-20 07:57:07 -07:00
|
|
|
|
|
|
|
EAPI struct wl_display *
|
|
|
|
ecore_wl2_display_get(Ecore_Wl2_Display *display)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL);
|
|
|
|
return display->wl.display;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI struct wl_shm *
|
|
|
|
ecore_wl2_display_shm_get(Ecore_Wl2_Display *display)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL);
|
|
|
|
return display->wl.shm;
|
|
|
|
}
|
2015-08-20 09:18:52 -07:00
|
|
|
|
|
|
|
EAPI Eina_Iterator *
|
|
|
|
ecore_wl2_display_globals_get(Ecore_Wl2_Display *display)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL);
|
|
|
|
return eina_hash_iterator_data_new(display->globals);
|
|
|
|
}
|
2015-09-25 11:31:30 -07:00
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
ecore_wl2_display_animator_source_set(Ecore_Wl2_Display *display, Ecore_Animator_Source source)
|
|
|
|
{
|
|
|
|
switch (source)
|
|
|
|
{
|
|
|
|
case ECORE_ANIMATOR_SOURCE_CUSTOM:
|
|
|
|
ecore_animator_custom_source_tick_begin_callback_set
|
|
|
|
(_animator_tick_cb_begin, display);
|
|
|
|
ecore_animator_custom_source_tick_end_callback_set
|
|
|
|
(_animator_tick_cb_end, display);
|
|
|
|
break;
|
|
|
|
case ECORE_ANIMATOR_SOURCE_TIMER:
|
|
|
|
ecore_animator_custom_source_tick_begin_callback_set(NULL, NULL);
|
|
|
|
ecore_animator_custom_source_tick_end_callback_set(NULL, NULL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
2015-09-28 08:58:51 -07:00
|
|
|
|
|
|
|
EAPI void
|
|
|
|
ecore_wl2_display_screen_size_get(Ecore_Wl2_Display *display, int *w, int *h)
|
|
|
|
{
|
|
|
|
Ecore_Wl2_Output *output;
|
|
|
|
int ow = 0, oh = 0;
|
|
|
|
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(display);
|
|
|
|
|
|
|
|
if (w) *w = 0;
|
|
|
|
if (h) *h = 0;
|
|
|
|
|
|
|
|
EINA_INLIST_FOREACH(display->outputs, output)
|
|
|
|
{
|
|
|
|
switch (output->transform)
|
|
|
|
{
|
|
|
|
case WL_OUTPUT_TRANSFORM_90:
|
|
|
|
case WL_OUTPUT_TRANSFORM_270:
|
|
|
|
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
|
|
|
|
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
|
|
|
|
ow += output->geometry.h;
|
|
|
|
oh += output->geometry.w;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
ow += output->geometry.w;
|
|
|
|
oh += output->geometry.h;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (w) *w = ow;
|
|
|
|
if (h) *h = oh;
|
|
|
|
}
|