Framebuffer.h revision b799f5f59373662ebbd685b4d1cbcc3e244c0677
/** @file
*
* VBox frontends: VBoxSDL (simple frontend based on SDL):
* Declaration of VBoxSDLFB (SDL framebuffer) class
*/
/*
* Copyright (C) 2006-2012 Oracle Corporation
*
* 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 (GPL) 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 __H_FRAMEBUFFER
#define __H_FRAMEBUFFER
#include "VBoxSDL.h"
#include <iprt/critsect.h>
#ifdef VBOX_SECURELABEL
#include <SDL_ttf.h>
/* function pointers */
extern "C"
{
extern DECLSPEC SDL_Surface* (SDLCALL *pTTF_RenderUTF8_Solid)(TTF_Font *font, const char *text, SDL_Color fg);
extern DECLSPEC SDL_Surface* (SDLCALL *pTTF_RenderUTF8_Shaded)(TTF_Font *font, const char *text, SDL_Color fg, SDL_Color bg);
extern DECLSPEC SDL_Surface* (SDLCALL *pTTF_RenderUTF8_Blended)(TTF_Font *font, const char *text, SDL_Color fg);
}
#endif /* VBOX_SECURELABEL && !VBOX_WITH_SDL13 */
{
static bool init(bool fShowSDLConfig);
static void uninit();
#ifdef RT_OS_WINDOWS
{
return ::InterlockedIncrement (&refcnt);
}
{
if (cnt == 0)
return cnt;
}
#endif
// internal public methods
bool initialized() { return mfInitialized; }
void resizeGuest();
void resizeSDL();
void update(int x, int y, int w, int h, bool fGuestRelative);
void repaint();
void setFullscreen(bool fFullscreen);
#ifdef VBOX_WITH_SDL13
#endif
#ifdef VBOX_SECURELABEL
void setSecureLabelText(const char *text);
void paintSecureLabel(int x, int y, int w, int h, bool fForce);
#endif
bool getFullscreen() { return mfFullscreen; }
#ifdef VBOX_WITH_SDL13
/** the SDL window */
/** the texture */
/** render info */
#endif
/** false if constructor failed */
bool mfInitialized;
/** the screen number of this framebuffer */
/** maximum possible screen width in pixels (~0 = no restriction) */
/** maximum possible screen height in pixels (~0 = no restriction) */
/** current guest screen width in pixels */
/** current guest screen height in pixels */
/** fixed SDL screen width (~0 = not set) */
/** fixed SDL screen height (~0 = not set) */
/** fixed SDL bits per pixel (~0 = not set) */
/** Y offset in pixels, i.e. guest-nondrawable area at the top */
/** X offset for guest screen centering */
/** Y offset for guest screen centering */
/** flag whether we're in fullscreen mode */
bool mfFullscreen;
/** flag whether we keep the host screen resolution when switching to
* fullscreen or not */
bool mfKeepHostRes;
/** framebuffer update semaphore */
/** flag whether the SDL window should be resizable */
bool mfResizable;
/** flag whether we print out SDL information */
bool mfShowSDLConfig;
/** handle to window where framebuffer context is being drawn*/
#ifdef VBOX_SECURELABEL
/** current secure label text */
/** current secure label foreground color (RGB) */
/** current secure label background color (RGB) */
/** secure label font handle */
/** secure label height in pixels */
/** secure label offset from the top of the secure label */
#endif
#ifdef RT_OS_WINDOWS
long refcnt;
#endif
bool mfUpdates;
};
{
#ifdef RT_OS_WINDOWS
{
return ::InterlockedIncrement (&refcnt);
}
{
if (cnt == 0)
return cnt;
}
#endif
/* These are not used, or return standard values. */
// internal public methods
/** Overlay X offset */
/** Overlay Y offset */
/** Overlay width */
/** Overlay height */
/** Whether the overlay is currently active */
/** The parent IFramebuffer */
/** SDL surface containing the actual framebuffer bits */
/** Additional SDL surface used for combining the framebuffer and the overlay */
#ifdef RT_OS_WINDOWS
long refcnt;
#endif
};
#endif // __H_FRAMEBUFFER