Index: /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 29811)
+++ /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 29812)
@@ -523,7 +523,4 @@
  VirtualBox_QT_MOCHDRS.darwin = \
  	src/darwin/VBoxCocoaSpecialControls.h
-else
- VirtualBox_SOURCES.darwin += \
- 	src/darwin/VBoxUtils-darwin-carbon.cpp
 endif
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/darwin/DockIconPreview.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/darwin/DockIconPreview.h	(revision 29811)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/darwin/DockIconPreview.h	(revision 29812)
@@ -3,9 +3,9 @@
  *
  * VBox frontends: Qt GUI ("VirtualBox"):
- * VBoxDockIconPreview class declaration
+ * UIDockIconPreview class declaration
  */
 
 /*
- * Copyright (C) 2009 Oracle Corporation
+ * Copyright (C) 2010 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -18,6 +18,6 @@
  */
 
-#ifndef ___VBoxDockIconPreview_h___
-#define ___VBoxDockIconPreview_h___
+#ifndef ___UIDockIconPreview_h___
+#define ___UIDockIconPreview_h___
 
 #ifdef QT_MAC_USE_COCOA
@@ -33,4 +33,4 @@
 #endif /* QT_MAC_USE_COCOA */
 
-#endif /* !___VBoxDockIconPreview_h___ */
+#endif /* !___UIDockIconPreview_h___ */
 
