VirtualBox

Ignore:
Timestamp:
Mar 4, 2009 12:11:33 PM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4-OSX: Make the dock icon preview work in Cocoa.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxUtils-darwin.h

    r17201 r17340  
    4040#else
    4141# include <iprt/cdefs.h> /* for __BEGIN_DECLS/__END_DECLS & stuff */
     42
    4243# include <qglobal.h> /* for QT_MAC_USE_COCOA */
     44# include <QRect>
    4345
    4446# include <ApplicationServices/ApplicationServices.h>
     47
    4548class QWidget;
    4649class QToolBar;
    4750class QPixmap;
    48 class QRect;
     51class QImage;
    4952
    5053# ifdef QT_MAC_USE_COCOA
     
    8992void darwinWindowInvalidateShadowImpl (NativeWindowRef aWindow);
    9093
    91 
    9294__END_DECLS
    9395
     
    157159
    158160
    159 
    160 /********************************************************************************
    161  *
    162  * Old carbon stuff. Have to be converted soon!
    163  *
    164  ********************************************************************************/
    165 
    166 #include <QWidget>
    167 class QImage;
    168 
    169 /* Converting stuff */
     161/********************************************************************************
     162 *
     163 * Graphics stuff (Qt Wrapper)
     164 *
     165 ********************************************************************************/
     166/**
     167 * Returns a reference to the CGContext of the QWidget.
     168 *
     169 * @returns CGContextRef of the QWidget.
     170 * @param   aWidget      Pointer to the QWidget
     171 */
     172CGContextRef darwinToCGContextRef (QWidget *aWidget);
     173
    170174CGImageRef darwinToCGImageRef (const QImage *aImage);
    171175CGImageRef darwinToCGImageRef (const QPixmap *aPixmap);
    172176CGImageRef darwinToCGImageRef (const char *aSource);
    173177
    174 /**
    175  * Returns a reference to the CGContext of the QWidget.
    176  *
    177  * @returns CGContextRef of the QWidget.
    178  * @param   aWidget      Pointer to the QWidget
    179  */
    180 DECLINLINE(CGContextRef) darwinToCGContextRef (QWidget *aWidget)
    181 {
    182     return static_cast<CGContext *> (aWidget->macCGHandle());
    183 }
    184 
    185178DECLINLINE(CGRect) darwinToCGRect (const QRect& aRect) { return CGRectMake (aRect.x(), aRect.y(), aRect.width(), aRect.height()); }
    186179DECLINLINE(CGRect) darwinFlipCGRect (CGRect aRect, int aTargetHeight) { aRect.origin.y = aTargetHeight - aRect.origin.y - aRect.size.height; return aRect; }
     180DECLINLINE(CGRect) darwinFlipCGRect (CGRect aRect, const CGRect &aTarget) { return darwinFlipCGRect (aRect, aTarget.size.height); }
     181DECLINLINE(CGRect) darwinCenterRectTo (CGRect aRect, const CGRect& aToRect)
     182{
     183    aRect.origin.x = aToRect.origin.x + (aToRect.size.width  - aRect.size.width)  / 2.0;
     184    aRect.origin.y = aToRect.origin.y + (aToRect.size.height - aRect.size.height) / 2.0;
     185    return aRect;
     186}
     187
     188
     189
     190
     191
     192/********************************************************************************
     193 *
     194 * Old carbon stuff. Have to be converted soon!
     195 *
     196 ********************************************************************************/
     197
     198#include <QWidget>
    187199
    188200# ifndef QT_MAC_USE_COCOA
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