VirtualBox

source: vbox/trunk/include/VBox/dbggui.h@ 12977

Last change on this file since 12977 was 12884, checked in by vboxsync, 16 years ago

Debugger: parenting, menu, destroy on close

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.0 KB
Line 
1/** @file
2 * DBGGUI - The VirtualBox Debugger GUI.
3 */
4
5/*
6 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 *
25 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
26 * Clara, CA 95054 USA or visit http://www.sun.com if you need
27 * additional information or have any questions.
28 */
29
30#ifndef ___VBox_dbggui_h
31#define ___VBox_dbggui_h
32
33#include <VBox/types.h>
34#if defined(RT_OS_WINDOWS)
35# include <VirtualBox.h>
36#else
37# include <VirtualBox_XPCOM.h>
38#endif
39
40
41__BEGIN_DECLS
42
43/** @defgroup grp_dbggui VirtualBox Debugger GUI
44 * @{
45 */
46
47/** Pointer to the debugger GUI instance structure. */
48typedef struct DBGGUI *PDBGGUI;
49
50/** Virtual method table for the debugger GUI. */
51typedef struct DBGGUIVT
52{
53 /** The version. (DBGGUIVT_VERSION) */
54 uint32_t u32Version;
55 /** @copydoc DBGGuiDestroy */
56 DECLCALLBACKMEMBER(int, pfnDestroy)(PDBGGUI pGui);
57 /** @copydoc DBGGuiAdjustRelativePos */
58 DECLCALLBACKMEMBER(void, pfnAdjustRelativePos)(PDBGGUI pGui, int x, int y, unsigned cx, unsigned cy);
59 /** @copydoc DBGGuiShowStatistics */
60 DECLCALLBACKMEMBER(int, pfnShowStatistics)(PDBGGUI pGui);
61 /** @copydoc DBGGuiShowCommandLine */
62 DECLCALLBACKMEMBER(int, pfnShowCommandLine)(PDBGGUI pGui);
63 /** @copydoc DBGGuiSetParent */
64 DECLCALLBACKMEMBER(void, pfnSetParent)(PDBGGUI pGui, void *pvParent);
65 /** @copydoc DBGGuiSetMenu */
66 DECLCALLBACKMEMBER(void, pfnSetMenu)(PDBGGUI pGui, void *pvMenu);
67 /** The end version. (DBGGUIVT_VERSION) */
68 uint32_t u32EndVersion;
69} DBGGUIVT;
70/** Pointer to the virtual method table for the debugger GUI. */
71typedef DBGGUIVT const *PCDBGGUIVT;
72/** The u32Version value.
73 * The first byte is the minor version, the 2nd byte is major version number.
74 * The high 16-bit word is a magic. */
75#define DBGGUIVT_VERSION UINT32_C(0xbead0100)
76/** Macro for determining whether two versions are compatible or not.
77 * @returns boolean result.
78 * @param uVer1 The first version number.
79 * @param uVer2 The second version number.
80 */
81#define DBGGUIVT_ARE_VERSIONS_COMPATIBLE(uVer1, uVer2) \
82 ( ((uVer1) & UINT32_C(0xffffff00)) == ((uVer2) & UINT32_C(0xffffff00)) )
83
84
85/**
86 * Creates the debugger GUI.
87 *
88 * @returns VBox status code.
89 * @param pSession The VirtualBox session.
90 * @param ppGui Where to store the pointer to the debugger instance.
91 * @param ppGuiVT Where to store the virtual method table pointer.
92 * Optional.
93 */
94DBGDECL(int) DBGGuiCreate(ISession *pSession, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT);
95/** @copydoc DBGGuiCreate. */
96typedef DECLCALLBACK(int) FNDBGGUICREATE(ISession *pSession, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT);
97/** Pointer to DBGGuiCreate. */
98typedef FNDBGGUICREATE *PFNDBGGUICREATE;
99
100/**
101 * Creates the debugger GUI given a VM handle.
102 *
103 * @returns VBox status code.
104 * @param pVM The VM handle.
105 * @param ppGui Where to store the pointer to the debugger instance.
106 * @param ppGuiVT Where to store the virtual method table pointer.
107 * Optional.
108 */
109DBGDECL(int) DBGGuiCreateForVM(PVM pVM, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT);
110/** @copydoc DBGGuiCreateForVM. */
111typedef DECLCALLBACK(int) FNDBGGUICREATEFORVM(PVM pVM, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT);
112/** Pointer to DBGGuiCreateForVM. */
113typedef FNDBGGUICREATEFORVM *PFNDBGGUICREATEFORVM;
114
115/**
116 * Destroys the debugger GUI.
117 *
118 * @returns VBox status code.
119 * @param pGui The instance returned by DBGGuiCreate().
120 */
121DBGDECL(int) DBGGuiDestroy(PDBGGUI pGui);
122
123/**
124 * Notifies the debugger GUI that the console window (or whatever) has changed
125 * size or position.
126 *
127 * @param pGui The instance returned by DBGGuiCreate().
128 * @param x The x-coordinate of the window the debugger is relative to.
129 * @param y The y-coordinate of the window the debugger is relative to.
130 * @param cx The width of the window the debugger is relative to.
131 * @param cy The height of the window the debugger is relative to.
132 */
133DBGDECL(void) DBGGuiAdjustRelativePos(PDBGGUI pGui, int x, int y, unsigned cx, unsigned cy);
134
135/**
136 * Shows the default statistics window.
137 *
138 * @returns VBox status code.
139 * @param pGui The instance returned by DBGGuiCreate().
140 */
141DBGDECL(int) DBGGuiShowStatistics(PDBGGUI pGui);
142
143/**
144 * Shows the default command line window.
145 *
146 * @returns VBox status code.
147 * @param pGui The instance returned by DBGGuiCreate().
148 */
149DBGDECL(int) DBGGuiShowCommandLine(PDBGGUI pGui);
150
151/**
152 * Sets the parent windows.
153 *
154 * @param pGui The instance returned by DBGGuiCreate().
155 * @param pvParent Pointer to a QWidget object.
156 *
157 * @remarks This will no affect any existing windows, so call it right after
158 * creating the thing.
159 */
160DBGDECL(void) DBGGuiSetParent(PDBGGUI pGui, void *pvParent);
161
162/**
163 * Sets the debug menu object.
164 *
165 * @param pGui The instance returned by DBGGuiCreate().
166 * @param pvMenu Pointer to a QMenu object.
167 *
168 * @remarks Call right after creation or risk losing menu item.
169 */
170DBGDECL(void) DBGGuiSetMenu(PDBGGUI pGui, void *pvMenu);
171
172/** @} */
173
174__END_DECLS
175
176#endif
177
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