Index: unk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxAquaStyle.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxAquaStyle.cpp	(revision 29811)
+++ 	(revision )
@@ -1,227 +1,0 @@
-/** $Id$ */
-/** @file
- * Qt GUI - VBox Variation on the QAquaStyle.
- */
-
-/*
- * Copyright (C) 2006-2007 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#include "VBoxDefs.h"
-#include "VBoxAquaStyle.h"
-#include <qapplication.h>
-#include <qtoolbutton.h>
-#include <qpushbutton.h>
-#include <qpainter.h>
-#include <qpixmap.h>
-
-
-VBoxAquaStyle *VBoxAquaStyle::sInstance;
-
-/**
- * Create a VBoxAquaStyle wrapper overloading the specified QAquaStyle instance.
- * @param   parent  QAquaStyle instance.
- */
-VBoxAquaStyle::VBoxAquaStyle(QStyle *parent)
-    : QStyle(),
-      mparent(parent)
-{
-}
-
-/**
- * Create a VBoxAquaStyle wrapper overloading the specified QAquaStyle instance.
- * @param   parent  QAquaStyle instance.
- */
-VBoxAquaStyle::VBoxAquaStyle(QStyle &parent)
-    : QStyle(),
-      mparent(&parent)
-{
-}
-
-/**
- * The main purpose here is to make sure the global
- * instance doesn't die on us.
- */
-VBoxAquaStyle::~VBoxAquaStyle()
-{
-    //fprintf(stderr, "~VBoxAquaStyle\n");
-    if (this == sInstance)
-        sInstance = NULL;
-    mparent = NULL;
-}
-
-/**
- * Get the global VBoxAquaStyle instance.
- */
-/* static */VBoxAquaStyle &VBoxAquaStyle::VBoxAquaStyle::instance()
-{
-    if (!sInstance)
-        sInstance = new VBoxAquaStyle(QApplication::style());
-    return *sInstance;
-}
-
-// The QStyle bits we modify the behaviour of.
-
-void VBoxAquaStyle::drawComplexControl( ComplexControl control, QPainter *p, const QWidget *widget,
-                                        const QRect &r, const QColorGroup &cg, SFlags how/* = Style_Default*/,
-                                        SCFlags sub/* = (uint)SC_All*/, SCFlags subActive/* = SC_None*/,
-                                        const QStyleOption &foo/* = QStyleOption::Default*/ ) const
-{
-    //fprintf(stderr, "drawComplexControl %p %x", widget, control);
-    if ( control == CC_ToolButton )
-    {
-        /*
-         * This is for the ugly tool bar buttons.
-         * We just drop the frame unless they are pressed down.
-         */
-        QToolButton *toolbutton = (QToolButton *)widget;
-        //if (toolbutton->isDown()) fprintf(stderr, " down");
-        if (!toolbutton->isDown())
-        {
-            if (toolbutton->hasFocus() && !toolbutton->focusProxy())
-            {
-                QRect fr = toolbutton->rect();
-                fr.addCoords(3, 3, -3, -3);
-                drawPrimitive(PE_FocusRect, p, fr, cg);
-            }
-            //fprintf(stderr, "\n");
-            return;
-        }
-    }
-
-    /* fallback */
-    mparent->drawComplexControl( control, p, widget, r, cg, how, sub, subActive, foo );
-    //fprintf(stderr, "\n");
-}
-
-
-// The QStyle proxying
-
-void VBoxAquaStyle::polish( QWidget *w )
-{
-    //fprintf(stderr, "polish %p\n", w);
-    mparent->polish( w );
-}
-
-void VBoxAquaStyle::unPolish( QWidget *w )
-{
-    //fprintf(stderr, "unPolish %p\n", w);
-    mparent->unPolish( w );
-}
-
-void VBoxAquaStyle::polish( QApplication *app )
-{
-    mparent->polish( app );
-}
-
-void VBoxAquaStyle::unPolish( QApplication *app )
-{
-    mparent->unPolish( app );
-}
-
-void VBoxAquaStyle::polish( QPalette &p )
-{
-    mparent->polish( p );
-}
-
-void VBoxAquaStyle::polishPopupMenu( QPopupMenu *m )
-{
-    mparent->polishPopupMenu( m );
-}
-
-QRect VBoxAquaStyle::itemRect( QPainter *p, const QRect &r, int flags, bool enabled,
-                                       const QPixmap *pixmap, const QString &text, int len/* = -1*/ ) const
-{
-    return mparent->itemRect( p, r, flags, enabled, pixmap, text, len );
-}
-
-void VBoxAquaStyle::drawItem( QPainter *p, const QRect &r, int flags, const QColorGroup &g, bool enabled,
-                              const QPixmap *pixmap, const QString &text, int len/* = -1*/, const QColor *penColor/* = 0*/ ) const
-{
-    //fprintf(stderr, "drawItem %p\n", pixmap);
-    mparent->drawItem( p, r, flags, g, enabled, pixmap, text, len, penColor );
-}
-
-void VBoxAquaStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRect &r, const QColorGroup &cg,
-                                   SFlags flags/* = Style_Default*/, const QStyleOption &foo/* = QStyleOption::Default*/ ) const
-{
-    //fprintf(stderr, "drawPrimitive %x\n", pe);
-    mparent->drawPrimitive( pe, p, r, cg, flags, foo);
-}
-
-void VBoxAquaStyle::drawControl( ControlElement element, QPainter *p, const QWidget *widget, const QRect &r,
-                                 const QColorGroup &cg, SFlags how/* = Style_Default*/, const QStyleOption &foo/* = QStyleOption::Default*/ ) const
-{
-    //fprintf(stderr, "drawControl %p %x\n", widget, element);
-    mparent->drawControl( element, p, widget, r, cg, how, foo );
-}
-
-void VBoxAquaStyle::drawControlMask( ControlElement element, QPainter *p, const QWidget *widget,
-                                     const QRect &r, const QStyleOption &foo/* = QStyleOption::Default*/ ) const
-{
-    //fprintf(stderr, "drawControlMask %p %x\n", widget, element);
-    mparent->drawControlMask( element, p, widget, r, foo);
-}
-
-QRect VBoxAquaStyle::subRect( SubRect r, const QWidget *widget ) const
-{
-    //fprintf(stderr, "subRect %p", widget);
-    QRect rct = mparent->subRect( r, widget );
-    //fprintf(stderr, " rct(%d,%d,%d,%d)\n", rct.topLeft().x(), rct.topLeft().y(), rct.bottomRight().x(),rct.bottomRight().y());
-    return rct;
-}
-
-int VBoxAquaStyle::pixelMetric( PixelMetric metric, const QWidget *widget/* = 0*/ ) const
-{
-    return mparent->pixelMetric( metric, widget );
-}
-
-QSize VBoxAquaStyle::sizeFromContents( ContentsType contents, const QWidget *widget, const QSize &contentsSize,
-                                       const QStyleOption &foo/* = QStyleOption::Default*/ ) const
-{
-    return mparent->sizeFromContents( contents, widget, contentsSize, foo );
-}
-
-int VBoxAquaStyle::styleHint( StyleHint stylehint, const QWidget *widget/* = 0*/,
-                              const QStyleOption &foo/* = QStyleOption::Default*/,
-                              QStyleHintReturn* returnData/* = 0*/) const
-{
-    return mparent->styleHint( stylehint, widget, foo, returnData );
-}
-
-QPixmap VBoxAquaStyle::stylePixmap( StylePixmap stylepixmap, const QWidget *widget/* = 0*/,
-                                    const QStyleOption &foo/* = QStyleOption::Default*/ ) const
-{
-    return mparent->stylePixmap( stylepixmap, widget, foo );
-}
-
-
-void VBoxAquaStyle::drawComplexControlMask( ComplexControl control, QPainter *p, const QWidget *widget, const QRect &r,
-                                            const QStyleOption &foo/* = QStyleOption::Default*/ ) const
-{
-    //fprintf(stderr, "drawComplexControl %p %x\n", widget, control);
-    mparent->drawComplexControlMask( control, p, widget, r, foo );
-}
-
-QRect VBoxAquaStyle::querySubControlMetrics( ComplexControl control, const QWidget *widget,
-                                             SubControl sc, const QStyleOption &foo/* = QStyleOption::Default*/ ) const
-{
-    //fprintf(stderr, "querySubControlMetrics %p %x\n", widget, control);
-    return mparent->querySubControlMetrics( control, widget, sc, foo );
-}
-
-QStyle::SubControl VBoxAquaStyle::querySubControl( ComplexControl control, const QWidget *widget, const QPoint &pos,
-                                           const QStyleOption &foo/* = QStyleOption::Default*/ ) const
-{
-    //fprintf(stderr, "querySubControl %p %x\n", widget, control);
-    return mparent->querySubControl( control, widget, pos, foo );
-}
-
Index: unk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxAquaStyle.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxAquaStyle.h	(revision 29811)
+++ 	(revision )
@@ -1,88 +1,0 @@
-/** $Id: $ */
-/** @file
- * Qt GUI - VBox Variation on the QAquaStyle.
- */
-
-/*
- * Copyright (C) 2006-2007 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-
-#ifndef ___VBoxAquaStyle_h___
-#define ___VBoxAquaStyle_h___
-
-#include <qstyle.h>
-//Added by qt3to4:
-#include <QPixmap>
-#include <Q3PopupMenu>
-
-/**
- * The VirtualBox QAquaStyle overrider.
- *
- * The purpose of this class is to make some small adjustments to
- * the QAquaStyle so it looks and works better.
- *
- * Since the QAquaStyle class isn't exported we have to do all the
- * virtual method work our selves. This also means we doesn't have
- * access to any protected or QAquaStyle methods, too bad.
- */
-class VBoxAquaStyle : public QStyle //QAquaStyle - not exported, sigh.
-{
-public:
-    VBoxAquaStyle(QStyle *parent);
-    VBoxAquaStyle(QStyle &parent);
-    virtual ~VBoxAquaStyle();
-    static VBoxAquaStyle &instance();
-
-    // The QStyle implementation.
-    virtual void polish( QWidget *w );
-    virtual void unPolish( QWidget *w );
-    virtual void polish( QApplication *app );
-    virtual void unPolish( QApplication *app );
-    virtual void polish( QPalette &p );
-    virtual void polishPopupMenu( Q3PopupMenu *m );
-    virtual QRect itemRect( QPainter *p, const QRect &r, int flags, bool enabled, const QPixmap *pixmap,
-                            const QString &text, int len = -1 ) const;
-    virtual void drawItem( QPainter *p, const QRect &r, int flags, const QColorGroup &g, bool enabled,
-                           const QPixmap *pixmap, const QString &text, int len = -1, const QColor *penColor = 0 ) const;
-    virtual void drawPrimitive( PrimitiveElement pe, QPainter *p, const QRect &r, const QColorGroup &cg,
-                                SFlags flags = Style_Default, const QStyleOption &foo = QStyleOption::Default ) const;
-    virtual void drawControl( ControlElement element, QPainter *p, const QWidget *widget, const QRect &r, const QColorGroup &cg,
-                              SFlags how = Style_Default, const QStyleOption &foo = QStyleOption::Default ) const;
-    virtual void drawControlMask( ControlElement element, QPainter *p, const QWidget *widget, const QRect &r,
-                                  const QStyleOption &foo = QStyleOption::Default ) const;
-    virtual QRect subRect( SubRect r, const QWidget *widget ) const;
-    virtual int pixelMetric( PixelMetric metric, const QWidget *widget = 0 ) const;
-    virtual QSize sizeFromContents( ContentsType contents, const QWidget *widget, const QSize &contentsSize,
-                                    const QStyleOption &foo = QStyleOption::Default ) const;
-    virtual int styleHint( StyleHint stylehint, const QWidget *widget = 0, const QStyleOption &foo = QStyleOption::Default,
-                           QStyleHintReturn* returnData = 0 ) const;
-    virtual QPixmap stylePixmap( StylePixmap stylepixmap, const QWidget *widget = 0, const QStyleOption &foo = QStyleOption::Default ) const;
-    virtual void drawComplexControl( ComplexControl control, QPainter *p, const QWidget *widget, const QRect &r,
-                                     const QColorGroup &cg, SFlags how = Style_Default, SCFlags sub = (uint)SC_All,
-                                     SCFlags subActive = SC_None, const QStyleOption &foo = QStyleOption::Default ) const;
-    virtual void drawComplexControlMask( ComplexControl control, QPainter *p, const QWidget *widget, const QRect &r,
-                                         const QStyleOption &foo = QStyleOption::Default ) const;
-    virtual QRect querySubControlMetrics( ComplexControl control, const QWidget *widget, SubControl sc,
-                                          const QStyleOption &foo = QStyleOption::Default ) const;
-    virtual SubControl querySubControl( ComplexControl control, const QWidget *widget, const QPoint &pos,
-                                        const QStyleOption &foo = QStyleOption::Default ) const;
-
-protected:
-    /** The style we're overloading. */
-    QStyle *mparent;
-
-    /** The global instance. */
-    static VBoxAquaStyle *sInstance;
-};
-
-#endif
-
Index: unk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxDockIconPreview-cocoa.mm
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxDockIconPreview-cocoa.mm	(revision 29811)
+++ 	(revision )
@@ -1,117 +1,0 @@
-/* $Id$ */
-/** @file
- *
- * VBox frontends: Qt GUI ("VirtualBox"):
- * Cocoa helper for the dock icon preview
- */
-
-/*
- * Copyright (C) 2009-2010 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#import "VBoxDockIconPreview.h"
-
-#import <AppKit/NSView.h>
-#import <AppKit/NSDockTile.h>
-#import <AppKit/NSApplication.h>
-#import <AppKit/NSGraphicsContext.h>
-#import <AppKit/NSImage.h>
-
-static NSImage *gDockIconImage = NULL;
-
-/********************************************************************************
- *
- * C-Helper: This is the external interface to the Cocoa dock tile handling.
- *
- ********************************************************************************/
-
-void darwinCreateVBoxDockIconTileView (void)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
-    if (gDockIconImage == NULL)
-        gDockIconImage = [[NSImage imageNamed:@"NSApplicationIcon"] copy];
-
-    [pool release];
-}
-
-void darwinDestroyVBoxDockIconTileView (void)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
-    if (gDockIconImage != NULL)
-    {
-        [gDockIconImage release];
-        gDockIconImage = NULL;
-    }
-
-    [pool release];
-}
-
-CGContextRef darwinBeginCGContextForApplicationDockTile (void)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
-    [gDockIconImage lockFocus];
-
-    NSGraphicsContext *nsContext = [NSGraphicsContext currentContext];
-    CGContextRef pCGContext = (CGContextRef)[nsContext graphicsPort];
-
-    [pool release];
-    return pCGContext;
-}
-
-void darwinEndCGContextForApplicationDockTile (CGContextRef aContext)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
-    [gDockIconImage unlockFocus];
-
-    [NSApp setApplicationIconImage:gDockIconImage];
-
-    [pool release];
-}
-
-void darwinOverlayApplicationDockTileImage (CGImageRef pImage)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
-    /* Convert the CGImage to an NSImage */
-    NSBitmapImageRep *bitmapImageRep = [[NSBitmapImageRep alloc] initWithCGImage:pImage];
-    if (bitmapImageRep)
-    {
-        NSImage *badgeImage = [[NSImage alloc] initWithSize:[bitmapImageRep size]];
-        [badgeImage addRepresentation:bitmapImageRep];
-        [bitmapImageRep release];
-        /* Make subsequent drawing operations on the icon */
-        [gDockIconImage lockFocus];
-        /* Draw the overlay bottom left */
-        [badgeImage drawAtPoint:NSZeroPoint fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
-        [gDockIconImage unlockFocus];
-        [badgeImage release];
-    }
-    /* Set the new application icon */
-    [NSApp setApplicationIconImage:gDockIconImage];
-
-    [pool release];
-}
-
-void darwinRestoreApplicationDockTileImage (void)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
-    /* Reset all */
-    darwinDestroyVBoxDockIconTileView();
-    darwinCreateVBoxDockIconTileView();
-
-    [pool release];
-}
-
Index: unk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-carbon.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-carbon.cpp	(revision 29811)
+++ 	(revision )
@@ -1,265 +1,0 @@
-/* $Id$ */
-/** @file
- *
- * VBox frontends: Qt GUI ("VirtualBox"):
- * Declarations of utility classes and functions for handling Darwin Carbon
- * specific tasks
- */
-
-/*
- * Copyright (C) 2009 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#include "VBoxUtils-darwin.h"
-
-#include <iprt/assert.h>
-
-#include <Carbon/Carbon.h>
-
-NativeWindowRef darwinToNativeWindowImpl (NativeViewRef aView)
-{
-    if (aView)
-        return reinterpret_cast<WindowRef> (::HIViewGetWindow (aView));
-    return NULL;
-}
-
-NativeViewRef darwinToNativeViewImpl (NativeWindowRef aWindow)
-{
-    NativeViewRef view = NULL;
-    if (aWindow)
-    {
-        OSStatus result = GetRootControl (aWindow, &view);
-        AssertCarbonOSStatus (result);
-    }
-    return view;
-}
-
-void darwinSetShowsToolbarButtonImpl (NativeWindowRef aWindow, bool aEnabled)
-{
-    OSStatus result = ::ChangeWindowAttributes (aWindow, aEnabled ? kWindowToolbarButtonAttribute : kWindowNoAttributes,
-                                                         aEnabled ? kWindowNoAttributes : kWindowToolbarButtonAttribute);
-    AssertCarbonOSStatus (result);
-}
-
-void darwinSetShowsResizeIndicatorImpl (NativeWindowRef aWindow, bool aEnabled)
-{
-    OSStatus result = ::ChangeWindowAttributes (aWindow, aEnabled ? kWindowResizableAttribute : kWindowNoAttributes,
-                                                         aEnabled ? kWindowNoAttributes : kWindowResizableAttribute);
-    AssertCarbonOSStatus (result);
-}
-
-void darwinSetShowsWindowTransparentImpl (NativeWindowRef aWindow, bool aEnabled)
-{
-    Assert (VALID_PTR (aWindow));
-    OSStatus result;
-    if (aEnabled)
-    {
-        HIViewRef viewRef = ::darwinToNativeViewImpl (aWindow);
-        Assert (VALID_PTR (viewRef));
-        /* @todo=poetzsch: Currently this isn't necessary. I should
-         * investigate if we can/should use this. */
-        /*
-           EventTypeSpec wCompositingEvent = { kEventClassWindow, kEventWindowGetRegion };
-           status = InstallWindowEventHandler ((WindowPtr)winId(), DarwinRegionHandler, GetEventTypeCount (wCompositingEvent), &wCompositingEvent, &mCurrRegion, &mDarwinRegionEventHandlerRef);
-           AssertCarbonOSStatus (status);
-           HIViewRef contentView = 0;
-           status = HIViewFindByID(HIViewGetRoot(windowRef), kHIViewWindowContentID, &contentView);
-           AssertCarbonOSStatus (status);
-           EventTypeSpec drawEvent = { kEventClassControl, kEventControlDraw };
-           status = InstallControlEventHandler (contentView, DarwinRegionHandler, GetEventTypeCount (drawEvent), &drawEvent, &contentView, NULL);
-           AssertCarbonOSStatus (status);
-         */
-        UInt32 features;
-        result = ::GetWindowFeatures (aWindow, &features);
-        AssertCarbonOSStatus (result);
-        if (( features & kWindowIsOpaque ) != 0)
-        {
-            result = ::HIWindowChangeFeatures (aWindow, 0, kWindowIsOpaque);
-            AssertCarbonOSStatus (result);
-        }
-        result = ::HIViewReshapeStructure (viewRef);
-        AssertCarbonOSStatus (result);
-        result = ::SetWindowAlpha (aWindow, 0.999);
-        AssertCarbonOSStatus (result);
-        /* For now disable the shadow of the window. This feature cause errors
-         * if a window in vbox looses focus, is reselected and than moved. */
-        /** @todo Search for an option to enable this again. A shadow on every
-         * window has a big coolness factor. */
-        result = ::ChangeWindowAttributes (aWindow, kWindowNoShadowAttribute, 0);
-        AssertCarbonOSStatus (result);
-    }
-    else
-    {
-        /* See above.
-           status = RemoveEventHandler (mDarwinRegionEventHandlerRef);
-           AssertCarbonOSStatus (status);
-         */
-        result = ::ReshapeCustomWindow (aWindow);
-        AssertCarbonOSStatus (result);
-        result = ::SetWindowAlpha (aWindow, 1.0);
-        AssertCarbonOSStatus (result);
-    }
-}
-
-void darwinSetMouseCoalescingEnabled (bool aEnabled)
-{
-    OSStatus result = ::SetMouseCoalescingEnabled (aEnabled, NULL);
-    AssertCarbonOSStatus (result);
-}
-
-void darwinWindowAnimateResizeImpl (NativeWindowRef aWidget, int x, int y, int width, int height)
-{
-    HIRect r = CGRectMake (x, y, width, height);
-    OSStatus result = ::TransitionWindowWithOptions (aWidget,
-                                                     kWindowSlideTransitionEffect,
-                                                     kWindowResizeTransitionAction,
-                                                     &r,
-                                                     false,
-                                                     NULL);
-    AssertCarbonOSStatus (result);
-}
-
-void darwinWindowInvalidateShapeImpl (NativeWindowRef aWindow)
-{
-    OSStatus result = HIViewReshapeStructure (::darwinToNativeViewImpl (aWindow));
-    AssertCarbonOSStatus (result);
-//    HIWindowInvalidateShadow (::darwinToWindowRef (console->viewport()));
-//    ReshapeCustomWindow (::darwinToWindowRef (this));
-}
-
-int darwinWindowToolBarHeight (NativeWindowRef aWindow)
-{
-    int h = 0;
-    if (::IsWindowToolbarVisible (aWindow))
-    {
-        /* Seems there is no method for getting the height of a toolbar in
-         * Carbon directly. Calculate it by getting the full window size,
-         * without the titlebar height & the content height. */
-        Rect win, win1, win2;
-        if (OSStatus result = ::GetWindowBounds (aWindow, kWindowStructureRgn, &win) == noErr)
-            if((result = ::GetWindowBounds (aWindow, kWindowTitleBarRgn, &win1)) == noErr)
-                if ((result = ::GetWindowBounds (aWindow, kWindowContentRgn, &win2)) == noErr)
-                    h = (win.bottom-win.top) - (win1.bottom-win1.top) - (win2.bottom-win2.top);
-    }
-    return h;
-}
-
-/********************************************************************************
- *
- * Old carbon stuff. Have to converted soon!
- *
- ********************************************************************************/
-
-bool darwinIsMenuOpen (void)
-{
-    MenuTrackingData outData;
-    return (GetMenuTrackingData (NULL, &outData) != menuNotFoundErr);
-}
-
-/* Currently not used! */
-OSStatus darwinRegionHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData)
-{
-    NOREF (aInHandlerCallRef);
-
-    OSStatus status = eventNotHandledErr;
-
-    switch (GetEventKind (aInEvent))
-    {
-        case kEventWindowGetRegion:
-        {
-            WindowRegionCode code;
-            RgnHandle rgn;
-
-            /* which region code is being queried? */
-            GetEventParameter (aInEvent, kEventParamWindowRegionCode, typeWindowRegionCode, NULL, sizeof (code), NULL, &code);
-
-            /* if it is the opaque region code then set the region to Empty and return noErr to stop the propagation */
-            if (code == kWindowOpaqueRgn)
-            {
-                printf("test1\n");
-                GetEventParameter (aInEvent, kEventParamRgnHandle, typeQDRgnHandle, NULL, sizeof (rgn), NULL, &rgn);
-                SetEmptyRgn (rgn);
-                status = noErr;
-            }
-            /* if the content of the whole window is queried return a copy of our saved region. */
-            else if (code == (kWindowStructureRgn))// || kWindowGlobalPortRgn || kWindowUpdateRgn))
-            {
-                printf("test2\n");
-                GetEventParameter (aInEvent, kEventParamRgnHandle, typeQDRgnHandle, NULL, sizeof (rgn), NULL, &rgn);
-                QRegion *pRegion = static_cast <QRegion*> (aInUserData);
-                if (!pRegion->isEmpty() && pRegion)
-                {
-                    //CopyRgn (pRegion->handle(), rgn);
-                    status = noErr;
-                }
-            }
-            break;
-        }
-        case kEventControlDraw:
-        {
-            printf("test3\n");
-            CGContextRef ctx;
-            HIRect bounds;
-
-            GetEventParameter (aInEvent, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof (ctx), NULL, &ctx);
-            HIViewGetBounds ((HIViewRef)aInUserData, &bounds);
-
-            CGContextClearRect (ctx, bounds);
-            status = noErr;
-            break;
-        }
-    }
-
-    return status;
-}
-
-
-#define DEBUG_MSG_RESULT(result, text) \
-        printf(text" (%d; %s:%d)", (int)(result), __FILE__, __LINE__)
-
-#define CHECK_CARBON_RC_RETURN(result, text, ret) \
-    if((result) != noErr) \
-    { \
-        DEBUG_MSG_RESULT(result, text); \
-        return ret; \
-    }
-
-#define CHECK_CARBON_RC_RETURN_VOID(result, text) \
-    CHECK_CARBON_RC_RETURN(result, text,)
-
-void PostUpdateContext (WindowRef window, void *wp)
-{
-    EventRef evt;
-    OSStatus status = CreateEvent(NULL, kEventClassVBox, kEventVBoxUpdateContext, 0, kEventAttributeNone, &evt);
-    CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU (PostUpdateContext): CreateEvent Failed");
-    status = SetEventParameter(evt, kEventParamWindowRef, typeWindowRef, sizeof (window), &window);
-    CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU (PostUpdateContext): SetEventParameter Failed");
-    status = SetEventParameter(evt, kEventParamUserData, typeVoidPtr, sizeof (wp), &wp);
-    CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU (PostUpdateContext): SetEventParameter Failed");
-    status = PostEventToQueue(GetMainEventQueue(), evt, kEventPriorityStandard);
-    CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU (PostUpdateContext): PostEventToQueue Failed");
-}
-
-void PostBoundsChanged (const QRect& rect)
-{
-    EventRef evt;
-    OSStatus status = CreateEvent(NULL, kEventClassVBox, kEventVBoxBoundsChanged, 0, kEventAttributeNone, &evt);
-    CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU (PostUpdateContext): CreateEvent Failed");
-    HIPoint p = CGPointMake (rect.x(), rect.y());
-    status = SetEventParameter(evt, kEventParamOrigin, typeHIPoint, sizeof (p), &p);
-    CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU (PostUpdateContext): SetEventParameter Failed");
-    HISize s = CGSizeMake (rect.width(), rect.height());
-    status = SetEventParameter(evt, kEventParamDimensions, typeHISize, sizeof (s), &s);
-    CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU (PostUpdateContext): SetEventParameter Failed");
-    status = PostEventToQueue(GetMainEventQueue(), evt, kEventPriorityStandard);
-    CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU (PostUpdateContext): PostEventToQueue Failed");
-}
-
Index: /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.h	(revision 29811)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.h	(revision 29812)
@@ -7,5 +7,5 @@
 
 /*
- * Copyright (C) 2009 Oracle Corporation
+ * Copyright (C) 2010 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -37,5 +37,4 @@
 
 # include <qglobal.h> /* for QT_MAC_USE_COCOA */
