2 * Copyright 2004 Christian Costa
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __WINE_DXFILE_H
20 #define __WINE_DXFILE_H
27 #endif /* defined(__cplusplus) */
29 typedef DWORD DXFILEFORMAT;
31 #define DXFILEFORMAT_BINARY 0
32 #define DXFILEFORMAT_TEXT 1
33 #define DXFILEFORMAT_COMPRESSED 2
35 typedef DWORD DXFILELOADOPTIONS;
37 #define DXFILELOAD_FROMFILE 0x00L
38 #define DXFILELOAD_FROMRESOURCE 0x01L
39 #define DXFILELOAD_FROMMEMORY 0x02L
40 #define DXFILELOAD_FROMSTREAM 0x04L
41 #define DXFILELOAD_FROMURL 0x08L
43 typedef struct _DXFILELOADRESOURCE {
45 LPCSTR /*LPCTSTR*/ lpName;
46 LPCSTR /*LPCTSTR*/ lpType;
47 } DXFILELOADRESOURCE, *LPDXFILELOADRESOURCE;
49 typedef struct _DXFILELOADMEMORY {
52 } DXFILELOADMEMORY, *LPDXFILELOADMEMORY;
54 typedef struct IDirectXFile IDirectXFile, *LPDIRECTXFILE;
55 typedef struct IDirectXFileEnumObject IDirectXFileEnumObject, *LPDIRECTXFILEENUMOBJECT;
56 typedef struct IDirectXFileSaveObject IDirectXFileSaveObject, *LPDIRECTXFILESAVEOBJECT;
57 typedef struct IDirectXFileObject IDirectXFileObject, *LPDIRECTXFILEOBJECT;
58 typedef struct IDirectXFileData IDirectXFileData, *LPDIRECTXFILEDATA;
59 typedef struct IDirectXFileDataReference IDirectXFileDataReference, *LPDIRECTXFILEDATAREFERENCE;
60 typedef struct IDirectXFileBinary IDirectXFileBinary, *LPDIRECTXFILEBINARY;
62 STDAPI DirectXFileCreate(LPDIRECTXFILE *lplpDirectXFile);
64 #define INTERFACE IDirectXFile
65 #define IDirectXFile_METHODS \
67 STDMETHOD(CreateEnumObject) (THIS_ LPVOID, DXFILELOADOPTIONS, LPDIRECTXFILEENUMOBJECT *) PURE; \
68 STDMETHOD(CreateSaveObject) (THIS_ LPCSTR, DXFILEFORMAT, LPDIRECTXFILESAVEOBJECT *) PURE; \
69 STDMETHOD(RegisterTemplates) (THIS_ LPVOID, DWORD) PURE;
70 ICOM_DEFINE(IDirectXFile,IUnknown)
74 /*** IUnknown methods ***/
75 #define IDirectXFile_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
76 #define IDirectXFile_AddRef(p) (p)->lpVtbl->AddRef(p)
77 #define IDirectXFile_Release(p) (p)->lpVtbl->Release(p)
78 /*** IDirectXFile methods ***/
79 #define IDirectXFile_CreateEnumObject(p,a,b,c) (p)->lpVtbl->CreateEnumObject(p,a,b,c)
80 #define IDirectXFile_CreateSaveObject(p,a,b,c) (p)->lpVtbl->CreateSaveObject(p,a,b,c)
81 #define IDirectXFile_RegisterTemplates(p,a,b) (p)->lpVtbl->RegisterTemplates(p,a,b)
84 #define INTERFACE IDirectXFileEnumObject
85 #define IDirectXFileEnumObject_METHODS \
87 STDMETHOD(GetNextDataObject) (THIS_ LPDIRECTXFILEDATA *) PURE; \
88 STDMETHOD(GetDataObjectById) (THIS_ REFGUID, LPDIRECTXFILEDATA *) PURE; \
89 STDMETHOD(GetDataObjectByName) (THIS_ LPCSTR, LPDIRECTXFILEDATA *) PURE;
90 ICOM_DEFINE(IDirectXFileEnumObject,IUnknown)
94 /*** IUnknown methods ***/
95 #define IDirectXFileEnumObject_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
96 #define IDirectXFileEnumObject_AddRef(p) (p)->lpVtbl->AddRef(p)
97 #define IDirectXFileEnumObject_Release(p) (p)->lpVtbl->Release(p)
98 /*** IDirectXFileEnumObject methods ***/
99 #define IDirectXFileEnumObject_GetNextDataObject(p,a) (p)->lpVtbl->GetNextDataObject(p,a)
100 #define IDirectXFileEnumObject_GetDataObjectById(p,a,b) (p)->lpVtbl->GetDataObjectById(p,a,b)
101 #define IDirectXFileEnumObject_GetDataObjectByName(p,a,b) (p)->lpVtbl->GetDataObjectByName(p,a,b)
104 #define INTERFACE IDirectXFileSaveObject
105 #define IDirectXFileSaveObject_METHODS \
107 STDMETHOD(SaveTemplates) (THIS_ DWORD, const GUID **) PURE; \
108 STDMETHOD(CreateDataObject) (THIS_ REFGUID, LPCSTR, const GUID *, DWORD, LPVOID, LPDIRECTXFILEDATA *) PURE; \
109 STDMETHOD(SaveData) (THIS_ LPDIRECTXFILEDATA) PURE;
110 ICOM_DEFINE(IDirectXFileSaveObject,IUnknown)
114 /*** IUnknown methods ***/
115 #define IDirectXFileSaveObject_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
116 #define IDirectXFileSaveObject_AddRef(p) (p)->lpVtbl->AddRef(p)
117 #define IDirectXFileSaveObject_Release(p) (p)->lpVtbl->Release(p)
118 /*** IDirectXFileSaveObject methods ***/
119 #define IDirectXFileSaveObject_SaveTemplates(p,a,b) (p)->lpVtbl->SaveTemplates(p,a,b)
120 #define IDirectXFileSaveObject_CreateDataObject(p,a,b,c,d,e,f) (p)->lpVtbl->CreateDataObject(p,a,b,c,d,e,f)
121 #define IDirectXFileSaveObject_SaveData(p,a) (p)->lpVtbl->SaveData(p,a)
124 #define IDIRECTXFILEOBJECT_METHODS \
125 STDMETHOD(GetName) (THIS_ LPSTR, LPDWORD) PURE; \
126 STDMETHOD(GetId) (THIS_ LPGUID) PURE;
128 #define INTERFACE IDirectXFileObject
129 #define IDirectXFileObject_METHODS \
131 IDIRECTXFILEOBJECT_METHODS
132 ICOM_DEFINE(IDirectXFileObject,IUnknown)
136 /*** IUnknown methods ***/
137 #define IDirectXFileObject_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
138 #define IDirectXFileObject_AddRef(p) (p)->lpVtbl->AddRef(p)
139 #define IDirectXFileObject_Release(p) (p)->lpVtbl->Release(p)
140 /*** IDirectXFileObject methods ***/
141 #define IDirectXFileObject_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b)
142 #define IDirectXFileObject_GetId(p,a) (p)->lpVtbl->GetId(p,a)
145 #define INTERFACE IDirectXFileData
146 #define IDirectXFileData_METHODS \
148 IDIRECTXFILEOBJECT_METHODS \
149 STDMETHOD(GetData) (THIS_ LPCSTR, DWORD *, void **) PURE; \
150 STDMETHOD(GetType) (THIS_ const GUID **) PURE; \
151 STDMETHOD(GetNextObject) (THIS_ LPDIRECTXFILEOBJECT *) PURE; \
152 STDMETHOD(AddDataObject) (THIS_ LPDIRECTXFILEDATA) PURE; \
153 STDMETHOD(AddDataReference) (THIS_ LPCSTR, const GUID *) PURE; \
154 STDMETHOD(AddBinaryObject) (THIS_ LPCSTR, const GUID *, LPCSTR, LPVOID, DWORD) PURE;
155 ICOM_DEFINE(IDirectXFileData,IDirectXFileObject)
159 /*** IUnknown methods ***/
160 #define IDirectXFileData_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
161 #define IDirectXFileData_AddRef(p) (p)->lpVtbl->AddRef(p)
162 #define IDirectXFileData_Release(p) (p)->lpVtbl->Release(p)
163 /*** IDirectXFileObject methods ***/
164 #define IDirectXFileData_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b)
165 #define IDirectXFileData_GetId(p,a) (p)->lpVtbl->GetId(p,a)
166 /*** IDirectXFileData methods ***/
167 #define IDirectXFileData_GetData(p,a,b,c) (p)->lpVtbl->GetData(p,a,b,c)
168 #define IDirectXFileData_GetType(p,a) (p)->lpVtbl->GetType(p,a)
169 #define IDirectXFileData_GetNextObject(p,a) (p)->lpVtbl->GetNextObject(p,a)
170 #define IDirectXFileData_AddDataObject(p,a) (p)->lpVtbl->AddDataObject(p,a)
171 #define IDirectXFileData_AddDataReference(p,a,b) (p)->lpVtbl->AddDataReference(p,a,b)
172 #define IDirectXFileData_AddBinaryObject(p,a,b,c,d,e) (p)->lpVtbl->AddBinaryObject(p,a,b,c,d,e)
175 #define INTERFACE IDirectXFileDataReference
176 #define IDirectXFileDataReference_METHODS \
178 IDIRECTXFILEOBJECT_METHODS \
179 STDMETHOD(Resolve) (THIS_ LPDIRECTXFILEDATA *) PURE;
180 ICOM_DEFINE(IDirectXFileDataReference,IDirectXFileObject)
184 /*** IUnknown methods ***/
185 #define IDirectXFileData_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
186 #define IDirectXFileData_AddRef(p) (p)->lpVtbl->AddRef(p)
187 #define IDirectXFileData_Release(p) (p)->lpVtbl->Release(p)
188 /*** IDirectXFileObject methods ***/
189 #define IDirectXFileData_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b)
190 #define IDirectXFileData_GetId(p,a) (p)->lpVtbl->GetId(p,a)
191 /*** IDirectXFileDataReference methods ***/
192 #define IDirectXFileData_Resolve(p,a) (p)->lpVtbl->GetData(p,a)
195 #define INTERFACE IDirectXFileBinary
196 #define IDirectXFileBinary_METHODS \
198 IDIRECTXFILEOBJECT_METHODS \
199 STDMETHOD(GetSize) (THIS_ DWORD *) PURE; \
200 STDMETHOD(GetMimeType) (THIS_ LPCSTR *) PURE; \
201 STDMETHOD(Read) (THIS_ LPVOID, DWORD, LPDWORD) PURE;
202 ICOM_DEFINE(IDirectXFileBinary,IDirectXFileObject)
206 /*** IUnknown methods ***/
207 #define IDirectXFileBinary_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
208 #define IDirectXFileBinary_AddRef(p) (p)->lpVtbl->AddRef(p)
209 #define IDirectXFileBinary_Release(p) (p)->lpVtbl->Release(p)
210 /*** IDirectXFileObject methods ***/
211 #define IDirectXFileBinary_GetName(p,a,b) (p)->lpVtbl->GetName(p,a,b)
212 #define IDirectXFileBinary_GetId(p,a) (p)->lpVtbl->GetId(p,a)
213 /*** IDirectXFileBinary methods ***/
214 #define IDirectXFileBinary_GetSize(p,a) (p)->lpVtbl->GetSize(p,a)
215 #define IDirectXFileBinary_GetMimeType(p,a) (p)->lpVtbl->GetMimeType(p,a)
216 #define IDirectXFileBinary_Read(p,a,b,c) (p)->lpVtbl->Read(p,a,b,c)
219 /* DirectXFile Object CLSID */
220 DEFINE_GUID(CLSID_CDirectXFile, 0x4516ec43, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
222 /* DirectX File Interface GUIDs */
223 DEFINE_GUID(IID_IDirectXFile, 0x3d82ab40, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
224 DEFINE_GUID(IID_IDirectXFileEnumObject, 0x3d82ab41, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
225 DEFINE_GUID(IID_IDirectXFileSaveObject, 0x3d82ab42, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
226 DEFINE_GUID(IID_IDirectXFileObject, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
227 DEFINE_GUID(IID_IDirectXFileData, 0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
228 DEFINE_GUID(IID_IDirectXFileDataReference, 0x3d82ab45, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
229 DEFINE_GUID(IID_IDirectXFileBinary, 0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
231 /* DirectX File Header template's GUID */
232 DEFINE_GUID(TID_DXFILEHeader, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
234 /* DirectX File errors */
236 #define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
240 #define DXFILEERR_BADOBJECT MAKE_DDHRESULT(850)
241 #define DXFILEERR_BADVALUE MAKE_DDHRESULT(851)
242 #define DXFILEERR_BADTYPE MAKE_DDHRESULT(852)
243 #define DXFILEERR_BADSTREAMHANDLE MAKE_DDHRESULT(853)
244 #define DXFILEERR_BADALLOC MAKE_DDHRESULT(854)
245 #define DXFILEERR_NOTFOUND MAKE_DDHRESULT(855)
246 #define DXFILEERR_NOTDONEYET MAKE_DDHRESULT(856)
247 #define DXFILEERR_FILENOTFOUND MAKE_DDHRESULT(857)
248 #define DXFILEERR_RESOURCENOTFOUND MAKE_DDHRESULT(858)
249 #define DXFILEERR_URLNOTFOUND MAKE_DDHRESULT(859)
250 #define DXFILEERR_BADRESOURCE MAKE_DDHRESULT(860)
251 #define DXFILEERR_BADFILETYPE MAKE_DDHRESULT(861)
252 #define DXFILEERR_BADFILEVERSION MAKE_DDHRESULT(862)
253 #define DXFILEERR_BADFILEFLOATSIZE MAKE_DDHRESULT(863)
254 #define DXFILEERR_BADFILECOMPRESSIONTYPE MAKE_DDHRESULT(864)
255 #define DXFILEERR_BADFILE MAKE_DDHRESULT(865)
256 #define DXFILEERR_PARSEERROR MAKE_DDHRESULT(866)
257 #define DXFILEERR_NOTEMPLATE MAKE_DDHRESULT(867)
258 #define DXFILEERR_BADARRAYSIZE MAKE_DDHRESULT(868)
259 #define DXFILEERR_BADDATAREFERENCE MAKE_DDHRESULT(869)
260 #define DXFILEERR_INTERNALERROR MAKE_DDHRESULT(870)
261 #define DXFILEERR_NOMOREOBJECTS MAKE_DDHRESULT(871)
262 #define DXFILEERR_BADINTRINSICS MAKE_DDHRESULT(872)
263 #define DXFILEERR_NOMORESTREAMHANDLES MAKE_DDHRESULT(873)
264 #define DXFILEERR_NOMOREDATA MAKE_DDHRESULT(874)
265 #define DXFILEERR_BADCACHEFILE MAKE_DDHRESULT(875)
266 #define DXFILEERR_NOINTERNET MAKE_DDHRESULT(876)
270 #endif /* defined(__cplusplus) */
272 #endif /* __WINE_DXFILE_H */