Mercurial > projects > dstep
comparison dstep/quartzcore/CIFilterGenerator.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 | |
children | b9de51448c6b |
comparison
equal
deleted
inserted
replaced
15:7ff919f595d5 | 16:19885b43130e |
---|---|
1 /** | |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Sep 24, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.quartzcore.CIFilterGenerator; | |
8 | |
9 import dstep.foundation.NSCoder; | |
10 import dstep.foundation.NSDictionary; | |
11 import dstep.foundation.NSObject; | |
12 import dstep.foundation.NSString; | |
13 import dstep.foundation.NSURL; | |
14 import dstep.foundation.NSZone; | |
15 import dstep.objc.bridge.Bridge; | |
16 import dstep.objc.objc; | |
17 import dstep.quartzcore.CIFilter; | |
18 | |
19 import bindings = dstep.quartzcore.CIFilterGenerator_bindings; | |
20 | |
21 private | |
22 { | |
23 NSString kCIFilterGeneratorExportedKey_; | |
24 NSString kCIFilterGeneratorExportedKeyTargetObject_; | |
25 NSString kCIFilterGeneratorExportedKeyName_; | |
26 } | |
27 | |
28 NSString kCIFilterGeneratorExportedKey () | |
29 { | |
30 if (kCIFilterGeneratorExportedKey_) | |
31 return kCIFilterGeneratorExportedKey_; | |
32 | |
33 return kCIFilterGeneratorExportedKey_ = new NSString(bindings.kCIFilterGeneratorExportedKey); | |
34 } | |
35 | |
36 NSString kCIFilterGeneratorExportedKeyTargetObject () | |
37 { | |
38 if (kCIFilterGeneratorExportedKeyTargetObject_) | |
39 return kCIFilterGeneratorExportedKeyTargetObject_; | |
40 | |
41 return kCIFilterGeneratorExportedKeyTargetObject_ = new NSString(bindings.kCIFilterGeneratorExportedKeyTargetObject); | |
42 } | |
43 | |
44 NSString kCIFilterGeneratorExportedKeyName () | |
45 { | |
46 if (kCIFilterGeneratorExportedKeyName_) | |
47 return kCIFilterGeneratorExportedKeyName_; | |
48 | |
49 return kCIFilterGeneratorExportedKeyName_ = new NSString(bindings.kCIFilterGeneratorExportedKeyName); | |
50 } | |
51 | |
52 class CIFilterGenerator : NSObject, INSCoding, INSCopying | |
53 { | |
54 mixin (ObjcWrap); | |
55 | |
56 this (NSCoder aDecoder) | |
57 { | |
58 super(typeof(this).alloc.initWithCoder(aDecoder).objcObject); | |
59 } | |
60 | |
61 void encodeWithCoder (NSCoder aCoder) | |
62 { | |
63 return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder); | |
64 } | |
65 | |
66 typeof(this) initWithCoder (NSCoder aDecoder) | |
67 { | |
68 return invokeObjcSelf!(typeof(this), "initWithCoder:", NSCoder)(aDecoder); | |
69 } | |
70 | |
71 typeof(this) copyWithZone (NSZone* zone) | |
72 { | |
73 return invokeObjcSelf!(typeof(this), "copyWithZone:", NSZone*)(zone); | |
74 } | |
75 | |
76 static CIFilterGenerator filterGenerator () | |
77 { | |
78 return invokeObjcSelfClass!(CIFilterGenerator, "filterGenerator"); | |
79 } | |
80 | |
81 static CIFilterGenerator filterGeneratorWithContentsOfURL (NSURL aURL) | |
82 { | |
83 return invokeObjcSelfClass!(CIFilterGenerator, "filterGeneratorWithContentsOfURL:", NSURL)(aURL); | |
84 } | |
85 | |
86 CIFilterGenerator initWithContentsOfURL (NSURL aURL) | |
87 { | |
88 id result = invokeObjcSelf!(id, "initWithContentsOfURL:", NSURL)(aURL); | |
89 return result is this.objcObject ? this : (result !is null ? new CIFilterGenerator(result) : null); | |
90 } | |
91 | |
92 this (NSURL aURL) | |
93 { | |
94 super(CIFilterGenerator.alloc.initWithContentsOfURL(aURL).objcObject); | |
95 } | |
96 | |
97 void connectObject (Object sourceObject, NSString sourceKey, Object targetObject, NSString targetKey) | |
98 { | |
99 return invokeObjcSelf!(void, "connectObject:withKey:toObject:withKey:", Object, NSString, Object, NSString)(sourceObject, sourceKey, targetObject, targetKey); | |
100 } | |
101 | |
102 void disconnectObject (Object sourceObject, NSString key, Object targetObject, NSString targetKey) | |
103 { | |
104 return invokeObjcSelf!(void, "disconnectObject:withKey:toObject:withKey:", Object, NSString, Object, NSString)(sourceObject, key, targetObject, targetKey); | |
105 } | |
106 | |
107 void exportKey (NSString key, Object targetObject, NSString exportedKeyName) | |
108 { | |
109 return invokeObjcSelf!(void, "exportKey:fromObject:withName:", NSString, Object, NSString)(key, targetObject, exportedKeyName); | |
110 } | |
111 | |
112 void removeExportedKey (NSString exportedKeyName) | |
113 { | |
114 return invokeObjcSelf!(void, "removeExportedKey:", NSString)(exportedKeyName); | |
115 } | |
116 | |
117 NSDictionary exportedKeys () | |
118 { | |
119 return invokeObjcSelf!(NSDictionary, "exportedKeys"); | |
120 } | |
121 | |
122 void setAttributes (NSDictionary attributes, NSString key) | |
123 { | |
124 return invokeObjcSelf!(void, "setAttributes:forExportedKey:", NSDictionary, NSString)(attributes, key); | |
125 } | |
126 | |
127 NSDictionary classAttributes () | |
128 { | |
129 return invokeObjcSelf!(NSDictionary, "classAttributes"); | |
130 } | |
131 | |
132 void setClassAttributes (NSDictionary attributes) | |
133 { | |
134 return invokeObjcSelf!(void, "setClassAttributes:", NSDictionary)(attributes); | |
135 } | |
136 | |
137 CIFilter filter () | |
138 { | |
139 return invokeObjcSelf!(CIFilter, "filter"); | |
140 } | |
141 | |
142 void registerFilterName (NSString name) | |
143 { | |
144 return invokeObjcSelf!(void, "registerFilterName:", NSString)(name); | |
145 } | |
146 | |
147 bool writeToURL (NSURL aURL, bool flag) | |
148 { | |
149 return invokeObjcSelf!(bool, "writeToURL:atomically:", NSURL, bool)(aURL, flag); | |
150 } | |
151 | |
152 } | |
153 |