EHS
Window_W32.h
Go to the documentation of this file.
1#pragma once
2
3#include "ehs/EHS.h"
4#include "ehs/Array.h"
5#include "ehs/Str.h"
6#include "ehs/Vec4.h"
7#include "BaseWindow.h"
8#include "HID/InputHandler.h"
9
10#define WM_HIDE (WM_APP + 1)
11#define WM_SHOW (WM_APP + 2)
12#define WM_HIDE_CURSOR (WM_APP + 3)
13#define WM_SHOW_CURSOR (WM_APP + 4)
14
15namespace ehs
16{
17 class EHS_LIB_IO Window : public BaseWindow
18 {
19 private:
20 UInt_32 owner;
21 HINSTANCE instance;
22 HWND hdl;
23
24 static Array<Window*> windows;
25
26 static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
27
28 public:
29 ~Window() override;
30
31 Window();
32
33 Window(const Window &win);
34
35 Window& operator=(const Window &win);
36
37 bool Poll() override;
38
40 void Create_32(const Str_32& title, const Vec2_s32& pos, Vec2_u32 scale) override;
41
43 void Create_16(const Str_16& title, const Vec2_s32& pos, Vec2_u32 scale) override;
44
46 void Create_8(const Str_8& title, const Vec2_s32& pos, Vec2_u32 scale) override;
47
49 void Use(HWND windowHdl);
50
52 void Close() override;
53
55 void Show() override;
56
58 void Hide() override;
59
60 void SetTitle_32(const Str_32& title) override;
61
62 Str_32 GetTitle_32() const override;
63
64 void SetTitle_16(const Str_16& title) override;
65
66 Str_16 GetTitle_16() const override;
67
68 void SetTitle_8(const Str_8& title) override;
69
70 Str_8 GetTitle_8() const override;
71
72 void SetIcon(const Str_8& filePath);
73
76 HWND GetHdl() const;
77
80 static HWND GetAvailableHdl();
81
82 HINSTANCE GetInst() const;
83
86 void ToggleEnabled(bool toggle);
87
90 bool IsEnabled();
91
95 void SetPos(const Vec2_s32& newPos) override;
96
99 Vec2_s32 GetPos() const override;
100
101 virtual void OnResized(const Vec2<UInt_32>& newSize);
102
106 void SetScale(const Vec2_u32& newScale) override;
107
110 Vec2_u32 GetScale() const override;
111
112 void ShowCursor(bool toggle) override;
113
114 void ConstrainCursor(bool toggle) override;
115
116 Serializer<UInt_64> GetClipboard() override;
117
118 void SetClipboard(Serializer<UInt_64> data) override;
119
120 void SetCursorImg(CursorImg img) override;
121
122 protected:
123 void SendMsg(UINT msg, WPARAM wParam, LPARAM lParam);
124
125 };
126}
Definition: Array.h:16
Definition: BaseWindow.h:22
Definition: Str.h:29
Definition: Window_W32.h:18
Definition: Anchor.h:6
unsigned int UInt_32
Definition: Types.h:49
CursorImg
Definition: BaseWindow.h:16