VirtualBox

Ignore:
Timestamp:
Sep 7, 2009 7:33:48 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
52043
Message:

video hw accel: generic template for overlay buffer

Location:
trunk/src/VBox/Frontends/VirtualBox/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxFBOverlay.h

    r22817 r22822  
    12571257
    12581258
     1259template <class T>
     1260class VBoxOverlayFrameBuffer : public T
     1261{
     1262public:
     1263    VBoxOverlayFrameBuffer (class VBoxConsoleView *aView)
     1264        : T(aView),
     1265          mOverlay(aView, this)
     1266    {}
     1267
     1268
     1269    STDMETHOD(ProcessVHWACommand)(BYTE *pCommand)
     1270    {
     1271        return mOverlay.onVHWACommand((VBOXVHWACMD*)pCommand);
     1272    }
     1273
     1274    void doProcessVHWACommand(QEvent * pEvent)
     1275    {
     1276        mOverlay.onVHWACommandEvent(pEvent);
     1277    }
     1278
     1279    STDMETHOD(NotifyUpdate) (ULONG aX, ULONG aY,
     1280                             ULONG aW, ULONG aH)
     1281    {
     1282        if(mOverlay.onNotifyUpdate(aX, aY, aW, aH))
     1283            return S_OK;
     1284        return T::NotifyUpdate(aX, aY, aW, aH);
     1285    }
     1286
     1287    void paintEvent (QPaintEvent *pe)
     1288    {
     1289        QRect rect;
     1290        VBOXFBOVERLAY_RESUT res = mOverlay.onPaintEvent(pe, &rect);
     1291        switch(res)
     1292        {
     1293            case VBOXFBOVERLAY_MODIFIED:
     1294            {
     1295                QPaintEvent modified(rect);
     1296                T::paintEvent(&modified);
     1297            } break;
     1298            case VBOXFBOVERLAY_UNTOUCHED:
     1299                T::paintEvent(pe);
     1300                break;
     1301        }
     1302    }
     1303
     1304    void resizeEvent (VBoxResizeEvent *re)
     1305    {
     1306        mOverlay.onResizeEvent(re);
     1307        T::resizeEvent(re);
     1308        mOverlay.onResizeEventPostprocess(re);
     1309    }
     1310private:
     1311    VBoxQGLOverlay mOverlay;
     1312};
     1313
    12591314#endif
    12601315
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h

    r22818 r22822  
    333333};
    334334
    335 # ifdef VBOX_WITH_VIDEOHWACCEL
    336 #  ifdef VBOX_GUI_USE_QIMAGE
    337 class VBoxQImageOverlayFrameBuffer : public VBoxQImageFrameBuffer
    338 {
    339 public:
    340     VBoxQImageOverlayFrameBuffer (VBoxConsoleView *aView);
    341 
    342 
    343     STDMETHOD(ProcessVHWACommand)(BYTE *pCommand);
    344 
    345     void doProcessVHWACommand(QEvent * pEvent);
    346 
    347     STDMETHOD(NotifyUpdate) (ULONG aX, ULONG aY,
    348                              ULONG aW, ULONG aH);
    349 
    350     void paintEvent (QPaintEvent *pe);
    351     void resizeEvent (VBoxResizeEvent *re);
    352 private:
    353     VBoxQGLOverlay mOverlay;
    354 };
    355 #  endif /* #  ifdef VBOX_GUI_USE_QIMAGE */
    356 # endif /* # ifdef VBOX_WITH_VIDEOHWACCEL */
    357 
    358335#endif
    359336
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