-
 # include <ApplicationServices/ApplicationServices.h>
 
@@ -49,8 +48,4 @@
 typedef void *NativeWindowRef;
 typedef void *NativeViewRef;
-# else /* QT_MAC_USE_COCOA */
-#  include <Carbon/Carbon.h>
-typedef WindowRef NativeWindowRef;
-typedef HIViewRef NativeViewRef;
 # endif /* QT_MAC_USE_COCOA */
 #endif /* __OBJC__ */
@@ -66,6 +61,6 @@
  *
  ********************************************************************************/
-NativeWindowRef darwinToNativeWindowImpl (NativeViewRef aView);
-NativeViewRef darwinToNativeViewImpl (NativeWindowRef aWindow);
+NativeWindowRef darwinToNativeWindowImpl(NativeViewRef aView);
+NativeViewRef darwinToNativeViewImpl(NativeWindowRef aWindow);
 
 /********************************************************************************
@@ -74,9 +69,9 @@
  *
  ********************************************************************************/
-void darwinSetShowsToolbarButtonImpl (NativeWindowRef aWindow, bool aEnabled);
-void darwinSetShowsResizeIndicatorImpl (NativeWindowRef aWindow, bool aEnabled);
-void darwinSetHidesAllTitleButtonsImpl (NativeWindowRef aWindow);
-void darwinSetShowsWindowTransparentImpl (NativeWindowRef aWindow, bool aEnabled);
-void darwinSetMouseCoalescingEnabled (bool aEnabled);
+void darwinSetShowsToolbarButtonImpl(NativeWindowRef aWindow, bool aEnabled);
+void darwinSetShowsResizeIndicatorImpl(NativeWindowRef aWindow, bool aEnabled);
+void darwinSetHidesAllTitleButtonsImpl(NativeWindowRef aWindow);
+void darwinSetShowsWindowTransparentImpl(NativeWindowRef aWindow, bool aEnabled);
+void darwinSetMouseCoalescingEnabled(bool aEnabled);
 
 /********************************************************************************
@@ -85,8 +80,8 @@
  *
  ********************************************************************************/
