HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
gui_window_vulkan_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 "gui_window_vulkan.hpp"
8#include <unordered_map>
9
10struct HWND__;
11using HWND = HWND__ *;
12
13namespace tt {
14class Application_win32;
15}
16
17namespace tt {
18
20public:
21 HWND win32Window = nullptr;
22
23 gui_window_vulkan_win32(gui_system &system, std::weak_ptr<gui_window_delegate> const &delegate, label const &title);
25
27 gui_window_vulkan_win32 &operator=(const gui_window_vulkan_win32 &) = delete;
30
31 void create_window(const std::u8string &title, extent2 extent) override;
32 int windowProc(unsigned int uMsg, uint64_t wParam, int64_t lParam) noexcept;
33
34 vk::SurfaceKHR getSurface() const override;
35
36 void set_cursor(mouse_cursor cursor) noexcept override;
37
38 void close_window() override;
39
40 void minimize_window() override;
41
42 void maximize_window() override;
43
44 void normalize_window() override;
45
47
48 [[nodiscard]] extent2 virtual_screen_size() const noexcept override;
49
50 [[nodiscard]] std::string get_text_from_clipboard() const noexcept override;
51
52 void set_text_on_clipboard(std::string str) noexcept override;
53
54private:
55 void setOSWindowRectangleFromRECT(RECT aarectangle) noexcept;
56
57 TRACKMOUSEEVENT trackMouseLeaveEventParameters;
58 bool trackingMouseLeaveEvent = false;
59 char32_t highSurrogate = 0;
60 mouse_event mouseButtonEvent;
61 hires_utc_clock::time_point doubleClickTimePoint;
62 hires_utc_clock::duration doubleClickMaximumDuration;
63
64 [[nodiscard]] KeyboardState getKeyboardState() noexcept;
65 [[nodiscard]] keyboard_modifiers getkeyboard_modifiers() noexcept;
66
67 [[nodiscard]] char32_t handleSuragates(char32_t c) noexcept;
68 [[nodiscard]] mouse_event createmouse_event(unsigned int uMsg, uint64_t wParam, int64_t lParam) noexcept;
69
70
71};
72
73}
STL namespace.
Class which represents an axis-aligned rectangle.
Definition axis_aligned_rectangle.hpp:18
Vulkan gui_device controller.
Definition gui_system.hpp:24
extent2 extent
The current window extent as set by the GPU library.
Definition gui_window.hpp:76
Definition gui_window_vulkan.hpp:39
Definition gui_window_vulkan_win32.hpp:19
std::string get_text_from_clipboard() const noexcept override
Retrieve a text string from the operating system's clip-board.
void set_text_on_clipboard(std::string str) noexcept override
Place a text string on the operating system's clip-board.
void normalize_window() override
Ask the operating system to normalize this window.
extent2 virtual_screen_size() const noexcept override
Get the size of the virtual-screen.
void create_window(const std::u8string &title, extent2 extent) override
Let the operating system create the actual window.
void maximize_window() override
Ask the operating system to maximize this window.
vk::SurfaceKHR getSurface() const override
void set_window_size(extent2 extent) override
Ask the operating system to set the size of 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 close_window() override
Ask the operating system to close this window.
Definition mouse_event.hpp:15
Timestamp.
Definition hires_utc_clock.hpp:16
A localized text + icon label.
Definition label.hpp:76