Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 59 lines (49 sloc) 2.229 kb
dc5be1c Initial check-in.
uli authored
1 //
2 // UKCarbonEventHandler.h
3 // TalkingMoose (XC2)
4 //
5 // Created by Uli Kusterer on 26.03.06.
720b0e7 @uliwitness Added licensing information to the source files.
authored
6 // Copyright 2006 Uli Kusterer.
7 //
8 // This software is provided 'as-is', without any express or implied
9 // warranty. In no event will the authors be held liable for any damages
10 // arising from the use of this software.
11 //
12 // Permission is granted to anyone to use this software for any purpose,
13 // including commercial applications, and to alter it and redistribute it
14 // freely, subject to the following restrictions:
15 //
16 // 1. The origin of this software must not be misrepresented; you must not
17 // claim that you wrote the original software. If you use this software
18 // in a product, an acknowledgment in the product documentation would be
19 // appreciated but is not required.
20 //
21 // 2. Altered source versions must be plainly marked as such, and must not be
22 // misrepresented as being the original software.
23 //
24 // 3. This notice may not be removed or altered from any source
25 // distribution.
dc5be1c Initial check-in.
uli authored
26 //
27
28 #import <Cocoa/Cocoa.h>
29
30 #ifndef __CARBON__
31 // Avoid pulling in all of Carbon.h into files that use an object of this kind (you'll still need it for creating one, though):
32 typedef void* EventHandlerRef;
33 typedef void* EventHandlerCallRef;
34 typedef void* EventRef;
35 #endif
36
37 extern NSString* UKCarbonEventHandlerEventReceived;
38
39 @interface UKCarbonEventHandler : NSObject
40 {
41 EventHandlerRef evtHandler; // Reference to our event handler to pass to Carbon.
42 EventHandlerCallRef currCall; // Allows us to forward the event. Only valid while we're handling an event.
43 EventRef currEvent; // The event we're currently handling.
44 }
45
46 -(id) initWithEventClass: (UInt32)eclass kind: (UInt32)ekind;
47
48 -(BOOL) performEventActionAndPassOn; // Override this to perform your action. By default sends a UKCarbonEventHandlerEventReceived notification with this object as the notification object.
49 -(BOOL) callNextHandler; // Returns YES when the other handler handled the event, NO on error or eventNotHandledErr.
50
51 // For you Carbon afficionados:
52 -(EventHandlerCallRef) currentCallRef;
53 -(EventRef) currentEventRef;
54
55 // Private:
56 -(OSStatus) handleEvent: (EventRef)inEvent call: (EventHandlerCallRef)inHandlerCallRef;
57
58 @end
Something went wrong with that request. Please try again.