wayland backend init commit
This commit is contained in:
parent
9831c033fb
commit
843cc74c4c
12 changed files with 581 additions and 3 deletions
|
|
@ -26,13 +26,15 @@ typedef void* MwLLPixmap;
|
|||
|
||||
enum MwLLBackends {
|
||||
MwLLBackendX11 = 0,
|
||||
MwLLBackendGDI
|
||||
MwLLBackendGDI,
|
||||
MwLLBackendWayland,
|
||||
};
|
||||
|
||||
struct _MwLLCommon {
|
||||
void* user;
|
||||
int copy_buffer;
|
||||
int type;
|
||||
int success;
|
||||
|
||||
MwLLHandler handler;
|
||||
};
|
||||
|
|
@ -56,6 +58,9 @@ struct _MwLLCommonPixmap {
|
|||
#ifdef USE_GDI
|
||||
#include <Mw/LowLevel/GDI.h>
|
||||
#endif
|
||||
#ifdef USE_WAYLAND
|
||||
#include <Mw/LowLevel/Wayland.h>
|
||||
#endif
|
||||
|
||||
union _MwLL {
|
||||
struct _MwLLCommon common;
|
||||
|
|
@ -65,6 +70,9 @@ union _MwLL {
|
|||
#ifdef USE_GDI
|
||||
struct _MwLLGDI gdi;
|
||||
#endif
|
||||
#ifdef USE_WAYLAND
|
||||
struct _MwLLWayland wayland;
|
||||
#endif
|
||||
};
|
||||
|
||||
union _MwLLColor {
|
||||
|
|
@ -75,6 +83,9 @@ union _MwLLColor {
|
|||
#ifdef USE_GDI
|
||||
struct _MwLLGDIColor gdi;
|
||||
#endif
|
||||
#ifdef USE_WAYLAND
|
||||
struct _MwLLWaylandColor wayland;
|
||||
#endif
|
||||
};
|
||||
|
||||
union _MwLLPixmap {
|
||||
|
|
@ -85,6 +96,9 @@ union _MwLLPixmap {
|
|||
#ifdef USE_GDI
|
||||
struct _MwLLGDIPixmap gdi;
|
||||
#endif
|
||||
#ifdef USE_WAYLAND
|
||||
struct _MwLLWaylandPixmap wayland;
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
#include <Mw/TypeDefs.h>
|
||||
|
|
|
|||
84
include/Mw/LowLevel/Wayland.h
Normal file
84
include/Mw/LowLevel/Wayland.h
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
/* $Id$ */
|
||||
/*!
|
||||
* @file Mw/LowLevel/Wayland.h
|
||||
* @brief Wayland Backend
|
||||
* @warning This is used internally
|
||||
*/
|
||||
#ifndef __MW_LOWLEVEL_WAYLAND_H__
|
||||
#define __MW_LOWLEVEL_WAYLAND_H__
|
||||
|
||||
#include <Mw/MachDep.h>
|
||||
#include <Mw/TypeDefs.h>
|
||||
#include <Mw/LowLevel.h>
|
||||
|
||||
#include <wayland-client.h>
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
|
||||
MWDECL int MwLLWaylandCallInit(void);
|
||||
|
||||
#ifndef WL_PROTOCOLS_DEFINED
|
||||
#define WL_PROTOCOLS_DEFINED
|
||||
#include "Wayland/xdg-shell-client-protocol.h"
|
||||
#include "Wayland/xdg-decoration-client-protocol.h"
|
||||
#include "Wayland/cursor-shape-client-protocol.h"
|
||||
#endif
|
||||
|
||||
typedef struct wayland_protocol {
|
||||
void* listener;
|
||||
void* context;
|
||||
} wayland_protocol_t;
|
||||
|
||||
typedef wayland_protocol_t*(wl_setup_func)(MwU32, struct _MwLLWayland*);
|
||||
|
||||
struct _MwLLWayland {
|
||||
struct _MwLLCommon common;
|
||||
|
||||
// struct wl_shm* shm;
|
||||
struct wl_display* display;
|
||||
struct wl_registry* registry;
|
||||
// struct wl_compositor* compositor;
|
||||
// struct wl_seat* seat;
|
||||
struct wl_surface* surface;
|
||||
struct xdg_surface* xdg_surface;
|
||||
// struct xdg_wm_base* xdg_wm_base;
|
||||
struct xdg_toplevel* xdg_top_level;
|
||||
|
||||
struct wl_registry_listener registry_listener;
|
||||
|
||||
// struct zxdg_decoration_manager_v1* decoration_manager;
|
||||
// struct zxdg_toplevel_decoration_v1* toplevel_decoration;
|
||||
|
||||
struct xdg_toplevel_listener xdg_toplevel_listener;
|
||||
// struct xdg_wm_base_listener xdg_wm_base_listener;
|
||||
struct xdg_surface_listener xdg_surface_listener;
|
||||
// struct wl_pointer_listener pointer_listener;
|
||||
// struct wl_seat_listener seat_listener;
|
||||
// struct wl_keyboard_listener keyboard_listener;
|
||||
// struct wl_shell_surface_listener shell_surface_listener;
|
||||
// struct zxdg_toplevel_decoration_v1_listener decoration_listener;
|
||||
|
||||
struct {
|
||||
const char* key;
|
||||
wl_setup_func* value;
|
||||
}* wl_protocol_setup_map;
|
||||
|
||||
struct {
|
||||
const char* key;
|
||||
wayland_protocol_t* value;
|
||||
}* wl_protocol_map;
|
||||
|
||||
struct xkb_context* xkb_context;
|
||||
|
||||
MwBool configured;
|
||||
MwBool running;
|
||||
};
|
||||
|
||||
struct _MwLLWaylandColor {
|
||||
struct _MwLLCommonColor common;
|
||||
};
|
||||
|
||||
struct _MwLLWaylandPixmap {
|
||||
struct _MwLLCommonPixmap common;
|
||||
};
|
||||
|
||||
#endif
|
||||
1
include/Mw/LowLevel/Wayland/.gitignore
vendored
Normal file
1
include/Mw/LowLevel/Wayland/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
*protocol.h
|
||||
1
include/Mw/LowLevel/Wayland/README.md
Normal file
1
include/Mw/LowLevel/Wayland/README.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Folder for wayland-scanner to place any of its files.
|
||||
Loading…
Add table
Add a link
Reference in a new issue