Debian Codegraph @

xbmc/windowing/osx/WinEventsOSX.mm

raw
1 /*
2 * Copyright (C) 2011-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9 #include "WinEventsOSX.h"
10
11 #import "WinEventsOSXImpl.h"
12
13 struct CWinEventsOSXImplWrapper
14 {
15 CWinEventsOSXImpl* callbackClass;
16 };
17
18 CWinEventsOSX::CWinEventsOSX() : CThread("CWinEventsOSX")
19 {
20 m_eventsImplWrapper = std::make_unique<CWinEventsOSXImplWrapper>();
21 m_eventsImplWrapper->callbackClass = [CWinEventsOSXImpl new];
22 Create();
23 }
24
25 CWinEventsOSX::~CWinEventsOSX()
26 {
27 m_bStop = true;
28 StopThread(true);
29 }
30
31 void CWinEventsOSX::MessagePush(XBMC_Event* newEvent)
32 {
33 [m_eventsImplWrapper->callbackClass MessagePush:newEvent];
34 }
35
36 size_t CWinEventsOSX::GetQueueSize()
37 {
38 return [m_eventsImplWrapper->callbackClass GetQueueSize];
39 }
40
41 bool CWinEventsOSX::MessagePump()
42 {
43 return [m_eventsImplWrapper->callbackClass MessagePump];
44 }
45
46 void CWinEventsOSX::enableInputEvents()
47 {
48 return [m_eventsImplWrapper->callbackClass enableInputEvents];
49 }
50
51 void CWinEventsOSX::disableInputEvents()
52 {
53 return [m_eventsImplWrapper->callbackClass disableInputEvents];
54 }
55
56 void CWinEventsOSX::signalMouseEntered()
57 {
58 return [m_eventsImplWrapper->callbackClass signalMouseEntered];
59 }
60
61 void CWinEventsOSX::signalMouseExited()
62 {
63 return [m_eventsImplWrapper->callbackClass signalMouseExited];
64 }
65
66 void CWinEventsOSX::SendInputEvent(NSEvent* nsEvent)
67 {
68 [m_eventsImplWrapper->callbackClass ProcessInputEvent:nsEvent];
69 }