Changeset 33959 in vbox for trunk/src/VBox/Main/ConsoleVRDPServer.cpp
- Timestamp:
- Nov 11, 2010 9:41:52 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleVRDPServer.cpp
r33676 r33959 35 35 #include <VBox/RemoteDesktop/VRDEOrders.h> 36 36 37 class VRDPConsoleListener : 38 VBOX_SCRIPTABLE_IMPL(IEventListener) 37 class VRDPConsoleListener 39 38 { 40 39 public: … … 42 41 : m_server(server) 43 42 { 44 #ifndef VBOX_WITH_XPCOM 45 refcnt = 0; 46 #endif /* !VBOX_WITH_XPCOM */ 47 } 48 49 virtual ~VRDPConsoleListener() {} 50 51 NS_DECL_ISUPPORTS 52 53 #ifndef VBOX_WITH_XPCOM 54 STDMETHOD_(ULONG, AddRef)() { 55 return ::InterlockedIncrement(&refcnt); 56 } 57 STDMETHOD_(ULONG, Release)() 58 { 59 long cnt = ::InterlockedDecrement(&refcnt); 60 if (cnt == 0) 61 delete this; 62 return cnt; 63 } 64 STDMETHOD(QueryInterface)(REFIID riid , void **ppObj) 65 { 66 if (riid == IID_IUnknown) { 67 *ppObj = (IUnknown*)this; 68 AddRef(); 69 return S_OK; 70 } 71 if (riid == IID_IEventListener) { 72 *ppObj = (IEventListener*)this; 73 AddRef(); 74 return S_OK; 75 } 76 *ppObj = NULL; 77 return E_NOINTERFACE; 78 } 79 #endif /* !VBOX_WITH_XPCOM */ 80 81 82 STDMETHOD(HandleEvent)(IEvent * aEvent) 83 { 84 VBoxEventType_T aType = VBoxEventType_Invalid; 85 86 aEvent->COMGETTER(Type)(&aType); 43 } 44 45 STDMETHOD(HandleEvent)(VBoxEventType_T aType, IEvent * aEvent) 46 { 87 47 switch (aType) 88 48 { … … 145 105 ULONG width, ULONG height, ComSafeArrayIn(BYTE,shape)); 146 106 ConsoleVRDPServer *m_server; 147 #ifndef VBOX_WITH_XPCOM148 long refcnt;149 #endif /* !VBOX_WITH_XPCOM */150 107 }; 151 108 152 #ifdef VBOX_WITH_XPCOM 153 #include <nsMemory.h> 154 NS_DECL_CLASSINFO(VRDPConsoleListener) 155 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(VRDPConsoleListener, IEventListener) 156 #endif /* VBOX_WITH_XPCOM */ 109 typedef ListenerImpl<VRDPConsoleListener, ConsoleVRDPServer*> VRDPConsoleListenerImpl; 110 111 VBOX_LISTENER_DECLARE(VRDPConsoleListenerImpl) 157 112 158 113 #ifdef DEBUG_sunlover … … 1220 1175 ComPtr<IEventSource> es; 1221 1176 console->COMGETTER(EventSource)(es.asOutParam()); 1222 mConsoleListener = new VRDPConsoleListener(this); 1223 mConsoleListener->AddRef(); 1177 mConsoleListener = new VRDPConsoleListenerImpl(this); 1224 1178 com::SafeArray <VBoxEventType_T> eventTypes; 1225 1179 eventTypes.push_back(VBoxEventType_OnMousePointerShapeChanged);
Note:
See TracChangeset
for help on using the changeset viewer.