Changeset 7871 in vbox for trunk/src/VBox/Frontends/VirtualBox4/include/VBoxUtils.h
- Timestamp:
- Apr 10, 2008 2:59:03 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxUtils.h
r7867 r7871 198 198 # include <Carbon/Carbon.h> 199 199 200 /* Asserts if a != noErr and prints the error code */ 200 201 #define AssertCarbonOSStatus(a) AssertMsg ((a) == noErr, ("Carbon OSStatus: %d\n", static_cast<int> (a))) 201 202 … … 203 204 class QPixmap; 204 205 class 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 */ 208 CGImageRef darwinToCGImageRef (const QImage *aImage); 209 CGImageRef darwinToCGImageRef (const QPixmap *aPixmap); 210 CGImageRef 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 */ 218 inline HIViewRef darwinToHIViewRef (QWidget *aWidget) 215 219 { 216 220 return HIViewRef(aWidget->winId()); 217 221 } 218 222 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 */ 229 inline WindowRef darwinToWindowRef (HIViewRef aViewRef) 220 230 { 221 231 return reinterpret_cast<WindowRef> (HIViewGetWindow(aViewRef)); 222 232 } 223 233 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 */ 240 inline 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 */ 251 inline CGContextRef darwinToCGContextRef (QWidget *aWidget) 230 252 { 231 253 return static_cast<CGContext *> (aWidget->macCGHandle()); 232 254 } 233 255 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 */ 262 inline HIRect darwinToHIRect (const QRect &aRect) 235 263 { 236 264 return CGRectMake (aRect.x(), aRect.y(), aRect.width(), aRect.height()); 237 265 } 238 266 267 /* Special routines for the dock handling */ 268 CGImageRef darwinCreateDockBadge (const char *aSource); 269 void darwinUpdateDockPreview (CGImageRef aVMImage, CGImageRef aOverlayImage, CGImageRef aStateImage = NULL); 270 void darwinUpdateDockPreview (VBoxFrameBuffer *aFrameBuffer, CGImageRef aOverlayImage); 271 272 /* Experimental region handler for the seamless mode */ 273 OSStatus darwinRegionHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData); 274 239 275 #endif /* Q_WS_MAC */ 240 276
Note:
See TracChangeset
for help on using the changeset viewer.