VBoxDbgGui.h revision 000c4c4719cbb24bb40e286f7685ba98d36c5477
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/* $Id$ */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/** @file
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * VBox Debugger GUI - The Manager.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Copyright (C) 2006-2007 Sun Microsystems, Inc.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * This file is part of VirtualBox Open Source Edition (OSE), as
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * available from http://www.virtualbox.org. This file is free software;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * you can redistribute it and/or modify it under the terms of the GNU
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * General Public License (GPL) as published by the Free Software
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Foundation, in version 2 as it comes in the "COPYING" file of the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Clara, CA 95054 USA or visit http://www.sun.com if you need
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * additional information or have any questions.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright#ifndef ___Debugger_VBoxDbgGui_h
5a48565528ab0659af6d43ebe1659bfff8074e8fKevin Crowe#define ___Debugger_VBoxDbgGui_h
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw// VirtualBox COM interfaces declarations (generated header)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#ifdef VBOX_WITH_XPCOM
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# include <VirtualBox_XPCOM.h>
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#else
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# include <VirtualBox.h>
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#endif
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#include "VBoxDbgStats.h"
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#include "VBoxDbgConsole.h"
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/**
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The Debugger GUI manager class.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * It's job is to provide a C callable external interface and manage the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * windows and bit making up the debugger GUI.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
3b13a1ef7511135ec0c75b5f94de8075454efd79Thomas Keiserclass VBoxDbgGui : public QObject
3b13a1ef7511135ec0c75b5f94de8075454efd79Thomas Keiser{
3b13a1ef7511135ec0c75b5f94de8075454efd79Thomas Keiser Q_OBJECT;
3b13a1ef7511135ec0c75b5f94de8075454efd79Thomas Keiser
3b13a1ef7511135ec0c75b5f94de8075454efd79Thomas Keiserpublic:
3b13a1ef7511135ec0c75b5f94de8075454efd79Thomas Keiser /**
3b13a1ef7511135ec0c75b5f94de8075454efd79Thomas Keiser * Create a default VBoxDbgGui object.
3b13a1ef7511135ec0c75b5f94de8075454efd79Thomas Keiser */
3b13a1ef7511135ec0c75b5f94de8075454efd79Thomas Keiser VBoxDbgGui();
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw /**
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Initializes a VBoxDbgGui object by ISession.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * @returns VBox status code.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * @param pSession VBox Session object.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw int init(ISession *pSession);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw /**
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Initializes a VBoxDbgGui object by VM handle.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * @returns VBox status code.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * @param pVM The VM handle.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw int init(PVM pVM);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw /**
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Destroys the VBoxDbgGui object.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego virtual ~VBoxDbgGui();
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw /**
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh * Show the default statistics window, creating it if necessary.
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh *
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh * @returns VBox status code.
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw int showStatistics();
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh /**
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh * Repositions and resizes (optionally) the statistics to its defaults
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh *
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh * @param fResize If set (default) the size of window is also changed.
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw void repositionStatistics(bool fResize = true);
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh /**
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh * Show the console window (aka. command line), creating it if necessary.
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh *
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh * @returns VBox status code.
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh */
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego int showConsole();
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw /**
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Repositions and resizes (optionally) the console to its defaults
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego * @param fResize If set (default) the size of window is also changed.
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh */
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh void repositionConsole(bool fResize = true);
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh /**
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh * Update the desktop size.
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh * This is called whenever the reference window changes positition.
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh */
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego void updateDesktopSize();
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh /**
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh * Notifies the debugger GUI that the console window (or whatever) has changed
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh * size or position.
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego *
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego * @param x The x-coordinate of the window the debugger is relative to.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * @param y The y-coordinate of the window the debugger is relative to.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * @param cx The width of the window the debugger is relative to.
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego * @param cy The height of the window the debugger is relative to.
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh */
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh void adjustRelativePos(int x, int y, unsigned cx, unsigned cy);
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw /**
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Resizes a QWidget given the frame size.
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego *
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego * @param pWidget The widget to resize.
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego * @param cx The new frame height.
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh * @param cy The new frame width.
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw static void resizeWidget(QWidget *pWidget, unsigned cx, unsigned cy);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwprotected slots:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw /**
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Notify that a child object (i.e. a window is begin destroyed).
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * @param pObj The object which is being destroyed.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw void notifyChildDestroyed(QObject *pObj);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwprotected:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw /** The debugger statistics. */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw VBoxDbgStats *m_pDbgStats;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw /** The debugger console (aka. command line). */
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego VBoxDbgConsole *m_pDbgConsole;
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego /** The Virtual Box session. */
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego ISession *m_pSession;
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego /** The Virtual Box console. */
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego IConsole *m_pConsole;
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross /** The Virtual Box Machine Debugger. */
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego IMachineDebugger *m_pMachineDebugger;
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego /** The Virtual Box Machine. */
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross IMachine *m_pMachine;
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross /** The VM instance. */
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross PVM m_pVM;
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross /** The x-coordinate of the window we're relative to. */
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross int m_x;
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego /** The y-coordinate of the window we're relative to. */
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego int m_y;
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego /** The width of the window we're relative to. */
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego unsigned m_cx;
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego /** The height of the window we're relative to. */
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross unsigned m_cy;
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego /** The x-coordianate of the desktop. */
3b13a1ef7511135ec0c75b5f94de8075454efd79Thomas Keiser int m_xDesktop;
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego /** The y-coordianate of the desktop. */
a1511e6b39158073666f6bd04cec5295813931f6joyce mcintosh int m_yDesktop;
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego /** The size of the desktop. */
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego unsigned m_cxDesktop;
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego /** The size of the desktop. */
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego unsigned m_cyDesktop;
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego};
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#endif
037cac007b685e7ea79f6ef7e8e62bfd342a4d56joyce mcintosh
7f667e74610492ddbce8ce60f52ece95d2401949jose borrego