Add IM support to ATSUI renderer
[MacVim.git] / src / MacVim / MMAtsuiTextView.h
blob0219fe490b73b42d87e76f0952058d9490ba6150
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>
12 #import "MMTextView.h"
14 enum { MMMaxCellsPerChar = 2 };
16 @class MMTextViewHelper;
19 @interface MMAtsuiTextView : NSView <NSTextInput> {
20 // From MMTextStorage
21 int maxRows, maxColumns;
22 NSColor *defaultBackgroundColor;
23 NSColor *defaultForegroundColor;
24 NSSize cellSize;
25 NSFont *font;
26 NSFont *fontWide;
27 float linespace;
28 float ascender;
30 // From NSTextView
31 NSSize insetSize;
33 // From vim-cocoa
34 NSImage *contentImage;
35 NSSize imageSize;
36 ATSUStyle atsuStyles[MMMaxCellsPerChar];
37 BOOL antialias;
39 MMTextViewHelper *helper;
42 - (id)initWithFrame:(NSRect)frame;
45 // MMTextStorage methods
47 - (int)maxRows;
48 - (int)maxColumns;
49 - (void)getMaxRows:(int*)rows columns:(int*)cols;
50 - (void)setMaxRows:(int)rows columns:(int)cols;
51 - (void)setDefaultColorsBackground:(NSColor *)bgColor
52 foreground:(NSColor *)fgColor;
53 - (NSColor *)defaultBackgroundColor;
54 - (NSColor *)defaultForegroundColor;
55 - (NSRect)rectForRowsInRange:(NSRange)range;
56 - (NSRect)rectForColumnsInRange:(NSRange)range;
58 - (void)setFont:(NSFont *)newFont;
59 - (void)setWideFont:(NSFont *)newFont;
60 - (NSFont *)font;
61 - (NSFont *)fontWide;
62 - (NSSize)cellSize;
63 - (void)setLinespace:(float)newLinespace;
66 // MMTextView methods
68 - (void)setPreEditRow:(int)row column:(int)col;
69 - (void)setMouseShape:(int)shape;
70 - (void)setAntialias:(BOOL)state;
71 - (BOOL)convertPoint:(NSPoint)point toRow:(int *)row column:(int *)column;
72 - (NSPoint)pointForRow:(int)row column:(int)col;
73 - (NSRect)rectForRow:(int)row column:(int)col numRows:(int)nr
74 numColumns:(int)nc;
77 // NSTextView methods
79 - (void)keyDown:(NSEvent *)event;
80 - (void)insertText:(id)string;
81 - (void)doCommandBySelector:(SEL)selector;
82 - (BOOL)performKeyEquivalent:(NSEvent *)event;
85 // NSTextContainer methods
87 - (void)setTextContainerInset:(NSSize)inset;
90 // MMAtsuiTextView methods
92 - (void)performBatchDrawWithData:(NSData *)data;
93 - (NSSize)desiredSize;
94 - (NSSize)minSize;
95 - (NSSize)constrainRows:(int *)rows columns:(int *)cols toSize:(NSSize)size;
97 @end