Changeset 35722 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jan 26, 2011 4:37:16 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r35446 r35722 99 99 100 100 virtual ~VirtualBoxClientEventListener() 101 { 102 } 103 104 HRESULT init() 105 { 106 return S_OK; 107 } 108 109 void uninit() 101 110 { 102 111 } … … 145 154 146 155 virtual ~VirtualBoxEventListener() 156 { 157 } 158 159 HRESULT init() 160 { 161 return S_OK; 162 } 163 164 void uninit() 147 165 { 148 166 } … … 252 270 253 271 virtual ~ConsoleEventListener() 272 { 273 } 274 275 HRESULT init() 276 { 277 return S_OK; 278 } 279 280 void uninit() 254 281 { 255 282 } … … 763 790 ComPtr<IMachine> machine; 764 791 bool fSessionOpened = false; 765 IEventListener *vboxClientListener = NULL;766 IEventListener *vboxListener = NULL;767 Co nsoleEventListenerImpl *consoleListener = NULL;792 ComPtr<IEventListener> vboxClientListener; 793 ComPtr<IEventListener> vboxListener; 794 ComObjPtr<ConsoleEventListenerImpl> consoleListener; 768 795 769 796 do … … 1001 1028 ComPtr<IEventSource> pES; 1002 1029 CHECK_ERROR(pVirtualBoxClient, COMGETTER(EventSource)(pES.asOutParam())); 1003 vboxClientListener = new VirtualBoxClientEventListenerImpl(); 1030 ComObjPtr<VirtualBoxClientEventListenerImpl> listener; 1031 listener.createObject(); 1032 listener->init(new VirtualBoxClientEventListener()); 1033 vboxClientListener = listener; 1004 1034 com::SafeArray<VBoxEventType_T> eventTypes; 1005 1035 eventTypes.push_back(VBoxEventType_OnVBoxSVCAvailabilityChanged); … … 1011 1041 ComPtr<IEventSource> es; 1012 1042 CHECK_ERROR(console, COMGETTER(EventSource)(es.asOutParam())); 1013 consoleListener = new ConsoleEventListenerImpl(); 1043 consoleListener.createObject(); 1044 consoleListener->init(new ConsoleEventListener()); 1014 1045 com::SafeArray<VBoxEventType_T> eventTypes; 1015 1046 eventTypes.push_back(VBoxEventType_OnMouseCapabilityChanged); … … 1166 1197 ComPtr<IEventSource> es; 1167 1198 CHECK_ERROR(virtualBox, COMGETTER(EventSource)(es.asOutParam())); 1168 vboxListener = new VirtualBoxEventListenerImpl(); 1199 ComObjPtr<VirtualBoxEventListenerImpl> listener; 1200 listener.createObject(); 1201 listener->init(new VirtualBoxEventListener()); 1202 vboxListener = listener; 1169 1203 com::SafeArray<VBoxEventType_T> eventTypes; 1170 1204 eventTypes.push_back(VBoxEventType_OnGuestPropertyChanged); -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r35666 r35722 245 245 } 246 246 247 HRESULT init() 248 { 249 return S_OK; 250 } 251 252 void uninit() 253 { 254 } 255 247 256 STDMETHOD(HandleEvent)(VBoxEventType_T aType, IEvent * aEvent) 248 257 { … … 287 296 288 297 virtual ~VBoxSDLEventListener() 298 { 299 } 300 301 HRESULT init() 302 { 303 return S_OK; 304 } 305 306 void uninit() 289 307 { 290 308 } … … 347 365 348 366 virtual ~VBoxSDLConsoleEventListener() 367 { 368 } 369 370 HRESULT init() 371 { 372 return S_OK; 373 } 374 375 void uninit() 349 376 { 350 377 } … … 772 799 uint32_t memorySize = 0; 773 800 uint32_t vramSize = 0; 774 IEventListener *pVBoxClientListener = NULL;775 IEventListener *pVBoxListener = NULL;776 VBoxSDLConsoleEventListenerImpl *pConsoleListener = NULL;801 ComPtr<IEventListener> pVBoxClientListener; 802 ComPtr<IEventListener> pVBoxListener; 803 ComObjPtr<VBoxSDLConsoleEventListenerImpl> pConsoleListener; 777 804 778 805 bool fFullscreen = false; … … 1834 1861 ComPtr<IEventSource> pES; 1835 1862 CHECK_ERROR(pVirtualBoxClient, COMGETTER(EventSource)(pES.asOutParam())); 1836 pVBoxClientListener = new VBoxSDLClientEventListenerImpl(); 1863 ComObjPtr<VBoxSDLClientEventListenerImpl> listener; 1864 listener.createObject(); 1865 listener->init(new VBoxSDLClientEventListener()); 1866 pVBoxClientListener = listener; 1837 1867 com::SafeArray<VBoxEventType_T> eventTypes; 1838 1868 eventTypes.push_back(VBoxEventType_OnVBoxSVCAvailabilityChanged); … … 1844 1874 ComPtr<IEventSource> pES; 1845 1875 CHECK_ERROR(pVirtualBox, COMGETTER(EventSource)(pES.asOutParam())); 1846 pVBoxListener = new VBoxSDLEventListenerImpl(); 1876 ComObjPtr<VBoxSDLEventListenerImpl> listener; 1877 listener.createObject(); 1878 listener->init(new VBoxSDLEventListener()); 1879 pVBoxListener = listener; 1847 1880 com::SafeArray<VBoxEventType_T> eventTypes; 1848 1881 eventTypes.push_back(VBoxEventType_OnExtraDataChanged); … … 1854 1887 ComPtr<IEventSource> pES; 1855 1888 CHECK_ERROR(gpConsole, COMGETTER(EventSource)(pES.asOutParam())); 1856 pConsoleListener = new VBoxSDLConsoleEventListenerImpl(); 1889 pConsoleListener.createObject(); 1890 pConsoleListener->init(new VBoxSDLConsoleEventListener()); 1857 1891 com::SafeArray<VBoxEventType_T> eventTypes; 1858 1892 eventTypes.push_back(VBoxEventType_OnMousePointerShapeChanged); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIExtraDataEventHandler.cpp
r34527 r35722 252 252 // RTPrintf("Self add: %RTthrd\n", RTThreadSelf()); 253 253 const CVirtualBox &vbox = vboxGlobal().virtualBox(); 254 UIMainEventListenerImpl *pListener = new UIMainEventListenerImpl(this); 254 ComObjPtr<UIMainEventListenerImpl> pListener; 255 pListener.createObject(); 256 pListener->init(new UIMainEventListener(), this); 255 257 m_mainEventListener = CEventListener(pListener); 256 258 QVector<KVBoxEventType> events; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp
r34527 r35722 25 25 //#include <iprt/stream.h> 26 26 27 UIMainEventListener::UIMainEventListener(QObject * /* pParent */) 28 // : QObject(pParent) /* Todo: Not sure if pParent should delete this. Especially on Win there is ref counting implemented. */ 27 UIMainEventListener::UIMainEventListener() 29 28 : QObject() 30 29 { … … 42 41 } 43 42 43 HRESULT UIMainEventListener::init(QObject * /* pParent */) 44 { 45 return S_OK; 46 } 47 48 void UIMainEventListener::uninit() 49 { 50 } 44 51 45 52 /** … … 50 57 { 51 58 CEvent event(pEvent); 52 // RTPrintf("Event received: %d (%RTthrd)\n", event.GetType(), RTThreadSelf());59 // printf("Event received: %d\n", event.GetType()); 53 60 switch(event.GetType()) 54 61 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h
r34527 r35722 43 43 44 44 public: 45 UIMainEventListener(QObject *pParent); 45 UIMainEventListener(); 46 47 48 HRESULT init(QObject *pParent); 49 void uninit(); 46 50 47 51 STDMETHOD(HandleEvent)(VBoxEventType_T aType, IEvent *pEvent); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r35665 r35722 5249 5249 QApplication::removePostedEvents (this); 5250 5250 5251 #ifdef Q_WS_WIN5252 /* COM for the main thread is shutdown in main() */5253 #else5254 5251 COMBase::CleanupCOM(); 5255 #endif5256 5252 5257 5253 mValid = false; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.cpp
r34527 r35722 59 59 60 60 // RTPrintf("Self add: %RTthrd\n", RTThreadSelf()); 61 UIMainEventListenerImpl *pListener = new UIMainEventListenerImpl(this); 61 ComObjPtr<UIMainEventListenerImpl> pListener; 62 pListener.createObject(); 63 pListener->init(new UIMainEventListener(), this); 62 64 m_mainEventListener = CEventListener(pListener); 63 65 QVector<KVBoxEventType> events; -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVirtualBoxEventHandler.cpp
r34527 r35722 52 52 // RTPrintf("Self add: %RTthrd\n", RTThreadSelf()); 53 53 const CVirtualBox &vbox = vboxGlobal().virtualBox(); 54 UIMainEventListenerImpl *pListener = new UIMainEventListenerImpl(this); 54 ComObjPtr<UIMainEventListenerImpl> pListener; 55 pListener.createObject(); 56 pListener->init(new UIMainEventListener(), this); 55 57 m_mainEventListener = CEventListener(pListener); 56 58 QVector<KVBoxEventType> events;
Note:
See TracChangeset
for help on using the changeset viewer.