xwayland: Move SHM declarations to their own header

Currently, `xwayland.h` contains all the declarations, which is a bit
awkward and hard to follow.

Move the SHM relevant declarations to their own header file.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
This commit is contained in:
Olivier Fourdan 2019-12-16 17:07:02 +01:00
parent c20e61fddc
commit 177c8a2302
7 changed files with 67 additions and 18 deletions

View File

@ -14,6 +14,7 @@ Xwayland_SOURCES = \
xwayland-input.c \
xwayland-cursor.c \
xwayland-shm.c \
xwayland-shm.h \
xwayland-types.h \
xwayland-output.c \
xwayland-cvt.c \

View File

@ -3,6 +3,7 @@ srcs = [
'xwayland-input.c',
'xwayland-cursor.c',
'xwayland-shm.c',
'xwayland-shm.h',
'xwayland-types.h',
'xwayland-output.c',
'xwayland-cvt.c',

View File

@ -24,9 +24,19 @@
* SOFTWARE.
*/
#include "xwayland.h"
#include <xwayland-config.h>
#include <mipointer.h>
#include "scrnintstr.h"
#include "servermd.h"
#include "cursorstr.h"
#include "inputstr.h"
#include "mipointer.h"
#include "xwayland.h"
#include "xwayland-shm.h"
#include "xwayland-types.h"
#include "tablet-unstable-v2-client-protocol.h"
static DevPrivateKeyRec xwl_cursor_private_key;

View File

@ -24,13 +24,7 @@
* SOFTWARE.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "os.h"
#include "xwayland.h"
#include <xwayland-config.h>
#include <sys/mman.h>
#include <sys/types.h>
@ -40,6 +34,13 @@
#include <string.h>
#include <stdlib.h>
#include "fb.h"
#include "os.h"
#include "pixmapstr.h"
#include "xwayland.h"
#include "xwayland-shm.h"
struct xwl_pixmap {
struct wl_buffer *buffer;
void *data;

View File

@ -0,0 +1,41 @@
/*
* Copyright © 2014 Intel Corporation
* Copyright © 2012 Collabora, Ltd.
*
* 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_SHM_H
#define XWAYLAND_SHM_H
#include <xwayland-config.h>
#include "scrnintstr.h"
#include "pixmapstr.h"
Bool xwl_shm_create_screen_resources(ScreenPtr screen);
PixmapPtr xwl_shm_create_pixmap(ScreenPtr screen, int width, int height,
int depth, unsigned int hint);
Bool xwl_shm_destroy_pixmap(PixmapPtr pixmap);
struct wl_buffer *xwl_shm_pixmap_get_wl_buffer(PixmapPtr pixmap);
#endif /* XWAYLAND_SHM_H */

View File

@ -23,9 +23,6 @@
* SOFTWARE.
*/
#include "xwayland.h"
#include "xwayland-window-buffers.h"
#include <stdio.h>
#include <X11/Xatom.h>
@ -39,6 +36,10 @@
#include <xserver_poll.h>
#include <propertyst.h>
#include "xwayland.h"
#include "xwayland-shm.h"
#include "xwayland-window-buffers.h"
#ifdef XF86VIDMODE
#include <X11/extensions/xf86vmproto.h>
_X_EXPORT Bool noXFree86VidModeExtension;

View File

@ -471,12 +471,6 @@ void xwl_pixmap_buffer_release_cb(void *data, struct wl_buffer *wl_buffer);
struct xwl_window *xwl_window_from_window(WindowPtr window);
Bool xwl_shm_create_screen_resources(ScreenPtr screen);
PixmapPtr xwl_shm_create_pixmap(ScreenPtr screen, int width, int height,
int depth, unsigned int hint);
Bool xwl_shm_destroy_pixmap(PixmapPtr pixmap);
struct wl_buffer *xwl_shm_pixmap_get_wl_buffer(PixmapPtr pixmap);
#ifdef XWL_HAS_GLAMOR
void xwl_glamor_init_backends(struct xwl_screen *xwl_screen,
Bool use_eglstream);