mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-01 23:12:49 +02:00
Replaced SDL user events list with dispatching of arbitrary functors
This commit is contained in:
@@ -87,7 +87,9 @@ void CGuiHandler::handleEvents()
|
||||
|
||||
void CGuiHandler::fakeMouseMove()
|
||||
{
|
||||
pushUserEvent(EUserEvent::FAKE_MOUSE_MOVE);
|
||||
dispatchMainThread([](){
|
||||
GH.events().dispatchMouseMoved(Point(0, 0), GH.getCursorPosition());
|
||||
});
|
||||
}
|
||||
|
||||
void CGuiHandler::startTextInput(const Rect & whereInput)
|
||||
@@ -203,14 +205,9 @@ bool CGuiHandler::amIGuiThread()
|
||||
return inGuiThread.get() && *inGuiThread;
|
||||
}
|
||||
|
||||
void CGuiHandler::pushUserEvent(EUserEvent usercode)
|
||||
void CGuiHandler::dispatchMainThread(const std::function<void()> & functor)
|
||||
{
|
||||
inputHandlerInstance->pushUserEvent(usercode, nullptr);
|
||||
}
|
||||
|
||||
void CGuiHandler::pushUserEvent(EUserEvent usercode, void * userdata)
|
||||
{
|
||||
inputHandlerInstance->pushUserEvent(usercode, userdata);
|
||||
inputHandlerInstance->dispatchMainThread(functor);
|
||||
}
|
||||
|
||||
IScreenHandler & CGuiHandler::screenHandler()
|
||||
|
||||
Reference in New Issue
Block a user