HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Application_win32.hpp
1// Copyright 2019 Pokitec
2// All rights reserved.
3
4#pragma once
5
6#include "application.hpp"
7#include <thread>
8
9namespace tt {
10
11// WM_USER = ?-0x7fff
12// WM_APP = 0x8000-0xbfff.
13constexpr unsigned int WM_WIN_LANGUAGE_CHANGE = 0x8000 - 1;
14constexpr unsigned int WM_APP_CALL_FUNCTION = 0x8000 + 1;
15
16class application_win32 final : public application {
17public:
19 ~application_win32() = default;
20
21 application_win32(const application_win32 &) = delete;
22 application_win32 &operator=(const application_win32 &) = delete;
24 application_win32 &operator=(application_win32 &&) = delete;
25
26 void init() override;
27
28 void run_from_main_loop(std::function<void()> function) override;
29
30 int loop() override;
31
32 void exit(int exit_code) override;
33
36 [[nodiscard]] std::vector<void *> win32_windows() noexcept;
37
40 void post_message(void *window, unsigned int Msg, ptrdiff_t wParam = 0, ptrdiff_t lParam = 0) noexcept;
41
44 void post_message(std::vector<void *> const &windows, unsigned int Msg, ptrdiff_t wParam = 0, ptrdiff_t lParam = 0) noexcept;
45
46protected:
47 typename timer::callback_ptr_type languages_maintenance_callback;
48
49 void init_audio() override;
50};
51
52} // namespace tt
STL namespace.
Definition application.hpp:36
std::weak_ptr< application_delegate > delegate
Definition application.hpp:42
os_handle instance
Handle to the operating system's application-instance.
Definition application.hpp:50
std::vector< std::string > arguments
Definition application.hpp:46
Definition Application_win32.hpp:16
void init() override
Two phase construction.
int loop() override
void post_message(void *window, unsigned int Msg, ptrdiff_t wParam=0, ptrdiff_t lParam=0) noexcept
Send a win32 message to a window, on the thread associated with that window.
std::vector< void * > win32_windows() noexcept
Get a win32 handle to each window of the application.
void run_from_main_loop(std::function< void()> function) override
void exit(int exit_code) override
Exit the main loop and exit the application.
A timer which will execute callbacks at given intervals.
Definition timer.hpp:19