dsound: Get rid of the DSOUND_QueryInterface() helper.
[wine/multimedia.git] / dlls / d3dxof / d3dxof_private.h
blob8872c149d784ef71f80df7eb3979f3c2df7b8fa9
1 /*
2 * DirectX File private interfaces (D3DXOF.DLL)
4 * Copyright 2004, 2008 Christian Costa
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __D3DXOF_PRIVATE_INCLUDED__
22 #define __D3DXOF_PRIVATE_INCLUDED__
24 #include <stdarg.h>
26 #include "windef.h"
27 #include "winbase.h"
28 #include "wtypes.h"
29 #include "wingdi.h"
30 #include "winuser.h"
31 #include "dxfile.h"
33 #define MAX_NAME_LEN 40
34 #define MAX_ARRAY_DIM 4
35 #define MAX_MEMBERS 50
36 #define MAX_CHILDREN 200
37 #define MAX_TEMPLATES 200
38 #define MAX_OBJECTS 500
39 #define MAX_SUBOBJECTS 2000
40 #define MAX_STRINGS_BUFFER 10000
42 typedef struct {
43 DWORD type;
44 LONG idx_template;
45 char name[MAX_NAME_LEN];
46 ULONG nb_dims;
47 BOOL dim_fixed[MAX_ARRAY_DIM]; /* fixed or variable */
48 ULONG dim_value[MAX_ARRAY_DIM]; /* fixed value or member index */
49 } member;
51 typedef struct {
52 char name[MAX_NAME_LEN];
53 GUID class_id;
54 BOOL open;
55 BOOL binary;
56 ULONG nb_children;
57 char children[MAX_CHILDREN][MAX_NAME_LEN];
58 ULONG nb_members;
59 member members[MAX_MEMBERS];
60 } xtemplate;
62 typedef struct {
63 char* name;
64 ULONG start;
65 ULONG size;
66 } xobject_member;
68 struct _xobject {
69 BOOL binary;
70 struct _xobject* ptarget;
71 char name[MAX_NAME_LEN];
72 GUID class_id;
73 GUID type;
74 LPBYTE pdata;
75 ULONG pos_data;
76 DWORD size;
77 ULONG nb_members;
78 xobject_member members[MAX_MEMBERS];
79 ULONG nb_children;
80 ULONG nb_subobjects;
81 struct _xobject * children[MAX_CHILDREN];
82 struct _xobject * root;
85 typedef struct _xobject xobject;
87 typedef struct {
88 IDirectXFile IDirectXFile_iface;
89 LONG ref;
90 ULONG nb_xtemplates;
91 xtemplate xtemplates[MAX_TEMPLATES];
92 } IDirectXFileImpl;
94 typedef struct {
95 IDirectXFileBinary IDirectXFileBinary_iface;
96 LONG ref;
97 } IDirectXFileBinaryImpl;
99 typedef struct {
100 IDirectXFileData IDirectXFileData_iface;
101 LONG ref;
102 xobject* pobj;
103 int cur_enum_object;
104 BOOL from_ref;
105 ULONG level;
106 LPBYTE pstrings;
107 } IDirectXFileDataImpl;
109 typedef struct {
110 IDirectXFileDataReference IDirectXFileDataReference_iface;
111 LONG ref;
112 xobject* ptarget;
113 } IDirectXFileDataReferenceImpl;
115 typedef struct {
116 IDirectXFileObject IDirectXFileObject_iface;
117 LONG ref;
118 } IDirectXFileObjectImpl;
120 typedef struct {
121 /* Buffer to parse */
122 LPBYTE buffer;
123 DWORD rem_bytes;
124 /* Misc info */
125 WORD current_token;
126 BOOL token_present;
127 BOOL txt;
128 ULONG cur_pos_data;
129 LPBYTE cur_pstrings;
130 BYTE value[100];
131 xobject** pxo_globals;
132 ULONG nb_pxo_globals;
133 xobject* pxo_tab;
134 IDirectXFileImpl* pdxf;
135 xobject* pxo;
136 xtemplate* pxt[MAX_SUBOBJECTS];
137 ULONG level;
138 LPBYTE pdata;
139 ULONG capacity;
140 LPBYTE pstrings;
141 } parse_buffer;
143 typedef struct {
144 IDirectXFileEnumObject IDirectXFileEnumObject_iface;
145 LONG ref;
146 LPBYTE mapped_memory;
147 LPBYTE decomp_buffer;
148 parse_buffer buf;
149 IDirectXFileImpl* pDirectXFile;
150 ULONG nb_xobjects;
151 xobject* xobjects[MAX_OBJECTS];
152 IDirectXFileData* pRefObjects[MAX_OBJECTS];
153 } IDirectXFileEnumObjectImpl;
155 typedef struct {
156 IDirectXFileSaveObject IDirectXFileSaveObject_iface;
157 LONG ref;
158 } IDirectXFileSaveObjectImpl;
160 HRESULT IDirectXFileImpl_Create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN;
162 HRESULT parse_header(parse_buffer *buf, BYTE **decomp_buffer_ptr) DECLSPEC_HIDDEN;
163 BOOL parse_object(parse_buffer * buf) DECLSPEC_HIDDEN;
164 BOOL parse_templates(parse_buffer * buf) DECLSPEC_HIDDEN;
166 int mszip_decompress(int inlen, int outlen, char* inbuffer, char* outbuffer) DECLSPEC_HIDDEN;
168 #endif /* __D3DXOF_PRIVATE_INCLUDED__ */