Mercurial > projects > dstep
diff dstep/appkit/NSLayoutManager.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 | f8a3b67adfcb |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dstep/appkit/NSLayoutManager.d Sun Jan 03 22:06:11 2010 +0100 @@ -0,0 +1,888 @@ +/** + * Copyright: Copyright (c) 2009 Jacob Carlborg. + * Authors: Jacob Carlborg + * Version: Initial created: Sep 24, 2009 + * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) + */ +module dstep.appkit.NSLayoutManager; + +import dstep.appkit.NSBox; +import dstep.appkit.NSCell; +import dstep.appkit.NSColor; +import dstep.appkit.NSEvent; +import dstep.appkit.NSFont; +import dstep.appkit.NSGlyphGenerator; +import dstep.appkit.NSImageCell; +import dstep.appkit.NSMatrix; +import dstep.appkit.NSParagraphStyle; +import dstep.appkit.NSRulerMarker; +import dstep.appkit.NSRulerView; +import dstep.appkit.NSTextContainer; +import dstep.appkit.NSTextField; +import dstep.appkit.NSTextStorage; +import dstep.appkit.NSTextTable; +import dstep.appkit.NSTextView; +import dstep.appkit.NSTypesetter; +import dstep.appkit.NSView; +import dstep.appkit.NSWindow; +import dstep.applicationservices.coregraphics.CGBase; +import dstep.foundation.NSArray; +import dstep.foundation.NSAttributedString; +import dstep.foundation.NSCoder; +import dstep.foundation.NSDictionary; +import dstep.foundation.NSGeometry; +import dstep.foundation.NSObjCRuntime; +import dstep.foundation.NSObject; +import dstep.foundation.NSRange; +import dstep.foundation.NSString; +import dstep.foundation.NSZone; +import dstep.objc.bridge.Bridge; +import dstep.objc.objc; + +alias NSUInteger NSGlyphInscription; +alias NSInteger NSTypesetterBehavior; + +enum +{ + NSGlyphAttributeSoft = 0, + NSGlyphAttributeElastic = 1, + NSGlyphAttributeBidiLevel = 2, + NSGlyphAttributeInscribe = 5 +} + +enum +{ + NSGlyphInscribeBase = 0, + NSGlyphInscribeBelow = 1, + NSGlyphInscribeAbove = 2, + NSGlyphInscribeOverstrike = 3, + NSGlyphInscribeOverBelow = 4 +} + +enum +{ + NSTypesetterLatestBehavior = -1, + NSTypesetterOriginalBehavior = 0, + NSTypesetterBehavior_10_2_WithCompatibility = 1, + NSTypesetterBehavior_10_2 = 2, + NSTypesetterBehavior_10_3 = 3, + NSTypesetterBehavior_10_4 = 4 +} + +const TNSTextViewSupport = ` + + NSArray rulerMarkersForTextView (NSTextView view, NSParagraphStyle style, NSRulerView ruler) + { + return invokeObjcSelf!(NSArray, "rulerMarkersForTextView:paragraphStyle:ruler:", NSTextView, NSParagraphStyle, NSRulerView)(view, style, ruler); + } + + NSView rulerAccessoryViewForTextView (NSTextView view, NSParagraphStyle style, NSRulerView ruler, bool isEnabled) + { + return invokeObjcSelf!(NSView, "rulerAccessoryViewForTextView:paragraphStyle:ruler:enabled:", NSTextView, NSParagraphStyle, NSRulerView, bool)(view, style, ruler, isEnabled); + } + + bool layoutManagerOwnsFirstResponderInWindow (NSWindow window) + { + return invokeObjcSelf!(bool, "layoutManagerOwnsFirstResponderInWindow:", NSWindow)(window); + } + + NSTextView firstTextView () + { + return invokeObjcSelf!(NSTextView, "firstTextView"); + } + + NSTextView textViewForBeginningOfSelection () + { + return invokeObjcSelf!(NSTextView, "textViewForBeginningOfSelection"); + } + + void drawBackgroundForGlyphRange (NSRange glyphsToShow, NSPoint origin) + { + return invokeObjcSelf!(void, "drawBackgroundForGlyphRange:atPoint:", NSRange, NSPoint)(glyphsToShow, origin); + } + + void drawGlyphsForGlyphRange (NSRange glyphsToShow, NSPoint origin) + { + return invokeObjcSelf!(void, "drawGlyphsForGlyphRange:atPoint:", NSRange, NSPoint)(glyphsToShow, origin); + } + + void showPackedGlyphs (char* glyphs, NSUInteger glyphLen, NSRange glyphRange, NSPoint point, NSFont font, NSColor color, NSSize printingAdjustment) + { + return invokeObjcSelf!(void, "showPackedGlyphs:length:glyphRange:atPoint:font:color:printingAdjustment:", char*, NSUInteger, NSRange, NSPoint, NSFont, NSColor, NSSize)(glyphs, glyphLen, glyphRange, point, font, color, printingAdjustment); + } + + void showAttachmentCell (NSCell cell, NSRect rect, NSUInteger attachmentIndex) + { + return invokeObjcSelf!(void, "showAttachmentCell:inRect:characterIndex:", NSCell, NSRect, NSUInteger)(cell, rect, attachmentIndex); + } + + void drawUnderlineForGlyphRange (NSRange glyphRange, NSInteger underlineVal, CGFloat baselineOffset, NSRect lineRect, NSRange lineGlyphRange, NSPoint containerOrigin) + { + return invokeObjcSelf!(void, "drawUnderlineForGlyphRange:underlineType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:", NSRange, NSInteger, CGFloat, NSRect, NSRange, NSPoint)(glyphRange, underlineVal, baselineOffset, lineRect, lineGlyphRange, containerOrigin); + } + + void underlineGlyphRange (NSRange glyphRange, NSInteger underlineVal, NSRect lineRect, NSRange lineGlyphRange, NSPoint containerOrigin) + { + return invokeObjcSelf!(void, "underlineGlyphRange:underlineType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:", NSRange, NSInteger, NSRect, NSRange, NSPoint)(glyphRange, underlineVal, lineRect, lineGlyphRange, containerOrigin); + } + + void drawStrikethroughForGlyphRange (NSRange glyphRange, NSInteger strikethroughVal, CGFloat baselineOffset, NSRect lineRect, NSRange lineGlyphRange, NSPoint containerOrigin) + { + return invokeObjcSelf!(void, "drawStrikethroughForGlyphRange:strikethroughType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:", NSRange, NSInteger, CGFloat, NSRect, NSRange, NSPoint)(glyphRange, strikethroughVal, baselineOffset, lineRect, lineGlyphRange, containerOrigin); + } + + void strikethroughGlyphRange (NSRange glyphRange, NSInteger strikethroughVal, NSRect lineRect, NSRange lineGlyphRange, NSPoint containerOrigin) + { + return invokeObjcSelf!(void, "strikethroughGlyphRange:strikethroughType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:", NSRange, NSInteger, NSRect, NSRange, NSPoint)(glyphRange, strikethroughVal, lineRect, lineGlyphRange, containerOrigin); + } + + //mixin ObjcBindMethod!(rulerMarkersForTextView, "rulerMarkersForTextView:paragraphStyle:ruler:"); + //mixin ObjcBindMethod!(rulerAccessoryViewForTextView, "rulerAccessoryViewForTextView:paragraphStyle:ruler:enabled:"); + //mixin ObjcBindMethod!(layoutManagerOwnsFirstResponderInWindow, "layoutManagerOwnsFirstResponderInWindow:"); + //mixin ObjcBindMethod!(firstTextView, "firstTextView"); + //mixin ObjcBindMethod!(textViewForBeginningOfSelection, "textViewForBeginningOfSelection"); + //mixin ObjcBindMethod!(drawBackgroundForGlyphRange, "drawBackgroundForGlyphRange:atPoint:"); + //mixin ObjcBindMethod!(drawGlyphsForGlyphRange, "drawGlyphsForGlyphRange:atPoint:"); + //mixin ObjcBindMethod!(showPackedGlyphs, "showPackedGlyphs:length:glyphRange:atPoint:font:color:printingAdjustment:"); + //mixin ObjcBindMethod!(showAttachmentCell, "showAttachmentCell:inRect:characterIndex:"); + //mixin ObjcBindMethod!(drawUnderlineForGlyphRange, "drawUnderlineForGlyphRange:underlineType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:"); + //mixin ObjcBindMethod!(underlineGlyphRange, "underlineGlyphRange:underlineType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:"); + //mixin ObjcBindMethod!(drawStrikethroughForGlyphRange, "drawStrikethroughForGlyphRange:strikethroughType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:"); + //mixin ObjcBindMethod!(strikethroughGlyphRange, "strikethroughGlyphRange:strikethroughType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:"); + +`; + +const TNSLayoutManagerDelegate = ` + + void layoutManagerDidInvalidateLayout (NSLayoutManager sender) + { + return invokeObjcSelf!(void, "layoutManagerDidInvalidateLayout:", NSLayoutManager)(sender); + } + + void layoutManager (NSLayoutManager layoutManager, NSTextContainer textContainer, bool layoutFinishedFlag) + { + return invokeObjcSelf!(void, "layoutManager:didCompleteLayoutForTextContainer:atEnd:", NSLayoutManager, NSTextContainer, bool)(layoutManager, textContainer, layoutFinishedFlag); + } + + NSDictionary layoutManager (NSLayoutManager layoutManager, NSDictionary attrs, bool toScreen, NSUInteger charIndex, NSRangePointer effectiveCharRange) + { + return invokeObjcSelf!(NSDictionary, "layoutManager:shouldUseTemporaryAttributes:forDrawingToScreen:atCharacterIndex:effectiveRange:", NSLayoutManager, NSDictionary, bool, NSUInteger, NSRangePointer)(layoutManager, attrs, toScreen, charIndex, effectiveCharRange); + } + + //mixin ObjcBindMethod!(layoutManagerDidInvalidateLayout, "layoutManagerDidInvalidateLayout:"); + //mixin ObjcBindMethod!(layoutManager, "layoutManager:didCompleteLayoutForTextContainer:atEnd:"); + //mixin ObjcBindMethod!(layoutManager, "layoutManager:shouldUseTemporaryAttributes:forDrawingToScreen:atCharacterIndex:effectiveRange:"); + +`; + +class NSLayoutManager : NSObject, INSCoding, INSGlyphStorage +{ + mixin (ObjcWrap); + + this (NSCoder aDecoder) + { + super(typeof(this).alloc.initWithCoder(aDecoder).objcObject); + } + + void encodeWithCoder (NSCoder aCoder) + { + return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder); + } + + typeof(this) initWithCoder (NSCoder aDecoder) + { + return invokeObjcSelf!(typeof(this), "initWithCoder:", NSCoder)(aDecoder); + } + + typeof(this) copyWithZone (NSZone* zone) + { + return invokeObjcSelf!(typeof(this), "copyWithZone:", NSZone*)(zone); + } + + NSLayoutManager init () + { + id result = invokeObjcSelf!(id, "init"); + return result is this.objcObject ? this : (result !is null ? new NSLayoutManager(result) : null); + } + + this () + { + super(NSLayoutManager.alloc.init.objcObject); + } + + NSTextStorage textStorage () + { + return invokeObjcSelf!(NSTextStorage, "textStorage"); + } + + void setTextStorage (NSTextStorage textStorage) + { + return invokeObjcSelf!(void, "setTextStorage:", NSTextStorage)(textStorage); + } + + NSAttributedString attributedString () + { + return invokeObjcSelf!(NSAttributedString, "attributedString"); + } + + void replaceTextStorage (NSTextStorage newTextStorage) + { + return invokeObjcSelf!(void, "replaceTextStorage:", NSTextStorage)(newTextStorage); + } + + NSGlyphGenerator glyphGenerator () + { + return invokeObjcSelf!(NSGlyphGenerator, "glyphGenerator"); + } + + void setGlyphGenerator (NSGlyphGenerator glyphGenerator) + { + return invokeObjcSelf!(void, "setGlyphGenerator:", NSGlyphGenerator)(glyphGenerator); + } + + NSTypesetter typesetter () + { + return invokeObjcSelf!(NSTypesetter, "typesetter"); + } + + void setTypesetter (NSTypesetter typesetter) + { + return invokeObjcSelf!(void, "setTypesetter:", NSTypesetter)(typesetter); + } + + Object delegate_ () + { + return invokeObjcSelf!(Object, "delegate"); + } + + void setDelegate (Object delegate_) + { + return invokeObjcSelf!(void, "setDelegate:", Object)(delegate_); + } + + NSArray textContainers () + { + return invokeObjcSelf!(NSArray, "textContainers"); + } + + void addTextContainer (NSTextContainer container) + { + return invokeObjcSelf!(void, "addTextContainer:", NSTextContainer)(container); + } + + void insertTextContainer (NSTextContainer container, NSUInteger index) + { + return invokeObjcSelf!(void, "insertTextContainer:atIndex:", NSTextContainer, NSUInteger)(container, index); + } + + void removeTextContainerAtIndex (NSUInteger index) + { + return invokeObjcSelf!(void, "removeTextContainerAtIndex:", NSUInteger)(index); + } + + void textContainerChangedGeometry (NSTextContainer container) + { + return invokeObjcSelf!(void, "textContainerChangedGeometry:", NSTextContainer)(container); + } + + void textContainerChangedTextView (NSTextContainer container) + { + return invokeObjcSelf!(void, "textContainerChangedTextView:", NSTextContainer)(container); + } + + void setBackgroundLayoutEnabled (bool flag) + { + return invokeObjcSelf!(void, "setBackgroundLayoutEnabled:", bool)(flag); + } + + bool backgroundLayoutEnabled () + { + return invokeObjcSelf!(bool, "backgroundLayoutEnabled"); + } + + void setUsesScreenFonts (bool flag) + { + return invokeObjcSelf!(void, "setUsesScreenFonts:", bool)(flag); + } + + bool usesScreenFonts () + { + return invokeObjcSelf!(bool, "usesScreenFonts"); + } + + void setShowsInvisibleCharacters (bool flag) + { + return invokeObjcSelf!(void, "setShowsInvisibleCharacters:", bool)(flag); + } + + bool showsInvisibleCharacters () + { + return invokeObjcSelf!(bool, "showsInvisibleCharacters"); + } + + void setShowsControlCharacters (bool flag) + { + return invokeObjcSelf!(void, "setShowsControlCharacters:", bool)(flag); + } + + bool showsControlCharacters () + { + return invokeObjcSelf!(bool, "showsControlCharacters"); + } + + void setHyphenationFactor (float factor) + { + return invokeObjcSelf!(void, "setHyphenationFactor:", float)(factor); + } + + float hyphenationFactor () + { + return invokeObjcSelf!(float, "hyphenationFactor"); + } + + void setDefaultAttachmentScaling (uint scaling) + { + return invokeObjcSelf!(void, "setDefaultAttachmentScaling:", uint)(scaling); + } + + uint defaultAttachmentScaling () + { + return invokeObjcSelf!(uint, "defaultAttachmentScaling"); + } + + void setTypesetterBehavior (int theBehavior) + { + return invokeObjcSelf!(void, "setTypesetterBehavior:", int)(theBehavior); + } + + int typesetterBehavior () + { + return invokeObjcSelf!(int, "typesetterBehavior"); + } + + NSUInteger layoutOptions () + { + return invokeObjcSelf!(NSUInteger, "layoutOptions"); + } + + void setAllowsNonContiguousLayout (bool flag) + { + return invokeObjcSelf!(void, "setAllowsNonContiguousLayout:", bool)(flag); + } + + bool allowsNonContiguousLayout () + { + return invokeObjcSelf!(bool, "allowsNonContiguousLayout"); + } + + bool hasNonContiguousLayout () + { + return invokeObjcSelf!(bool, "hasNonContiguousLayout"); + } + + void invalidateGlyphsForCharacterRange (NSRange charRange, NSInteger delta, NSRangePointer actualCharRange) + { + return invokeObjcSelf!(void, "invalidateGlyphsForCharacterRange:changeInLength:actualCharacterRange:", NSRange, NSInteger, NSRangePointer)(charRange, delta, actualCharRange); + } + + void invalidateLayoutForCharacterRange (NSRange charRange, NSRangePointer actualCharRange) + { + return invokeObjcSelf!(void, "invalidateLayoutForCharacterRange:actualCharacterRange:", NSRange, NSRangePointer)(charRange, actualCharRange); + } + + void invalidateLayoutForCharacterRange (NSRange charRange, bool flag, NSRangePointer actualCharRange) + { + return invokeObjcSelf!(void, "invalidateLayoutForCharacterRange:isSoft:actualCharacterRange:", NSRange, bool, NSRangePointer)(charRange, flag, actualCharRange); + } + + void invalidateDisplayForCharacterRange (NSRange charRange) + { + return invokeObjcSelf!(void, "invalidateDisplayForCharacterRange:", NSRange)(charRange); + } + + void invalidateDisplayForGlyphRange (NSRange glyphRange) + { + return invokeObjcSelf!(void, "invalidateDisplayForGlyphRange:", NSRange)(glyphRange); + } + + void textStorage (NSTextStorage str, NSUInteger editedMask, NSRange newCharRange, NSInteger delta, NSRange invalidatedCharRange) + { + return invokeObjcSelf!(void, "textStorage:edited:range:changeInLength:invalidatedRange:", NSTextStorage, NSUInteger, NSRange, NSInteger, NSRange)(str, editedMask, newCharRange, delta, invalidatedCharRange); + } + + void ensureGlyphsForCharacterRange (NSRange charRange) + { + return invokeObjcSelf!(void, "ensureGlyphsForCharacterRange:", NSRange)(charRange); + } + + void ensureGlyphsForGlyphRange (NSRange glyphRange) + { + return invokeObjcSelf!(void, "ensureGlyphsForGlyphRange:", NSRange)(glyphRange); + } + + void ensureLayoutForCharacterRange (NSRange charRange) + { + return invokeObjcSelf!(void, "ensureLayoutForCharacterRange:", NSRange)(charRange); + } + + void ensureLayoutForGlyphRange (NSRange glyphRange) + { + return invokeObjcSelf!(void, "ensureLayoutForGlyphRange:", NSRange)(glyphRange); + } + + void ensureLayoutForTextContainer (NSTextContainer container) + { + return invokeObjcSelf!(void, "ensureLayoutForTextContainer:", NSTextContainer)(container); + } + + void ensureLayoutForBoundingRect (NSRect bounds, NSTextContainer container) + { + return invokeObjcSelf!(void, "ensureLayoutForBoundingRect:inTextContainer:", NSRect, NSTextContainer)(bounds, container); + } + + void insertGlyphs (NSGlyph* glyphs, NSUInteger length, NSUInteger glyphIndex, NSUInteger charIndex) + { + return invokeObjcSelf!(void, "insertGlyphs:length:forStartingGlyphAtIndex:characterIndex:", NSGlyph*, NSUInteger, NSUInteger, NSUInteger)(glyphs, length, glyphIndex, charIndex); + } + + void insertGlyph (uint glyph, NSUInteger glyphIndex, NSUInteger charIndex) + { + return invokeObjcSelf!(void, "insertGlyph:atGlyphIndex:characterIndex:", uint, NSUInteger, NSUInteger)(glyph, glyphIndex, charIndex); + } + + void replaceGlyphAtIndex (NSUInteger glyphIndex, uint newGlyph) + { + return invokeObjcSelf!(void, "replaceGlyphAtIndex:withGlyph:", NSUInteger, uint)(glyphIndex, newGlyph); + } + + void deleteGlyphsInRange (NSRange glyphRange) + { + return invokeObjcSelf!(void, "deleteGlyphsInRange:", NSRange)(glyphRange); + } + + void setCharacterIndex (NSUInteger charIndex, NSUInteger glyphIndex) + { + return invokeObjcSelf!(void, "setCharacterIndex:forGlyphAtIndex:", NSUInteger, NSUInteger)(charIndex, glyphIndex); + } + + void setIntAttribute (NSInteger attributeTag, NSInteger val, NSUInteger glyphIndex) + { + return invokeObjcSelf!(void, "setIntAttribute:value:forGlyphAtIndex:", NSInteger, NSInteger, NSUInteger)(attributeTag, val, glyphIndex); + } + + void invalidateGlyphsOnLayoutInvalidationForGlyphRange (NSRange glyphRange) + { + return invokeObjcSelf!(void, "invalidateGlyphsOnLayoutInvalidationForGlyphRange:", NSRange)(glyphRange); + } + + NSUInteger numberOfGlyphs () + { + return invokeObjcSelf!(NSUInteger, "numberOfGlyphs"); + } + + uint glyphAtIndex (NSUInteger glyphIndex, bool* isValidIndex) + { + return invokeObjcSelf!(uint, "glyphAtIndex:isValidIndex:", NSUInteger, bool*)(glyphIndex, isValidIndex); + } + + uint glyphAtIndex (NSUInteger glyphIndex) + { + return invokeObjcSelf!(uint, "glyphAtIndex:", NSUInteger)(glyphIndex); + } + + bool isValidGlyphIndex (NSUInteger glyphIndex) + { + return invokeObjcSelf!(bool, "isValidGlyphIndex:", NSUInteger)(glyphIndex); + } + + NSUInteger characterIndexForGlyphAtIndex (NSUInteger glyphIndex) + { + return invokeObjcSelf!(NSUInteger, "characterIndexForGlyphAtIndex:", NSUInteger)(glyphIndex); + } + + NSUInteger glyphIndexForCharacterAtIndex (NSUInteger charIndex) + { + return invokeObjcSelf!(NSUInteger, "glyphIndexForCharacterAtIndex:", NSUInteger)(charIndex); + } + + NSInteger intAttribute (NSInteger attributeTag, NSUInteger glyphIndex) + { + return invokeObjcSelf!(NSInteger, "intAttribute:forGlyphAtIndex:", NSInteger, NSUInteger)(attributeTag, glyphIndex); + } + + NSUInteger getGlyphsInRange (NSRange glyphRange, NSGlyph* glyphBuffer, NSUInteger* charIndexBuffer, NSGlyphInscription* inscribeBuffer, bool* elasticBuffer) + { + return invokeObjcSelf!(NSUInteger, "getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:", NSRange, NSGlyph*, NSUInteger*, NSGlyphInscription*, bool*)(glyphRange, glyphBuffer, charIndexBuffer, inscribeBuffer, elasticBuffer); + } + + NSUInteger getGlyphsInRange (NSRange glyphRange, NSGlyph* glyphBuffer, NSUInteger* charIndexBuffer, NSGlyphInscription* inscribeBuffer, bool* elasticBuffer, char* bidiLevelBuffer) + { + return invokeObjcSelf!(NSUInteger, "getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:bidiLevels:", NSRange, NSGlyph*, NSUInteger*, NSGlyphInscription*, bool*, char*)(glyphRange, glyphBuffer, charIndexBuffer, inscribeBuffer, elasticBuffer, bidiLevelBuffer); + } + + NSUInteger getGlyphs (NSGlyph* glyphArray, NSRange glyphRange) + { + return invokeObjcSelf!(NSUInteger, "getGlyphs:range:", NSGlyph*, NSRange)(glyphArray, glyphRange); + } + + void setTextContainer (NSTextContainer container, NSRange glyphRange) + { + return invokeObjcSelf!(void, "setTextContainer:forGlyphRange:", NSTextContainer, NSRange)(container, glyphRange); + } + + void setLineFragmentRect (NSRect fragmentRect, NSRange glyphRange, NSRect usedRect) + { + return invokeObjcSelf!(void, "setLineFragmentRect:forGlyphRange:usedRect:", NSRect, NSRange, NSRect)(fragmentRect, glyphRange, usedRect); + } + + void setExtraLineFragmentRect (NSRect fragmentRect, NSRect usedRect, NSTextContainer container) + { + return invokeObjcSelf!(void, "setExtraLineFragmentRect:usedRect:textContainer:", NSRect, NSRect, NSTextContainer)(fragmentRect, usedRect, container); + } + + void setLocation (NSPoint location, NSRange glyphRange) + { + return invokeObjcSelf!(void, "setLocation:forStartOfGlyphRange:", NSPoint, NSRange)(location, glyphRange); + } + + void setLocations (NSPointArray locations, NSUInteger* glyphIndexes, NSUInteger count, NSRange glyphRange) + { + return invokeObjcSelf!(void, "setLocations:startingGlyphIndexes:count:forGlyphRange:", NSPointArray, NSUInteger*, NSUInteger, NSRange)(locations, glyphIndexes, count, glyphRange); + } + + void setNotShownAttribute (bool flag, NSUInteger glyphIndex) + { + return invokeObjcSelf!(void, "setNotShownAttribute:forGlyphAtIndex:", bool, NSUInteger)(flag, glyphIndex); + } + + void setDrawsOutsideLineFragment (bool flag, NSUInteger glyphIndex) + { + return invokeObjcSelf!(void, "setDrawsOutsideLineFragment:forGlyphAtIndex:", bool, NSUInteger)(flag, glyphIndex); + } + + void setAttachmentSize (NSSize attachmentSize, NSRange glyphRange) + { + return invokeObjcSelf!(void, "setAttachmentSize:forGlyphRange:", NSSize, NSRange)(attachmentSize, glyphRange); + } + + void getFirstUnlaidCharacterIndex (NSUInteger* charIndex, NSUInteger* glyphIndex) + { + return invokeObjcSelf!(void, "getFirstUnlaidCharacterIndex:glyphIndex:", NSUInteger*, NSUInteger*)(charIndex, glyphIndex); + } + + NSUInteger firstUnlaidCharacterIndex () + { + return invokeObjcSelf!(NSUInteger, "firstUnlaidCharacterIndex"); + } + + NSUInteger firstUnlaidGlyphIndex () + { + return invokeObjcSelf!(NSUInteger, "firstUnlaidGlyphIndex"); + } + + NSTextContainer textContainerForGlyphAtIndex (NSUInteger glyphIndex, NSRangePointer effectiveGlyphRange) + { + return invokeObjcSelf!(NSTextContainer, "textContainerForGlyphAtIndex:effectiveRange:", NSUInteger, NSRangePointer)(glyphIndex, effectiveGlyphRange); + } + + NSRect usedRectForTextContainer (NSTextContainer container) + { + return invokeObjcSelf!(NSRect, "usedRectForTextContainer:", NSTextContainer)(container); + } + + NSRect lineFragmentRectForGlyphAtIndex (NSUInteger glyphIndex, NSRangePointer effectiveGlyphRange) + { + return invokeObjcSelf!(NSRect, "lineFragmentRectForGlyphAtIndex:effectiveRange:", NSUInteger, NSRangePointer)(glyphIndex, effectiveGlyphRange); + } + + NSRect lineFragmentUsedRectForGlyphAtIndex (NSUInteger glyphIndex, NSRangePointer effectiveGlyphRange) + { + return invokeObjcSelf!(NSRect, "lineFragmentUsedRectForGlyphAtIndex:effectiveRange:", NSUInteger, NSRangePointer)(glyphIndex, effectiveGlyphRange); + } + + NSRect lineFragmentRectForGlyphAtIndex (NSUInteger glyphIndex, NSRangePointer effectiveGlyphRange, bool flag) + { + return invokeObjcSelf!(NSRect, "lineFragmentRectForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:", NSUInteger, NSRangePointer, bool)(glyphIndex, effectiveGlyphRange, flag); + } + + NSRect lineFragmentUsedRectForGlyphAtIndex (NSUInteger glyphIndex, NSRangePointer effectiveGlyphRange, bool flag) + { + return invokeObjcSelf!(NSRect, "lineFragmentUsedRectForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:", NSUInteger, NSRangePointer, bool)(glyphIndex, effectiveGlyphRange, flag); + } + + NSTextContainer textContainerForGlyphAtIndex (NSUInteger glyphIndex, NSRangePointer effectiveGlyphRange, bool flag) + { + return invokeObjcSelf!(NSTextContainer, "textContainerForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:", NSUInteger, NSRangePointer, bool)(glyphIndex, effectiveGlyphRange, flag); + } + + NSRect extraLineFragmentRect () + { + return invokeObjcSelf!(NSRect, "extraLineFragmentRect"); + } + + NSRect extraLineFragmentUsedRect () + { + return invokeObjcSelf!(NSRect, "extraLineFragmentUsedRect"); + } + + NSTextContainer extraLineFragmentTextContainer () + { + return invokeObjcSelf!(NSTextContainer, "extraLineFragmentTextContainer"); + } + + NSPoint locationForGlyphAtIndex (NSUInteger glyphIndex) + { + return invokeObjcSelf!(NSPoint, "locationForGlyphAtIndex:", NSUInteger)(glyphIndex); + } + + bool notShownAttributeForGlyphAtIndex (NSUInteger glyphIndex) + { + return invokeObjcSelf!(bool, "notShownAttributeForGlyphAtIndex:", NSUInteger)(glyphIndex); + } + + bool drawsOutsideLineFragmentForGlyphAtIndex (NSUInteger glyphIndex) + { + return invokeObjcSelf!(bool, "drawsOutsideLineFragmentForGlyphAtIndex:", NSUInteger)(glyphIndex); + } + + NSSize attachmentSizeForGlyphAtIndex (NSUInteger glyphIndex) + { + return invokeObjcSelf!(NSSize, "attachmentSizeForGlyphAtIndex:", NSUInteger)(glyphIndex); + } + + void setLayoutRect (NSRect rect, NSTextBlock block, NSRange glyphRange) + { + return invokeObjcSelf!(void, "setLayoutRect:forTextBlock:glyphRange:", NSRect, NSTextBlock, NSRange)(rect, block, glyphRange); + } + + void setBoundsRect (NSRect rect, NSTextBlock block, NSRange glyphRange) + { + return invokeObjcSelf!(void, "setBoundsRect:forTextBlock:glyphRange:", NSRect, NSTextBlock, NSRange)(rect, block, glyphRange); + } + + NSRect layoutRectForTextBlock (NSTextBlock block, NSRange glyphRange) + { + return invokeObjcSelf!(NSRect, "layoutRectForTextBlock:glyphRange:", NSTextBlock, NSRange)(block, glyphRange); + } + + NSRect boundsRectForTextBlock (NSTextBlock block, NSRange glyphRange) + { + return invokeObjcSelf!(NSRect, "boundsRectForTextBlock:glyphRange:", NSTextBlock, NSRange)(block, glyphRange); + } + + NSRect layoutRectForTextBlock (NSTextBlock block, NSUInteger glyphIndex, NSRangePointer effectiveGlyphRange) + { + return invokeObjcSelf!(NSRect, "layoutRectForTextBlock:atIndex:effectiveRange:", NSTextBlock, NSUInteger, NSRangePointer)(block, glyphIndex, effectiveGlyphRange); + } + + NSRect boundsRectForTextBlock (NSTextBlock block, NSUInteger glyphIndex, NSRangePointer effectiveGlyphRange) + { + return invokeObjcSelf!(NSRect, "boundsRectForTextBlock:atIndex:effectiveRange:", NSTextBlock, NSUInteger, NSRangePointer)(block, glyphIndex, effectiveGlyphRange); + } + + NSRange glyphRangeForCharacterRange (NSRange charRange, NSRangePointer actualCharRange) + { + return invokeObjcSelf!(NSRange, "glyphRangeForCharacterRange:actualCharacterRange:", NSRange, NSRangePointer)(charRange, actualCharRange); + } + + NSRange characterRangeForGlyphRange (NSRange glyphRange, NSRangePointer actualGlyphRange) + { + return invokeObjcSelf!(NSRange, "characterRangeForGlyphRange:actualGlyphRange:", NSRange, NSRangePointer)(glyphRange, actualGlyphRange); + } + + NSRange glyphRangeForTextContainer (NSTextContainer container) + { + return invokeObjcSelf!(NSRange, "glyphRangeForTextContainer:", NSTextContainer)(container); + } + + NSRange rangeOfNominallySpacedGlyphsContainingIndex (NSUInteger glyphIndex) + { + return invokeObjcSelf!(NSRange, "rangeOfNominallySpacedGlyphsContainingIndex:", NSUInteger)(glyphIndex); + } + + NSRectArray rectArrayForCharacterRange (NSRange charRange, NSRange selCharRange, NSTextContainer container, NSUInteger* rectCount) + { + return invokeObjcSelf!(NSRectArray, "rectArrayForCharacterRange:withinSelectedCharacterRange:inTextContainer:rectCount:", NSRange, NSRange, NSTextContainer, NSUInteger*)(charRange, selCharRange, container, rectCount); + } + + NSRectArray rectArrayForGlyphRange (NSRange glyphRange, NSRange selGlyphRange, NSTextContainer container, NSUInteger* rectCount) + { + return invokeObjcSelf!(NSRectArray, "rectArrayForGlyphRange:withinSelectedGlyphRange:inTextContainer:rectCount:", NSRange, NSRange, NSTextContainer, NSUInteger*)(glyphRange, selGlyphRange, container, rectCount); + } + + NSRect boundingRectForGlyphRange (NSRange glyphRange, NSTextContainer container) + { + return invokeObjcSelf!(NSRect, "boundingRectForGlyphRange:inTextContainer:", NSRange, NSTextContainer)(glyphRange, container); + } + + NSRange glyphRangeForBoundingRect (NSRect bounds, NSTextContainer container) + { + return invokeObjcSelf!(NSRange, "glyphRangeForBoundingRect:inTextContainer:", NSRect, NSTextContainer)(bounds, container); + } + + NSRange glyphRangeForBoundingRectWithoutAdditionalLayout (NSRect bounds, NSTextContainer container) + { + return invokeObjcSelf!(NSRange, "glyphRangeForBoundingRectWithoutAdditionalLayout:inTextContainer:", NSRect, NSTextContainer)(bounds, container); + } + + NSUInteger glyphIndexForPoint (NSPoint point, NSTextContainer container, CGFloat* partialFraction) + { + return invokeObjcSelf!(NSUInteger, "glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:", NSPoint, NSTextContainer, CGFloat*)(point, container, partialFraction); + } + + NSUInteger glyphIndexForPoint (NSPoint point, NSTextContainer container) + { + return invokeObjcSelf!(NSUInteger, "glyphIndexForPoint:inTextContainer:", NSPoint, NSTextContainer)(point, container); + } + + CGFloat fractionOfDistanceThroughGlyphForPoint (NSPoint point, NSTextContainer container) + { + return invokeObjcSelf!(CGFloat, "fractionOfDistanceThroughGlyphForPoint:inTextContainer:", NSPoint, NSTextContainer)(point, container); + } + + NSUInteger getLineFragmentInsertionPointsForCharacterAtIndex (NSUInteger charIndex, bool aFlag, bool dFlag, CGFloat* positions, NSUInteger* charIndexes) + { + return invokeObjcSelf!(NSUInteger, "getLineFragmentInsertionPointsForCharacterAtIndex:alternatePositions:inDisplayOrder:positions:characterIndexes:", NSUInteger, bool, bool, CGFloat*, NSUInteger*)(charIndex, aFlag, dFlag, positions, charIndexes); + } + + NSDictionary temporaryAttributesAtCharacterIndex (NSUInteger charIndex, NSRangePointer effectiveCharRange) + { + return invokeObjcSelf!(NSDictionary, "temporaryAttributesAtCharacterIndex:effectiveRange:", NSUInteger, NSRangePointer)(charIndex, effectiveCharRange); + } + + void setTemporaryAttributes (NSDictionary attrs, NSRange charRange) + { + return invokeObjcSelf!(void, "setTemporaryAttributes:forCharacterRange:", NSDictionary, NSRange)(attrs, charRange); + } + + void addTemporaryAttributes (NSDictionary attrs, NSRange charRange) + { + return invokeObjcSelf!(void, "addTemporaryAttributes:forCharacterRange:", NSDictionary, NSRange)(attrs, charRange); + } + + void removeTemporaryAttribute (NSString attrName, NSRange charRange) + { + return invokeObjcSelf!(void, "removeTemporaryAttribute:forCharacterRange:", NSString, NSRange)(attrName, charRange); + } + + Object temporaryAttribute (NSString attrName, NSUInteger location, NSRangePointer range) + { + return invokeObjcSelf!(Object, "temporaryAttribute:atCharacterIndex:effectiveRange:", NSString, NSUInteger, NSRangePointer)(attrName, location, range); + } + + Object temporaryAttribute (NSString attrName, NSUInteger location, NSRangePointer range, NSRange rangeLimit) + { + return invokeObjcSelf!(Object, "temporaryAttribute:atCharacterIndex:longestEffectiveRange:inRange:", NSString, NSUInteger, NSRangePointer, NSRange)(attrName, location, range, rangeLimit); + } + + NSDictionary temporaryAttributesAtCharacterIndex (NSUInteger location, NSRangePointer range, NSRange rangeLimit) + { + return invokeObjcSelf!(NSDictionary, "temporaryAttributesAtCharacterIndex:longestEffectiveRange:inRange:", NSUInteger, NSRangePointer, NSRange)(location, range, rangeLimit); + } + + void addTemporaryAttribute (NSString attrName, Object value, NSRange charRange) + { + return invokeObjcSelf!(void, "addTemporaryAttribute:value:forCharacterRange:", NSString, Object, NSRange)(attrName, value, charRange); + } + + NSFont substituteFontForFont (NSFont originalFont) + { + return invokeObjcSelf!(NSFont, "substituteFontForFont:", NSFont)(originalFont); + } + + CGFloat defaultLineHeightForFont (NSFont theFont) + { + return invokeObjcSelf!(CGFloat, "defaultLineHeightForFont:", NSFont)(theFont); + } + + CGFloat defaultBaselineOffsetForFont (NSFont theFont) + { + return invokeObjcSelf!(CGFloat, "defaultBaselineOffsetForFont:", NSFont)(theFont); + } + + bool usesFontLeading () + { + return invokeObjcSelf!(bool, "usesFontLeading"); + } + + void setUsesFontLeading (bool flag) + { + return invokeObjcSelf!(void, "setUsesFontLeading:", bool)(flag); + } + + void insertGlyphs (NSGlyph* glyphs, NSUInteger length, NSUInteger glyphIndex, NSUInteger charIndex) + { + return invokeObjcSelf!(void, "insertGlyphs:length:forStartingGlyphAtIndex:characterIndex:", NSGlyph*, NSUInteger, NSUInteger, NSUInteger)(glyphs, length, glyphIndex, charIndex); + } + + void setIntAttribute (NSInteger attributeTag, NSInteger val, NSUInteger glyphIndex) + { + return invokeObjcSelf!(void, "setIntAttribute:value:forGlyphAtIndex:", NSInteger, NSInteger, NSUInteger)(attributeTag, val, glyphIndex); + } + + // NSTextViewSupport + NSArray rulerMarkersForTextView (NSTextView view, NSParagraphStyle style, NSRulerView ruler) + { + return invokeObjcSelf!(NSArray, "rulerMarkersForTextView:paragraphStyle:ruler:", NSTextView, NSParagraphStyle, NSRulerView)(view, style, ruler); + } + + NSView rulerAccessoryViewForTextView (NSTextView view, NSParagraphStyle style, NSRulerView ruler, bool isEnabled) + { + return invokeObjcSelf!(NSView, "rulerAccessoryViewForTextView:paragraphStyle:ruler:enabled:", NSTextView, NSParagraphStyle, NSRulerView, bool)(view, style, ruler, isEnabled); + } + + bool layoutManagerOwnsFirstResponderInWindow (NSWindow window) + { + return invokeObjcSelf!(bool, "layoutManagerOwnsFirstResponderInWindow:", NSWindow)(window); + } + + NSTextView firstTextView () + { + return invokeObjcSelf!(NSTextView, "firstTextView"); + } + + NSTextView textViewForBeginningOfSelection () + { + return invokeObjcSelf!(NSTextView, "textViewForBeginningOfSelection"); + } + + void drawBackgroundForGlyphRange (NSRange glyphsToShow, NSPoint origin) + { + return invokeObjcSelf!(void, "drawBackgroundForGlyphRange:atPoint:", NSRange, NSPoint)(glyphsToShow, origin); + } + + void drawGlyphsForGlyphRange (NSRange glyphsToShow, NSPoint origin) + { + return invokeObjcSelf!(void, "drawGlyphsForGlyphRange:atPoint:", NSRange, NSPoint)(glyphsToShow, origin); + } + + void showPackedGlyphs (char* glyphs, NSUInteger glyphLen, NSRange glyphRange, NSPoint point, NSFont font, NSColor color, NSSize printingAdjustment) + { + return invokeObjcSelf!(void, "showPackedGlyphs:length:glyphRange:atPoint:font:color:printingAdjustment:", char*, NSUInteger, NSRange, NSPoint, NSFont, NSColor, NSSize)(glyphs, glyphLen, glyphRange, point, font, color, printingAdjustment); + } + + void showAttachmentCell (NSCell cell, NSRect rect, NSUInteger attachmentIndex) + { + return invokeObjcSelf!(void, "showAttachmentCell:inRect:characterIndex:", NSCell, NSRect, NSUInteger)(cell, rect, attachmentIndex); + } + + void drawUnderlineForGlyphRange (NSRange glyphRange, NSInteger underlineVal, CGFloat baselineOffset, NSRect lineRect, NSRange lineGlyphRange, NSPoint containerOrigin) + { + return invokeObjcSelf!(void, "drawUnderlineForGlyphRange:underlineType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:", NSRange, NSInteger, CGFloat, NSRect, NSRange, NSPoint)(glyphRange, underlineVal, baselineOffset, lineRect, lineGlyphRange, containerOrigin); + } + + void underlineGlyphRange (NSRange glyphRange, NSInteger underlineVal, NSRect lineRect, NSRange lineGlyphRange, NSPoint containerOrigin) + { + return invokeObjcSelf!(void, "underlineGlyphRange:underlineType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:", NSRange, NSInteger, NSRect, NSRange, NSPoint)(glyphRange, underlineVal, lineRect, lineGlyphRange, containerOrigin); + } + + void drawStrikethroughForGlyphRange (NSRange glyphRange, NSInteger strikethroughVal, CGFloat baselineOffset, NSRect lineRect, NSRange lineGlyphRange, NSPoint containerOrigin) + { + return invokeObjcSelf!(void, "drawStrikethroughForGlyphRange:strikethroughType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:", NSRange, NSInteger, CGFloat, NSRect, NSRange, NSPoint)(glyphRange, strikethroughVal, baselineOffset, lineRect, lineGlyphRange, containerOrigin); + } + + void strikethroughGlyphRange (NSRange glyphRange, NSInteger strikethroughVal, NSRect lineRect, NSRange lineGlyphRange, NSPoint containerOrigin) + { + return invokeObjcSelf!(void, "strikethroughGlyphRange:strikethroughType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:", NSRange, NSInteger, NSRect, NSRange, NSPoint)(glyphRange, strikethroughVal, lineRect, lineGlyphRange, containerOrigin); + } +} \ No newline at end of file