Remove duplicate code in text renderers
[MacVim.git] / src / MacVim / MMAtsuiTextView.h
blob1e1cdfc92dbcb54d991734beb551808b91967904
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>
14 enum { MMMaxCellsPerChar = 2 };
16 @class MMTextViewHelper;
19 @interface MMAtsuiTextView : NSView {
20 // From MMTextStorage
21 int maxRows, maxColumns;
22 NSColor *defaultBackgroundColor;
23 NSColor *defaultForegroundColor;
24 NSSize cellSize;
25 NSFont *font;
26 float linespace;
28 // From NSTextView
29 NSSize insetSize;
31 // From vim-cocoa
32 NSImage *contentImage;
33 NSSize imageSize;
34 ATSUStyle atsuStyles[MMMaxCellsPerChar];
35 BOOL antialias;
37 MMTextViewHelper *helper;
40 - (id)initWithFrame:(NSRect)frame;
43 // MMTextStorage methods
45 - (int)maxRows;
46 - (void)getMaxRows:(int*)rows columns:(int*)cols;
47 - (void)setMaxRows:(int)rows columns:(int)cols;
48 - (void)setDefaultColorsBackground:(NSColor *)bgColor
49 foreground:(NSColor *)fgColor;
50 - (NSRect)rectForRowsInRange:(NSRange)range;
51 - (NSRect)rectForColumnsInRange:(NSRange)range;
53 - (void)setFont:(NSFont *)newFont;
54 - (void)setWideFont:(NSFont *)newFont;
55 - (NSFont *)font;
56 - (NSSize)cellSize;
57 - (void)setLinespace:(float)newLinespace;
60 // MMTextView methods
62 - (void)setShouldDrawInsertionPoint:(BOOL)on;
63 - (void)setPreEditRow:(int)row column:(int)col;
64 - (void)hideMarkedTextField;
65 - (void)setMouseShape:(int)shape;
66 - (void)setAntialias:(BOOL)state;
67 - (BOOL)convertPoint:(NSPoint)point toRow:(int *)row column:(int *)column;
70 // NSTextView methods
72 - (void)keyDown:(NSEvent *)event;
73 - (void)insertText:(id)string;
74 - (void)doCommandBySelector:(SEL)selector;
75 - (BOOL)performKeyEquivalent:(NSEvent *)event;
78 // NSTextContainer methods
80 - (void)setTextContainerInset:(NSSize)inset;
83 // MMAtsuiTextView methods
85 - (void)performBatchDrawWithData:(NSData *)data;
86 - (NSSize)desiredSize;
87 - (NSSize)minSize;
88 - (NSSize)constrainRows:(int *)rows columns:(int *)cols toSize:(NSSize)size;
90 @end