2 * Copyright (C) 2011-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
9 #include "WinEventsOSX.h"
11 #import "WinEventsOSXImpl.h"
13 struct CWinEventsOSXImplWrapper
15 CWinEventsOSXImpl* callbackClass;
18 CWinEventsOSX::CWinEventsOSX() : CThread("CWinEventsOSX")
20 m_eventsImplWrapper = std::make_unique<CWinEventsOSXImplWrapper>();
21 m_eventsImplWrapper->callbackClass = [CWinEventsOSXImpl new];
25 CWinEventsOSX::~CWinEventsOSX()
31 void CWinEventsOSX::MessagePush(XBMC_Event* newEvent)
33 [m_eventsImplWrapper->callbackClass MessagePush:newEvent];
36 size_t CWinEventsOSX::GetQueueSize()
38 return [m_eventsImplWrapper->callbackClass GetQueueSize];
41 bool CWinEventsOSX::MessagePump()
43 return [m_eventsImplWrapper->callbackClass MessagePump];
46 void CWinEventsOSX::enableInputEvents()
48 return [m_eventsImplWrapper->callbackClass enableInputEvents];
51 void CWinEventsOSX::disableInputEvents()
53 return [m_eventsImplWrapper->callbackClass disableInputEvents];
56 void CWinEventsOSX::signalMouseEntered()
58 return [m_eventsImplWrapper->callbackClass signalMouseEntered];
61 void CWinEventsOSX::signalMouseExited()
63 return [m_eventsImplWrapper->callbackClass signalMouseExited];
66 void CWinEventsOSX::SendInputEvent(NSEvent* nsEvent)
68 [m_eventsImplWrapper->callbackClass ProcessInputEvent:nsEvent];