Add missing defines to Tiger
[MacVim.git] / src / MacVim / MMTextStorage.h
blob1d72ab527808bd13f87de3e31bb9a03667802a2e
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 - (id)attribute:(NSString *)attrib atIndex:(unsigned)index
54 effectiveRange:(NSRangePointer)range;
55 - (void)replaceCharactersInRange:(NSRange)aRange
56 withString:(NSString *)aString;
57 - (void)setAttributes:(NSDictionary *)attributes range:(NSRange)aRange;
59 - (int)maxRows;
60 - (int)maxColumns;
61 - (int)actualRows;
62 - (int)actualColumns;
63 - (float)linespace;
64 - (void)setLinespace:(float)newLinespace;
65 - (void)getMaxRows:(int*)rows columns:(int*)cols;
66 - (void)setMaxRows:(int)rows columns:(int)cols;
67 - (void)drawString:(NSString *)string atRow:(int)row column:(int)col
68 cells:(int)cells withFlags:(int)flags
69 foregroundColor:(NSColor *)fg backgroundColor:(NSColor *)bg
70 specialColor:(NSColor *)sp;
71 - (void)deleteLinesFromRow:(int)row lineCount:(int)count
72 scrollBottom:(int)bottom left:(int)left right:(int)right
73 color:(NSColor *)color;
74 - (void)insertLinesAtRow:(int)row lineCount:(int)count
75 scrollBottom:(int)bottom left:(int)left right:(int)right
76 color:(NSColor *)color;
77 - (void)clearBlockFromRow:(int)row1 column:(int)col1 toRow:(int)row2
78 column:(int)col2 color:(NSColor *)color;
79 - (void)clearAll;
80 - (void)setDefaultColorsBackground:(NSColor *)bgColor
81 foreground:(NSColor *)fgColor;
82 - (void)setFont:(NSFont *)newFont;
83 - (void)setWideFont:(NSFont *)newFont;
84 - (NSFont *)font;
85 - (NSFont *)fontWide;
86 - (NSColor *)defaultBackgroundColor;
87 - (NSColor *)defaultForegroundColor;
88 - (NSSize)size;
89 - (NSSize)cellSize;
90 - (NSRect)rectForRowsInRange:(NSRange)range;
91 - (NSRect)rectForColumnsInRange:(NSRange)range;
92 - (NSUInteger)characterIndexForRow:(int)row column:(int)col;
93 - (BOOL)resizeToFitSize:(NSSize)size;
94 - (NSSize)fitToSize:(NSSize)size;
95 - (NSSize)fitToSize:(NSSize)size rows:(int *)rows columns:(int *)columns;
96 - (NSRect)boundingRectForCharacterAtRow:(int)row column:(int)col;
97 #if MM_USE_ROW_CACHE
98 - (MMRowCacheEntry *)rowCache;
99 #endif
101 @end