comparison dstep/appkit/NSAttributedString.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
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.appkit.NSAttributedString;
8
9 import dstep.appkit.AppKitDefines;
10 import dstep.appkit.NSFileWrapper;
11 import dstep.appkit.NSFontManager;
12 import dstep.appkit.NSText;
13 import dstep.appkit.NSTextList;
14 import dstep.appkit.NSTextTable;
15 import dstep.foundation.NSAttributedString;
16 import dstep.foundation.NSObjCRuntime;
17 import dstep.foundation.NSString;
18 import dstep.foundation.NSURL;
19 import dstep.objc.bridge.Bridge;
20 import dstep.objc.objc;
21
22 import bindings = dstep.appkit.NSAttributedString_bindings;
23
24 extern (C)
25 {
26 extern
27 {
28 NSUInteger NSUnderlineByWordMask;
29 NSUInteger NSUnderlineStrikethroughMask;
30 }
31 }
32
33 private
34 {
35 NSString NSFontAttributeName_;
36 NSString NSParagraphStyleAttributeName_;
37 NSString NSForegroundColorAttributeName_;
38 NSString NSUnderlineStyleAttributeName_;
39 NSString NSSuperscriptAttributeName_;
40 NSString NSBackgroundColorAttributeName_;
41 NSString NSAttachmentAttributeName_;
42 NSString NSLigatureAttributeName_;
43 NSString NSBaselineOffsetAttributeName_;
44 NSString NSKernAttributeName_;
45 NSString NSLinkAttributeName_;
46 NSString NSStrokeWidthAttributeName_;
47 NSString NSStrokeColorAttributeName_;
48 NSString NSUnderlineColorAttributeName_;
49 NSString NSStrikethroughStyleAttributeName_;
50 NSString NSStrikethroughColorAttributeName_;
51 NSString NSShadowAttributeName_;
52 NSString NSObliquenessAttributeName_;
53 NSString NSExpansionAttributeName_;
54 NSString NSCursorAttributeName_;
55 NSString NSToolTipAttributeName_;
56 NSString NSCharacterShapeAttributeName_;
57 NSString NSGlyphInfoAttributeName_;
58 NSString NSMarkedClauseSegmentAttributeName_;
59 NSString NSSpellingStateAttributeName_;
60 NSString NSPlainTextDocumentType_;
61 NSString NSRTFTextDocumentType_;
62 NSString NSRTFDTextDocumentType_;
63 NSString NSMacSimpleTextDocumentType_;
64 NSString NSHTMLTextDocumentType_;
65 NSString NSDocFormatTextDocumentType_;
66 NSString NSWordMLTextDocumentType_;
67 NSString NSWebArchiveTextDocumentType_;
68 NSString NSOfficeOpenXMLTextDocumentType_;
69 NSString NSOpenDocumentTextDocumentType_;
70 NSString NSPaperSizeDocumentAttribute_;
71 NSString NSLeftMarginDocumentAttribute_;
72 NSString NSRightMarginDocumentAttribute_;
73 NSString NSTopMarginDocumentAttribute_;
74 NSString NSBottomMarginDocumentAttribute_;
75 NSString NSViewSizeDocumentAttribute_;
76 NSString NSViewZoomDocumentAttribute_;
77 NSString NSViewModeDocumentAttribute_;
78 NSString NSDocumentTypeDocumentAttribute_;
79 NSString NSReadOnlyDocumentAttribute_;
80 NSString NSConvertedDocumentAttribute_;
81 NSString NSCocoaVersionDocumentAttribute_;
82 NSString NSBackgroundColorDocumentAttribute_;
83 NSString NSHyphenationFactorDocumentAttribute_;
84 NSString NSDefaultTabIntervalDocumentAttribute_;
85 NSString NSCharacterEncodingDocumentAttribute_;
86 NSString NSTitleDocumentAttribute_;
87 NSString NSCompanyDocumentAttribute_;
88 NSString NSCopyrightDocumentAttribute_;
89 NSString NSSubjectDocumentAttribute_;
90 NSString NSAuthorDocumentAttribute_;
91 NSString NSKeywordsDocumentAttribute_;
92 NSString NSCommentDocumentAttribute_;
93 NSString NSEditorDocumentAttribute_;
94 NSString NSCreationTimeDocumentAttribute_;
95 NSString NSModificationTimeDocumentAttribute_;
96 NSString NSExcludedElementsDocumentAttribute_;
97 NSString NSTextEncodingNameDocumentAttribute_;
98 NSString NSPrefixSpacesDocumentAttribute_;
99 NSString NSDocumentTypeDocumentOption_;
100 NSString NSDefaultAttributesDocumentOption_;
101 NSString NSCharacterEncodingDocumentOption_;
102 NSString NSTextEncodingNameDocumentOption_;
103 NSString NSBaseURLDocumentOption_;
104 NSString NSTimeoutDocumentOption_;
105 NSString NSWebPreferencesDocumentOption_;
106 NSString NSWebResourceLoadDelegateDocumentOption_;
107 NSString NSTextSizeMultiplierDocumentOption_;
108 }
109
110 NSString NSFontAttributeName ()
111 {
112 if (NSFontAttributeName_)
113 return NSFontAttributeName_;
114
115 return NSFontAttributeName_ = new NSString(bindings.NSFontAttributeName);
116 }
117
118 NSString NSParagraphStyleAttributeName ()
119 {
120 if (NSParagraphStyleAttributeName_)
121 return NSParagraphStyleAttributeName_;
122
123 return NSParagraphStyleAttributeName_ = new NSString(bindings.NSParagraphStyleAttributeName);
124 }
125
126 NSString NSForegroundColorAttributeName ()
127 {
128 if (NSForegroundColorAttributeName_)
129 return NSForegroundColorAttributeName_;
130
131 return NSForegroundColorAttributeName_ = new NSString(bindings.NSForegroundColorAttributeName);
132 }
133
134 NSString NSUnderlineStyleAttributeName ()
135 {
136 if (NSUnderlineStyleAttributeName_)
137 return NSUnderlineStyleAttributeName_;
138
139 return NSUnderlineStyleAttributeName_ = new NSString(bindings.NSUnderlineStyleAttributeName);
140 }
141
142 NSString NSSuperscriptAttributeName ()
143 {
144 if (NSSuperscriptAttributeName_)
145 return NSSuperscriptAttributeName_;
146
147 return NSSuperscriptAttributeName_ = new NSString(bindings.NSSuperscriptAttributeName);
148 }
149
150 NSString NSBackgroundColorAttributeName ()
151 {
152 if (NSBackgroundColorAttributeName_)
153 return NSBackgroundColorAttributeName_;
154
155 return NSBackgroundColorAttributeName_ = new NSString(bindings.NSBackgroundColorAttributeName);
156 }
157
158 NSString NSAttachmentAttributeName ()
159 {
160 if (NSAttachmentAttributeName_)
161 return NSAttachmentAttributeName_;
162
163 return NSAttachmentAttributeName_ = new NSString(bindings.NSAttachmentAttributeName);
164 }
165
166 NSString NSLigatureAttributeName ()
167 {
168 if (NSLigatureAttributeName_)
169 return NSLigatureAttributeName_;
170
171 return NSLigatureAttributeName_ = new NSString(bindings.NSLigatureAttributeName);
172 }
173
174 NSString NSBaselineOffsetAttributeName ()
175 {
176 if (NSBaselineOffsetAttributeName_)
177 return NSBaselineOffsetAttributeName_;
178
179 return NSBaselineOffsetAttributeName_ = new NSString(bindings.NSBaselineOffsetAttributeName);
180 }
181
182 NSString NSKernAttributeName ()
183 {
184 if (NSKernAttributeName_)
185 return NSKernAttributeName_;
186
187 return NSKernAttributeName_ = new NSString(bindings.NSKernAttributeName);
188 }
189
190 NSString NSLinkAttributeName ()
191 {
192 if (NSLinkAttributeName_)
193 return NSLinkAttributeName_;
194
195 return NSLinkAttributeName_ = new NSString(bindings.NSLinkAttributeName);
196 }
197
198 NSString NSStrokeWidthAttributeName ()
199 {
200 if (NSStrokeWidthAttributeName_)
201 return NSStrokeWidthAttributeName_;
202
203 return NSStrokeWidthAttributeName_ = new NSString(bindings.NSStrokeWidthAttributeName);
204 }
205
206 NSString NSStrokeColorAttributeName ()
207 {
208 if (NSStrokeColorAttributeName_)
209 return NSStrokeColorAttributeName_;
210
211 return NSStrokeColorAttributeName_ = new NSString(bindings.NSStrokeColorAttributeName);
212 }
213
214 NSString NSUnderlineColorAttributeName ()
215 {
216 if (NSUnderlineColorAttributeName_)
217 return NSUnderlineColorAttributeName_;
218
219 return NSUnderlineColorAttributeName_ = new NSString(bindings.NSUnderlineColorAttributeName);
220 }
221
222 NSString NSStrikethroughStyleAttributeName ()
223 {
224 if (NSStrikethroughStyleAttributeName_)
225 return NSStrikethroughStyleAttributeName_;
226
227 return NSStrikethroughStyleAttributeName_ = new NSString(bindings.NSStrikethroughStyleAttributeName);
228 }
229
230 NSString NSStrikethroughColorAttributeName ()
231 {
232 if (NSStrikethroughColorAttributeName_)
233 return NSStrikethroughColorAttributeName_;
234
235 return NSStrikethroughColorAttributeName_ = new NSString(bindings.NSStrikethroughColorAttributeName);
236 }
237
238 NSString NSShadowAttributeName ()
239 {
240 if (NSShadowAttributeName_)
241 return NSShadowAttributeName_;
242
243 return NSShadowAttributeName_ = new NSString(bindings.NSShadowAttributeName);
244 }
245
246 NSString NSObliquenessAttributeName ()
247 {
248 if (NSObliquenessAttributeName_)
249 return NSObliquenessAttributeName_;
250
251 return NSObliquenessAttributeName_ = new NSString(bindings.NSObliquenessAttributeName);
252 }
253
254 NSString NSExpansionAttributeName ()
255 {
256 if (NSExpansionAttributeName_)
257 return NSExpansionAttributeName_;
258
259 return NSExpansionAttributeName_ = new NSString(bindings.NSExpansionAttributeName);
260 }
261
262 NSString NSCursorAttributeName ()
263 {
264 if (NSCursorAttributeName_)
265 return NSCursorAttributeName_;
266
267 return NSCursorAttributeName_ = new NSString(bindings.NSCursorAttributeName);
268 }
269
270 NSString NSToolTipAttributeName ()
271 {
272 if (NSToolTipAttributeName_)
273 return NSToolTipAttributeName_;
274
275 return NSToolTipAttributeName_ = new NSString(bindings.NSToolTipAttributeName);
276 }
277
278 NSString NSCharacterShapeAttributeName ()
279 {
280 if (NSCharacterShapeAttributeName_)
281 return NSCharacterShapeAttributeName_;
282
283 return NSCharacterShapeAttributeName_ = new NSString(bindings.NSCharacterShapeAttributeName);
284 }
285
286 NSString NSGlyphInfoAttributeName ()
287 {
288 if (NSGlyphInfoAttributeName_)
289 return NSGlyphInfoAttributeName_;
290
291 return NSGlyphInfoAttributeName_ = new NSString(bindings.NSGlyphInfoAttributeName);
292 }
293
294 NSString NSMarkedClauseSegmentAttributeName ()
295 {
296 if (NSMarkedClauseSegmentAttributeName_)
297 return NSMarkedClauseSegmentAttributeName_;
298
299 return NSMarkedClauseSegmentAttributeName_ = new NSString(bindings.NSMarkedClauseSegmentAttributeName);
300 }
301
302 NSString NSSpellingStateAttributeName ()
303 {
304 if (NSSpellingStateAttributeName_)
305 return NSSpellingStateAttributeName_;
306
307 return NSSpellingStateAttributeName_ = new NSString(bindings.NSSpellingStateAttributeName);
308 }
309
310 NSString NSPlainTextDocumentType ()
311 {
312 if (NSPlainTextDocumentType_)
313 return NSPlainTextDocumentType_;
314
315 return NSPlainTextDocumentType_ = new NSString(bindings.NSPlainTextDocumentType);
316 }
317
318 NSString NSRTFTextDocumentType ()
319 {
320 if (NSRTFTextDocumentType_)
321 return NSRTFTextDocumentType_;
322
323 return NSRTFTextDocumentType_ = new NSString(bindings.NSRTFTextDocumentType);
324 }
325
326 NSString NSRTFDTextDocumentType ()
327 {
328 if (NSRTFDTextDocumentType_)
329 return NSRTFDTextDocumentType_;
330
331 return NSRTFDTextDocumentType_ = new NSString(bindings.NSRTFDTextDocumentType);
332 }
333
334 NSString NSMacSimpleTextDocumentType ()
335 {
336 if (NSMacSimpleTextDocumentType_)
337 return NSMacSimpleTextDocumentType_;
338
339 return NSMacSimpleTextDocumentType_ = new NSString(bindings.NSMacSimpleTextDocumentType);
340 }
341
342 NSString NSHTMLTextDocumentType ()
343 {
344 if (NSHTMLTextDocumentType_)
345 return NSHTMLTextDocumentType_;
346
347 return NSHTMLTextDocumentType_ = new NSString(bindings.NSHTMLTextDocumentType);
348 }
349
350 NSString NSDocFormatTextDocumentType ()
351 {
352 if (NSDocFormatTextDocumentType_)
353 return NSDocFormatTextDocumentType_;
354
355 return NSDocFormatTextDocumentType_ = new NSString(bindings.NSDocFormatTextDocumentType);
356 }
357
358 NSString NSWordMLTextDocumentType ()
359 {
360 if (NSWordMLTextDocumentType_)
361 return NSWordMLTextDocumentType_;
362
363 return NSWordMLTextDocumentType_ = new NSString(bindings.NSWordMLTextDocumentType);
364 }
365
366 NSString NSWebArchiveTextDocumentType ()
367 {
368 if (NSWebArchiveTextDocumentType_)
369 return NSWebArchiveTextDocumentType_;
370
371 return NSWebArchiveTextDocumentType_ = new NSString(bindings.NSWebArchiveTextDocumentType);
372 }
373
374 NSString NSOfficeOpenXMLTextDocumentType ()
375 {
376 if (NSOfficeOpenXMLTextDocumentType_)
377 return NSOfficeOpenXMLTextDocumentType_;
378
379 return NSOfficeOpenXMLTextDocumentType_ = new NSString(bindings.NSOfficeOpenXMLTextDocumentType);
380 }
381
382 NSString NSOpenDocumentTextDocumentType ()
383 {
384 if (NSOpenDocumentTextDocumentType_)
385 return NSOpenDocumentTextDocumentType_;
386
387 return NSOpenDocumentTextDocumentType_ = new NSString(bindings.NSOpenDocumentTextDocumentType);
388 }
389
390 NSString NSPaperSizeDocumentAttribute ()
391 {
392 if (NSPaperSizeDocumentAttribute_)
393 return NSPaperSizeDocumentAttribute_;
394
395 return NSPaperSizeDocumentAttribute_ = new NSString(bindings.NSPaperSizeDocumentAttribute);
396 }
397
398 NSString NSLeftMarginDocumentAttribute ()
399 {
400 if (NSLeftMarginDocumentAttribute_)
401 return NSLeftMarginDocumentAttribute_;
402
403 return NSLeftMarginDocumentAttribute_ = new NSString(bindings.NSLeftMarginDocumentAttribute);
404 }
405
406 NSString NSRightMarginDocumentAttribute ()
407 {
408 if (NSRightMarginDocumentAttribute_)
409 return NSRightMarginDocumentAttribute_;
410
411 return NSRightMarginDocumentAttribute_ = new NSString(bindings.NSRightMarginDocumentAttribute);
412 }
413
414 NSString NSTopMarginDocumentAttribute ()
415 {
416 if (NSTopMarginDocumentAttribute_)
417 return NSTopMarginDocumentAttribute_;
418
419 return NSTopMarginDocumentAttribute_ = new NSString(bindings.NSTopMarginDocumentAttribute);
420 }
421
422 NSString NSBottomMarginDocumentAttribute ()
423 {
424 if (NSBottomMarginDocumentAttribute_)
425 return NSBottomMarginDocumentAttribute_;
426
427 return NSBottomMarginDocumentAttribute_ = new NSString(bindings.NSBottomMarginDocumentAttribute);
428 }
429
430 NSString NSViewSizeDocumentAttribute ()
431 {
432 if (NSViewSizeDocumentAttribute_)
433 return NSViewSizeDocumentAttribute_;
434
435 return NSViewSizeDocumentAttribute_ = new NSString(bindings.NSViewSizeDocumentAttribute);
436 }
437
438 NSString NSViewZoomDocumentAttribute ()
439 {
440 if (NSViewZoomDocumentAttribute_)
441 return NSViewZoomDocumentAttribute_;
442
443 return NSViewZoomDocumentAttribute_ = new NSString(bindings.NSViewZoomDocumentAttribute);
444 }
445
446 NSString NSViewModeDocumentAttribute ()
447 {
448 if (NSViewModeDocumentAttribute_)
449 return NSViewModeDocumentAttribute_;
450
451 return NSViewModeDocumentAttribute_ = new NSString(bindings.NSViewModeDocumentAttribute);
452 }
453
454 NSString NSDocumentTypeDocumentAttribute ()
455 {
456 if (NSDocumentTypeDocumentAttribute_)
457 return NSDocumentTypeDocumentAttribute_;
458
459 return NSDocumentTypeDocumentAttribute_ = new NSString(bindings.NSDocumentTypeDocumentAttribute);
460 }
461
462 NSString NSReadOnlyDocumentAttribute ()
463 {
464 if (NSReadOnlyDocumentAttribute_)
465 return NSReadOnlyDocumentAttribute_;
466
467 return NSReadOnlyDocumentAttribute_ = new NSString(bindings.NSReadOnlyDocumentAttribute);
468 }
469
470 NSString NSConvertedDocumentAttribute ()
471 {
472 if (NSConvertedDocumentAttribute_)
473 return NSConvertedDocumentAttribute_;
474
475 return NSConvertedDocumentAttribute_ = new NSString(bindings.NSConvertedDocumentAttribute);
476 }
477
478 NSString NSCocoaVersionDocumentAttribute ()
479 {
480 if (NSCocoaVersionDocumentAttribute_)
481 return NSCocoaVersionDocumentAttribute_;
482
483 return NSCocoaVersionDocumentAttribute_ = new NSString(bindings.NSCocoaVersionDocumentAttribute);
484 }
485
486 NSString NSBackgroundColorDocumentAttribute ()
487 {
488 if (NSBackgroundColorDocumentAttribute_)
489 return NSBackgroundColorDocumentAttribute_;
490
491 return NSBackgroundColorDocumentAttribute_ = new NSString(bindings.NSBackgroundColorDocumentAttribute);
492 }
493
494 NSString NSHyphenationFactorDocumentAttribute ()
495 {
496 if (NSHyphenationFactorDocumentAttribute_)
497 return NSHyphenationFactorDocumentAttribute_;
498
499 return NSHyphenationFactorDocumentAttribute_ = new NSString(bindings.NSHyphenationFactorDocumentAttribute);
500 }
501
502 NSString NSDefaultTabIntervalDocumentAttribute ()
503 {
504 if (NSDefaultTabIntervalDocumentAttribute_)
505 return NSDefaultTabIntervalDocumentAttribute_;
506
507 return NSDefaultTabIntervalDocumentAttribute_ = new NSString(bindings.NSDefaultTabIntervalDocumentAttribute);
508 }
509
510 NSString NSCharacterEncodingDocumentAttribute ()
511 {
512 if (NSCharacterEncodingDocumentAttribute_)
513 return NSCharacterEncodingDocumentAttribute_;
514
515 return NSCharacterEncodingDocumentAttribute_ = new NSString(bindings.NSCharacterEncodingDocumentAttribute);
516 }
517
518 NSString NSTitleDocumentAttribute ()
519 {
520 if (NSTitleDocumentAttribute_)
521 return NSTitleDocumentAttribute_;
522
523 return NSTitleDocumentAttribute_ = new NSString(bindings.NSTitleDocumentAttribute);
524 }
525
526 NSString NSCompanyDocumentAttribute ()
527 {
528 if (NSCompanyDocumentAttribute_)
529 return NSCompanyDocumentAttribute_;
530
531 return NSCompanyDocumentAttribute_ = new NSString(bindings.NSCompanyDocumentAttribute);
532 }
533
534 NSString NSCopyrightDocumentAttribute ()
535 {
536 if (NSCopyrightDocumentAttribute_)
537 return NSCopyrightDocumentAttribute_;
538
539 return NSCopyrightDocumentAttribute_ = new NSString(bindings.NSCopyrightDocumentAttribute);
540 }
541
542 NSString NSSubjectDocumentAttribute ()
543 {
544 if (NSSubjectDocumentAttribute_)
545 return NSSubjectDocumentAttribute_;
546
547 return NSSubjectDocumentAttribute_ = new NSString(bindings.NSSubjectDocumentAttribute);
548 }
549
550 NSString NSAuthorDocumentAttribute ()
551 {
552 if (NSAuthorDocumentAttribute_)
553 return NSAuthorDocumentAttribute_;
554
555 return NSAuthorDocumentAttribute_ = new NSString(bindings.NSAuthorDocumentAttribute);
556 }
557
558 NSString NSKeywordsDocumentAttribute ()
559 {
560 if (NSKeywordsDocumentAttribute_)
561 return NSKeywordsDocumentAttribute_;
562
563 return NSKeywordsDocumentAttribute_ = new NSString(bindings.NSKeywordsDocumentAttribute);
564 }
565
566 NSString NSCommentDocumentAttribute ()
567 {
568 if (NSCommentDocumentAttribute_)
569 return NSCommentDocumentAttribute_;
570
571 return NSCommentDocumentAttribute_ = new NSString(bindings.NSCommentDocumentAttribute);
572 }
573
574 NSString NSEditorDocumentAttribute ()
575 {
576 if (NSEditorDocumentAttribute_)
577 return NSEditorDocumentAttribute_;
578
579 return NSEditorDocumentAttribute_ = new NSString(bindings.NSEditorDocumentAttribute);
580 }
581
582 NSString NSCreationTimeDocumentAttribute ()
583 {
584 if (NSCreationTimeDocumentAttribute_)
585 return NSCreationTimeDocumentAttribute_;
586
587 return NSCreationTimeDocumentAttribute_ = new NSString(bindings.NSCreationTimeDocumentAttribute);
588 }
589
590 NSString NSModificationTimeDocumentAttribute ()
591 {
592 if (NSModificationTimeDocumentAttribute_)
593 return NSModificationTimeDocumentAttribute_;
594
595 return NSModificationTimeDocumentAttribute_ = new NSString(bindings.NSModificationTimeDocumentAttribute);
596 }
597
598 NSString NSExcludedElementsDocumentAttribute ()
599 {
600 if (NSExcludedElementsDocumentAttribute_)
601 return NSExcludedElementsDocumentAttribute_;
602
603 return NSExcludedElementsDocumentAttribute_ = new NSString(bindings.NSExcludedElementsDocumentAttribute);
604 }
605
606 NSString NSTextEncodingNameDocumentAttribute ()
607 {
608 if (NSTextEncodingNameDocumentAttribute_)
609 return NSTextEncodingNameDocumentAttribute_;
610
611 return NSTextEncodingNameDocumentAttribute_ = new NSString(bindings.NSTextEncodingNameDocumentAttribute);
612 }
613
614 NSString NSPrefixSpacesDocumentAttribute ()
615 {
616 if (NSPrefixSpacesDocumentAttribute_)
617 return NSPrefixSpacesDocumentAttribute_;
618
619 return NSPrefixSpacesDocumentAttribute_ = new NSString(bindings.NSPrefixSpacesDocumentAttribute);
620 }
621
622 NSString NSDocumentTypeDocumentOption ()
623 {
624 if (NSDocumentTypeDocumentOption_)
625 return NSDocumentTypeDocumentOption_;
626
627 return NSDocumentTypeDocumentOption_ = new NSString(bindings.NSDocumentTypeDocumentOption);
628 }
629
630 NSString NSDefaultAttributesDocumentOption ()
631 {
632 if (NSDefaultAttributesDocumentOption_)
633 return NSDefaultAttributesDocumentOption_;
634
635 return NSDefaultAttributesDocumentOption_ = new NSString(bindings.NSDefaultAttributesDocumentOption);
636 }
637
638 NSString NSCharacterEncodingDocumentOption ()
639 {
640 if (NSCharacterEncodingDocumentOption_)
641 return NSCharacterEncodingDocumentOption_;
642
643 return NSCharacterEncodingDocumentOption_ = new NSString(bindings.NSCharacterEncodingDocumentOption);
644 }
645
646 NSString NSTextEncodingNameDocumentOption ()
647 {
648 if (NSTextEncodingNameDocumentOption_)
649 return NSTextEncodingNameDocumentOption_;
650
651 return NSTextEncodingNameDocumentOption_ = new NSString(bindings.NSTextEncodingNameDocumentOption);
652 }
653
654 NSString NSBaseURLDocumentOption ()
655 {
656 if (NSBaseURLDocumentOption_)
657 return NSBaseURLDocumentOption_;
658
659 return NSBaseURLDocumentOption_ = new NSString(bindings.NSBaseURLDocumentOption);
660 }
661
662 NSString NSTimeoutDocumentOption ()
663 {
664 if (NSTimeoutDocumentOption_)
665 return NSTimeoutDocumentOption_;
666
667 return NSTimeoutDocumentOption_ = new NSString(bindings.NSTimeoutDocumentOption);
668 }
669
670 NSString NSWebPreferencesDocumentOption ()
671 {
672 if (NSWebPreferencesDocumentOption_)
673 return NSWebPreferencesDocumentOption_;
674
675 return NSWebPreferencesDocumentOption_ = new NSString(bindings.NSWebPreferencesDocumentOption);
676 }
677
678 NSString NSWebResourceLoadDelegateDocumentOption ()
679 {
680 if (NSWebResourceLoadDelegateDocumentOption_)
681 return NSWebResourceLoadDelegateDocumentOption_;
682
683 return NSWebResourceLoadDelegateDocumentOption_ = new NSString(bindings.NSWebResourceLoadDelegateDocumentOption);
684 }
685
686 NSString NSTextSizeMultiplierDocumentOption ()
687 {
688 if (NSTextSizeMultiplierDocumentOption_)
689 return NSTextSizeMultiplierDocumentOption_;
690
691 return NSTextSizeMultiplierDocumentOption_ = new NSString(bindings.NSTextSizeMultiplierDocumentOption);
692 }
693
694 enum
695 {
696 NSUnderlineStyleNone = 0x00,
697 NSUnderlineStyleSingle = 0x01,
698 NSUnderlineStyleThick = 0x02,
699 NSUnderlineStyleDouble = 0x09
700 }
701
702 enum
703 {
704 NSUnderlinePatternSolid = 0x0000,
705 NSUnderlinePatternDot = 0x0100,
706 NSUnderlinePatternDash = 0x0200,
707 NSUnderlinePatternDashDot = 0x0300,
708 NSUnderlinePatternDashDotDot = 0x0400
709 }
710
711 enum
712 {
713 NSSpellingStateSpellingFlag = (1 << 0),
714 NSSpellingStateGrammarFlag = (1 << 1)
715 }
716
717 enum
718 {
719 NSNoUnderlineStyle = 0,
720 NSSingleUnderlineStyle
721 }
722
723 const TNSMutableAttributedStringKitAdditions = `
724
725 bool readFromURL (NSURL url, NSDictionary opts, ref NSDictionary dict, ref NSError error)
726 {
727 id __arg2;
728 id __arg3;
729
730 if (dict)
731 __arg2 = dict.objcObject;
732
733 if (error)
734 __arg3 = error.objcObject;
735
736 bool result = invokeObjcSelf!(bool, "readFromURL:options:documentAttributes:error:", NSURL, NSDictionary, id*, id*)(url, opts, &__arg2, &__arg3);
737
738 if (__arg2)
739 dict = new NSDictionary(__arg2);
740 if (__arg3)
741 error = new NSError(__arg3);
742
743 return result;
744 }
745
746 bool readFromData (NSData data, NSDictionary opts, ref NSDictionary dict, ref NSError error)
747 {
748 id __arg2;
749 id __arg3;
750
751 if (dict)
752 __arg2 = dict.objcObject;
753
754 if (error)
755 __arg3 = error.objcObject;
756
757 bool result = invokeObjcSelf!(bool, "readFromData:options:documentAttributes:error:", NSData, NSDictionary, id*, id*)(data, opts, &__arg2, &__arg3);
758
759 if (__arg2)
760 dict = new NSDictionary(__arg2);
761 if (__arg3)
762 error = new NSError(__arg3);
763
764 return result;
765 }
766
767 bool readFromURL (NSURL url, NSDictionary options, ref NSDictionary dict)
768 {
769 id __arg2;
770
771 if (dict)
772 __arg2 = dict.objcObject;
773
774 bool result = invokeObjcSelf!(bool, "readFromURL:options:documentAttributes:", NSURL, NSDictionary, id*)(url, options, &__arg2);
775
776 if (__arg2)
777 dict = new NSDictionary(__arg2);
778
779 return result;
780 }
781
782 bool readFromData (NSData data, NSDictionary options, ref NSDictionary dict)
783 {
784 id __arg2;
785
786 if (dict)
787 __arg2 = dict.objcObject;
788
789 bool result = invokeObjcSelf!(bool, "readFromData:options:documentAttributes:", NSData, NSDictionary, id*)(data, options, &__arg2);
790
791 if (__arg2)
792 dict = new NSDictionary(__arg2);
793
794 return result;
795 }
796
797 void superscriptRange (NSRange range)
798 {
799 return invokeObjcSelf!(void, "superscriptRange:", NSRange)(range);
800 }
801
802 void subscriptRange (NSRange range)
803 {
804 return invokeObjcSelf!(void, "subscriptRange:", NSRange)(range);
805 }
806
807 void unscriptRange (NSRange range)
808 {
809 return invokeObjcSelf!(void, "unscriptRange:", NSRange)(range);
810 }
811
812 void applyFontTraits (uint traitMask, NSRange range)
813 {
814 return invokeObjcSelf!(void, "applyFontTraits:range:", uint, NSRange)(traitMask, range);
815 }
816
817 void setAlignment (uint alignment, NSRange range)
818 {
819 return invokeObjcSelf!(void, "setAlignment:range:", uint, NSRange)(alignment, range);
820 }
821
822 void setBaseWritingDirection (int writingDirection, NSRange range)
823 {
824 return invokeObjcSelf!(void, "setBaseWritingDirection:range:", int, NSRange)(writingDirection, range);
825 }
826
827 void fixAttributesInRange (NSRange range)
828 {
829 return invokeObjcSelf!(void, "fixAttributesInRange:", NSRange)(range);
830 }
831
832 void fixFontAttributeInRange (NSRange range)
833 {
834 return invokeObjcSelf!(void, "fixFontAttributeInRange:", NSRange)(range);
835 }
836
837 void fixParagraphStyleAttributeInRange (NSRange range)
838 {
839 return invokeObjcSelf!(void, "fixParagraphStyleAttributeInRange:", NSRange)(range);
840 }
841
842 void fixAttachmentAttributeInRange (NSRange range)
843 {
844 return invokeObjcSelf!(void, "fixAttachmentAttributeInRange:", NSRange)(range);
845 }
846
847 ////mixin ObjcBindMethod!(readFromURL, bool, "readFromURL:options:documentAttributes:error:", NSURL, NSDictionary, ref NSDictionary, ref NSError);
848 ////mixin ObjcBindMethod!(readFromData, bool, "readFromData:options:documentAttributes:error:", NSData, NSDictionary, ref NSDictionary, ref NSError);
849 ////mixin ObjcBindMethod!(readFromURL, bool, "readFromURL:options:documentAttributes:", NSURL, NSDictionary, ref NSDictionary, ref NSError);
850 ////mixin ObjcBindMethod!(readFromData, bool, "readFromData:options:documentAttributes:", NSData, NSDictionary, ref NSDictionary, ref NSError);
851 //mixin ObjcBindMethod!(superscriptRange, "superscriptRange:");
852 //mixin ObjcBindMethod!(subscriptRange, "subscriptRange:");
853 //mixin ObjcBindMethod!(unscriptRange, "unscriptRange:");
854 //mixin ObjcBindMethod!(applyFontTraits, "applyFontTraits:range:");
855 //mixin ObjcBindMethod!(setAlignment, "setAlignment:range:");
856 //mixin ObjcBindMethod!(setBaseWritingDirection, "setBaseWritingDirection:range:");
857 //mixin ObjcBindMethod!(fixAttributesInRange, "fixAttributesInRange:");
858 //mixin ObjcBindMethod!(fixFontAttributeInRange, "fixFontAttributeInRange:");
859 //mixin ObjcBindMethod!(fixParagraphStyleAttributeInRange, "fixParagraphStyleAttributeInRange:");
860 //mixin ObjcBindMethod!(fixAttachmentAttributeInRange, "fixAttachmentAttributeInRange:");
861
862 `;
863
864 const TNSExtendedAttributedString = `
865
866 //import dstep.appkit.NSAttributedString;
867
868 Object attribute (NSString attrName, NSUInteger location, NSRangePointer range)
869 {
870 return invokeObjcSelf!(Object, "attribute:atIndex:effectiveRange:", NSString, NSUInteger, NSRangePointer)(attrName, location, range);
871 }
872
873 NSAttributedString attributedSubstringFromRange (NSRange range)
874 {
875 return invokeObjcSelf!(NSAttributedString, "attributedSubstringFromRange:", NSRange)(range);
876 }
877
878 NSDictionary attributesAtIndex (NSUInteger location, NSRangePointer range, NSRange rangeLimit)
879 {
880 return invokeObjcSelf!(NSDictionary, "attributesAtIndex:longestEffectiveRange:inRange:", NSUInteger, NSRangePointer, NSRange)(location, range, rangeLimit);
881 }
882
883 Object attribute (NSString attrName, NSUInteger location, NSRangePointer range, NSRange rangeLimit)
884 {
885 return invokeObjcSelf!(Object, "attribute:atIndex:longestEffectiveRange:inRange:", NSString, NSUInteger, NSRangePointer, NSRange)(attrName, location, range, rangeLimit);
886 }
887
888 bool isEqualToAttributedString (NSAttributedString other)
889 {
890 return invokeObjcSelf!(bool, "isEqualToAttributedString:", NSAttributedString)(other);
891 }
892
893 //mixin ObjcBindMethod!(attribute, "attribute:atIndex:effectiveRange:");
894 //mixin ObjcBindMethod!(attributedSubstringFromRange, "attributedSubstringFromRange:");
895 //mixin ObjcBindMethod!(attributesAtIndex, "attributesAtIndex:longestEffectiveRange:inRange:");
896 //mixin ObjcBindMethod!(attribute, "attribute:atIndex:longestEffectiveRange:inRange:");
897 //mixin ObjcBindMethod!(isEqualToAttributedString, "isEqualToAttributedString:");
898 //mixin ObjcBindMethod!(initWithString, "initWithString:");
899 //mixin ObjcBindMethod!(initWithString, "initWithString:attributes:");
900 //mixin ObjcBindMethod!(initWithAttributedString, "initWithAttributedString:");
901
902 `;
903
904 const TNSDeprecatedKitAdditions = `
905
906 static NSArray textFileTypes ()
907 {
908 return invokeObjcSelfClass!(NSArray, "textFileTypes");
909 }
910
911 static NSArray textPasteboardTypes ()
912 {
913 return invokeObjcSelfClass!(NSArray, "textPasteboardTypes");
914 }
915
916 static NSArray textUnfilteredFileTypes ()
917 {
918 return invokeObjcSelfClass!(NSArray, "textUnfilteredFileTypes");
919 }
920
921 static NSArray textUnfilteredPasteboardTypes ()
922 {
923 return invokeObjcSelfClass!(NSArray, "textUnfilteredPasteboardTypes");
924 }
925
926 //mixin ObjcBindClassMethod!(textFileTypes, "textFileTypes");
927 //mixin ObjcBindClassMethod!(textPasteboardTypes, "textPasteboardTypes");
928 //mixin ObjcBindClassMethod!(textUnfilteredFileTypes, "textUnfilteredFileTypes");
929 //mixin ObjcBindClassMethod!(textUnfilteredPasteboardTypes, "textUnfilteredPasteboardTypes");
930
931 `;
932
933 const TNSAttributedStringKitAdditions = `
934
935 /*import dstep.appkit.NSFileWrapper;
936 import dstep.appkit.NSTextList;
937 import dstep.appkit.NSTextTable;*/
938
939 NSDictionary fontAttributesInRange (NSRange range)
940 {
941 return invokeObjcSelf!(NSDictionary, "fontAttributesInRange:", NSRange)(range);
942 }
943
944 NSDictionary rulerAttributesInRange (NSRange range)
945 {
946 return invokeObjcSelf!(NSDictionary, "rulerAttributesInRange:", NSRange)(range);
947 }
948
949 bool containsAttachments ()
950 {
951 return invokeObjcSelf!(bool, "containsAttachments");
952 }
953
954 NSUInteger lineBreakBeforeIndex (NSUInteger location, NSRange aRange)
955 {
956 return invokeObjcSelf!(NSUInteger, "lineBreakBeforeIndex:withinRange:", NSUInteger, NSRange)(location, aRange);
957 }
958
959 NSUInteger lineBreakByHyphenatingBeforeIndex (NSUInteger location, NSRange aRange)
960 {
961 return invokeObjcSelf!(NSUInteger, "lineBreakByHyphenatingBeforeIndex:withinRange:", NSUInteger, NSRange)(location, aRange);
962 }
963
964 NSRange doubleClickAtIndex (NSUInteger location)
965 {
966 return invokeObjcSelf!(NSRange, "doubleClickAtIndex:", NSUInteger)(location);
967 }
968
969 NSUInteger nextWordFromIndex (NSUInteger location, bool isForward)
970 {
971 return invokeObjcSelf!(NSUInteger, "nextWordFromIndex:forward:", NSUInteger, bool)(location, isForward);
972 }
973
974 NSURL URLAtIndex (NSUInteger location, NSRangePointer effectiveRange)
975 {
976 return invokeObjcSelf!(NSURL, "URLAtIndex:effectiveRange:", NSUInteger, NSRangePointer)(location, effectiveRange);
977 }
978
979 static NSArray textTypes ()
980 {
981 return invokeObjcSelfClass!(NSArray, "textTypes");
982 }
983
984 static NSArray textUnfilteredTypes ()
985 {
986 return invokeObjcSelfClass!(NSArray, "textUnfilteredTypes");
987 }
988
989 NSRange rangeOfTextBlock (NSTextBlock block, NSUInteger location)
990 {
991 return invokeObjcSelf!(NSRange, "rangeOfTextBlock:atIndex:", NSTextBlock, NSUInteger)(block, location);
992 }
993
994 NSRange rangeOfTextTable (NSTextTable table, NSUInteger location)
995 {
996 return invokeObjcSelf!(NSRange, "rangeOfTextTable:atIndex:", NSTextTable, NSUInteger)(table, location);
997 }
998
999 NSRange rangeOfTextList (NSTextList list, NSUInteger location)
1000 {
1001 return invokeObjcSelf!(NSRange, "rangeOfTextList:atIndex:", NSTextList, NSUInteger)(list, location);
1002 }
1003
1004 NSInteger itemNumberInTextList (NSTextList list, NSUInteger location)
1005 {
1006 return invokeObjcSelf!(NSInteger, "itemNumberInTextList:atIndex:", NSTextList, NSUInteger)(list, location);
1007 }
1008
1009 typeof(this) initWithURL (NSURL url, NSDictionary options, ref NSDictionary dict, ref NSError error)
1010 {
1011 id __arg2;
1012 id __arg3;
1013
1014 if (dict)
1015 __arg2 = dict.objcObject;
1016
1017 if (error)
1018 __arg3 = error.objcObject;
1019
1020 id result = invokeObjcSelf!(id, "initWithURL:options:documentAttributes:error:", NSURL, NSDictionary, id*, id*)(url, options, &__arg2, &__arg3);
1021
1022 if (__arg2)
1023 dict = new NSDictionary(__arg2);
1024 if (__arg3)
1025 error = new NSError(__arg3);
1026
1027 return result is this.objcObject ? this : (result !is null ? new typeof(this)(result) : null);
1028 }
1029
1030 this (NSURL url, NSDictionary options, ref NSDictionary dict, ref NSError error)
1031 {
1032 super(typeof(this).alloc.initWithURL(url, options, dict, error).objcObject);
1033 }
1034
1035 typeof(this) initWithData (NSData data, NSDictionary options, ref NSDictionary dict, ref NSError error)
1036 {
1037 id __arg2;
1038 id __arg3;
1039
1040 if (dict)
1041 __arg2 = dict.objcObject;
1042
1043 if (error)
1044 __arg3 = error.objcObject;
1045
1046 id result = invokeObjcSelf!(id, "initWithData:options:documentAttributes:error:", NSData, NSDictionary, id*, id*)(data, options, &__arg2, &__arg3);
1047
1048 if (__arg2)
1049 dict = new NSDictionary(__arg2);
1050 if (__arg3)
1051 error = new NSError(__arg3);
1052
1053 return result is this.objcObject ? this : (result !is null ? new typeof(this)(result) : null);
1054 }
1055
1056 this (NSData data, NSDictionary options, ref NSDictionary dict, ref NSError error)
1057 {
1058 super(typeof(this).alloc.initWithData(data, options, dict, error).objcObject);
1059 }
1060
1061 typeof(this) initWithPath (NSString path, ref NSDictionary dict)
1062 {
1063 id __arg1;
1064
1065 if (dict)
1066 __arg1 = dict.objcObject;
1067
1068 id result = invokeObjcSelf!(id, "initWithPath:documentAttributes:", NSString, id*)(path, &__arg1);
1069
1070 if (__arg1)
1071 dict = new NSDictionary(__arg1);
1072
1073 return result is this.objcObject ? this : (result !is null ? new typeof(this)(result) : null);
1074 }
1075
1076 this (NSString path, ref NSDictionary dict)
1077 {
1078 super(typeof(this).alloc.initWithPath(path, dict).objcObject);
1079 }
1080
1081 typeof(this) initWithURL (NSURL url, ref NSDictionary dict)
1082 {
1083 id __arg1;
1084
1085 if (dict)
1086 __arg1 = dict.objcObject;
1087
1088 id result = invokeObjcSelf!(id, "initWithURL:documentAttributes:", NSURL, id*)(url, &__arg1);
1089
1090 if (__arg1)
1091 dict = new NSDictionary(__arg1);
1092
1093 return result is this.objcObject ? this : (result !is null ? new typeof(this)(result) : null);
1094 }
1095
1096 this (NSURL url, ref NSDictionary dict)
1097 {
1098 super(typeof(this).alloc.initWithURL(url, dict).objcObject);
1099 }
1100
1101 typeof(this) initWithRTF (NSData data, ref NSDictionary dict)
1102 {
1103 id __arg1;
1104
1105 if (dict)
1106 __arg1 = dict.objcObject;
1107
1108 id result = invokeObjcSelf!(id, "initWithRTF:documentAttributes:", NSData, id*)(data, &__arg1);
1109
1110 if (__arg1)
1111 dict = new NSDictionary(__arg1);
1112
1113 return result is this.objcObject ? this : (result !is null ? new typeof(this)(result) : null);
1114 }
1115
1116 this (NSData data, ref NSDictionary dict)
1117 {
1118 super(typeof(this).alloc.initWithRTF(data, dict).objcObject);
1119 }
1120
1121 typeof(this) initWithRTFD (NSData data, ref NSDictionary dict)
1122 {
1123 id __arg1;
1124
1125 if (dict)
1126 __arg1 = dict.objcObject;
1127
1128 id result = invokeObjcSelf!(id, "initWithRTFD:documentAttributes:", NSData, id*)(data, &__arg1);
1129
1130 if (__arg1)
1131 dict = new NSDictionary(__arg1);
1132
1133 return result is this.objcObject ? this : (result !is null ? new typeof(this)(result) : null);
1134 }
1135
1136 this (NSData data, ref NSDictionary dict)
1137 {
1138 super(typeof(this).alloc.initWithRTFD(data, dict).objcObject);
1139 }
1140
1141 typeof(this) initWithHTML (NSData data, ref NSDictionary dict)
1142 {
1143 id __arg1;
1144
1145 if (dict)
1146 __arg1 = dict.objcObject;
1147
1148 id result = invokeObjcSelf!(id, "initWithHTML:documentAttributes:", NSData, id*)(data, &__arg1);
1149
1150 if (__arg1)
1151 dict = new NSDictionary(__arg1);
1152
1153 return result is this.objcObject ? this : (result !is null ? new typeof(this)(result) : null);
1154 }
1155
1156 this (NSData data, ref NSDictionary dict)
1157 {
1158 super(typeof(this).alloc.initWithHTML(data, dict).objcObject);
1159 }
1160
1161 typeof(this) initWithHTML (NSData data, NSURL base, ref NSDictionary dict)
1162 {
1163 id __arg2;
1164
1165 if (dict)
1166 __arg2 = dict.objcObject;
1167
1168 id result = invokeObjcSelf!(id, "initWithHTML:baseURL:documentAttributes:", NSData, NSURL, id*)(data, base, &__arg2);
1169
1170 if (__arg2)
1171 dict = new NSDictionary(__arg2);
1172
1173 return result is this.objcObject ? this : (result !is null ? new typeof(this)(result) : null);
1174 }
1175
1176 this (NSData data, NSURL base, ref NSDictionary dict)
1177 {
1178 super(typeof(this).alloc.initWithHTML(data, base, dict).objcObject);
1179 }
1180
1181 typeof(this) initWithDocFormat (NSData data, ref NSDictionary dict)
1182 {
1183 id __arg1;
1184
1185 if (dict)
1186 __arg1 = dict.objcObject;
1187
1188 id result = invokeObjcSelf!(id, "initWithDocFormat:documentAttributes:", NSData, id*)(data, &__arg1);
1189
1190 if (__arg1)
1191 dict = new NSDictionary(__arg1);
1192
1193 return result is this.objcObject ? this : (result !is null ? new typeof(this)(result) : null);
1194 }
1195
1196 this (NSData data, ref NSDictionary dict)
1197 {
1198 super(typeof(this).alloc.initWithDocFormat(data, dict).objcObject);
1199 }
1200
1201 typeof(this) initWithHTML (NSData data, NSDictionary options, ref NSDictionary dict)
1202 {
1203 id __arg2;
1204
1205 if (dict)
1206 __arg2 = dict.objcObject;
1207
1208 id result = invokeObjcSelf!(id, "initWithHTML:options:documentAttributes:", NSData, NSDictionary, id*)(data, options, &__arg2);
1209
1210 if (__arg2)
1211 dict = new NSDictionary(__arg2);
1212
1213 return result is this.objcObject ? this : (result !is null ? new typeof(this)(result) : null);
1214 }
1215
1216 this (NSData data, NSDictionary options, ref NSDictionary dict)
1217 {
1218 super(typeof(this).alloc.initWithHTML(data, options, dict).objcObject);
1219 }
1220
1221 typeof(this) initWithRTFDFileWrapper (NSFileWrapper wrapper, ref NSDictionary dict)
1222 {
1223 id __arg1;
1224
1225 if (dict)
1226 __arg1 = dict.objcObject;
1227
1228 id result = invokeObjcSelf!(id, "initWithRTFDFileWrapper:documentAttributes:", NSFileWrapper, id*)(wrapper, &__arg1);
1229
1230 if (__arg1)
1231 dict = new NSDictionary(__arg1);
1232
1233 return result is this.objcObject ? this : (result !is null ? new typeof(this)(result) : null);
1234 }
1235
1236 this (NSFileWrapper wrapper, ref NSDictionary dict)
1237 {
1238 super(typeof(this).alloc.initWithRTFDFileWrapper(wrapper, dict).objcObject);
1239 }
1240
1241 NSData dataFromRange (NSRange range, NSDictionary dict, ref NSError error)
1242 {
1243 id __arg2;
1244
1245 if (error)
1246 __arg2 = error.objcObject;
1247
1248 NSData result = invokeObjcSelf!(NSData, "dataFromRange:documentAttributes:error:", NSRange, NSDictionary, id*)(range, dict, &__arg2);
1249
1250 if (__arg2)
1251 error = new NSError(__arg2);
1252
1253 return result;
1254 }
1255
1256 NSFileWrapper fileWrapperFromRange (NSRange range, NSDictionary dict, ref NSError error)
1257 {
1258 id __arg2;
1259
1260 if (error)
1261 __arg2 = error.objcObject;
1262
1263 NSFileWrapper result = invokeObjcSelf!(NSFileWrapper, "fileWrapperFromRange:documentAttributes:error:", NSRange, NSDictionary, id*)(range, dict, &__arg2);
1264
1265 if (__arg2)
1266 error = new NSError(__arg2);
1267
1268 return result;
1269 }
1270
1271 NSData RTFFromRange (NSRange range, NSDictionary dict)
1272 {
1273 return invokeObjcSelf!(NSData, "RTFFromRange:documentAttributes:", NSRange, NSDictionary)(range, dict);
1274 }
1275
1276 NSData RTFDFromRange (NSRange range, NSDictionary dict)
1277 {
1278 return invokeObjcSelf!(NSData, "RTFDFromRange:documentAttributes:", NSRange, NSDictionary)(range, dict);
1279 }
1280
1281 NSFileWrapper RTFDFileWrapperFromRange (NSRange range, NSDictionary dict)
1282 {
1283 return invokeObjcSelf!(NSFileWrapper, "RTFDFileWrapperFromRange:documentAttributes:", NSRange, NSDictionary)(range, dict);
1284 }
1285
1286 NSData docFormatFromRange (NSRange range, NSDictionary dict)
1287 {
1288 return invokeObjcSelf!(NSData, "docFormatFromRange:documentAttributes:", NSRange, NSDictionary)(range, dict);
1289 }
1290
1291 //mixin ObjcBindMethod!(fontAttributesInRange, "fontAttributesInRange:");
1292 //mixin ObjcBindMethod!(rulerAttributesInRange, "rulerAttributesInRange:");
1293 //mixin ObjcBindMethod!(containsAttachments, "containsAttachments");
1294 //mixin ObjcBindMethod!(lineBreakBeforeIndex, "lineBreakBeforeIndex:withinRange:");
1295 //mixin ObjcBindMethod!(lineBreakByHyphenatingBeforeIndex, "lineBreakByHyphenatingBeforeIndex:withinRange:");
1296 //mixin ObjcBindMethod!(doubleClickAtIndex, "doubleClickAtIndex:");
1297 //mixin ObjcBindMethod!(nextWordFromIndex, "nextWordFromIndex:forward:");
1298 //mixin ObjcBindMethod!(URLAtIndex, "URLAtIndex:effectiveRange:");
1299 //mixin ObjcBindClassMethod!(textTypes, "textTypes");
1300 //mixin ObjcBindClassMethod!(textUnfilteredTypes, "textUnfilteredTypes");
1301 //mixin ObjcBindMethod!(rangeOfTextBlock, "rangeOfTextBlock:atIndex:");
1302 //mixin ObjcBindMethod!(rangeOfTextTable, "rangeOfTextTable:atIndex:");
1303 //mixin ObjcBindMethod!(rangeOfTextList, "rangeOfTextList:atIndex:");
1304 //mixin ObjcBindMethod!(itemNumberInTextList, "itemNumberInTextList:atIndex:");
1305 /*//mixin ObjcBindMethod!(initWithURL, "initWithURL:options:documentAttributes:error:");
1306 //mixin ObjcBindMethod!(initWithData, "initWithData:options:documentAttributes:error:");
1307 //mixin ObjcBindMethod!(initWithPath, "initWithPath:documentAttributes:");
1308 //mixin ObjcBindMethod!(initWithURL, "initWithURL:documentAttributes:");
1309 //mixin ObjcBindMethod!(initWithRTF, "initWithRTF:documentAttributes:");
1310 //mixin ObjcBindMethod!(initWithRTFD, "initWithRTFD:documentAttributes:");
1311 //mixin ObjcBindMethod!(initWithHTML, "initWithHTML:documentAttributes:");
1312 //mixin ObjcBindMethod!(initWithHTML, "initWithHTML:baseURL:documentAttributes:");
1313 //mixin ObjcBindMethod!(initWithDocFormat, "initWithDocFormat:documentAttributes:");
1314 //mixin ObjcBindMethod!(initWithHTML, "initWithHTML:options:documentAttributes:");
1315 //mixin ObjcBindMethod!(initWithRTFDFileWrapper, "initWithRTFDFileWrapper:documentAttributes:");*/
1316 /*//mixin ObjcBindMethod!(dataFromRange, "dataFromRange:documentAttributes:error:");
1317 //mixin ObjcBindMethod!(fileWrapperFromRange, "fileWrapperFromRange:documentAttributes:error:");*/
1318 //mixin ObjcBindMethod!(RTFFromRange, "RTFFromRange:documentAttributes:");
1319 //mixin ObjcBindMethod!(RTFDFromRange, "RTFDFromRange:documentAttributes:");
1320 //mixin ObjcBindMethod!(RTFDFileWrapperFromRange, "RTFDFileWrapperFromRange:documentAttributes:");
1321 //mixin ObjcBindMethod!(docFormatFromRange, "docFormatFromRange:documentAttributes:");
1322
1323 `;
1324
1325 const TNSExtendedMutableAttributedString = `
1326
1327 /*NSMutableString mutableString ()
1328 {
1329 return invokeObjcSelf!(NSMutableString, "mutableString");
1330 }*/
1331
1332 void addAttribute (NSString name, Object value, NSRange range)
1333 {
1334 return invokeObjcSelf!(void, "addAttribute:value:range:", NSString, Object, NSRange)(name, value, range);
1335 }
1336
1337 void addAttributes (NSDictionary attrs, NSRange range)
1338 {
1339 return invokeObjcSelf!(void, "addAttributes:range:", NSDictionary, NSRange)(attrs, range);
1340 }
1341
1342 void removeAttribute (NSString name, NSRange range)
1343 {
1344 return invokeObjcSelf!(void, "removeAttribute:range:", NSString, NSRange)(name, range);
1345 }
1346
1347 void replaceCharactersInRange (NSRange range, NSAttributedString attrString)
1348 {
1349 return invokeObjcSelf!(void, "replaceCharactersInRange:withAttributedString:", NSRange, NSAttributedString)(range, attrString);
1350 }
1351
1352 void insertAttributedString (NSAttributedString attrString, NSUInteger loc)
1353 {
1354 return invokeObjcSelf!(void, "insertAttributedString:atIndex:", NSAttributedString, NSUInteger)(attrString, loc);
1355 }
1356
1357 void appendAttributedString (NSAttributedString attrString)
1358 {
1359 return invokeObjcSelf!(void, "appendAttributedString:", NSAttributedString)(attrString);
1360 }
1361
1362 void deleteCharactersInRange (NSRange range)
1363 {
1364 return invokeObjcSelf!(void, "deleteCharactersInRange:", NSRange)(range);
1365 }
1366
1367 void setAttributedString (NSAttributedString attrString)
1368 {
1369 return invokeObjcSelf!(void, "setAttributedString:", NSAttributedString)(attrString);
1370 }
1371
1372 /*void beginEditing ()
1373 {
1374 return invokeObjcSelf!(void, "beginEditing");
1375 }
1376
1377 void endEditing ()
1378 {
1379 return invokeObjcSelf!(void, "endEditing");
1380 }*/
1381
1382 ////mixin ObjcBindMethod!(mutableString, "mutableString");
1383 //mixin ObjcBindMethod!(addAttribute, "addAttribute:value:range:");
1384 //mixin ObjcBindMethod!(addAttributes, "addAttributes:range:");
1385 //mixin ObjcBindMethod!(removeAttribute, "removeAttribute:range:");
1386 //mixin ObjcBindMethod!(replaceCharactersInRange, "replaceCharactersInRange:withAttributedString:");
1387 //mixin ObjcBindMethod!(insertAttributedString, "insertAttributedString:atIndex:");
1388 //mixin ObjcBindMethod!(appendAttributedString, "appendAttributedString:");
1389 //mixin ObjcBindMethod!(deleteCharactersInRange, "deleteCharactersInRange:");
1390 //mixin ObjcBindMethod!(setAttributedString, "setAttributedString:");
1391 /*//mixin ObjcBindMethod!(beginEditing, "beginEditing");
1392 //mixin ObjcBindMethod!(endEditing, "endEditing");*/
1393
1394 `;
1395