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 <Foundation/Foundation.h>
15 // If disabled, all input is dropped if input is already being processed. (If
16 // enabled, same thing happens at the moment actually. So this is pretty
18 #define MM_USE_INPUT_QUEUE 0
23 @interface MMBackend
: NSObject
<MMBackendProtocol
> {
24 NSMutableArray
*queue
;
25 NSMutableData
*drawData
;
26 NSConnection
*connection
;
28 NSDictionary
*colorDict
;
29 NSDictionary
*sysColorDict
;
35 int defaultBackgroundColor
;
36 int defaultForegroundColor
;
37 NSDate
*lastFlushDate
;
41 NSTimeInterval blinkWaitInterval
;
42 NSTimeInterval blinkOnInterval
;
43 NSTimeInterval blinkOffInterval
;
45 #if MM_USE_INPUT_QUEUE
46 NSMutableArray
*inputQueue
;
50 + (MMBackend
*)sharedInstance
;
52 - (void)setBackgroundColor
:(int)color
;
53 - (void)setForegroundColor
:(int)color
;
54 - (void)setSpecialColor
:(int)color
;
55 - (void)setDefaultColorsBackground
:(int)bg foreground
:(int)fg
;
58 - (BOOL
)openVimWindow
;
60 - (void)clearBlockFromRow
:(int)row1 column
:(int)col1
61 toRow
:(int)row2 column
:(int)col2
;
62 - (void)deleteLinesFromRow
:(int)row count
:(int)count
63 scrollBottom
:(int)bottom left
:(int)left right
:(int)right
;
64 - (void)replaceString
:(char*)s length
:(int)len row
:(int)row column
:(int)col
66 - (void)insertLinesFromRow
:(int)row count
:(int)count
67 scrollBottom
:(int)bottom left
:(int)left right
:(int)right
;
68 - (void)drawCursorAtRow
:(int)row column
:(int)col shape
:(int)shape
69 fraction
:(int)percent color
:(int)color
;
70 - (void)flushQueue
:(BOOL
)force
;
71 - (BOOL
)waitForInput
:(int)milliseconds
;
73 - (void)selectTab
:(int)index
;
75 - (BOOL
)tabBarVisible
;
76 - (void)showTabBar
:(BOOL
)enable
;
77 - (void)setRows
:(int)rows columns
:(int)cols
;
78 - (void)setVimWindowTitle
:(char *)title
;
79 - (char *)browseForFileInDirectory
:(char *)dir title
:(char *)title
81 - (int)presentDialogWithType
:(int)type title
:(char *)title message
:(char *)msg
82 buttons
:(char *)btns textField
:(char *)txtfield
;
83 - (void)addMenuWithTag
:(int)tag parent
:(int)parentTag name
:(char *)name
85 - (void)addMenuItemWithTag
:(int)tag parent
:(int)parentTag name
:(char *)name
86 tip
:(char *)tip icon
:(char *)icon
87 keyEquivalent
:(int)key modifiers
:(int)mods
88 action
:(NSString
*)action atIndex
:(int)index
;
89 - (void)removeMenuItemWithTag
:(int)tag
;
90 - (void)enableMenuItemWithTag
:(int)tag state
:(int)enabled
;
91 - (void)showPopupMenuWithName
:(char *)name atMouseLocation
:(BOOL
)mouse
;
92 - (void)showToolbar
:(int)enable flags
:(int)flags
;
93 - (void)createScrollbarWithIdentifier
:(long)ident type
:(int)type
;
94 - (void)destroyScrollbarWithIdentifier
:(long)ident
;
95 - (void)showScrollbarWithIdentifier
:(long)ident state
:(int)visible
;
96 - (void)setScrollbarPosition
:(int)pos length
:(int)len identifier
:(long)ident
;
97 - (void)setScrollbarThumbValue
:(long)val size
:(long)size max
:(long)max
98 identifier
:(long)ident
;
99 - (BOOL
)setFontWithName
:(char *)name
;
100 - (void)executeActionWithName
:(NSString
*)name
;
101 - (void)setMouseShape
:(int)shape
;
102 - (void)setBlinkWait
:(int)wait on
:(int)on off
:(int)off
;
106 - (int)lookupColorWithKey
:(NSString
*)key
;
107 - (BOOL
)hasSpecialKeyWithValue
:(NSString
*)value
;