-void darwinWindowAnimateResizeImpl (NativeWindowRef aWindow, int x, int y, int width, int height);
-void darwinWindowInvalidateShapeImpl (NativeWindowRef aWindow);
-void darwinWindowInvalidateShadowImpl (NativeWindowRef aWindow);
-int  darwinWindowToolBarHeight (NativeWindowRef aWindow);
+void darwinWindowAnimateResizeImpl(NativeWindowRef aWindow, int x, int y, int width, int height);
+void darwinWindowInvalidateShapeImpl(NativeWindowRef aWindow);
+void darwinWindowInvalidateShadowImpl(NativeWindowRef aWindow);
+int  darwinWindowToolBarHeight(NativeWindowRef aWindow);
 bool darwinIsWindowMaximized(NativeWindowRef aWindow);
 
@@ -97,8 +92,8 @@
 RT_C_DECLS_END
 
-DECLINLINE(CGRect) darwinToCGRect (const QRect& aRect) { return CGRectMake (aRect.x(), aRect.y(), aRect.width(), aRect.height()); }
-DECLINLINE(CGRect) darwinFlipCGRect (CGRect aRect, int aTargetHeight) { aRect.origin.y = aTargetHeight - aRect.origin.y - aRect.size.height; return aRect; }
-DECLINLINE(CGRect) darwinFlipCGRect (CGRect aRect, const CGRect &aTarget) { return darwinFlipCGRect (aRect, aTarget.size.height); }
-DECLINLINE(CGRect) darwinCenterRectTo (CGRect aRect, const CGRect& aToRect)
+DECLINLINE(CGRect) darwinToCGRect(const QRect& aRect) { return CGRectMake(aRect.x(), aRect.y(), aRect.width(), aRect.height()); }
+DECLINLINE(CGRect) darwinFlipCGRect(CGRect aRect, int aTargetHeight) { aRect.origin.y = aTargetHeight - aRect.origin.y - aRect.size.height; return aRect; }
+DECLINLINE(CGRect) darwinFlipCGRect(CGRect aRect, const CGRect &aTarget) { return darwinFlipCGRect(aRect, aTarget.size.height); }
+DECLINLINE(CGRect) darwinCenterRectTo(CGRect aRect, const CGRect& aToRect)
 {
     aRect.origin.x = aToRect.origin.x + (aToRect.size.width  - aRect.size.width)  / 2.0;
@@ -121,5 +116,5 @@
  * @param   aWidget   Pointer to the QWidget
  */
-NativeViewRef darwinToNativeView (QWidget *aWidget);
+NativeViewRef darwinToNativeView(QWidget *aWidget);
 
 /**
@@ -129,5 +124,5 @@
  * @param   aWidget   Pointer to the QWidget
  */
-NativeWindowRef darwinToNativeWindow (QWidget *aWidget);
+NativeWindowRef darwinToNativeWindow(QWidget *aWidget);
 
 /* This is necessary because of the C calling convention. Its a simple wrapper
@@ -140,5 +135,5 @@
  * @param   aWidget   Pointer to the native View
  */
-NativeWindowRef darwinToNativeWindow (NativeViewRef aView);
+NativeWindowRef darwinToNativeWindow(NativeViewRef aView);
 
 /**
@@ -148,5 +143,5 @@
  * @param   aWidget   Pointer to the native Window
  */
-NativeViewRef darwinToNativeView (NativeWindowRef aWindow);
+NativeViewRef darwinToNativeView(NativeWindowRef aWindow);
 
 /********************************************************************************
@@ -155,9 +150,9 @@
  *
  ********************************************************************************/
-void darwinSetShowsToolbarButton (QToolBar *aToolBar, bool aEnabled);
-void darwinSetShowsResizeIndicator (QWidget *aWidget, bool aEnabled);
-void darwinSetHidesAllTitleButtons (QWidget *aWidget);
-void darwinSetShowsWindowTransparent (QWidget *aWidget, bool aEnabled);
-void darwinDisableIconsInMenus (void);
+void darwinSetShowsToolbarButton(QToolBar *aToolBar, bool aEnabled);
+void darwinSetShowsResizeIndicator(QWidget *aWidget, bool aEnabled);
+void darwinSetHidesAllTitleButtons(QWidget *aWidget);
+void darwinSetShowsWindowTransparent(QWidget *aWidget, bool aEnabled);
+void darwinDisableIconsInMenus(void);
 
 /********************************************************************************
@@ -166,11 +161,11 @@
  *
  ********************************************************************************/
-void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget);
-void darwinWindowInvalidateShape (QWidget *aWidget);
-void darwinWindowInvalidateShadow (QWidget *aWidget);
-int  darwinWindowToolBarHeight (QWidget *aWidget);
+void darwinWindowAnimateResize(QWidget *aWidget, const QRect &aTarget);
+void darwinWindowInvalidateShape(QWidget *aWidget);
+void darwinWindowInvalidateShadow(QWidget *aWidget);
+int  darwinWindowToolBarHeight(QWidget *aWidget);
 bool darwinIsWindowMaximized(QWidget *aWidget);
