push 818f085f73990f577927aeb76c81fa65ee9c5568
[wine/hacks.git] / dlls / d3dxof / d3dxof_private.h
blob7cb82cd41ab019f3a87a3843185e17d49202196c
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 4
38 #define MAX_MEMBERS 50
39 #define MAX_CHILDS 100
40 #define MAX_TEMPLATES 200
41 #define MAX_OBJECTS 500
42 #define MAX_SUBOBJECTS 500
43 #define MAX_STRINGS_BUFFER 10000
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 BOOL binary;
59 ULONG nb_childs;
60 char childs[MAX_CHILDS][MAX_NAME_LEN];
61 ULONG nb_members;
62 member members[MAX_MEMBERS];
63 } xtemplate;
65 typedef struct {
66 char name[MAX_NAME_LEN];
67 LPBYTE start;
68 ULONG size;
69 } xobject_member;
71 struct _xobject {
72 BOOL binary;
73 struct _xobject* ptarget;
74 char name[MAX_NAME_LEN];
75 GUID class_id;
76 GUID type;
77 LPBYTE pdata;
78 DWORD size;
79 ULONG nb_members;
80 xobject_member members[MAX_MEMBERS];
81 ULONG nb_childs;
82 ULONG nb_subobjects;
83 struct _xobject * childs[MAX_CHILDS];
86 typedef struct _xobject xobject;
88 typedef struct {
89 IDirectXFile lpVtbl;
90 LONG ref;
91 ULONG nb_xtemplates;
92 xtemplate xtemplates[MAX_TEMPLATES];
93 } IDirectXFileImpl;
95 typedef struct {
96 IDirectXFileBinary lpVtbl;
97 LONG ref;
98 } IDirectXFileBinaryImpl;
100 typedef struct {
101 IDirectXFileData lpVtbl;
102 LONG ref;
103 xobject* pobj;
104 int cur_enum_object;
105 BOOL from_ref;
106 ULONG level;
107 LPBYTE pstrings;
108 } IDirectXFileDataImpl;
110 typedef struct {
111 IDirectXFileDataReference lpVtbl;
112 LONG ref;
113 xobject* ptarget;
114 } IDirectXFileDataReferenceImpl;
116 typedef struct {
117 IDirectXFileObject lpVtbl;
118 LONG ref;
119 } IDirectXFileObjectImpl;
121 typedef struct {
122 /* Buffer to parse */
123 LPBYTE buffer;
124 DWORD rem_bytes;
125 /* Misc info */
126 WORD current_token;
127 BOOL token_present;
128 BOOL txt;
129 ULONG cur_subobject;
130 LPBYTE cur_pdata;
131 LPBYTE cur_pstrings;
132 BYTE value[100];
133 xobject* pxo_globals;
134 ULONG nb_pxo_globals;
135 xobject* pxo_tab;
136 IDirectXFileImpl* pdxf;
137 xobject* pxo;
138 xtemplate* pxt[MAX_SUBOBJECTS];
139 ULONG level;
140 LPBYTE pdata;
141 LPBYTE pstrings;
142 } parse_buffer;
144 typedef struct {
145 IDirectXFileEnumObject lpVtbl;
146 LONG ref;
147 DXFILELOADOPTIONS source;
148 HANDLE hFile;
149 parse_buffer buf;
150 IDirectXFileImpl* pDirectXFile;
151 ULONG nb_xobjects;
152 xobject xobjects[MAX_OBJECTS][MAX_SUBOBJECTS];
153 } IDirectXFileEnumObjectImpl;
155 typedef struct {
156 IDirectXFileSaveObject lpVtbl;
157 LONG ref;
158 } IDirectXFileSaveObjectImpl;
160 HRESULT IDirectXFileImpl_Create(IUnknown *pUnkOuter, LPVOID *ppObj);
161 HRESULT IDirectXFileFileObjectImpl_Create(IDirectXFileObjectImpl** ppObj);
162 HRESULT IDirectXFileFileSaveObjectImpl_Create(IDirectXFileSaveObjectImpl** ppObj);
164 #endif /* __D3DXOF_PRIVATE_INCLUDED__ */