VirtualBox

Ignore:
Timestamp:
Apr 14, 2010 11:33:05 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
60101
Message:

crOpenGl;FE/Qt4: more dock work for the 3D parts of the multi-monitor support on OSX (still not finished)

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/darwin/UIAbstractDockIconPreview.cpp

    r27215 r28342  
    2222/* VBox includes */
    2323#include "UIAbstractDockIconPreview.h"
     24#include "UIFrameBuffer.h"
     25#include "UIMachineLogic.h"
     26#include "UIMachineView.h"
    2427#include "UISession.h"
    25 #include "UIFrameBuffer.h"
    2628
    2729UIAbstractDockIconPreview::UIAbstractDockIconPreview(UISession * /* pSession */, const QPixmap& /* overlayImage */)
     
    6769    m_stateRestoring = ::darwinToCGImageRef("state_restoring_16px.png");
    6870    Assert(m_stateRestoring);
     71}
     72
     73void* UIAbstractDockIconPreviewHelper::currentPreviewWindowId() const
     74{
     75    /* Get the MachineView which is currently previewed and return the win id
     76       of the viewport. */
     77    UIMachineView* pView = m_pSession->machineLogic()->dockPreviewView();
     78    if (pView)
     79        return (void*)pView->viewport()->winId();
     80    return 0;
    6981}
    7082
  • trunk/src/VBox/Frontends/VirtualBox/src/darwin/UIAbstractDockIconPreview.h

    r27215 r28342  
    3131#include "VBoxUtils-darwin.h"
    3232
     33class UIFrameBuffer;
    3334class UISession;
    34 class UIFrameBuffer;
    3535
    3636class QPixmap;
     
    5858    void drawOverlayIcons(CGContextRef context);
    5959
     60    void* currentPreviewWindowId() const;
     61
    6062    /* Flipping is necessary cause the drawing context in Carbon is flipped by 180 degree */
    6163    inline CGRect flipRect(CGRect rect) const { return ::darwinFlipCGRect(rect, m_dockIconRect); }
  • trunk/src/VBox/Frontends/VirtualBox/src/darwin/UICocoaDockIconPreview.mm

    r28279 r28342  
    5353
    5454    UIDockTileMonitor *mMonitor;
    55     NSImageView     *mAppIcon;
     55    NSImageView       *mAppIcon;
    5656
    5757    UIDockTileOverlay *mOverlay;
     
    5959- (id)initWithParent:(UICocoaDockIconPreviewPrivate*)parent;
    6060- (void)destroy;
    61 - (NSView*)screenContent;
     61- (NSView*)screenContentWithParentView:(NSView*)parentView;
    6262- (void)cleanup;
    6363- (void)restoreAppIcon;
     
    261261}
    262262
    263 - (NSView*)screenContent
    264 {
    265     return [mMonitor screenContent];
     263- (NSView*)screenContentWithParentView:(NSView*)parentView
     264{
     265    if (mMonitor != nil)
     266    {
     267        void *pId = p->currentPreviewWindowId();
     268        if (parentView == pId)
     269            return [mMonitor screenContent];
     270    }
     271    return nil;
    266272}
    267273
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r28294 r28342  
    268268}
    269269
    270 UIMachineWindow* UIMachineLogic::mainMachineWindow()
     270UIMachineWindow* UIMachineLogic::mainMachineWindow() const
    271271{
    272272    /* Return null if windows are not created yet: */
     
    277277}
    278278
    279 UIMachineWindow* UIMachineLogic::defaultMachineWindow()
     279UIMachineWindow* UIMachineLogic::defaultMachineWindow() const
    280280{
    281281    /* Return null if windows are not created yet: */
     
    325325        && m_DockIconPreviewMonitor == screenId)
    326326        m_pDockIconPreview->setOriginalSize(width, height);
     327}
     328
     329UIMachineView* UIMachineLogic::dockPreviewView() const
     330{
     331    if (   m_fIsDockIconEnabled
     332        && m_pDockIconPreview)
     333        return machineWindows().at(m_DockIconPreviewMonitor)->machineView();
     334    return 0;
    327335}
    328336#endif /* Q_WS_MAC */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r28279 r28342  
    4444class UIActionsPool;
    4545class UIMachineWindow;
     46class UIMachineView;
    4647class UIDockIconPreview;
    4748class VBoxChangeDockIconUpdateEvent;
     
    7071    UIActionsPool* actionsPool() const { return m_pActionsPool; }
    7172    UIVisualStateType visualStateType() const { return m_visualStateType; }
    72     QList<UIMachineWindow*>& machineWindows() { return m_machineWindowsList; }
    73     UIMachineWindow* mainMachineWindow();
    74     UIMachineWindow* defaultMachineWindow();
     73    const QList<UIMachineWindow*>& machineWindows() const { return m_machineWindowsList; }
     74    UIMachineWindow* mainMachineWindow() const;
     75    UIMachineWindow* defaultMachineWindow() const;
    7576
    7677    /* Maintenance getters/setters: */
     
    8182    void updateDockIcon();
    8283    void updateDockIconSize(int screenId, int width, int height);
     84    UIMachineView* dockPreviewView() const;
    8385#endif /* Q_WS_MAC */
    8486
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r27768 r28342  
    755755}
    756756
     757UIMachineLogic* UISession::machineLogic() const
     758{
     759    return uimachine()->machineLogic();
     760}
     761
    757762QMenu* UISession::newMenu(UIMainMenuType fOptions /* = UIMainMenuType_ALL */)
    758763{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r27768 r28342  
    4141class UIFrameBuffer;
    4242class UIMachine;
     43class UIMachineLogic;
    4344class UIMachineMenuBar;
    4445
     
    8687    UIActionsPool* actionsPool() const;
    8788    QWidget* mainMachineWindow() const;
     89    UIMachineLogic* machineLogic() const;
    8890    QMenu* newMenu(UIMainMenuType fOptions = UIMainMenuType_All);
    8991    QMenuBar* newMenuBar(UIMainMenuType fOptions = UIMainMenuType_All);
Note: See TracChangeset for help on using the changeset viewer.

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