1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox Debugger GUI - The Manager.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
18 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
19 | * additional information or have any questions.
|
---|
20 | */
|
---|
21 |
|
---|
22 | #ifndef __VBoxDbgGui_h__
|
---|
23 | #define __VBoxDbgGui_h__
|
---|
24 |
|
---|
25 | // VirtualBox COM interfaces declarations (generated header)
|
---|
26 | #ifdef VBOX_WITH_XPCOM
|
---|
27 | # include <VirtualBox_XPCOM.h>
|
---|
28 | #else
|
---|
29 | # include <VirtualBox.h>
|
---|
30 | #endif
|
---|
31 |
|
---|
32 | #include "VBoxDbgStats.h"
|
---|
33 | #include "VBoxDbgConsole.h"
|
---|
34 |
|
---|
35 |
|
---|
36 | /**
|
---|
37 | * The Debugger GUI manager class.
|
---|
38 | *
|
---|
39 | * It's job is to provide a C callable external interface and manage the
|
---|
40 | * windows and bit making up the debugger GUI.
|
---|
41 | */
|
---|
42 | class VBoxDbgGui : public QObject
|
---|
43 | {
|
---|
44 | Q_OBJECT
|
---|
45 |
|
---|
46 | public:
|
---|
47 | /**
|
---|
48 | * Create a default VBoxDbgGui object.
|
---|
49 | */
|
---|
50 | VBoxDbgGui();
|
---|
51 |
|
---|
52 | /**
|
---|
53 | * Initializes a VBoxDbgGui object.
|
---|
54 | *
|
---|
55 | * @returns VBox status code.
|
---|
56 | * @param pSession VBox Session object.
|
---|
57 | */
|
---|
58 | int init(ISession *pSession);
|
---|
59 |
|
---|
60 | /**
|
---|
61 | * Destroys the VBoxDbgGui object.
|
---|
62 | */
|
---|
63 | virtual ~VBoxDbgGui();
|
---|
64 |
|
---|
65 | /**
|
---|
66 | * Show the default statistics window, creating it if necessary.
|
---|
67 | *
|
---|
68 | * @returns VBox status code.
|
---|
69 | */
|
---|
70 | int showStatistics();
|
---|
71 |
|
---|
72 | /**
|
---|
73 | * Repositions and resizes (optionally) the statistics to its defaults
|
---|
74 | *
|
---|
75 | * @param fResize If set (default) the size of window is also changed.
|
---|
76 | */
|
---|
77 | void repositionStatistics(bool fResize = true);
|
---|
78 |
|
---|
79 | /**
|
---|
80 | * Show the console window (aka. command line), creating it if necessary.
|
---|
81 | *
|
---|
82 | * @returns VBox status code.
|
---|
83 | */
|
---|
84 | int showConsole();
|
---|
85 |
|
---|
86 | /**
|
---|
87 | * Repositions and resizes (optionally) the console to its defaults
|
---|
88 | *
|
---|
89 | * @param fResize If set (default) the size of window is also changed.
|
---|
90 | */
|
---|
91 | void repositionConsole(bool fResize = true);
|
---|
92 |
|
---|
93 | /**
|
---|
94 | * Update the desktop size.
|
---|
95 | * This is called whenever the reference window changes positition.
|
---|
96 | */
|
---|
97 | void updateDesktopSize();
|
---|
98 |
|
---|
99 | /**
|
---|
100 | * Notifies the debugger GUI that the console window (or whatever) has changed
|
---|
101 | * size or position.
|
---|
102 | *
|
---|
103 | * @param x The x-coordinate of the window the debugger is relative to.
|
---|
104 | * @param y The y-coordinate of the window the debugger is relative to.
|
---|
105 | * @param cx The width of the window the debugger is relative to.
|
---|
106 | * @param cy The height of the window the debugger is relative to.
|
---|
107 | */
|
---|
108 | void adjustRelativePos(int x, int y, unsigned cx, unsigned cy);
|
---|
109 |
|
---|
110 | /**
|
---|
111 | * Resizes a QWidget given the frame size.
|
---|
112 | *
|
---|
113 | * @param pWidget The widget to resize.
|
---|
114 | * @param cx The new frame height.
|
---|
115 | * @param cy The new frame width.
|
---|
116 | */
|
---|
117 | static void resizeWidget(QWidget *pWidget, unsigned cx, unsigned cy);
|
---|
118 |
|
---|
119 | protected slots:
|
---|
120 | /**
|
---|
121 | * Notify that a child object (i.e. a window is begin destroyed).
|
---|
122 | * @param pObj The object which is being destroyed.
|
---|
123 | */
|
---|
124 | void notifyChildDestroyed(QObject *pObj);
|
---|
125 |
|
---|
126 | protected:
|
---|
127 |
|
---|
128 | /** The debugger statistics. */
|
---|
129 | VBoxDbgStats *m_pDbgStats;
|
---|
130 | /** The debugger console (aka. command line). */
|
---|
131 | VBoxDbgConsole *m_pDbgConsole;
|
---|
132 |
|
---|
133 | /** The Virtual Box session. */
|
---|
134 | ISession *m_pSession;
|
---|
135 | /** The Virtual Box console. */
|
---|
136 | IConsole *m_pConsole;
|
---|
137 | /** The Virtual Box Machine Debugger. */
|
---|
138 | IMachineDebugger *m_pMachineDebugger;
|
---|
139 | /** The Virtual Box Machine. */
|
---|
140 | IMachine *m_pMachine;
|
---|
141 | /** The VM instance. */
|
---|
142 | PVM m_pVM;
|
---|
143 |
|
---|
144 | /** The x-coordinate of the window we're relative to. */
|
---|
145 | int m_x;
|
---|
146 | /** The y-coordinate of the window we're relative to. */
|
---|
147 | int m_y;
|
---|
148 | /** The width of the window we're relative to. */
|
---|
149 | unsigned m_cx;
|
---|
150 | /** The height of the window we're relative to. */
|
---|
151 | unsigned m_cy;
|
---|
152 | /** The x-coordianate of the desktop. */
|
---|
153 | int m_xDesktop;
|
---|
154 | /** The y-coordianate of the desktop. */
|
---|
155 | int m_yDesktop;
|
---|
156 | /** The size of the desktop. */
|
---|
157 | unsigned m_cxDesktop;
|
---|
158 | /** The size of the desktop. */
|
---|
159 | unsigned m_cyDesktop;
|
---|
160 | };
|
---|
161 |
|
---|
162 |
|
---|
163 | #endif
|
---|
164 |
|
---|