/*
 * DirectDraw HAL base interface
 *
 * Copyright 2001 TransGaming Technologies, Inc.
 */
#ifndef __WINE_X11DDRAW_H
#define __WINE_X11DDRAW_H

#ifndef __WINE_CONFIG_H
# error You must include config.h to use this header
#endif

#include "ddrawi.h"

extern LPDDRAWI_DDRAWSURFACE_LCL X11DRV_DD_Primary;
extern LPDDRAWI_DDRAWSURFACE_GBL X11DRV_DD_PrimaryGbl;
extern HBITMAP X11DRV_DD_PrimaryDIB;
extern BOOL X11DRV_DD_IsDirect;
extern Window X11DRV_DD_PrimaryFrame, X11DRV_DD_PrimaryClient;

typedef int (*X11DRV_GetCurrentMode_Fcn)(void);
typedef void (*X11DRV_SetCurrentMode_Fcn)(int mode);
typedef int (*X11DRV_GetSystemMode_Fcn)(void);

typedef struct X11DRV_ModeSwitch
{
  X11DRV_GetCurrentMode_Fcn get_current_mode;
  X11DRV_SetCurrentMode_Fcn set_current_mode;
  X11DRV_GetSystemMode_Fcn get_system_mode;

  LPDDHALMODEINFO Modes;
  DWORD NumModes;
} X11DRV_MODE_SWITCH, *LPX11DRV_MODE_SWITCH;
extern X11DRV_MODE_SWITCH X11DRV_DD_ModeSwitch;


void X11DRV_DD_Init(void);
void X11DRV_DD_Cleanup(void);
void X11DRV_DD_Detach(void);
void X11DRV_DD_CreateDesktop(unsigned int width, unsigned int height);
void X11DRV_DD_DestroyDesktop(void); 
void X11DRV_EnableGrabs(void);
void X11DRV_DisableGrabs(void);


void X11DRV_DDHAL_SwitchMode(DWORD dwModeIndex, LPVOID fb_addr, LPVIDMEM fb_mem, BOOL desktop);
void X11DRV_DDHAL_SetPalEntries(Colormap pal, DWORD dwBase, DWORD dwNumEntries,
				LPPALETTEENTRY lpEntries);

typedef struct _X11DRIVERINFO {
  const GUID *		lpGuid;
  DWORD			dwSize;
  LPVOID		lpvData;
  struct _X11DRIVERINFO*lpNext;
} X11DRIVERINFO,*LPX11DRIVERINFO;

typedef struct _X11DEVICE {
  LPX11DRIVERINFO	lpInfo;
} X11DEVICE,*LPX11DEVICE;

#endif /* __WINE_X11DDRAW_H */
