VirtualBox

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

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

scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.5 KB
Line 
1/* $Id: VBoxDbgGui.h 93115 2022-01-01 11:31:46Z 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 */
67 int init(PUVM pUVM);
68
69 /**
70 * Destroys the VBoxDbgGui object.
71 */
72 virtual ~VBoxDbgGui();
73
74 /**
75 * Sets the parent widget.
76 *
77 * @param pParent New parent widget.
78 * @remarks This only affects new windows.
79 */
80 void setParent(QWidget *pParent);
81
82 /**
83 * Sets the menu object.
84 *
85 * @param pMenu New menu object.
86 * @remarks This only affects new menu additions.
87 */
88 void setMenu(QMenu *pMenu);
89
90 /**
91 * Show the default statistics window, creating it if necessary.
92 *
93 * @returns VBox status code.
94 * @param pszFilter Filter pattern.
95 * @param pszExpand Expand pattern.
96 */
97 int showStatistics(const char *pszFilter, const char *pszExpand);
98
99 /**
100 * Repositions and resizes (optionally) the statistics to its defaults
101 *
102 * @param fResize If set (default) the size of window is also changed.
103 */
104 void repositionStatistics(bool fResize = true);
105
106 /**
107 * Show the console window (aka. command line), creating it if necessary.
108 *
109 * @returns VBox status code.
110 */
111 int showConsole();
112
113 /**
114 * Repositions and resizes (optionally) the console to its defaults
115 *
116 * @param fResize If set (default) the size of window is also changed.
117 */
118 void repositionConsole(bool fResize = true);
119
120 /**
121 * Update the desktop size.
122 * This is called whenever the reference window changes position.
123 */
124 void updateDesktopSize();
125
126 /**
127 * Notifies the debugger GUI that the console window (or whatever) has changed
128 * size or position.
129 *
130 * @param x The x-coordinate of the window the debugger is relative to.
131 * @param y The y-coordinate of the window the debugger is relative to.
132 * @param cx The width of the window the debugger is relative to.
133 * @param cy The height of the window the debugger is relative to.
134 */
135 void adjustRelativePos(int x, int y, unsigned cx, unsigned cy);
136
137 /**
138 * Gets the user mode VM handle.
139 * @returns The UVM handle.
140 */
141 PUVM getUvmHandle() const
142 {
143 return m_pUVM;
144 }
145
146 /**
147 * @returns The name of the machine.
148 */
149 QString getMachineName() const;
150
151protected slots:
152 /**
153 * Notify that a child object (i.e. a window is begin destroyed).
154 * @param pObj The object which is being destroyed.
155 */
156 void notifyChildDestroyed(QObject *pObj);
157
158protected:
159
160 /** The debugger statistics. */
161 VBoxDbgStats *m_pDbgStats;
162 /** The debugger console (aka. command line). */
163 VBoxDbgConsole *m_pDbgConsole;
164
165 /** The VirtualBox session. */
166 ISession *m_pSession;
167 /** The VirtualBox console. */
168 IConsole *m_pConsole;
169 /** The VirtualBox Machine Debugger. */
170 IMachineDebugger *m_pMachineDebugger;
171 /** The VirtualBox Machine. */
172 IMachine *m_pMachine;
173 /** The VM instance. */
174 PVM m_pVM;
175 /** The user mode VM handle. */
176 PUVM m_pUVM;
177
178 /** The parent widget. */
179 QWidget *m_pParent;
180 /** The menu object for the 'debug' menu. */
181 QMenu *m_pMenu;
182
183 /** The x-coordinate of the window we're relative to. */
184 int m_x;
185 /** The y-coordinate of the window we're relative to. */
186 int m_y;
187 /** The width of the window we're relative to. */
188 unsigned m_cx;
189 /** The height of the window we're relative to. */
190 unsigned m_cy;
191 /** The x-coordinate of the desktop. */
192 int m_xDesktop;
193 /** The y-coordinate of the desktop. */
194 int m_yDesktop;
195 /** The size of the desktop. */
196 unsigned m_cxDesktop;
197 /** The size of the desktop. */
198 unsigned m_cyDesktop;
199};
200
201
202#endif /* !DEBUGGER_INCLUDED_SRC_VBoxDbgGui_h */
203
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