forked from ITzTravelInTime/kx-audio-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TemplDef.h
executable file
·355 lines (295 loc) · 13 KB
/
TemplDef.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
// kX Driver / kX Driver Interface / kX Driver Effects Library
// Copyright (c) Eugene Gavrilov, LeMury 2003-2004.
// All rights reserved
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#if !defined(AFX_TEMPLDEF_H__742F3281_055B_11D4_B261_00104BB13A66__INCLUDED_)
#define AFX_TEMPLDEF_H__742F3281_055B_11D4_B261_00104BB13A66__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
///////////////////////////////////////////////////////////////////////////////
// TemplDef.h: helper macroses for using templates with MFC
//
// Author: Yury Goltsman
// email: ygprg@go.to
// page: http://go.to/ygprg
// Copyright © 2000, Yury Goltsman
//
// This code provided "AS IS," without any kind of warranty.
// You may freely use or modify this code provided this
// Copyright is included in all derived versions.
//
// version : 1.1 (18.02.2004)
// Added support for VS2003(VC++ 7.1)
//
// version : 1.0
//
///////////////////////////////////////////////////////////////////////////////
// common definitions for any map:
// use it to specify list of arguments for class and as theTemplArgs
// e.g. BEGIN_TEMPLATE_MESSAGE_MAP(ARGS2(class base_class, int max),
// CMyTClass<ARGS2(base_class, max)>,
// base_class)
#define ARGS2(arg1, arg2) arg1, arg2
#define ARGS3(arg1, arg2, arg3) arg1, arg2, arg3
#define ARGS4(arg1, arg2, arg3, arg4) arg1, arg2, arg3, arg4
#define ARGS5(arg1, arg2, arg3, arg4, arg5) arg1, arg2, arg3, arg4, arg5
///////////////////////////////////////////////////////////////////////////////
// definition for MESSAGE_MAP:
#define DECLARE_TEMPLATE_MESSAGE_MAP() DECLARE_MESSAGE_MAP()
#if 0
// #if ( _MSC_VER >= 1300) // VC++ 7.0 (.net)
#ifdef _AFXDLL
#define BEGIN_TEMPLATE_MESSAGE_MAP(theTemplArgs, theClass, baseClass) \
template <theTemplArgs> \
const AFX_MSGMAP* PASCAL theClass::GetThisMessageMap() \
{ return &theClass::messageMap; } \
template <theTemplArgs> \
const AFX_MSGMAP* theClass::GetMessageMap() const \
{ return &theClass::messageMap; } \
template <theTemplArgs> \
const AFX_MSGMAP theClass::messageMap = \
{ &baseClass::GetThisMessageMap, &theClass::_messageEntries[0] }; \
template <theTemplArgs> \
const AFX_MSGMAP_ENTRY theClass::_messageEntries[] = \
{ \
#else
#define BEGIN_TEMPLATE_MESSAGE_MAP(theTemplArgs, theClass, baseClass) \
template <theTemplArgs> \
const AFX_MSGMAP* theClass::GetMessageMap() const \
{ return &theClass::messageMap; } \
template <theTemplArgs> \
AFX_COMDAT AFX_DATADEF const AFX_MSGMAP theClass::messageMap = \
{ &baseClass::messageMap, &theClass::_messageEntries[0] }; \
template <theTemplArgs> \
AFX_COMDAT const AFX_MSGMAP_ENTRY theClass::_messageEntries[] = \
{ \
#endif
#else
// Old VC6.0
#ifdef _AFXDLL
#define BEGIN_TEMPLATE_MESSAGE_MAP(theTemplArgs, theClass, baseClass) \
template <theTemplArgs> \
const AFX_MSGMAP* PASCAL theClass::_GetBaseMessageMap() \
{ return &baseClass::messageMap; } \
template <theTemplArgs> \
const AFX_MSGMAP* theClass::GetMessageMap() const \
{ return &theClass::messageMap; } \
template <theTemplArgs> \
AFX_COMDAT AFX_DATADEF const AFX_MSGMAP theClass::messageMap = \
{ &theClass::_GetBaseMessageMap, &theClass::_messageEntries[0] }; \
template <theTemplArgs> \
AFX_COMDAT const AFX_MSGMAP_ENTRY theClass::_messageEntries[] = \
{ \
#else
#define BEGIN_TEMPLATE_MESSAGE_MAP(theTemplArgs, theClass, baseClass) \
template <theTemplArgs> \
const AFX_MSGMAP* theClass::GetMessageMap() const \
{ return &theClass::messageMap; } \
template <theTemplArgs> \
AFX_COMDAT AFX_DATADEF const AFX_MSGMAP theClass::messageMap = \
{ &baseClass::messageMap, &theClass::_messageEntries[0] }; \
template <theTemplArgs> \
AFX_COMDAT const AFX_MSGMAP_ENTRY theClass::_messageEntries[] = \
{ \
#endif
#endif
#define END_TEMPLATE_MESSAGE_MAP() END_MESSAGE_MAP()
///////////////////////////////////////////////////////////////////////////////
// definition for OLECMD_MAP:
#define DECLARE_TEMPLATE_OLECMD_MAP() DECLARE_OLECMD_MAP()
#ifdef _AFXDLL
#define BEGIN_TEMPLATE_OLECMD_MAP(theTemplArgs, theClass, baseClass) \
template <theTemplArgs> \
const AFX_OLECMDMAP* PASCAL theClass::_GetBaseCommandMap() \
{ return &baseClass::commandMap; } \
template <theTemplArgs> \
const AFX_OLECMDMAP* theClass::GetCommandMap() const \
{ return &theClass::commandMap; } \
template <theTemplArgs> \
AFX_COMDAT AFX_DATADEF const AFX_OLECMDMAP theClass::commandMap = \
{ &theClass::_GetBaseCommandMap, &theClass::_commandEntries[0] }; \
template <theTemplArgs> \
AFX_COMDAT const AFX_OLECMDMAP_ENTRY theClass::_commandEntries[] = \
{ \
#else
#define BEGIN_TEMPLATE_OLECMD_MAP(theTemplArgs, theClass, baseClass) \
template <theTemplArgs> \
const AFX_OLECMDMAP* theClass::GetCommandMap() const \
{ return &theClass::commandMap; } \
template <theTemplArgs> \
AFX_COMDAT AFX_DATADEF const AFX_OLECMDMAP theClass::commandMap = \
{ &baseClass::commandMap, &theClass::_commandEntries[0] }; \
template <theTemplArgs> \
AFX_COMDAT const AFX_OLECMDMAP_ENTRY theClass::_commandEntries[] = \
{ \
#endif
#define END_TEMPLATE_OLECMD_MAP() END_OLECMD_MAP()
///////////////////////////////////////////////////////////////////////////////
// definition for INTERFACE_MAP:
#define DECLARE_TEMPLATE_INTERFACE_MAP() DECLARE_INTERFACE_MAP()
#ifdef _AFXDLL
#define BEGIN_TEMPLATE_INTERFACE_MAP(theTemplArgs, theClass, theBase) \
template <theTemplArgs> \
const AFX_INTERFACEMAP* PASCAL theClass::_GetBaseInterfaceMap() \
{ return &theBase::interfaceMap; } \
template <theTemplArgs> \
const AFX_INTERFACEMAP* theClass::GetInterfaceMap() const \
{ return &theClass::interfaceMap; } \
template <theTemplArgs> \
AFX_COMDAT const AFX_DATADEF AFX_INTERFACEMAP theClass::interfaceMap = \
{ &theClass::_GetBaseInterfaceMap, &theClass::_interfaceEntries[0], }; \
template <theTemplArgs> \
AFX_COMDAT const AFX_DATADEF AFX_INTERFACEMAP_ENTRY theClass::_interfaceEntries[] = \
{ \
#else
#define BEGIN_TEMPLATE_INTERFACE_MAP(theTemplArgs, theClass, theBase) \
template <theTemplArgs> \
const AFX_INTERFACEMAP* theClass::GetInterfaceMap() const \
{ return &theClass::interfaceMap; } \
template <theTemplArgs> \
AFX_COMDAT const AFX_DATADEF AFX_INTERFACEMAP theClass::interfaceMap = \
{ &theBase::interfaceMap, &theClass::_interfaceEntries[0], }; \
template <theTemplArgs> \
AFX_COMDAT const AFX_DATADEF AFX_INTERFACEMAP_ENTRY theClass::_interfaceEntries[] = \
{ \
#endif
#define END_TEMPLATE_INTERFACE_MAP() END_INTERFACE_MAP()
///////////////////////////////////////////////////////////////////////////////
// definition for DISPATCH_MAP:
#define DECLARE_TEMPLATE_DISPATCH_MAP() DECLARE_DISPATCH_MAP()
#ifdef _AFXDLL
#define BEGIN_TEMPLATE_DISPATCH_MAP(theTemplArgs, theClass, baseClass) \
template <theTemplArgs> \
const AFX_DISPMAP* PASCAL theClass::_GetBaseDispatchMap() \
{ return &baseClass::dispatchMap; } \
template <theTemplArgs> \
const AFX_DISPMAP* theClass::GetDispatchMap() const \
{ return &theClass::dispatchMap; } \
template <theTemplArgs> \
AFX_COMDAT const AFX_DISPMAP theClass::dispatchMap = \
{ &theClass::_GetBaseDispatchMap, &theClass::_dispatchEntries[0], \
&theClass::_dispatchEntryCount, &theClass::_dwStockPropMask }; \
template <theTemplArgs> \
AFX_COMDAT UINT theClass::_dispatchEntryCount = (UINT)-1; \
template <theTemplArgs> \
AFX_COMDAT DWORD theClass::_dwStockPropMask = (DWORD)-1; \
template <theTemplArgs> \
AFX_COMDAT const AFX_DISPMAP_ENTRY theClass::_dispatchEntries[] = \
{ \
#else
#define BEGIN_TEMPLATE_DISPATCH_MAP(theTemplArgs, theClass, baseClass) \
template <theTemplArgs> \
const AFX_DISPMAP* theClass::GetDispatchMap() const \
{ return &theClass::dispatchMap; } \
template <theTemplArgs> \
AFX_COMDAT const AFX_DISPMAP theClass::dispatchMap = \
{ &baseClass::dispatchMap, &theClass::_dispatchEntries[0], \
&theClass::_dispatchEntryCount, &theClass::_dwStockPropMask }; \
template <theTemplArgs> \
AFX_COMDAT UINT theClass::_dispatchEntryCount = (UINT)-1; \
template <theTemplArgs> \
AFX_COMDAT DWORD theClass::_dwStockPropMask = (DWORD)-1; \
template <theTemplArgs> \
AFX_COMDAT const AFX_DISPMAP_ENTRY theClass::_dispatchEntries[] = \
{ \
#endif
#define END_TEMPLATE_DISPATCH_MAP() END_DISPATCH_MAP()
///////////////////////////////////////////////////////////////////////////////
// definition for CONNECTION_MAP:
#define DECLARE_TEMPLATE_CONNECTION_MAP() DECLARE_CONNECTION_MAP()
#ifdef _AFXDLL
#define BEGIN_TEMPLATE_CONNECTION_MAP(theTemplArgs, theClass, theBase) \
template <theTemplArgs> \
const AFX_CONNECTIONMAP* PASCAL theClass::_GetBaseConnectionMap() \
{ return &theBase::connectionMap; } \
template <theTemplArgs> \
const AFX_CONNECTIONMAP* theClass::GetConnectionMap() const \
{ return &theClass::connectionMap; } \
template <theTemplArgs> \
AFX_COMDAT const AFX_DATADEF AFX_CONNECTIONMAP theClass::connectionMap = \
{ &theClass::_GetBaseConnectionMap, &theClass::_connectionEntries[0], }; \
template <theTemplArgs> \
AFX_COMDAT const AFX_DATADEF AFX_CONNECTIONMAP_ENTRY theClass::_connectionEntries[] = \
{ \
#else
#define BEGIN_TEMPLATE_CONNECTION_MAP(theTemplArgs, theClass, theBase) \
template <theTemplArgs> \
const AFX_CONNECTIONMAP* theClass::GetConnectionMap() const \
{ return &theClass::connectionMap; } \
template <theTemplArgs> \
AFX_COMDAT const AFX_DATADEF AFX_CONNECTIONMAP theClass::connectionMap = \
{ &(theBase::connectionMap), &theClass::_connectionEntries[0], }; \
template <theTemplArgs> \
AFX_COMDAT const AFX_DATADEF AFX_CONNECTIONMAP_ENTRY theClass::_connectionEntries[] = \
{ \
#endif
#define END_TEMPLATE_CONNECTION_MAP() END_CONNECTION_MAP()
///////////////////////////////////////////////////////////////////////////////
// definition for EVENTSINK_MAP:
#define DECLARE_TEMPLATE_EVENTSINK_MAP() DECLARE_EVENTSINK_MAP()
#ifdef _AFXDLL
#define BEGIN_TEMPLATE_EVENTSINK_MAP(theTemplArgs, theClass, baseClass) \
template <theTemplArgs> \
const AFX_EVENTSINKMAP* PASCAL theClass::_GetBaseEventSinkMap() \
{ return &baseClass::eventsinkMap; } \
template <theTemplArgs> \
const AFX_EVENTSINKMAP* theClass::GetEventSinkMap() const \
{ return &theClass::eventsinkMap; } \
template <theTemplArgs> \
const AFX_EVENTSINKMAP theClass::eventsinkMap = \
{ &theClass::_GetBaseEventSinkMap, &theClass::_eventsinkEntries[0], \
&theClass::_eventsinkEntryCount }; \
template <theTemplArgs> \
UINT theClass::_eventsinkEntryCount = (UINT)-1; \
template <theTemplArgs> \
const AFX_EVENTSINKMAP_ENTRY theClass::_eventsinkEntries[] = \
{ \
#else
#define BEGIN_TEMPLATE_EVENTSINK_MAP(theTemplArgs, theClass, baseClass) \
template <theTemplArgs> \
const AFX_EVENTSINKMAP* theClass::GetEventSinkMap() const \
{ return &theClass::eventsinkMap; } \
template <theTemplArgs> \
const AFX_EVENTSINKMAP theClass::eventsinkMap = \
{ &baseClass::eventsinkMap, &theClass::_eventsinkEntries[0], \
&theClass::_eventsinkEntryCount }; \
template <theTemplArgs> \
UINT theClass::_eventsinkEntryCount = (UINT)-1; \
template <theTemplArgs> \
const AFX_EVENTSINKMAP_ENTRY theClass::_eventsinkEntries[] = \
{ \
#endif
#define END_TEMPLATE_EVENTSINK_MAP() END_EVENTSINK_MAP()
///////////////////////////////////////////////////////////////////////////////
// definition for EVENT_MAP:
#define DECLARE_TEMPLATE_EVENT_MAP() DECLARE_EVENT_MAP()
#define BEGIN_TEMPLATE_EVENT_MAP(theTemplArgs, theClass, baseClass) \
template <theTemplArgs> \
const AFX_EVENTMAP* theClass::GetEventMap() const \
{ return &eventMap; } \
template <theTemplArgs> \
const AFX_DATADEF AFX_EVENTMAP theClass::eventMap = \
{ &(baseClass::eventMap), theClass::_eventEntries, \
&theClass::_dwStockEventMask }; \
template <theTemplArgs> \
AFX_COMDAT DWORD theClass::_dwStockEventMask = (DWORD)-1; \
template <theTemplArgs> \
AFX_COMDAT const AFX_DATADEF AFX_EVENTMAP_ENTRY theClass::_eventEntries[] = \
{
#define END_TEMPLATE_EVENT_MAP() END_EVENT_MAP()
#endif // !defined(AFX_TEMPLDEF_H__742F3281_055B_11D4_B261_00104BB13A66__INCLUDED_)