VirtualBox

Changeset 17349 in vbox


Ignore:
Timestamp:
Mar 4, 2009 3:40:25 PM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4-OSX: more Cocoa clean up

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

Legend:

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

    r16953 r17349  
    3939
    4040#if defined (Q_WS_MAC)
    41 # ifdef QT_MAC_USE_COCOA
    42 /** @todo include something chocolatety... */
    43 # else
    44 #  include <Carbon/Carbon.h>
    45 # endif
     41# include <ApplicationServices/ApplicationServices.h>
    4642#endif
    4743
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h

    r17201 r17349  
    356356#ifdef Q_WS_MAC
    357357    QRegion mCurrRegion;
    358 # ifdef QT_MAC_USE_COCOA
    359     /** @todo Carbon -> Cocoa */
    360 # else
     358# ifndef QT_MAC_USE_COCOA
    361359    EventHandlerRef mDarwinRegionEventHandlerRef;
    362360# endif
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxIChatTheaterWrapper.h

    r16469 r17349  
    2525#if defined (Q_WS_MAC) && defined (VBOX_WITH_ICHAT_THEATER)
    2626
    27 #ifdef QT_MAC_USE_COCOA
    28 /** @todo Carbon -> Cocoa */
    29 #else
    30 # include <Carbon/Carbon.h>
    31 #endif
     27# include <ApplicationServices/ApplicationServices.h>
    3228
    3329__BEGIN_DECLS
    3430
    3531void initSharedAVManager();
    36 #ifdef QT_MAC_USE_COCOA
    37 /** @todo Carbon -> Cocoa */
    38 #else
    3932void setImageRef (CGImageRef aImage);
    40 #endif
    4133
    4234__END_DECLS
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxToolBar.h

    r17126 r17349  
    7878        {
    7979            mMainWindow->setUnifiedTitleAndToolBarOnMac (true);
    80 # ifdef QT_MAC_USE_COCOA
    81             /** @todo Carbon -> Cocoa */
    82 # else  /* !QT_MAC_USE_COCOA */
     80# ifndef QT_MAC_USE_COCOA
    8381            WindowRef window = ::darwinToNativeWindow (this);
    8482            EventHandlerUPP eventHandler = ::NewEventHandlerUPP (VBoxToolBar::macEventFilter);
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMListView.cpp

    r16473 r17349  
    3131#if defined (Q_WS_MAC)
    3232# include <ApplicationServices/ApplicationServices.h>
    33 # ifdef QT_MAC_USE_COCOA
    34 /** @todo Carbon -> Cocoa */
    35 # else
    36 #  include <Carbon/Carbon.h>
    37 # endif
    3833#endif
    3934
  • trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-cocoa.m

    r17340 r17349  
    2626#include <iprt/assert.h>
    2727
    28 #import <AppKit/NSWindow.h>
    29 #import <AppKit/NSView.h>
    3028#import <AppKit/NSEvent.h>
    31 #import <AppKit/NSToolbar.h>
    3229#import <AppKit/NSColor.h>
    33 #import <AppKit/NSGraphicsContext.h>
    34 #import <AppKit/NSApplication.h>
    35 #import <AppKit/NSImageView.h>
    3630
    3731NativeWindowRef darwinToNativeWindowImpl (NativeViewRef aView)
    3832{
     33    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     34
     35    NativeWindowRef window = NULL;
    3936    if (aView)
    40         return [aView window];
    41     return NULL;
     37        window = [aView window];
     38   
     39    [pool release];
     40    return window;
    4241}
    4342
    4443NativeViewRef darwinToNativeViewImpl (NativeWindowRef aWindow)
    4544{
     45    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     46
     47    NativeViewRef view = NULL;
    4648    if (aWindow)
    47         return [aWindow contentView];   
    48     return NULL;
     49        view = [aWindow contentView];   
     50
     51    [pool release];
     52    return view;
    4953}
    5054
    5155void darwinSetShowsToolbarButtonImpl (NativeWindowRef aWindow, bool aEnabled)
    5256{
     57    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     58
    5359    [aWindow setShowsToolbarButton:aEnabled];
     60
     61    [pool release];
    5462}
    5563
    5664void darwinSetShowsResizeIndicatorImpl (NativeWindowRef aWindow, bool aEnabled)
    5765{
     66    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     67
    5868    [aWindow setShowsResizeIndicator:aEnabled];
     69
     70    [pool release];
    5971}
    6072
    6173void darwinSetHidesAllTitleButtonsImpl (NativeWindowRef aWindow)
    6274{
     75    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     76
    6377    NSButton *closeButton = [aWindow standardWindowButton:NSWindowCloseButton];
    6478    if (closeButton != Nil)
     
    7387    if (iconButton != Nil)
    7488        [iconButton setHidden:YES];
     89
     90    [pool release];
    7591}
    7692
    7793void darwinSetShowsWindowTransparentImpl (NativeWindowRef aWindow, bool aEnabled)
    7894{
     95    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     96
    7997    if (aEnabled)
    8098    {
     
    89107        [aWindow setHasShadow:YES];
    90108    }
     109
     110    [pool release];
    91111}
    92112
     
    98118void darwinSetMouseCoalescingEnabled (bool aEnabled)
    99119{
     120    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     121
    100122    [NSEvent setMouseCoalescingEnabled:aEnabled];
     123
     124    [pool release];
    101125}
    102126
    103127void darwinWindowAnimateResizeImpl (NativeWindowRef aWindow, int x, int y, int width, int height)
    104128{
     129    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     130
    105131    /* It seems that Qt doesn't return the height of the window with the
    106132     * toolbar height included. So add this size manually. Could easily be that
     
    117143
    118144    [aWindow setFrame:windowFrame display:YES animate:YES];
     145
     146    [pool release];
    119147}
    120148
    121149void darwinWindowInvalidateShadowImpl (NativeWindowRef aWindow)
    122150{
     151    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     152
    123153    [aWindow invalidateShadow];
     154
     155    [pool release];
    124156}
    125157
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