VirtualBox

Ignore:
Timestamp:
Feb 25, 2009 1:03:29 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
43374
Message:

FE/Qt-OSX: Make the handling of Darwin tasks more generic for Carbon & Cocoa. Disable settings window animation on Cocoa.

Location:
trunk/src/VBox/Frontends/VirtualBox/include
Files:
1 added
2 edited

Legend:

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

    r16469 r17126  
    8181            /** @todo Carbon -> Cocoa */
    8282# else  /* !QT_MAC_USE_COCOA */
    83             WindowRef window = ::darwinToWindowRef (this);
     83            WindowRef window = ::darwinToNativeWindow (this);
    8484            EventHandlerUPP eventHandler = ::NewEventHandlerUPP (VBoxToolBar::macEventFilter);
    8585            EventTypeSpec eventTypes[2];
     
    123123    {
    124124#ifdef Q_WS_MAC
    125         ::darwinSetShowToolBarButton (this, aShow);
     125        ::darwinSetShowsToolbarButton (this, aShow);
    126126#else  /* Q_WS_MAC */
    127127        NOREF (aShow);
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxUtils.h

    r16691 r17126  
    128128
    129129#ifdef Q_WS_MAC
    130 class QImage;
    131 class QPixmap;
    132 class QToolBar;
    133 class VBoxFrameBuffer;
    134 
    135 # ifdef QT_MAC_USE_COCOA
    136 /** @todo Carbon -> Cocoa */
    137 # else /* !QT_MAC_USE_COCOA */
    138 #  undef PAGE_SIZE
    139 #  undef PAGE_SHIFT
    140 #  include <Carbon/Carbon.h>
    141 
    142 /* Asserts if a != noErr and prints the error code */
    143 #  define AssertCarbonOSStatus(a) AssertMsg ((a) == noErr, ("Carbon OSStatus: %d\n", static_cast<int> (a)))
    144 
    145 /* Converting stuff */
    146 CGImageRef darwinToCGImageRef (const QImage *aImage);
    147 CGImageRef darwinToCGImageRef (const QPixmap *aPixmap);
    148 CGImageRef darwinToCGImageRef (const char *aSource);
    149 
    150 /**
    151  * Returns a reference to the HIView of the QWidget.
    152  *
    153  * @returns HIViewRef of the QWidget.
    154  * @param   aWidget   Pointer to the QWidget
    155  */
    156 DECLINLINE(HIViewRef) darwinToHIViewRef (QWidget *aWidget)
    157 {
    158     return HIViewRef(aWidget->winId());
    159 }
    160 
    161 /**
    162  * Returns a reference to the Window of the HIView.
    163  *
    164  * @returns WindowRef of the HIView.
    165  * @param   aViewRef  Reference to the HIView
    166  */
    167 DECLINLINE(WindowRef) darwinToWindowRef (HIViewRef aViewRef)
    168 {
    169     return reinterpret_cast<WindowRef> (HIViewGetWindow(aViewRef));
    170 }
    171 
    172 /**
    173  * Returns a reference to the Window of the QWidget.
    174  *
    175  * @returns WindowRef of the QWidget.
    176  * @param   aWidget   Pointer to the QWidget
    177  */
    178 DECLINLINE(WindowRef) darwinToWindowRef (QWidget *aWidget)
    179 {
    180     return ::darwinToWindowRef (::darwinToHIViewRef (aWidget));
    181 }
    182 
    183 /**
    184  * Returns a reference to the CGContext of the QWidget.
    185  *
    186  * @returns CGContextRef of the QWidget.
    187  * @param   aWidget      Pointer to the QWidget
    188  */
    189 DECLINLINE(CGContextRef) darwinToCGContextRef (QWidget *aWidget)
    190 {
    191     return static_cast<CGContext *> (aWidget->macCGHandle());
    192 }
    193 
    194 /**
    195  * Converts a QRect to a HIRect.
    196  *
    197  * @returns HIRect for the converted QRect.
    198  * @param   aRect  the QRect to convert
    199  */
    200 DECLINLINE(HIRect) darwinToHIRect (const QRect &aRect)
    201 {
    202     return CGRectMake (aRect.x(), aRect.y(), aRect.width(), aRect.height());
    203 }
    204 #endif /* !QT_MAC_USE_COCOA */
    205 
    206 QString darwinSystemLanguage (void);
    207 
    208 bool darwinIsMenuOpen (void);
    209 
    210 void darwinSetShowToolBarButton (QToolBar *aToolBar, bool aShow);
    211 
    212 void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget);
    213 
    214 /* Proxy icon creation */
    215 QPixmap darwinCreateDragPixmap (const QPixmap& aPixmap, const QString &aText);
    216 
    217 /* Icons in the menu of an mac application are unusual. */
    218 void darwinDisableIconsInMenus (void);
    219 
    220 # ifdef DEBUG
    221 void darwinDebugPrintEvent (const char *aPrefix, EventRef aEvent);
    222 # endif
    223 
    224 # ifdef QT_MAC_USE_COCOA
    225 /** @todo Carbon -> Cocoa  */
    226 # else  /* !QT_MAC_USE_COCOA */
    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     kEventVBoxMoveWindow   = 'mwin',
    238     kEventVBoxResizeWindow = 'rwin',
    239     kEventVBoxUpdateDock   = 'udck'
    240 };
    241 OSStatus darwinOverlayWindowHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData);
    242 # endif /* !QT_MAC_USE_COCOA*/
     130# include "VBoxUtils-darwin.h"
    243131#endif /* Q_WS_MAC */
    244132
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