stub.h revision 71d34382c90482c97bd863ad9e814c511e6a3cdb
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync/* Copyright (c) 2001, Stanford University
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync * All rights reserved
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync * See the file LICENSE.txt for information on redistributing this software.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * How this all works...
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * This directory implements three different interfaces to Chromium:
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * 1. the Chromium interface - this is defined by the functions that start
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * with the "cr" prefix and are defined in chromium.h and implemented in
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * stub.c. Typically, this is used by parallel apps (like psubmit).
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * 2. GLX emulation interface - the glX*() functions are emulated here.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * When glXCreateContext() is called we may either create a real, native
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * GLX context or a Chromium context (depending on match_window_title and
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * minimum_window_size).
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * 3. WGL emulation interface - the wgl*() functions are emulated here.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * When wglCreateContext() is called we may either create a real, native
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * WGL context or a Chromium context (depending on match_window_title and
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * minimum_window_size).
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync#if defined(WINDOWS) || defined(Linux) || defined(SunOS)
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync#if !defined(CHROMIUM_THREADSAFE) && defined(CR_NEWWINTRACK)
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync/*#define VBOX_TEST_MEGOO*/
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync#if 0 && defined(CR_NEWWINTRACK) && !defined(WINDOWS)
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync/* When we first create a rendering context we can't be sure whether
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync * it'll be handled by Chromium or as a native GLX/WGL context. So in
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync * CreateContext() we'll mark the ContextInfo object as UNDECIDED then
7db630a55be9d955c8ac125da609b304cbcc6010vboxsync * switch it to either NATIVE or CHROMIUM the first time MakeCurrent()
} ContextType;
#ifdef GLX
struct glxpixmap_info_t
struct context_info_t
#ifdef CHROMIUM_THREADSAFE
#ifdef WINDOWS
unsigned int options;
unsigned long client_storage;
long disp_mask;
int damageEventsBase;
#ifdef DARWIN
struct window_info_t
#ifdef WINDOWS
# ifdef CR_NEWWINTRACK
#ifdef CR_NEWWINTRACK
int appDrawCursor;
char *matchWindowTitle;
int ignoreFreeglutMenus;
int trackWindowSize;
int trackWindowPos;
char *spu_dir;
int force_pbuffers;
int viewportHack;
#ifdef CHROMIUM_THREADSAFE
int freeContextNumber;
#ifndef CHROMIUM_THREADSAFE
#ifdef GLX
#ifdef WINDOWS
# ifndef CR_NEWWINTRACK
# ifdef VBOX_WITH_WDDM
bool bRunningUnderWDDM;
#ifdef CR_NEWWINTRACK
bool volatile bShutdownSyncThread;
} Stub;
#ifdef CHROMIUM_THREADSAFE
/* we place the g_stubCurrentContextTLS outside the Stub data because Stub data is inited by the client's call,
* while we need g_stubCurrentContextTLS the g_stubCurrentContextTLS to be valid at any time to be able to handle
* on THREAD_DETACH since it may cause deadlock, i.e. in this situation loader lock is acquired first and then the init lock,
* but since we use GetModuleFileName in crGetProcName called from stubInitLocked, the lock order might be the oposite.
return ctx;
# define stubSetCurrentContext(_ctx) VBoxTlsRefSetCurrent(ContextInfo, &g_stubCurrentContextTSD, _ctx)
#ifdef WINDOWS
extern void stubInstallWindowMessageHook();
extern void stubUninstallWindowMessageHook();
/* These don't seem to be included in the OSX glext.h ... */
extern ContextInfo *stubNewContext( const char *dpyName, GLint visBits, ContextType type, unsigned long shareCtx
extern void stubGetWindowGeometry(WindowInfo *win, int *x, int *y, unsigned int *w, unsigned int *h);
extern bool stubInit(void);