Mercurial > projects > dstep
annotate dstep/foundation/NSScriptClassDescription.d @ 27:57371c29ef73 default tip
ObjcWrap is now automatically mixed in. Added support for building as a dylib with DMD.
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Fri, 09 Apr 2010 23:00:22 +0200 |
parents | b9de51448c6b |
children |
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.NSScriptClassDescription; | |
8 | |
9 import dstep.foundation.NSClassDescription; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
10 import dstep.foundation.NSDictionary; |
14 | 11 import dstep.foundation.NSScriptCommandDescription; |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
12 import dstep.foundation.NSString; |
14 | 13 import dstep.objc.bridge.Bridge; |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
14 import dstep.objc.objc; |
14 | 15 |
16 class NSScriptClassDescription : NSClassDescription | |
17 { | |
25
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
18 mixin ObjcWrap; |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
19 |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
20 this (id object) |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
21 { |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
22 super(object); |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
23 } |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
24 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
25 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
26 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
27 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
28 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
29 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
30 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
31 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
32 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
33 } |
14 | 34 |
35 static NSScriptClassDescription classDescriptionForClass (Class aClass) | |
36 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
37 return invokeObjcSuperClass!(NSScriptClassDescription, "classDescriptionForClass:", Class)(aClass); |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
38 } |
14 | 39 |
40 Object initWithSuiteName (NSString suiteName, NSString className, NSDictionary classDeclaration) | |
41 { | |
42 return invokeObjcSelf!(Object, "initWithSuiteName:className:dictionary:", NSString, NSString, NSDictionary)(suiteName, className, classDeclaration); | |
43 } | |
44 | |
45 this (NSString suiteName, NSString className, NSDictionary classDeclaration) | |
46 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
47 typeof(this).alloc.initWithSuiteName(suiteName, className, classDeclaration); |
14 | 48 } |
49 | |
50 NSString suiteName () | |
51 { | |
52 return invokeObjcSelf!(NSString, "suiteName"); | |
53 } | |
54 | |
55 NSString className () | |
56 { | |
57 return invokeObjcSelf!(NSString, "className"); | |
58 } | |
59 | |
60 NSString implementationClassName () | |
61 { | |
62 return invokeObjcSelf!(NSString, "implementationClassName"); | |
63 } | |
64 | |
65 NSScriptClassDescription superclassDescription () | |
66 { | |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
67 id result = invokeObjcSelf!(id, "superclassDescription"); |
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
68 return result is this.objcObject ? this : (result !is null ? new NSScriptClassDescription(result) : null); |
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
69 } |
14 | 70 |
71 uint appleEventCode () | |
72 { | |
73 return invokeObjcSelf!(uint, "appleEventCode"); | |
74 } | |
75 | |
76 bool matchesAppleEventCode (uint appleEventCode) | |
77 { | |
78 return invokeObjcSelf!(bool, "matchesAppleEventCode:", uint)(appleEventCode); | |
79 } | |
80 | |
81 bool supportsCommand (NSScriptCommandDescription commandDescription) | |
82 { | |
83 return invokeObjcSelf!(bool, "supportsCommand:", NSScriptCommandDescription)(commandDescription); | |
84 } | |
85 | |
86 SEL selectorForCommand (NSScriptCommandDescription commandDescription) | |
87 { | |
88 return invokeObjcSelf!(SEL, "selectorForCommand:", NSScriptCommandDescription)(commandDescription); | |
89 } | |
90 | |
91 NSString typeForKey (NSString key) | |
92 { | |
93 return invokeObjcSelf!(NSString, "typeForKey:", NSString)(key); | |
94 } | |
95 | |
96 NSScriptClassDescription classDescriptionForKey (NSString key) | |
97 { | |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
98 id result = invokeObjcSelf!(id, "classDescriptionForKey:", NSString)(key); |
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
99 return result is this.objcObject ? this : (result !is null ? new NSScriptClassDescription(result) : null); |
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
100 } |
14 | 101 |
102 uint appleEventCodeForKey (NSString key) | |
103 { | |
104 return invokeObjcSelf!(uint, "appleEventCodeForKey:", NSString)(key); | |
105 } | |
106 | |
107 NSString keyWithAppleEventCode (uint appleEventCode) | |
108 { | |
109 return invokeObjcSelf!(NSString, "keyWithAppleEventCode:", uint)(appleEventCode); | |
110 } | |
111 | |
112 NSString defaultSubcontainerAttributeKey () | |
113 { | |
114 return invokeObjcSelf!(NSString, "defaultSubcontainerAttributeKey"); | |
115 } | |
116 | |
117 bool isLocationRequiredToCreateForKey (NSString toManyRelationshipKey) | |
118 { | |
119 return invokeObjcSelf!(bool, "isLocationRequiredToCreateForKey:", NSString)(toManyRelationshipKey); | |
120 } | |
121 | |
122 bool hasPropertyForKey (NSString key) | |
123 { | |
124 return invokeObjcSelf!(bool, "hasPropertyForKey:", NSString)(key); | |
125 } | |
126 | |
127 bool hasOrderedToManyRelationshipForKey (NSString key) | |
128 { | |
129 return invokeObjcSelf!(bool, "hasOrderedToManyRelationshipForKey:", NSString)(key); | |
130 } | |
131 | |
132 bool hasReadablePropertyForKey (NSString key) | |
133 { | |
134 return invokeObjcSelf!(bool, "hasReadablePropertyForKey:", NSString)(key); | |
135 } | |
136 | |
137 bool hasWritablePropertyForKey (NSString key) | |
138 { | |
139 return invokeObjcSelf!(bool, "hasWritablePropertyForKey:", NSString)(key); | |
140 } | |
141 } | |
142 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
143 const TNSScriptClassDescription = ` |
14 | 144 |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
145 uint classCode () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
146 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
147 return invokeObjcSelf!(uint, "classCode"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
148 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
149 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
150 NSString className () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
151 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
152 return invokeObjcSelf!(NSString, "className"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
153 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
154 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
155 //mixin ObjcBindMethod!(classCode, "classCode"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
156 //mixin ObjcBindMethod!(className, "className"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
157 `; |