VirtualBox

Changeset 7867 in vbox


Ignore:
Timestamp:
Apr 10, 2008 12:24:19 PM (17 years ago)
Author:
vboxsync
Message:

FE/Qt4: Ported the Quartz2D framebuffer implementation (Seamless isn't fully working).

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxFrameBuffer.h

    r7610 r7867  
    453453
    454454private:
    455 
    456     inline CGRect QRectToCGRect (const QRect &aRect) const
    457     {
    458         return CGRectMake (aRect.x(), aRect.y(), aRect.width(), aRect.height());
    459     }
    460 
    461     inline QRect mapYOrigin (const QRect &aRect, int aHeight) const
    462     {
    463         /* The cgcontext has a fliped y-coord relative to the
    464          * qt coord system. So we need some mapping here */
    465         return QRect (aRect.x(), aHeight - (aRect.y() + aRect.height()),
    466                       aRect.width(), aRect.height());
    467     }
    468455
    469456    void clean();
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxUtils.h

    r7789 r7867  
    197197# undef PAGE_SHIFT
    198198# include <Carbon/Carbon.h>
     199
     200#define AssertCarbonOSStatus(a) AssertMsg ((a) == noErr, ("Carbon OSStatus: %d\n", static_cast<int> (a)))
     201
    199202class QImage;
    200203class QPixmap;
     
    208211void DarwinUpdateDockPreview (VBoxFrameBuffer *aFrameBuffer, CGImageRef aOverlayImage);
    209212OSStatus DarwinRegionHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData);
     213
     214inline HIViewRef mapToHIViewRef (QWidget *aWidget)
     215{
     216    return HIViewRef(aWidget->winId());
     217}
     218
     219inline WindowRef mapToWindowRef (HIViewRef aViewRef)
     220{
     221    return reinterpret_cast<WindowRef> (HIViewGetWindow(aViewRef));
     222}
     223
     224inline WindowRef mapToWindowRef (QWidget *aWidget)
     225{
     226    return mapToWindowRef (mapToHIViewRef (aWidget));
     227}
     228
     229inline CGContextRef mapToCGContextRef (QWidget *aWidget)
     230{
     231    return static_cast<CGContext *> (aWidget->macCGHandle());
     232}
     233
     234inline HIRect mapToHIRect (const QRect &aRect)
     235{
     236    return CGRectMake (aRect.x(), aRect.y(), aRect.width(), aRect.height());
     237}
     238
    210239#endif /* Q_WS_MAC */
    211240
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleView.cpp

    r7619 r7867  
    714714#if defined (VBOX_GUI_USE_QUARTZ2D)
    715715        case VBoxDefs::Quartz2DMode:
     716            /* Indicate that we are doing all
     717             * drawing stuff ourself */
     718            pViewport->setAttribute (Qt::WA_PaintOnScreen);
    716719            mFrameBuf = new VBoxQuartz2DFrameBuffer (this);
    717720            break;
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp

    r7721 r7867  
    256256    else
    257257    {
    258         dbgStatisticsAction = NULL;
     258        dbgStatisticsAction = NULL;osstatus
    259259        dbgCommandLineAction = NULL;
    260260    }
     
    11601160            break;
    11611161        }
     1162#ifdef Q_WS_MAC
     1163        case QEvent::Paint:
     1164        {
     1165            if (mIsSeamless)
     1166            {
     1167                /* Clear the background */
     1168                HIRect viewRect;
     1169                HIViewGetBounds (mapToHIViewRef (this), &viewRect);
     1170                CGContextClearRect (mapToCGContextRef (this), viewRect);
     1171            }
     1172            break;
     1173        }
     1174#endif
    11621175        case StatusTipEvent::Type:
    11631176        {
     
    21062119        palette.setColor (centralWidget()->backgroundRole(), Qt::black);
    21072120        centralWidget()->setPalette (palette);
    2108         centralWidget()->setAutoFillBackground (true);
     2121        centralWidget()->setAutoFillBackground (!aSeamless);
    21092122        console_style = console->frameStyle();
    21102123        console->setFrameStyle (QFrame::NoFrame);
     
    21232136        {
    21242137            OSStatus status;
    2125             WindowPtr WindowRef = reinterpret_cast<WindowPtr>(winId());
    2126             EventTypeSpec wNonCompositingEvent = { kEventClassWindow, kEventWindowGetRegion };
    2127             status = InstallWindowEventHandler (WindowRef, DarwinRegionHandler, GetEventTypeCount (wNonCompositingEvent), &wNonCompositingEvent, &mCurrRegion, &mDarwinRegionEventHandlerRef);
    2128             Assert (status == noErr);
    2129             status = ReshapeCustomWindow (WindowRef);
    2130             Assert (status == noErr);
     2138            HIViewRef viewRef = mapToHIViewRef (console->viewport());
     2139            Assert (VALID_PTR (viewRef));
     2140            WindowRef windowRef = mapToWindowRef (viewRef);
     2141            Assert (VALID_PTR (windowRef));
     2142            /* @todo=poetzsch: Currently this isn't necessary. I should
     2143             * investigate if we can/should use this. */
     2144            /*
     2145            EventTypeSpec wCompositingEvent = { kEventClassWindow, kEventWindowGetRegion };
     2146            status = InstallWindowEventHandler ((WindowPtr)winId(), DarwinRegionHandler, GetEventTypeCount (wCompositingEvent), &wCompositingEvent, &mCurrRegion, &mDarwinRegionEventHandlerRef);
     2147            AssertCarbonOSStatus (status);
     2148            HIViewRef contentView = 0;
     2149            status = HIViewFindByID(HIViewGetRoot(windowRef), kHIViewWindowContentID, &contentView);
     2150            AssertCarbonOSStatus (status);
     2151            EventTypeSpec drawEvent = { kEventClassControl, kEventControlDraw };
     2152            status = InstallControlEventHandler (contentView, DarwinRegionHandler, GetEventTypeCount (drawEvent), &drawEvent, &contentView, NULL);
     2153            AssertCarbonOSStatus (status);
     2154            */
    21312155            UInt32 features;
    2132             status = GetWindowFeatures (WindowRef, &features);
    2133             Assert (status == noErr);
     2156            status = GetWindowFeatures (windowRef, &features);
     2157            AssertCarbonOSStatus (status);
    21342158            if (( features & kWindowIsOpaque ) != 0)
    21352159            {
    2136                 status = HIWindowChangeFeatures (WindowRef, 0, kWindowIsOpaque);
    2137                 Assert(status == noErr);
     2160                status = HIWindowChangeFeatures (windowRef, 0, kWindowIsOpaque);
     2161                AssertCarbonOSStatus (status);
    21382162            }
    2139             status = SetWindowAlpha(WindowRef, 0.999);
    2140             Assert (status == noErr);
     2163            status = HIViewReshapeStructure (viewRef);
     2164            AssertCarbonOSStatus (status);
     2165            status = SetWindowAlpha(windowRef, 0.999);
     2166            AssertCarbonOSStatus (status);
    21412167            /* For now disable the shadow of the window. This feature cause errors
    21422168             * if a window in vbox looses focus, is reselected and than moved. */
    21432169            /** @todo Search for an option to enable this again. A shadow on every
    21442170             * window has a big coolness factor. */
    2145             ChangeWindowAttributes (WindowRef, kWindowNoShadowAttribute, 0);
     2171            status = ChangeWindowAttributes (windowRef, kWindowNoShadowAttribute, 0);
     2172            AssertCarbonOSStatus (status);
    21462173        }
    21472174#else
     
    21732200
    21742201#ifdef Q_WS_MAC
    2175         if (!aSeamless)
    2176             SetSystemUIMode (kUIModeNormal, 0);
    2177 
    21782202        if (aSeamless)
    21792203        {
    21802204            /* Undo all mac specific installations */
    21812205            OSStatus status;
    2182             WindowPtr WindowRef = reinterpret_cast<WindowPtr>(winId());
     2206            WindowRef windowRef = mapToWindowRef (this);
     2207            Assert (VALID_PTR (windowRef));
     2208            /* See above.
    21832209            status = RemoveEventHandler (mDarwinRegionEventHandlerRef);
    2184             Assert (status == noErr);
    2185             status = ReshapeCustomWindow (WindowRef);
    2186             Assert (status == noErr);
    2187             status = SetWindowAlpha (WindowRef, 1);
    2188             Assert (status == noErr);
     2210            AssertCarbonOSStatus (status);
     2211            */
     2212            status = ReshapeCustomWindow (windowRef);
     2213            AssertCarbonOSStatus (status);
     2214            status = SetWindowAlpha (windowRef, 1.0);
     2215            AssertCarbonOSStatus (status);
    21892216        }
    21902217#endif
     
    22522279        QRect aRect (aTargetRect);
    22532280        mMaskShift.scale (aTargetRect.left(), aTargetRect.top(), Qt::IgnoreAspectRatio);
    2254 #ifdef Q_WS_MAC
    2255         /* On mac os x this isn't necessary cause the screen starts
    2256          * by y=0 always regardless if there is the global menubar or not. */
    2257         aRect.setRect (aRect.left(), 0, aRect.width(), aRect.height() + aRect.top());
    2258 #endif // Q_WS_MAC
    22592281        /* Set the clipping mask */
    22602282        mStrictedRegion = aRect;
     
    27132735         * an repaint only. All the magic clipping stuff is done
    27142736         * in the paint engine. */
    2715         repaint();
    2716 //        qApp->processEvents();
     2737        HIViewReshapeStructure (mapToHIViewRef (console->viewport()));
     2738//        ReshapeCustomWindow (mapToWindowRef (this));
    27172739    }
    27182740    else
     
    27252747        if (!region.isEmpty())
    27262748            region |= QRect (0, 0, 1, 1);
    2727         /* Save the current region for later processing in the darwin event handler. */
    2728         mCurrRegion = region;
    2729         /* We repaint the screen before the ReshapeCustomWindow command. Unfortunately
    2730          * this command flushes a copy of the backbuffer to the screen after the new
    2731          * mask is set. This leads into a missplaced drawing of the content. Currently
    2732          * no alternative to this and also this is not 100% perfect. */
    2733         repaint();
    2734         qApp->processEvents();
    2735         /* Now force the reshaping of the window. This is definitly necessary. */
    2736         ReshapeCustomWindow (reinterpret_cast <WindowPtr> (winId()));
     2749//        /* Save the current region for later processing in the darwin event handler. */
     2750//        mCurrRegion = region;
     2751//        /* We repaint the screen before the ReshapeCustomWindow command. Unfortunately
     2752//         * this command flushes a copy of the backbuffer to the screen after the new
     2753//         * mask is set. This leads into a missplaced drawing of the content. Currently
     2754//         * no alternative to this and also this is not 100% perfect. */
     2755//        repaint();
     2756//        qApp->processEvents();
     2757//        /* Now force the reshaping of the window. This is definitly necessary. */
     2758//        ReshapeCustomWindow (reinterpret_cast <WindowPtr> (winId()));
     2759        QMainWindow::setMask (region);
    27372760    }
    27382761#else
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxFBQuartz2D.cpp

    r7678 r7867  
    2323#include "VBoxProblemReporter.h"
    2424#include "VBoxGlobal.h"
     25#include "VBoxUtils.h"
    2526/* Needed for checking against seamless mode */
    2627#include "VBoxConsoleWnd.h"
    2728#include "VBoxIChatTheaterWrapper.h"
    2829
    29 /* Qt includes */
    30 #include <qapplication.h>
    31 #include <q3mainwindow.h>
    32 #include <qstatusbar.h>
    33 //Added by qt3to4:
    34 #include <QPaintEvent>
    35 #include <Q3MemArray>
     30//#define COMP_WITH_SHADOW
    3631
    3732/** @class VBoxQuartz2DFrameBuffer
     
    150145}
    151146
    152 void VBoxQuartz2DFrameBuffer::paintEvent (QPaintEvent *pe)
    153 {
    154     /* Some general hints at the beginning:
    155      * The console is not a real sub window of the main window. There is
    156      * one real mac window only. This means all the drawing on the context has
    157      * to pay attention to the statusbar, the scrollbars, the shifting spacers
    158      * and any frame borders.
    159      * Secondly the origin of the coordinate system is differently defined in
    160      * Qt and Quartz2D. In Qt the point (0, 0) means top/left where this is
    161      * bottom/left in Quartz2D. Use mapYOrigin to map from Qt to Quartz2D.
    162      *
    163      * For debugging /Developer/Applications/Performance Tools/Quartz Debug.app
    164      * is a nice tool to see which parts of the screen are updated. */
     147void VBoxQuartz2DFrameBuffer::paintEvent (QPaintEvent *aEvent)
     148{
     149    /* For debugging /Developer/Applications/Performance Tools/Quartz
     150     * Debug.app is a nice tool to see which parts of the screen are
     151     * updated.*/
    165152
    166153    Assert (mImage);
    167154
    168155    QWidget *pMain = qApp->mainWidget();
    169     Assert (pMain);
    170     /* Calculate the view rect to draw in */
    171     QPoint p = mView->viewport()->mapTo (pMain, QPoint (0, 0));
    172     QRect Q2DViewRect = mapYOrigin (QRect (p.x(), p.y(), mView->width(), mView->height()), pMain->height());
    173     /* We have to pay special attention to the scrollbars */
    174 //    if (mView->horizontalScrollBar()->isVisible())
    175 //        Q2DViewRect.setY (Q2DViewRect.y() + (mView->horizontalScrollBar()->frameSize().height() + 2));
    176 //    if (mView->verticalScrollBar()->isVisible())
    177 //        Q2DViewRect.setWidth (Q2DViewRect.width() - (mView->verticalScrollBar()->frameSize().width() + 2));
    178 
    179     /* Create the context to draw on */
    180 //    WindowPtr window = static_cast <WindowPtr> (mView->viewport()->handle());
    181 //    SetPortWindowPort (window);
    182     CGContextRef ctx = static_cast<CGContext *> (mView->viewport()->macCGHandle());
    183 //    QDBeginCGContext (GetWindowPort (window), &ctx);
     156    Assert (VALID_PTR (pMain));
     157    QWidget* viewport = mView->viewport();
     158    Assert (VALID_PTR (viewport));
     159
     160    HIViewRef viewRef = mapToHIViewRef (viewport);
     161    Assert (VALID_PTR (viewRef));
     162    /* Get the dimensions of this HIView */
     163    HIRect viewRect;
     164    HIViewGetBounds (viewRef, &viewRect);
     165    /* Get the context of this window from qt */
     166    CGContextRef ctx = mapToCGContextRef (viewport);
     167    Assert (VALID_PTR (ctx));
    184168    /* We handle the seamless mode as a special case. */
    185     if (static_cast <VBoxConsoleWnd*> (pMain)->isTrueSeamless())
     169    if (qobject_cast <VBoxConsoleWnd *> (pMain)->isTrueSeamless())
    186170    {
    187171        /* Here we paint the windows without any wallpaper.
     
    191175         * Currently this subimage is the whole screen. */
    192176        CGImageRef subImage = CGImageCreateWithImageInRect (mImage, CGRectMake (mView->contentsX(), mView->contentsY(), mView->visibleWidth(), mView->visibleHeight()));
    193         Assert (subImage);
     177        Assert (VALID_PTR (subImage));
    194178        /* Clear the background (Make the rect fully transparent) */
    195         Rect winRect;
    196 //        GetPortBounds (GetWindowPort (window), &winRect);
    197         CGContextClearRect (ctx, CGRectMake (winRect.left, winRect.top, winRect.right - winRect.left, winRect.bottom - winRect.top));
     179        CGContextClearRect (ctx, viewRect);
     180#ifdef COMP_WITH_SHADOW
     181        /* Enable shadows */
     182        CGContextSetShadow (ctx, CGSizeMake (10, -10), 10);
     183        CGContextBeginTransparencyLayer (ctx, NULL);
     184#endif
    198185        /* Grab the current visible region. */
    199186        RegionRects *rgnRcts = (RegionRects *) ASMAtomicXchgPtr ((void * volatile *) &mRegion, NULL);
     
    202189            if (rgnRcts->used > 0)
    203190            {
    204                 /* Save state for display fliping */
    205                 CGContextSaveGState (ctx);
    206                 /* Flip the y-coord */
    207                 CGContextScaleCTM (ctx, 1.0, -1.0);
    208                 CGContextTranslateCTM (ctx, Q2DViewRect.x(), -Q2DViewRect.height() - Q2DViewRect.y());
    209191                /* Add the clipping rects all at once. They are defined in
    210192                 * SetVisibleRegion. */
    211193                CGContextBeginPath (ctx);
    212194                CGContextAddRects (ctx, rgnRcts->rcts, rgnRcts->used);
    213                 /* Restore the context state. Note that the
    214                  * current path isn't destroyed. */
    215                 CGContextRestoreGState (ctx);
    216195                /* Now convert the path to a clipping path. */
    217196                CGContextClip (ctx);
     
    223202        }
    224203        /* In any case clip the drawing to the view window */
    225         CGContextClipToRect (ctx, QRectToCGRect (Q2DViewRect));
     204        CGContextClipToRect (ctx, viewRect);
    226205        /* At this point draw the real vm image */
    227         CGContextDrawImage (ctx, QRectToCGRect (Q2DViewRect), subImage);
     206        HIViewDrawCGImage (ctx, &viewRect, subImage);
     207#ifdef COMP_WITH_SHADOW
     208        CGContextEndTransparencyLayer (ctx);
     209#endif
    228210    }
    229211    else
     
    233215        /* Create a subimage of the current view in the size
    234216         * of the bounding box of the current paint event */
    235         QRect ir = pe->rect();
     217        QRect ir = aEvent->rect();
    236218        QRect is = QRect (ir.x() + mView->contentsX(), ir.y() + mView->contentsY(), ir.width(), ir.height());
    237         CGImageRef subImage = CGImageCreateWithImageInRect (mImage, QRectToCGRect (is));
    238         Assert (subImage);
    239         /* Flip the y-coord */
    240         CGContextScaleCTM (ctx, 1.0, -1.0);
    241         CGContextTranslateCTM (ctx, Q2DViewRect.x(), -Q2DViewRect.height() - Q2DViewRect.y());
    242 
     219        CGImageRef subImage = CGImageCreateWithImageInRect (mImage, mapToHIRect (is));
     220        Assert (VALID_PTR (subImage));
    243221        /* Ok, for more performance we set a clipping path of the
    244222         * regions given by this paint event. */
    245         Q3MemArray <QRect> a = pe->region().rects();
    246 //        if (a.size() > 0)
    247         if (0)
     223        QVector<QRect> a = aEvent->region().rects();
     224        if (!a.isEmpty())
    248225        {
    249             /* Save state for display fliping */
    250             CGContextSaveGState (ctx);
    251             /* Flip the y-coord */
    252226            CGContextBeginPath (ctx);
    253227            /* Add all region rects to the current context as path components */
    254             for (unsigned int i = 0; i < a.size(); ++i)
    255                 CGContextAddRect (ctx, QRectToCGRect (a[i]));
    256             CGContextRestoreGState (ctx);
     228            for (int i = 0; i < a.size(); ++i)
     229                CGContextAddRect (ctx, mapToHIRect (a[i]));
    257230            /* Now convert the path to a clipping path. */
    258231            CGContextClip (ctx);
     
    260233
    261234        /* In any case clip the drawing to the view window */
    262         CGContextClipToRect (ctx, QRectToCGRect (Q2DViewRect));
    263         /* Draw the sub image to the right position */
    264         QPoint p = mView->viewport()->mapTo (pMain, QPoint (ir.x(), ir.y()));
    265         QRect cr = mapYOrigin (QRect (p.x(), p.y(), ir.width(), ir.height()), pMain->height());
    266         CGContextDrawImage (ctx, QRectToCGRect (cr), subImage);
    267     }
    268 //    QDEndCGContext (GetWindowPort (window), &ctx);
    269 }
    270 /* Save for later shadow stuff ... */
    271 //        CGContextSetShadow (myContext, myShadowOffset, 10);
    272 //        CGContextBeginTransparencyLayer (myContext, NULL);
    273 //        CGContextSetShadow (myContext, CGSizeMake (10, 5), 1);
    274 //        CGContextClipToRect (myContext, rect);
    275 //        QRect ir = pe->rect();
    276 //        CGContextClipToRect (myContext, CGRectMake (ir.y(), ir.x(), ir.width(), ir.height()));
    277 //        CGContextEndTransparencyLayer (myContext);
    278 
    279 void VBoxQuartz2DFrameBuffer::resizeEvent (VBoxResizeEvent *re)
     235        CGContextClipToRect (ctx, viewRect);
     236        /* At this point draw the real vm image */
     237        HIRect destRect = mapToHIRect (ir);
     238        HIViewDrawCGImage (ctx, &destRect, subImage);
     239    }
     240}
     241
     242void VBoxQuartz2DFrameBuffer::resizeEvent (VBoxResizeEvent *aEvent)
    280243{
    281244#if 0
    282245    printf ("fmt=%lu, vram=%X, bpp=%lu, bpl=%lu, width=%lu, height=%lu\n",
    283            re->pixelFormat(), (unsigned int)re->VRAM(),
    284            re->bitsPerPixel(), re->bytesPerLine(),
    285            re->width(), re->height());
     246           aEvent->pixelFormat(), (unsigned int)aEvent->VRAM(),
     247           aEvent->bitsPerPixel(), aEvent->bytesPerLine(),
     248           aEvent->width(), aEvent->height());
    286249#endif
    287250
     
    289252    clean();
    290253
    291     mWdt = re->width();
    292     mHgt = re->height();
     254    mWdt = aEvent->width();
     255    mHgt = aEvent->height();
    293256
    294257    bool remind = false;
     
    299262     * Mac OS X supports 16 bit also but not in the 565 mode. So we could use
    300263     * 32 bit only. */
    301     if (   re->pixelFormat() == FramebufferPixelFormat_FOURCC_RGB
    302         && re->bitsPerPixel() == 32)
     264    if (   aEvent->pixelFormat() == FramebufferPixelFormat_FOURCC_RGB
     265        && aEvent->bitsPerPixel() == 32)
    303266    {
    304267//        printf ("VRAM\n");
    305268        CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB();
    306269        /* Create the image copy of the framebuffer */
    307         CGDataProviderRef dp = CGDataProviderCreateWithData (NULL, re->VRAM(), re->bitsPerPixel() / 8 * mWdt * mHgt, NULL);
    308         mImage = CGImageCreate (mWdt, mHgt, 8, re->bitsPerPixel(), re->bytesPerLine(), cs,
     270        CGDataProviderRef dp = CGDataProviderCreateWithData (NULL, aEvent->VRAM(), aEvent->bitsPerPixel() / 8 * mWdt * mHgt, NULL);
     271        mImage = CGImageCreate (mWdt, mHgt, 8, aEvent->bitsPerPixel(), aEvent->bytesPerLine(), cs,
    309272                                kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Little, dp, 0, false,
    310273                                kCGRenderingIntentDefault);
    311         mDataAddress = re->VRAM();
     274        mDataAddress = aEvent->VRAM();
    312275        CGDataProviderRelease (dp);
    313276    }
     
    348311//            }
    349312//        };
    350 //        (new RemindEvent (re->bitsPerPixel()))->post();
     313//        (new RemindEvent (aEvent->bitsPerPixel()))->post();
    351314//    }
    352315}
  • trunk/src/VBox/Frontends/VirtualBox4/src/darwin/VBoxUtils-darwin.cpp

    r7412 r7867  
    251251}
    252252
     253/* Currently not used! */
    253254OSStatus DarwinRegionHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData)
    254255{
     
    270271            if (code == kWindowOpaqueRgn)
    271272            {
     273                printf("test1\n");
    272274                GetEventParameter (aInEvent, kEventParamRgnHandle, typeQDRgnHandle, NULL, sizeof (rgn), NULL, &rgn);
    273275                SetEmptyRgn (rgn);
     
    277279            else if (code == (kWindowStructureRgn))// || kWindowGlobalPortRgn || kWindowUpdateRgn))
    278280            {
     281                printf("test2\n");
    279282                GetEventParameter (aInEvent, kEventParamRgnHandle, typeQDRgnHandle, NULL, sizeof (rgn), NULL, &rgn);
    280283                QRegion *pRegion = static_cast <QRegion*> (aInUserData);
     
    287290            break;
    288291        }
     292        case kEventControlDraw:
     293        {
     294            printf("test3\n");
     295            CGContextRef ctx;
     296            HIRect bounds;
     297
     298            GetEventParameter (aInEvent, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof (ctx), NULL, &ctx);
     299            HIViewGetBounds ((HIViewRef)aInUserData, &bounds);
     300
     301            CGContextClearRect (ctx, bounds);
     302            status = noErr;
     303            break;
     304        }
    289305    }
    290306
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