Window: Add window "token" type, unique for each window instance

Not recycled even for windows with same class/ID
Token may outlive window, unlike pointer
This commit is contained in:
Jonathan G Rennison
2023-12-28 02:24:36 +00:00
parent 117deb0c62
commit ea1ba56ec4
4 changed files with 27 additions and 0 deletions

View File

@@ -255,6 +255,8 @@ struct Window : ZeroedMemoryAllocator {
WindowClass window_class; ///< Window class
private:
WindowToken window_token;
/**
* Helper allocation function to disallow something.
* Don't allow arrays; arrays of Windows are pointless as you need
@@ -334,6 +336,8 @@ public:
void ChangeWindowClass(WindowClass cls);
WindowToken GetWindowToken() const { return this->window_token; }
/**
* Set the timeout flag of the window and initiate the timer.
*/