Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSAppleEventManager.d @ 1:8b48be5454ce
The internal cocoa classes compile now
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Tue, 19 Aug 2008 17:35:17 +0200 |
parents | 380af2bdd8e5 |
children | f565d3a95c0a |
comparison
equal
deleted
inserted
replaced
0:380af2bdd8e5 | 1:8b48be5454ce |
---|---|
11 * Port to the D Programming language: | 11 * Port to the D Programming language: |
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | 12 * Jacob Carlborg <jacob.carlborg@gmail.com> |
13 *******************************************************************************/ | 13 *******************************************************************************/ |
14 module dwt.internal.cocoa.NSAppleEventManager; | 14 module dwt.internal.cocoa.NSAppleEventManager; |
15 | 15 |
16 import dwt.internal.cocoa.id; | |
16 import dwt.internal.cocoa.NSAppleEventDescriptor; | 17 import dwt.internal.cocoa.NSAppleEventDescriptor; |
17 import dwt.internal.cocoa.NSObject; | 18 import dwt.internal.cocoa.NSObject; |
19 import dwt.internal.cocoa.OS; | |
18 import objc = dwt.internal.objc.runtime; | 20 import objc = dwt.internal.objc.runtime; |
19 | 21 |
20 public class NSAppleEventManager : NSObject | 22 public class NSAppleEventManager : NSObject |
21 { | 23 { |
22 | 24 |
30 super(id); | 32 super(id); |
31 } | 33 } |
32 | 34 |
33 public NSAppleEventDescriptor appleEventForSuspensionID (objc.id suspensionID) | 35 public NSAppleEventDescriptor appleEventForSuspensionID (objc.id suspensionID) |
34 { | 36 { |
35 objc.id result = OS.objc_msgSend(this.id, OS.sel_appleEventForSuspensionID_1, suspensionID); | 37 objc.id result = OS.objc_msgSend(this.id_, OS.sel_appleEventForSuspensionID_1, suspensionID); |
36 return result !is null ? new NSAppleEventDescriptor(result) : null; | 38 return result !is null ? new NSAppleEventDescriptor(result) : null; |
37 } | 39 } |
38 | 40 |
39 public NSAppleEventDescriptor currentAppleEvent () | 41 public NSAppleEventDescriptor currentAppleEvent () |
40 { | 42 { |
41 objc.id result = OS.objc_msgSend(this.id, OS.sel_currentAppleEvent); | 43 objc.id result = OS.objc_msgSend(this.id_, OS.sel_currentAppleEvent); |
42 return result !is null ? new NSAppleEventDescriptor(result) : null; | 44 return result !is null ? new NSAppleEventDescriptor(result) : null; |
43 } | 45 } |
44 | 46 |
45 public NSAppleEventDescriptor currentReplyAppleEvent () | 47 public NSAppleEventDescriptor currentReplyAppleEvent () |
46 { | 48 { |
47 objc.id result = OS.objc_msgSend(this.id, OS.sel_currentReplyAppleEvent); | 49 objc.id result = OS.objc_msgSend(this.id_, OS.sel_currentReplyAppleEvent); |
48 return result !is null ? new NSAppleEventDescriptor(result) : null; | 50 return result !is null ? new NSAppleEventDescriptor(result) : null; |
49 } | 51 } |
50 | 52 |
51 public short dispatchRawAppleEvent (objc.id theAppleEvent, objc.id theReply, objc.id handlerRefCon) | 53 public short dispatchRawAppleEvent (objc.id theAppleEvent, objc.id theReply, objc.id handlerRefCon) |
52 { | 54 { |
53 return cast(short) OS.objc_msgSend(this.id, OS.sel_dispatchRawAppleEvent_1withRawReply_1handlerRefCon_1, theAppleEvent, theReply, | 55 return cast(short) OS.objc_msgSend(this.id_, OS.sel_dispatchRawAppleEvent_1withRawReply_1handlerRefCon_1, theAppleEvent, theReply, |
54 handlerRefCon); | 56 handlerRefCon); |
55 } | 57 } |
56 | 58 |
57 public void removeEventHandlerForEventClass (objc.id eventClass, objc.id eventID) | 59 public void removeEventHandlerForEventClass (objc.id eventClass, objc.id eventID) |
58 { | 60 { |
59 OS.objc_msgSend(this.id, OS.sel_removeEventHandlerForEventClass_1andEventID_1, eventClass, eventID); | 61 OS.objc_msgSend(this.id_, OS.sel_removeEventHandlerForEventClass_1andEventID_1, eventClass, eventID); |
60 } | 62 } |
61 | 63 |
62 public NSAppleEventDescriptor replyAppleEventForSuspensionID (objc.id suspensionID) | 64 public NSAppleEventDescriptor replyAppleEventForSuspensionID (objc.id suspensionID) |
63 { | 65 { |
64 objc.id result = OS.objc_msgSend(this.id, OS.sel_replyAppleEventForSuspensionID_1, suspensionID); | 66 objc.id result = OS.objc_msgSend(this.id_, OS.sel_replyAppleEventForSuspensionID_1, suspensionID); |
65 return result !is null ? new NSAppleEventDescriptor(result) : null; | 67 return result !is null ? new NSAppleEventDescriptor(result) : null; |
66 } | 68 } |
67 | 69 |
68 public void resumeWithSuspensionID (objc.id suspensionID) | 70 public void resumeWithSuspensionID (objc.id suspensionID) |
69 { | 71 { |
70 OS.objc_msgSend(this.id, OS.sel_resumeWithSuspensionID_1, suspensionID); | 72 OS.objc_msgSend(this.id_, OS.sel_resumeWithSuspensionID_1, suspensionID); |
71 } | 73 } |
72 | 74 |
73 public void setCurrentAppleEventAndReplyEventWithSuspensionID (objc.id suspensionID) | 75 public void setCurrentAppleEventAndReplyEventWithSuspensionID (objc.id suspensionID) |
74 { | 76 { |
75 OS.objc_msgSend(this.id, OS.sel_setCurrentAppleEventAndReplyEventWithSuspensionID_1, suspensionID); | 77 OS.objc_msgSend(this.id_, OS.sel_setCurrentAppleEventAndReplyEventWithSuspensionID_1, suspensionID); |
76 } | 78 } |
77 | 79 |
78 public void setEventHandler (id handler, objc.id handleEventSelector, objc.id eventClass, objc.id eventID) | 80 public void setEventHandler (id handler, objc.id handleEventSelector, objc.id eventClass, objc.id eventID) |
79 { | 81 { |
80 OS.objc_msgSend(this.id, OS.sel_setEventHandler_1andSelector_1forEventClass_1andEventID_1, handler !is null ? handler.id : null, | 82 OS.objc_msgSend(this.id_, OS.sel_setEventHandler_1andSelector_1forEventClass_1andEventID_1, handler !is null ? handler.id_ : null, |
81 handleEventSelector, eventClass, eventID); | 83 handleEventSelector, eventClass, eventID); |
82 } | 84 } |
83 | 85 |
84 public static NSAppleEventManager sharedAppleEventManager () | 86 public static NSAppleEventManager sharedAppleEventManager () |
85 { | 87 { |
87 return result !is null ? new NSAppleEventManager(result) : null; | 89 return result !is null ? new NSAppleEventManager(result) : null; |
88 } | 90 } |
89 | 91 |
90 public objc.id suspendCurrentAppleEvent () | 92 public objc.id suspendCurrentAppleEvent () |
91 { | 93 { |
92 return OS.objc_msgSend(this.id, OS.sel_suspendCurrentAppleEvent); | 94 return OS.objc_msgSend(this.id_, OS.sel_suspendCurrentAppleEvent); |
93 } | 95 } |
94 } | 96 } |