From 03a9b58a0b9c13f5e30240fdea6d1c81ef264415 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Sat, 1 Jul 2023 18:45:33 +0200 Subject: c++,window: Rewriting window code to match new code --- src/window/xcb.h | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/window/xcb.h') diff --git a/src/window/xcb.h b/src/window/xcb.h index e2928b6..53aac5f 100644 --- a/src/window/xcb.h +++ b/src/window/xcb.h @@ -6,11 +6,15 @@ #include "backends.h" #include "device.h" +#include "window.h" + +#include + +#include +#include namespace saw { namespace gfx { -class window; - template<> class device final { private: @@ -23,9 +27,11 @@ private: own async_notifier_; conveyor_sink async_conveyor_; - std::map windows_; + std::map *> windows_; std::vector pending_events_; +private: + own> create_xcb_window(const video_mode& vid_mod, std::string_view title_view, int visual_id); public: device(::Display *display, int screen, xcb_connection_t *xcb_connection, xcb_screen_t *xcb_screen, own && an); @@ -35,16 +41,17 @@ public: void xcb_window_was_destroyed(xcb_window_t window_id); void handle_events(); - window create_window(const video_mode& vid_mod, std::string_view title_view); + own> create_window(const video_mode& vid_mod, std::string_view title_view); void flush(); }; -error_or> create_xcb_device(); +error_or>> create_xcb_device(io_provider& provider); -class window { +template<> +class window final { private: - device *device_; + device *device_; xcb_window_t xcb_window_; xcb_colormap_t xcb_colormap_; @@ -54,7 +61,7 @@ private: own>> event_feeder = nullptr; public: - window(device& dev_, xcb_window_t xcb_win, xcb_colormap_t xcb_colormap_, const video_mode& vid_mode_, std::string_view title_view_); + window(device& dev_, xcb_window_t xcb_win, xcb_colormap_t xcb_colormap_, const video_mode& vid_mode_, std::string_view title_view_); ~window(); -- cgit v1.2.3