push 9eb9af089d68d39110a91889d3a673043db63c4b
[wine/hacks.git] / dlls / d3dxof / d3dxof_private.h
blob80f67a297c95af58ef1d8cd5894be000663264e7
1 /*
2 * DirectX File private interfaces (D3DXOF.DLL)
4 * Copyright 2004, 2008 Christian Costa
6 * This file contains the (internal) driver registration functions,
7 * driver enumeration APIs and DirectDraw creation functions.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #ifndef __D3DXOF_PRIVATE_INCLUDED__
25 #define __D3DXOF_PRIVATE_INCLUDED__
27 #include <stdarg.h>
29 #include "windef.h"
30 #include "winbase.h"
31 #include "wtypes.h"
32 #include "wingdi.h"
33 #include "winuser.h"
34 #include "dxfile.h"
36 #define MAX_NAME_LEN 32
37 #define MAX_ARRAY_DIM 1
38 #define MAX_MEMBERS 50
39 #define MAX_CHILDS 20
40 #define MAX_TEMPLATES 200
41 #define MAX_OBJECTS 500
42 #define MAX_SUBOBJECTS 120
43 #define MAX_STRINGS_BUFFER 200
45 typedef struct {
46 DWORD type;
47 LONG idx_template;
48 char name[MAX_NAME_LEN];
49 ULONG nb_dims;
50 BOOL dim_fixed[MAX_ARRAY_DIM]; /* fixed or variable */
51 ULONG dim_value[MAX_ARRAY_DIM]; /* fixed value or member index */
52 } member;
54 typedef struct {
55 char name[MAX_NAME_LEN];
56 GUID class_id;
57 BOOL open;
58 ULONG nb_childs;
59 char childs[MAX_CHILDS][MAX_NAME_LEN];
60 ULONG nb_members;
61 member members[MAX_MEMBERS];
62 } xtemplate;
64 typedef struct {
65 char name[MAX_NAME_LEN];
66 LPBYTE start;
67 ULONG size;
68 } xobject_member;
70 struct _xobject {
71 struct _xobject* ptarget;
72 char name[MAX_NAME_LEN];
73 GUID class_id;
74 GUID type;
75 LPBYTE pdata;
76 DWORD size;
77 ULONG nb_members;
78 xobject_member members[MAX_MEMBERS];
79 ULONG nb_childs;
80 ULONG nb_subobjects;
81 struct _xobject * childs[MAX_CHILDS];
84 typedef struct _xobject xobject;
86 typedef struct {
87 IDirectXFile lpVtbl;
88 LONG ref;
89 ULONG nb_xtemplates;
90 xtemplate xtemplates[MAX_TEMPLATES];
91 } IDirectXFileImpl;
93 typedef struct {
94 IDirectXFileBinary lpVtbl;
95 LONG ref;
96 } IDirectXFileBinaryImpl;
98 typedef struct {
99 IDirectXFileData lpVtbl;
100 LONG ref;
101 xobject* pobj;
102 int cur_enum_object;
103 BOOL from_ref;
104 ULONG level;
105 LPBYTE pstrings;
106 } IDirectXFileDataImpl;
108 typedef struct {
109 IDirectXFileDataReference lpVtbl;
110 LONG ref;
111 xobject* ptarget;
112 } IDirectXFileDataReferenceImpl;
114 typedef struct {
115 IDirectXFileObject lpVtbl;
116 LONG ref;
117 } IDirectXFileObjectImpl;
119 typedef struct {
120 /* Buffer to parse */
121 LPBYTE buffer;
122 DWORD rem_bytes;
123 /* Misc info */
124 WORD current_token;
125 BOOL token_present;
126 BOOL txt;
127 ULONG cur_subobject;
128 LPBYTE cur_pdata;
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 pstrings;
139 } parse_buffer;
141 typedef struct {
142 IDirectXFileEnumObject lpVtbl;
143 LONG ref;
144 DXFILELOADOPTIONS source;
145 HANDLE hFile;
146 parse_buffer buf;
147 IDirectXFileImpl* pDirectXFile;
148 ULONG nb_xobjects;
149 xobject xobjects[MAX_OBJECTS][MAX_SUBOBJECTS];
150 } IDirectXFileEnumObjectImpl;
152 typedef struct {
153 IDirectXFileSaveObject lpVtbl;
154 LONG ref;
155 } IDirectXFileSaveObjectImpl;
157 HRESULT IDirectXFileImpl_Create(IUnknown *pUnkOuter, LPVOID *ppObj);
158 HRESULT IDirectXFileBinaryImpl_Create(IDirectXFileBinaryImpl** ppObj);
159 HRESULT IDirectXFileDataImpl_Create(IDirectXFileDataImpl** ppObj);
160 HRESULT IDirectXFileDataReferenceImpl_Create(IDirectXFileDataReferenceImpl** ppObj);
161 HRESULT IDirectXFileEnumObjectImpl_Create(IDirectXFileEnumObjectImpl** ppObj);
162 HRESULT IDirectXFileFileObjectImpl_Create(IDirectXFileObjectImpl** ppObj);
163 HRESULT IDirectXFileFileSaveObjectImpl_Create(IDirectXFileSaveObjectImpl** ppObj);
165 #endif /* __D3DXOF_PRIVATE_INCLUDED__ */