comparison dwt/internal/cocoa/NSLayoutManager.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.NSLayoutManager;
15
16 import dwt.internal.cocoa.id;
17 import dwt.internal.cocoa.NSArray;
18 import dwt.internal.cocoa.NSAttributedString;
19 import dwt.internal.cocoa.NSCell;
20 import dwt.internal.cocoa.NSColor;
21 import dwt.internal.cocoa.NSDictionary;
22 import dwt.internal.cocoa.NSFont;
23 import dwt.internal.cocoa.NSGlyphGenerator;
24 import dwt.internal.cocoa.NSImageCell : NSImageScaling;
25 import dwt.internal.cocoa.NSInteger;
26 import dwt.internal.cocoa.NSObject;
27 import dwt.internal.cocoa.NSParagraphStyle;
28 import dwt.internal.cocoa.NSPoint;
29 import dwt.internal.cocoa.NSRange;
30 import dwt.internal.cocoa.NSRect;
31 import dwt.internal.cocoa.NSRulerView;
32 import dwt.internal.cocoa.NSSize;
33 import dwt.internal.cocoa.NSString;
34 import dwt.internal.cocoa.NSTextBlock;
35 import dwt.internal.cocoa.NSTextContainer;
36 import dwt.internal.cocoa.NSTextStorage;
37 import dwt.internal.cocoa.NSTextView;
38 import dwt.internal.cocoa.NSTypesetter;
39 import dwt.internal.cocoa.NSWindow;
40 import dwt.internal.cocoa.OS;
41 import objc = dwt.internal.objc.runtime;
42
43
44
45 enum NSGlyphInscription : NSUInteger
46 {
47 NSGlyphInscribeBase = 0,
48 NSGlyphInscribeBelow = 1,
49 NSGlyphInscribeAbove = 2,
50 NSGlyphInscribeOverstrike = 3,
51 NSGlyphInscribeOverBelow = 4
52 }
53
54 alias NSGlyphInscription.NSGlyphInscribeBase NSGlyphInscribeBase;
55 alias NSGlyphInscription.NSGlyphInscribeBelow NSGlyphInscribeBelow;
56 alias NSGlyphInscription.NSGlyphInscribeAbove NSGlyphInscribeAbove;
57 alias NSGlyphInscription.NSGlyphInscribeOverstrike NSGlyphInscribeOverstrike;
58 alias NSGlyphInscription.NSGlyphInscribeOverBelow NSGlyphInscribeOverBelow;
59
60
61
62 enum NSTypesetterBehavior : NSInteger
63 {
64 NSTypesetterLatestBehavior = -1,
65 NSTypesetterOriginalBehavior = 0,
66 NSTypesetterBehavior_10_2_WithCompatibility = 1,
67 NSTypesetterBehavior_10_2 = 2,
68 NSTypesetterBehavior_10_3 = 3,
69 NSTypesetterBehavior_10_4 = 4
70 }
71
72 alias NSTypesetterBehavior.NSTypesetterLatestBehavior NSTypesetterLatestBehavior;
73 alias NSTypesetterBehavior.NSTypesetterOriginalBehavior NSTypesetterOriginalBehavior;
74 alias NSTypesetterBehavior.NSTypesetterBehavior_10_2_WithCompatibility NSTypesetterBehavior_10_2_WithCompatibility;
75 alias NSTypesetterBehavior.NSTypesetterBehavior_10_2 NSTypesetterBehavior_10_2;
76 alias NSTypesetterBehavior.NSTypesetterBehavior_10_3 NSTypesetterBehavior_10_3;
77 alias NSTypesetterBehavior.NSTypesetterBehavior_10_4 NSTypesetterBehavior_10_4;
78
79
80
81 public class NSLayoutManager : NSObject
82 {
83
84 public this ()
85 {
86 super();
87 }
88
89 public this (objc.id id)
90 {
91 super(id);
92 }
93
94 public void addTemporaryAttribute (NSString attrName, id value, NSRange charRange)
95 {
96 OS.objc_msgSend(this.id, OS.sel_addTemporaryAttribute_1value_1forCharacterRange_1, attrName !is null ? attrName.id : null,
97 value !is null ? value.id : null, charRange);
98 }
99
100 public void addTemporaryAttributes (NSDictionary attrs, NSRange charRange)
101 {
102 OS.objc_msgSend(this.id, OS.sel_addTemporaryAttributes_1forCharacterRange_1, attrs !is null ? attrs.id : null, charRange);
103 }
104
105 public void addTextContainer (NSTextContainer container)
106 {
107 OS.objc_msgSend(this.id, OS.sel_addTextContainer_1, container !is null ? container.id : null);
108 }
109
110 public bool allowsNonContiguousLayout ()
111 {
112 return OS.objc_msgSend(this.id, OS.sel_allowsNonContiguousLayout) !is null;
113 }
114
115 public NSSize attachmentSizeForGlyphAtIndex (NSUInteger glyphIndex)
116 {
117 NSSize result;
118 OS.objc_msgSend_stret(result, this.id, OS.sel_attachmentSizeForGlyphAtIndex_1, glyphIndex);
119 return result;
120 }
121
122 public NSAttributedString attributedString ()
123 {
124 objc.id result = OS.objc_msgSend(this.id, OS.sel_attributedString);
125 return result !is null ? new NSAttributedString(result) : null;
126 }
127
128 public bool backgroundLayoutEnabled ()
129 {
130 return OS.objc_msgSend(this.id, OS.sel_backgroundLayoutEnabled) !is null;
131 }
132
133 public NSRect boundingRectForGlyphRange (NSRange glyphRange, NSTextContainer container)
134 {
135 NSRect result;
136 OS.objc_msgSend_stret(result, this.id, OS.sel_boundingRectForGlyphRange_1inTextContainer_1, glyphRange,
137 container !is null ? container.id : null);
138 return result;
139 }
140
141 public NSRect boundsRectForTextBlock_atIndex_effectiveRange_ (NSTextBlock block, NSUInteger glyphIndex, NSRangePointer effectiveGlyphRange)
142 {
143 NSRect result;
144 OS.objc_msgSend_stret(result, this.id, OS.sel_boundsRectForTextBlock_1atIndex_1effectiveRange_1, block !is null ? block.id : null,
145 glyphIndex, effectiveGlyphRange);
146 return result;
147 }
148
149 public NSRect boundsRectForTextBlock_glyphRange_ (NSTextBlock block, NSRange glyphRange)
150 {
151 NSRect result;
152 OS.objc_msgSend_stret(result, this.id, OS.sel_boundsRectForTextBlock_1glyphRange_1, block !is null ? block.id : null, glyphRange);
153 return result;
154 }
155
156 public NSUInteger characterIndexForGlyphAtIndex (NSUInteger glyphIndex)
157 {
158 return OS.objc_msgSend(this.id, OS.sel_characterIndexForGlyphAtIndex_1, glyphIndex);
159 }
160
161 public NSRange characterRangeForGlyphRange (NSRange glyphRange, NSRangePointer actualGlyphRange)
162 {
163 NSRange result;
164 OS.objc_msgSend_stret(result, this.id, OS.sel_characterRangeForGlyphRange_1actualGlyphRange_1, glyphRange, actualGlyphRange);
165 return result;
166 }
167
168 public NSImageScaling defaultAttachmentScaling ()
169 {
170 return OS.objc_msgSend(this.id, OS.sel_defaultAttachmentScaling);
171 }
172
173 public CGFloat defaultBaselineOffsetForFont (NSFont theFont)
174 {
175 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_defaultBaselineOffsetForFont_1, theFont !is null ? theFont.id : null);
176 }
177
178 public CGFloat defaultLineHeightForFont (NSFont theFont)
179 {
180 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_defaultLineHeightForFont_1, theFont !is null ? theFont.id : null);
181 }
182
183 public id delegatee ()
184 {
185 objc.id result = OS.objc_msgSend(this.id, OS.sel_delegate);
186 return result !is null ? new id(result) : null;
187 }
188
189 public void deleteGlyphsInRange (NSRange glyphRange)
190 {
191 OS.objc_msgSend(this.id, OS.sel_deleteGlyphsInRange_1, glyphRange);
192 }
193
194 public void drawBackgroundForGlyphRange (NSRange glyphsToShow, NSPoint origin)
195 {
196 OS.objc_msgSend(this.id, OS.sel_drawBackgroundForGlyphRange_1atPoint_1, glyphsToShow, origin);
197 }
198
199 public void drawGlyphsForGlyphRange (NSRange glyphsToShow, NSPoint origin)
200 {
201 OS.objc_msgSend(this.id, OS.sel_drawGlyphsForGlyphRange_1atPoint_1, glyphsToShow, origin);
202 }
203
204 public void drawStrikethroughForGlyphRange (NSRange glyphRange, NSInteger strikethroughVal, CGFloat baselineOffset, NSRect lineRect,
205 NSRange lineGlyphRange, NSPoint containerOrigin)
206 {
207 OS.objc_msgSend(
208 this.id,
209 OS.sel_drawStrikethroughForGlyphRange_1strikethroughType_1baselineOffset_1lineFragmentRect_1lineFragmentGlyphRange_1containerOrigin_1,
210 glyphRange, strikethroughVal, baselineOffset, lineRect, lineGlyphRange, containerOrigin);
211 }
212
213 public void drawUnderlineForGlyphRange (NSRange glyphRange, NSInteger underlineVal, CGFloat baselineOffset, NSRect lineRect,
214 NSRange lineGlyphRange, NSPoint containerOrigin)
215 {
216 OS.objc_msgSend(this.id,
217 OS.sel_drawUnderlineForGlyphRange_1underlineType_1baselineOffset_1lineFragmentRect_1lineFragmentGlyphRange_1containerOrigin_1,
218 glyphRange, underlineVal, baselineOffset, lineRect, lineGlyphRange, containerOrigin);
219 }
220
221 public bool drawsOutsideLineFragmentForGlyphAtIndex (NSUInteger glyphIndex)
222 {
223 return OS.objc_msgSend(this.id, OS.sel_drawsOutsideLineFragmentForGlyphAtIndex_1, glyphIndex) !is null;
224 }
225
226 public void ensureGlyphsForCharacterRange (NSRange charRange)
227 {
228 OS.objc_msgSend(this.id, OS.sel_ensureGlyphsForCharacterRange_1, charRange);
229 }
230
231 public void ensureGlyphsForGlyphRange (NSRange glyphRange)
232 {
233 OS.objc_msgSend(this.id, OS.sel_ensureGlyphsForGlyphRange_1, glyphRange);
234 }
235
236 public void ensureLayoutForBoundingRect (NSRect bounds, NSTextContainer container)
237 {
238 OS.objc_msgSend(this.id, OS.sel_ensureLayoutForBoundingRect_1inTextContainer_1, bounds, container !is null ? container.id : null);
239 }
240
241 public void ensureLayoutForCharacterRange (NSRange charRange)
242 {
243 OS.objc_msgSend(this.id, OS.sel_ensureLayoutForCharacterRange_1, charRange);
244 }
245
246 public void ensureLayoutForGlyphRange (NSRange glyphRange)
247 {
248 OS.objc_msgSend(this.id, OS.sel_ensureLayoutForGlyphRange_1, glyphRange);
249 }
250
251 public void ensureLayoutForTextContainer (NSTextContainer container)
252 {
253 OS.objc_msgSend(this.id, OS.sel_ensureLayoutForTextContainer_1, container !is null ? container.id : null);
254 }
255
256 public NSRect extraLineFragmentRect ()
257 {
258 NSRect result;
259 OS.objc_msgSend_stret(result, this.id, OS.sel_extraLineFragmentRect);
260 return result;
261 }
262
263 public NSTextContainer extraLineFragmentTextContainer ()
264 {
265 objc.id result = OS.objc_msgSend(this.id, OS.sel_extraLineFragmentTextContainer);
266 return result !is null ? new NSTextContainer(result) : null;
267 }
268
269 public NSRect extraLineFragmentUsedRect ()
270 {
271 NSRect result;
272 OS.objc_msgSend_stret(result, this.id, OS.sel_extraLineFragmentUsedRect);
273 return result;
274 }
275
276 public NSTextView firstTextView ()
277 {
278 objc.id result = OS.objc_msgSend(this.id, OS.sel_firstTextView);
279 return result !is null ? new NSTextView(result) : null;
280 }
281
282 public NSUInteger firstUnlaidCharacterIndex ()
283 {
284 return OS.objc_msgSend(this.id, OS.sel_firstUnlaidCharacterIndex);
285 }
286
287 public NSUInteger firstUnlaidGlyphIndex ()
288 {
289 return OS.objc_msgSend(this.id, OS.sel_firstUnlaidGlyphIndex);
290 }
291
292 public CGFloat fractionOfDistanceThroughGlyphForPoint (NSPoint point, NSTextContainer container)
293 {
294 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_fractionOfDistanceThroughGlyphForPoint_1inTextContainer_1, point,
295 container !is null ? container.id : null);
296 }
297
298 public void getFirstUnlaidCharacterIndex (NSUInteger* charIndex, NSUInteger* glyphIndex)
299 {
300 OS.objc_msgSend(this.id, OS.sel_getFirstUnlaidCharacterIndex_1glyphIndex_1, charIndex, glyphIndex);
301 }
302
303 public NSUInteger getGlyphs (NSGlyph* glyphArray, NSRange glyphRange)
304 {
305 return OS.objc_msgSend(this.id, OS.sel_getGlyphs_1range_1, glyphArray, glyphRange);
306 }
307
308 public NSUInteger getGlyphsInRange_glyphs_characterIndexes_glyphInscriptions_elasticBits_ (NSRange glyphRange, NSGlyph* glyphBuffer,
309 NSUInteger* charIndexBuffer, NSGlyphInscription* inscribeBuffer, bool* elasticBuffer)
310 {
311 return OS.objc_msgSend(this.id, OS.sel_getGlyphsInRange_1glyphs_1characterIndexes_1glyphInscriptions_1elasticBits_1, glyphRange, glyphBuffer,
312 charIndexBuffer, inscribeBuffer, elasticBuffer);
313 }
314
315 public NSUInteger getGlyphsInRange_glyphs_characterIndexes_glyphInscriptions_elasticBits_bidiLevels_ (NSRange glyphRange, NSGlyph* glyphBuffer,
316 NSUInteger* charIndexBuffer, NSGlyphInscription* inscribeBuffer, bool* elasticBuffer, ubyte* bidiLevelBuffer)
317 {
318 return OS.objc_msgSend(this.id, OS.sel_getGlyphsInRange_1glyphs_1characterIndexes_1glyphInscriptions_1elasticBits_1bidiLevels_1, glyphRange,
319 glyphBuffer, charIndexBuffer, inscribeBuffer, elasticBuffer, bidiLevelBuffer);
320 }
321
322 public NSUInteger getLineFragmentInsertionPointsForCharacterAtIndex (NSUInteger charIndex, bool aFlag, bool dFlag, CGFloat* positions,
323 NSUInteger* charIndexes)
324 {
325 return OS.objc_msgSend(this.id,
326 OS.sel_getLineFragmentInsertionPointsForCharacterAtIndex_1alternatePositions_1inDisplayOrder_1positions_1characterIndexes_1,
327 charIndex, aFlag, dFlag, positions, charIndexes);
328 }
329
330 public NSGlyph glyphAtIndex_ (NSUInteger glyphIndex)
331 {
332 return OS.objc_msgSend(this.id, OS.sel_glyphAtIndex_1, glyphIndex);
333 }
334
335 public NSGlyph glyphAtIndex_isValidIndex_ (NSUInteger glyphIndex, bool* isValidIndex)
336 {
337 return OS.objc_msgSend(this.id, OS.sel_glyphAtIndex_1isValidIndex_1, glyphIndex, isValidIndex);
338 }
339
340 public NSGlyphGenerator glyphGenerator ()
341 {
342 objc.id result = OS.objc_msgSend(this.id, OS.sel_glyphGenerator);
343 return result !is null ? new NSGlyphGenerator(result) : null;
344 }
345
346 public NSUInteger glyphIndexForCharacterAtIndex (NSUInteger charIndex)
347 {
348 return OS.objc_msgSend(this.id, OS.sel_glyphIndexForCharacterAtIndex_1, charIndex);
349 }
350
351 public NSUInteger glyphIndexForPoint_inTextContainer_ (NSPoint point, NSTextContainer container)
352 {
353 return OS.objc_msgSend(this.id, OS.sel_glyphIndexForPoint_1inTextContainer_1, point, container !is null ? container.id : null);
354 }
355
356 public NSUInteger glyphIndexForPoint_inTextContainer_fractionOfDistanceThroughGlyph_ (NSPoint point, NSTextContainer container,
357 CGFloat* partialFraction)
358 {
359 return OS.objc_msgSend(this.id, OS.sel_glyphIndexForPoint_1inTextContainer_1fractionOfDistanceThroughGlyph_1, point,
360 container !is null ? container.id : null, partialFraction);
361 }
362
363 public NSRange glyphRangeForBoundingRect (NSRect bounds, NSTextContainer container)
364 {
365 NSRange result;
366 OS.objc_msgSend_stret(result, this.id, OS.sel_glyphRangeForBoundingRect_1inTextContainer_1, bounds, container !is null ? container.id : null);
367 return result;
368 }
369
370 public NSRange glyphRangeForBoundingRectWithoutAdditionalLayout (NSRect bounds, NSTextContainer container)
371 {
372 NSRange result;
373 OS.objc_msgSend_stret(result, this.id, OS.sel_glyphRangeForBoundingRectWithoutAdditionalLayout_1inTextContainer_1, bounds,
374 container !is null ? container.id : null);
375 return result;
376 }
377
378 public NSRange glyphRangeForCharacterRange (NSRange charRange, NSRangePointer actualCharRange)
379 {
380 NSRange result;
381 OS.objc_msgSend_struct(result, this.id, OS.sel_glyphRangeForCharacterRange_1actualCharacterRange_1, charRange, actualCharRange);
382 return result;
383 }
384
385 public NSRange glyphRangeForTextContainer (NSTextContainer container)
386 {
387 NSRange result;
388 OS.objc_msgSend_struct(result, this.id, OS.sel_glyphRangeForTextContainer_1, container !is null ? container.id : null);
389 return result;
390 }
391
392 public bool hasNonContiguousLayout ()
393 {
394 return OS.objc_msgSend(this.id, OS.sel_hasNonContiguousLayout) !is null;
395 }
396
397 public float hyphenationFactor ()
398 {
399 return cast(float) OS.objc_msgSend_fpret(this.id, OS.sel_hyphenationFactor);
400 }
401
402 public void insertGlyph (NSGlyph glyph, NSUInteger glyphIndex, NSUInteger charIndex)
403 {
404 OS.objc_msgSend(this.id, OS.sel_insertGlyph_1atGlyphIndex_1characterIndex_1, glyph, glyphIndex, charIndex);
405 }
406
407 public void insertGlyphs (/*const*/NSGlyph* glyphs, NSUInteger length, NSUInteger glyphIndex, NSUInteger charIndex)
408 {
409 OS.objc_msgSend(this.id, OS.sel_insertGlyphs_1length_1forStartingGlyphAtIndex_1characterIndex_1, glyphs, length, glyphIndex, charIndex);
410 }
411
412 public void insertTextContainer (NSTextContainer container, NSUInteger index)
413 {
414 OS.objc_msgSend(this.id, OS.sel_insertTextContainer_1atIndex_1, container !is null ? container.id : null, index);
415 }
416
417 public NSInteger intAttribute (NSInteger attributeTag, NSUInteger glyphIndex)
418 {
419 return OS.objc_msgSend(this.id, OS.sel_intAttribute_1forGlyphAtIndex_1, attributeTag, glyphIndex);
420 }
421
422 public void invalidateDisplayForCharacterRange (NSRange charRange)
423 {
424 OS.objc_msgSend(this.id, OS.sel_invalidateDisplayForCharacterRange_1, charRange);
425 }
426
427 public void invalidateDisplayForGlyphRange (NSRange glyphRange)
428 {
429 OS.objc_msgSend(this.id, OS.sel_invalidateDisplayForGlyphRange_1, glyphRange);
430 }
431
432 public void invalidateGlyphsForCharacterRange (NSRange charRange, NSInteger delta, NSRangePointer actualCharRange)
433 {
434 OS.objc_msgSend(this.id, OS.sel_invalidateGlyphsForCharacterRange_1changeInLength_1actualCharacterRange_1, charRange, delta, actualCharRange);
435 }
436
437 public void invalidateGlyphsOnLayoutInvalidationForGlyphRange (NSRange glyphRange)
438 {
439 OS.objc_msgSend(this.id, OS.sel_invalidateGlyphsOnLayoutInvalidationForGlyphRange_1, glyphRange);
440 }
441
442 public void invalidateLayoutForCharacterRange_actualCharacterRange_ (NSRange charRange, NSRangePointer actualCharRange)
443 {
444 OS.objc_msgSend(this.id, OS.sel_invalidateLayoutForCharacterRange_1actualCharacterRange_1, charRange, actualCharRange);
445 }
446
447 public void invalidateLayoutForCharacterRange_isSoft_actualCharacterRange_ (NSRange charRange, bool flag, NSRangePointer actualCharRange)
448 {
449 OS.objc_msgSend(this.id, OS.sel_invalidateLayoutForCharacterRange_1isSoft_1actualCharacterRange_1, charRange, flag, actualCharRange);
450 }
451
452 public bool isValidGlyphIndex (NSUInteger glyphIndex)
453 {
454 return OS.objc_msgSend(this.id, OS.sel_isValidGlyphIndex_1, glyphIndex) !is null;
455 }
456
457 public bool layoutManagerOwnsFirstResponderInWindow (NSWindow window)
458 {
459 return OS.objc_msgSend(this.id, OS.sel_layoutManagerOwnsFirstResponderInWindow_1, window !is null ? window.id : null) !is null;
460 }
461
462 public NSUInteger layoutOptions ()
463 {
464 return OS.objc_msgSend(this.id, OS.sel_layoutOptions);
465 }
466
467 public NSRect layoutRectForTextBlock_atIndex_effectiveRange_ (NSTextBlock block, NSUInteger glyphIndex, NSRangePointer effectiveGlyphRange)
468 {
469 NSRect result;
470 OS.objc_msgSend_stret(result, this.id, OS.sel_layoutRectForTextBlock_1atIndex_1effectiveRange_1, block !is null ? block.id : null,
471 glyphIndex, effectiveGlyphRange);
472 return result;
473 }
474
475 public NSRect layoutRectForTextBlock_glyphRange_ (NSTextBlock block, NSRange glyphRange)
476 {
477 NSRect result;
478 OS.objc_msgSend_stret(result, this.id, OS.sel_layoutRectForTextBlock_1glyphRange_1, block !is null ? block.id : null, glyphRange);
479 return result;
480 }
481
482 public NSRect lineFragmentRectForGlyphAtIndex_effectiveRange_ (NSUInteger glyphIndex, NSRangePointer effectiveGlyphRange)
483 {
484 NSRect result;
485 OS.objc_msgSend_stret(result, this.id, OS.sel_lineFragmentRectForGlyphAtIndex_1effectiveRange_1, glyphIndex, effectiveGlyphRange);
486 return result;
487 }
488
489 public NSRect lineFragmentRectForGlyphAtIndex_effectiveRange_withoutAdditionalLayout_ (NSUInteger glyphIndex, NSRangePointer effectiveGlyphRange,
490 bool flag)
491 {
492 NSRect result;
493 OS.objc_msgSend_stret(result, this.id, OS.sel_lineFragmentRectForGlyphAtIndex_1effectiveRange_1withoutAdditionalLayout_1, glyphIndex,
494 effectiveGlyphRange, flag);
495 return result;
496 }
497
498 public NSRect lineFragmentUsedRectForGlyphAtIndex_effectiveRange_ (NSUInteger glyphIndex, NSRangePointer effectiveGlyphRange)
499 {
500 NSRect result;
501 OS.objc_msgSend_stret(result, this.id, OS.sel_lineFragmentUsedRectForGlyphAtIndex_1effectiveRange_1, glyphIndex, effectiveGlyphRange);
502 return result;
503 }
504
505 public NSRect lineFragmentUsedRectForGlyphAtIndex_effectiveRange_withoutAdditionalLayout_ (NSUInteger glyphIndex,
506 NSRangePointer effectiveGlyphRange, bool flag)
507 {
508 NSRect result;
509 OS.objc_msgSend_stret(result, this.id, OS.sel_lineFragmentUsedRectForGlyphAtIndex_1effectiveRange_1withoutAdditionalLayout_1, glyphIndex,
510 effectiveGlyphRange, flag);
511 return result;
512 }
513
514 public NSPoint locationForGlyphAtIndex (NSUInteger glyphIndex)
515 {
516 NSPoint result;
517 OS.objc_msgSend_struct(result, this.id, OS.sel_locationForGlyphAtIndex_1, glyphIndex);
518 return result;
519 }
520
521 public bool notShownAttributeForGlyphAtIndex (NSUInteger glyphIndex)
522 {
523 return OS.objc_msgSend(this.id, OS.sel_notShownAttributeForGlyphAtIndex_1, glyphIndex) !is null;
524 }
525
526 public NSUInteger numberOfGlyphs ()
527 {
528 return OS.objc_msgSend(this.id, OS.sel_numberOfGlyphs);
529 }
530
531 public NSRange rangeOfNominallySpacedGlyphsContainingIndex (NSUInteger glyphIndex)
532 {
533 NSRange result;
534 OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfNominallySpacedGlyphsContainingIndex_1, glyphIndex);
535 return result;
536 }
537
538 public NSRectArray rectArrayForCharacterRange (NSRange charRange, NSRange selCharRange, NSTextContainer container, NSUInteger* rectCount)
539 {
540 return OS.objc_msgSend(this.id, OS.sel_rectArrayForCharacterRange_1withinSelectedCharacterRange_1inTextContainer_1rectCount_1, charRange,
541 selCharRange, container !is null ? container.id : null, rectCount);
542 }
543
544 public NSRectArray rectArrayForGlyphRange (NSRange glyphRange, NSRange selGlyphRange, NSTextContainer container, NSUInteger* rectCount)
545 {
546 return OS.objc_msgSend(this.id, OS.sel_rectArrayForGlyphRange_1withinSelectedGlyphRange_1inTextContainer_1rectCount_1, glyphRange,
547 selGlyphRange, container !is null ? container.id : null, rectCount);
548 }
549
550 public void removeTemporaryAttribute (NSString attrName, NSRange charRange)
551 {
552 OS.objc_msgSend(this.id, OS.sel_removeTemporaryAttribute_1forCharacterRange_1, attrName !is null ? attrName.id : null, charRange);
553 }
554
555 public void removeTextContainerAtIndex (NSUInteger index)
556 {
557 OS.objc_msgSend(this.id, OS.sel_removeTextContainerAtIndex_1, index);
558 }
559
560 public void replaceGlyphAtIndex (NSUInteger glyphIndex, NSGlyph newGlyph)
561 {
562 OS.objc_msgSend(this.id, OS.sel_replaceGlyphAtIndex_1withGlyph_1, glyphIndex, newGlyph);
563 }
564
565 public void replaceTextStorage (NSTextStorage newTextStorage)
566 {
567 OS.objc_msgSend(this.id, OS.sel_replaceTextStorage_1, newTextStorage !is null ? newTextStorage.id : null);
568 }
569
570 public NSView rulerAccessoryViewForTextView (NSTextView view, NSParagraphStyle style, NSRulerView ruler, bool isEnabled)
571 {
572 objc.id result = OS.objc_msgSend(this.id, OS.sel_rulerAccessoryViewForTextView_1paragraphStyle_1ruler_1enabled_1,
573 view !is null ? view.id : null, style !is null ? style.id : null, ruler !is null ? ruler.id : null, isEnabled);
574 return result !is null ? new NSView(result) : null;
575 }
576
577 public NSArray rulerMarkersForTextView (NSTextView view, NSParagraphStyle style, NSRulerView ruler)
578 {
579 objc.id result = OS.objc_msgSend(this.id, OS.sel_rulerMarkersForTextView_1paragraphStyle_1ruler_1, view !is null ? view.id : null,
580 style !is null ? style.id : null, ruler !is null ? ruler.id : null);
581 return result !is null ? new NSArray(result) : null;
582 }
583
584 public void setAllowsNonContiguousLayout (bool flag)
585 {
586 OS.objc_msgSend(this.id, OS.sel_setAllowsNonContiguousLayout_1, flag);
587 }
588
589 public void setAttachmentSize (NSSize attachmentSize, NSRange glyphRange)
590 {
591 OS.objc_msgSend(this.id, OS.sel_setAttachmentSize_1forGlyphRange_1, attachmentSize, glyphRange);
592 }
593
594 public void setBackgroundLayoutEnabled (bool flag)
595 {
596 OS.objc_msgSend(this.id, OS.sel_setBackgroundLayoutEnabled_1, flag);
597 }
598
599 public void setBoundsRect (NSRect rect, NSTextBlock block, NSRange glyphRange)
600 {
601 OS.objc_msgSend(this.id, OS.sel_setBoundsRect_1forTextBlock_1glyphRange_1, rect, block !is null ? block.id : null, glyphRange);
602 }
603
604 public void setCharacterIndex (NSUInteger charIndex, NSUInteger glyphIndex)
605 {
606 OS.objc_msgSend(this.id, OS.sel_setCharacterIndex_1forGlyphAtIndex_1, charIndex, glyphIndex);
607 }
608
609 public void setDefaultAttachmentScaling (NSImageScaling scaling)
610 {
611 OS.objc_msgSend(this.id, OS.sel_setDefaultAttachmentScaling_1, scaling);
612 }
613
614 public void setDelegate (id delegatee)
615 {
616 OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegatee !is null ? delegatee.id : null);
617 }
618
619 public void setDrawsOutsideLineFragment (bool flag, NSUInteger glyphIndex)
620 {
621 OS.objc_msgSend(this.id, OS.sel_setDrawsOutsideLineFragment_1forGlyphAtIndex_1, flag, glyphIndex);
622 }
623
624 public void setExtraLineFragmentRect (NSRect fragmentRect, NSRect usedRect, NSTextContainer container)
625 {
626 OS.objc_msgSend(this.id, OS.sel_setExtraLineFragmentRect_1usedRect_1textContainer_1, fragmentRect, usedRect,
627 container !is null ? container.id : null);
628 }
629
630 public void setGlyphGenerator (NSGlyphGenerator glyphGenerator)
631 {
632 OS.objc_msgSend(this.id, OS.sel_setGlyphGenerator_1, glyphGenerator !is null ? glyphGenerator.id : null);
633 }
634
635 public void setHyphenationFactor (float factor)
636 {
637 OS.objc_msgSend(this.id, OS.sel_setHyphenationFactor_1, factor);
638 }
639
640 public void setIntAttribute (NSInteger attributeTag, NSInteger val, NSUInteger glyphIndex)
641 {
642 OS.objc_msgSend(this.id, OS.sel_setIntAttribute_1value_1forGlyphAtIndex_1, attributeTag, val, glyphIndex);
643 }
644
645 public void setLayoutRect (NSRect rect, NSTextBlock block, NSRange glyphRange)
646 {
647 OS.objc_msgSend(this.id, OS.sel_setLayoutRect_1forTextBlock_1glyphRange_1, rect, block !is null ? block.id : null, glyphRange);
648 }
649
650 public void setLineFragmentRect (NSRect fragmentRect, NSRange glyphRange, NSRect usedRect)
651 {
652 OS.objc_msgSend(this.id, OS.sel_setLineFragmentRect_1forGlyphRange_1usedRect_1, fragmentRect, glyphRange, usedRect);
653 }
654
655 public void setLocation (NSPoint location, NSRange glyphRange)
656 {
657 OS.objc_msgSend(this.id, OS.sel_setLocation_1forStartOfGlyphRange_1, location, glyphRange);
658 }
659
660 public void setLocations (NSPointArray locations, NSUInteger* glyphIndexes, NSUInteger count, NSRange glyphRange)
661 {
662 OS.objc_msgSend(this.id, OS.sel_setLocations_1startingGlyphIndexes_1count_1forGlyphRange_1, locations, glyphIndexes, count, glyphRange);
663 }
664
665 public void setNotShownAttribute (bool flag, NSUInteger glyphIndex)
666 {
667 OS.objc_msgSend(this.id, OS.sel_setNotShownAttribute_1forGlyphAtIndex_1, flag, glyphIndex);
668 }
669
670 public void setShowsControlCharacters (bool flag)
671 {
672 OS.objc_msgSend(this.id, OS.sel_setShowsControlCharacters_1, flag);
673 }
674
675 public void setShowsInvisibleCharacters (bool flag)
676 {
677 OS.objc_msgSend(this.id, OS.sel_setShowsInvisibleCharacters_1, flag);
678 }
679
680 public void setTemporaryAttributes (NSDictionary attrs, NSRange charRange)
681 {
682 OS.objc_msgSend(this.id, OS.sel_setTemporaryAttributes_1forCharacterRange_1, attrs !is null ? attrs.id : null, charRange);
683 }
684
685 public void setTextContainer (NSTextContainer container, NSRange glyphRange)
686 {
687 OS.objc_msgSend(this.id, OS.sel_setTextContainer_1forGlyphRange_1, container !is null ? container.id : null, glyphRange);
688 }
689
690 public void setTextStorage (NSTextStorage textStorage)
691 {
692 OS.objc_msgSend(this.id, OS.sel_setTextStorage_1, textStorage !is null ? textStorage.id : null);
693 }
694
695 public void setTypesetter (NSTypesetter typesetter)
696 {
697 OS.objc_msgSend(this.id, OS.sel_setTypesetter_1, typesetter !is null ? typesetter.id : null);
698 }
699
700 public void setTypesetterBehavior (NSTypesetterBehavior theBehavior)
701 {
702 OS.objc_msgSend(this.id, OS.sel_setTypesetterBehavior_1, theBehavior);
703 }
704
705 public void setUsesFontLeading (bool flag)
706 {
707 OS.objc_msgSend(this.id, OS.sel_setUsesFontLeading_1, flag);
708 }
709
710 public void setUsesScreenFonts (bool flag)
711 {
712 OS.objc_msgSend(this.id, OS.sel_setUsesScreenFonts_1, flag);
713 }
714
715 public void showAttachmentCell (NSCell cell, NSRect rect, NSUInteger attachmentIndex)
716 {
717 OS.objc_msgSend(this.id, OS.sel_showAttachmentCell_1inRect_1characterIndex_1, cell !is null ? cell.id : null, rect, attachmentIndex);
718 }
719
720 public void showPackedGlyphs (byte* glyphs, NSUInteger glyphLen, NSRange glyphRange, NSPoint point, NSFont font, NSColor color,
721 NSSize printingAdjustment)
722 {
723 OS.objc_msgSend(this.id, OS.sel_showPackedGlyphs_1length_1glyphRange_1atPoint_1font_1color_1printingAdjustment_1, glyphs, glyphLen,
724 glyphRange, point, font !is null ? font.id : null, color !is null ? color.id : null, printingAdjustment);
725 }
726
727 public bool showsControlCharacters ()
728 {
729 return OS.objc_msgSend(this.id, OS.sel_showsControlCharacters) !is null;
730 }
731
732 public bool showsInvisibleCharacters ()
733 {
734 return OS.objc_msgSend(this.id, OS.sel_showsInvisibleCharacters) !is null;
735 }
736
737 public void strikethroughGlyphRange (NSRange glyphRange, NSInteger strikethroughVal, NSRect lineRect, NSRange lineGlyphRange,
738 NSPoint containerOrigin)
739 {
740 OS.objc_msgSend(this.id, OS.sel_strikethroughGlyphRange_1strikethroughType_1lineFragmentRect_1lineFragmentGlyphRange_1containerOrigin_1,
741 glyphRange, strikethroughVal, lineRect, lineGlyphRange, containerOrigin);
742 }
743
744 public NSFont substituteFontForFont (NSFont originalFont)
745 {
746 objc.id result = OS.objc_msgSend(this.id, OS.sel_substituteFontForFont_1, originalFont !is null ? originalFont.id : null);
747 return result !is null ? new NSFont(result) : null;
748 }
749
750 public id temporaryAttribute_atCharacterIndex_effectiveRange_ (NSString attrName, NSUInteger location, NSRangePointer range)
751 {
752 objc.id result = OS.objc_msgSend(this.id, OS.sel_temporaryAttribute_1atCharacterIndex_1effectiveRange_1,
753 attrName !is null ? attrName.id : null, location, range);
754 return result !is null ? new id(result) : null;
755 }
756
757 public id temporaryAttribute_atCharacterIndex_longestEffectiveRange_inRange_ (NSString attrName, NSUInteger location, NSRangePointer range,
758 NSRange rangeLimit)
759 {
760 objc.id result = OS.objc_msgSend(this.id, OS.sel_temporaryAttribute_1atCharacterIndex_1longestEffectiveRange_1inRange_1,
761 attrName !is null ? attrName.id : null, location, range, rangeLimit);
762 return result !is null ? new id(result) : null;
763 }
764
765 public NSDictionary temporaryAttributesAtCharacterIndex_effectiveRange_ (NSUInteger charIndex, NSRangePointer effectiveCharRange)
766 {
767 objc.id result = OS.objc_msgSend(this.id, OS.sel_temporaryAttributesAtCharacterIndex_1effectiveRange_1, charIndex, effectiveCharRange);
768 return result !is null ? new NSDictionary(result) : null;
769 }
770
771 public NSDictionary temporaryAttributesAtCharacterIndex_longestEffectiveRange_inRange_ (NSUInteger location, NSRangePointer range,
772 NSRange rangeLimit)
773 {
774 objc.id result = OS.objc_msgSend(this.id, OS.sel_temporaryAttributesAtCharacterIndex_1longestEffectiveRange_1inRange_1, location, range,
775 rangeLimit);
776 return result !is null ? new NSDictionary(result) : null;
777 }
778
779 public void textContainerChangedGeometry (NSTextContainer container)
780 {
781 OS.objc_msgSend(this.id, OS.sel_textContainerChangedGeometry_1, container !is null ? container.id : null);
782 }
783
784 public void textContainerChangedTextView (NSTextContainer container)
785 {
786 OS.objc_msgSend(this.id, OS.sel_textContainerChangedTextView_1, container !is null ? container.id : null);
787 }
788
789 public NSTextContainer textContainerForGlyphAtIndex_effectiveRange_ (NSUInteger glyphIndex, NSRangePointer effectiveGlyphRange)
790 {
791 objc.id result = OS.objc_msgSend(this.id, OS.sel_textContainerForGlyphAtIndex_1effectiveRange_1, glyphIndex, effectiveGlyphRange);
792 return result !is null ? new NSTextContainer(result) : null;
793 }
794
795 public NSTextContainer textContainerForGlyphAtIndex_effectiveRange_withoutAdditionalLayout_ (NSUInteger glyphIndex,
796 NSRangePointer effectiveGlyphRange, bool flag)
797 {
798 objc.id result = OS.objc_msgSend(this.id, OS.sel_textContainerForGlyphAtIndex_1effectiveRange_1withoutAdditionalLayout_1, glyphIndex,
799 effectiveGlyphRange, flag);
800 return result !is null ? new NSTextContainer(result) : null;
801 }
802
803 public NSArray textContainers ()
804 {
805 objc.id result = OS.objc_msgSend(this.id, OS.sel_textContainers);
806 return result !is null ? new NSArray(result) : null;
807 }
808
809 public NSTextStorage textStorage ()
810 {
811 objc.id result = OS.objc_msgSend(this.id, OS.sel_textStorage);
812 return result !is null ? new NSTextStorage(result) : null;
813 }
814
815 public void textStorage_edited_range_changeInLength_invalidatedRange_ (NSTextStorage str, NSUInteger editedMask, NSRange newCharRange,
816 NSInteger delta, NSRange invalidatedCharRange)
817 {
818 OS.objc_msgSend(this.id, OS.sel_textStorage_1edited_1range_1changeInLength_1invalidatedRange_1, str !is null ? str.id : null, editedMask,
819 newCharRange, delta, invalidatedCharRange);
820 }
821
822 public NSTextView textViewForBeginningOfSelection ()
823 {
824 objc.id result = OS.objc_msgSend(this.id, OS.sel_textViewForBeginningOfSelection);
825 return result !is null ? new NSTextView(result) : null;
826 }
827
828 public NSTypesetter typesetter ()
829 {
830 objc.id result = OS.objc_msgSend(this.id, OS.sel_typesetter);
831 return result !is null ? new NSTypesetter(result) : null;
832 }
833
834 public NSTypesetterBehavior typesetterBehavior ()
835 {
836 return OS.objc_msgSend(this.id, OS.sel_typesetterBehavior);
837 }
838
839 public void underlineGlyphRange (NSRange glyphRange, NSInteger underlineVal, NSRect lineRect, NSRange lineGlyphRange, NSPoint containerOrigin)
840 {
841 OS.objc_msgSend(this.id, OS.sel_underlineGlyphRange_1underlineType_1lineFragmentRect_1lineFragmentGlyphRange_1containerOrigin_1, glyphRange,
842 underlineVal, lineRect, lineGlyphRange, containerOrigin);
843 }
844
845 public NSRect usedRectForTextContainer (NSTextContainer container)
846 {
847 NSRect result;
848 OS.objc_msgSend_stret(result, this.id, OS.sel_usedRectForTextContainer_1, container !is null ? container.id : null);
849 return result;
850 }
851
852 public bool usesFontLeading ()
853 {
854 return OS.objc_msgSend(this.id, OS.sel_usesFontLeading) !is null;
855 }
856
857 public bool usesScreenFonts ()
858 {
859 return OS.objc_msgSend(this.id, OS.sel_usesScreenFonts) !is null;
860 }
861
862 }