#ifndef __WINE_DLLS_DINPUT_DINPUT_PRIVATE_H
#define __WINE_DLLS_DINPUT_DINPUT_PRIVATE_H

#include "winbase.h"
#include "dinput.h"
#include "ddrawi.h"

/* Implementation specification */
typedef struct IDirectInputImpl IDirectInputImpl;
struct IDirectInputImpl
{
  LPVOID lpVtbl;
  DWORD  ref;
  DWORD  ver;

  /* Used to have an unique sequence number for all the events */
  DWORD evsequence;
};

/* Function called by all devices that Wine supports */
typedef struct dinput_device {
  INT pref;
  int (*enum_deviceA)(IDirectInputImpl *dinput, DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEA lpddi, DWORD dwID);
  HRESULT (*create_deviceA)(IDirectInputImpl *dinput, REFGUID rguid, REFIID riid, LPDIRECTINPUTDEVICEA* pdev);
  int (*enum_deviceW)(IDirectInputImpl *dinput, DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEW lpddi, DWORD dwID);
  HRESULT (*create_deviceW)(IDirectInputImpl *dinput, REFGUID rguid, REFIID riid, LPDIRECTINPUTDEVICEW* pdev);
} dinput_device;

extern void dinput_register_device(dinput_device *device) ;
extern void init_keyboard(void);
extern void init_joystick(void);
extern void init_mouse(void);
extern void deinit_keyboard(void);
extern void deinit_joystick(void);
extern void deinit_mouse(void);

extern LPDDRAWI_DIRECTDRAW_GBL dinput_dd_gbl;

HRESULT DeviceThunkA_create_device(dinput_device* device, IDirectInputImpl* dinput, REFGUID rguid, REFIID riid, LPDIRECTINPUTDEVICEA* pdev);
HRESULT DeviceThunkW_create_device(dinput_device* device, IDirectInputImpl* dinput, REFGUID rguid, REFIID riid, LPDIRECTINPUTDEVICEW* pdev);
HRESULT DeviceThunkA_enum_device(dinput_device* device, IDirectInputImpl* dinput, DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEA lpddi, DWORD dwID);
HRESULT DeviceThunkW_enum_device(dinput_device* device, IDirectInputImpl* dinput, DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEW lpddi, DWORD dwID);

#endif /* __WINE_DLLS_DINPUT_DINPUT_PRIVATE_H */