-QString darwinSystemLanguage (void);
-QPixmap darwinCreateDragPixmap (const QPixmap& aPixmap, const QString &aText);
+QString darwinSystemLanguage(void);
+QPixmap darwinCreateDragPixmap(const QPixmap& aPixmap, const QString &aText);
 
 
@@ -186,72 +181,9 @@
  * @param   aWidget      Pointer to the QWidget
  */
-CGContextRef darwinToCGContextRef (QWidget *aWidget);
+CGContextRef darwinToCGContextRef(QWidget *aWidget);
 
-CGImageRef darwinToCGImageRef (const QImage *aImage);
-CGImageRef darwinToCGImageRef (const QPixmap *aPixmap);
-CGImageRef darwinToCGImageRef (const char *aSource);
-
-
-
-
-
-/********************************************************************************
- *
- * Old carbon stuff. Have to be converted soon!
- *
- ********************************************************************************/
-
-#include <QWidget>
-
-# ifndef QT_MAC_USE_COCOA
-
-/* Asserts if a != noErr and prints the error code */
-#  ifdef RT_STRICT
-#   define AssertCarbonOSStatus(a) AssertMsg ((a) == noErr, ("Carbon OSStatus: %d\n", static_cast<int> (a)))
-#  else
-#   define AssertCarbonOSStatus(a) do { NOREF(a); } while (0)
-#  endif
-
-
-/**
- * Converts a QRect to a HIRect.
- *
- * @returns HIRect for the converted QRect.
- * @param   aRect  the QRect to convert
- */
-DECLINLINE(HIRect) darwinToHIRect (const QRect &aRect)
-{
-    return CGRectMake (aRect.x(), aRect.y(), aRect.width(), aRect.height());
-}
-
-/* Experimental region handler for the seamless mode */
-OSStatus darwinRegionHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData);
-
-/* Handler for the OpenGL overlay window stuff & the possible messages. */
-enum
-{
-    /* Event classes */
-    kEventClassVBox         = 'vbox',
-    /* Event kinds */
-    kEventVBoxShowWindow    = 'swin',
-    kEventVBoxHideWindow    = 'hwin',
-    kEventVBoxMoveWindow    = 'mwin',
-    kEventVBoxResizeWindow  = 'rwin',
-    kEventVBoxDisposeWindow = 'dwin',
-    kEventVBoxUpdateDock    = 'udck',
-    kEventVBoxUpdateContext = 'uctx',
-    kEventVBoxBoundsChanged = 'bchg'
-};
-
-void PostBoundsChanged (const QRect& rect);
-OSStatus darwinOverlayWindowHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData);
-
-bool darwinIsMenuOpen (void);
-
-# endif /* !QT_MAC_USE_COCOA */
-
-# ifdef DEBUG
-void darwinDebugPrintEvent (const char *aPrefix, EventRef aEvent);
-# endif
+CGImageRef darwinToCGImageRef(const QImage *aImage);
+CGImageRef darwinToCGImageRef(const QPixmap *aPixmap);
+CGImageRef darwinToCGImageRef(const char *aSource);
 
 #endif /* !__OBJC__ */
