comparison dstep/foundation/NSPortMessage.d @ 14:89f3c3ef1fd2

Added the Foundation framework
author Jacob Carlborg <doob@me.com>
date Mon, 03 Aug 2009 15:23:15 +0200
parents
children 19885b43130e
comparison
equal deleted inserted replaced
13:4f583f7e242e 14:89f3c3ef1fd2
1 /**
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
3 * Authors: Jacob Carlborg
4 * Version: Initial created: Aug 3, 2009
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
6 */
7 module dstep.foundation.NSPortMessage;
8
9 import dstep.foundation.NSArray;
10 import dstep.foundation.NSDate;
11 import dstep.foundation.NSMutableArray;
12 import dstep.foundation.NSObject;
13 import dstep.foundation.NSPort;
14 import dstep.objc.bridge.Bridge;
15 import dstep.objc.objc : id;
16
17 class NSPortMessage : NSObject
18 {
19 mixin ObjcWrap;
20
21 Object initWithSendPort (NSPort sendPort, NSPort replyPort, NSArray components)
22 {
23 return invokeObjcSelf!(Object, "initWithSendPort:receivePort:components:", NSPort, NSPort, NSArray)(sendPort, replyPort, components);
24 }
25
26 this (NSPort sendPort, NSPort replyPort, NSArray components)
27 {
28 objcObject = Bridge.invokeObjcClassMethod!(id, "alloc")(objcClass);
29 id result = Bridge.invokeObjcMethod!(id, "initWithSendPort:receivePort:components:", NSPort, NSPort, NSArray)(objcObject, sendPort, replyPort, components);
30
31 if (result)
32 objcObject = ret;
33
34 dObject = this;
35 }
36
37 NSArray components ()
38 {
39 return invokeObjcSelf!(NSArray, "components");
40 }
41
42 NSPort receivePort ()
43 {
44 return invokeObjcSelf!(NSPort, "receivePort");
45 }
46
47 NSPort sendPort ()
48 {
49 return invokeObjcSelf!(NSPort, "sendPort");
50 }
51
52 bool sendBeforeDate (NSDate date)
53 {
54 return invokeObjcSelf!(bool, "sendBeforeDate:", NSDate)(date);
55 }
56
57 uint msgid ()
58 {
59 return invokeObjcSelf!(uint, "msgid");
60 }
61
62 void setMsgid (uint msgid)
63 {
64 return invokeObjcSelf!(void, "setMsgid:", uint)(msgid);
65 }
66 }
67