EHS
Window_XCB.h
Go to the documentation of this file.
1#pragma once
2
3#include "BaseWindow.h"
4#include "File.h"
5
6#include <xcb/xcb.h>
7#include <xcb/xinput.h>
8
9namespace ehs
10{
11 class EHS_LIB_IO Window : public BaseWindow
12 {
13 protected:
14 friend class Input;
15
16 xcb_connection_t* server;
17 xcb_screen_t* screen;
18 xcb_window_t hdl;
19 xcb_atom_t masks[2];
23
24 public:
25 ~Window() override;
26
28
29 Window(Window&& win) noexcept;
30
31 Window(const Window& win);
32
33 Window& operator=(Window&& win) noexcept;
34
35 Window& operator=(const Window& win);
36
37 void Create_32(const Str_32& title, const Vec2_s32& pos, Vec2_u32 scale) override;
38
39 void Create_16(const Str_16& title, const Vec2_s32& pos, Vec2_u32 scale) override;
40
41 void Create_8(const Str_8& title, const Vec2_s32& pos, Vec2_u32 scale) override;
42
43 void Close() override;
44
45 void Show() override;
46
47 void Hide() override;
48
49 bool Poll() override;
50
51 void ShowCursor(bool toggle) override;
52
53 void ConstrainCursor(bool constrain) override;
54
55 void SetTitle_32(const Str_32& newTitle) override;
56
57 Str_32 GetTitle_32() const override;
58
59 void SetTitle_16(const Str_16& newTitle) override;
60
61 Str_16 GetTitle_16() const override;
62
63 void SetTitle_8(const Str_8& newTitle) override;
64
65 Str_8 GetTitle_8() const override;
66
67 void SetPos(const Vec2_s32& newPos) override;
68
69 Vec2_s32 GetPos() const override;
70
71 void SetScale(const Vec2_u32& newScale) override;
72
73 Vec2_u32 GetScale() const override;
74
76
77 void SetClipboard(Serializer<UInt_64> data) override;
78
79 void SetCursorImg(CursorImg img) override;
80
81 xcb_connection_t* GetServer();
82
83 private:
84 xcb_generic_event_t* RetrieveEvent();
85
86 xcb_atom_t RetrieveAtom(bool create, const Str_8& name) const;
87
88 xcb_get_property_reply_t* RetrieveProp(xcb_atom_t prop, xcb_atom_t type) const;
89
90 void QueryPrimaryDevices();
91
92 Str_8 QueryDeviceName(UInt_16 id);
93 };
94}
Definition: Input.h:10
Definition: Str.h:29
Definition: Window_W32.h:18
void ConstrainCursor(bool constrain) override
void Hide() override
Str_16 GetTitle_16() const override
void Show() override
xcb_window_t hdl
Definition: Window_XCB.h:18
Window(Window &&win) noexcept
void SetTitle_16(const Str_16 &newTitle) override
void SetTitle_32(const Str_32 &newTitle) override
~Window() override
xcb_connection_t * server
Definition: Window_XCB.h:16
void Create_8(const Str_8 &title, const Vec2_s32 &pos, Vec2_u32 scale) override
void Create_32(const Str_32 &title, const Vec2_s32 &pos, Vec2_u32 scale) override
Window & operator=(Window &&win) noexcept
void SetTitle_8(const Str_8 &newTitle) override
void SetPos(const Vec2_s32 &newPos) override
Vec2_s32 GetPos() const override
Vec2_u32 GetScale() const override
Str_32 GetTitle_32() const override
xcb_screen_t * screen
Definition: Window_XCB.h:17
Vector< xcb_generic_event_t * > events
Definition: Window_XCB.h:21
Serializer< UInt_64 > GetClipboard() override
bool Poll() override
void ShowCursor(bool toggle) override
Serializer< UInt_64 > clipboard
Definition: Window_XCB.h:22
UInt_8 extOpCode
Definition: Window_XCB.h:20
void Create_16(const Str_16 &title, const Vec2_s32 &pos, Vec2_u32 scale) override
Window(const Window &win)
Window & operator=(const Window &win)
Str_8 GetTitle_8() const override
void SetScale(const Vec2_u32 &newScale) override
void SetClipboard(Serializer< UInt_64 > data) override
void Close() override
void SetCursorImg(CursorImg img) override
Definition: Anchor.h:6
unsigned char UInt_8
Definition: Types.h:43
unsigned short UInt_16
Definition: Types.h:46
CursorImg
Definition: BaseWindow.h:16