From a14896f9ed209dd3f9597722e5a5697bd7dbf531 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 4 Dec 2023 12:18:14 +0100 Subject: meta: Renamed folder containing source --- c++/window/xcb.h | 105 ------------------------------------------------------- 1 file changed, 105 deletions(-) delete mode 100644 c++/window/xcb.h (limited to 'c++/window/xcb.h') diff --git a/c++/window/xcb.h b/c++/window/xcb.h deleted file mode 100644 index a2a9b0b..0000000 --- a/c++/window/xcb.h +++ /dev/null @@ -1,105 +0,0 @@ -#pragma once - -#ifndef SAW_UNIX_XCB -#error "XCB is not supported" -#endif - -#include "backends.h" -#include "device.h" -#include "window.h" - -#include - -#include -#include - -namespace saw { -namespace gfx { -template -class window; - -template -class device; - -template<> -class device final { -private: - ::Display *display_; - int screen_; - - xcb_connection_t *xcb_connection_; - xcb_screen_t *xcb_screen_; - - own async_notifier_; - conveyor_sink async_conveyor_; - - std::map *> windows_; - - std::vector pending_events_; - - friend class window; -public: - own> create_xcb_window(const video_mode& vid_mod, std::string_view title_view, int visual_id); - void xcb_window_was_destroyed(xcb_window_t window_id); -public: - device(::Display *display, int screen, xcb_connection_t *xcb_connection, - xcb_screen_t *xcb_screen, own && an); - - ~device(); - - void handle_events(); - - own> create_window(const video_mode& vid_mod, std::string_view title_view); - - void flush(); - - // XCB specific info for other classes - ::Display* get_xcb_display() { - return display_; - } - - int get_xcb_screen() const { - return screen_; - } -}; - -error_or>> create_xcb_device(io_provider& provider); - -template<> -class window final { -private: - device *device_; - - xcb_window_t xcb_window_; - xcb_colormap_t xcb_colormap_; - - video_mode video_mode_; - std::string window_title_; - - own>> event_feeder = nullptr; -public: - window(device& dev_, xcb_window_t xcb_win, xcb_colormap_t xcb_colormap_, const video_mode& vid_mode_, const std::string_view& title_view_); - - ~window(); - - void show(); - void hide(); - - const video_mode& get_video_mode() const; - - const std::string_view get_title() const; - - void resize(uint64_t width, uint64_t height); - - conveyor> on_event(); - - void resize_event(uint64_t x, uint64_t y, uint64_t width, uint64_t height); - void mouse_event(int16_t x, int16_t y, uint16_t state, bool pressed); - void mouse_move_event(int16_t x, int16_t y); - void keyboard_event(int16_t x, int16_t y, uint32_t keycode, bool pressed, bool repeat); - - // XCB specific things - xcb_window_t get_xcb_window_handle() const; -}; -} -} -- cgit v1.2.3