VirtualBox

Changeset 35722 in vbox for trunk/src/VBox/Frontends/VBoxSDL


Ignore:
Timestamp:
Jan 26, 2011 4:37:16 PM (14 years ago)
Author:
vboxsync
Message:

Main: reworked listener objects creation, fixes Win problems with events, few cleanups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r35666 r35722  
    245245    }
    246246
     247    HRESULT init()
     248    {
     249        return S_OK;
     250    }
     251
     252    void uninit()
     253    {
     254    }
     255
    247256    STDMETHOD(HandleEvent)(VBoxEventType_T aType, IEvent * aEvent)
    248257    {
     
    287296
    288297    virtual ~VBoxSDLEventListener()
     298    {
     299    }
     300
     301    HRESULT init()
     302    {
     303        return S_OK;
     304    }
     305
     306    void uninit()
    289307    {
    290308    }
     
    347365
    348366    virtual ~VBoxSDLConsoleEventListener()
     367    {
     368    }
     369
     370    HRESULT init()
     371    {
     372        return S_OK;
     373    }
     374
     375    void uninit()
    349376    {
    350377    }
     
    772799    uint32_t memorySize = 0;
    773800    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;
    777804
    778805    bool fFullscreen = false;
     
    18341861        ComPtr<IEventSource> pES;
    18351862        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;
    18371867        com::SafeArray<VBoxEventType_T> eventTypes;
    18381868        eventTypes.push_back(VBoxEventType_OnVBoxSVCAvailabilityChanged);
     
    18441874        ComPtr<IEventSource> pES;
    18451875        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;
    18471880        com::SafeArray<VBoxEventType_T> eventTypes;
    18481881        eventTypes.push_back(VBoxEventType_OnExtraDataChanged);
     
    18541887        ComPtr<IEventSource> pES;
    18551888        CHECK_ERROR(gpConsole, COMGETTER(EventSource)(pES.asOutParam()));
    1856         pConsoleListener = new VBoxSDLConsoleEventListenerImpl();
     1889        pConsoleListener.createObject();
     1890        pConsoleListener->init(new VBoxSDLConsoleEventListener());
    18571891        com::SafeArray<VBoxEventType_T> eventTypes;
    18581892        eventTypes.push_back(VBoxEventType_OnMousePointerShapeChanged);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette