1 /* vi:set ts=8 sts=4 sw=4 ft=objc:
3 * VIM - Vi IMproved by Bram Moolenaar
4 * MacVim GUI port by Bjorn Winckler
6 * Do ":help uganda" in Vim to read copying and usage conditions.
7 * Do ":help credits" in Vim to see a list of people who contributed.
8 * See README.txt for an overview of the Vim source code.
11 #import <Cocoa/Cocoa.h>
13 #if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)
14 // Need Carbon for TIS...() functions
15 #import <Carbon/Carbon.h>
20 // These values are chosen so that the min text view size is not too small
21 // with the default font (they only affect resizing with the mouse, you can
22 // still use e.g. ":set lines=2" to go below these values).
28 @interface MMTextViewHelper
: NSObject
{
37 NSTrackingRectTag trackingRectTag
;
38 NSColor
*insertionPointColor
;
39 BOOL interpretKeyEventsSwallowedKey
;
40 NSEvent
*currentEvent
;
45 NSDictionary
*markedTextAttributes
;
46 NSMutableAttributedString
*markedText
;
51 #if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)
52 TISInputSourceRef lastImSource
;
53 TISInputSourceRef asciiImSource
;
57 - (void)setTextView
:(id
)view
;
58 - (void)setInsertionPointColor
:(NSColor
*)color
;
59 - (NSColor
*)insertionPointColor
;
61 - (void)keyDown
:(NSEvent
*)event
;
62 - (void)insertText
:(id
)string
;
63 - (void)doCommandBySelector
:(SEL
)selector
;
64 - (BOOL
)performKeyEquivalent
:(NSEvent
*)event
;
65 - (void)scrollWheel
:(NSEvent
*)event
;
66 - (void)mouseDown
:(NSEvent
*)event
;
67 - (void)mouseUp
:(NSEvent
*)event
;
68 - (void)mouseDragged
:(NSEvent
*)event
;
69 - (void)mouseMoved
:(NSEvent
*)event
;
70 - (void)mouseEntered
:(NSEvent
*)event
;
71 - (void)mouseExited
:(NSEvent
*)event
;
72 - (void)setFrame
:(NSRect
)frame
;
73 - (void)viewDidMoveToWindow
;
74 - (void)viewWillMoveToWindow
:(NSWindow
*)newWindow
;
75 - (BOOL
)performDragOperation
:(id
<NSDraggingInfo
>)sender
;
76 - (NSDragOperation
)draggingEntered
:(id
<NSDraggingInfo
>)sender
;
77 - (NSDragOperation
)draggingUpdated
:(id
<NSDraggingInfo
>)sender
;
78 - (void)setMouseShape
:(int)shape
;
79 - (void)changeFont
:(id
)sender
;
82 - (BOOL
)hasMarkedText
;
83 - (NSRange
)markedRange
;
84 - (NSDictionary
*)markedTextAttributes
;
85 - (void)setMarkedTextAttributes
:(NSDictionary
*)attr
;
86 - (void)setMarkedText
:(id
)text selectedRange
:(NSRange
)range
;
88 - (NSMutableAttributedString
*)markedText
;
89 - (void)setPreEditRow
:(int)row column
:(int)col
;
92 - (void)setImRange
:(NSRange
)range
;
94 - (void)setMarkedRange
:(NSRange
)range
;
95 - (NSRect
)firstRectForCharacterRange
:(NSRange
)range
;
96 - (void)setImControl
:(BOOL
)enable
;
97 - (void)activateIm
:(BOOL
)enable
;