Changeset 28279 in vbox
- Timestamp:
- Apr 14, 2010 12:52:05 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 60022
- Location:
- trunk/src/VBox
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/darwin/UICocoaDockIconPreview.mm
r27215 r28279 58 58 } 59 59 - (id)initWithParent:(UICocoaDockIconPreviewPrivate*)parent; 60 - (void)destroy; 60 61 - (NSView*)screenContent; 61 62 - (void)cleanup; … … 82 83 inline ~UICocoaDockIconPreviewPrivate() 83 84 { 85 86 [mUIDockTile destroy]; 84 87 [mUIDockTile release]; 85 88 } … … 246 249 } 247 250 251 - (void)destroy 252 { 253 /* Remove all content from the application dock tile. */ 254 [mOverlay removeFromSuperview]; 255 [mOverlay release]; 256 mOverlay = nil; 257 NSDockTile *dock = [[NSApplication sharedApplication] dockTile]; 258 [dock setContentView: nil]; 259 /* Cleanup all other resources */ 260 [self cleanup]; 261 } 262 248 263 - (NSView*)screenContent 249 264 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r28215 r28279 314 314 CGImageRelease(image); 315 315 } 316 } 317 318 void UIMachineLogic::updateDockIconSize(int screenId, int width, int height) 319 { 320 if (!isMachineWindowsCreated()) 321 return; 322 323 if ( m_fIsDockIconEnabled 324 && m_pDockIconPreview 325 && m_DockIconPreviewMonitor == screenId) 326 m_pDockIconPreview->setOriginalSize(width, height); 316 327 } 317 328 #endif /* Q_WS_MAC */ … … 344 355 //dbgDestroy(); 345 356 #endif 346 347 #ifdef Q_WS_MAC348 if (m_pDockIconPreview)349 delete m_pDockIconPreview;350 #endif /* Q_WS_MAC */351 357 } 352 358 … … 608 614 } 609 615 616 void UIMachineLogic::cleanupMachineWindows() 617 { 618 #ifdef Q_WS_MAC 619 /* We need to clean up the dock stuff before the machine windows. */ 620 cleanupDock(); 621 #endif /* Q_WS_MAC */ 622 } 623 624 #ifdef Q_WS_MAC 625 void UIMachineLogic::cleanupDock() 626 { 627 if (m_pDockIconPreview) 628 { 629 delete m_pDockIconPreview; 630 m_pDockIconPreview = 0; 631 } 632 } 633 #endif /* Q_WS_MAC */ 634 610 635 void UIMachineLogic::sltMachineStateChanged() 611 636 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r27678 r28279 80 80 #ifdef Q_WS_MAC 81 81 void updateDockIcon(); 82 void updateDockIconSize(int screenId, int width, int height); 82 83 #endif /* Q_WS_MAC */ 83 84 … … 120 121 /* Cleanup helpers: */ 121 122 //virtual void cleanupRequiredFeatures() {} 122 #ifdef Q_WS_MAC 123 //virtual void cleanupDock() {} 123 virtual void cleanupMachineWindows(); 124 #ifdef Q_WS_MAC 125 virtual void cleanupDock(); 124 126 #endif /* Q_WS_MAC */ 125 127 //virtual void cleanupActionGroups() {} -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r28246 r28279 828 828 829 829 #ifdef Q_WS_MAC 830 // TODO_NEW_CORE 831 // mDockIconPreview->setOriginalSize(pResizeEvent->width(), pResizeEvent->height()); 830 machineLogic()->updateDockIconSize(screenId(), pResizeEvent->width(), pResizeEvent->height()); 832 831 #endif /* Q_WS_MAC */ 833 832 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
r27419 r28279 210 210 if (!isMachineWindowsCreated()) 211 211 return; 212 213 /* Base class cleanup: */ 214 UIMachineLogic::cleanupMachineWindows(); 212 215 213 216 /* Cleanup normal machine window: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp
r27376 r28279 133 133 return; 134 134 135 /* Base class cleanup: */ 136 UIMachineLogic::cleanupMachineWindows(); 137 135 138 #ifdef Q_WS_MAC // TODO: Is that really need here? 136 139 /* We have to make sure that we are getting the front most process. -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp
r27419 r28279 199 199 return; 200 200 201 /* Base class cleanup: */ 202 UIMachineLogic::cleanupMachineWindows(); 203 201 204 /* Cleanup normal machine window: */ 202 205 foreach (UIMachineWindow *pMachineWindow, machineWindows()) -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsDisplay.cpp
r28210 r28279 304 304 { 305 305 int cVal = mSlMonitors->value(); 306 if (cVal > 1)307 {308 #ifdef Q_WS_MAC309 mCb3D->setChecked(false);310 #endif311 }312 306 #ifdef VBOX_WITH_VIDEOHWACCEL 313 307 mCb2DVideo->setEnabled(VBoxGlobal::isAcceleration2DVideoAvailable()); 314 308 #endif /* VBOX_WITH_VIDEOHWACCEL */ 315 #ifdef Q_WS_MAC316 mCb3D->setEnabled(cVal == 1 && vboxGlobal().virtualBox().GetHost().GetAcceleration3DAvailable());317 #else318 309 mCb3D->setEnabled(vboxGlobal().virtualBox().GetHost().GetAcceleration3DAvailable()); 319 #endif320 310 321 311 /* The memory requirements have changed too. */ -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c
r27889 r28279 347 347 { 348 348 renderspuMakeCurrent(0, 0, pCtx->id); 349 } 349 } 350 350 } 351 351 … … 372 372 if (pNewCtx!=pOldCtx) 373 373 { 374 renderspuMakeCurrent(pOldCtx&&pOldCtx->currentWindow ? pOldCtx->currentWindow->id:0, 0, 374 renderspuMakeCurrent(pOldCtx&&pOldCtx->currentWindow ? pOldCtx->currentWindow->id:0, 0, 375 375 pOldCtx ? pOldCtx->id:0); 376 376 } … … 1054 1054 } 1055 1055 1056 #if defined(WINDOWS) || defined(GLX)1057 1056 renderspu_SystemReparentWindow(pWindow); 1058 #endif1059 1057 } 1060 1058 -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h
r27708 r28279 311 311 312 312 extern GLint RENDER_APIENTRY renderspuWindowCreate( const char *dpyName, GLint visBits ); 313 extern void RENDER_APIENTRY renderspu_SystemReparentWindow(WindowInfo *window); 313 314 extern GLint RENDER_APIENTRY renderspuCreateContext( const char *dpyname, GLint visBits, GLint shareCtx ); 314 315 extern void RENDER_APIENTRY renderspuMakeCurrent(GLint crWindow, GLint nativeWindow, GLint ctx); 315 316 extern void RENDER_APIENTRY renderspuSwapBuffers( GLint window, GLint flags ); 316 317 #if defined(WINDOWS) || defined(GLX)318 extern void renderspu_SystemReparentWindow(WindowInfo *window);319 #endif320 317 321 318 #ifdef __cplusplus -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_agl.c
r24378 r28279 428 428 } 429 429 430 void renderspu_SystemReparentWindow(WindowInfo *) 431 { 432 /* stub only */ 433 } 434 430 435 void 431 436 renderspu_SystemDestroyWindow(WindowInfo *window) -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c
r26229 r28279 96 96 } 97 97 98 void renderspu_SystemDestroyWindow(WindowInfo *pWinInfo) 99 { 100 CRASSERT(pWinInfo); 101 102 cocoaViewDestroy(pWinInfo->window); 103 } 104 105 void renderspu_SystemWindowPosition(WindowInfo *pWinInfo, GLint x, GLint y) 106 { 107 CRASSERT(pWinInfo); 108 98 void renderspu_SystemReparentWindow(WindowInfo *pWinInfo) 99 { 109 100 #ifdef __LP64__ 110 101 NativeViewRef pParentWin = (NativeViewRef)render_spu_parent_window_id; … … 112 103 NativeViewRef pParentWin = (NativeViewRef)(uint32_t)render_spu_parent_window_id; 113 104 #endif /* __LP64__ */ 105 cocoaViewReparent(pWinInfo->window, pParentWin); 106 } 107 108 void renderspu_SystemDestroyWindow(WindowInfo *pWinInfo) 109 { 110 CRASSERT(pWinInfo); 111 112 cocoaViewDestroy(pWinInfo->window); 113 } 114 115 void renderspu_SystemWindowPosition(WindowInfo *pWinInfo, GLint x, GLint y) 116 { 117 CRASSERT(pWinInfo); 118 119 #ifdef __LP64__ 120 NativeViewRef pParentWin = (NativeViewRef)render_spu_parent_window_id; 121 #else /* __LP64__ */ 122 NativeViewRef pParentWin = (NativeViewRef)(uint32_t)render_spu_parent_window_id; 123 #endif /* __LP64__ */ 114 124 115 125 cocoaViewSetPosition(pWinInfo->window, pParentWin, x, y); -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.h
r23491 r28279 43 43 /* View management */ 44 44 void cocoaViewCreate(NativeViewRef *ppView, NativeViewRef pParentView, GLbitfield fVisParams); 45 void cocoaViewReparent(NativeViewRef pView, NativeViewRef pParentView); 45 46 void cocoaViewDestroy(NativeViewRef pView); 46 47 void cocoaViewDisplay(NativeViewRef pView); -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m
r25293 r28279 138 138 @private 139 139 NSView *m_pParentView; 140 NSWindow *m_pOverlayWin; 140 141 141 142 NSOpenGLContext *m_pGLCtx; … … 172 173 - (void)setGLCtx:(NSOpenGLContext*)pCtx; 173 174 - (NSOpenGLContext*)glCtx; 175 176 - (void)setParentView: (NSView*)view; 177 - (NSView*)parentView; 178 - (void)setOverlayWin: (NSWindow*)win; 179 - (NSWindow*)overlayWin; 174 180 175 181 - (void)setPos:(NSPoint)pos; … … 299 305 [self cleanup]; 300 306 301 /* Create a buffer for our thumbnail image. Its in the size of this view. */ 302 m_ThumbBitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL 303 pixelsWide:frame.size.width 304 pixelsHigh:frame.size.height 305 bitsPerSample:8 306 samplesPerPixel:4 307 hasAlpha:YES 308 isPlanar:NO 309 colorSpaceName:NSDeviceRGBColorSpace 310 bytesPerRow:frame.size.width * 4 311 bitsPerPixel:8 * 4]; 312 m_ThumbImage = [[NSImage alloc] initWithSize:[m_ThumbBitmap size]]; 313 [m_ThumbImage addRepresentation:m_ThumbBitmap]; 307 if ( frame.size.width > 0 308 && frame.size.height > 0) 309 { 310 /* Create a buffer for our thumbnail image. Its in the size of this view. */ 311 m_ThumbBitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL 312 pixelsWide:frame.size.width 313 pixelsHigh:frame.size.height 314 bitsPerSample:8 315 samplesPerPixel:4 316 hasAlpha:YES 317 isPlanar:NO 318 colorSpaceName:NSDeviceRGBColorSpace 319 bytesPerRow:frame.size.width * 4 320 bitsPerPixel:8 * 4]; 321 m_ThumbImage = [[NSImage alloc] initWithSize:[m_ThumbBitmap size]]; 322 [m_ThumbImage addRepresentation:m_ThumbBitmap]; 323 } 314 324 [self unlock]; 315 325 } … … 447 457 m_pOverlayView = pOverlayView; 448 458 m_Thread = [NSThread currentThread]; 459 460 [m_pOverlayView setOverlayWin: self]; 449 461 450 462 m_pOverlayHelperView = [[OverlayHelperView alloc] initWithOverlayWindow:self]; … … 606 618 } 607 619 620 - (NSView*)parentView 621 { 622 return m_pParentView; 623 } 624 625 - (void)setParentView: (NSView*)view 626 { 627 m_pParentView = view; 628 } 629 630 - (void)setOverlayWin: (NSWindow*)win 631 { 632 m_pOverlayWin = win; 633 } 634 635 - (NSWindow*)overlayWin 636 { 637 return m_pOverlayWin; 638 } 639 608 640 - (void)setPos:(NSPoint)pos 609 641 { … … 1026 1058 [m_DockTileView thumbBitmap] != nil) 1027 1059 { 1028 /* Only update after at least 200 ms, cause glReadPixels is1060 /* Only update after at least 200 ms, cause glReadPixels is 1029 1061 * heavy performance wise. */ 1030 1062 uint64_t uiNewTime = RTTimeMilliTS(); … … 1306 1338 } 1307 1339 1340 void cocoaViewReparent(NativeViewRef pView, NativeViewRef pParentView) 1341 { 1342 NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; 1343 1344 OverlayView* pOView = (OverlayView*)pView; 1345 1346 if (pOView) 1347 { 1348 /* Make sure the window is removed from any previous parent window. */ 1349 [[[pOView overlayWin] parentWindow] removeChildWindow:[pOView overlayWin]]; 1350 /* Set the new parent view */ 1351 [pOView setParentView: pParentView]; 1352 /* Add the overlay window as a child to the new parent window */ 1353 [[pParentView window] addChildWindow:[pOView overlayWin] ordered:NSWindowAbove]; 1354 } 1355 1356 [pPool release]; 1357 } 1358 1308 1359 void cocoaViewDestroy(NativeViewRef pView) 1309 1360 {
Note:
See TracChangeset
for help on using the changeset viewer.