VBoxDefs.h revision fba735bba4e2e68ef92feb6b5c225571a2f04be0
/** @file
*
* VBox frontends: Qt GUI ("VirtualBox"):
* Header with common definitions and global functions
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License as published by the Free Software Foundation,
* in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
* distribution. VirtualBox OSE is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef __VBoxDefs_h__
#define __VBoxDefs_h__
#include <qevent.h>
#define LOG_GROUP LOG_GROUP_GUI
#ifdef VBOX_GUI_DEBUG
#define AssertWrapperOk(w) \
#define AssertWrapperOkMsg(w, m) \
#else // !VBOX_GUI_DEBUG
#define AssertWrapperOk(w) do {} while (0)
#define AssertWrapperOkMsg(w, m) do {} while (0)
#endif // !VBOX_GUI_DEBUG
#ifndef SIZEOF_ARRAY
#define SIZEOF_ARRAY(a) (sizeof(a) / sizeof(a[0]))
#endif
#if defined (VBOX_GUI_USE_QIMAGE) || \
defined (VBOX_GUI_USE_SDL) || \
defined (VBOX_GUI_USE_DDRAW)
#if !defined (VBOX_GUI_USE_EXT_FRAMEBUFFER)
#define VBOX_GUI_USE_EXT_FRAMEBUFFER
#endif
#else
#if defined (VBOX_GUI_USE_EXT_FRAMEBUFFER)
#endif
#if !defined (VBOX_GUI_USE_REFRESH_TIMER)
#define VBOX_GUI_USE_REFRESH_TIMER
#endif
#endif
/////////////////////////////////////////////////////////////////////////////
#if defined (VBOX_GUI_DEBUG)
#include <qthread.h>
#include <qdatetime.h>
/**
* A class to measure intervals using rdtsc instruction.
*/
{
return ASMReadTSC();
}
return tcks / ticks_per_msec;
}
return tcks / ticks_per_msec;
}
{
QTime t;
t.start();
}
inline static uint64_t ticksPerMsec() {
return ticks_per_msec;
}
static uint64_t ticks_per_msec;
};
#endif // VBOX_GUI_DEBUG
/* A common namespace for all enums */
struct VBoxDefs
{
/** Disk image type. */
/** VM display rendering mode. */
enum RenderMode
{
};
/** Additional Qt event types. */
enum
{
#if defined (Q_WS_WIN)
#endif
#if defined (Q_WS_MAC)
#endif
};
static const char* GUI_LastWindowPosition;
static const char* GUI_LastWindowPosition_Max;
static const char* GUI_Fullscreen;
static const char* GUI_Seamless;
static const char* GUI_AutoresizeGuest;
static const char* GUI_FirstRun;
static const char* GUI_SaveMountedAtRuntime;
static const char* GUI_LastCloseAction;
static const char* GUI_SuppressMessages;
static const char* GUI_PermanentSharedFoldersAtRuntime;
#ifdef Q_WS_X11
static const char* GUI_LicenseKey;
#endif
};
#endif // __VBoxDefs_h__