VirtualBox

source: vbox/trunk/src/VBox/Debugger/VBoxDbgGui.h@ 103068

Last change on this file since 103068 was 101107, checked in by vboxsync, 15 months ago

VBoxDbg: Rewrote the automatic window positioning to make it more flexible and to try keep the console window wide enough for at least 80 columns of text.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.4 KB
Line 
1/* $Id: VBoxDbgGui.h 101107 2023-09-13 14:01:58Z vboxsync $ */
2/** @file
3 * VBox Debugger GUI - The Manager.
4 */
5
6/*
7 * Copyright (C) 2006-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef DEBUGGER_INCLUDED_SRC_VBoxDbgGui_h
29#define DEBUGGER_INCLUDED_SRC_VBoxDbgGui_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34// VirtualBox COM interfaces declarations (generated header)
35#ifdef VBOX_WITH_XPCOM
36# include <VirtualBox_XPCOM.h>
37#else
38# include <iprt/win/windows.h> /* Include via cleanup wrapper before VirtualBox.h includes it via rpc.h. */
39# include <VirtualBox.h>
40#endif
41
42#include "VBoxDbgStatsQt.h"
43#include "VBoxDbgConsole.h"
44
45
46/**
47 * The Debugger GUI manager class.
48 *
49 * It's job is to provide a C callable external interface and manage the
50 * windows and bit making up the debugger GUI.
51 */
52class VBoxDbgGui : public QObject
53{
54 Q_OBJECT;
55
56public:
57 /**
58 * Create a default VBoxDbgGui object.
59 */
60 VBoxDbgGui();
61
62 /**
63 * Initializes a VBoxDbgGui object by ISession.
64 *
65 * @returns VBox status code.
66 * @param pSession VBox Session object.
67 */
68 int init(ISession *pSession);
69
70 /**
71 * Initializes a VBoxDbgGui object by VM handle.
72 *
73 * @returns VBox status code.
74 * @param pUVM The user mode VM handle. The caller's reference will be
75 * consumed on success.
76 * @param pVMM The VMM function table.
77 */
78 int init(PUVM pUVM, PCVMMR3VTABLE pVMM);
79
80 /**
81 * Destroys the VBoxDbgGui object.
82 */
83 virtual ~VBoxDbgGui();
84
85 /**
86 * Sets the parent widget.
87 *
88 * @param pParent New parent widget.
89 * @remarks This only affects new windows.
90 */
91 void setParent(QWidget *pParent);
92
93 /**
94 * Sets the menu object.
95 *
96 * @param pMenu New menu object.
97 * @remarks This only affects new menu additions.
98 */
99 void setMenu(QMenu *pMenu);
100
101 /**
102 * Show the default statistics window, creating it if necessary.
103 *
104 * @returns VBox status code.
105 * @param pszFilter Filter pattern.
106 * @param pszExpand Expand pattern.
107 */
108 int showStatistics(const char *pszFilter, const char *pszExpand);
109
110 /**
111 * Show the console window (aka. command line), creating it if necessary.
112 *
113 * @returns VBox status code.
114 */
115 int showConsole();
116
117 /**
118 * Update the desktop size.
119 * This is called whenever the reference window changes position.
120 */
121 void updateDesktopSize();
122
123 /**
124 * Repositions and maybe resizes a window according to the VM window.
125 *
126 * @param a_pWindow The window. Ignored if NULL.
127 * @param a_fResize If set (default) the size of window is also changed.
128 */
129 void repositionWindow(VBoxDbgBaseWindow *a_pWindow, bool a_fResize = true);
130
131 /**
132 * Does the initial repositioning and sizing of a window.
133 *
134 * This may get preferences from extra data.
135 *
136 * @param a_pWindow The window.
137 * @param a_pszSettings The 'section' name in the settings.
138 * @param a_enmDefaultAttraction The default attraction of the window.
139 */
140 void repositionWindowInitial(VBoxDbgBaseWindow *a_pWindow, const char *a_pszSettings,
141 VBoxDbgBaseWindow::VBoxDbgAttractionType a_enmDefaultAttraction);
142
143 /**
144 * Notifies the debugger GUI that the console window (or whatever) has changed
145 * size or position.
146 *
147 * @param x The x-coordinate of the window the debugger is relative to.
148 * @param y The y-coordinate of the window the debugger is relative to.
149 * @param cx The width of the window the debugger is relative to.
150 * @param cy The height of the window the debugger is relative to.
151 */
152 void adjustRelativePos(int x, int y, unsigned cx, unsigned cy);
153
154 /**
155 * Gets the user mode VM handle.
156 * @returns The UVM handle.
157 */
158 PUVM getUvmHandle() const
159 {
160 return m_pUVM;
161 }
162
163 /**
164 * Gets the VMM function table.
165 * @returns The VMM function table.
166 */
167 PCVMMR3VTABLE getVMMFunctionTable() const
168 {
169 return m_pVMM;
170 }
171
172 /**
173 * @returns The name of the machine.
174 */
175 QString getMachineName() const;
176
177protected slots:
178 /**
179 * Notify that a child object (i.e. a window is begin destroyed).
180 * @param pObj The object which is being destroyed.
181 */
182 void notifyChildDestroyed(QObject *pObj);
183
184protected:
185
186 /** The debugger statistics. */
187 VBoxDbgStats *m_pDbgStats;
188 /** The debugger console (aka. command line). */
189 VBoxDbgConsole *m_pDbgConsole;
190
191 /** The VirtualBox session. */
192 ISession *m_pSession;
193 /** The VirtualBox console. */
194 IConsole *m_pConsole;
195 /** The VirtualBox Machine Debugger. */
196 IMachineDebugger *m_pMachineDebugger;
197 /** The VirtualBox Machine. */
198 IMachine *m_pMachine;
199 /** The VM instance. */
200 PVM m_pVM;
201 /** The user mode VM handle. */
202 PUVM m_pUVM;
203 /** The VMM function table. */
204 PCVMMR3VTABLE m_pVMM;
205
206 /** The parent widget. */
207 QWidget *m_pParent;
208 /** The menu object for the 'debug' menu. */
209 QMenu *m_pMenu;
210
211 /** The x-coordinate of the window we're relative to. */
212 int m_x;
213 /** The y-coordinate of the window we're relative to. */
214 int m_y;
215 /** The width of the window we're relative to. */
216 unsigned m_cx;
217 /** The height of the window we're relative to. */
218 unsigned m_cy;
219 /** The x-coordinate of the desktop. */
220 int m_xDesktop;
221 /** The y-coordinate of the desktop. */
222 int m_yDesktop;
223 /** The size of the desktop. */
224 unsigned m_cxDesktop;
225 /** The size of the desktop. */
226 unsigned m_cyDesktop;
227};
228
229
230#endif /* !DEBUGGER_INCLUDED_SRC_VBoxDbgGui_h */
231
Note: See TracBrowser for help on using the repository browser.

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