Utility/Window: Add new event system, based on signals

Old pooling-based system remains for now but is now deprecated


Former-commit-id: 803c6f51e8287613610ede8433bef8112bc70352 [formerly 9f60f0fabea7fa0d0d62feba217e28c421522e36] [formerly f05d3dededee17402669ec9e4060c95d77c74bb4 [formerly 5b96073b92c3a10a5c485abcc7c33ecedb819fca]]
Former-commit-id: 4280c668fb5ec67c0b765a80516b9b4fe466135d [formerly c8ce15aa230bf2f1040b00153ec81aa1f39ef48d]
Former-commit-id: 71893d639b5e1628776d8a4577b0309437865c16
This commit is contained in:
Lynix
2016-08-28 01:08:38 +02:00
parent 6b155f7e14
commit 618449c13a
7 changed files with 181 additions and 38 deletions

View File

@@ -14,7 +14,7 @@
#include <Nazara/Math/Vector2.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Enums.hpp>
#include <Nazara/Utility/Event.hpp>
#include <Nazara/Utility/EventHandler.hpp>
#include <Nazara/Utility/VideoMode.hpp>
#include <Nazara/Utility/WindowHandle.hpp>
#include <queue>
@@ -52,9 +52,11 @@ namespace Nz
void Destroy();
NAZARA_DEPRECATED("Event pooling/waiting is deprecated, please use the EventHandler system") inline void EnableEventPolling(bool enable);
void EnableKeyRepeat(bool enable);
void EnableSmoothScrolling(bool enable);
EventHandler& GetEventHandler();
WindowHandle GetHandle() const;
unsigned int GetHeight() const;
Vector2i GetPosition() const;
@@ -71,7 +73,9 @@ namespace Nz
inline bool IsValid() const;
bool IsVisible() const;
bool PollEvent(WindowEvent* event);
NAZARA_DEPRECATED("Event pooling/waiting is deprecated, please use the EventHandler system") bool PollEvent(WindowEvent* event);
void ProcessEvents(bool block = false);
void SetCursor(WindowCursor cursor);
void SetCursor(const Cursor& cursor);
@@ -90,7 +94,7 @@ namespace Nz
void SetTitle(const String& title);
void SetVisible(bool visible);
bool WaitEvent(WindowEvent* event);
NAZARA_DEPRECATED("Event pooling/waiting is deprecated, please use the EventHandler system")bool WaitEvent(WindowEvent* event);
Window& operator=(const Window&) = delete;
inline Window& operator=(Window&& window);
@@ -114,10 +118,11 @@ namespace Nz
ConditionVariable m_eventCondition;
Mutex m_eventMutex;
Mutex m_eventConditionMutex;
bool m_eventListener;
bool m_waitForEvent;
#endif
EventHandler m_eventHandler;
bool m_closed;
bool m_eventPolling;
bool m_ownsWindow;
};
}