VirtualBox

Ignore:
Timestamp:
Apr 10, 2008 2:59:03 PM (17 years ago)
Author:
vboxsync
Message:

FE/Qt4-OSX: Some minor fixes, updates & naming changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxUtils.h

    r7867 r7871  
    198198# include <Carbon/Carbon.h>
    199199
     200/* Asserts if a != noErr and prints the error code */
    200201#define AssertCarbonOSStatus(a) AssertMsg ((a) == noErr, ("Carbon OSStatus: %d\n", static_cast<int> (a)))
    201202
     
    203204class QPixmap;
    204205class VBoxFrameBuffer;
    205 CGImageRef DarwinQImageToCGImage (const QImage *aImage);
    206 CGImageRef DarwinQImageFromMimeSourceToCGImage (const char *aSource);
    207 CGImageRef DarwinQPixmapToCGImage (const QPixmap *aPixmap);
    208 CGImageRef DarwinQPixmapFromMimeSourceToCGImage (const char *aSource);
    209 CGImageRef DarwinCreateDockBadge (const char *aSource);
    210 void DarwinUpdateDockPreview (CGImageRef aVMImage, CGImageRef aOverlayImage, CGImageRef aStateImage = NULL);
    211 void DarwinUpdateDockPreview (VBoxFrameBuffer *aFrameBuffer, CGImageRef aOverlayImage);
    212 OSStatus DarwinRegionHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData);
    213 
    214 inline HIViewRef mapToHIViewRef (QWidget *aWidget)
     206
     207/* Converting stuff */
     208CGImageRef darwinToCGImageRef (const QImage *aImage);
     209CGImageRef darwinToCGImageRef (const QPixmap *aPixmap);
     210CGImageRef darwinToCGImageRef (const char *aSource);
     211
     212/**
     213 * Returns a reference to the HIView of the QWidget.
     214 *
     215 * @returns HIViewRef of the QWidget.
     216 * @param   aWidget   Pointer to the QWidget
     217 */
     218inline HIViewRef darwinToHIViewRef (QWidget *aWidget)
    215219{
    216220    return HIViewRef(aWidget->winId());
    217221}
    218222
    219 inline WindowRef mapToWindowRef (HIViewRef aViewRef)
     223/**
     224 * Returns a reference to the Window of the HIView.
     225 *
     226 * @returns WindowRef of the HIView.
     227 * @param   aViewRef  Reference to the HIView
     228 */
     229inline WindowRef darwinToWindowRef (HIViewRef aViewRef)
    220230{
    221231    return reinterpret_cast<WindowRef> (HIViewGetWindow(aViewRef));
    222232}
    223233
    224 inline WindowRef mapToWindowRef (QWidget *aWidget)
    225 {
    226     return mapToWindowRef (mapToHIViewRef (aWidget));
    227 }
    228 
    229 inline CGContextRef mapToCGContextRef (QWidget *aWidget)
     234/**
     235 * Returns a reference to the Window of the QWidget.
     236 *
     237 * @returns WindowRef of the QWidget.
     238 * @param   aWidget   Pointer to the QWidget
     239 */
     240inline WindowRef darwinToWindowRef (QWidget *aWidget)
     241{
     242    return ::darwinToWindowRef (::darwinToHIViewRef (aWidget));
     243}
     244
     245/**
     246 * Returns a reference to the CGContext of the QWidget.
     247 *
     248 * @returns CGContextRef of the QWidget.
     249 * @param   aWidget      Pointer to the QWidget
     250 */
     251inline CGContextRef darwinToCGContextRef (QWidget *aWidget)
    230252{
    231253    return static_cast<CGContext *> (aWidget->macCGHandle());
    232254}
    233255
    234 inline HIRect mapToHIRect (const QRect &aRect)
     256/**
     257 * Converts a QRect to a HIRect.
     258 *
     259 * @returns HIRect for the converted QRect.
     260 * @param   aRect  the QRect to convert
     261 */
     262inline HIRect darwinToHIRect (const QRect &aRect)
    235263{
    236264    return CGRectMake (aRect.x(), aRect.y(), aRect.width(), aRect.height());
    237265}
    238266
     267/* Special routines for the dock handling */
     268CGImageRef darwinCreateDockBadge (const char *aSource);
     269void darwinUpdateDockPreview (CGImageRef aVMImage, CGImageRef aOverlayImage, CGImageRef aStateImage = NULL);
     270void darwinUpdateDockPreview (VBoxFrameBuffer *aFrameBuffer, CGImageRef aOverlayImage);
     271
     272/* Experimental region handler for the seamless mode */
     273OSStatus darwinRegionHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData);
     274
    239275#endif /* Q_WS_MAC */
    240276
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