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.
11 #import <Cocoa/Cocoa.h>
14 #define MM_USE_ROW_CACHE 1
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)
27 @interface MMTextStorage
: NSTextStorage
{
28 NSMutableAttributedString
*attribString
;
29 int maxRows
, maxColumns
;
30 int actualRows
, actualColumns
;
31 NSAttributedString
*emptyRowString
;
35 NSFont
*boldItalicFont
;
38 NSFont
*italicFontWide
;
39 NSFont
*boldItalicFontWide
;
40 NSColor
*defaultBackgroundColor
;
41 NSColor
*defaultForegroundColor
;
45 MMRowCacheEntry
*rowCache
;
47 BOOL characterEqualsColumn
;
51 - (NSDictionary
*)attributesAtIndex
:(unsigned)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
;
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
;
80 - (void)setDefaultColorsBackground
:(NSColor
*)bgColor
81 foreground
:(NSColor
*)fgColor
;
82 - (void)setFont
:(NSFont
*)newFont
;
83 - (void)setWideFont
:(NSFont
*)newFont
;
86 - (NSColor
*)defaultBackgroundColor
;
87 - (NSColor
*)defaultForegroundColor
;
90 - (NSRect
)rectForRowsInRange
:(NSRange
)range
;
91 - (NSRect
)rectForColumnsInRange
:(NSRange
)range
;
92 - (unsigned)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
;
98 - (MMRowCacheEntry
*)rowCache
;