Fix placement of auxiliary IM window for Core Text
[MacVim.git] / src / MacVim / MMTextStorage.h
blob1a7277cedca40a751d0e1a3456990efffd68f40c
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 "MacVim.h"
14 #define MM_USE_ROW_CACHE 1
17 #if MM_USE_ROW_CACHE
18 typedef struct {
19 unsigned length; // length of row in unichars
20 int col; // last column accessed (in this row)
21 unsigned colOffset; // offset of 'col' from start of row (in unichars)
22 } MMRowCacheEntry;
23 #endif
27 @interface MMTextStorage : NSTextStorage {
28 NSMutableAttributedString *attribString;
29 int maxRows, maxColumns;
30 int actualRows, actualColumns;
31 NSAttributedString *emptyRowString;
32 NSFont *font;
33 NSFont *boldFont;
34 NSFont *italicFont;
35 NSFont *boldItalicFont;
36 NSFont *fontWide;
37 NSFont *boldFontWide;
38 NSFont *italicFontWide;
39 NSFont *boldItalicFontWide;
40 NSColor *defaultBackgroundColor;
41 NSColor *defaultForegroundColor;
42 NSSize cellSize;
43 float linespace;
44 #if MM_USE_ROW_CACHE
45 MMRowCacheEntry *rowCache;
46 #endif
47 BOOL characterEqualsColumn;
50 - (NSString *)string;
51 - (NSDictionary *)attributesAtIndex:(NSUInteger)index
52 effectiveRange:(NSRangePointer)aRange;
53 - (void)replaceCharactersInRange:(NSRange)aRange
54 withString:(NSString *)aString;
55 - (void)setAttributes:(NSDictionary *)attributes range:(NSRange)aRange;
57 - (int)maxRows;
58 - (int)maxColumns;
59 - (int)actualRows;
60 - (int)actualColumns;
61 - (float)linespace;
62 - (void)setLinespace:(float)newLinespace;
63 - (void)getMaxRows:(int*)rows columns:(int*)cols;
64 - (void)setMaxRows:(int)rows columns:(int)cols;
65 - (void)drawString:(NSString *)string atRow:(int)row column:(int)col
66 cells:(int)cells withFlags:(int)flags
67 foregroundColor:(NSColor *)fg backgroundColor:(NSColor *)bg
68 specialColor:(NSColor *)sp;
69 - (void)deleteLinesFromRow:(int)row lineCount:(int)count
70 scrollBottom:(int)bottom left:(int)left right:(int)right
71 color:(NSColor *)color;
72 - (void)insertLinesAtRow:(int)row lineCount:(int)count
73 scrollBottom:(int)bottom left:(int)left right:(int)right
74 color:(NSColor *)color;
75 - (void)clearBlockFromRow:(int)row1 column:(int)col1 toRow:(int)row2
76 column:(int)col2 color:(NSColor *)color;
77 - (void)clearAll;
78 - (void)setDefaultColorsBackground:(NSColor *)bgColor
79 foreground:(NSColor *)fgColor;
80 - (void)setFont:(NSFont *)newFont;
81 - (void)setWideFont:(NSFont *)newFont;
82 - (NSFont *)font;
83 - (NSFont *)fontWide;
84 - (NSColor *)defaultBackgroundColor;
85 - (NSColor *)defaultForegroundColor;
86 - (NSSize)size;
87 - (NSSize)cellSize;
88 - (NSRect)rectForRowsInRange:(NSRange)range;
89 - (NSRect)rectForColumnsInRange:(NSRange)range;
90 - (NSUInteger)characterIndexForRow:(int)row column:(int)col;
91 - (BOOL)resizeToFitSize:(NSSize)size;
92 - (NSSize)fitToSize:(NSSize)size;
93 - (NSSize)fitToSize:(NSSize)size rows:(int *)rows columns:(int *)columns;
94 - (NSRect)boundingRectForCharacterAtRow:(int)row column:(int)col;
95 #if MM_USE_ROW_CACHE
96 - (MMRowCacheEntry *)rowCache;
97 #endif
99 @end