annotate dstep/foundation/NSAttributedString.d @ 25:b9de51448c6b

Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
author Jacob Carlborg <doob@me.com>
date Tue, 06 Apr 2010 11:37:27 +0200
parents 19885b43130e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
1 /**
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
3 * Authors: Jacob Carlborg
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
4 * Version: Initial created: Aug 3, 2009
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
6 */
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
7 module dstep.foundation.NSAttributedString;
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
8
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
9 /*import dstep.appkit.NSFileWrapper;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
10 import dstep.appkit.NSStringDrawing;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
11 import dstep.appkit.NSTextAttachment;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
12 import dstep.appkit.NSTextList;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
13 import dstep.appkit.NSTextTable;*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
14 import dstep.foundation.NSArray;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
15 import dstep.foundation.NSCoder;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
16 import dstep.foundation.NSData;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
17 import dstep.foundation.NSError;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
18 import dstep.foundation.NSDictionary;
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
19 import dstep.foundation.NSGeometry;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
20 import dstep.foundation.NSObjCRuntime;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
21 import dstep.foundation.NSObject;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
22 import dstep.foundation.NSRange;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
23 import dstep.foundation.NSString;
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
24 import dstep.foundation.NSURL;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
25 import dstep.foundation.NSZone;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
26 import dstep.objc.bridge.Bridge;
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
27 import dstep.objc.objc;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
28
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
29 const TNSExtendedAttributedString = `
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
30
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
31 NSUInteger length ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
32 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
33 return invokeObjcSelf!(NSUInteger, "length");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
34 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
35
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
36 Object attribute (NSString attrName, NSUInteger location, NSRangePointer range)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
37 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
38 return invokeObjcSelf!(Object, "attribute:atIndex:effectiveRange:", NSString, NSUInteger, NSRangePointer)(attrName, location, range);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
39 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
40
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
41 NSAttributedString attributedSubstringFromRange (NSRange range)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
42 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
43 return invokeObjcSelf!(NSAttributedString, "attributedSubstringFromRange:", NSRange)(range);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
44 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
45
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
46 NSDictionary attributesAtIndex (NSUInteger location, NSRangePointer range, NSRange rangeLimit)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
47 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
48 return invokeObjcSelf!(NSDictionary, "attributesAtIndex:longestEffectiveRange:inRange:", NSUInteger, NSRangePointer, NSRange)(location, range, rangeLimit);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
49 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
50
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
51 Object attribute (NSString attrName, NSUInteger location, NSRangePointer range, NSRange rangeLimit)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
52 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
53 return invokeObjcSelf!(Object, "attribute:atIndex:longestEffectiveRange:inRange:", NSString, NSUInteger, NSRangePointer, NSRange)(attrName, location, range, rangeLimit);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
54 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
55
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
56 bool isEqualToAttributedString (NSAttributedString other)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
57 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
58 return invokeObjcSelf!(bool, "isEqualToAttributedString:", NSAttributedString)(other);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
59 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
60
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
61 Object initWithString (NSString str)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
62 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
63 return invokeObjcSelf!(Object, "initWithString:", NSString)(str);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
64 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
65
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
66 this (NSString str)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
67 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
68 typeof(this).alloc.initWithString(str);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
69 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
70
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
71 Object initWithString (NSString str, NSDictionary attrs)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
72 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
73 return invokeObjcSelf!(Object, "initWithString:attributes:", NSString, NSDictionary)(str, attrs);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
74 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
75
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
76 this (NSString str, NSDictionary attrs)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
77 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
78 typeof(this).alloc.initWithString(str, attrs);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
79 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
80
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
81 Object initWithAttributedString (NSAttributedString attrStr)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
82 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
83 return invokeObjcSelf!(Object, "initWithAttributedString:", NSAttributedString)(attrStr);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
84 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
85
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
86 this (NSAttributedString attrStr)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
87 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
88 typeof(this).alloc.initWithAttributedString(attrStr);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
89 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
90 `;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
91
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
92 const TNSExtendedMutableAttributedString = `
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
93
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
94 NSMutableString mutableString ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
95 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
96 return invokeObjcSelf!(NSMutableString, "mutableString");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
97 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
98
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
99 void addAttribute (NSString name, Object value, NSRange range)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
100 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
101 return invokeObjcSelf!(void, "addAttribute:value:range:", NSString, Object, NSRange)(name, value, range);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
102 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
103
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
104 void addAttributes (NSDictionary attrs, NSRange range)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
105 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
106 return invokeObjcSelf!(void, "addAttributes:range:", NSDictionary, NSRange)(attrs, range);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
107 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
108
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
109 void removeAttribute (NSString name, NSRange range)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
110 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
111 return invokeObjcSelf!(void, "removeAttribute:range:", NSString, NSRange)(name, range);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
112 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
113
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
114 void replaceCharactersInRange (NSRange range, NSAttributedString attrString)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
115 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
116 return invokeObjcSelf!(void, "replaceCharactersInRange:withAttributedString:", NSRange, NSAttributedString)(range, attrString);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
117 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
118
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
119 void insertAttributedString (NSAttributedString attrString, NSUInteger loc)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
120 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
121 return invokeObjcSelf!(void, "insertAttributedString:atIndex:", NSAttributedString, NSUInteger)(attrString, loc);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
122 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
123
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
124 void appendAttributedString (NSAttributedString attrString)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
125 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
126 return invokeObjcSelf!(void, "appendAttributedString:", NSAttributedString)(attrString);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
127 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
128
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
129 void deleteCharactersInRange (NSRange range)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
130 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
131 return invokeObjcSelf!(void, "deleteCharactersInRange:", NSRange)(range);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
132 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
133
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
134 void setAttributedString (NSAttributedString attrString)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
135 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
136 return invokeObjcSelf!(void, "setAttributedString:", NSAttributedString)(attrString);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
137 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
138
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
139 void beginEditing ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
140 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
141 return invokeObjcSelf!(void, "beginEditing");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
142 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
143
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
144 void endEditing ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
145 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
146 return invokeObjcSelf!(void, "endEditing");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
147 }
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
148 `;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
149
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
150 class NSMutableAttributedString : NSAttributedString
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
151 {
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
152 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
153
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
154 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
155 {
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
156 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
157 }
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
158
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
159 this ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
160 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
161 super(typeof(this).alloc.init.objcObject);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
162 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
163
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
164 typeof(this) init ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
165 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
166 return invokeObjcSelf!(typeof(this), "init");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
167 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
168
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
169 void replaceCharactersInRange (NSRange range, NSString str)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
170 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
171 return invokeObjcSelf!(void, "replaceCharactersInRange:withString:", NSRange, NSString)(range, str);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
172 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
173
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
174 void setAttributes (NSDictionary attrs, NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
175 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
176 return invokeObjcSelf!(void, "setAttributes:range:", NSDictionary, NSRange)(attrs, range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
177 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
178
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
179 // NSExtendedMutableAttributedString
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
180 /*NSMutableString mutableString ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
181 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
182 return invokeObjcSelf!(NSMutableString, "mutableString");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
183 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
184
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
185 void addAttribute (NSString name, Object value, NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
186 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
187 return invokeObjcSelf!(void, "addAttribute:value:range:", NSString, Object, NSRange)(name, value, range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
188 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
189
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
190 void addAttributes (NSDictionary attrs, NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
191 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
192 return invokeObjcSelf!(void, "addAttributes:range:", NSDictionary, NSRange)(attrs, range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
193 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
194
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
195 void removeAttribute (NSString name, NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
196 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
197 return invokeObjcSelf!(void, "removeAttribute:range:", NSString, NSRange)(name, range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
198 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
199
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
200 void replaceCharactersInRange (NSRange range, NSAttributedString attrString)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
201 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
202 return invokeObjcSelf!(void, "replaceCharactersInRange:withAttributedString:", NSRange, NSAttributedString)(range, attrString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
203 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
204
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
205 void insertAttributedString (NSAttributedString attrString, NSUInteger loc)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
206 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
207 return invokeObjcSelf!(void, "insertAttributedString:atIndex:", NSAttributedString, NSUInteger)(attrString, loc);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
208 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
209
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
210 void appendAttributedString (NSAttributedString attrString)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
211 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
212 return invokeObjcSelf!(void, "appendAttributedString:", NSAttributedString)(attrString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
213 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
214
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
215 void deleteCharactersInRange (NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
216 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
217 return invokeObjcSelf!(void, "deleteCharactersInRange:", NSRange)(range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
218 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
219
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
220 void setAttributedString (NSAttributedString attrString)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
221 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
222 return invokeObjcSelf!(void, "setAttributedString:", NSAttributedString)(attrString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
223 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
224
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
225 /*void beginEditing ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
226 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
227 return invokeObjcSelf!(void, "beginEditing");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
228 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
229
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
230 void endEditing ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
231 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
232 return invokeObjcSelf!(void, "endEditing");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
233 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
234
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
235 // NSMutableAttributedStringKitAdditions
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
236 bool readFromURL (NSURL url, NSDictionary opts, ref NSDictionary dict, ref NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
237 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
238 id __arg2;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
239 id __arg3;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
240
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
241 if (dict)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
242 __arg2 = dict.objcObject;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
243
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
244 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
245 __arg3 = error.objcObject;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
246
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
247 bool result = invokeObjcSelf!(bool, "readFromURL:options:documentAttributes:error:", NSURL, NSDictionary, id*, id*)(url, opts, &__arg2, &__arg3);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
248
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
249 if (__arg2)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
250 dict = new NSDictionary(__arg2);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
251 if (__arg3)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
252 error = new NSError(__arg3);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
253
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
254 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
255 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
256
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
257 bool readFromData (NSData data, NSDictionary opts, ref NSDictionary dict, ref NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
258 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
259 id __arg2;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
260 id __arg3;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
261
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
262 if (dict)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
263 __arg2 = dict.objcObject;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
264
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
265 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
266 __arg3 = error.objcObject;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
267
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
268 bool result = invokeObjcSelf!(bool, "readFromData:options:documentAttributes:error:", NSData, NSDictionary, id*, id*)(data, opts, &__arg2, &__arg3);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
269
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
270 if (__arg2)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
271 dict = new NSDictionary(__arg2);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
272 if (__arg3)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
273 error = new NSError(__arg3);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
274
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
275 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
276 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
277
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
278 bool readFromURL (NSURL url, NSDictionary options, ref NSDictionary dict)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
279 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
280 id __arg2;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
281
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
282 if (dict)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
283 __arg2 = dict.objcObject;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
284
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
285 bool result = invokeObjcSelf!(bool, "readFromURL:options:documentAttributes:", NSURL, NSDictionary, id*)(url, options, &__arg2);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
286
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
287 if (__arg2)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
288 dict = new NSDictionary(__arg2);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
289
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
290 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
291 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
292
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
293 bool readFromData (NSData data, NSDictionary options, ref NSDictionary dict)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
294 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
295 id __arg2;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
296
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
297 if (dict)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
298 __arg2 = dict.objcObject;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
299
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
300 bool result = invokeObjcSelf!(bool, "readFromData:options:documentAttributes:", NSData, NSDictionary, id*)(data, options, &__arg2);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
301
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
302 if (__arg2)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
303 dict = new NSDictionary(__arg2);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
304
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
305 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
306 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
307
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
308 void superscriptRange (NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
309 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
310 return invokeObjcSelf!(void, "superscriptRange:", NSRange)(range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
311 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
312
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
313 void subscriptRange (NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
314 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
315 return invokeObjcSelf!(void, "subscriptRange:", NSRange)(range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
316 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
317
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
318 void unscriptRange (NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
319 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
320 return invokeObjcSelf!(void, "unscriptRange:", NSRange)(range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
321 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
322
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
323 void applyFontTraits (uint traitMask, NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
324 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
325 return invokeObjcSelf!(void, "applyFontTraits:range:", uint, NSRange)(traitMask, range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
326 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
327
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
328 void setAlignment (uint alignment, NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
329 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
330 return invokeObjcSelf!(void, "setAlignment:range:", uint, NSRange)(alignment, range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
331 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
332
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
333 void setBaseWritingDirection (int writingDirection, NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
334 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
335 return invokeObjcSelf!(void, "setBaseWritingDirection:range:", int, NSRange)(writingDirection, range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
336 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
337
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
338 void fixAttributesInRange (NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
339 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
340 return invokeObjcSelf!(void, "fixAttributesInRange:", NSRange)(range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
341 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
342
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
343 void fixFontAttributeInRange (NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
344 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
345 return invokeObjcSelf!(void, "fixFontAttributeInRange:", NSRange)(range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
346 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
347
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
348 void fixParagraphStyleAttributeInRange (NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
349 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
350 return invokeObjcSelf!(void, "fixParagraphStyleAttributeInRange:", NSRange)(range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
351 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
352
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
353 void fixAttachmentAttributeInRange (NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
354 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
355 return invokeObjcSelf!(void, "fixAttachmentAttributeInRange:", NSRange)(range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
356 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
357
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
358 // NSMutableAttributedStringAttachmentConveniences
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
359 void updateAttachmentsFromPath (NSString path)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
360 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
361 return invokeObjcSelf!(void, "updateAttachmentsFromPath:", NSString)(path);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
362 }
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
363 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
364
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
365 class NSAttributedString : NSObject, INSCopying, INSMutableCopying, INSCoding
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
366 {
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
367 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
368
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
369 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
370 {
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
371 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
372 }
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
373
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
374
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
375 this ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
376 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
377 super(typeof(this).alloc.init.objcObject);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
378 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
379
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
380 typeof(this) init ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
381 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
382 return invokeObjcSelf!(typeof(this), "init");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
383 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
384
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
385 NSString string ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
386 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
387 return invokeObjcSelf!(NSString, "string");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
388 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
389
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
390 NSDictionary attributesAtIndex (NSUInteger location, NSRangePointer range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
391 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
392 return invokeObjcSelf!(NSDictionary, "attributesAtIndex:effectiveRange:", NSUInteger, NSRangePointer)(location, range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
393 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
394
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
395 Object copyWithZone (NSZone* zone)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
396 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
397 return invokeObjcSelf!(Object, "copyWithZone:", NSZone*)(zone);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
398 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
399
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
400 Object mutableCopyWithZone (NSZone* zone)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
401 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
402 return invokeObjcSelf!(Object, "mutableCopyWithZone:", NSZone*)(zone);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
403 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
404
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
405 void encodeWithCoder (NSCoder aCoder)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
406 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
407 return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
408 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
409
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
410 Object initWithCoder (NSCoder aDecoder)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
411 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
412 return invokeObjcSelf!(Object, "initWithCoder:", NSCoder)(aDecoder);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
413 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
414
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
415 this (NSCoder aDecoder)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
416 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
417 typeof(this).alloc.initWithCoder(aDecoder);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
418 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
419
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
420 mixin (TNSExtendedAttributedString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
421 //mixin (TNSAttributedStringAttachmentConveniences);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
422 //mixin (dstep.appkit.NSAttributedString.TNSExtendedAttributedString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
423 //mixin (dstep.appkit.NSAttributedString.TNSDeprecatedKitAdditions);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
424 //mixin (TNSStringDrawing);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
425 //mixin (dstep.appkit.NSAttributedString.TNSAttributedStringKitAdditions);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
426 }