Sparkle 0.0.1
Loading...
Searching...
No Matches
spk_class.hpp
1#pragma once
2
3#include <Windows.h>
4#include <string>
5#include <unordered_map>
6
7#include "structure/win32/spk_window.hpp"
8
9namespace spk
10{
11 namespace Win32
12 {
23 class Class
24 {
25 private:
26 static void _subscribe(const std::wstring &p_className, const WNDPROC &p_windowProcedure);
27 static void _unsubscribe(const std::wstring &p_className);
28
29 static inline std::unordered_map<std::wstring, size_t> _classSubscriptionMap;
30
31 std::wstring _className;
32
33 public:
39 Class(const std::wstring &p_className, const WNDPROC &p_windowProcedure);
40 ~Class();
41
49 Window instanciate(const std::wstring &p_title, const spk::Extend2D &p_extend, void *p_userPtr);
50 };
51 }
52}
Window instanciate(const std::wstring &p_title, const spk::Extend2D &p_extend, void *p_userPtr)
Creates a window instance bound to this class.
Definition spk_class.cpp:62
Class(const std::wstring &p_className, const WNDPROC &p_windowProcedure)
Registers a Win32 class name with a window procedure.
Definition spk_class.cpp:40
RAII wrapper over a Win32 HWND handle created by spk::Win32::Class.
Definition spk_window.hpp:20
Axis-aligned rectangle defined by an anchor point and size.
Definition spk_extend_2d.hpp:24