diff --git a/hw/xwayland/Makefile.am b/hw/xwayland/Makefile.am index 6c281259c..9e77e6f81 100644 --- a/hw/xwayland/Makefile.am +++ b/hw/xwayland/Makefile.am @@ -22,6 +22,7 @@ Xwayland_SOURCES = \ xwayland-shm.h \ xwayland-types.h \ xwayland-output.c \ + xwayland-output.h \ xwayland-cvt.c \ xwayland-vidmode.c \ xwayland-window.c \ diff --git a/hw/xwayland/meson.build b/hw/xwayland/meson.build index 273200e8c..93672024e 100644 --- a/hw/xwayland/meson.build +++ b/hw/xwayland/meson.build @@ -11,6 +11,7 @@ srcs = [ 'xwayland-shm.h', 'xwayland-types.h', 'xwayland-output.c', + 'xwayland-output.h', 'xwayland-cvt.c', 'xwayland-vidmode.c', 'xwayland-window.c', diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c index 238bebcdf..6f62e5ae7 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c @@ -29,6 +29,7 @@ #include #include "xwayland.h" +#include "xwayland-output.h" #include "xwayland-window.h" #include "xdg-output-unstable-v1-client-protocol.h" diff --git a/hw/xwayland/xwayland-output.h b/hw/xwayland/xwayland-output.h new file mode 100644 index 000000000..02b983108 --- /dev/null +++ b/hw/xwayland/xwayland-output.h @@ -0,0 +1,82 @@ +/* + * Copyright © 2011-2014 Intel Corporation + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without + * fee, provided that the above copyright notice appear in all copies + * and that both that copyright notice and this permission notice + * appear in supporting documentation, and that the name of the + * copyright holders not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +#ifndef XWAYLAND_OUTPUT_H +#define XWAYLAND_OUTPUT_H + +#include +#include + +#include +#include +#include + +#include "xwayland-types.h" + +struct xwl_output { + struct xorg_list link; + struct wl_output *output; + struct zxdg_output_v1 *xdg_output; + uint32_t server_output_id; + struct xwl_screen *xwl_screen; + RROutputPtr randr_output; + RRCrtcPtr randr_crtc; + int32_t x, y, width, height, refresh; + Rotation rotation; + Bool wl_output_done; + Bool xdg_output_done; +}; + +/* Per client per output emulated randr/vidmode resolution info. */ +struct xwl_emulated_mode { + uint32_t server_output_id; + int32_t width; + int32_t height; + Bool from_vidmode; +}; + +Bool xwl_screen_init_output(struct xwl_screen *xwl_screen); + +struct xwl_output *xwl_output_create(struct xwl_screen *xwl_screen, + uint32_t id); + +void xwl_output_destroy(struct xwl_output *xwl_output); + +void xwl_output_remove(struct xwl_output *xwl_output); + +struct xwl_emulated_mode *xwl_output_get_emulated_mode_for_client( + struct xwl_output *xwl_output, ClientPtr client); + +RRModePtr xwl_output_find_mode(struct xwl_output *xwl_output, + int32_t width, int32_t height); +void xwl_output_set_emulated_mode(struct xwl_output *xwl_output, + ClientPtr client, RRModePtr mode, + Bool from_vidmode); +void xwl_output_set_window_randr_emu_props(struct xwl_screen *xwl_screen, + WindowPtr window); + +void xwl_screen_init_xdg_output(struct xwl_screen *xwl_screen); + +#endif /* XWAYLAND_OUTPUT_H */ diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index 811545a0d..a613ced6e 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -39,6 +39,7 @@ #include "xwayland.h" #include "xwayland-glamor.h" #include "xwayland-input.h" +#include "xwayland-output.h" #include "xwayland-pixmap.h" #include "xwayland-present.h" #include "xwayland-shm.h" diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h index 5f8947344..46f67e61e 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -50,6 +50,7 @@ #include "viewporter-client-protocol.h" #include "xwayland-types.h" +#include "xwayland-output.h" #include "xwayland-glamor.h" struct xwl_format { @@ -122,28 +123,6 @@ struct xwl_screen { #define MODIFIER_META 0x01 -struct xwl_output { - struct xorg_list link; - struct wl_output *output; - struct zxdg_output_v1 *xdg_output; - uint32_t server_output_id; - struct xwl_screen *xwl_screen; - RROutputPtr randr_output; - RRCrtcPtr randr_crtc; - int32_t x, y, width, height, refresh; - Rotation rotation; - Bool wl_output_done; - Bool xdg_output_done; -}; - -/* Per client per output emulated randr/vidmode resolution info. */ -struct xwl_emulated_mode { - uint32_t server_output_id; - int32_t width; - int32_t height; - Bool from_vidmode; -}; - /* Apps which use randr/vidmode to change the mode when going fullscreen, * usually change the mode of only a single monitor, so this should be plenty. */ @@ -167,31 +146,9 @@ Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen); struct xwl_output *xwl_screen_get_first_output(struct xwl_screen *xwl_screen); void xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen); -Bool xwl_screen_init_output(struct xwl_screen *xwl_screen); - -struct xwl_output *xwl_output_create(struct xwl_screen *xwl_screen, - uint32_t id); - -void xwl_output_destroy(struct xwl_output *xwl_output); - -void xwl_output_remove(struct xwl_output *xwl_output); - -struct xwl_emulated_mode *xwl_output_get_emulated_mode_for_client( - struct xwl_output *xwl_output, ClientPtr client); - -RRModePtr xwl_output_find_mode(struct xwl_output *xwl_output, - int32_t width, int32_t height); -void xwl_output_set_emulated_mode(struct xwl_output *xwl_output, - ClientPtr client, RRModePtr mode, - Bool from_vidmode); -void xwl_output_set_window_randr_emu_props(struct xwl_screen *xwl_screen, - WindowPtr window); - RRModePtr xwayland_cvt(int HDisplay, int VDisplay, float VRefresh, Bool Reduced, Bool Interlaced); -void xwl_screen_init_xdg_output(struct xwl_screen *xwl_screen); - #ifdef XF86VIDMODE void xwlVidModeExtensionInit(void); #endif