HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
gui_window_win32.hpp
1// Copyright Take Vos 2019-2021.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7#include "../GFX/gfx_surface_vulkan.hpp"
8#include "gui_window.hpp"
9#include <unordered_map>
10
11struct HWND__;
12using HWND = HWND__ *;
13
14namespace tt {
15class Application_win32;
16}
17
18namespace tt {
19
20class gui_window_win32 final : public gui_window {
21public:
22 using super = gui_window;
23 using delegate_type = typename super::delegate_type;
24
25 HWND win32Window = nullptr;
26
27 gui_window_win32(label const &title, std::weak_ptr<delegate_type> delegate = {}) noexcept;
28
30
31 void create_window() override;
32 int windowProc(unsigned int uMsg, uint64_t wParam, int64_t lParam) noexcept;
33
34 void set_cursor(mouse_cursor cursor) noexcept override;
35
36 void close_window() override;
37
38 void minimize_window() override;
39
40 void maximize_window() override;
41
42 void normalize_window() override;
43
44 void set_window_size(extent2 extent) override;
45
46 [[nodiscard]] extent2 virtual_screen_size() const noexcept override;
47
48 [[nodiscard]] std::string get_text_from_clipboard() const noexcept override;
49
50 void set_text_on_clipboard(std::string str) noexcept override;
51
52private:
53 void setOSWindowRectangleFromRECT(RECT aarectangle) noexcept;
54
55 TRACKMOUSEEVENT trackMouseLeaveEventParameters;
56 bool trackingMouseLeaveEvent = false;
57 char32_t highSurrogate = 0;
58 mouse_event mouseButtonEvent;
59 hires_utc_clock::time_point doubleClickTimePoint;
60 hires_utc_clock::duration doubleClickMaximumDuration;
61
62 [[nodiscard]] KeyboardState getKeyboardState() noexcept;
63 [[nodiscard]] keyboard_modifiers getkeyboard_modifiers() noexcept;
64
65 [[nodiscard]] char32_t handleSuragates(char32_t c) noexcept;
66 [[nodiscard]] mouse_event createmouse_event(unsigned int uMsg, uint64_t wParam, int64_t lParam) noexcept;
67};
68
69} // namespace tt
STL namespace.
Class which represents an axis-aligned rectangle.
Definition axis_aligned_rectangle.hpp:20
Definition gui_window.hpp:36
Definition gui_window_delegate.hpp:12
Definition gui_window_win32.hpp:20
void normalize_window() override
Ask the operating system to normalize this window.
void set_cursor(mouse_cursor cursor) noexcept override
Set the mouse cursor icon.
void minimize_window() override
Ask the operating system to minimize this window.
void set_text_on_clipboard(std::string str) noexcept override
Place a text string on the operating system's clip-board.
void create_window() override
Let the operating system create the actual window.
void close_window() override
Ask the operating system to close this window.
void maximize_window() override
Ask the operating system to maximize this window.
std::string get_text_from_clipboard() const noexcept override
Retrieve a text string from the operating system's clip-board.
void set_window_size(extent2 extent) override
Ask the operating system to set the size of this window.
extent2 virtual_screen_size() const noexcept override
Get the size of the virtual-screen.
Definition mouse_event.hpp:15
Timestamp.
Definition hires_utc_clock.hpp:19
A label consisting of localizable text and an icon.
Definition label.hpp:27