Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSTextStorage.d @ 0:380af2bdd8e5
Upload of whole dwt tree
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Sat, 09 Aug 2008 17:00:02 +0200 |
parents | |
children | 8b48be5454ce |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:380af2bdd8e5 |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2007 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * | |
11 * Port to the D Programming language: | |
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | |
13 *******************************************************************************/ | |
14 module dwt.internal.cocoa.NSTextStorage; | |
15 | |
16 import dwt.internal.cocoa.id; | |
17 import dwt.internal.cocoa.NSArray; | |
18 import dwt.internal.cocoa.NSColor; | |
19 import dwt.internal.cocoa.NSFont; | |
20 import dwt.internal.cocoa.NSInteger; | |
21 import dwt.internal.cocoa.NSLayoutManager; | |
22 import dwt.internal.cocoa.NSMutableAttributedString; | |
23 import dwt.internal.cocoa.NSRange; | |
24 import dwt.internal.cocoa.OS; | |
25 import objc = dwt.internal.objc.runtime; | |
26 | |
27 public class NSTextStorage : NSMutableAttributedString | |
28 { | |
29 | |
30 public this () | |
31 { | |
32 super(); | |
33 } | |
34 | |
35 public this (objc.id id) | |
36 { | |
37 super(id); | |
38 } | |
39 | |
40 public void addLayoutManager (NSLayoutManager obj) | |
41 { | |
42 OS.objc_msgSend(this.id, OS.sel_addLayoutManager_1, obj !is null ? obj.id : null); | |
43 } | |
44 | |
45 public NSArray attributeRuns () | |
46 { | |
47 objc.id result = OS.objc_msgSend(this.id, OS.sel_attributeRuns); | |
48 return result !is null ? new NSArray(result) : null; | |
49 } | |
50 | |
51 public NSInteger changeInLength () | |
52 { | |
53 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_changeInLength); | |
54 } | |
55 | |
56 public NSArray characters () | |
57 { | |
58 objc.id result = OS.objc_msgSend(this.id, OS.sel_characters); | |
59 return result !is null ? new NSArray(result) : null; | |
60 } | |
61 | |
62 public id delegatee () | |
63 { | |
64 objc.id result = OS.objc_msgSend(this.id, OS.sel_delegate); | |
65 return result !is null ? new id(result) : null; | |
66 } | |
67 | |
68 public void edited (NSUInteger editedMask, NSRange range, NSInteger delta) | |
69 { | |
70 OS.objc_msgSend(this.id, OS.sel_edited_1range_1changeInLength_1, editedMask, range, delta); | |
71 } | |
72 | |
73 public NSUInteger editedMask () | |
74 { | |
75 return cast(NSUInteger) OS.objc_msgSend(this.id, OS.sel_editedMask); | |
76 } | |
77 | |
78 public NSRange editedRange () | |
79 { | |
80 NSRange result; | |
81 OS.objc_msgSend_stret(result, this.id, OS.sel_editedRange); | |
82 return result; | |
83 } | |
84 | |
85 public void ensureAttributesAreFixedInRange (NSRange range) | |
86 { | |
87 OS.objc_msgSend(this.id, OS.sel_ensureAttributesAreFixedInRange_1, range); | |
88 } | |
89 | |
90 public bool fixesAttributesLazily () | |
91 { | |
92 return OS.objc_msgSend(this.id, OS.sel_fixesAttributesLazily) !is null; | |
93 } | |
94 | |
95 public NSFont font () | |
96 { | |
97 objc.id result = OS.objc_msgSend(this.id, OS.sel_font); | |
98 return result !is null ? new NSFont(result) : null; | |
99 } | |
100 | |
101 public NSColor foregroundColor () | |
102 { | |
103 objc.id result = OS.objc_msgSend(this.id, OS.sel_foregroundColor); | |
104 return result !is null ? new NSColor(result) : null; | |
105 } | |
106 | |
107 public void invalidateAttributesInRange (NSRange range) | |
108 { | |
109 OS.objc_msgSend(this.id, OS.sel_invalidateAttributesInRange_1, range); | |
110 } | |
111 | |
112 public NSArray layoutManagers () | |
113 { | |
114 objc.id result = OS.objc_msgSend(this.id, OS.sel_layoutManagers); | |
115 return result !is null ? new NSArray(result) : null; | |
116 } | |
117 | |
118 public NSArray paragraphs () | |
119 { | |
120 objc.id result = OS.objc_msgSend(this.id, OS.sel_paragraphs); | |
121 return result !is null ? new NSArray(result) : null; | |
122 } | |
123 | |
124 public void processEditing () | |
125 { | |
126 OS.objc_msgSend(this.id, OS.sel_processEditing); | |
127 } | |
128 | |
129 public void removeLayoutManager (NSLayoutManager obj) | |
130 { | |
131 OS.objc_msgSend(this.id, OS.sel_removeLayoutManager_1, obj !is null ? obj.id : null); | |
132 } | |
133 | |
134 public void setAttributeRuns (NSArray attributeRuns) | |
135 { | |
136 OS.objc_msgSend(this.id, OS.sel_setAttributeRuns_1, attributeRuns !is null ? attributeRuns.id : null); | |
137 } | |
138 | |
139 public void setCharacters (NSArray characters) | |
140 { | |
141 OS.objc_msgSend(this.id, OS.sel_setCharacters_1, characters !is null ? characters.id : null); | |
142 } | |
143 | |
144 public void setDelegate (id delegatee) | |
145 { | |
146 OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegatee !is null ? delegatee.id : null); | |
147 } | |
148 | |
149 public void setFont (NSFont font) | |
150 { | |
151 OS.objc_msgSend(this.id, OS.sel_setFont_1, font !is null ? font.id : null); | |
152 } | |
153 | |
154 public void setForegroundColor (NSColor color) | |
155 { | |
156 OS.objc_msgSend(this.id, OS.sel_setForegroundColor_1, color !is null ? color.id : null); | |
157 } | |
158 | |
159 public void setParagraphs (NSArray paragraphs) | |
160 { | |
161 OS.objc_msgSend(this.id, OS.sel_setParagraphs_1, paragraphs !is null ? paragraphs.id : null); | |
162 } | |
163 | |
164 public void setWords (NSArray words) | |
165 { | |
166 OS.objc_msgSend(this.id, OS.sel_setWords_1, words !is null ? words.id : null); | |
167 } | |
168 | |
169 public NSArray words () | |
170 { | |
171 objc.id result = OS.objc_msgSend(this.id, OS.sel_words); | |
172 return result !is null ? new NSArray(result) : null; | |
173 } | |
174 | |
175 } |