VirtualBox

Changeset 29812 in vbox for trunk


Ignore:
Timestamp:
May 26, 2010 11:46:22 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
62021
Message:

FE/Qt4-OSX: much more cleanup

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
4 deleted
3 edited

Legend:

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

    r29808 r29812  
    523523 VirtualBox_QT_MOCHDRS.darwin = \
    524524        src/darwin/VBoxCocoaSpecialControls.h
    525 else
    526  VirtualBox_SOURCES.darwin += \
    527         src/darwin/VBoxUtils-darwin-carbon.cpp
    528525endif
    529526
  • trunk/src/VBox/Frontends/VirtualBox/src/darwin/DockIconPreview.h

    r29794 r29812  
    33 *
    44 * VBox frontends: Qt GUI ("VirtualBox"):
    5  * VBoxDockIconPreview class declaration
     5 * UIDockIconPreview class declaration
    66 */
    77
    88/*
    9  * Copyright (C) 2009 Oracle Corporation
     9 * Copyright (C) 2010 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1818 */
    1919
    20 #ifndef ___VBoxDockIconPreview_h___
    21 #define ___VBoxDockIconPreview_h___
     20#ifndef ___UIDockIconPreview_h___
     21#define ___UIDockIconPreview_h___
    2222
    2323#ifdef QT_MAC_USE_COCOA
     
    3333#endif /* QT_MAC_USE_COCOA */
    3434
    35 #endif /* !___VBoxDockIconPreview_h___ */
     35#endif /* !___UIDockIconPreview_h___ */
    3636
  • trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.h

    r28800 r29812  
    77
    88/*
    9  * Copyright (C) 2009 Oracle Corporation
     9 * Copyright (C) 2010 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3737
    3838# include <qglobal.h> /* for QT_MAC_USE_COCOA */
    39 
    4039# include <ApplicationServices/ApplicationServices.h>
    4140
     
    4948typedef void *NativeWindowRef;
    5049typedef void *NativeViewRef;
    51 # else /* QT_MAC_USE_COCOA */
    52 #  include <Carbon/Carbon.h>
    53 typedef WindowRef NativeWindowRef;
    54 typedef HIViewRef NativeViewRef;
    5550# endif /* QT_MAC_USE_COCOA */
    5651#endif /* __OBJC__ */
     
    6661 *
    6762 ********************************************************************************/
    68 NativeWindowRef darwinToNativeWindowImpl (NativeViewRef aView);
    69 NativeViewRef darwinToNativeViewImpl (NativeWindowRef aWindow);
     63NativeWindowRef darwinToNativeWindowImpl(NativeViewRef aView);
     64NativeViewRef darwinToNativeViewImpl(NativeWindowRef aWindow);
    7065
    7166/********************************************************************************
     
    7469 *
    7570 ********************************************************************************/
    76 void darwinSetShowsToolbarButtonImpl (NativeWindowRef aWindow, bool aEnabled);
    77 void darwinSetShowsResizeIndicatorImpl (NativeWindowRef aWindow, bool aEnabled);
    78 void darwinSetHidesAllTitleButtonsImpl (NativeWindowRef aWindow);
    79 void darwinSetShowsWindowTransparentImpl (NativeWindowRef aWindow, bool aEnabled);
    80 void darwinSetMouseCoalescingEnabled (bool aEnabled);
     71void darwinSetShowsToolbarButtonImpl(NativeWindowRef aWindow, bool aEnabled);
     72void darwinSetShowsResizeIndicatorImpl(NativeWindowRef aWindow, bool aEnabled);
     73void darwinSetHidesAllTitleButtonsImpl(NativeWindowRef aWindow);
     74void darwinSetShowsWindowTransparentImpl(NativeWindowRef aWindow, bool aEnabled);
     75void darwinSetMouseCoalescingEnabled(bool aEnabled);
    8176
    8277/********************************************************************************
     
    8580 *
    8681 ********************************************************************************/
    87 void darwinWindowAnimateResizeImpl (NativeWindowRef aWindow, int x, int y, int width, int height);
    88 void darwinWindowInvalidateShapeImpl (NativeWindowRef aWindow);
    89 void darwinWindowInvalidateShadowImpl (NativeWindowRef aWindow);
    90 int  darwinWindowToolBarHeight (NativeWindowRef aWindow);
     82void darwinWindowAnimateResizeImpl(NativeWindowRef aWindow, int x, int y, int width, int height);
     83void darwinWindowInvalidateShapeImpl(NativeWindowRef aWindow);
     84void darwinWindowInvalidateShadowImpl(NativeWindowRef aWindow);
     85int  darwinWindowToolBarHeight(NativeWindowRef aWindow);
    9186bool darwinIsWindowMaximized(NativeWindowRef aWindow);
    9287
     
    9792RT_C_DECLS_END
    9893
    99 DECLINLINE(CGRect) darwinToCGRect (const QRect& aRect) { return CGRectMake (aRect.x(), aRect.y(), aRect.width(), aRect.height()); }
    100 DECLINLINE(CGRect) darwinFlipCGRect (CGRect aRect, int aTargetHeight) { aRect.origin.y = aTargetHeight - aRect.origin.y - aRect.size.height; return aRect; }
    101 DECLINLINE(CGRect) darwinFlipCGRect (CGRect aRect, const CGRect &aTarget) { return darwinFlipCGRect (aRect, aTarget.size.height); }
    102 DECLINLINE(CGRect) darwinCenterRectTo (CGRect aRect, const CGRect& aToRect)
     94DECLINLINE(CGRect) darwinToCGRect(const QRect& aRect) { return CGRectMake(aRect.x(), aRect.y(), aRect.width(), aRect.height()); }
     95DECLINLINE(CGRect) darwinFlipCGRect(CGRect aRect, int aTargetHeight) { aRect.origin.y = aTargetHeight - aRect.origin.y - aRect.size.height; return aRect; }
     96DECLINLINE(CGRect) darwinFlipCGRect(CGRect aRect, const CGRect &aTarget) { return darwinFlipCGRect(aRect, aTarget.size.height); }
     97DECLINLINE(CGRect) darwinCenterRectTo(CGRect aRect, const CGRect& aToRect)
    10398{
    10499    aRect.origin.x = aToRect.origin.x + (aToRect.size.width  - aRect.size.width)  / 2.0;
     
    121116 * @param   aWidget   Pointer to the QWidget
    122117 */
    123 NativeViewRef darwinToNativeView (QWidget *aWidget);
     118NativeViewRef darwinToNativeView(QWidget *aWidget);
    124119
    125120/**
     
    129124 * @param   aWidget   Pointer to the QWidget
    130125 */
    131 NativeWindowRef darwinToNativeWindow (QWidget *aWidget);
     126NativeWindowRef darwinToNativeWindow(QWidget *aWidget);
    132127
    133128/* This is necessary because of the C calling convention. Its a simple wrapper
     
    140135 * @param   aWidget   Pointer to the native View
    141136 */
    142 NativeWindowRef darwinToNativeWindow (NativeViewRef aView);
     137NativeWindowRef darwinToNativeWindow(NativeViewRef aView);
    143138
    144139/**
     
    148143 * @param   aWidget   Pointer to the native Window
    149144 */
    150 NativeViewRef darwinToNativeView (NativeWindowRef aWindow);
     145NativeViewRef darwinToNativeView(NativeWindowRef aWindow);
    151146
    152147/********************************************************************************
     
    155150 *
    156151 ********************************************************************************/
    157 void darwinSetShowsToolbarButton (QToolBar *aToolBar, bool aEnabled);
    158 void darwinSetShowsResizeIndicator (QWidget *aWidget, bool aEnabled);
    159 void darwinSetHidesAllTitleButtons (QWidget *aWidget);
    160 void darwinSetShowsWindowTransparent (QWidget *aWidget, bool aEnabled);
    161 void darwinDisableIconsInMenus (void);
     152void darwinSetShowsToolbarButton(QToolBar *aToolBar, bool aEnabled);
     153void darwinSetShowsResizeIndicator(QWidget *aWidget, bool aEnabled);
     154void darwinSetHidesAllTitleButtons(QWidget *aWidget);
     155void darwinSetShowsWindowTransparent(QWidget *aWidget, bool aEnabled);
     156void darwinDisableIconsInMenus(void);
    162157
    163158/********************************************************************************
     
    166161 *
    167162 ********************************************************************************/
    168 void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget);
    169 void darwinWindowInvalidateShape (QWidget *aWidget);
    170 void darwinWindowInvalidateShadow (QWidget *aWidget);
    171 int  darwinWindowToolBarHeight (QWidget *aWidget);
     163void darwinWindowAnimateResize(QWidget *aWidget, const QRect &aTarget);
     164void darwinWindowInvalidateShape(QWidget *aWidget);
     165void darwinWindowInvalidateShadow(QWidget *aWidget);
     166int  darwinWindowToolBarHeight(QWidget *aWidget);
    172167bool darwinIsWindowMaximized(QWidget *aWidget);
    173 QString darwinSystemLanguage (void);
    174 QPixmap darwinCreateDragPixmap (const QPixmap& aPixmap, const QString &aText);
     168QString darwinSystemLanguage(void);
     169QPixmap darwinCreateDragPixmap(const QPixmap& aPixmap, const QString &aText);
    175170
    176171
     
    186181 * @param   aWidget      Pointer to the QWidget
    187182 */
    188 CGContextRef darwinToCGContextRef (QWidget *aWidget);
     183CGContextRef darwinToCGContextRef(QWidget *aWidget);
    189184
    190 CGImageRef darwinToCGImageRef (const QImage *aImage);
    191 CGImageRef darwinToCGImageRef (const QPixmap *aPixmap);
    192 CGImageRef darwinToCGImageRef (const char *aSource);
    193 
    194 
    195 
    196 
    197 
    198 /********************************************************************************
    199  *
    200  * Old carbon stuff. Have to be converted soon!
    201  *
    202  ********************************************************************************/
    203 
    204 #include <QWidget>
    205 
    206 # ifndef QT_MAC_USE_COCOA
    207 
    208 /* Asserts if a != noErr and prints the error code */
    209 #  ifdef RT_STRICT
    210 #   define AssertCarbonOSStatus(a) AssertMsg ((a) == noErr, ("Carbon OSStatus: %d\n", static_cast<int> (a)))
    211 #  else
    212 #   define AssertCarbonOSStatus(a) do { NOREF(a); } while (0)
    213 #  endif
    214 
    215 
    216 /**
    217  * Converts a QRect to a HIRect.
    218  *
    219  * @returns HIRect for the converted QRect.
    220  * @param   aRect  the QRect to convert
    221  */
    222 DECLINLINE(HIRect) darwinToHIRect (const QRect &aRect)
    223 {
    224     return CGRectMake (aRect.x(), aRect.y(), aRect.width(), aRect.height());
    225 }
    226 
    227 /* Experimental region handler for the seamless mode */
    228 OSStatus darwinRegionHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData);
    229 
    230 /* Handler for the OpenGL overlay window stuff & the possible messages. */
    231 enum
    232 {
    233     /* Event classes */
    234     kEventClassVBox         = 'vbox',
    235     /* Event kinds */
    236     kEventVBoxShowWindow    = 'swin',
    237     kEventVBoxHideWindow    = 'hwin',
    238     kEventVBoxMoveWindow    = 'mwin',
    239     kEventVBoxResizeWindow  = 'rwin',
    240     kEventVBoxDisposeWindow = 'dwin',
    241     kEventVBoxUpdateDock    = 'udck',
    242     kEventVBoxUpdateContext = 'uctx',
    243     kEventVBoxBoundsChanged = 'bchg'
    244 };
    245 
    246 void PostBoundsChanged (const QRect& rect);
    247 OSStatus darwinOverlayWindowHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData);
    248 
    249 bool darwinIsMenuOpen (void);
    250 
    251 # endif /* !QT_MAC_USE_COCOA */
    252 
    253 # ifdef DEBUG
    254 void darwinDebugPrintEvent (const char *aPrefix, EventRef aEvent);
    255 # endif
     185CGImageRef darwinToCGImageRef(const QImage *aImage);
     186CGImageRef darwinToCGImageRef(const QPixmap *aPixmap);
     187CGImageRef darwinToCGImageRef(const char *aSource);
    256188
    257189#endif /* !__OBJC__ */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette