VBoxTray.h revision e64031e20c39650a7bc902a3e1aba613b9415dee
/* $Id$ */
/** @file
* VBoxTray - Guest Additions Tray, Internal Header.
*/
/*
* Copyright (C) 2006-2007 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 ___VBOXTRAY_H
#define ___VBOXTRAY_H
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include <stdarg.h>
#include <process.h>
#include <iprt/initterm.h>
#include <VBox/VBoxGuestLib.h>
#include <VBoxDisplay.h>
#ifdef VBOXWDDM
# include <d3dkmthk.h>
#endif
#define ID_TRAYICON 2000
typedef enum
{
#ifdef VBOXWDDM
#endif
/* display driver interface abstraction for XPDM & WDDM
* with WDDM we can not use ExtEscape to communicate with our driver
* because we do not have XPDM display driver any more, i.e. escape requests are handled by cdd
* that knows nothing about us
* NOTE: DispIf makes no checks whether the display driver is actually a VBox driver,
* it just switches between using different backend OS API based on the VBoxDispIfSwitchMode call
* It's caller's responsibility to initiate it to work in the correct mode */
typedef struct VBOXDISPIF
{
/* with WDDM the approach is to call into WDDM miniport driver via PFND3DKMT API provided by the GDI,
* The PFND3DKMT is supposed to be used by the OpenGL ICD according to MSDN, so this approach is a bit hacky */
union
{
struct
{
LONG (WINAPI * pfnChangeDisplaySettingsEx)(LPCSTR lpszDeviceName, LPDEVMODE lpDevMode, HWND hwnd, DWORD dwflags, LPVOID lParam);
} xpdm;
#ifdef VBOXWDDM
struct
{
/* open adapter */
/* close adapter */
/* escape */
/* auto resize support */
} wddm;
#endif
} modeData;
} VBOXDISPIF, *PVBOXDISPIF;
typedef const struct VBOXDISPIF *PCVBOXDISPIF;
/* initializes the DispIf
* Initially the DispIf is configured to work in XPDM mode
* call VBoxDispIfSwitchMode to switch the mode to WDDM */
DWORD VBoxDispIfResize(PCVBOXDISPIF const pIf, ULONG Id, DWORD Width, DWORD Height, DWORD BitsPerPixel);
/* The environment information for services. */
typedef struct _VBOXSERVICEENV
{
/* display driver interface, XPDM - WDDM abstraction see VBOXDISPIF** definitions above */
/* The service initialization info and runtime variables. */
typedef struct _VBOXSERVICEINFO
{
char *pszName;
/* Variables. */
void *pInstance;
bool fStarted;
extern HWND gToolWindow;
extern void VBoxServiceReloadCursor(void);
#endif /* !___VBOXTRAY_H */