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>
16 // If disabled, all input is dropped if input is already being processed. (If
17 // enabled, same thing happens at the moment actually. So this is pretty
19 #define MM_USE_INPUT_QUEUE 0
24 @interface MMBackend
: NSObject
<MMBackendProtocol
, MMVimServerProtocol
,
25 MMVimClientProtocol
> {
26 NSMutableArray
*queue
;
27 NSMutableData
*drawData
;
28 NSConnection
*connection
;
30 NSDictionary
*colorDict
;
31 NSDictionary
*sysColorDict
;
37 int defaultBackgroundColor
;
38 int defaultForegroundColor
;
39 NSDate
*lastFlushDate
;
43 NSTimeInterval blinkWaitInterval
;
44 NSTimeInterval blinkOnInterval
;
45 NSTimeInterval blinkOffInterval
;
47 #if MM_USE_INPUT_QUEUE
48 NSMutableArray
*inputQueue
;
50 NSMutableDictionary
*connectionNameDict
;
51 NSMutableDictionary
*clientProxyDict
;
52 NSMutableDictionary
*serverReplyDict
;
53 NSString
*alternateServerName
;
56 + (MMBackend
*)sharedInstance
;
58 - (void)setBackgroundColor
:(int)color
;
59 - (void)setForegroundColor
:(int)color
;
60 - (void)setSpecialColor
:(int)color
;
61 - (void)setDefaultColorsBackground
:(int)bg foreground
:(int)fg
;
62 - (NSConnection
*)connection
;
65 - (BOOL
)openVimWindow
;
67 - (void)clearBlockFromRow
:(int)row1 column
:(int)col1
68 toRow
:(int)row2 column
:(int)col2
;
69 - (void)deleteLinesFromRow
:(int)row count
:(int)count
70 scrollBottom
:(int)bottom left
:(int)left right
:(int)right
;
71 - (void)replaceString
:(char*)s length
:(int)len row
:(int)row column
:(int)col
73 - (void)insertLinesFromRow
:(int)row count
:(int)count
74 scrollBottom
:(int)bottom left
:(int)left right
:(int)right
;
75 - (void)drawCursorAtRow
:(int)row column
:(int)col shape
:(int)shape
76 fraction
:(int)percent color
:(int)color
;
77 - (void)flushQueue
:(BOOL
)force
;
78 - (BOOL
)waitForInput
:(int)milliseconds
;
80 - (void)selectTab
:(int)index
;
82 - (BOOL
)tabBarVisible
;
83 - (void)showTabBar
:(BOOL
)enable
;
84 - (void)setRows
:(int)rows columns
:(int)cols
;
85 - (void)setVimWindowTitle
:(char *)title
;
86 - (char *)browseForFileInDirectory
:(char *)dir title
:(char *)title
88 - (int)presentDialogWithType
:(int)type title
:(char *)title message
:(char *)msg
89 buttons
:(char *)btns textField
:(char *)txtfield
;
90 - (void)addMenuWithTag
:(int)tag parent
:(int)parentTag name
:(char *)name
92 - (void)addMenuItemWithTag
:(int)tag parent
:(int)parentTag name
:(char *)name
93 tip
:(char *)tip icon
:(char *)icon
94 keyEquivalent
:(int)key modifiers
:(int)mods
95 action
:(NSString
*)action atIndex
:(int)index
;
96 - (void)removeMenuItemWithTag
:(int)tag
;
97 - (void)enableMenuItemWithTag
:(int)tag state
:(int)enabled
;
98 - (void)showPopupMenuWithName
:(char *)name atMouseLocation
:(BOOL
)mouse
;
99 - (void)showToolbar
:(int)enable flags
:(int)flags
;
100 - (void)createScrollbarWithIdentifier
:(long)ident type
:(int)type
;
101 - (void)destroyScrollbarWithIdentifier
:(long)ident
;
102 - (void)showScrollbarWithIdentifier
:(long)ident state
:(int)visible
;
103 - (void)setScrollbarPosition
:(int)pos length
:(int)len identifier
:(long)ident
;
104 - (void)setScrollbarThumbValue
:(long)val size
:(long)size max
:(long)max
105 identifier
:(long)ident
;
106 - (BOOL
)setFontWithName
:(char *)name
;
107 - (void)executeActionWithName
:(NSString
*)name
;
108 - (void)setMouseShape
:(int)shape
;
109 - (void)setBlinkWait
:(int)wait on
:(int)on off
:(int)off
;
112 - (void)adjustLinespace
:(int)linespace
;
115 - (int)lookupColorWithKey
:(NSString
*)key
;
116 - (BOOL
)hasSpecialKeyWithValue
:(NSString
*)value
;
118 - (void)registerServerWithName
:(NSString
*)name
;
119 - (BOOL
)sendToServer
:(NSString
*)name string
:(NSString
*)string
120 reply
:(char_u
**)reply port
:(int *)port expression
:(BOOL
)expr
122 - (NSArray
*)serverList
;
123 - (NSString
*)peekForReplyOnPort
:(int)port
;
124 - (NSString
*)waitForReplyOnPort
:(int)port
;
125 - (BOOL
)sendReply
:(NSString
*)reply toPort
:(int)port
;