VirtualBox

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

Last change on this file since 93466 was 93460, checked in by vboxsync, 3 years ago

Main/MachineDebugger,VBoxHeadless,VirtualBoxVM,VBoxSDL,VBoxDbg: Removed a few obsolete raw-mode attributes and changed the VM attribute into getUVMAndVMMFunctionTable, restricting it to calls from within the VM process. bugref:10074

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.6 KB
Line 
1/* $Id: VBoxDbgGui.h 93460 2022-01-27 16:50:15Z vboxsync $ */
2/** @file
3 * VBox Debugger GUI - The Manager.
4 */
5
6/*
7 * Copyright (C) 2006-2022 Oracle Corporation
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
18#ifndef DEBUGGER_INCLUDED_SRC_VBoxDbgGui_h
19#define DEBUGGER_INCLUDED_SRC_VBoxDbgGui_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24// VirtualBox COM interfaces declarations (generated header)
25#ifdef VBOX_WITH_XPCOM
26# include <VirtualBox_XPCOM.h>
27#else
28# include <iprt/win/windows.h> /* Include via cleanup wrapper before VirtualBox.h includes it via rpc.h. */
29# include <VirtualBox.h>
30#endif
31
32#include "VBoxDbgStatsQt.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 */
42class VBoxDbgGui : public QObject
43{
44 Q_OBJECT;
45
46public:
47 /**
48 * Create a default VBoxDbgGui object.
49 */
50 VBoxDbgGui();
51
52 /**
53 * Initializes a VBoxDbgGui object by ISession.
54 *
55 * @returns VBox status code.
56 * @param pSession VBox Session object.
57 */
58 int init(ISession *pSession);
59
60 /**
61 * Initializes a VBoxDbgGui object by VM handle.
62 *
63 * @returns VBox status code.
64 * @param pUVM The user mode VM handle. The caller's reference will be
65 * consumed on success.
66 * @param pVMM The VMM function table.
67 */
68 int init(PUVM pUVM, PCVMMR3VTABLE pVMM);
69
70 /**
71 * Destroys the VBoxDbgGui object.
72 */
73 virtual ~VBoxDbgGui();
74
75 /**
76 * Sets the parent widget.
77 *
78 * @param pParent New parent widget.
79 * @remarks This only affects new windows.
80 */
81 void setParent(QWidget *pParent);
82
83 /**
84 * Sets the menu object.
85 *
86 * @param pMenu New menu object.
87 * @remarks This only affects new menu additions.
88 */
89 void setMenu(QMenu *pMenu);
90
91 /**
92 * Show the default statistics window, creating it if necessary.
93 *
94 * @returns VBox status code.
95 * @param pszFilter Filter pattern.
96 * @param pszExpand Expand pattern.
97 */
98 int showStatistics(const char *pszFilter, const char *pszExpand);
99
100 /**
101 * Repositions and resizes (optionally) the statistics to its defaults
102 *
103 * @param fResize If set (default) the size of window is also changed.
104 */
105 void repositionStatistics(bool fResize = true);
106
107 /**
108 * Show the console window (aka. command line), creating it if necessary.
109 *
110 * @returns VBox status code.
111 */
112 int showConsole();
113
114 /**
115 * Repositions and resizes (optionally) the console to its defaults
116 *
117 * @param fResize If set (default) the size of window is also changed.
118 */
119 void repositionConsole(bool fResize = true);
120
121 /**
122 * Update the desktop size.
123 * This is called whenever the reference window changes position.
124 */
125 void updateDesktopSize();
126
127 /**
128 * Notifies the debugger GUI that the console window (or whatever) has changed
129 * size or position.
130 *
131 * @param x The x-coordinate of the window the debugger is relative to.
132 * @param y The y-coordinate of the window the debugger is relative to.
133 * @param cx The width of the window the debugger is relative to.
134 * @param cy The height of the window the debugger is relative to.
135 */
136 void adjustRelativePos(int x, int y, unsigned cx, unsigned cy);
137
138 /**
139 * Gets the user mode VM handle.
140 * @returns The UVM handle.
141 */
142 PUVM getUvmHandle() const
143 {
144 return m_pUVM;
145 }
146
147 /**
148 * @returns The name of the machine.
149 */
150 QString getMachineName() const;
151
152protected slots:
153 /**
154 * Notify that a child object (i.e. a window is begin destroyed).
155 * @param pObj The object which is being destroyed.
156 */
157 void notifyChildDestroyed(QObject *pObj);
158
159protected:
160
161 /** The debugger statistics. */
162 VBoxDbgStats *m_pDbgStats;
163 /** The debugger console (aka. command line). */
164 VBoxDbgConsole *m_pDbgConsole;
165
166 /** The VirtualBox session. */
167 ISession *m_pSession;
168 /** The VirtualBox console. */
169 IConsole *m_pConsole;
170 /** The VirtualBox Machine Debugger. */
171 IMachineDebugger *m_pMachineDebugger;
172 /** The VirtualBox Machine. */
173 IMachine *m_pMachine;
174 /** The VM instance. */
175 PVM m_pVM;
176 /** The user mode VM handle. */
177 PUVM m_pUVM;
178 /** The VMM function table. */
179 PCVMMR3VTABLE m_pVMM;
180
181 /** The parent widget. */
182 QWidget *m_pParent;
183 /** The menu object for the 'debug' menu. */
184 QMenu *m_pMenu;
185
186 /** The x-coordinate of the window we're relative to. */
187 int m_x;
188 /** The y-coordinate of the window we're relative to. */
189 int m_y;
190 /** The width of the window we're relative to. */
191 unsigned m_cx;
192 /** The height of the window we're relative to. */
193 unsigned m_cy;
194 /** The x-coordinate of the desktop. */
195 int m_xDesktop;
196 /** The y-coordinate of the desktop. */
197 int m_yDesktop;
198 /** The size of the desktop. */
199 unsigned m_cxDesktop;
200 /** The size of the desktop. */
201 unsigned m_cyDesktop;
202};
203
204
205#endif /* !DEBUGGER_INCLUDED_SRC_VBoxDbgGui_h */
206
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