forked from Shell4026/ShellEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWindowImpl.h
More file actions
47 lines (38 loc) · 1.13 KB
/
Copy pathWindowImpl.h
File metadata and controls
47 lines (38 loc) · 1.13 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
44
45
46
47
#pragma once
#include "Export.h"
#include "Event.h"
#include <string>
#include <string_view>
#include <queue>
#ifdef _WIN32
struct HWND__;
#elif __linux__
#include <utility>
struct _XDisplay;
using XWindow = unsigned long;
#endif
namespace sh::window {
#ifdef _WIN32
using WinHandle = HWND__*;
#elif __linux__
using WinHandle = std::pair<_XDisplay*, XWindow>;
#endif
class WindowImpl {
private:
std::queue<Event> events;
public:
SH_WINDOW_API virtual ~WindowImpl();
SH_WINDOW_API void PushEvent(const Event& e);
SH_WINDOW_API Event PopEvent();
SH_WINDOW_API bool IsEmptyEvent() const;
SH_WINDOW_API virtual auto Create(const std::string& title, int wsize, int hsize, uint32_t style) -> WinHandle = 0;
SH_WINDOW_API virtual void Close() = 0;
SH_WINDOW_API virtual void ProcessEvent() = 0;
SH_WINDOW_API virtual void SetTitle(std::string_view title) = 0;
SH_WINDOW_API virtual auto GetWidth() const->uint32_t = 0;
SH_WINDOW_API virtual auto GetHeight() const->uint32_t = 0;
/// @brief 일정 시간동안 스레드를 멈추는 함수
/// @param ms 밀리초
SH_WINDOW_API virtual void StopTimer(uint32_t ms) = 0;
};
}