Changeset 17340 in vbox for trunk/src/VBox/Frontends/VirtualBox/include/VBoxUtils-darwin.h
- Timestamp:
- Mar 4, 2009 12:11:33 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxUtils-darwin.h
r17201 r17340 40 40 #else 41 41 # include <iprt/cdefs.h> /* for __BEGIN_DECLS/__END_DECLS & stuff */ 42 42 43 # include <qglobal.h> /* for QT_MAC_USE_COCOA */ 44 # include <QRect> 43 45 44 46 # include <ApplicationServices/ApplicationServices.h> 47 45 48 class QWidget; 46 49 class QToolBar; 47 50 class QPixmap; 48 class Q Rect;51 class QImage; 49 52 50 53 # ifdef QT_MAC_USE_COCOA … … 89 92 void darwinWindowInvalidateShadowImpl (NativeWindowRef aWindow); 90 93 91 92 94 __END_DECLS 93 95 … … 157 159 158 160 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 */ 172 CGContextRef darwinToCGContextRef (QWidget *aWidget); 173 170 174 CGImageRef darwinToCGImageRef (const QImage *aImage); 171 175 CGImageRef darwinToCGImageRef (const QPixmap *aPixmap); 172 176 CGImageRef darwinToCGImageRef (const char *aSource); 173 177 174 /**175 * Returns a reference to the CGContext of the QWidget.176 *177 * @returns CGContextRef of the QWidget.178 * @param aWidget Pointer to the QWidget179 */180 DECLINLINE(CGContextRef) darwinToCGContextRef (QWidget *aWidget)181 {182 return static_cast<CGContext *> (aWidget->macCGHandle());183 }184 185 178 DECLINLINE(CGRect) darwinToCGRect (const QRect& aRect) { return CGRectMake (aRect.x(), aRect.y(), aRect.width(), aRect.height()); } 186 179 DECLINLINE(CGRect) darwinFlipCGRect (CGRect aRect, int aTargetHeight) { aRect.origin.y = aTargetHeight - aRect.origin.y - aRect.size.height; return aRect; } 180 DECLINLINE(CGRect) darwinFlipCGRect (CGRect aRect, const CGRect &aTarget) { return darwinFlipCGRect (aRect, aTarget.size.height); } 181 DECLINLINE(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> 187 199 188 200 # ifndef QT_MAC_USE_COCOA
Note:
See TracChangeset
for help on using the changeset viewer.