6
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
7
("Apple") in consideration of your agreement to the following terms, and your
8
use, installation, modification or redistribution of this Apple software
9
constitutes acceptance of these terms. If you do not agree with these terms,
10
please do not use, install, modify or redistribute this Apple software.
12
In consideration of your agreement to abide by the following terms, and subject
13
to these terms, Apple grants you a personal, non-exclusive license, under Apple�s
14
copyrights in this original Apple software (the "Apple Software"), to use,
15
reproduce, modify and redistribute the Apple Software, with or without
16
modifications, in source and/or binary forms; provided that if you redistribute
17
the Apple Software in its entirety and without modifications, you must retain
18
this notice and the following text and disclaimers in all such redistributions of
19
the Apple Software. Neither the name, trademarks, service marks or logos of
20
Apple Computer, Inc. may be used to endorse or promote products derived from the
21
Apple Software without specific prior written permission from Apple. Except as
22
expressly stated in this notice, no other rights or licenses, express or implied,
23
are granted by Apple herein, including but not limited to any patent rights that
24
may be infringed by your derivative works or by other works in which the Apple
25
Software may be incorporated.
27
The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
28
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
29
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30
PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
31
COMBINATION WITH YOUR PRODUCTS.
33
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
34
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
35
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36
ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
37
OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
38
(INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
39
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41
Copyright � 2000-2005 Apple Computer, Inc., All Rights Reserved
44
#include "TCarbonEvent.h"
46
//-----------------------------------------------------------------------------------
47
// TCarbonEvent constructor
48
//-----------------------------------------------------------------------------------
50
TCarbonEvent::TCarbonEvent(
54
CreateEvent( NULL, inClass, inKind, 0, 0, &fEvent );
57
//-----------------------------------------------------------------------------------
58
// TCarbonEvent constructor
59
//-----------------------------------------------------------------------------------
61
TCarbonEvent::TCarbonEvent(
65
RetainEvent( fEvent );
68
//-----------------------------------------------------------------------------------
69
// TCarbonEvent destructor
70
//-----------------------------------------------------------------------------------
72
TCarbonEvent::~TCarbonEvent()
74
ReleaseEvent( fEvent );
77
//-----------------------------------------------------------------------------------
79
//-----------------------------------------------------------------------------------
82
TCarbonEvent::PostToQueue(
83
EventQueueRef inQueue,
84
EventPriority inPriority )
86
return PostEventToQueue( inQueue, fEvent, inPriority );
89
//-----------------------------------------------------------------------------------
91
//-----------------------------------------------------------------------------------
94
TCarbonEvent::SetParameter(
95
EventParamName inName,
96
EventParamType inType,
100
return SetEventParameter( fEvent, inName, inType, inSize, inData );
103
//-----------------------------------------------------------------------------------
105
//-----------------------------------------------------------------------------------
108
TCarbonEvent::GetParameter(
109
EventParamName inName,
110
EventParamType inType,
114
return GetEventParameter( fEvent, inName, inType, NULL, inBufferSize, NULL, outData );
117
//-----------------------------------------------------------------------------------
119
//-----------------------------------------------------------------------------------
122
TCarbonEvent::GetParameterType(
123
EventParamName inName,
124
EventParamType* outType )
126
return GetEventParameter( fEvent, inName, typeWildCard, outType, 0, NULL, NULL );
129
//-----------------------------------------------------------------------------------
131
//-----------------------------------------------------------------------------------
134
TCarbonEvent::GetParameterSize(
135
EventParamName inName,
138
return GetEventParameter( fEvent, inName, typeWildCard, NULL, 0, outSize, NULL );
141
//-----------------------------------------------------------------------------------
143
//-----------------------------------------------------------------------------------
146
TCarbonEvent::SetParameter(
147
EventParamName inName,
150
return SetParameter<Boolean>( inName, typeBoolean, inValue );
153
//-----------------------------------------------------------------------------------
155
//-----------------------------------------------------------------------------------
158
TCarbonEvent::GetParameter(
159
EventParamName inName,
162
return GetParameter<Boolean>( inName, typeBoolean, outValue );
165
//-----------------------------------------------------------------------------------
167
//-----------------------------------------------------------------------------------
170
TCarbonEvent::SetParameter(
171
EventParamName inName,
174
return SetParameter<Boolean>( inName, typeBoolean, (Boolean) inValue );
177
//-----------------------------------------------------------------------------------
179
//-----------------------------------------------------------------------------------
182
TCarbonEvent::GetParameter(
183
EventParamName inName,
186
return GetParameter<Boolean>( inName, sizeof( Boolean ), (Boolean*) outValue );
189
//-----------------------------------------------------------------------------------
191
//-----------------------------------------------------------------------------------
194
TCarbonEvent::SetParameter(
195
EventParamName inName,
198
return SetParameter<Point>( inName, typeQDPoint, inPt );
201
//-----------------------------------------------------------------------------------
203
//-----------------------------------------------------------------------------------
206
TCarbonEvent::GetParameter(
207
EventParamName inName,
210
return GetParameter<Point>( inName, typeQDPoint, outPt );
213
//-----------------------------------------------------------------------------------
215
//-----------------------------------------------------------------------------------
218
TCarbonEvent::SetParameter(
219
EventParamName inName,
220
const HIPoint& inPt )
222
return SetParameter<HIPoint>( inName, typeHIPoint, inPt );
225
//-----------------------------------------------------------------------------------
227
//-----------------------------------------------------------------------------------
230
TCarbonEvent::GetParameter(
231
EventParamName inName,
234
return GetParameter<HIPoint>( inName, typeHIPoint, outPt );
237
//-----------------------------------------------------------------------------------
239
//-----------------------------------------------------------------------------------
242
TCarbonEvent::SetParameter(
243
EventParamName inName,
246
return SetParameter<Rect>( inName, typeQDRectangle, inRect );
249
//-----------------------------------------------------------------------------------
251
//-----------------------------------------------------------------------------------
254
TCarbonEvent::GetParameter(
255
EventParamName inName,
258
return GetParameter<Rect>( inName, typeQDRectangle, outRect );
261
//-----------------------------------------------------------------------------------
263
//-----------------------------------------------------------------------------------
266
TCarbonEvent::SetParameter(
267
EventParamName inName,
268
const HIRect& inRect )
270
return SetParameter<HIRect>( inName, typeHIRect, inRect );
273
//-----------------------------------------------------------------------------------
275
//-----------------------------------------------------------------------------------
278
TCarbonEvent::GetParameter(
279
EventParamName inName,
282
return GetParameter<HIRect>( inName, typeHIRect, outRect );
285
//-----------------------------------------------------------------------------------
287
//-----------------------------------------------------------------------------------
290
TCarbonEvent::SetParameter(
291
EventParamName inName,
292
const HISize& inSize )
294
return SetParameter<HISize>( inName, typeHISize, inSize );
297
//-----------------------------------------------------------------------------------
299
//-----------------------------------------------------------------------------------
302
TCarbonEvent::GetParameter(
303
EventParamName inName,
306
return GetParameter<HISize>( inName, typeHISize, outSize );
309
//-----------------------------------------------------------------------------------
311
//-----------------------------------------------------------------------------------
314
TCarbonEvent::SetParameter(
315
EventParamName inName,
318
return SetParameter<RgnHandle>( inName, typeQDRgnHandle, inRegion );
321
//-----------------------------------------------------------------------------------
323
//-----------------------------------------------------------------------------------
326
TCarbonEvent::GetParameter(
327
EventParamName inName,
328
RgnHandle* outRegion )
330
return GetParameter<RgnHandle>( inName, typeQDRgnHandle, outRegion );
333
//-----------------------------------------------------------------------------------
335
//-----------------------------------------------------------------------------------
338
TCarbonEvent::SetParameter(
339
EventParamName inName,
342
return SetParameter<WindowRef>( inName, typeWindowRef, inWindow );
345
//-----------------------------------------------------------------------------------
347
//-----------------------------------------------------------------------------------
350
TCarbonEvent::GetParameter(
351
EventParamName inName,
352
WindowRef* outWindow )
354
return GetParameter<WindowRef>( inName, typeWindowRef, outWindow );
357
//-----------------------------------------------------------------------------------
359
//-----------------------------------------------------------------------------------
362
TCarbonEvent::SetParameter(
363
EventParamName inName,
364
ControlRef inControl )
366
return SetParameter<ControlRef>( inName, typeControlRef, inControl );
369
//-----------------------------------------------------------------------------------
371
//-----------------------------------------------------------------------------------
374
TCarbonEvent::GetParameter(
375
EventParamName inName,
376
ControlRef* outControl )
378
return GetParameter<ControlRef>( inName, typeControlRef, outControl );
381
//-----------------------------------------------------------------------------------
383
//-----------------------------------------------------------------------------------
386
TCarbonEvent::SetParameter(
387
EventParamName inName,
390
return SetParameter<MenuRef>( inName, typeMenuRef, inMenu );
393
//-----------------------------------------------------------------------------------
395
//-----------------------------------------------------------------------------------
398
TCarbonEvent::GetParameter(
399
EventParamName inName,
402
return GetParameter<MenuRef>( inName, typeMenuRef, outMenu );
405
//-----------------------------------------------------------------------------------
407
//-----------------------------------------------------------------------------------
410
TCarbonEvent::SetParameter(
411
EventParamName inName,
414
return SetParameter<DragRef>( inName, typeDragRef, inDrag );
417
//-----------------------------------------------------------------------------------
419
//-----------------------------------------------------------------------------------
422
TCarbonEvent::GetParameter(
423
EventParamName inName,
426
return GetParameter<DragRef>( inName, typeDragRef, outDrag );
429
//-----------------------------------------------------------------------------------
431
//-----------------------------------------------------------------------------------
434
TCarbonEvent::SetParameter(
435
EventParamName inName,
438
return SetParameter<UInt32>( inName, typeUInt32, inValue );
441
//-----------------------------------------------------------------------------------
443
//-----------------------------------------------------------------------------------
446
TCarbonEvent::GetParameter(
447
EventParamName inName,
450
return GetParameter<UInt32>( inName, typeUInt32, outValue );
453
//-----------------------------------------------------------------------------------
455
//-----------------------------------------------------------------------------------
458
TCarbonEvent::SetParameter(
459
EventParamName inName,
460
const HICommand& inValue )
462
return SetParameter<HICommand>( inName, typeHICommand, inValue );
465
//-----------------------------------------------------------------------------------
467
//-----------------------------------------------------------------------------------
470
TCarbonEvent::GetParameter(
471
EventParamName inName,
472
HICommand* outValue )
474
return GetParameter<HICommand>( inName, typeHICommand, outValue );
477
//-----------------------------------------------------------------------------------
479
//-----------------------------------------------------------------------------------
482
TCarbonEvent::SetParameter(
483
EventParamName inName,
484
const HICommandExtended& inValue )
486
return SetParameter<HICommandExtended>( inName, typeHICommand, inValue );
489
//-----------------------------------------------------------------------------------
491
//-----------------------------------------------------------------------------------
494
TCarbonEvent::GetParameter(
495
EventParamName inName,
496
HICommandExtended* outValue )
498
return GetParameter<HICommandExtended>( inName, typeHICommand, outValue );
501
//-----------------------------------------------------------------------------------
503
//-----------------------------------------------------------------------------------
506
TCarbonEvent::SetParameter(
507
EventParamName inName,
508
const ControlPartCode& inValue )
510
return SetParameter<ControlPartCode>( inName, typeControlPartCode, inValue );
513
//-----------------------------------------------------------------------------------
515
//-----------------------------------------------------------------------------------
518
TCarbonEvent::GetParameter(
519
EventParamName inName,
520
ControlPartCode* outValue )
522
return GetParameter<ControlPartCode>( inName, typeControlPartCode, outValue );