儲存庫 vbox 的更動 17175
- 時間撮記:
- 2009-2-26 下午04:09:24 (16 年 以前)
- 位置:
- trunk/src/VBox/Frontends/VirtualBox
- 檔案:
-
- 修改 8 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r17126 r17175 151 151 VirtualBox_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS 152 152 VirtualBox_DEFS.debug = VBOX_CHECK_STATE # QT_FATAL_ASSERT 153 VirtualBox_DEFS.darwin = VBOX_GUI_USE_Q IMAGE VBOX_WITHOUT_QHTTP153 VirtualBox_DEFS.darwin = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP 154 154 ifndef VBOX_WITH_COCOA_QT 155 155 VirtualBox_DEFS.darwin.x86= VBOX_GUI_USE_QUARTZ2D USE_HID_FOR_MODIFIERS -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxDockIconPreview.h
r16484 r17175 27 27 28 28 #ifdef QT_MAC_USE_COCOA 29 # include <ApplicationServices/ApplicationServices.h> 29 30 /** @todo include chocolatey headers... */ 30 31 #else … … 44 45 45 46 void updateDockOverlay(); 46 #ifndef QT_MAC_USE_COCOA47 //#ifndef QT_MAC_USE_COCOA 47 48 void updateDockPreview (CGImageRef aVMImage); 48 #endif49 //#endif 49 50 void updateDockPreview (VBoxFrameBuffer *aFrameBuffer); 50 51 51 52 private: 52 #ifdef QT_MAC_USE_COCOA53 //#ifdef QT_MAC_USE_COCOA 53 54 /** @todo Carbon -> Cocoa */ 54 #else55 //#else 55 56 inline void initPreviewImages(); 56 57 inline void initOverlayData (int aBitmapByteCount); … … 67 68 return aRect; 68 69 } 69 #endif /* !QT_MAC_USE_COCOA */70 //#endif /* !QT_MAC_USE_COCOA */ 70 71 71 72 /* Private member vars */ 72 73 VBoxConsoleWnd *mMainWnd; 73 #ifdef QT_MAC_USE_COCOA74 //#ifdef QT_MAC_USE_COCOA 74 75 /** @todo Carbon -> Cocoa */ 75 #else76 //#else 76 77 const CGRect mDockIconRect; 77 78 … … 88 89 CGRect mUpdateRect; 89 90 CGRect mMonitorRect; 90 #endif91 //#endif 91 92 }; 92 93 -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxUtils-darwin.h
r17150 r17175 151 151 class QImage; 152 152 153 # ifndef QT_MAC_USE_COCOA154 155 /* Asserts if a != noErr and prints the error code */156 # define AssertCarbonOSStatus(a) AssertMsg ((a) == noErr, ("Carbon OSStatus: %d\n", static_cast<int> (a)))157 158 153 /* Converting stuff */ 159 154 CGImageRef darwinToCGImageRef (const QImage *aImage); … … 171 166 return static_cast<CGContext *> (aWidget->macCGHandle()); 172 167 } 168 169 # ifndef QT_MAC_USE_COCOA 170 171 /* Asserts if a != noErr and prints the error code */ 172 # define AssertCarbonOSStatus(a) AssertMsg ((a) == noErr, ("Carbon OSStatus: %d\n", static_cast<int> (a))) 173 173 174 174 175 /** -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r17126 r17175 3031 3031 * an repaint only. All the magic clipping stuff is done 3032 3032 * in the paint engine. */ 3033 #ifndef QT_MAC_USE_COCOA 3033 3034 HIViewReshapeStructure (::darwinToNativeView (console->viewport())); 3035 #endif /* QT_MAC_USE_COCOA */ 3034 3036 // HIWindowInvalidateShadow (::darwinToWindowRef (console->viewport())); 3035 3037 // ReshapeCustomWindow (::darwinToWindowRef (this)); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBQuartz2D.cpp
r17126 r17175 159 159 Assert (mImage); 160 160 161 #ifndef QT_MAC_USE_COCOA 161 162 VBoxConsoleWnd *main = qobject_cast <VBoxConsoleWnd *> (vboxGlobal().mainWindow()); 162 163 Assert (VALID_PTR (main)); … … 252 253 HIViewDrawCGImage (ctx, &destRect, subImage); 253 254 } 255 #endif /* QT_MAC_USE_COCOA */ 254 256 } 255 257 -
trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxDockIconPreview.cpp
r17126 r17175 32 32 #endif 33 33 34 #ifndef QT_MAC_USE_COCOA34 //#ifndef QT_MAC_USE_COCOA 35 35 /* Import private function to capture the window content of any given window. */ 36 36 CG_EXTERN_C_BEGIN … … 41 41 CG_EXTERN void CGContextCopyWindowCaptureContentsToRect(CGContextRef c, CGRect dstRect, CGSConnectionID connection, CGSWindowID window, int zero); 42 42 CG_EXTERN_C_END 43 #endif /* !QT_MAC_USE_COCOA */43 //#endif /* !QT_MAC_USE_COCOA */ 44 44 45 45 VBoxDockIconPreview::VBoxDockIconPreview (VBoxConsoleWnd *aMainWnd, const QPixmap& aOverlayImage) 46 46 : mMainWnd (aMainWnd) 47 #ifdef QT_MAC_USE_COCOA48 #else47 //#ifdef QT_MAC_USE_COCOA 48 //#else 49 49 , mDockIconRect (CGRectMake (0, 0, 128, 128)) 50 50 , mDockMonitor (NULL) … … 53 53 , mUpdateRect (CGRectMake (0, 0, 0, 0)) 54 54 , mMonitorRect (CGRectMake (0, 0, 0, 0)) 55 #endif55 //#endif 56 56 { 57 57 #ifdef QT_MAC_USE_COCOA … … 88 88 } 89 89 90 #ifndef QT_MAC_USE_COCOA90 //#ifndef QT_MAC_USE_COCOA 91 91 92 92 void VBoxDockIconPreview::initPreviewImages() … … 158 158 } 159 159 160 #endif /* !QT_MAC_USE_COCOA */160 //#endif /* !QT_MAC_USE_COCOA */ 161 161 162 162 void VBoxDockIconPreview::updateDockOverlay() … … 208 208 } 209 209 210 #ifndef QT_MAC_USE_COCOA210 //#ifndef QT_MAC_USE_COCOA 211 211 void VBoxDockIconPreview::updateDockPreview (CGImageRef aVMImage) 212 212 { … … 251 251 CGContextDrawImage (context, flipRect (iconRect), aVMImage); 252 252 253 #ifndef QT_MAC_USE_COCOA 253 254 /* Process the content of any external OpenGL window. */ 254 255 WindowRef w = darwinToNativeWindow (mMainWnd); … … 293 294 } 294 295 } 296 #endif /* QT_MAC_USE_COCOA */ 295 297 296 298 /* Draw the glossy overlay */ … … 306 308 CGColorSpaceRelease (cs); 307 309 } 308 #endif /* !QT_MAC_USE_COCOA */310 //#endif /* !QT_MAC_USE_COCOA */ 309 311 310 312 void VBoxDockIconPreview::updateDockPreview (VBoxFrameBuffer *aFrameBuffer) 311 313 { 312 #ifdef QT_MAC_USE_COCOA313 #else /* !QT_MAC_USE_COCOA */314 //#ifdef QT_MAC_USE_COCOA 315 //#else /* !QT_MAC_USE_COCOA */ 314 316 CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB(); 315 317 Assert (cs); … … 329 331 CGDataProviderRelease (dp); 330 332 CGColorSpaceRelease (cs); 331 #endif /* !QT_MAC_USE_COCOA */332 } 333 333 //#endif /* !QT_MAC_USE_COCOA */ 334 } 335 -
trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-carbon.cpp
r17150 r17175 85 85 QImage *qimg = (QImage *)info; 86 86 delete qimg; 87 }88 89 /**90 * Converts a QPixmap to a CGImage.91 *92 * @returns CGImageRef for the new image. (Remember to release it when finished with it.)93 * @param aPixmap Pointer to the QPixmap instance to convert.94 */95 CGImageRef darwinToCGImageRef (const QImage *aImage)96 {97 QImage *imageCopy = new QImage (*aImage);98 /** @todo this code assumes 32-bit image input, the lazy bird convert image to 32-bit method is anything but optimal... */99 if (imageCopy->format() != QImage::Format_ARGB32)100 *imageCopy = imageCopy->convertToFormat (QImage::Format_ARGB32);101 Assert (!imageCopy->isNull());102 103 CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB();104 CGDataProviderRef dp = CGDataProviderCreateWithData (imageCopy, aImage->bits(), aImage->numBytes(), darwinDataProviderReleaseQImage);105 106 CGBitmapInfo bmpInfo = kCGImageAlphaFirst | kCGBitmapByteOrder32Host;107 CGImageRef ir = CGImageCreate (imageCopy->width(), imageCopy->height(), 8, 32, imageCopy->bytesPerLine(), cs,108 bmpInfo, dp, 0 /*decode */, 0 /* shouldInterpolate */,109 kCGRenderingIntentDefault);110 CGColorSpaceRelease (cs);111 CGDataProviderRelease (dp);112 113 Assert (ir);114 return ir;115 }116 117 /**118 * Converts a QPixmap to a CGImage.119 *120 * @returns CGImageRef for the new image. (Remember to release it when finished with it.)121 * @param aPixmap Pointer to the QPixmap instance to convert.122 */123 CGImageRef darwinToCGImageRef (const QPixmap *aPixmap)124 {125 return aPixmap->toMacCGImageRef();126 }127 128 /**129 * Loads an image using Qt and converts it to a CGImage.130 *131 * @returns CGImageRef for the new image. (Remember to release it when finished with it.)132 * @param aSource The source name.133 */134 CGImageRef darwinToCGImageRef (const char *aSource)135 {136 QPixmap qpm (QString(":/") + aSource);137 Assert (!qpm.isNull());138 return ::darwinToCGImageRef (&qpm);139 87 } 140 88 -
trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.cpp
r17150 r17175 21 21 22 22 #include "VBoxUtils-darwin.h" 23 24 #include <iprt/assert.h> 23 25 24 26 #include <QApplication> … … 126 128 painter.end(); 127 129 return dragPixmap; 130 } 131 132 /** 133 * Callback for deleting the QImage object when CGImageCreate is done 134 * with it (which is probably not until the returned CFGImageRef is released). 135 * 136 * @param info Pointer to the QImage. 137 */ 138 static void darwinDataProviderReleaseQImage (void *info, const void *, size_t) 139 { 140 QImage *qimg = (QImage *)info; 141 delete qimg; 142 } 143 144 /** 145 * Converts a QPixmap to a CGImage. 146 * 147 * @returns CGImageRef for the new image. (Remember to release it when finished with it.) 148 * @param aPixmap Pointer to the QPixmap instance to convert. 149 */ 150 CGImageRef darwinToCGImageRef (const QImage *aImage) 151 { 152 QImage *imageCopy = new QImage (*aImage); 153 /** @todo this code assumes 32-bit image input, the lazy bird convert image to 32-bit method is anything but optimal... */ 154 if (imageCopy->format() != QImage::Format_ARGB32) 155 *imageCopy = imageCopy->convertToFormat (QImage::Format_ARGB32); 156 Assert (!imageCopy->isNull()); 157 158 CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB(); 159 CGDataProviderRef dp = CGDataProviderCreateWithData (imageCopy, aImage->bits(), aImage->numBytes(), darwinDataProviderReleaseQImage); 160 161 CGBitmapInfo bmpInfo = kCGImageAlphaFirst | kCGBitmapByteOrder32Host; 162 CGImageRef ir = CGImageCreate (imageCopy->width(), imageCopy->height(), 8, 32, imageCopy->bytesPerLine(), cs, 163 bmpInfo, dp, 0 /*decode */, 0 /* shouldInterpolate */, 164 kCGRenderingIntentDefault); 165 CGColorSpaceRelease (cs); 166 CGDataProviderRelease (dp); 167 168 Assert (ir); 169 return ir; 170 } 171 172 /** 173 * Converts a QPixmap to a CGImage. 174 * 175 * @returns CGImageRef for the new image. (Remember to release it when finished with it.) 176 * @param aPixmap Pointer to the QPixmap instance to convert. 177 */ 178 CGImageRef darwinToCGImageRef (const QPixmap *aPixmap) 179 { 180 return aPixmap->toMacCGImageRef(); 181 } 182 183 /** 184 * Loads an image using Qt and converts it to a CGImage. 185 * 186 * @returns CGImageRef for the new image. (Remember to release it when finished with it.) 187 * @param aSource The source name. 188 */ 189 CGImageRef darwinToCGImageRef (const char *aSource) 190 { 191 QPixmap qpm (QString(":/") + aSource); 192 Assert (!qpm.isNull()); 193 return ::darwinToCGImageRef (&qpm); 128 194 } 129 195
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器