Mercurial > projects > dstep
annotate dstep/foundation/NSNotificationQueue.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | 89f3c3ef1fd2 |
children | b9de51448c6b |
rev | line source |
---|---|
14 | 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.NSNotificationQueue; | |
8 | |
9 import dstep.foundation.NSArray; | |
10 import dstep.foundation.NSNotification; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
11 import dstep.foundation.NSObjCRuntime; |
14 | 12 import dstep.foundation.NSObject; |
13 import dstep.objc.bridge.Bridge; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
14 import dstep.objc.objc; |
14 | 15 |
16 alias NSUInteger NSPostingStyle; | |
17 alias NSUInteger NSNotificationCoalescing; | |
18 | |
19 enum | |
20 { | |
21 NSPostWhenIdle = 1, | |
22 NSPostASAP = 2, | |
23 NSPostNow = 3 | |
24 } | |
25 | |
26 enum | |
27 { | |
28 NSNotificationNoCoalescing = 0, | |
29 NSNotificationCoalescingOnName = 1, | |
30 NSNotificationCoalescingOnSender = 2 | |
31 } | |
32 | |
33 class NSNotificationQueue : NSObject | |
34 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
35 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
36 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
37 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
38 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
39 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
40 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
41 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
42 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
43 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
44 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
45 } |
14 | 46 |
47 static Object defaultQueue () | |
48 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
49 return invokeObjcSuperClass!(Object, "defaultQueue"); |
14 | 50 } |
51 | |
52 Object initWithNotificationCenter (NSNotificationCenter notificationCenter) | |
53 { | |
54 return invokeObjcSelf!(Object, "initWithNotificationCenter:", NSNotificationCenter)(notificationCenter); | |
55 } | |
56 | |
57 this (NSNotificationCenter notificationCenter) | |
58 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
59 typeof(this).alloc.initWithNotificationCenter(notificationCenter); |
14 | 60 } |
61 | |
62 void enqueueNotification (NSNotification notification, uint postingStyle) | |
63 { | |
64 return invokeObjcSelf!(void, "enqueueNotification:postingStyle:", NSNotification, uint)(notification, postingStyle); | |
65 } | |
66 | |
67 void enqueueNotification (NSNotification notification, uint postingStyle, NSUInteger coalesceMask, NSArray modes) | |
68 { | |
69 return invokeObjcSelf!(void, "enqueueNotification:postingStyle:coalesceMask:forModes:", NSNotification, uint, NSUInteger, NSArray)(notification, postingStyle, coalesceMask, modes); | |
70 } | |
71 | |
72 void dequeueNotificationsMatching (NSNotification notification, NSUInteger coalesceMask) | |
73 { | |
74 return invokeObjcSelf!(void, "dequeueNotificationsMatching:coalesceMask:", NSNotification, NSUInteger)(notification, coalesceMask); | |
75 } | |
76 } | |
77 |