~ubuntu-branches/ubuntu/trusty/virtualbox/trusty-proposed

« back to all changes in this revision

Viewing changes to src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2013-03-07 16:38:36 UTC
  • mfrom: (1.1.13) (3.1.20 experimental)
  • Revision ID: package-import@ubuntu.com-20130307163836-p93jpbgx39tp3gb4
Tags: 4.2.8-dfsg-0ubuntu1
* New upstream release. (Closes: #691148)
  - Fixes compatibility with kernel 3.8. (Closes: #700823; LP: #1101867)
* Switch to my @debian.org email address.
* Move package to contrib as virtualbox 4.2 needs a non-free compiler to
  build the BIOS.
* Build-depend on libdevmapper-dev.
* Refresh patches.
  - Drop 36-fix-ftbfs-xserver-112.patch, cve-2012-3221.patch,
    CVE-2013-0420.patch 37-kcompat-3.6.patch and 38-kcompat-3.7.patch.
* Drop all virtualbox-ose transitional packages.
* Drop the virtualbox-fuse package as vdfuse fails to build with
  virtualbox 4.2.
* Update install files and VBox.sh.
* Bump required kbuild version to 0.1.9998svn2577.
* Fix path to VBoxCreateUSBNode.sh in virtualbox.postinst. (Closes: #700479)
* Add an init script to virtuabox-guest-x11 which loads the vboxvideo
  kernel module. The X Server 1.13 doesn't load it anymore. (Closes: #686994)
* Update man pages. (Closes: #680053)
* Add 36-python-multiarch.patch from Rico Tzschichholz to fix detection of
  python in multiarch paths using pkg-config.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 */
6
6
 
7
7
/*
8
 
 * Copyright (C) 2010 Oracle Corporation
 
8
 * Copyright (C) 2010-2012 Oracle Corporation
9
9
 *
10
10
 * This file is part of VirtualBox Open Source Edition (OSE), as
11
11
 * available from http://www.virtualbox.org. This file is free software;
19
19
#ifndef __UIMachineWindow_h__
20
20
#define __UIMachineWindow_h__
21
21
 
22
 
/* Local includes */
 
22
/* Qt includes: */
 
23
#include <QMainWindow>
 
24
 
 
25
/* GUI includes: */
 
26
#include "QIWithRetranslateUI.h"
23
27
#include "UIMachineDefs.h"
24
28
 
25
 
/* Global forwards */
26
 
class QWidget;
 
29
/* COM includes: */
 
30
#include "COMEnums.h"
 
31
#include "CMachine.h"
 
32
 
 
33
/* Forward declarations: */
27
34
class QGridLayout;
28
35
class QSpacerItem;
29
36
class QCloseEvent;
30
 
 
31
 
/* Local forwards */
32
37
class CSession;
33
38
class UISession;
34
39
class UIMachineLogic;
35
40
class UIMachineView;
36
41
 
37
 
class UIMachineWindow
 
42
/* Machine-window interface: */
 
43
class UIMachineWindow : public QIWithRetranslateUI2<QMainWindow>
38
44
{
 
45
    Q_OBJECT;
 
46
 
39
47
public:
40
48
 
41
 
    /* Factory function to create required machine window child: */
42
 
    static UIMachineWindow* create(UIMachineLogic *pMachineLogic, UIVisualStateType visualStateType, ulong uScreenId = 0);
 
49
    /* Factory functions to create/destroy machine-window: */
 
50
    static UIMachineWindow* create(UIMachineLogic *pMachineLogic, ulong uScreenId = 0);
43
51
    static void destroy(UIMachineWindow *pWhichWindow);
44
52
 
45
 
    /* Abstract slot to close machine window: */
46
 
    virtual void sltTryClose();
 
53
    /* Prepare/cleanup machine-window: */
 
54
    void prepare();
 
55
    void cleanup();
47
56
 
48
57
    /* Public getters: */
49
 
    virtual UIMachineLogic* machineLogic() const { return m_pMachineLogic; }
50
 
    virtual QWidget* machineWindow() const { return m_pMachineWindow; }
51
 
    virtual UIMachineView* machineView() const { return m_pMachineView; }
 
58
    UIMachineView* machineView() const { return m_pMachineView; }
 
59
    UIMachineLogic* machineLogic() const { return m_pMachineLogic; }
52
60
    UISession* uisession() const;
53
61
    CSession& session() const;
54
 
 
55
 
    /* Public members: */
56
 
    virtual void reshow() {}
57
 
    virtual void setMask(const QRegion &region);
 
62
    CMachine machine() const;
 
63
 
 
64
protected slots:
 
65
 
 
66
    /* Session event-handlers: */
 
67
    virtual void sltMachineStateChanged();
 
68
    virtual void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
58
69
 
59
70
protected:
60
71
 
61
 
    /* Machine window constructor/destructor: */
 
72
    /* Constructor: */
62
73
    UIMachineWindow(UIMachineLogic *pMachineLogic, ulong uScreenId);
63
 
    virtual ~UIMachineWindow();
64
 
 
65
 
    /* Protected getters: */
66
 
    const QString& defaultWindowTitle() const { return m_strWindowTitlePrefix; }
67
 
 
68
 
    /* Translate routine: */
69
 
    virtual void retranslateUi();
70
 
 
71
 
    /* Common machine window event handlers: */
 
74
 
 
75
    /* Show stuff: */
 
76
    virtual void showInNecessaryMode() = 0;
 
77
 
 
78
    /* Translate stuff: */
 
79
    void retranslateUi();
 
80
 
 
81
    /* Event handlers: */
72
82
#ifdef Q_WS_X11
73
83
    bool x11Event(XEvent *pEvent);
74
 
#endif
 
84
#endif /* Q_WS_X11 */
75
85
    void closeEvent(QCloseEvent *pEvent);
76
86
 
77
87
    /* Prepare helpers: */
78
 
    virtual void prepareWindowIcon();
79
 
    virtual void prepareConsoleConnections();
80
 
    virtual void prepareMachineViewContainer();
81
 
    //virtual void loadWindowSettings() {}
 
88
    virtual void prepareSessionConnections();
 
89
    virtual void prepareMainLayout();
 
90
    virtual void prepareMenu() {}
 
91
    virtual void prepareStatusBar() {}
 
92
    virtual void prepareMachineView();
 
93
    virtual void prepareVisualState() {}
82
94
    virtual void prepareHandlers();
 
95
    virtual void loadSettings() {}
83
96
 
84
97
    /* Cleanup helpers: */
 
98
    virtual void saveSettings() {}
85
99
    virtual void cleanupHandlers();
86
 
    //virtual void saveWindowSettings() {}
87
 
    //virtual void cleanupMachineViewContainer() {}
88
 
    //virtual void cleanupConsoleConnections() {}
89
 
    //virtual void cleanupWindowIcon() {}
 
100
    virtual void cleanupVisualState() {}
 
101
    virtual void cleanupMachineView();
 
102
    virtual void cleanupStatusBar() {}
 
103
    virtual void cleanupMenu() {}
 
104
    virtual void cleanupMainLayout() {}
 
105
    virtual void cleanupSessionConnections() {}
90
106
 
91
 
    /* Update routines: */
 
107
    /* Update stuff: */
92
108
    virtual void updateAppearanceOf(int iElement);
93
109
#ifdef VBOX_WITH_DEBUGGER_GUI
94
 
    virtual void updateDbgWindows();
 
110
    void updateDbgWindows();
95
111
#endif /* VBOX_WITH_DEBUGGER_GUI */
96
112
 
97
 
    /* Protected slots: */
98
 
    virtual void sltMachineStateChanged();
 
113
    /* Helpers: */
 
114
    const QString& defaultWindowTitle() const { return m_strWindowTitlePrefix; }
 
115
    static Qt::WindowFlags windowFlags(UIVisualStateType visualStateType);
 
116
    static Qt::Alignment viewAlignment(UIVisualStateType visualStateType);
99
117
 
100
 
    /* Protected variables: */
 
118
    /* Variables: */
101
119
    UIMachineLogic *m_pMachineLogic;
102
 
    QWidget *m_pMachineWindow;
103
 
 
104
 
    /* Virtual screen number: */
 
120
    UIMachineView *m_pMachineView;
 
121
    QString m_strWindowTitlePrefix;
105
122
    ulong m_uScreenId;
106
 
 
107
 
    QGridLayout *m_pMachineViewContainer;
 
123
    QGridLayout *m_pMainLayout;
108
124
    QSpacerItem *m_pTopSpacer;
109
125
    QSpacerItem *m_pBottomSpacer;
110
126
    QSpacerItem *m_pLeftSpacer;
111
127
    QSpacerItem *m_pRightSpacer;
112
128
 
113
 
    UIMachineView *m_pMachineView;
114
 
    QString m_strWindowTitlePrefix;
115
 
 
 
129
    /* Friend classes: */
116
130
    friend class UIMachineLogic;
117
131
};
118
132