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.
12 #import <Cocoa/Cocoa.h>
13 #import "Miscellaneous.h"
17 enum { MMMaxCellsPerChar
= 2 };
19 @
class MMTextViewHelper
;
22 @interface MMAtsuiTextView
: NSView
<NSTextInput
> {
24 int maxRows
, maxColumns
;
25 NSColor
*defaultBackgroundColor
;
26 NSColor
*defaultForegroundColor
;
37 NSImage
*contentImage
;
39 ATSUStyle atsuStyles
[MMMaxCellsPerChar
];
42 MMTextViewHelper
*helper
;
45 - (id
)initWithFrame
:(NSRect
)frame
;
48 // MMTextStorage methods
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
;
66 - (void)setLinespace
:(float)newLinespace
;
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
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
;
100 - (NSSize
)constrainRows
:(int *)rows columns
:(int *)cols toSize
:(NSSize
)size
;
104 #endif // MM_ENABLE_ATSUI