Fix placement of auxiliary IM window for Core Text
[MacVim.git] / src / MacVim / MMTextViewHelper.h
blob715dec6404976b348431c7cfb0cafe0ab57d462a
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.
9 */
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>
16 #endif
19 enum {
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).
23 MMMinRows = 4,
24 MMMinColumns = 30
28 @interface MMTextViewHelper : NSObject {
29 id textView;
30 BOOL isDragging;
31 int dragRow;
32 int dragColumn;
33 int dragFlags;
34 NSPoint dragPoint;
35 BOOL isAutoscrolling;
36 int mouseShape;
37 NSTrackingRectTag trackingRectTag;
38 NSColor *insertionPointColor;
39 BOOL interpretKeyEventsSwallowedKey;
40 NSEvent *currentEvent;
42 // Input Manager
43 NSRange imRange;
44 NSRange markedRange;
45 NSDictionary *markedTextAttributes;
46 NSMutableAttributedString *markedText;
47 int preEditRow;
48 int preEditColumn;
49 BOOL imControl;
50 BOOL imState;
51 #if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)
52 TISInputSourceRef lastImSource;
53 TISInputSourceRef asciiImSource;
54 #endif
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;
81 // Input Manager
82 - (BOOL)hasMarkedText;
83 - (NSRange)markedRange;
84 - (NSDictionary *)markedTextAttributes;
85 - (void)setMarkedTextAttributes:(NSDictionary *)attr;
86 - (void)setMarkedText:(id)text selectedRange:(NSRange)range;
87 - (void)unmarkText;
88 - (NSMutableAttributedString *)markedText;
89 - (void)setPreEditRow:(int)row column:(int)col;
90 - (int)preEditRow;
91 - (int)preEditColumn;
92 - (void)setImRange:(NSRange)range;
93 - (NSRange)imRange;
94 - (void)setMarkedRange:(NSRange)range;
95 - (NSRect)firstRectForCharacterRange:(NSRange)range;
96 - (void)setImControl:(BOOL)enable;
97 - (void)activateIm:(BOOL)enable;
98 - (BOOL)useInlineIm;
100 @end