Changeset 6715 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Feb 1, 2008 11:36:46 AM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro
r6603 r6715 267 267 images/dock_0.png \ 268 268 images/dock_1.png \ 269 images/dock_128x128_transparent.png 269 images/dock_128x128_transparent.png \ 270 images/VirtualBox_48px.png 270 271 271 272 TRANSLATIONS = \ -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleView.h
r6674 r6715 283 283 284 284 QPixmap mPausedShot; 285 #if defined(Q_WS_MAC) 286 CGImageRef mVirtualBoxLogo; 287 #endif 285 288 }; 286 289 -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h
r6659 r6715 336 336 #ifdef Q_WS_MAC 337 337 // Dock images. 338 CGImageRef dockImgStateRunning;339 338 CGImageRef dockImgStatePaused; 340 339 CGImageRef dockImgStateSaving; 341 340 CGImageRef dockImgStateRestoring; 342 CGImageRef dockImgBack75x75;343 341 CGImageRef dockImgBack100x75; 344 342 CGImageRef dockImgOS; -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxUtils.h
r6645 r6715 255 255 CGImageRef DarwinQPixmapFromMimeSourceToCGImage (const char *aSource); 256 256 CGImageRef DarwinCreateDockBadge (const char *aSource); 257 CGImageRef DarwinCreateDockPreview (CGImageRef aVMImage, CGImageRef aOverlayImage );257 CGImageRef DarwinCreateDockPreview (CGImageRef aVMImage, CGImageRef aOverlayImage, CGImageRef aStateImage = NULL); 258 258 CGImageRef DarwinCreateDockPreview (VBoxFrameBuffer *aFrameBuffer, CGImageRef aOverlayImage); 259 259 OSStatus DarwinRegionHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r6681 r6715 625 625 # endif 626 626 , mDarwinKeyModifiers (0) 627 , mVirtualBoxLogo (NULL) 627 628 #endif 628 629 { … … 631 632 !mConsole.GetKeyboard().isNull() && 632 633 !mConsole.GetMouse().isNull()); 634 635 #ifdef Q_WS_MAC 636 /* Overlay logo for the dock icon */ 637 mVirtualBoxLogo = ::DarwinQPixmapFromMimeSourceToCGImage ("VirtualBox_48px.png"); 638 #endif 633 639 634 640 /* enable MouseMove events */ … … 798 804 799 805 mConsole.UnregisterCallback (mCallback); 806 807 #ifdef Q_WS_MAC 808 CGImageRelease (mVirtualBoxLogo); 809 #endif 800 810 } 801 811 … … 2930 2940 static_cast <VBoxQuartz2DFrameBuffer *> (mFrameBuf)->imageRef(); 2931 2941 SetApplicationDockTileImage ( 2932 ::DarwinCreateDockPreview (ir, m MainWnd->dockImageState()));2942 ::DarwinCreateDockPreview (ir, mVirtualBoxLogo)); 2933 2943 } 2934 2944 else 2935 2945 # endif 2936 2946 SetApplicationDockTileImage ( 2937 ::DarwinCreateDockPreview (mFrameBuf, m MainWnd->dockImageState()));2947 ::DarwinCreateDockPreview (mFrameBuf, mVirtualBoxLogo)); 2938 2948 } 2939 2949 #endif … … 2947 2957 r.x() + contentsX(), r.y() + contentsY(), 2948 2958 r.width(), r.height()); 2959 2960 #ifdef Q_WS_MAC 2961 SetApplicationDockTileImage ( 2962 ::DarwinCreateDockPreview (DarwinQPixmapToCGImage (&mPausedShot), 2963 mVirtualBoxLogo, 2964 mMainWnd->dockImageState())); 2965 #endif 2949 2966 } 2950 2967 } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r6682 r6715 122 122 #endif 123 123 #ifdef Q_WS_MAC 124 , dockImgStateRunning (NULL)125 124 , dockImgStatePaused (NULL) 126 125 , dockImgStateSaving (NULL) 127 126 , dockImgStateRestoring (NULL) 128 , dockImgBack75x75 (NULL)129 127 , dockImgBack100x75 (NULL) 130 128 , dockImgOS (NULL) … … 582 580 #ifdef Q_WS_MAC 583 581 /* prepare the dock images */ 584 dockImgStateRunning = ::DarwinCreateDockBadge ("state_running_16px.png");585 582 dockImgStatePaused = ::DarwinCreateDockBadge ("state_paused_16px.png"); 586 583 dockImgStateSaving = ::DarwinCreateDockBadge ("state_saving_16px.png"); 587 584 dockImgStateRestoring = ::DarwinCreateDockBadge ("state_restoring_16px.png"); 588 dockImgBack75x75 = ::DarwinCreateDockBadge ("dock_0.png");589 585 dockImgBack100x75 = ::DarwinCreateDockBadge ("dock_1.png"); 590 586 SetApplicationDockTileImage (dockImgOS); 591 OverlayApplicationDockTileImage (dockImgStateRunning);592 587 #endif 593 588 mMaskShift.scale (0, 0, QSize::ScaleFree); … … 598 593 #ifdef Q_WS_MAC 599 594 /* release the dock images */ 600 if (dockImgStateRunning)601 CGImageRelease (dockImgStateRunning);602 595 if (dockImgStatePaused) 603 596 CGImageRelease (dockImgStatePaused); … … 606 599 if (dockImgStateRestoring) 607 600 CGImageRelease (dockImgStateRestoring); 608 if (dockImgBack75x75)609 CGImageRelease (dockImgBack75x75);610 601 if (dockImgBack100x75) 611 602 CGImageRelease (dockImgBack100x75); … … 800 791 #ifdef Q_WS_MAC 801 792 QString osTypeId = cmachine.GetOSTypeId(); 802 # if 0803 QImage osImg75x75 = vboxGlobal().vmGuestOSTypeIcon (osTypeId).convertToImage().smoothScale (75, 75);804 QImage osImg = QImage::fromMimeSource ("dock_0.png");805 bitBlt (&osImg, 25, 22,806 &osImg75x75, 0, 0,807 75, 75, /* conversion_flags */ 0);808 # else809 793 QImage osImg100x75 = vboxGlobal().vmGuestOSTypeIcon (osTypeId).convertToImage().smoothScale (100, 75); 810 794 QImage osImg = QImage::fromMimeSource ("dock_1.png"); … … 812 796 &osImg100x75, 0, 0, 813 797 100, 75, /* conversion_flags */ 0); 814 # endif 798 QImage VBoxOverlay = QImage::fromMimeSource ("VirtualBox_48px.png"); 799 bitBlt (&osImg, osImg.width() - VBoxOverlay.width(), osImg.height() - VBoxOverlay.height(), 800 &VBoxOverlay, 0, 0, 801 VBoxOverlay.width(), VBoxOverlay.height(), /* conversion_flags */ 0); 815 802 if (dockImgOS) 816 803 CGImageRelease (dockImgOS); 817 804 dockImgOS = ::DarwinQImageToCGImage (&osImg); 805 SetApplicationDockTileImage (dockImgOS); 818 806 #endif 819 807 … … 1909 1897 vmDisableMouseIntegrAction->setEnabled (false); 1910 1898 } 1911 1912 #ifdef Q_WS_MAC1913 SetApplicationDockTileImage (dockImgOS);1914 CGImageRef img = dockImageState();1915 if (img)1916 OverlayApplicationDockTileImage (img);1917 #endif1918 1899 } 1919 1900 … … 2191 2172 { 2192 2173 CGImageRef img; 2193 if (machine_state == CEnums::Running) 2194 img = dockImgStateRunning; 2195 else if (machine_state == CEnums::Paused) 2174 if (machine_state == CEnums::Paused) 2196 2175 img = dockImgStatePaused; 2197 2176 else if (machine_state == CEnums::Restoring) … … 3170 3149 } 3171 3150 } 3151 3152 #ifdef Q_WS_MAC 3153 CGImageRef img = dockImageState(); 3154 if (img) 3155 OverlayApplicationDockTileImage (img); 3156 #endif 3172 3157 } 3173 3158 -
trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.cpp
r6680 r6715 118 118 if (badge.width() < 32) 119 119 badge = badge.convertToImage().smoothScale (32, 32); 120 copyBlt (&back, back.width() - badge.width(), back.height() - badge.height(),120 copyBlt (&back, (back.width() - badge.width()) / 2.0, (back.height() - badge.height()) / 2.0, 121 121 &badge, 0, 0, 122 122 badge.width(), badge.height()); 123 // copyBlt (&back, back.width() - badge.width(), back.height() - badge.height(), 124 // &badge, 0, 0, 125 // badge.width(), badge.height()); 123 126 Assert (!back.isNull()); 124 127 Assert (back.width() == 128 && back.height() == 128); … … 128 131 } 129 132 130 131 133 /** 132 134 * Creates a dock preview image. … … 136 138 * @returns CGImageRef for the new image. (Remember to release it when finished with it.) 137 139 * @param aVMImage the vm screen as a CGImageRef 138 * @param aOverlayImage an optional overlay image to add at the bottom right of the icon 139 */ 140 CGImageRef DarwinCreateDockPreview (CGImageRef aVMImage, CGImageRef aOverlayImage) 140 * @param aOverlayImage an optional icon overlay image to add at the bottom right of the icon 141 * @param aStateImage an optional state overlay image to add at the center of the icon 142 */ 143 CGImageRef DarwinCreateDockPreview (CGImageRef aVMImage, CGImageRef aOverlayImage, CGImageRef aStateImage) 141 144 { 142 145 Assert (aVMImage); … … 189 192 iconRect = CGRectInset (iconRect, 1, 1); 190 193 CGContextDrawImage (context, iconRect, aVMImage); 191 /* the overlay image */ 194 /* the state image at center */ 195 if (aStateImage) 196 { 197 CGRect stateRect = CGRectMake ((targetWidth - CGImageGetWidth (aStateImage)) / 2.0, (targetHeight - CGImageGetHeight (aStateImage)) / 2.0, CGImageGetWidth (aStateImage), CGImageGetHeight (aStateImage)); 198 CGContextDrawImage (context, stateRect, aStateImage); 199 } 200 /* the overlay image at bottom/right */ 192 201 if (aOverlayImage) 193 202 { … … 214 223 * @returns CGImageRef for the new image. (Remember to release it when finished with it.) 215 224 * @param aFrameBuffer The guest frame buffer. 216 * @param aOverlayImage an optional overlay image to add at the bottom right of the icon225 * @param aOverlayImage an optional icon overlay image to add at the bottom right of the icon 217 226 */ 218 227 CGImageRef DarwinCreateDockPreview (VBoxFrameBuffer *aFrameBuffer, CGImageRef aOverlayImage)
Note:
See TracChangeset
for help on using the changeset viewer.