VirtualBox

Changeset 2411 in vbox for trunk


Ignore:
Timestamp:
Apr 28, 2007 6:01:48 PM (18 years ago)
Author:
vboxsync
Message:

playing with the dock.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile

    r2410 r2411  
    159159        src/darwin/DarwinKeyboard.cpp \
    160160        src/darwin/DarwinCursor.cpp \
    161         src/darwin/VBoxAquaStyle.cpp
     161        src/darwin/VBoxAquaStyle.cpp \
     162        src/darwin/VBoxUtils-darwin.cpp
    162163
    163164## @todo how to detect what tool is used?
  • trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro

    r2139 r2411  
    241241        images/vdm_remove_disabled_22px.png \
    242242        images/welcome.png \
    243         images/about_600px.png
     243        images/about_600px.png \
     244    images/dock_128x128_transparent.png
    244245
    245246TRANSLATIONS = \
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h

    r1435 r2411  
    3434
    3535#ifdef VBOX_WITH_DEBUGGER_GUI
    36 #include <VBox/dbggui.h>
    37 #endif
     36# include <VBox/dbggui.h>
     37#endif
     38#ifdef Q_WS_MAC
     39# undef PAGE_SIZE
     40# undef PAGE_SHIFT
     41# include <Carbon/Carbon.h>
     42#endif
    3843
    3944class QAction;
     
    265270    PDBGGUI dbg_gui;
    266271#endif
     272
     273#ifdef Q_WS_MAC
     274    // Dock images.
     275    CGImageRef dockImgStateRunning;
     276    CGImageRef dockImgStatePaused;
     277    CGImageRef dockImgStateSaving;
     278    CGImageRef dockImgStateRestoring;
     279#endif
    267280};
    268281
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxUtils.h

    r2392 r2411  
    194194};
    195195
     196
     197#ifdef Q_WS_MAC
     198# undef PAGE_SIZE
     199# undef PAGE_SHIFT
     200# include <Carbon/Carbon.h>
     201class QImage;
     202class QPixmap;
     203CGImageRef DarwinQImageToCGImage (const QImage *aImage);
     204CGImageRef DarwinQPixmapToCGImage (const QPixmap *aPixmap);
     205CGImageRef DarwinQPixmapFromMimeSourceToCGImage (const char *aSource);
     206CGImageRef DarwinCreateDockBadge (const char *aSource);
     207#endif /* Q_WS_MAC */
     208
    196209#endif // __VBoxUtils_h__
    197210
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp

    r2354 r2411  
    3232#include "VBoxDiskImageManagerDlg.h"
    3333#include "VBoxSharedFoldersSettings.h"
     34#include "VBoxUtils.h"
    3435#include "QIStateIndicator.h"
    3536#include "QIStatusBar.h"
     
    155156    , dbg_gui (NULL)
    156157#endif
     158#ifdef Q_WS_MAC
     159    , dockImgStateRunning (NULL)
     160    , dockImgStatePaused (NULL)
     161    , dockImgStateSaving (NULL)
     162    , dockImgStateRestoring (NULL)
     163#endif
    157164{
    158165    if (aSelf)
     
    516523                 this, SLOT (dbgShowCommandLine()));
    517524#endif
     525
     526#ifdef Q_WS_MAC
     527    /* prepare the dock images */
     528    dockImgStateRunning   = ::DarwinCreateDockBadge ("state_running_16px.png");
     529    dockImgStatePaused    = ::DarwinCreateDockBadge ("state_paused_16px.png");
     530    dockImgStateSaving    = ::DarwinCreateDockBadge ("state_saving_16px.png");
     531    dockImgStateRestoring = ::DarwinCreateDockBadge ("state_restoring_16px.png");
     532    OverlayApplicationDockTileImage (dockImgStateRunning);
     533#endif
    518534}
    519535
     
    522538    if (mUsbLedTip)
    523539        delete mUsbLedTip;
     540#ifdef Q_WS_MAC
     541    /* release the dock images */
     542    if (dockImgStateRunning)
     543        CGImageRelease (dockImgStateRunning);
     544    if (dockImgStatePaused)
     545        CGImageRelease (dockImgStatePaused);
     546    if (dockImgStateSaving)
     547        CGImageRelease (dockImgStateSaving);
     548    if (dockImgStateRestoring)
     549        CGImageRelease (dockImgStateRestoring);
     550#endif
    524551}
    525552
     
    14931520            vmDisableMouseIntegrAction->setEnabled (false);
    14941521    }
     1522#ifdef Q_WS_MAC
     1523    if (1)//(element & DockTile)
     1524    {
     1525        //CGContextDrawImage
     1526        //HIViewDrawCGImage();
     1527        //CGImageAlphaInfo
     1528        CGImageRef img;
     1529        if (machine_state == CEnums::Running)
     1530            img = dockImgStateRunning;
     1531        else if (machine_state == CEnums::Paused)
     1532            img = dockImgStatePaused;
     1533        else if (machine_state == CEnums::Restoring)
     1534            img = dockImgStateRestoring;
     1535        else if (machine_state == CEnums::Saving)
     1536            img = dockImgStateSaving;
     1537        else
     1538            img = NULL;
     1539        RestoreApplicationDockTileImage();
     1540        if (img)
     1541            OverlayApplicationDockTileImage (img);
     1542    }
     1543#endif
    14951544}
    14961545
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette