VirtualBox

Changeset 17201 in vbox for trunk/src


Ignore:
Timestamp:
Feb 27, 2009 12:51:37 PM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4-OSX: Quartz2D backend back to life for Cocoa.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r17175 r17201  
    153153VirtualBox_DEFS.darwin    = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP
    154154ifndef VBOX_WITH_COCOA_QT
    155 VirtualBox_DEFS.darwin.x86= VBOX_GUI_USE_QUARTZ2D USE_HID_FOR_MODIFIERS
     155VirtualBox_DEFS.darwin.x86= USE_HID_FOR_MODIFIERS
    156156endif
    157157VirtualBox_DEFS.freebsd   = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h

    r16589 r17201  
    4141#endif
    4242#ifdef Q_WS_MAC
    43 # ifdef QT_MAC_USE_COCOA
    44     /** @todo Carbon -> Cocoa */
    45 # else
    46 #  undef PAGE_SIZE
    47 #  undef PAGE_SHIFT
    48 #  include <Carbon/Carbon.h>
    49 # endif
     43# include <ApplicationServices/ApplicationServices.h>
    5044#endif
    5145
     
    396390    QRect mNormalGeometry;
    397391    Qt::WindowFlags mSavedFlags;
    398 # ifdef QT_MAC_USE_COCOA
    399     /** @todo Carbon -> Cocoa */
    400 # else
    401392    /* For the fade effect if the the window goes fullscreen */
    402393    CGDisplayFadeReservationToken mFadeToken;
    403 # endif
    404394#endif
    405395};
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxUtils-darwin.h

    r17175 r17201  
    4141# include <iprt/cdefs.h> /* for __BEGIN_DECLS/__END_DECLS & stuff */
    4242# include <qglobal.h> /* for QT_MAC_USE_COCOA */
     43
     44# include <ApplicationServices/ApplicationServices.h>
    4345class QWidget;
    4446class QToolBar;
     
    6567 ********************************************************************************/
    6668NativeWindowRef darwinToNativeWindowImpl (NativeViewRef aView);
     69NativeViewRef darwinToNativeViewImpl (NativeWindowRef aWindow);
    6770
    6871/********************************************************************************
     
    7477void darwinSetShowsResizeIndicatorImpl (NativeWindowRef aWindow, bool aEnabled);
    7578void darwinSetHidesAllTitleButtonsImpl (NativeWindowRef aWindow);
     79void darwinSetShowsWindowTransparentImpl (NativeWindowRef aWindow, bool aEnabled);
    7680void darwinSetMouseCoalescingEnabled (bool aEnabled);
    7781
     
    8286 ********************************************************************************/
    8387void darwinWindowAnimateResizeImpl (NativeWindowRef aWindow, int x, int y, int width, int height);
     88void darwinWindowInvalidateShapeImpl (NativeWindowRef aWindow);
     89void darwinWindowInvalidateShadowImpl (NativeWindowRef aWindow);
     90
    8491
    8592__END_DECLS
     
    119126NativeWindowRef darwinToNativeWindow (NativeViewRef aView);
    120127
     128/**
     129 * Returns a reference to the native View of the Window.
     130 *
     131 * @returns either HIViewRef or NSView* of the Window.
     132 * @param   aWidget   Pointer to the native Window
     133 */
     134NativeViewRef darwinToNativeView (NativeWindowRef aWindow);
     135
    121136/********************************************************************************
    122137 *
     
    127142void darwinSetShowsResizeIndicator (QWidget *aWidget, bool aEnabled);
    128143void darwinSetHidesAllTitleButtons (QWidget *aWidget);
     144void darwinSetShowsWindowTransparent (QWidget *aWidget, bool aEnabled);
    129145void darwinDisableIconsInMenus (void);
    130146
     
    135151 ********************************************************************************/
    136152void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget);
     153void darwinWindowInvalidateShape (QWidget *aWidget);
     154void darwinWindowInvalidateShadow (QWidget *aWidget);
    137155QString darwinSystemLanguage (void);
    138156QPixmap darwinCreateDragPixmap (const QPixmap& aPixmap, const QString &aText);
    139 
    140 
    141157
    142158
     
    166182    return static_cast<CGContext *> (aWidget->macCGHandle());
    167183}
     184
     185DECLINLINE(CGRect) darwinToCGRect (const QRect& aRect) { return CGRectMake (aRect.x(), aRect.y(), aRect.width(), aRect.height()); }
     186DECLINLINE(CGRect) darwinFlipCGRect (CGRect aRect, int aTargetHeight) { aRect.origin.y = aTargetHeight - aRect.origin.y - aRect.size.height; return aRect; }
    168187
    169188# ifndef QT_MAC_USE_COCOA
     
    202221bool darwinIsMenuOpen (void);
    203222
    204 void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget);
    205223# endif /* !QT_MAC_USE_COCOA */
    206224
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp

    r17200 r17201  
    11671167    {
    11681168        /* Fade back to the normal gamma */
    1169 # ifdef QT_MAC_USE_COCOA
    1170         /** @todo Carbon -> Cocoa */
    1171 # else
    11721169        CGDisplayFade (mFadeToken, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, false);
    11731170        CGReleaseDisplayFadeReservation (mFadeToken);
    1174 # endif
    11751171    }
    11761172    console->setMouseCoalescingEnabled (true);
     
    12661262            {
    12671263                /* Clear the background */
    1268 # ifdef QT_MAC_USE_COCOA
    1269                 /** @todo Carbon -> Cocoa */
    1270 # else
    1271                 HIRect viewRect;
    1272                 HIViewGetBounds (::darwinToNativeView (this), &viewRect);
    1273                 CGContextClearRect (::darwinToCGContextRef (this), viewRect);
    1274 # endif
     1264                CGContextClearRect (::darwinToCGContextRef (this), ::darwinToCGRect (frameGeometry()));
    12751265            }
    12761266            break;
     
    22502240    {
    22512241        /* Fade to black */
    2252 # ifdef QT_MAC_USE_COCOA
    2253         /** @todo Carbon -> Cocoa */
    2254 # else
    22552242        CGAcquireDisplayFadeReservation (kCGMaxDisplayReservationInterval, &mFadeToken);
    22562243        CGDisplayFade (mFadeToken, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, true);
    2257 # endif
    22582244    }
    22592245#endif
     
    23812367             * calls. */
    23822368            /* Undo all mac specific installations */
    2383 # ifdef QT_MAC_USE_COCOA
    2384             /** @todo Carbon -> Cocoa */
    2385 # else  /* !QT_MAC_USE_COCOA */
    2386             OSStatus status;
    2387             WindowRef windowRef = ::darwinToNativeWindow (this);
    2388             Assert (VALID_PTR (windowRef));
    2389             /* See above.
    2390             status = RemoveEventHandler (mDarwinRegionEventHandlerRef);
    2391             AssertCarbonOSStatus (status);
    2392             */
    2393             status = ReshapeCustomWindow (windowRef);
    2394             AssertCarbonOSStatus (status);
    2395             status = SetWindowAlpha (windowRef, 1.0);
    2396             AssertCarbonOSStatus (status);
    2397 # endif /* !QT_MAC_USE_COCOA */
     2369            ::darwinSetShowsWindowTransparent (this, false);
    23982370        }
    23992371#endif
     
    24282400         * switch and make this stuff useless with the old winId. So please be
    24292401         * careful on rearrangement of the method calls. */
    2430 # ifdef QT_MAC_USE_COCOA
    2431         /** @todo Carbon -> Cocoa */
    2432 # else  /* !QT_MAC_USE_COCOA */
    2433         OSStatus status;
    2434         HIViewRef viewRef = ::darwinToNativeView (console->viewport());
    2435         Assert (VALID_PTR (viewRef));
    2436         WindowRef windowRef = ::darwinToNativeWindow (viewRef);
    2437         Assert (VALID_PTR (windowRef));
    2438         /* @todo=poetzsch: Currently this isn't necessary. I should
    2439          * investigate if we can/should use this. */
    2440         /*
    2441            EventTypeSpec wCompositingEvent = { kEventClassWindow, kEventWindowGetRegion };
    2442            status = InstallWindowEventHandler ((WindowPtr)winId(), DarwinRegionHandler, GetEventTypeCount (wCompositingEvent), &wCompositingEvent, &mCurrRegion, &mDarwinRegionEventHandlerRef);
    2443            AssertCarbonOSStatus (status);
    2444            HIViewRef contentView = 0;
    2445            status = HIViewFindByID(HIViewGetRoot(windowRef), kHIViewWindowContentID, &contentView);
    2446            AssertCarbonOSStatus (status);
    2447            EventTypeSpec drawEvent = { kEventClassControl, kEventControlDraw };
    2448            status = InstallControlEventHandler (contentView, DarwinRegionHandler, GetEventTypeCount (drawEvent), &drawEvent, &contentView, NULL);
    2449            AssertCarbonOSStatus (status);
    2450            */
    2451         UInt32 features;
    2452         status = GetWindowFeatures (windowRef, &features);
    2453         AssertCarbonOSStatus (status);
    2454         if (( features & kWindowIsOpaque ) != 0)
    2455         {
    2456             status = HIWindowChangeFeatures (windowRef, 0, kWindowIsOpaque);
    2457             AssertCarbonOSStatus (status);
    2458         }
    2459         status = HIViewReshapeStructure (viewRef);
    2460         AssertCarbonOSStatus (status);
    2461         status = SetWindowAlpha(windowRef, 0.999);
    2462         AssertCarbonOSStatus (status);
    2463         /* For now disable the shadow of the window. This feature cause errors
    2464          * if a window in vbox looses focus, is reselected and than moved. */
    2465         /** @todo Search for an option to enable this again. A shadow on every
    2466          * window has a big coolness factor. */
    2467         status = ChangeWindowAttributes (windowRef, kWindowNoShadowAttribute, 0);
    2468         AssertCarbonOSStatus (status);
    2469 # endif /* !QT_MAC_USE_COCOA */
     2402        ::darwinSetShowsWindowTransparent (this, true);
    24702403    }
    24712404#endif
     
    25132446{
    25142447#ifdef Q_WS_MAC
    2515 # ifdef QT_MAC_USE_COCOA
    2516     /** @todo Carbon -> Cocoa */
    2517 # else  /* !QT_MAC_USE_COCOA */
     2448# ifndef QT_MAC_USE_COCOA
    25182449    /* setWindowState removes the window group connection somehow. So save it
    25192450     * temporary. */
    25202451    WindowGroupRef g = GetWindowGroup (::darwinToNativeWindow (this));
     2452# endif  /* !QT_MAC_USE_COCOA */
    25212453    if (aSeamless)
    25222454        if (aOn)
     
    25262458            mSavedFlags = windowFlags();
    25272459            /* Remove the frame from the window */
     2460            const QRect fullscreen (qApp->desktop()->screenGeometry (qApp->desktop()->screenNumber (this)));
    25282461            setParent (0, Qt::Window | Qt::FramelessWindowHint | (windowFlags() & 0xffff0000));
     2462            setGeometry (fullscreen);
    25292463            /* Set it maximized */
    25302464            setWindowState (windowState() ^ Qt::WindowMaximized);
     
    25392473        /* Here we are going really fullscreen */
    25402474        setWindowState (windowState() ^ Qt::WindowFullScreen);
     2475# ifndef QT_MAC_USE_COCOA
    25412476    /* Reassign the correct window group. */
    25422477    SetWindowGroup (::darwinToNativeWindow (this), g);
     
    30312966         * an repaint only. All the magic clipping stuff is done
    30322967         * in the paint engine. */
    3033 #ifndef QT_MAC_USE_COCOA
    3034         HIViewReshapeStructure (::darwinToNativeView (console->viewport()));
    3035 #endif /* QT_MAC_USE_COCOA */
    3036 //        HIWindowInvalidateShadow (::darwinToWindowRef (console->viewport()));
    3037 //        ReshapeCustomWindow (::darwinToWindowRef (this));
     2968        ::darwinWindowInvalidateShape (console->viewport());
    30382969    }
    30392970    else
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBQuartz2D.cpp

    r17175 r17201  
    133133        CGRect *cgRct = &rgnRcts->rcts[rgnRcts->used];
    134134        cgRct->origin.x = rect.x();
    135         cgRct->origin.y = rect.y();
     135        cgRct->origin.y = height() - rect.y() - rect.height();
    136136        cgRct->size.width = rect.width();
    137137        cgRct->size.height = rect.height();
     
    159159    Assert (mImage);
    160160
    161 #ifndef QT_MAC_USE_COCOA
    162161    VBoxConsoleWnd *main = qobject_cast <VBoxConsoleWnd *> (vboxGlobal().mainWindow());
    163162    Assert (VALID_PTR (main));
    164163    QWidget* viewport = mView->viewport();
    165164    Assert (VALID_PTR (viewport));
    166 
    167     HIViewRef viewRef = ::darwinToNativeView (viewport);
    168     Assert (VALID_PTR (viewRef));
    169     /* Get the dimensions of this HIView */
    170     HIRect viewRect;
    171     HIViewGetBounds (viewRef, &viewRect);
    172     /* Get the context of this window from qt */
     165    /* Get the dimensions of the viewport */
     166    CGRect viewRect = ::darwinToCGRect (viewport->geometry());
     167    /* Get the context of this window from Qt */
    173168    CGContextRef ctx = ::darwinToCGContextRef (viewport);
    174169    Assert (VALID_PTR (ctx));
     170
     171    /* Flip the context */
     172    CGContextTranslateCTM (ctx, 0, viewRect.size.height);
     173    CGContextScaleCTM (ctx, 1.0, -1.0);
     174
    175175    /* We handle the seamless mode as a special case. */
    176176    if (main->isTrueSeamless())
     
    215215        CGContextClipToRect (ctx, viewRect);
    216216        /* At this point draw the real vm image */
    217         HIViewDrawCGImage (ctx, &viewRect, subImage);
     217        CGContextDrawImage (ctx, ::darwinFlipCGRect (viewRect, viewRect.size.height), subImage);
    218218#ifdef COMP_WITH_SHADOW
    219219        CGContextEndTransparencyLayer (ctx);
     
    230230        CGImageRef subImage;
    231231        if (!mView->pauseShot().isNull())
    232             subImage = CGImageCreateWithImageInRect (::darwinToCGImageRef (&mView->pauseShot()), ::darwinToHIRect (is));
     232            subImage = CGImageCreateWithImageInRect (::darwinToCGImageRef (&mView->pauseShot()), ::darwinToCGRect (is));
    233233        else
    234             subImage = CGImageCreateWithImageInRect (mImage, ::darwinToHIRect (is));
     234            subImage = CGImageCreateWithImageInRect (mImage, ::darwinToCGRect (is));
    235235        Assert (VALID_PTR (subImage));
    236236        /* Ok, for more performance we set a clipping path of the
     
    242242            /* Add all region rects to the current context as path components */
    243243            for (int i = 0; i < a.size(); ++i)
    244                 CGContextAddRect (ctx, ::darwinToHIRect (a[i]));
     244                CGContextAddRect (ctx, ::darwinFlipCGRect (::darwinToCGRect (a[i]), viewRect.size.height));
    245245            /* Now convert the path to a clipping path. */
    246246            CGContextClip (ctx);
     
    250250        CGContextClipToRect (ctx, viewRect);
    251251        /* At this point draw the real vm image */
    252         HIRect destRect = ::darwinToHIRect (ir);
    253         HIViewDrawCGImage (ctx, &destRect, subImage);
    254     }
    255 #endif /* QT_MAC_USE_COCOA */
     252        CGContextDrawImage (ctx, ::darwinFlipCGRect (::darwinToCGRect (ir), viewRect.size.height), subImage);
     253    }
    256254}
    257255
  • trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-carbon.cpp

    r17175 r17201  
    3535}
    3636
     37NativeViewRef darwinToNativeViewImpl (NativeWindowRef aWindow)
     38{
     39    NativeViewRef view = NULL;
     40    if (aWindow)
     41    {
     42        OSStatus result = GetRootControl (aWindow, &view);
     43        AssertCarbonOSStatus (result);
     44    }
     45    return view;
     46}
     47
    3748void darwinSetShowsToolbarButtonImpl (NativeWindowRef aWindow, bool aEnabled)
    3849{
    39     int err = ::ChangeWindowAttributes (aWindow, aEnabled ? kWindowToolbarButtonAttribute : kWindowNoAttributes,
    40                                                  aEnabled ? kWindowNoAttributes : kWindowToolbarButtonAttribute);
    41     AssertCarbonOSStatus (err);
     50    OSStatus result = ::ChangeWindowAttributes (aWindow, aEnabled ? kWindowToolbarButtonAttribute : kWindowNoAttributes,
     51                                                         aEnabled ? kWindowNoAttributes : kWindowToolbarButtonAttribute);
     52    AssertCarbonOSStatus (result);
    4253}
    4354
    4455void darwinSetShowsResizeIndicatorImpl (NativeWindowRef aWindow, bool aEnabled)
    4556{
    46     int err = ::ChangeWindowAttributes (aWindow, aEnabled ? kWindowResizableAttribute : kWindowNoAttributes,
    47                                                  aEnabled ? kWindowNoAttributes : kWindowResizableAttribute);
    48     AssertCarbonOSStatus (err);
     57    OSStatus result = ::ChangeWindowAttributes (aWindow, aEnabled ? kWindowResizableAttribute : kWindowNoAttributes,
     58                                                         aEnabled ? kWindowNoAttributes : kWindowResizableAttribute);
     59    AssertCarbonOSStatus (result);
     60}
     61
     62void darwinSetShowsWindowTransparentImpl (NativeWindowRef aWindow, bool aEnabled)
     63{
     64    Assert (VALID_PTR (aWindow));
     65    OSStatus result;
     66    if (aEnabled)
     67    {
     68        HIViewRef viewRef = ::darwinToNativeViewImpl (aWindow);
     69        Assert (VALID_PTR (viewRef));
     70        /* @todo=poetzsch: Currently this isn't necessary. I should
     71         * investigate if we can/should use this. */
     72        /*
     73           EventTypeSpec wCompositingEvent = { kEventClassWindow, kEventWindowGetRegion };
     74           status = InstallWindowEventHandler ((WindowPtr)winId(), DarwinRegionHandler, GetEventTypeCount (wCompositingEvent), &wCompositingEvent, &mCurrRegion, &mDarwinRegionEventHandlerRef);
     75           AssertCarbonOSStatus (status);
     76           HIViewRef contentView = 0;
     77           status = HIViewFindByID(HIViewGetRoot(windowRef), kHIViewWindowContentID, &contentView);
     78           AssertCarbonOSStatus (status);
     79           EventTypeSpec drawEvent = { kEventClassControl, kEventControlDraw };
     80           status = InstallControlEventHandler (contentView, DarwinRegionHandler, GetEventTypeCount (drawEvent), &drawEvent, &contentView, NULL);
     81           AssertCarbonOSStatus (status);
     82         */
     83        UInt32 features;
     84        result = ::GetWindowFeatures (aWindow, &features);
     85        AssertCarbonOSStatus (result);
     86        if (( features & kWindowIsOpaque ) != 0)
     87        {
     88            result = ::HIWindowChangeFeatures (aWindow, 0, kWindowIsOpaque);
     89            AssertCarbonOSStatus (result);
     90        }
     91        result = ::HIViewReshapeStructure (viewRef);
     92        AssertCarbonOSStatus (result);
     93        result = ::SetWindowAlpha (aWindow, 0.999);
     94        AssertCarbonOSStatus (result);
     95        /* For now disable the shadow of the window. This feature cause errors
     96         * if a window in vbox looses focus, is reselected and than moved. */
     97        /** @todo Search for an option to enable this again. A shadow on every
     98         * window has a big coolness factor. */
     99        result = ::ChangeWindowAttributes (aWindow, kWindowNoShadowAttribute, 0);
     100        AssertCarbonOSStatus (result);
     101    }
     102    else
     103    {
     104        /* See above.
     105           status = RemoveEventHandler (mDarwinRegionEventHandlerRef);
     106           AssertCarbonOSStatus (status);
     107         */
     108        result = ::ReshapeCustomWindow (aWindow);
     109        AssertCarbonOSStatus (result);
     110        result = ::SetWindowAlpha (aWindow, 1.0);
     111        AssertCarbonOSStatus (result);
     112    }
    49113}
    50114
    51115void darwinSetMouseCoalescingEnabled (bool aEnabled)
    52116{
    53     int err = ::SetMouseCoalescingEnabled (aEnabled, NULL);
    54     AssertCarbonOSStatus (err);
     117    OSStatus result = ::SetMouseCoalescingEnabled (aEnabled, NULL);
     118    AssertCarbonOSStatus (result);
    55119}
    56120
     
    58122{
    59123    HIRect r = CGRectMake (x, y, width, height);
    60     int err = ::TransitionWindowWithOptions (aWidget,
    61                                              kWindowSlideTransitionEffect,
    62                                              kWindowResizeTransitionAction,
    63                                              &r,
    64                                              false,
    65                                              NULL);
    66     AssertCarbonOSStatus (err);
    67 }
    68 
     124    OSStatus result = ::TransitionWindowWithOptions (aWidget,
     125                                                     kWindowSlideTransitionEffect,
     126                                                     kWindowResizeTransitionAction,
     127                                                     &r,
     128                                                     false,
     129                                                     NULL);
     130    AssertCarbonOSStatus (result);
     131}
     132
     133void darwinWindowInvalidateShapeImpl (NativeWindowRef aWindow)
     134{
     135    OSStatus result = HIViewReshapeStructure (::darwinToNativeViewImpl (aWindow));
     136    AssertCarbonOSStatus (result);
     137//    HIWindowInvalidateShadow (::darwinToWindowRef (console->viewport()));
     138//    ReshapeCustomWindow (::darwinToWindowRef (this));
     139}
    69140
    70141/********************************************************************************
     
    74145 ********************************************************************************/
    75146#include "VBoxConsoleView.h"
    76 
    77 /**
    78  * Callback for deleting the QImage object when CGImageCreate is done
    79  * with it (which is probably not until the returned CFGImageRef is released).
    80  *
    81  * @param   info        Pointer to the QImage.
    82  */
    83 static void darwinDataProviderReleaseQImage (void *info, const void *, size_t)
    84 {
    85     QImage *qimg = (QImage *)info;
    86     delete qimg;
    87 }
    88147
    89148bool darwinIsMenuOpen (void)
  • trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-cocoa.m

    r17150 r17201  
    2828#import <AppKit/NSEvent.h>
    2929#import <AppKit/NSToolbar.h>
     30#import <AppKit/NSColor.h>
    3031
    3132NativeWindowRef darwinToNativeWindowImpl (NativeViewRef aView)
     
    3334    if (aView)
    3435        return [aView window];
     36    return NULL;
     37}
     38
     39NativeViewRef darwinToNativeViewImpl (NativeWindowRef aWindow)
     40{
     41    if (aWindow)
     42        return [aWindow contentView];   
    3543    return NULL;
    3644}
     
    6068    if (iconButton != Nil)
    6169        [iconButton setHidden:YES];
     70}
     71
     72void darwinSetShowsWindowTransparentImpl (NativeWindowRef aWindow, bool aEnabled)
     73{
     74    if (aEnabled)
     75    {
     76        [aWindow setOpaque:NO];
     77        [aWindow setBackgroundColor:[NSColor clearColor]];
     78        [aWindow setHasShadow:NO];
     79    }
     80    else
     81    {
     82        [aWindow setOpaque:YES];
     83        [aWindow setBackgroundColor:[NSColor windowBackgroundColor]];
     84        [aWindow setHasShadow:YES];
     85    }
    6286}
    6387
     
    90114}
    91115
     116void darwinWindowInvalidateShadowImpl (NativeWindowRef aWindow)
     117{
     118    [aWindow invalidateShadow];
     119}
     120
  • trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.cpp

    r17175 r17201  
    5151}
    5252
     53NativeViewRef darwinToNativeView (NativeWindowRef aWindow)
     54{
     55    return ::darwinToNativeViewImpl (aWindow);
     56}
     57
    5358void darwinSetShowsToolbarButton (QToolBar *aToolBar, bool aEnabled)
    5459{
     
    5661    if (parent)
    5762        ::darwinSetShowsToolbarButtonImpl (::darwinToNativeWindow (parent), aEnabled);
    58 }
    59 
    60 void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget)
    61 {
    62     ::darwinWindowAnimateResizeImpl (::darwinToNativeWindow (aWidget), aTarget.x(), aTarget.y(), aTarget.width(), aTarget.height());
    6363}
    6464
     
    7171    NOREF (aWidget);
    7272#endif /* !QT_MAC_USE_COCOA */
     73}
     74
     75void darwinSetShowsWindowTransparent (QWidget *aWidget, bool aEnabled)
     76{
     77    ::darwinSetShowsWindowTransparentImpl (::darwinToNativeWindow (aWidget), aEnabled);
     78}
     79
     80void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget)
     81{
     82    ::darwinWindowAnimateResizeImpl (::darwinToNativeWindow (aWidget), aTarget.x(), aTarget.y(), aTarget.width(), aTarget.height());
     83}
     84
     85void darwinWindowInvalidateShape (QWidget *aWidget)
     86{
     87#ifdef QT_MAC_USE_COCOA
     88    /* Here a simple update is enough! */
     89    aWidget->update();
     90#else /* QT_MAC_USE_COCOA */
     91    ::darwinWindowInvalidateShapeImpl (::darwinToNativeWindow (aWidget));
     92#endif /* QT_MAC_USE_COCOA */
     93}
     94;
     95void darwinWindowInvalidateShadow (QWidget *aWidget)
     96{
     97#ifdef QT_MAC_USE_COCOA
     98    ::darwinWindowInvalidateShadowImpl (::darwinToNativeWindow (aWidget));
     99#else /* QT_MAC_USE_COCOA */
     100    NOREF (aWidget);
     101#endif /* QT_MAC_USE_COCOA */
    73102}
    74103
     
    110139#endif /* QT_VERSION >= 0x040400 */
    111140}
     141
    112142
    113143/* Proxy icon creation */
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