Mercurial > projects > dstep
diff dstep/appkit/NSTextView.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/NSTextView.d Sun Jan 03 22:06:11 2010 +0100 @@ -0,0 +1,2032 @@ +/** + * 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.NSTextView; + +import dstep.appkit.AppKitDefines; +import dstep.appkit.NSColor; +import dstep.appkit.NSDragging; +import dstep.appkit.NSEvent; +import dstep.appkit.NSImage; +import dstep.appkit.NSInputManager; +import dstep.appkit.NSLayoutManager; +import dstep.appkit.NSMenu; +import dstep.appkit.NSParagraphStyle; +import dstep.appkit.NSPasteboard; +import dstep.appkit.NSRulerMarker; +import dstep.appkit.NSRulerView; +import dstep.appkit.NSText; +import dstep.appkit.NSTextAttachment; +import dstep.appkit.NSTextContainer; +import dstep.appkit.NSTextInputClient; +import dstep.appkit.NSTextStorage; +import dstep.appkit.NSUserInterfaceValidation; +import dstep.applicationservices.coregraphics.CGBase; +import dstep.foundation.NSArray; +import dstep.foundation.NSAttributedString; +import dstep.foundation.NSDictionary; +import dstep.foundation.NSGeometry; +import dstep.foundation.NSNotification; +import dstep.foundation.NSObjCRuntime; +import dstep.foundation.NSObject; +import dstep.foundation.NSRange; +import dstep.foundation.NSUndoManager; +import dstep.foundation.NSString; +import dstep.objc.bridge.Bridge; +import dstep.objc.objc; + +import bindings = dstep.appkit.NSTextView_bindings; + +typedef NSUInteger NSSelectionGranularity; +typedef NSUInteger NSSelectionAffinity; +typedef NSUInteger NSFindPanelAction; +typedef NSUInteger NSFindPanelSubstringMatchType; + +private +{ + NSString NSFindPanelSearchOptionsPboardType_; + NSString NSFindPanelCaseInsensitiveSearch_; + NSString NSFindPanelSubstringMatch_; + NSString NSAllRomanInputSourcesLocaleIdentifier_; + NSString NSTextViewWillChangeNotifyingTextViewNotification_; + NSString NSTextViewDidChangeSelectionNotification_; + NSString NSTextViewDidChangeTypingAttributesNotification_; +} + +NSString NSFindPanelSearchOptionsPboardType () +{ + if (NSFindPanelSearchOptionsPboardType_) + return NSFindPanelSearchOptionsPboardType_; + + return NSFindPanelSearchOptionsPboardType_ = new NSString(bindings.NSFindPanelSearchOptionsPboardType); +} + +NSString NSFindPanelCaseInsensitiveSearch () +{ + if (NSFindPanelCaseInsensitiveSearch_) + return NSFindPanelCaseInsensitiveSearch_; + + return NSFindPanelCaseInsensitiveSearch_ = new NSString(bindings.NSFindPanelCaseInsensitiveSearch); +} + +NSString NSFindPanelSubstringMatch () +{ + if (NSFindPanelSubstringMatch_) + return NSFindPanelSubstringMatch_; + + return NSFindPanelSubstringMatch_ = new NSString(bindings.NSFindPanelSubstringMatch); +} + +NSString NSAllRomanInputSourcesLocaleIdentifier () +{ + if (NSAllRomanInputSourcesLocaleIdentifier_) + return NSAllRomanInputSourcesLocaleIdentifier_; + + return NSAllRomanInputSourcesLocaleIdentifier_ = new NSString(bindings.NSAllRomanInputSourcesLocaleIdentifier); +} + +NSString NSTextViewWillChangeNotifyingTextViewNotification () +{ + if (NSTextViewWillChangeNotifyingTextViewNotification_) + return NSTextViewWillChangeNotifyingTextViewNotification_; + + return NSTextViewWillChangeNotifyingTextViewNotification_ = new NSString(bindings.NSTextViewWillChangeNotifyingTextViewNotification); +} + +NSString NSTextViewDidChangeSelectionNotification () +{ + if (NSTextViewDidChangeSelectionNotification_) + return NSTextViewDidChangeSelectionNotification_; + + return NSTextViewDidChangeSelectionNotification_ = new NSString(bindings.NSTextViewDidChangeSelectionNotification); +} + +NSString NSTextViewDidChangeTypingAttributesNotification () +{ + if (NSTextViewDidChangeTypingAttributesNotification_) + return NSTextViewDidChangeTypingAttributesNotification_; + + return NSTextViewDidChangeTypingAttributesNotification_ = new NSString(bindings.NSTextViewDidChangeTypingAttributesNotification); +} + +enum : NSUInteger +{ + NSSelectByCharacter = 0, + NSSelectByWord = 1, + NSSelectByParagraph = 2 +} + +enum : NSUInteger +{ + NSSelectionAffinityUpstream = 0, + NSSelectionAffinityDownstream = 1 +} + +enum : NSUInteger +{ + NSFindPanelActionShowFindPanel = 1, + NSFindPanelActionNext = 2, + NSFindPanelActionPrevious = 3, + NSFindPanelActionReplaceAll = 4, + NSFindPanelActionReplace = 5, + NSFindPanelActionReplaceAndFind = 6, + NSFindPanelActionSetFindString = 7, + NSFindPanelActionReplaceAllInSelection = 8, + NSFindPanelActionSelectAll = 9, + NSFindPanelActionSelectAllInSelection = 10 +} + +enum : NSUInteger +{ + NSFindPanelSubstringMatchTypeContains = 0, + NSFindPanelSubstringMatchTypeStartsWith = 1, + NSFindPanelSubstringMatchTypeFullWord = 2, + NSFindPanelSubstringMatchTypeEndsWith = 3 +} + +const TNSDragging = ` + + bool dragSelectionWithEvent (NSEvent event, NSSize mouseOffset, bool slideBack) + { + return invokeObjcSelf!(bool, "dragSelectionWithEvent:offset:slideBack:", NSEvent, NSSize, bool)(event, mouseOffset, slideBack); + } + + NSImage dragImageForSelectionWithEvent (NSEvent event, NSPointPointer origin) + { + return invokeObjcSelf!(NSImage, "dragImageForSelectionWithEvent:origin:", NSEvent, NSPointPointer)(event, origin); + } + + NSArray acceptableDragTypes () + { + return invokeObjcSelf!(NSArray, "acceptableDragTypes"); + } + + uint dragOperationForDraggingInfo (INSDraggingInfo dragInfo, NSString type) + { + return invokeObjcSelf!(uint, "dragOperationForDraggingInfo:type:", INSDraggingInfo, NSString)(dragInfo, type); + } + + void cleanUpAfterDragOperation () + { + return invokeObjcSelf!(void, "cleanUpAfterDragOperation"); + } + + //mixin ObjcBindMethod!(dragSelectionWithEvent, "dragSelectionWithEvent:offset:slideBack:"); + //mixin ObjcBindMethod!(dragImageForSelectionWithEvent, "dragImageForSelectionWithEvent:origin:"); + //mixin ObjcBindMethod!(acceptableDragTypes, "acceptableDragTypes"); + //mixin ObjcBindMethod!(dragOperationForDraggingInfo, "dragOperationForDraggingInfo:type:"); + //mixin ObjcBindMethod!(cleanUpAfterDragOperation, "cleanUpAfterDragOperation"); + +`; + +const TNSCompletion = ` + + void complete (Object sender) + { + return invokeObjcSelf!(void, "complete:", Object)(sender); + } + + NSRange rangeForUserCompletion () + { + return invokeObjcSelf!(NSRange, "rangeForUserCompletion"); + } + + NSArray completionsForPartialWordRange (NSRange charRange, NSInteger* index) + { + return invokeObjcSelf!(NSArray, "completionsForPartialWordRange:indexOfSelectedItem:", NSRange, NSInteger*)(charRange, index); + } + + void insertCompletion (NSString word, NSRange charRange, NSInteger movement, bool flag) + { + return invokeObjcSelf!(void, "insertCompletion:forPartialWordRange:movement:isFinal:", NSString, NSRange, NSInteger, bool)(word, charRange, movement, flag); + } + + //mixin ObjcBindMethod!(complete, "complete:"); + //mixin ObjcBindMethod!(rangeForUserCompletion, "rangeForUserCompletion"); + //mixin ObjcBindMethod!(completionsForPartialWordRange, "completionsForPartialWordRange:indexOfSelectedItem:"); + //mixin ObjcBindMethod!(insertCompletion, "insertCompletion:forPartialWordRange:movement:isFinal:"); + +`; + +const TNSSharing = ` + + NSArray selectedRanges () + { + return invokeObjcSelf!(NSArray, "selectedRanges"); + } + + void setSelectedRanges (NSArray ranges, uint affinity, bool stillSelectingFlag) + { + return invokeObjcSelf!(void, "setSelectedRanges:affinity:stillSelecting:", NSArray, uint, bool)(ranges, affinity, stillSelectingFlag); + } + + void setSelectedRanges (NSArray ranges) + { + return invokeObjcSelf!(void, "setSelectedRanges:", NSArray)(ranges); + } + + void setSelectedRange (NSRange charRange, uint affinity, bool stillSelectingFlag) + { + return invokeObjcSelf!(void, "setSelectedRange:affinity:stillSelecting:", NSRange, uint, bool)(charRange, affinity, stillSelectingFlag); + } + + uint selectionAffinity () + { + return invokeObjcSelf!(uint, "selectionAffinity"); + } + + uint selectionGranularity () + { + return invokeObjcSelf!(uint, "selectionGranularity"); + } + + void setSelectionGranularity (uint granularity) + { + return invokeObjcSelf!(void, "setSelectionGranularity:", uint)(granularity); + } + + void setSelectedTextAttributes (NSDictionary attributeDictionary) + { + return invokeObjcSelf!(void, "setSelectedTextAttributes:", NSDictionary)(attributeDictionary); + } + + NSDictionary selectedTextAttributes () + { + return invokeObjcSelf!(NSDictionary, "selectedTextAttributes"); + } + + void setInsertionPointColor (NSColor color) + { + return invokeObjcSelf!(void, "setInsertionPointColor:", NSColor)(color); + } + + NSColor insertionPointColor () + { + return invokeObjcSelf!(NSColor, "insertionPointColor"); + } + + void updateInsertionPointStateAndRestartTimer (bool restartFlag) + { + return invokeObjcSelf!(void, "updateInsertionPointStateAndRestartTimer:", bool)(restartFlag); + } + + void setMarkedTextAttributes (NSDictionary attributeDictionary) + { + return invokeObjcSelf!(void, "setMarkedTextAttributes:", NSDictionary)(attributeDictionary); + } + + NSDictionary markedTextAttributes () + { + return invokeObjcSelf!(NSDictionary, "markedTextAttributes"); + } + + void setLinkTextAttributes (NSDictionary attributeDictionary) + { + return invokeObjcSelf!(void, "setLinkTextAttributes:", NSDictionary)(attributeDictionary); + } + + NSDictionary linkTextAttributes () + { + return invokeObjcSelf!(NSDictionary, "linkTextAttributes"); + } + + bool displaysLinkToolTips () + { + return invokeObjcSelf!(bool, "displaysLinkToolTips"); + } + + void setDisplaysLinkToolTips (bool flag) + { + return invokeObjcSelf!(void, "setDisplaysLinkToolTips:", bool)(flag); + } + + bool acceptsGlyphInfo () + { + return invokeObjcSelf!(bool, "acceptsGlyphInfo"); + } + + void setAcceptsGlyphInfo (bool flag) + { + return invokeObjcSelf!(void, "setAcceptsGlyphInfo:", bool)(flag); + } + + void setRulerVisible (bool flag) + { + return invokeObjcSelf!(void, "setRulerVisible:", bool)(flag); + } + + bool usesRuler () + { + return invokeObjcSelf!(bool, "usesRuler"); + } + + void setUsesRuler (bool flag) + { + return invokeObjcSelf!(void, "setUsesRuler:", bool)(flag); + } + + void setContinuousSpellCheckingEnabled (bool flag) + { + return invokeObjcSelf!(void, "setContinuousSpellCheckingEnabled:", bool)(flag); + } + + bool isContinuousSpellCheckingEnabled () + { + return invokeObjcSelf!(bool, "isContinuousSpellCheckingEnabled"); + } + + void toggleContinuousSpellChecking (Object sender) + { + return invokeObjcSelf!(void, "toggleContinuousSpellChecking:", Object)(sender); + } + + NSInteger spellCheckerDocumentTag () + { + return invokeObjcSelf!(NSInteger, "spellCheckerDocumentTag"); + } + + void setGrammarCheckingEnabled (bool flag) + { + return invokeObjcSelf!(void, "setGrammarCheckingEnabled:", bool)(flag); + } + + bool isGrammarCheckingEnabled () + { + return invokeObjcSelf!(bool, "isGrammarCheckingEnabled"); + } + + void toggleGrammarChecking (Object sender) + { + return invokeObjcSelf!(void, "toggleGrammarChecking:", Object)(sender); + } + + void setSpellingState (NSInteger value, NSRange charRange) + { + return invokeObjcSelf!(void, "setSpellingState:range:", NSInteger, NSRange)(value, charRange); + } + + NSDictionary typingAttributes () + { + return invokeObjcSelf!(NSDictionary, "typingAttributes"); + } + + void setTypingAttributes (NSDictionary attrs) + { + return invokeObjcSelf!(void, "setTypingAttributes:", NSDictionary)(attrs); + } + + bool shouldChangeTextInRanges (NSArray affectedRanges, NSArray replacementStrings) + { + return invokeObjcSelf!(bool, "shouldChangeTextInRanges:replacementStrings:", NSArray, NSArray)(affectedRanges, replacementStrings); + } + + NSArray rangesForUserTextChange () + { + return invokeObjcSelf!(NSArray, "rangesForUserTextChange"); + } + + NSArray rangesForUserCharacterAttributeChange () + { + return invokeObjcSelf!(NSArray, "rangesForUserCharacterAttributeChange"); + } + + NSArray rangesForUserParagraphAttributeChange () + { + return invokeObjcSelf!(NSArray, "rangesForUserParagraphAttributeChange"); + } + + bool shouldChangeTextInRange (NSRange affectedCharRange, NSString replacementString) + { + return invokeObjcSelf!(bool, "shouldChangeTextInRange:replacementString:", NSRange, NSString)(affectedCharRange, replacementString); + } + + void didChangeText () + { + return invokeObjcSelf!(void, "didChangeText"); + } + + NSRange rangeForUserTextChange () + { + return invokeObjcSelf!(NSRange, "rangeForUserTextChange"); + } + + NSRange rangeForUserCharacterAttributeChange () + { + return invokeObjcSelf!(NSRange, "rangeForUserCharacterAttributeChange"); + } + + NSRange rangeForUserParagraphAttributeChange () + { + return invokeObjcSelf!(NSRange, "rangeForUserParagraphAttributeChange"); + } + + void setUsesFindPanel (bool flag) + { + return invokeObjcSelf!(void, "setUsesFindPanel:", bool)(flag); + } + + bool usesFindPanel () + { + return invokeObjcSelf!(bool, "usesFindPanel"); + } + + void setAllowsDocumentBackgroundColorChange (bool flag) + { + return invokeObjcSelf!(void, "setAllowsDocumentBackgroundColorChange:", bool)(flag); + } + + bool allowsDocumentBackgroundColorChange () + { + return invokeObjcSelf!(bool, "allowsDocumentBackgroundColorChange"); + } + + void setDefaultParagraphStyle (NSParagraphStyle paragraphStyle) + { + return invokeObjcSelf!(void, "setDefaultParagraphStyle:", NSParagraphStyle)(paragraphStyle); + } + + NSParagraphStyle defaultParagraphStyle () + { + return invokeObjcSelf!(NSParagraphStyle, "defaultParagraphStyle"); + } + + void setAllowsUndo (bool flag) + { + return invokeObjcSelf!(void, "setAllowsUndo:", bool)(flag); + } + + bool allowsUndo () + { + return invokeObjcSelf!(bool, "allowsUndo"); + } + + void breakUndoCoalescing () + { + return invokeObjcSelf!(void, "breakUndoCoalescing"); + } + + bool allowsImageEditing () + { + return invokeObjcSelf!(bool, "allowsImageEditing"); + } + + void setAllowsImageEditing (bool flag) + { + return invokeObjcSelf!(void, "setAllowsImageEditing:", bool)(flag); + } + + void showFindIndicatorForRange (NSRange charRange) + { + return invokeObjcSelf!(void, "showFindIndicatorForRange:", NSRange)(charRange); + } + + Object delegate_ () + { + return invokeObjcSelf!(Object, "delegate"); + } + + void setDelegate (Object anObject) + { + return invokeObjcSelf!(void, "setDelegate:", Object)(anObject); + } + + bool isEditable () + { + return invokeObjcSelf!(bool, "isEditable"); + } + + void setEditable (bool flag) + { + return invokeObjcSelf!(void, "setEditable:", bool)(flag); + } + + bool isSelectable () + { + return invokeObjcSelf!(bool, "isSelectable"); + } + + void setSelectable (bool flag) + { + return invokeObjcSelf!(void, "setSelectable:", bool)(flag); + } + + bool isRichText () + { + return invokeObjcSelf!(bool, "isRichText"); + } + + void setRichText (bool flag) + { + return invokeObjcSelf!(void, "setRichText:", bool)(flag); + } + + bool importsGraphics () + { + return invokeObjcSelf!(bool, "importsGraphics"); + } + + void setImportsGraphics (bool flag) + { + return invokeObjcSelf!(void, "setImportsGraphics:", bool)(flag); + } + + bool drawsBackground () + { + return invokeObjcSelf!(bool, "drawsBackground"); + } + + void setDrawsBackground (bool flag) + { + return invokeObjcSelf!(void, "setDrawsBackground:", bool)(flag); + } + + NSColor backgroundColor () + { + return invokeObjcSelf!(NSColor, "backgroundColor"); + } + + void setBackgroundColor (NSColor color) + { + return invokeObjcSelf!(void, "setBackgroundColor:", NSColor)(color); + } + + bool isFieldEditor () + { + return invokeObjcSelf!(bool, "isFieldEditor"); + } + + void setFieldEditor (bool flag) + { + return invokeObjcSelf!(void, "setFieldEditor:", bool)(flag); + } + + bool usesFontPanel () + { + return invokeObjcSelf!(bool, "usesFontPanel"); + } + + void setUsesFontPanel (bool flag) + { + return invokeObjcSelf!(void, "setUsesFontPanel:", bool)(flag); + } + + bool isRulerVisible () + { + return invokeObjcSelf!(bool, "isRulerVisible"); + } + + void setSelectedRange (NSRange charRange) + { + return invokeObjcSelf!(void, "setSelectedRange:", NSRange)(charRange); + } + + bool smartInsertDeleteEnabled () + { + return invokeObjcSelf!(bool, "smartInsertDeleteEnabled"); + } + + void setSmartInsertDeleteEnabled (bool flag) + { + return invokeObjcSelf!(void, "setSmartInsertDeleteEnabled:", bool)(flag); + } + + NSRange smartDeleteRangeForProposedRange (NSRange proposedCharRange) + { + return invokeObjcSelf!(NSRange, "smartDeleteRangeForProposedRange:", NSRange)(proposedCharRange); + } + + void toggleSmartInsertDelete (Object sender) + { + return invokeObjcSelf!(void, "toggleSmartInsertDelete:", Object)(sender); + } + + void smartInsertForString (NSString pasteString, NSRange charRangeToReplace, NSString** beforeString, NSString** afterString) + { + return invokeObjcSelf!(void, "smartInsertForString:replacingRange:beforeString:afterString:", NSString, NSRange, NSString**, NSString**)(pasteString, charRangeToReplace, beforeString, afterString); + } + + NSString smartInsertBeforeStringForString (NSString pasteString, NSRange charRangeToReplace) + { + return invokeObjcSelf!(NSString, "smartInsertBeforeStringForString:replacingRange:", NSString, NSRange)(pasteString, charRangeToReplace); + } + + NSString smartInsertAfterStringForString (NSString pasteString, NSRange charRangeToReplace) + { + return invokeObjcSelf!(NSString, "smartInsertAfterStringForString:replacingRange:", NSString, NSRange)(pasteString, charRangeToReplace); + } + + void setAutomaticQuoteSubstitutionEnabled (bool flag) + { + return invokeObjcSelf!(void, "setAutomaticQuoteSubstitutionEnabled:", bool)(flag); + } + + bool isAutomaticQuoteSubstitutionEnabled () + { + return invokeObjcSelf!(bool, "isAutomaticQuoteSubstitutionEnabled"); + } + + void toggleAutomaticQuoteSubstitution (Object sender) + { + return invokeObjcSelf!(void, "toggleAutomaticQuoteSubstitution:", Object)(sender); + } + + void setAutomaticLinkDetectionEnabled (bool flag) + { + return invokeObjcSelf!(void, "setAutomaticLinkDetectionEnabled:", bool)(flag); + } + + bool isAutomaticLinkDetectionEnabled () + { + return invokeObjcSelf!(bool, "isAutomaticLinkDetectionEnabled"); + } + + void toggleAutomaticLinkDetection (Object sender) + { + return invokeObjcSelf!(void, "toggleAutomaticLinkDetection:", Object)(sender); + } + + NSArray allowedInputSourceLocales () + { + return invokeObjcSelf!(NSArray, "allowedInputSourceLocales"); + } + + void setAllowedInputSourceLocales (NSArray localeIdentifiers) + { + return invokeObjcSelf!(void, "setAllowedInputSourceLocales:", NSArray)(localeIdentifiers); + } + + //mixin ObjcBindMethod!(selectedRanges, "selectedRanges"); + //mixin ObjcBindMethod!(setSelectedRanges, "setSelectedRanges:affinity:stillSelecting:"); + //mixin ObjcBindMethod!(setSelectedRanges, "setSelectedRanges:"); + //mixin ObjcBindMethod!(setSelectedRange, "setSelectedRange:affinity:stillSelecting:"); + //mixin ObjcBindMethod!(selectionAffinity, "selectionAffinity"); + //mixin ObjcBindMethod!(selectionGranularity, "selectionGranularity"); + //mixin ObjcBindMethod!(setSelectionGranularity, "setSelectionGranularity:"); + //mixin ObjcBindMethod!(setSelectedTextAttributes, "setSelectedTextAttributes:"); + //mixin ObjcBindMethod!(selectedTextAttributes, "selectedTextAttributes"); + //mixin ObjcBindMethod!(setInsertionPointColor, "setInsertionPointColor:"); + //mixin ObjcBindMethod!(insertionPointColor, "insertionPointColor"); + //mixin ObjcBindMethod!(updateInsertionPointStateAndRestartTimer, "updateInsertionPointStateAndRestartTimer:"); + //mixin ObjcBindMethod!(setMarkedTextAttributes, "setMarkedTextAttributes:"); + //mixin ObjcBindMethod!(markedTextAttributes, "markedTextAttributes"); + //mixin ObjcBindMethod!(setLinkTextAttributes, "setLinkTextAttributes:"); + //mixin ObjcBindMethod!(linkTextAttributes, "linkTextAttributes"); + //mixin ObjcBindMethod!(displaysLinkToolTips, "displaysLinkToolTips"); + //mixin ObjcBindMethod!(setDisplaysLinkToolTips, "setDisplaysLinkToolTips:"); + //mixin ObjcBindMethod!(acceptsGlyphInfo, "acceptsGlyphInfo"); + //mixin ObjcBindMethod!(setAcceptsGlyphInfo, "setAcceptsGlyphInfo:"); + //mixin ObjcBindMethod!(setRulerVisible, "setRulerVisible:"); + //mixin ObjcBindMethod!(usesRuler, "usesRuler"); + //mixin ObjcBindMethod!(setUsesRuler, "setUsesRuler:"); + //mixin ObjcBindMethod!(setContinuousSpellCheckingEnabled, "setContinuousSpellCheckingEnabled:"); + //mixin ObjcBindMethod!(isContinuousSpellCheckingEnabled, "isContinuousSpellCheckingEnabled"); + //mixin ObjcBindMethod!(toggleContinuousSpellChecking, "toggleContinuousSpellChecking:"); + //mixin ObjcBindMethod!(spellCheckerDocumentTag, "spellCheckerDocumentTag"); + //mixin ObjcBindMethod!(setGrammarCheckingEnabled, "setGrammarCheckingEnabled:"); + //mixin ObjcBindMethod!(isGrammarCheckingEnabled, "isGrammarCheckingEnabled"); + //mixin ObjcBindMethod!(toggleGrammarChecking, "toggleGrammarChecking:"); + //mixin ObjcBindMethod!(setSpellingState, "setSpellingState:range:"); + //mixin ObjcBindMethod!(typingAttributes, "typingAttributes"); + //mixin ObjcBindMethod!(setTypingAttributes, "setTypingAttributes:"); + //mixin ObjcBindMethod!(shouldChangeTextInRanges, "shouldChangeTextInRanges:replacementStrings:"); + //mixin ObjcBindMethod!(rangesForUserTextChange, "rangesForUserTextChange"); + //mixin ObjcBindMethod!(rangesForUserCharacterAttributeChange, "rangesForUserCharacterAttributeChange"); + //mixin ObjcBindMethod!(rangesForUserParagraphAttributeChange, "rangesForUserParagraphAttributeChange"); + //mixin ObjcBindMethod!(shouldChangeTextInRange, "shouldChangeTextInRange:replacementString:"); + //mixin ObjcBindMethod!(didChangeText, "didChangeText"); + //mixin ObjcBindMethod!(rangeForUserTextChange, "rangeForUserTextChange"); + //mixin ObjcBindMethod!(rangeForUserCharacterAttributeChange, "rangeForUserCharacterAttributeChange"); + //mixin ObjcBindMethod!(rangeForUserParagraphAttributeChange, "rangeForUserParagraphAttributeChange"); + //mixin ObjcBindMethod!(setUsesFindPanel, "setUsesFindPanel:"); + //mixin ObjcBindMethod!(usesFindPanel, "usesFindPanel"); + //mixin ObjcBindMethod!(setAllowsDocumentBackgroundColorChange, "setAllowsDocumentBackgroundColorChange:"); + //mixin ObjcBindMethod!(allowsDocumentBackgroundColorChange, "allowsDocumentBackgroundColorChange"); + //mixin ObjcBindMethod!(setDefaultParagraphStyle, "setDefaultParagraphStyle:"); + //mixin ObjcBindMethod!(defaultParagraphStyle, "defaultParagraphStyle"); + //mixin ObjcBindMethod!(setAllowsUndo, "setAllowsUndo:"); + //mixin ObjcBindMethod!(allowsUndo, "allowsUndo"); + //mixin ObjcBindMethod!(breakUndoCoalescing, "breakUndoCoalescing"); + //mixin ObjcBindMethod!(allowsImageEditing, "allowsImageEditing"); + //mixin ObjcBindMethod!(setAllowsImageEditing, "setAllowsImageEditing:"); + //mixin ObjcBindMethod!(showFindIndicatorForRange, "showFindIndicatorForRange:"); + //mixin ObjcBindMethod!(delegate_, "delegate"); + //mixin ObjcBindMethod!(setDelegate, "setDelegate:"); + //mixin ObjcBindMethod!(isEditable, "isEditable"); + //mixin ObjcBindMethod!(setEditable, "setEditable:"); + //mixin ObjcBindMethod!(isSelectable, "isSelectable"); + //mixin ObjcBindMethod!(setSelectable, "setSelectable:"); + //mixin ObjcBindMethod!(isRichText, "isRichText"); + //mixin ObjcBindMethod!(setRichText, "setRichText:"); + //mixin ObjcBindMethod!(importsGraphics, "importsGraphics"); + //mixin ObjcBindMethod!(setImportsGraphics, "setImportsGraphics:"); + //mixin ObjcBindMethod!(drawsBackground, "drawsBackground"); + //mixin ObjcBindMethod!(setDrawsBackground, "setDrawsBackground:"); + //mixin ObjcBindMethod!(backgroundColor, "backgroundColor"); + //mixin ObjcBindMethod!(setBackgroundColor, "setBackgroundColor:"); + //mixin ObjcBindMethod!(isFieldEditor, "isFieldEditor"); + //mixin ObjcBindMethod!(setFieldEditor, "setFieldEditor:"); + //mixin ObjcBindMethod!(usesFontPanel, "usesFontPanel"); + //mixin ObjcBindMethod!(setUsesFontPanel, "setUsesFontPanel:"); + //mixin ObjcBindMethod!(isRulerVisible, "isRulerVisible"); + //mixin ObjcBindMethod!(setSelectedRange, "setSelectedRange:"); + //mixin ObjcBindMethod!(smartInsertDeleteEnabled, "smartInsertDeleteEnabled"); + //mixin ObjcBindMethod!(setSmartInsertDeleteEnabled, "setSmartInsertDeleteEnabled:"); + //mixin ObjcBindMethod!(smartDeleteRangeForProposedRange, "smartDeleteRangeForProposedRange:"); + //mixin ObjcBindMethod!(toggleSmartInsertDelete, "toggleSmartInsertDelete:"); + //mixin ObjcBindMethod!(smartInsertForString, "smartInsertForString:replacingRange:beforeString:afterString:"); + //mixin ObjcBindMethod!(smartInsertBeforeStringForString, "smartInsertBeforeStringForString:replacingRange:"); + //mixin ObjcBindMethod!(smartInsertAfterStringForString, "smartInsertAfterStringForString:replacingRange:"); + //mixin ObjcBindMethod!(setAutomaticQuoteSubstitutionEnabled, "setAutomaticQuoteSubstitutionEnabled:"); + //mixin ObjcBindMethod!(isAutomaticQuoteSubstitutionEnabled, "isAutomaticQuoteSubstitutionEnabled"); + //mixin ObjcBindMethod!(toggleAutomaticQuoteSubstitution, "toggleAutomaticQuoteSubstitution:"); + //mixin ObjcBindMethod!(setAutomaticLinkDetectionEnabled, "setAutomaticLinkDetectionEnabled:"); + //mixin ObjcBindMethod!(isAutomaticLinkDetectionEnabled, "isAutomaticLinkDetectionEnabled"); + //mixin ObjcBindMethod!(toggleAutomaticLinkDetection, "toggleAutomaticLinkDetection:"); + //mixin ObjcBindMethod!(allowedInputSourceLocales, "allowedInputSourceLocales"); + //mixin ObjcBindMethod!(setAllowedInputSourceLocales, "setAllowedInputSourceLocales:"); + +`; + +const TNSPasteboard = ` + + NSArray writablePasteboardTypes () + { + return invokeObjcSelf!(NSArray, "writablePasteboardTypes"); + } + + bool writeSelectionToPasteboard (NSPasteboard pboard, NSString type) + { + return invokeObjcSelf!(bool, "writeSelectionToPasteboard:type:", NSPasteboard, NSString)(pboard, type); + } + + bool writeSelectionToPasteboard (NSPasteboard pboard, NSArray types) + { + return invokeObjcSelf!(bool, "writeSelectionToPasteboard:types:", NSPasteboard, NSArray)(pboard, types); + } + + NSArray readablePasteboardTypes () + { + return invokeObjcSelf!(NSArray, "readablePasteboardTypes"); + } + + NSString preferredPasteboardTypeFromArray (NSArray availableTypes, NSArray allowedTypes) + { + return invokeObjcSelf!(NSString, "preferredPasteboardTypeFromArray:restrictedToTypesFromArray:", NSArray, NSArray)(availableTypes, allowedTypes); + } + + bool readSelectionFromPasteboard (NSPasteboard pboard, NSString type) + { + return invokeObjcSelf!(bool, "readSelectionFromPasteboard:type:", NSPasteboard, NSString)(pboard, type); + } + + bool readSelectionFromPasteboard (NSPasteboard pboard) + { + return invokeObjcSelf!(bool, "readSelectionFromPasteboard:", NSPasteboard)(pboard); + } + + static void registerForServices () + { + return invokeObjcSelfClass!(void, "registerForServices"); + } + + Object validRequestorForSendType (NSString sendType, NSString returnType) + { + return invokeObjcSelf!(Object, "validRequestorForSendType:returnType:", NSString, NSString)(sendType, returnType); + } + + void pasteAsPlainText (Object sender) + { + return invokeObjcSelf!(void, "pasteAsPlainText:", Object)(sender); + } + + void pasteAsRichText (Object sender) + { + return invokeObjcSelf!(void, "pasteAsRichText:", Object)(sender); + } + + //mixin ObjcBindMethod!(writablePasteboardTypes, "writablePasteboardTypes"); + //mixin ObjcBindMethod!(writeSelectionToPasteboard, "writeSelectionToPasteboard:type:"); + //mixin ObjcBindMethod!(writeSelectionToPasteboard, "writeSelectionToPasteboard:types:"); + //mixin ObjcBindMethod!(readablePasteboardTypes, "readablePasteboardTypes"); + //mixin ObjcBindMethod!(preferredPasteboardTypeFromArray, "preferredPasteboardTypeFromArray:restrictedToTypesFromArray:"); + //mixin ObjcBindMethod!(readSelectionFromPasteboard, "readSelectionFromPasteboard:type:"); + //mixin ObjcBindMethod!(readSelectionFromPasteboard, "readSelectionFromPasteboard:"); + //mixin ObjcBindClassMethod!(registerForServices, "registerForServices"); + //mixin ObjcBindMethod!(validRequestorForSendType, "validRequestorForSendType:returnType:"); + //mixin ObjcBindMethod!(pasteAsPlainText, "pasteAsPlainText:"); + //mixin ObjcBindMethod!(pasteAsRichText, "pasteAsRichText:"); + +`; + +const TNSTextViewDelegate = ` + + bool textView (NSTextView textView, Object link, NSUInteger charIndex) + { + return invokeObjcSelf!(bool, "textView:clickedOnLink:atIndex:", NSTextView, Object, NSUInteger)(textView, link, charIndex); + } + + void textView (NSTextView textView, INSTextAttachmentCell cell, NSRect cellFrame, NSUInteger charIndex) + { + return invokeObjcSelf!(void, "textView:clickedOnCell:inRect:atIndex:", NSTextView, INSTextAttachmentCell, NSRect, NSUInteger)(textView, cell, cellFrame, charIndex); + } + + void textView (NSTextView textView, INSTextAttachmentCell cell, NSRect cellFrame, NSUInteger charIndex) + { + return invokeObjcSelf!(void, "textView:doubleClickedOnCell:inRect:atIndex:", NSTextView, INSTextAttachmentCell, NSRect, NSUInteger)(textView, cell, cellFrame, charIndex); + } + + void textView (NSTextView view, INSTextAttachmentCell cell, NSRect rect, NSEvent event, NSUInteger charIndex) + { + return invokeObjcSelf!(void, "textView:draggedCell:inRect:event:atIndex:", NSTextView, INSTextAttachmentCell, NSRect, NSEvent, NSUInteger)(view, cell, rect, event, charIndex); + } + + NSArray textView (NSTextView view, INSTextAttachmentCell cell, NSUInteger charIndex) + { + return invokeObjcSelf!(NSArray, "textView:writablePasteboardTypesForCell:atIndex:", NSTextView, INSTextAttachmentCell, NSUInteger)(view, cell, charIndex); + } + + bool textView (NSTextView view, INSTextAttachmentCell cell, NSUInteger charIndex, NSPasteboard pboard, NSString type) + { + return invokeObjcSelf!(bool, "textView:writeCell:atIndex:toPasteboard:type:", NSTextView, INSTextAttachmentCell, NSUInteger, NSPasteboard, NSString)(view, cell, charIndex, pboard, type); + } + + NSRange textView (NSTextView textView, NSRange oldSelectedCharRange, NSRange newSelectedCharRange) + { + return invokeObjcSelf!(NSRange, "textView:willChangeSelectionFromCharacterRange:toCharacterRange:", NSTextView, NSRange, NSRange)(textView, oldSelectedCharRange, newSelectedCharRange); + } + + NSArray textView (NSTextView textView, NSArray oldSelectedCharRanges, NSArray newSelectedCharRanges) + { + return invokeObjcSelf!(NSArray, "textView:willChangeSelectionFromCharacterRanges:toCharacterRanges:", NSTextView, NSArray, NSArray)(textView, oldSelectedCharRanges, newSelectedCharRanges); + } + + bool textView (NSTextView textView, NSArray affectedRanges, NSArray replacementStrings) + { + return invokeObjcSelf!(bool, "textView:shouldChangeTextInRanges:replacementStrings:", NSTextView, NSArray, NSArray)(textView, affectedRanges, replacementStrings); + } + + NSDictionary textView (NSTextView textView, NSDictionary oldTypingAttributes, NSDictionary newTypingAttributes) + { + return invokeObjcSelf!(NSDictionary, "textView:shouldChangeTypingAttributes:toAttributes:", NSTextView, NSDictionary, NSDictionary)(textView, oldTypingAttributes, newTypingAttributes); + } + + void textViewDidChangeSelection (NSNotification notification) + { + return invokeObjcSelf!(void, "textViewDidChangeSelection:", NSNotification)(notification); + } + + void textViewDidChangeTypingAttributes (NSNotification notification) + { + return invokeObjcSelf!(void, "textViewDidChangeTypingAttributes:", NSNotification)(notification); + } + + NSString textView (NSTextView textView, NSString tooltip, NSUInteger characterIndex) + { + return invokeObjcSelf!(NSString, "textView:willDisplayToolTip:forCharacterAtIndex:", NSTextView, NSString, NSUInteger)(textView, tooltip, characterIndex); + } + + NSArray textView (NSTextView textView, NSArray words, NSRange charRange, NSInteger* index) + { + return invokeObjcSelf!(NSArray, "textView:completions:forPartialWordRange:indexOfSelectedItem:", NSTextView, NSArray, NSRange, NSInteger*)(textView, words, charRange, index); + } + + bool textView (NSTextView textView, NSRange affectedCharRange, NSString replacementString) + { + return invokeObjcSelf!(bool, "textView:shouldChangeTextInRange:replacementString:", NSTextView, NSRange, NSString)(textView, affectedCharRange, replacementString); + } + + bool textView (NSTextView textView, SEL commandSelector) + { + return invokeObjcSelf!(bool, "textView:doCommandBySelector:", NSTextView, SEL)(textView, commandSelector); + } + + NSInteger textView (NSTextView textView, NSInteger value, NSRange affectedCharRange) + { + return invokeObjcSelf!(NSInteger, "textView:shouldSetSpellingState:range:", NSTextView, NSInteger, NSRange)(textView, value, affectedCharRange); + } + + NSMenu textView (NSTextView view, NSMenu menu, NSEvent event, NSUInteger charIndex) + { + return invokeObjcSelf!(NSMenu, "textView:menu:forEvent:atIndex:", NSTextView, NSMenu, NSEvent, NSUInteger)(view, menu, event, charIndex); + } + + bool textView (NSTextView textView, Object link) + { + return invokeObjcSelf!(bool, "textView:clickedOnLink:", NSTextView, Object)(textView, link); + } + + void textView (NSTextView textView, INSTextAttachmentCell cell, NSRect cellFrame) + { + return invokeObjcSelf!(void, "textView:clickedOnCell:inRect:", NSTextView, INSTextAttachmentCell, NSRect)(textView, cell, cellFrame); + } + + void textView (NSTextView textView, INSTextAttachmentCell cell, NSRect cellFrame) + { + return invokeObjcSelf!(void, "textView:doubleClickedOnCell:inRect:", NSTextView, INSTextAttachmentCell, NSRect)(textView, cell, cellFrame); + } + + void textView (NSTextView view, INSTextAttachmentCell cell, NSRect rect, NSEvent event) + { + return invokeObjcSelf!(void, "textView:draggedCell:inRect:event:", NSTextView, INSTextAttachmentCell, NSRect, NSEvent)(view, cell, rect, event); + } + + NSUndoManager undoManagerForTextView (NSTextView view) + { + return invokeObjcSelf!(NSUndoManager, "undoManagerForTextView:", NSTextView)(view); + } + + //mixin ObjcBindMethod!(textView, "textView:clickedOnLink:atIndex:"); + //mixin ObjcBindMethod!(textView, "textView:clickedOnCell:inRect:atIndex:"); + //mixin ObjcBindMethod!(textView, "textView:doubleClickedOnCell:inRect:atIndex:"); + //mixin ObjcBindMethod!(textView, "textView:draggedCell:inRect:event:atIndex:"); + //mixin ObjcBindMethod!(textView, "textView:writablePasteboardTypesForCell:atIndex:"); + //mixin ObjcBindMethod!(textView, "textView:writeCell:atIndex:toPasteboard:type:"); + //mixin ObjcBindMethod!(textView, "textView:willChangeSelectionFromCharacterRange:toCharacterRange:"); + //mixin ObjcBindMethod!(textView, "textView:willChangeSelectionFromCharacterRanges:toCharacterRanges:"); + //mixin ObjcBindMethod!(textView, "textView:shouldChangeTextInRanges:replacementStrings:"); + //mixin ObjcBindMethod!(textView, "textView:shouldChangeTypingAttributes:toAttributes:"); + //mixin ObjcBindMethod!(textViewDidChangeSelection, "textViewDidChangeSelection:"); + //mixin ObjcBindMethod!(textViewDidChangeTypingAttributes, "textViewDidChangeTypingAttributes:"); + //mixin ObjcBindMethod!(textView, "textView:willDisplayToolTip:forCharacterAtIndex:"); + //mixin ObjcBindMethod!(textView, "textView:completions:forPartialWordRange:indexOfSelectedItem:"); + //mixin ObjcBindMethod!(textView, "textView:shouldChangeTextInRange:replacementString:"); + //mixin ObjcBindMethod!(textView, "textView:doCommandBySelector:"); + //mixin ObjcBindMethod!(textView, "textView:shouldSetSpellingState:range:"); + //mixin ObjcBindMethod!(textView, "textView:menu:forEvent:atIndex:"); + //mixin ObjcBindMethod!(textView, "textView:clickedOnLink:"); + //mixin ObjcBindMethod!(textView, "textView:clickedOnCell:inRect:"); + //mixin ObjcBindMethod!(textView, "textView:doubleClickedOnCell:inRect:"); + //mixin ObjcBindMethod!(textView, "textView:draggedCell:inRect:event:"); + //mixin ObjcBindMethod!(undoManagerForTextView, "undoManagerForTextView:"); + +`; + +class NSTextViewDelegate : NSObject +{ + bool textView (NSTextView textView, Object link, NSUInteger charIndex) + { + return invokeObjcSelf!(bool, "textView:clickedOnLink:atIndex:", NSTextView, Object, NSUInteger)(textView, link, charIndex); + } + + void textView (NSTextView textView, INSTextAttachmentCell cell, NSRect cellFrame, NSUInteger charIndex) + { + return invokeObjcSelf!(void, "textView:clickedOnCell:inRect:atIndex:", NSTextView, INSTextAttachmentCell, NSRect, NSUInteger)(textView, cell, cellFrame, charIndex); + } + + void textView (NSTextView textView, INSTextAttachmentCell cell, NSRect cellFrame, NSUInteger charIndex) + { + return invokeObjcSelf!(void, "textView:doubleClickedOnCell:inRect:atIndex:", NSTextView, INSTextAttachmentCell, NSRect, NSUInteger)(textView, cell, cellFrame, charIndex); + } + + void textView (NSTextView view, INSTextAttachmentCell cell, NSRect rect, NSEvent event, NSUInteger charIndex) + { + return invokeObjcSelf!(void, "textView:draggedCell:inRect:event:atIndex:", NSTextView, INSTextAttachmentCell, NSRect, NSEvent, NSUInteger)(view, cell, rect, event, charIndex); + } + + NSArray textView (NSTextView view, INSTextAttachmentCell cell, NSUInteger charIndex) + { + return invokeObjcSelf!(NSArray, "textView:writablePasteboardTypesForCell:atIndex:", NSTextView, INSTextAttachmentCell, NSUInteger)(view, cell, charIndex); + } + + bool textView (NSTextView view, INSTextAttachmentCell cell, NSUInteger charIndex, NSPasteboard pboard, NSString type) + { + return invokeObjcSelf!(bool, "textView:writeCell:atIndex:toPasteboard:type:", NSTextView, INSTextAttachmentCell, NSUInteger, NSPasteboard, NSString)(view, cell, charIndex, pboard, type); + } + + NSRange textView (NSTextView textView, NSRange oldSelectedCharRange, NSRange newSelectedCharRange) + { + return invokeObjcSelf!(NSRange, "textView:willChangeSelectionFromCharacterRange:toCharacterRange:", NSTextView, NSRange, NSRange)(textView, oldSelectedCharRange, newSelectedCharRange); + } + + NSArray textView (NSTextView textView, NSArray oldSelectedCharRanges, NSArray newSelectedCharRanges) + { + return invokeObjcSelf!(NSArray, "textView:willChangeSelectionFromCharacterRanges:toCharacterRanges:", NSTextView, NSArray, NSArray)(textView, oldSelectedCharRanges, newSelectedCharRanges); + } + + bool textView (NSTextView textView, NSArray affectedRanges, NSArray replacementStrings) + { + return invokeObjcSelf!(bool, "textView:shouldChangeTextInRanges:replacementStrings:", NSTextView, NSArray, NSArray)(textView, affectedRanges, replacementStrings); + } + + NSDictionary textView (NSTextView textView, NSDictionary oldTypingAttributes, NSDictionary newTypingAttributes) + { + return invokeObjcSelf!(NSDictionary, "textView:shouldChangeTypingAttributes:toAttributes:", NSTextView, NSDictionary, NSDictionary)(textView, oldTypingAttributes, newTypingAttributes); + } + + void textViewDidChangeSelection (NSNotification notification) + { + return invokeObjcSelf!(void, "textViewDidChangeSelection:", NSNotification)(notification); + } + + void textViewDidChangeTypingAttributes (NSNotification notification) + { + return invokeObjcSelf!(void, "textViewDidChangeTypingAttributes:", NSNotification)(notification); + } + + NSString textView (NSTextView textView, NSString tooltip, NSUInteger characterIndex) + { + return invokeObjcSelf!(NSString, "textView:willDisplayToolTip:forCharacterAtIndex:", NSTextView, NSString, NSUInteger)(textView, tooltip, characterIndex); + } + + NSArray textView (NSTextView textView, NSArray words, NSRange charRange, NSInteger* index) + { + return invokeObjcSelf!(NSArray, "textView:completions:forPartialWordRange:indexOfSelectedItem:", NSTextView, NSArray, NSRange, NSInteger*)(textView, words, charRange, index); + } + + bool textView (NSTextView textView, NSRange affectedCharRange, NSString replacementString) + { + return invokeObjcSelf!(bool, "textView:shouldChangeTextInRange:replacementString:", NSTextView, NSRange, NSString)(textView, affectedCharRange, replacementString); + } + + bool textView (NSTextView textView, SEL commandSelector) + { + return invokeObjcSelf!(bool, "textView:doCommandBySelector:", NSTextView, SEL)(textView, commandSelector); + } + + NSInteger textView (NSTextView textView, NSInteger value, NSRange affectedCharRange) + { + return invokeObjcSelf!(NSInteger, "textView:shouldSetSpellingState:range:", NSTextView, NSInteger, NSRange)(textView, value, affectedCharRange); + } + + NSMenu textView (NSTextView view, NSMenu menu, NSEvent event, NSUInteger charIndex) + { + return invokeObjcSelf!(NSMenu, "textView:menu:forEvent:atIndex:", NSTextView, NSMenu, NSEvent, NSUInteger)(view, menu, event, charIndex); + } + + bool textView (NSTextView textView, Object link) + { + return invokeObjcSelf!(bool, "textView:clickedOnLink:", NSTextView, Object)(textView, link); + } + + void textView (NSTextView textView, INSTextAttachmentCell cell, NSRect cellFrame) + { + return invokeObjcSelf!(void, "textView:clickedOnCell:inRect:", NSTextView, INSTextAttachmentCell, NSRect)(textView, cell, cellFrame); + } + + void textView (NSTextView textView, INSTextAttachmentCell cell, NSRect cellFrame) + { + return invokeObjcSelf!(void, "textView:doubleClickedOnCell:inRect:", NSTextView, INSTextAttachmentCell, NSRect)(textView, cell, cellFrame); + } + + void textView (NSTextView view, INSTextAttachmentCell cell, NSRect rect, NSEvent event) + { + return invokeObjcSelf!(void, "textView:draggedCell:inRect:event:", NSTextView, INSTextAttachmentCell, NSRect, NSEvent)(view, cell, rect, event); + } + + NSUndoManager undoManagerForTextView (NSTextView view) + { + return invokeObjcSelf!(NSUndoManager, "undoManagerForTextView:", NSTextView)(view); + } +} + +class NSTextView : NSText, INSTextInput, INSUserInterfaceValidations, INSTextInputClient +{ + mixin (ObjcWrap); + + NSRect firstRectForCharacterRange (NSRange theRange) + { + return invokeObjcSelf!(NSRect, "firstRectForCharacterRange:", NSRange)(theRange); + } + + void setMarkedText (Object aString, NSRange selRange) + { + return invokeObjcSelf!(void, "setMarkedText:selectedRange:", Object, NSRange)(aString, selRange); + } + + NSInteger conversationIdentifier () + { + return invokeObjcSelf!(NSInteger, "conversationIdentifier"); + } + + NSAttributedString attributedSubstringFromRange (NSRange theRange) + { + return invokeObjcSelf!(NSAttributedString, "attributedSubstringFromRange:", NSRange)(theRange); + } + + bool validateUserInterfaceItem (INSValidatedUserInterfaceItem anItem) + { + return invokeObjcSelf!(bool, "validateUserInterfaceItem:", INSValidatedUserInterfaceItem)(anItem); + } + + void insertText (Object aString, NSRange replacementRange) + { + return invokeObjcSelf!(void, "insertText:replacementRange:", Object, NSRange)(aString, replacementRange); + } + + void doCommandBySelector (SEL aSelector) + { + return invokeObjcSelf!(void, "doCommandBySelector:", SEL)(aSelector); + } + + void setMarkedText (Object aString, NSRange selectedRange, NSRange replacementRange) + { + return invokeObjcSelf!(void, "setMarkedText:selectedRange:replacementRange:", Object, NSRange, NSRange)(aString, selectedRange, replacementRange); + } + + void unmarkText () + { + return invokeObjcSelf!(void, "unmarkText"); + } + + NSRange selectedRange () + { + return invokeObjcSelf!(NSRange, "selectedRange"); + } + + NSRange markedRange () + { + return invokeObjcSelf!(NSRange, "markedRange"); + } + + bool hasMarkedText () + { + return invokeObjcSelf!(bool, "hasMarkedText"); + } + + NSAttributedString attributedSubstringForProposedRange (NSRange aRange, NSRangePointer actualRange) + { + return invokeObjcSelf!(NSAttributedString, "attributedSubstringForProposedRange:actualRange:", NSRange, NSRangePointer)(aRange, actualRange); + } + + NSArray validAttributesForMarkedText () + { + return invokeObjcSelf!(NSArray, "validAttributesForMarkedText"); + } + + NSRect firstRectForCharacterRange (NSRange aRange, NSRangePointer actualRange) + { + return invokeObjcSelf!(NSRect, "firstRectForCharacterRange:actualRange:", NSRange, NSRangePointer)(aRange, actualRange); + } + + NSUInteger characterIndexForPoint (NSPoint aPoint) + { + return invokeObjcSelf!(NSUInteger, "characterIndexForPoint:", NSPoint)(aPoint); + } + + NSAttributedString attributedString () + { + return invokeObjcSelf!(NSAttributedString, "attributedString"); + } + + CGFloat fractionOfDistanceThroughGlyphForPoint (NSPoint aPoint) + { + return invokeObjcSelf!(CGFloat, "fractionOfDistanceThroughGlyphForPoint:", NSPoint)(aPoint); + } + + CGFloat baselineDeltaForCharacterAtIndex (NSUInteger anIndex) + { + return invokeObjcSelf!(CGFloat, "baselineDeltaForCharacterAtIndex:", NSUInteger)(anIndex); + } + + NSInteger windowLevel () + { + return invokeObjcSelf!(NSInteger, "windowLevel"); + } + + NSTextView initWithFrame (NSRect frameRect, NSTextContainer container) + { + return invokeObjcSelf!(NSTextView, "initWithFrame:textContainer:", NSRect, NSTextContainer)(frameRect, container); + } + + this (NSRect frameRect, NSTextContainer container) + { + super(NSTextView.alloc.initWithFrame(frameRect, container).objcObject); + } + + NSTextView initWithFrame (NSRect frameRect) + { + return invokeObjcSelf!(NSTextView, "initWithFrame:", NSRect)(frameRect); + } + + this (NSRect frameRect) + { + super(NSTextView.alloc.initWithFrame(frameRect).objcObject); + } + + NSTextContainer textContainer () + { + return invokeObjcSelf!(NSTextContainer, "textContainer"); + } + + void setTextContainer (NSTextContainer container) + { + return invokeObjcSelf!(void, "setTextContainer:", NSTextContainer)(container); + } + + void replaceTextContainer (NSTextContainer newContainer) + { + return invokeObjcSelf!(void, "replaceTextContainer:", NSTextContainer)(newContainer); + } + + void setTextContainerInset (NSSize inset) + { + return invokeObjcSelf!(void, "setTextContainerInset:", NSSize)(inset); + } + + NSSize textContainerInset () + { + return invokeObjcSelf!(NSSize, "textContainerInset"); + } + + NSPoint textContainerOrigin () + { + return invokeObjcSelf!(NSPoint, "textContainerOrigin"); + } + + void invalidateTextContainerOrigin () + { + return invokeObjcSelf!(void, "invalidateTextContainerOrigin"); + } + + NSLayoutManager layoutManager () + { + return invokeObjcSelf!(NSLayoutManager, "layoutManager"); + } + + NSTextStorage textStorage () + { + return invokeObjcSelf!(NSTextStorage, "textStorage"); + } + + void insertText (Object insertString) + { + return invokeObjcSelf!(void, "insertText:", Object)(insertString); + } + + void setConstrainedFrameSize (NSSize desiredSize) + { + return invokeObjcSelf!(void, "setConstrainedFrameSize:", NSSize)(desiredSize); + } + + void setAlignment (NSTextAlignment alignment) + { + return invokeObjcSelf!(void, "setAlignment:", NSTextAlignment)(alignment); + } + + void setBaseWritingDirection (NSWritingDirection writingDirection, NSRange range) + { + return invokeObjcSelf!(void, "setBaseWritingDirection:range:", NSWritingDirection, NSRange)(writingDirection, range); + } + + void turnOffKerning (Object sender) + { + return invokeObjcSelf!(void, "turnOffKerning:", Object)(sender); + } + + void tightenKerning (Object sender) + { + return invokeObjcSelf!(void, "tightenKerning:", Object)(sender); + } + + void loosenKerning (Object sender) + { + return invokeObjcSelf!(void, "loosenKerning:", Object)(sender); + } + + void useStandardKerning (Object sender) + { + return invokeObjcSelf!(void, "useStandardKerning:", Object)(sender); + } + + void turnOffLigatures (Object sender) + { + return invokeObjcSelf!(void, "turnOffLigatures:", Object)(sender); + } + + void useStandardLigatures (Object sender) + { + return invokeObjcSelf!(void, "useStandardLigatures:", Object)(sender); + } + + void useAllLigatures (Object sender) + { + return invokeObjcSelf!(void, "useAllLigatures:", Object)(sender); + } + + void raiseBaseline (Object sender) + { + return invokeObjcSelf!(void, "raiseBaseline:", Object)(sender); + } + + void lowerBaseline (Object sender) + { + return invokeObjcSelf!(void, "lowerBaseline:", Object)(sender); + } + + void toggleTraditionalCharacterShape (Object sender) + { + return invokeObjcSelf!(void, "toggleTraditionalCharacterShape:", Object)(sender); + } + + void outline (Object sender) + { + return invokeObjcSelf!(void, "outline:", Object)(sender); + } + + void performFindPanelAction (Object sender) + { + return invokeObjcSelf!(void, "performFindPanelAction:", Object)(sender); + } + + void alignJustified (Object sender) + { + return invokeObjcSelf!(void, "alignJustified:", Object)(sender); + } + + void changeColor (Object sender) + { + return invokeObjcSelf!(void, "changeColor:", Object)(sender); + } + + void changeAttributes (Object sender) + { + return invokeObjcSelf!(void, "changeAttributes:", Object)(sender); + } + + void changeDocumentBackgroundColor (Object sender) + { + return invokeObjcSelf!(void, "changeDocumentBackgroundColor:", Object)(sender); + } + + void toggleBaseWritingDirection (Object sender) + { + return invokeObjcSelf!(void, "toggleBaseWritingDirection:", Object)(sender); + } + + void orderFrontSpacingPanel (Object sender) + { + return invokeObjcSelf!(void, "orderFrontSpacingPanel:", Object)(sender); + } + + void orderFrontLinkPanel (Object sender) + { + return invokeObjcSelf!(void, "orderFrontLinkPanel:", Object)(sender); + } + + void orderFrontListPanel (Object sender) + { + return invokeObjcSelf!(void, "orderFrontListPanel:", Object)(sender); + } + + void orderFrontTablePanel (Object sender) + { + return invokeObjcSelf!(void, "orderFrontTablePanel:", Object)(sender); + } + + bool rulerView_shouldMoveMarker (NSRulerView ruler, NSRulerMarker marker) + { + return invokeObjcSelf!(bool, "rulerView:shouldMoveMarker:", NSRulerView, NSRulerMarker)(ruler, marker); + } + + CGFloat rulerView (NSRulerView ruler, NSRulerMarker marker, CGFloat location) + { + return invokeObjcSelf!(CGFloat, "rulerView:willMoveMarker:toLocation:", NSRulerView, NSRulerMarker, CGFloat)(ruler, marker, location); + } + + void rulerView (NSRulerView ruler, NSRulerMarker marker) + { + return invokeObjcSelf!(void, "rulerView:didMoveMarker:", NSRulerView, NSRulerMarker)(ruler, marker); + } + + void rulerView_shouldRemoveMarker (NSRulerView ruler, NSRulerMarker marker) + { + return invokeObjcSelf!(void, "rulerView:shouldRemoveMarker:", NSRulerView, NSRulerMarker)(ruler, marker); + } + + void rulerView_didRemoveMarker (NSRulerView ruler, NSRulerMarker marker) + { + return invokeObjcSelf!(void, "rulerView:didRemoveMarker:", NSRulerView, NSRulerMarker)(ruler, marker); + } + + bool rulerView_shouldAddMarker (NSRulerView ruler, NSRulerMarker marker) + { + return invokeObjcSelf!(bool, "rulerView:shouldAddMarker:", NSRulerView, NSRulerMarker)(ruler, marker); + } + + CGFloat rulerView_willAddMarker_atLocation (NSRulerView ruler, NSRulerMarker marker, CGFloat location) + { + return invokeObjcSelf!(CGFloat, "rulerView:willAddMarker:atLocation:", NSRulerView, NSRulerMarker, CGFloat)(ruler, marker, location); + } + + void rulerView_didAddMarker (NSRulerView ruler, NSRulerMarker marker) + { + return invokeObjcSelf!(void, "rulerView:didAddMarker:", NSRulerView, NSRulerMarker)(ruler, marker); + } + + void rulerView (NSRulerView ruler, NSEvent event) + { + return invokeObjcSelf!(void, "rulerView:handleMouseDown:", NSRulerView, NSEvent)(ruler, event); + } + + void setNeedsDisplayInRect (NSRect rect, bool flag) + { + return invokeObjcSelf!(void, "setNeedsDisplayInRect:avoidAdditionalLayout:", NSRect, bool)(rect, flag); + } + + bool shouldDrawInsertionPoint () + { + return invokeObjcSelf!(bool, "shouldDrawInsertionPoint"); + } + + void drawInsertionPointInRect (NSRect rect, NSColor color, bool flag) + { + return invokeObjcSelf!(void, "drawInsertionPointInRect:color:turnedOn:", NSRect, NSColor, bool)(rect, color, flag); + } + + void drawViewBackgroundInRect (NSRect rect) + { + return invokeObjcSelf!(void, "drawViewBackgroundInRect:", NSRect)(rect); + } + + void updateRuler () + { + return invokeObjcSelf!(void, "updateRuler"); + } + + void updateFontPanel () + { + return invokeObjcSelf!(void, "updateFontPanel"); + } + + void updateDragTypeRegistration () + { + return invokeObjcSelf!(void, "updateDragTypeRegistration"); + } + + NSRange selectionRangeForProposedRange (NSRange proposedCharRange, NSSelectionGranularity granularity) + { + return invokeObjcSelf!(NSRange, "selectionRangeForProposedRange:granularity:", NSRange, NSSelectionGranularity)(proposedCharRange, granularity); + } + + void clickedOnCell (Object link, NSUInteger charIndex) + { + return invokeObjcSelf!(void, "clickedOnCell:atIndex:", Object, NSUInteger)(link, charIndex); + } + + void startSpeaking (Object sender) + { + return invokeObjcSelf!(void, "startSpeaking:", Object)(sender); + } + + void stopSpeaking (Object sender) + { + return invokeObjcSelf!(void, "stopSpeaking:", Object)(sender); + } + + NSUInteger characterIndexForInsertionAtPoint (NSPoint point) + { + return invokeObjcSelf!(NSUInteger, "characterIndexForInsertionAtPoint:", NSPoint)(point); + } + + // NSDragging + bool dragSelectionWithEvent (NSEvent event, NSSize mouseOffset, bool slideBack) + { + return invokeObjcSelf!(bool, "dragSelectionWithEvent:offset:slideBack:", NSEvent, NSSize, bool)(event, mouseOffset, slideBack); + } + + NSImage dragImageForSelectionWithEvent (NSEvent event, NSPointPointer origin) + { + return invokeObjcSelf!(NSImage, "dragImageForSelectionWithEvent:origin:", NSEvent, NSPointPointer)(event, origin); + } + + NSArray acceptableDragTypes () + { + return invokeObjcSelf!(NSArray, "acceptableDragTypes"); + } + + uint dragOperationForDraggingInfo (INSDraggingInfo dragInfo, NSString type) + { + return invokeObjcSelf!(uint, "dragOperationForDraggingInfo:type:", INSDraggingInfo, NSString)(dragInfo, type); + } + + void cleanUpAfterDragOperation () + { + return invokeObjcSelf!(void, "cleanUpAfterDragOperation"); + } + + // NSCompletion + void complete (Object sender) + { + return invokeObjcSelf!(void, "complete:", Object)(sender); + } + + NSRange rangeForUserCompletion () + { + return invokeObjcSelf!(NSRange, "rangeForUserCompletion"); + } + + NSArray completionsForPartialWordRange (NSRange charRange, NSInteger* index) + { + return invokeObjcSelf!(NSArray, "completionsForPartialWordRange:indexOfSelectedItem:", NSRange, NSInteger*)(charRange, index); + } + + void insertCompletion (NSString word, NSRange charRange, NSInteger movement, bool flag) + { + return invokeObjcSelf!(void, "insertCompletion:forPartialWordRange:movement:isFinal:", NSString, NSRange, NSInteger, bool)(word, charRange, movement, flag); + } + + // NSSharing + NSArray selectedRanges () + { + return invokeObjcSelf!(NSArray, "selectedRanges"); + } + + void setSelectedRanges (NSArray ranges, uint affinity, bool stillSelectingFlag) + { + return invokeObjcSelf!(void, "setSelectedRanges:affinity:stillSelecting:", NSArray, uint, bool)(ranges, affinity, stillSelectingFlag); + } + + void setSelectedRanges (NSArray ranges) + { + return invokeObjcSelf!(void, "setSelectedRanges:", NSArray)(ranges); + } + + void setSelectedRange (NSRange charRange, uint affinity, bool stillSelectingFlag) + { + return invokeObjcSelf!(void, "setSelectedRange:affinity:stillSelecting:", NSRange, uint, bool)(charRange, affinity, stillSelectingFlag); + } + + uint selectionAffinity () + { + return invokeObjcSelf!(uint, "selectionAffinity"); + } + + uint selectionGranularity () + { + return invokeObjcSelf!(uint, "selectionGranularity"); + } + + void setSelectionGranularity (uint granularity) + { + return invokeObjcSelf!(void, "setSelectionGranularity:", uint)(granularity); + } + + void setSelectedTextAttributes (NSDictionary attributeDictionary) + { + return invokeObjcSelf!(void, "setSelectedTextAttributes:", NSDictionary)(attributeDictionary); + } + + NSDictionary selectedTextAttributes () + { + return invokeObjcSelf!(NSDictionary, "selectedTextAttributes"); + } + + void setInsertionPointColor (NSColor color) + { + return invokeObjcSelf!(void, "setInsertionPointColor:", NSColor)(color); + } + + NSColor insertionPointColor () + { + return invokeObjcSelf!(NSColor, "insertionPointColor"); + } + + void updateInsertionPointStateAndRestartTimer (bool restartFlag) + { + return invokeObjcSelf!(void, "updateInsertionPointStateAndRestartTimer:", bool)(restartFlag); + } + + void setMarkedTextAttributes (NSDictionary attributeDictionary) + { + return invokeObjcSelf!(void, "setMarkedTextAttributes:", NSDictionary)(attributeDictionary); + } + + NSDictionary markedTextAttributes () + { + return invokeObjcSelf!(NSDictionary, "markedTextAttributes"); + } + + void setLinkTextAttributes (NSDictionary attributeDictionary) + { + return invokeObjcSelf!(void, "setLinkTextAttributes:", NSDictionary)(attributeDictionary); + } + + NSDictionary linkTextAttributes () + { + return invokeObjcSelf!(NSDictionary, "linkTextAttributes"); + } + + bool displaysLinkToolTips () + { + return invokeObjcSelf!(bool, "displaysLinkToolTips"); + } + + void setDisplaysLinkToolTips (bool flag) + { + return invokeObjcSelf!(void, "setDisplaysLinkToolTips:", bool)(flag); + } + + bool acceptsGlyphInfo () + { + return invokeObjcSelf!(bool, "acceptsGlyphInfo"); + } + + void setAcceptsGlyphInfo (bool flag) + { + return invokeObjcSelf!(void, "setAcceptsGlyphInfo:", bool)(flag); + } + + void setRulerVisible (bool flag) + { + return invokeObjcSelf!(void, "setRulerVisible:", bool)(flag); + } + + bool usesRuler () + { + return invokeObjcSelf!(bool, "usesRuler"); + } + + void setUsesRuler (bool flag) + { + return invokeObjcSelf!(void, "setUsesRuler:", bool)(flag); + } + + void setContinuousSpellCheckingEnabled (bool flag) + { + return invokeObjcSelf!(void, "setContinuousSpellCheckingEnabled:", bool)(flag); + } + + bool isContinuousSpellCheckingEnabled () + { + return invokeObjcSelf!(bool, "isContinuousSpellCheckingEnabled"); + } + + void toggleContinuousSpellChecking (Object sender) + { + return invokeObjcSelf!(void, "toggleContinuousSpellChecking:", Object)(sender); + } + + NSInteger spellCheckerDocumentTag () + { + return invokeObjcSelf!(NSInteger, "spellCheckerDocumentTag"); + } + + void setGrammarCheckingEnabled (bool flag) + { + return invokeObjcSelf!(void, "setGrammarCheckingEnabled:", bool)(flag); + } + + bool isGrammarCheckingEnabled () + { + return invokeObjcSelf!(bool, "isGrammarCheckingEnabled"); + } + + void toggleGrammarChecking (Object sender) + { + return invokeObjcSelf!(void, "toggleGrammarChecking:", Object)(sender); + } + + void setSpellingState (NSInteger value, NSRange charRange) + { + return invokeObjcSelf!(void, "setSpellingState:range:", NSInteger, NSRange)(value, charRange); + } + + NSDictionary typingAttributes () + { + return invokeObjcSelf!(NSDictionary, "typingAttributes"); + } + + void setTypingAttributes (NSDictionary attrs) + { + return invokeObjcSelf!(void, "setTypingAttributes:", NSDictionary)(attrs); + } + + bool shouldChangeTextInRanges (NSArray affectedRanges, NSArray replacementStrings) + { + return invokeObjcSelf!(bool, "shouldChangeTextInRanges:replacementStrings:", NSArray, NSArray)(affectedRanges, replacementStrings); + } + + NSArray rangesForUserTextChange () + { + return invokeObjcSelf!(NSArray, "rangesForUserTextChange"); + } + + NSArray rangesForUserCharacterAttributeChange () + { + return invokeObjcSelf!(NSArray, "rangesForUserCharacterAttributeChange"); + } + + NSArray rangesForUserParagraphAttributeChange () + { + return invokeObjcSelf!(NSArray, "rangesForUserParagraphAttributeChange"); + } + + bool shouldChangeTextInRange (NSRange affectedCharRange, NSString replacementString) + { + return invokeObjcSelf!(bool, "shouldChangeTextInRange:replacementString:", NSRange, NSString)(affectedCharRange, replacementString); + } + + void didChangeText () + { + return invokeObjcSelf!(void, "didChangeText"); + } + + NSRange rangeForUserTextChange () + { + return invokeObjcSelf!(NSRange, "rangeForUserTextChange"); + } + + NSRange rangeForUserCharacterAttributeChange () + { + return invokeObjcSelf!(NSRange, "rangeForUserCharacterAttributeChange"); + } + + NSRange rangeForUserParagraphAttributeChange () + { + return invokeObjcSelf!(NSRange, "rangeForUserParagraphAttributeChange"); + } + + void setUsesFindPanel (bool flag) + { + return invokeObjcSelf!(void, "setUsesFindPanel:", bool)(flag); + } + + bool usesFindPanel () + { + return invokeObjcSelf!(bool, "usesFindPanel"); + } + + void setAllowsDocumentBackgroundColorChange (bool flag) + { + return invokeObjcSelf!(void, "setAllowsDocumentBackgroundColorChange:", bool)(flag); + } + + bool allowsDocumentBackgroundColorChange () + { + return invokeObjcSelf!(bool, "allowsDocumentBackgroundColorChange"); + } + + void setDefaultParagraphStyle (NSParagraphStyle paragraphStyle) + { + return invokeObjcSelf!(void, "setDefaultParagraphStyle:", NSParagraphStyle)(paragraphStyle); + } + + NSParagraphStyle defaultParagraphStyle () + { + return invokeObjcSelf!(NSParagraphStyle, "defaultParagraphStyle"); + } + + void setAllowsUndo (bool flag) + { + return invokeObjcSelf!(void, "setAllowsUndo:", bool)(flag); + } + + bool allowsUndo () + { + return invokeObjcSelf!(bool, "allowsUndo"); + } + + void breakUndoCoalescing () + { + return invokeObjcSelf!(void, "breakUndoCoalescing"); + } + + bool allowsImageEditing () + { + return invokeObjcSelf!(bool, "allowsImageEditing"); + } + + void setAllowsImageEditing (bool flag) + { + return invokeObjcSelf!(void, "setAllowsImageEditing:", bool)(flag); + } + + void showFindIndicatorForRange (NSRange charRange) + { + return invokeObjcSelf!(void, "showFindIndicatorForRange:", NSRange)(charRange); + } + + Object delegate_ () + { + return invokeObjcSelf!(Object, "delegate"); + } + + void setDelegate (Object anObject) + { + return invokeObjcSelf!(void, "setDelegate:", Object)(anObject); + } + + bool isEditable () + { + return invokeObjcSelf!(bool, "isEditable"); + } + + void setEditable (bool flag) + { + return invokeObjcSelf!(void, "setEditable:", bool)(flag); + } + + bool isSelectable () + { + return invokeObjcSelf!(bool, "isSelectable"); + } + + void setSelectable (bool flag) + { + return invokeObjcSelf!(void, "setSelectable:", bool)(flag); + } + + bool isRichText () + { + return invokeObjcSelf!(bool, "isRichText"); + } + + void setRichText (bool flag) + { + return invokeObjcSelf!(void, "setRichText:", bool)(flag); + } + + bool importsGraphics () + { + return invokeObjcSelf!(bool, "importsGraphics"); + } + + void setImportsGraphics (bool flag) + { + return invokeObjcSelf!(void, "setImportsGraphics:", bool)(flag); + } + + bool drawsBackground () + { + return invokeObjcSelf!(bool, "drawsBackground"); + } + + void setDrawsBackground (bool flag) + { + return invokeObjcSelf!(void, "setDrawsBackground:", bool)(flag); + } + + NSColor backgroundColor () + { + return invokeObjcSelf!(NSColor, "backgroundColor"); + } + + void setBackgroundColor (NSColor color) + { + return invokeObjcSelf!(void, "setBackgroundColor:", NSColor)(color); + } + + bool isFieldEditor () + { + return invokeObjcSelf!(bool, "isFieldEditor"); + } + + void setFieldEditor (bool flag) + { + return invokeObjcSelf!(void, "setFieldEditor:", bool)(flag); + } + + bool usesFontPanel () + { + return invokeObjcSelf!(bool, "usesFontPanel"); + } + + void setUsesFontPanel (bool flag) + { + return invokeObjcSelf!(void, "setUsesFontPanel:", bool)(flag); + } + + bool isRulerVisible () + { + return invokeObjcSelf!(bool, "isRulerVisible"); + } + + void setSelectedRange (NSRange charRange) + { + return invokeObjcSelf!(void, "setSelectedRange:", NSRange)(charRange); + } + + bool smartInsertDeleteEnabled () + { + return invokeObjcSelf!(bool, "smartInsertDeleteEnabled"); + } + + void setSmartInsertDeleteEnabled (bool flag) + { + return invokeObjcSelf!(void, "setSmartInsertDeleteEnabled:", bool)(flag); + } + + NSRange smartDeleteRangeForProposedRange (NSRange proposedCharRange) + { + return invokeObjcSelf!(NSRange, "smartDeleteRangeForProposedRange:", NSRange)(proposedCharRange); + } + + void toggleSmartInsertDelete (Object sender) + { + return invokeObjcSelf!(void, "toggleSmartInsertDelete:", Object)(sender); + } + + void smartInsertForString (NSString pasteString, NSRange charRangeToReplace, NSString** beforeString, NSString** afterString) + { + return invokeObjcSelf!(void, "smartInsertForString:replacingRange:beforeString:afterString:", NSString, NSRange, NSString**, NSString**)(pasteString, charRangeToReplace, beforeString, afterString); + } + + NSString smartInsertBeforeStringForString (NSString pasteString, NSRange charRangeToReplace) + { + return invokeObjcSelf!(NSString, "smartInsertBeforeStringForString:replacingRange:", NSString, NSRange)(pasteString, charRangeToReplace); + } + + NSString smartInsertAfterStringForString (NSString pasteString, NSRange charRangeToReplace) + { + return invokeObjcSelf!(NSString, "smartInsertAfterStringForString:replacingRange:", NSString, NSRange)(pasteString, charRangeToReplace); + } + + void setAutomaticQuoteSubstitutionEnabled (bool flag) + { + return invokeObjcSelf!(void, "setAutomaticQuoteSubstitutionEnabled:", bool)(flag); + } + + bool isAutomaticQuoteSubstitutionEnabled () + { + return invokeObjcSelf!(bool, "isAutomaticQuoteSubstitutionEnabled"); + } + + void toggleAutomaticQuoteSubstitution (Object sender) + { + return invokeObjcSelf!(void, "toggleAutomaticQuoteSubstitution:", Object)(sender); + } + + void setAutomaticLinkDetectionEnabled (bool flag) + { + return invokeObjcSelf!(void, "setAutomaticLinkDetectionEnabled:", bool)(flag); + } + + bool isAutomaticLinkDetectionEnabled () + { + return invokeObjcSelf!(bool, "isAutomaticLinkDetectionEnabled"); + } + + void toggleAutomaticLinkDetection (Object sender) + { + return invokeObjcSelf!(void, "toggleAutomaticLinkDetection:", Object)(sender); + } + + NSArray allowedInputSourceLocales () + { + return invokeObjcSelf!(NSArray, "allowedInputSourceLocales"); + } + + void setAllowedInputSourceLocales (NSArray localeIdentifiers) + { + return invokeObjcSelf!(void, "setAllowedInputSourceLocales:", NSArray)(localeIdentifiers); + } + + // NSPasteboard + NSArray writablePasteboardTypes () + { + return invokeObjcSelf!(NSArray, "writablePasteboardTypes"); + } + + bool writeSelectionToPasteboard (NSPasteboard pboard, NSString type) + { + return invokeObjcSelf!(bool, "writeSelectionToPasteboard:type:", NSPasteboard, NSString)(pboard, type); + } + + bool writeSelectionToPasteboard (NSPasteboard pboard, NSArray types) + { + return invokeObjcSelf!(bool, "writeSelectionToPasteboard:types:", NSPasteboard, NSArray)(pboard, types); + } + + NSArray readablePasteboardTypes () + { + return invokeObjcSelf!(NSArray, "readablePasteboardTypes"); + } + + NSString preferredPasteboardTypeFromArray (NSArray availableTypes, NSArray allowedTypes) + { + return invokeObjcSelf!(NSString, "preferredPasteboardTypeFromArray:restrictedToTypesFromArray:", NSArray, NSArray)(availableTypes, allowedTypes); + } + + bool readSelectionFromPasteboard (NSPasteboard pboard, NSString type) + { + return invokeObjcSelf!(bool, "readSelectionFromPasteboard:type:", NSPasteboard, NSString)(pboard, type); + } + + bool readSelectionFromPasteboard (NSPasteboard pboard) + { + return invokeObjcSelf!(bool, "readSelectionFromPasteboard:", NSPasteboard)(pboard); + } + + static void registerForServices () + { + return invokeObjcSelfClass!(void, "registerForServices"); + } + + Object validRequestorForSendType (NSString sendType, NSString returnType) + { + return invokeObjcSelf!(Object, "validRequestorForSendType:returnType:", NSString, NSString)(sendType, returnType); + } + + void pasteAsPlainText (Object sender) + { + return invokeObjcSelf!(void, "pasteAsPlainText:", Object)(sender); + } + + void pasteAsRichText (Object sender) + { + return invokeObjcSelf!(void, "pasteAsRichText:", Object)(sender); + } +} \ No newline at end of file