54 lines
1.5 KiB
C++
54 lines
1.5 KiB
C++
#pragma once
|
|
#ifndef H_WAYLAND_STATE_
|
|
#define H_WAYLAND_STATE_
|
|
|
|
#include <wayland-client-protocol.h>
|
|
|
|
#include "xdg-shell-client-protocol.h"
|
|
|
|
class WaylandState {
|
|
public:
|
|
static WaylandState *GetInstance();
|
|
|
|
private:
|
|
static void wm_base_handle_ping(void *data, struct xdg_wm_base *wm_base,
|
|
uint32_t serial);
|
|
static void registry_handle_global(void *data, struct wl_registry *registry,
|
|
uint32_t name, const char *interface,
|
|
uint32_t version);
|
|
static void registry_handle_global_remove(void *data,
|
|
struct wl_registry *registry,
|
|
uint32_t name);
|
|
static void seat_handle_capabilities(void *data,
|
|
struct wl_seat *seat,
|
|
uint32_t capabilities);
|
|
static void seat_handle_name(void *data,
|
|
struct wl_seat *seat,
|
|
const char *name);
|
|
private:
|
|
WaylandState();
|
|
~WaylandState();
|
|
|
|
private:
|
|
static WaylandState *s_instance;
|
|
|
|
struct wl_display *m_display = nullptr;
|
|
struct wl_compositor *m_compositor = nullptr;
|
|
struct xdg_wm_base *m_wm_base = nullptr;
|
|
|
|
struct xdg_wm_base_listener m_wm_base_listener;
|
|
struct wl_registry_listener m_reg_listener;
|
|
|
|
struct wl_shm *m_shm;
|
|
|
|
struct wl_seat *m_seat;
|
|
struct wl_seat_listener m_seat_listener;
|
|
struct wl_pointer* m_pointer;
|
|
|
|
friend class WaylandWindowImpl;
|
|
friend class Renderer;
|
|
friend class WaylandInputHandler;
|
|
};
|
|
|
|
#endif // H_WAYLAND_STATE_
|