Changeset 8345 for trunk/include/win/dinput.h
- Timestamp:
- Apr 30, 2002, 4:51:01 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/win/dinput.h
r7557 r8345 4 4 #include "windef.h" /* for MAX_PATH */ 5 5 #include "unknwn.h" 6 #include "mouse.h"7 6 8 7 #define DIRECTINPUT_VERSION 0x0500 … … 17 16 DEFINE_GUID(IID_IDirectInput2A, 0x5944E662,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); 18 17 DEFINE_GUID(IID_IDirectInput2W, 0x5944E663,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); 18 DEFINE_GUID(IID_IDirectInput7A, 0x9A4CB684,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE); 19 DEFINE_GUID(IID_IDirectInput7W, 0x9A4CB685,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE); 19 20 DEFINE_GUID(IID_IDirectInputDeviceA, 0x5944E680,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); 20 21 DEFINE_GUID(IID_IDirectInputDeviceW, 0x5944E681,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); 21 22 DEFINE_GUID(IID_IDirectInputDevice2A, 0x5944E682,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); 22 23 DEFINE_GUID(IID_IDirectInputDevice2W, 0x5944E683,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); 24 DEFINE_GUID(IID_IDirectInputDevice7A, 0x57D7C6BC,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE); 25 DEFINE_GUID(IID_IDirectInputDevice7W, 0x57D7C6BD,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE); 23 26 DEFINE_GUID(IID_IDirectInputEffect, 0xE7E1F7C0,0x88D2,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); 24 27 … … 56 59 57 60 typedef struct IDirectInputA IDirectInputA,*LPDIRECTINPUTA; 61 typedef struct IDirectInput2A IDirectInput2A,*LPDIRECTINPUT2A; 62 typedef struct IDirectInput7A IDirectInput7A,*LPDIRECTINPUT7A; 58 63 typedef struct IDirectInputDeviceA IDirectInputDeviceA,*LPDIRECTINPUTDEVICEA; 59 64 typedef struct IDirectInputDevice2A IDirectInputDevice2A,*LPDIRECTINPUTDEVICE2A; 65 typedef struct IDirectInputDevice7A IDirectInputDevice7A,*LPDIRECTINPUTDEVICE7A; 60 66 typedef struct IDirectInputEffect IDirectInputEffect,*LPDIRECTINPUTEFFECT; 61 67 typedef struct SysKeyboardA SysKeyboardA,*LPSYSKEYBOARDA; 62 68 typedef struct SysMouseA SysMouseA,*LPSYSMOUSEA; 69 70 #define IID_IDirectInput WINELIB_NAME_AW(IID_IDirectInput) 71 DECL_WINELIB_TYPE_AW(LPDIRECTINPUT) 72 #define IID_IDirectInput7 WINELIB_NAME_AW(IID_IDirectInput7) 73 DECL_WINELIB_TYPE_AW(LPDIRECTINPUT7) 74 #define IID_IDirectInputDevice WINELIB_NAME_AW(IID_IDirectInputDevice) 75 DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE) 76 #define IID_IDirectInputDevice2 WINELIB_NAME_AW(IID_IDirectInputDevice2) 77 DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE2) 63 78 64 79 #define DI_OK S_OK … … 121 136 #define DIENUM_CONTINUE 1 122 137 138 #define DIEDFL_ALLDEVICES 0x00000000 139 #define DIEDFL_ATTACHEDONLY 0x00000000 140 #define DIEDFL_FORCEFEEDBACK 0x00000100 141 #define DIEDFL_INCLUDEALIASES 0x00010000 142 #define DIEDFL_INCLUDEPHANTOMS 0x00020000 143 123 144 #define DIDEVTYPE_DEVICE 1 124 145 #define DIDEVTYPE_MOUSE 2 … … 154 175 #define DIDEVTYPEJOYSTICK_WHEEL 6 155 176 #define DIDEVTYPEJOYSTICK_HEADTRACKER 7 177 178 #define GET_DIDEVICE_TYPE(dwDevType) LOBYTE(dwDevType) 179 #define GET_DIDEVICE_SUBTYPE(dwDevType) HIBYTE(dwDevType) 156 180 157 181 typedef struct { … … 403 427 #define DIGDD_PEEK 0x00000001 404 428 405 typedef struct {429 typedef struct DIDEVICEOBJECTDATA { 406 430 DWORD dwOfs; 407 431 DWORD dwData; … … 424 448 DWORD dwNumObjs; 425 449 LPDIOBJECTDATAFORMAT rgodf; 426 } DIDATAFORMAT, *LPDIDATAFORMAT,*LPCDIDATAFORMAT; 450 } DIDATAFORMAT, *LPDIDATAFORMAT; 451 typedef const DIDATAFORMAT *LPCDIDATAFORMAT; 427 452 428 453 typedef struct { … … 431 456 DWORD dwObj; 432 457 DWORD dwHow; 433 } DIPROPHEADER,*LPDIPROPHEADER,*LPCDIPROPHEADER; 458 } DIPROPHEADER,*LPDIPROPHEADER; 459 typedef const DIPROPHEADER *LPCDIPROPHEADER; 434 460 435 461 #define DIPH_DEVICE 0 … … 471 497 472 498 /* special property GUIDs */ 499 #ifdef __cplusplus 500 #define MAKEDIPROP(prop) (*(const GUID *)(prop)) 501 #else 473 502 #define MAKEDIPROP(prop) ((REFGUID)(prop)) 503 #endif 474 504 #define DIPROP_BUFFERSIZE MAKEDIPROP(1) 475 505 #define DIPROP_AXISMODE MAKEDIPROP(2) … … 733 763 #define DIJOFS_BUTTON31 DIJOFS_BUTTON(31) 734 764 765 /* DInput 7 structures, types */ 766 typedef struct DIFILEEFFECT { 767 DWORD dwSize; 768 GUID GuidEffect; 769 LPCDIEFFECT lpDiEffect; 770 CHAR szFriendlyName[MAX_PATH]; 771 } DIFILEEFFECT, *LPDIFILEEFFECT; 772 773 typedef const DIFILEEFFECT *LPCDIFILEEFFECT; 774 typedef BOOL (* CALLBACK LPDIENUMEFFECTSINFILECALLBACK)(LPCDIFILEEFFECT , LPVOID); 775 776 735 777 /***************************************************************************** 736 778 * IDirectInputEffect interface … … 870 912 #define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) ICOM_CALL4(SendDeviceData,p,a,b,c,d) 871 913 914 /***************************************************************************** 915 * IDirectInputDevice7A interface 916 */ 917 #define ICOM_INTERFACE IDirectInputDevice7A 918 #define IDirectInputDevice7A_METHODS \ 919 ICOM_METHOD4(HRESULT,EnumEffectsInFile,LPCSTR,lpszFileName,LPDIENUMEFFECTSINFILECALLBACK,pec,LPVOID,pvRef,DWORD,dwFlags) \ 920 ICOM_METHOD4(HRESULT,WriteEffectToFile,LPCSTR,lpszFileName,DWORD,dwEntries,LPDIFILEEFFECT,rgDiFileEft,DWORD,dwFlags) 921 #define IDirectInputDevice7A_IMETHODS \ 922 IDirectInputDeviceA_IMETHODS \ 923 IDirectInputDevice2A_METHODS \ 924 IDirectInputDevice7A_METHODS 925 ICOM_DEFINE(IDirectInputDevice7A,IDirectInputDevice2A) 926 #undef ICOM_INTERFACE 927 928 /*** IUnknown methods ***/ 929 #define IDirectInputDevice7_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) 930 #define IDirectInputDevice7_AddRef(p) ICOM_CALL (AddRef,p) 931 #define IDirectInputDevice7_Release(p) ICOM_CALL (Release,p) 932 /*** IDirectInputDevice methods ***/ 933 #define IDirectInputDevice7_GetCapabilities(p,a) ICOM_CALL1(GetCapabilities,p,a) 934 #define IDirectInputDevice7_EnumObjects(p,a,b,c) ICOM_CALL3(EnumObjects,p,a,b,c) 935 #define IDirectInputDevice7_GetProperty(p,a,b) ICOM_CALL2(GetProperty,p,a,b) 936 #define IDirectInputDevice7_SetProperty(p,a,b) ICOM_CALL2(SetProperty,p,a,b) 937 #define IDirectInputDevice7_Acquire(p) ICOM_CALL (Acquire,p) 938 #define IDirectInputDevice7_Unacquire(p) ICOM_CALL (Unacquire,p) 939 #define IDirectInputDevice7_GetDeviceState(p,a,b) ICOM_CALL2(GetDeviceState,p,a,b) 940 #define IDirectInputDevice7_GetDeviceData(p,a,b,c,d) ICOM_CALL4(GetDeviceData,p,a,b,c,d) 941 #define IDirectInputDevice7_SetDataFormat(p,a) ICOM_CALL1(SetDataFormat,p,a) 942 #define IDirectInputDevice7_SetEventNotification(p,a) ICOM_CALL1(SetEventNotification,p,a) 943 #define IDirectInputDevice7_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b) 944 #define IDirectInputDevice7_GetObjectInfo(p,a,b,c) ICOM_CALL3(GetObjectInfo,p,a,b,c) 945 #define IDirectInputDevice7_GetDeviceInfo(p,a) ICOM_CALL1(GetDeviceInfo,p,a) 946 #define IDirectInputDevice7_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b) 947 #define IDirectInputDevice7_Initialize(p,a,b,c) ICOM_CALL3(Initialize,p,a,b,c) 948 /*** IDirectInputDevice2 methods ***/ 949 #define IDirectInputDevice7_CreateEffect(p,a,b,c,d) ICOM_CALL4(CreateEffect,p,a,b,c,d) 950 #define IDirectInputDevice7_EnumEffects(p,a,b,c) ICOM_CALL3(EnumEffects,p,a,b,c) 951 #define IDirectInputDevice7_GetEffectInfo(p,a,b) ICOM_CALL2(GetEffectInfo,p,a,b) 952 #define IDirectInputDevice7_GetForceFeedbackState(p,a) ICOM_CALL1(GetForceFeedbackState,p,a) 953 #define IDirectInputDevice7_SendForceFeedbackCommand(p,a) ICOM_CALL1(SendForceFeedbackCommand,p,a) 954 #define IDirectInputDevice7_EnumCreatedEffectObjects(p,a,b,c) ICOM_CALL3(EnumCreatedEffectObjects,p,a,b,c) 955 #define IDirectInputDevice7_Escape(p,a) ICOM_CALL1(Escape,p,a) 956 #define IDirectInputDevice7_Poll(p) ICOM_CALL (Poll,p) 957 #define IDirectInputDevice7_SendDeviceData(p,a,b,c,d) ICOM_CALL4(SendDeviceData,p,a,b,c,d) 958 /*** IDirectInputDevice7 methods ***/ 959 #define IDirectInputDevice7_EnumEffectsInFile(p,a,b,c,d) ICOM_CALL4(EnumEffectsInFile,p,a,b,c,d) 960 #define IDirectInputDevice7_WriteEffectToFile(p,a,b,c,d) ICOM_CALL4(WriteEffectToFile,p,a,b,c,d) 961 872 962 /* "Standard" Mouse report... */ 873 963 typedef struct DIMOUSESTATE { … … 878 968 } DIMOUSESTATE; 879 969 970 /* "Standard" Mouse report for DInput 7... */ 971 typedef struct DIMOUSESTATE2 { 972 LONG lX; 973 LONG lY; 974 LONG lZ; 975 BYTE rgbButtons[8]; 976 } DIMOUSESTATE2; 977 880 978 #define DIMOFS_X FIELD_OFFSET(DIMOUSESTATE, lX) 881 979 #define DIMOFS_Y FIELD_OFFSET(DIMOUSESTATE, lY) … … 886 984 #define DIMOFS_BUTTON3 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 3) 887 985 986 #ifdef __cplusplus 987 extern "C" { 988 #endif 989 extern const DIDATAFORMAT c_dfDIMouse; 990 extern const DIDATAFORMAT c_dfDIMouse2; /* DX 7 */ 991 extern const DIDATAFORMAT c_dfDIKeyboard; 992 extern const DIDATAFORMAT c_dfDIJoystick; 993 extern const DIDATAFORMAT c_dfDIJoystick2; 994 #ifdef __cplusplus 995 }; 996 #endif 888 997 889 998 /***************************************************************************** … … 914 1023 #define IDirectInputA_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b) 915 1024 1025 /***************************************************************************** 1026 * IDirectInput2A interface 1027 */ 1028 #define ICOM_INTERFACE IDirectInput2A 1029 #define IDirectInput2A_METHODS \ 1030 ICOM_METHOD3(HRESULT,FindDevice, REFGUID,rguid, LPCSTR,pszName, LPGUID,pguidInstance) 1031 #define IDirectInput2A_IMETHODS \ 1032 IDirectInputA_IMETHODS \ 1033 IDirectInput2A_METHODS 1034 ICOM_DEFINE(IDirectInput2A,IDirectInputA) 1035 #undef ICOM_INTERFACE 1036 1037 /*** IUnknown methods ***/ 1038 #define IDirectInput2A_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) 1039 #define IDirectInput2A_AddRef(p) ICOM_CALL (AddRef,p) 1040 #define IDirectInput2A_Release(p) ICOM_CALL (Release,p) 1041 /*** IDirectInputA methods ***/ 1042 #define IDirectInput2A_CreateDevice(p,a,b,c) ICOM_CALL3(CreateDevice,p,a,b,c) 1043 #define IDirectInput2A_EnumDevices(p,a,b,c,d) ICOM_CALL4(EnumDevices,p,a,b,c,d) 1044 #define IDirectInput2A_GetDeviceStatus(p,a) ICOM_CALL1(GetDeviceStatus,p,a) 1045 #define IDirectInput2A_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b) 1046 #define IDirectInput2A_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b) 1047 /*** IDirectInput2A methods ***/ 1048 #define IDirectInput2A_FindDevice(p,a,b,c) ICOM_CALL3(FindDevice,p,a,b,c) 1049 1050 /***************************************************************************** 1051 * IDirectInput7A interface 1052 */ 1053 #define ICOM_INTERFACE IDirectInput7A 1054 #define IDirectInput7A_METHODS \ 1055 ICOM_METHOD4(HRESULT,CreateDeviceEx, REFGUID,rguid, REFIID,riid, LPVOID*,pvOut, LPUNKNOWN,lpUnknownOuter) 1056 #define IDirectInput7A_IMETHODS \ 1057 IDirectInput2A_IMETHODS \ 1058 IDirectInput7A_METHODS 1059 ICOM_DEFINE(IDirectInput7A,IDirectInput2A) 1060 #undef ICOM_INTERFACE 1061 1062 /*** IUnknown methods ***/ 1063 #define IDirectInput7A_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) 1064 #define IDirectInput7A_AddRef(p) ICOM_CALL (AddRef,p) 1065 #define IDirectInput7A_Release(p) ICOM_CALL (Release,p) 1066 /*** IDirectInputA methods ***/ 1067 #define IDirectInput7A_CreateDevice(p,a,b,c) ICOM_CALL3(CreateDevice,p,a,b,c) 1068 #define IDirectInput7A_EnumDevices(p,a,b,c,d) ICOM_CALL4(EnumDevices,p,a,b,c,d) 1069 #define IDirectInput7A_GetDeviceStatus(p,a) ICOM_CALL1(GetDeviceStatus,p,a) 1070 #define IDirectInput7A_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b) 1071 #define IDirectInput7A_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b) 1072 /*** IDirectInput2A methods ***/ 1073 #define IDirectInput7A_FindDevice(p,a,b,c) ICOM_CALL3(FindDevice,p,a,b,c) 1074 /*** IDirectInput7A methods ***/ 1075 #define IDirectInput7A_CreateDeviceEx(p,a,b,c,d) ICOM_CALL4(CreateDeviceEx,p,a,b,c,d) 1076 916 1077 /* Export functions */ 1078 1079 #ifdef __cplusplus 1080 extern "C" { 1081 #endif 917 1082 918 1083 HRESULT WINAPI DirectInputCreateA(HINSTANCE,DWORD,LPDIRECTINPUTA *,LPUNKNOWN); … … 920 1085 #define DirectInputCreate WINELIB_NAME_AW(DirectInputCreate) 921 1086 1087 HRESULT WINAPI DirectInputCreateEx(HINSTANCE,DWORD,REFIID,LPVOID *,LPUNKNOWN); 1088 1089 #ifdef __cplusplus 1090 }; 1091 #endif 1092 922 1093 #endif /* __WINE_DINPUT_H */
Note:
See TracChangeset
for help on using the changeset viewer.