Fix placement of auxiliary IM window for Core Text
[MacVim.git] / src / MacVim / MMAtsuiTextView.h
blob47e6cc2e9d7df4339af77fe9d2f6e9195e585d41
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 */
12 #import <Cocoa/Cocoa.h>
13 #import "Miscellaneous.h"
15 #if MM_ENABLE_ATSUI
17 enum { MMMaxCellsPerChar = 2 };
19 @class MMTextViewHelper;
22 @interface MMAtsuiTextView : NSView <NSTextInput> {
23 // From MMTextStorage
24 int maxRows, maxColumns;
25 NSColor *defaultBackgroundColor;
26 NSColor *defaultForegroundColor;
27 NSSize cellSize;
28 NSFont *font;
29 NSFont *fontWide;
30 float linespace;
31 float ascender;
33 // From NSTextView
34 NSSize insetSize;
36 // From vim-cocoa
37 NSImage *contentImage;
38 NSSize imageSize;
39 ATSUStyle atsuStyles[MMMaxCellsPerChar];
40 BOOL antialias;
42 MMTextViewHelper *helper;
45 - (id)initWithFrame:(NSRect)frame;
48 // MMTextStorage methods
50 - (int)maxRows;
51 - (int)maxColumns;
52 - (void)getMaxRows:(int*)rows columns:(int*)cols;
53 - (void)setMaxRows:(int)rows columns:(int)cols;
54 - (void)setDefaultColorsBackground:(NSColor *)bgColor
55 foreground:(NSColor *)fgColor;
56 - (NSColor *)defaultBackgroundColor;
57 - (NSColor *)defaultForegroundColor;
58 - (NSRect)rectForRowsInRange:(NSRange)range;
59 - (NSRect)rectForColumnsInRange:(NSRange)range;
61 - (void)setFont:(NSFont *)newFont;
62 - (void)setWideFont:(NSFont *)newFont;
63 - (NSFont *)font;
64 - (NSFont *)fontWide;
65 - (NSSize)cellSize;
66 - (void)setLinespace:(float)newLinespace;
69 // MMTextView methods
71 - (void)setPreEditRow:(int)row column:(int)col;
72 - (void)setMouseShape:(int)shape;
73 - (void)setAntialias:(BOOL)state;
74 - (void)setImControl:(BOOL)enable;
75 - (void)activateIm:(BOOL)enable;
76 - (BOOL)convertPoint:(NSPoint)point toRow:(int *)row column:(int *)column;
77 - (NSPoint)pointForRow:(int)row column:(int)col;
78 - (NSRect)rectForRow:(int)row column:(int)col numRows:(int)nr
79 numColumns:(int)nc;
82 // NSTextView methods
84 - (void)keyDown:(NSEvent *)event;
85 - (void)insertText:(id)string;
86 - (void)doCommandBySelector:(SEL)selector;
87 - (BOOL)performKeyEquivalent:(NSEvent *)event;
90 // NSTextContainer methods
92 - (void)setTextContainerInset:(NSSize)inset;
95 // MMAtsuiTextView methods
97 - (void)performBatchDrawWithData:(NSData *)data;
98 - (NSSize)desiredSize;
99 - (NSSize)minSize;
100 - (NSSize)constrainRows:(int *)rows columns:(int *)cols toSize:(NSSize)size;
102 @end
104 #endif // MM_ENABLE_ATSUI