summaryrefslogtreecommitdiff
path: root/src/wlshm.h
blob: adb4e4b379179a05912cc4333c6ec547ac168c5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef _XF86_VIDEO_WAYLAND_SHM_H_
#define _XF86_VIDEO_WAYLAND_SHM_H_

/* All drivers should typically include these */
#include "xf86.h"
#include "xf86_OSproc.h"

#include "xf86Cursor.h"

#include "xf86xv.h"
#include <X11/extensions/Xv.h>
#include <string.h>

#include "xwayland.h"

#define WLSHM_DRIVER_NAME "wlshm"
#define COMBINED_DRIVER_VERSION \
    ((PACKAGE_VERSION_MAJOR << 16) | (PACKAGE_VERSION_MINOR << 8) | \
     PACKAGE_VERSION_PATCHLEVEL)

/* globals */
struct wlshm_device
{
    /* options */
    OptionInfoPtr options;

    /* proc pointer */
    CloseScreenProcPtr CloseScreen;
    CreateWindowProcPtr	CreateWindow;
    DestroyWindowProcPtr DestroyWindow;
    UnrealizeWindowProcPtr UnrealizeWindow;
    SetWindowPixmapProcPtr SetWindowPixmap;

    pointer* fb;

    struct xwl_screen *xwl_screen;
};

struct wlshm_pixmap {
    int fd;
    void *orig;
    void *data;
    size_t bytes;
};

static inline struct wlshm_device *wlshm_scrninfo_priv(ScrnInfoPtr pScrn)
{
    return ((struct wlshm_device *)((pScrn)->driverPrivate));
}

static inline struct wlshm_device *wlshm_screen_priv(ScreenPtr pScreen)
{
    return wlshm_scrninfo_priv(xf86Screens[pScreen->myNum]);
}

#endif