338bfcd9ed608ae8fe417fa74cc1ee46ecd28100
[MacVim.git] / src / MacVim / MMCoreTextView.h
blob338bfcd9ed608ae8fe417fa74cc1ee46ecd28100
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 "Miscellaneous.h" // Defines MM_ENABLE_ATSUI
14 #if !MM_ENABLE_ATSUI
16 @class MMTextViewHelper;
19 @interface MMCoreTextView : 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;
29 // From NSTextView
30 NSSize insetSize;
32 float fontDescent;
33 BOOL antialias;
34 NSMutableArray *drawData;
36 MMTextViewHelper *helper;
38 unsigned maxlen;
39 CGGlyph *glyphs;
40 CGSize *advances;
43 - (id)initWithFrame:(NSRect)frame;
46 // MMTextStorage methods
48 - (int)maxRows;
49 - (int)maxColumns;
50 - (void)getMaxRows:(int*)rows columns:(int*)cols;
51 - (void)setMaxRows:(int)rows columns:(int)cols;
52 - (void)setDefaultColorsBackground:(NSColor *)bgColor
53 foreground:(NSColor *)fgColor;
54 - (NSColor *)defaultBackgroundColor;
55 - (NSColor *)defaultForegroundColor;
56 - (NSRect)rectForRowsInRange:(NSRange)range;
57 - (NSRect)rectForColumnsInRange:(NSRange)range;
59 - (void)setFont:(NSFont *)newFont;
60 - (void)setWideFont:(NSFont *)newFont;
61 - (NSFont *)font;
62 - (NSFont *)fontWide;
63 - (NSSize)cellSize;
64 - (void)setLinespace:(float)newLinespace;
67 // MMTextView methods
69 - (void)setShouldDrawInsertionPoint:(BOOL)on;
70 - (void)setPreEditRow:(int)row column:(int)col;
71 - (void)setMouseShape:(int)shape;
72 - (void)setAntialias:(BOOL)state;
73 - (void)setImControl:(BOOL)enable;
74 - (void)activateIm:(BOOL)enable;
75 - (BOOL)convertPoint:(NSPoint)point toRow:(int *)row column:(int *)column;
78 // NSTextView methods
80 - (void)keyDown:(NSEvent *)event;
81 - (void)insertText:(id)string;
82 - (void)doCommandBySelector:(SEL)selector;
83 - (BOOL)performKeyEquivalent:(NSEvent *)event;
86 // NSTextContainer methods
88 - (void)setTextContainerInset:(NSSize)inset;
91 // MMCoreTextView methods
93 - (void)performBatchDrawWithData:(NSData *)data;
94 - (NSSize)desiredSize;
95 - (NSSize)minSize;
96 - (NSSize)constrainRows:(int *)rows columns:(int *)cols toSize:(NSSize)size;
98 @end
100 #endif // !MM_ENABLE_ATSUI