From 8dad985328e2183b224300aa992951131956fdb3 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 23 Jan 2024 13:12:11 +0100 Subject: core,codec-json,codec-minecraft,codec-netcdf,codec,io-tls,io,io_codec,window,window-opengl: Renamed file endings and changed includes --- modules/window/c++/window.hpp | 79 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 modules/window/c++/window.hpp (limited to 'modules/window/c++/window.hpp') diff --git a/modules/window/c++/window.hpp b/modules/window/c++/window.hpp new file mode 100644 index 0000000..4637ea7 --- /dev/null +++ b/modules/window/c++/window.hpp @@ -0,0 +1,79 @@ +#pragma once + +#include "video_mode.hpp + +#include +#include +#include + +#include +#include + +namespace saw { +namespace gfx { +namespace schema { +using namespace saw::schema; +using WindowResize = Struct< + Member, + Member +>; +using WindowEvents = Union< + Member +>; +} + +template +class window; +} +} + +#include "linux_xcb.hpp + +/** +namespace saw { +class window { +public: + class event { + public: + struct resize { + size_t width; + size_t height; + }; + + struct keyboard { + uint32_t key; + uint32_t scan; + bool pressed; + bool repeat; + }; + + struct mouse { + uint16_t button_mask; + bool pressed; + uint32_t x; + uint32_t y; + }; + + struct mouse_move { + uint32_t x; + uint32_t y; + }; + }; + + using variant_event = std::variant; + + virtual ~window() = default; + + virtual void show() = 0; + virtual void hide() = 0; + + virtual const video_mode &get_video_mode() const = 0; + virtual const std::string_view title() const = 0; + + virtual void resize(size_t width, size_t height) = 0; + + virtual conveyor on_event() = 0; +}; +} // namespace saw +*/ -- cgit v1.2.3