#include "window.h" #include #include "xdg-shell-client-protocol.h" class WaylandWindowImpl : public WindowImpl { public: WaylandWindowImpl(size_t width, size_t height); ~WaylandWindowImpl() override; public: bool Dispatch() override; size_t GetWidth() const override; size_t GetHeight() const override; private: static void handle_frame_callback(void *data, struct wl_callback *cb, uint32_t time); static void xsurface_handle_configure(void *data, struct xdg_surface *surface, uint32_t serial); static void xtoplevel_handle_configure(void *data, struct xdg_toplevel *toplevel, int32_t width, int32_t height, struct wl_array *states); static void xtoplevel_handle_close(void *data, struct xdg_toplevel *toplevel); static void xtoplevel_handle_configure_bounds(void *data, struct xdg_toplevel *toplevel, int32_t width, int32_t height); static void xtoplevel_handle_wm_capabilities(void *data, struct xdg_toplevel *toplevel, struct wl_array *capabilities); private: EGLSurface m_egl_surface; EGLContext m_egl_context; GLuint m_program; struct wl_egl_window *m_egl_window; struct wl_surface *m_wsurface; struct xdg_surface *m_xsurface; struct xdg_toplevel *m_toplevel; struct wl_callback_listener m_frame_listener; struct xdg_surface_listener m_xsurface_listener; struct xdg_toplevel_listener m_toplevel_listener; bool m_running = false; size_t m_width, m_height; };