Fix wrong structure size check in GetScrollBarInfo().
[wine] / dlls / dmstyle / dmstyle_private.h
1 /* DirectMusicStyle Private Include
2  *
3  * Copyright (C) 2003-2004 Rok Mandeljc
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __WINE_DMSTYLE_PRIVATE_H
21 #define __WINE_DMSTYLE_PRIVATE_H
22
23 #include <stdio.h>
24 #include <stdarg.h>
25 #include <string.h>
26
27 #define COBJMACROS
28
29 #include "windef.h"
30 #include "winbase.h"
31 #include "winnt.h"
32 #include "wingdi.h"
33 #include "winuser.h"
34
35 #include "wine/debug.h"
36 #include "wine/list.h"
37 #include "wine/unicode.h"
38 #include "winreg.h"
39 #include "objbase.h"
40
41 #include "dmusici.h"
42 #include "dmusicf.h"
43 #include "dmusics.h"
44
45 /*****************************************************************************
46  * Interfaces
47  */
48 typedef struct IDirectMusicStyle8Impl IDirectMusicStyle8Impl;
49
50 typedef struct IDirectMusicAuditionTrack IDirectMusicAuditionTrack;
51 typedef struct IDirectMusicChordTrack IDirectMusicChordTrack;
52 typedef struct IDirectMusicCommandTrack IDirectMusicCommandTrack;
53 typedef struct IDirectMusicMelodyFormulationTrack IDirectMusicMelodyFormulationTrack;
54 typedef struct IDirectMusicMotifTrack IDirectMusicMotifTrack;
55 typedef struct IDirectMusicMuteTrack IDirectMusicMuteTrack;
56 typedef struct IDirectMusicStyleTrack IDirectMusicStyleTrack;
57         
58 /*****************************************************************************
59  * ClassFactory
60  */
61 extern HRESULT WINAPI DMUSIC_CreateDirectMusicStyleImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
62
63 /*****************************************************************************
64  * Auxiliary definitions
65  */
66 typedef struct _DMUS_PRIVATE_STYLE_BAND {
67   struct list entry; /* for listing elements */
68   IDirectMusicBand* pBand;
69 } DMUS_PRIVATE_STYLE_BAND, *LPDMUS_PRIVATE_STYLE_BAND;
70
71 typedef struct _DMUS_PRIVATE_STYLE_PARTREF_ITEM {
72   struct list entry; /* for listing elements */
73   DMUS_OBJECTDESC desc;
74   DMUS_IO_PARTREF part_ref;
75 } DMUS_PRIVATE_STYLE_PARTREF_ITEM, *LPDMUS_PRIVATE_STYLE_PARTREF_ITEM;
76
77 typedef struct _DMUS_PRIVATE_STYLE_MOTIF {
78   struct list entry; /* for listing elements */
79   DWORD dwRythm;
80   DMUS_IO_PATTERN pattern;
81   DMUS_OBJECTDESC desc;
82   /** optional for motifs */
83   DMUS_IO_MOTIFSETTINGS settings;
84   IDirectMusicBand* pBand;
85
86   struct list Items;
87 } DMUS_PRIVATE_STYLE_MOTIF, *LPDMUS_PRIVATE_STYLE_MOTIF;
88
89 typedef struct _DMUS_PRIVATE_STYLE_ITEM {
90   struct list entry; /* for listing elements */
91   DWORD dwTimeStamp;
92   IDirectMusicStyle8* pObject;
93 } DMUS_PRIVATE_STYLE_ITEM, *LPDMUS_PRIVATE_STYLE_ITEM;
94
95 extern HRESULT WINAPI DMUSIC_CreateDirectMusicAuditionTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
96 extern HRESULT WINAPI DMUSIC_CreateDirectMusicChordTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
97 extern HRESULT WINAPI DMUSIC_CreateDirectMusicCommandTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
98 extern HRESULT WINAPI DMUSIC_CreateDirectMusicMelodyFormulationTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
99 extern HRESULT WINAPI DMUSIC_CreateDirectMusicMotifTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
100 extern HRESULT WINAPI DMUSIC_CreateDirectMusicMuteTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
101 extern HRESULT WINAPI DMUSIC_CreateDirectMusicStyleTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
102
103 /*****************************************************************************
104  * IDirectMusicStyle8Impl implementation structure
105  */
106 struct IDirectMusicStyle8Impl {
107   /* IUnknown fields */
108   const IUnknownVtbl *UnknownVtbl;
109   const IDirectMusicStyle8Vtbl *StyleVtbl;
110   const IDirectMusicObjectVtbl *ObjectVtbl;
111   const IPersistStreamVtbl *PersistStreamVtbl;
112   LONG           ref;
113
114   /* IDirectMusicStyle8Impl fields */
115   LPDMUS_OBJECTDESC pDesc;
116   DMUS_IO_STYLE style;
117
118   /* data */
119   struct list Motifs;
120   struct list Bands;
121 };
122
123 /* IUnknown: */
124 extern HRESULT WINAPI IDirectMusicStyle8Impl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
125 extern ULONG WINAPI   IDirectMusicStyle8Impl_IUnknown_AddRef (LPUNKNOWN iface);
126 /* IDirectMusicStyle: */
127 extern ULONG WINAPI   IDirectMusicStyle8Impl_IDirectMusicStyle8_AddRef (LPDIRECTMUSICSTYLE8 iface);
128 /* IDirectMusicObject: */
129 extern ULONG WINAPI   IDirectMusicStyle8Impl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface);
130 /* IPersistStream: */
131 extern ULONG WINAPI   IDirectMusicStyle8Impl_IPersistStream_AddRef (LPPERSISTSTREAM iface);
132
133 /*****************************************************************************
134  * IDirectMusicAuditionTrack implementation structure
135  */
136 struct IDirectMusicAuditionTrack {
137   /* IUnknown fields */
138   const IUnknownVtbl *UnknownVtbl;
139   const IDirectMusicTrack8Vtbl *TrackVtbl;
140   const IPersistStreamVtbl *PersistStreamVtbl;
141   LONG           ref;
142
143   /* IDirectMusicAuditionTrack fields */
144   LPDMUS_OBJECTDESC pDesc;
145 };
146
147 /* IUnknown: */
148 extern HRESULT WINAPI IDirectMusicAuditionTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
149 extern ULONG WINAPI   IDirectMusicAuditionTrack_IUnknown_AddRef (LPUNKNOWN iface);
150 /* IDirectMusicTrack(8): */
151 extern ULONG WINAPI   IDirectMusicAuditionTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
152 /* IPersistStream: */
153 extern ULONG WINAPI   IDirectMusicAuditionTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface);
154
155 /*****************************************************************************
156  * IDirectMusicChordTrack implementation structure
157  */
158 struct IDirectMusicChordTrack {
159   /* IUnknown fields */
160   const IUnknownVtbl *UnknownVtbl;
161   const IDirectMusicTrack8Vtbl *TrackVtbl;
162   const IPersistStreamVtbl *PersistStreamVtbl;
163   LONG           ref;
164
165   /* IDirectMusicChordTrack fields */
166   LPDMUS_OBJECTDESC pDesc;
167   DWORD dwScale;
168 };
169
170 /* IUnknown: */
171 extern HRESULT WINAPI IDirectMusicChordTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
172 extern ULONG WINAPI   IDirectMusicChordTrack_IUnknown_AddRef (LPUNKNOWN iface);
173 /* IDirectMusicTrack(8): */
174 extern ULONG WINAPI   IDirectMusicChordTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
175 /* IPersistStream: */
176 extern ULONG WINAPI   IDirectMusicChordTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface);
177
178 typedef struct _DMUS_PRIVATE_COMMAND {
179         struct list entry; /* for listing elements */
180         DMUS_IO_COMMAND pCommand;
181         IDirectMusicCollection* ppReferenceCollection;
182 } DMUS_PRIVATE_COMMAND, *LPDMUS_PRIVATE_COMMAND;
183
184 /*****************************************************************************
185  * IDirectMusicCommandTrack implementation structure
186  */
187 struct IDirectMusicCommandTrack {
188   /* IUnknown fields */
189   const IUnknownVtbl *UnknownVtbl;
190   const IDirectMusicTrack8Vtbl *TrackVtbl;
191   const IPersistStreamVtbl *PersistStreamVtbl;
192   LONG           ref;
193
194   /* IDirectMusicCommandTrack fields */
195   LPDMUS_OBJECTDESC pDesc;
196   /* track data */
197   struct list Commands;
198 };
199
200 /* IUnknown: */
201 extern HRESULT WINAPI IDirectMusicCommandTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
202 extern ULONG WINAPI   IDirectMusicCommandTrack_IUnknown_AddRef (LPUNKNOWN iface);
203 /* IDirectMusicTrack(8): */
204 extern ULONG WINAPI   IDirectMusicCommandTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
205 /* IPersistStream: */
206 extern ULONG WINAPI   IDirectMusicCommandTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface);
207
208 /*****************************************************************************
209  * IDirectMusicMelodyFormulationTrack implementation structure
210  */
211 struct IDirectMusicMelodyFormulationTrack {
212   /* IUnknown fields */
213   const IUnknownVtbl *UnknownVtbl;
214   const IDirectMusicTrack8Vtbl *TrackVtbl;
215   const IPersistStreamVtbl *PersistStreamVtbl;
216   LONG           ref;
217
218   /* IDirectMusicMelodyFormulationTrack fields */
219   LPDMUS_OBJECTDESC pDesc;
220 };
221
222 /* IUnknown: */
223 extern HRESULT WINAPI IDirectMusicMelodyFormulationTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
224 extern ULONG WINAPI   IDirectMusicMelodyFormulationTrack_IUnknown_AddRef (LPUNKNOWN iface);
225 /* IDirectMusicTrack(8): */
226 extern ULONG WINAPI   IDirectMusicMelodyFormulationTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
227 /* IPersistStream: */
228 extern ULONG WINAPI   IDirectMusicMelodyFormulationTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface);
229
230 /*****************************************************************************
231  * IDirectMusicMotifTrack implementation structure
232  */
233 struct IDirectMusicMotifTrack {
234   /* IUnknown fields */
235   const IUnknownVtbl *UnknownVtbl;
236   const IDirectMusicTrack8Vtbl *TrackVtbl;
237   const IPersistStreamVtbl *PersistStreamVtbl;
238   LONG           ref;
239
240   /* IDirectMusicMotifTrack fields */
241   LPDMUS_OBJECTDESC pDesc;
242 };
243
244 /* IUnknown: */
245 extern HRESULT WINAPI IDirectMusicMotifTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
246 extern ULONG WINAPI   IDirectMusicMotifTrack_IUnknown_AddRef (LPUNKNOWN iface);
247 /* IDirectMusicTrack(8): */
248 extern ULONG WINAPI   IDirectMusicMotifTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
249 /* IPersistStream: */
250 extern ULONG WINAPI   IDirectMusicMotifTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface);
251
252 /*****************************************************************************
253  * IDirectMusicMuteTrack implementation structure
254  */
255 struct IDirectMusicMuteTrack {
256   /* IUnknown fields */
257   const IUnknownVtbl *UnknownVtbl;
258   const IDirectMusicTrack8Vtbl *TrackVtbl;
259   const IPersistStreamVtbl *PersistStreamVtbl;
260   LONG           ref;
261
262   /* IDirectMusicMuteTrack fields */
263   LPDMUS_OBJECTDESC pDesc;
264 };
265
266 /* IUnknown: */
267 extern HRESULT WINAPI IDirectMusicMuteTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
268 extern ULONG WINAPI   IDirectMusicMuteTrack_IUnknown_AddRef (LPUNKNOWN iface);
269 /* IDirectMusicTrack(8): */
270 extern ULONG WINAPI   IDirectMusicMuteTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
271 /* IPersistStream: */
272 extern ULONG   WINAPI IDirectMusicMuteTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface);
273
274 /*****************************************************************************
275  * IDirectMusicStyleTrack implementation structure
276  */
277 struct IDirectMusicStyleTrack {
278   /* IUnknown fields */
279   const IUnknownVtbl *UnknownVtbl;
280   const IDirectMusicTrack8Vtbl *TrackVtbl;
281   const IPersistStreamVtbl *PersistStreamVtbl;
282   LONG           ref;
283
284   /* IDirectMusicStyleTrack fields */
285   LPDMUS_OBJECTDESC pDesc;
286   
287   struct list Items;
288 };
289
290 /* IUnknown: */
291 extern HRESULT WINAPI IDirectMusicStyleTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
292 extern ULONG WINAPI   IDirectMusicStyleTrack_IUnknown_AddRef (LPUNKNOWN iface);
293 /* IDirectMusicTrack(8): */
294 extern ULONG WINAPI   IDirectMusicStyleTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
295 /* IPersistStream: */
296 extern ULONG WINAPI   IDirectMusicStyleTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface);
297
298 /**********************************************************************
299  * Dll lifetime tracking declaration for dmstyle.dll
300  */
301 extern LONG DMSTYLE_refCount;
302 static inline void DMSTYLE_LockModule(void) { InterlockedIncrement( &DMSTYLE_refCount ); }
303 static inline void DMSTYLE_UnlockModule(void) { InterlockedDecrement( &DMSTYLE_refCount ); }
304
305 /*****************************************************************************
306  * Misc.
307  */
308 #include "dmutils.h"
309
310 #endif  /* __WINE_DMSTYLE_PRIVATE_H */