#pragma once #ifndef H_WAYLAND_STATE_ #define H_WAYLAND_STATE_ #include #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); 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; friend class WaylandWindowImpl; friend class Renderer; }; #endif // H_WAYLAND_STATE_