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