-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWindowImplUnix.h
More file actions
43 lines (34 loc) · 1.07 KB
/
Copy pathWindowImplUnix.h
File metadata and controls
43 lines (34 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#include "Export.h"
#include "../WindowImpl.h"
#include <X11/Xlib.h>
namespace sh::window
{
class WindowImplUnix : public WindowImpl
{
public:
SH_WINDOW_API ~WindowImplUnix() override;
SH_WINDOW_API auto Create(const std::string& title, int wsize, int hsize, uint32_t style) -> WinHandle override;
SH_WINDOW_API void Close() override;
SH_WINDOW_API void ProcessEvent() override;
SH_WINDOW_API auto GetDisplay() -> Display*;
SH_WINDOW_API void SetTitle(std::string_view title) override;
SH_WINDOW_API auto GetWidth() const->uint32_t override;
SH_WINDOW_API auto GetHeight() const->uint32_t override;
SH_WINDOW_API void StopTimer(uint32_t ms) override;
SH_WINDOW_API void Resize(int width, int height) override;
private:
auto CovertKeyCode(unsigned int keycode) -> Event::KeyType;
static auto CheckEvent(Display*, XEvent*, XPointer userData) -> int;
private:
Display* display;
int screen;
::Window win, root;
XEvent e;
XIM xim = nullptr;
XIC xic = nullptr;
Atom wmDeleteMessage;
int widthPrevious;
int heightPrevious;
};
}