VBoxSDL.h revision 4e46eee5a96078ebec6cb36939b794a391f1ade0
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg/** @file
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg *
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg * VBox frontends: VBoxSDL (simple frontend based on SDL):
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg * Main header
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg */
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg/*
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg * Copyright (C) 2006-2007 innotek GmbH
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg *
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg * This file is part of VirtualBox Open Source Edition (OSE), as
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg * available from http://www.virtualbox.org. This file is free software;
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg * you can redistribute it and/or modify it under the terms of the GNU
0662ed52e814f8f08ef0e09956413a792584eddffuankg * General Public License as published by the Free Software Foundation,
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg * distribution. VirtualBox OSE is distributed in the hope that it will
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg * be useful, but WITHOUT ANY WARRANTY of any kind.
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg */
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#ifndef __H_VBOXSDL
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#define __H_VBOXSDL
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#ifdef RT_OS_WINDOWS /** @todo check why we need to do this on windows. */
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg/* convince SDL to not overload main() */
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#define _SDL_main_h
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#endif
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg/* include this first so Windows.h get's in before our stuff. */
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#include <SDL.h>
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg
44f575c8cb19a7a5cd61664a7848be6bc197df02fuankg/** custom SDL event for display update handling */
16b55a35cff91315d261d1baa776138af465c4e4fuankg#define SDL_USER_EVENT_UPDATERECT (SDL_USEREVENT + 4)
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg/** custom SDL event for resize handling */
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#define SDL_USER_EVENT_RESIZE (SDL_USEREVENT + 5)
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg/** custom SDL for XPCOM event queue processing */
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#define SDL_USER_EVENT_XPCOM_EVENTQUEUE (SDL_USEREVENT + 6)
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg/** custom SDL event for updating the titlebar */
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#define SDL_USER_EVENT_UPDATE_TITLEBAR (SDL_USEREVENT + 7)
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg/** custom SDL user event for terminating the session */
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#define SDL_USER_EVENT_TERMINATE (SDL_USEREVENT + 8)
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg/** custom SDL user event for secure label update notification */
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#define SDL_USER_EVENT_SECURELABEL_UPDATE (SDL_USEREVENT + 9)
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg/** custom SDL user event for pointer shape change request */
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#define SDL_USER_EVENT_POINTER_CHANGE (SDL_USEREVENT + 10)
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg/** custom SDL user event for a regular timer */
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#define SDL_USER_EVENT_TIMER (SDL_USEREVENT + 11)
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg/** custom SDL user event for resetting mouse cursor */
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#define SDL_USER_EVENT_GUEST_CAP_CHANGED (SDL_USEREVENT + 12)
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg/** custom SDL user event for window resize down */
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#define SDL_USER_EVENT_WINDOW_RESIZE_DONE (SDL_USEREVENT + 13)
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg/** The user.code field of the SDL_USER_EVENT_TERMINATE event.
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg * @{
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg */
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg/** Normal termination. */
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#define VBOXSDL_TERM_NORMAL 0
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg/** Abnormal termination. */
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#define VBOXSDL_TERM_ABEND 1
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg/** @} */
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgvoid ResetVM(void);
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgvoid SaveState(void);
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#ifdef VBOX_WIN32_UI
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgint initUI(bool fResizable);
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgint uninitUI(void);
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgint resizeUI(uint16_t width, uint16_t height);
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgint setUITitle(char *title);
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#endif /* VBOX_WIN32_UI */
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#ifdef VBOXSDL_WITH_X11
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgvoid PushNotifyUpdateEvent(SDL_Event *event);
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#endif
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgint PushSDLEventForSure(SDL_Event *event);
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg#endif // __H_VBOXSDL
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg