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
;
54 ATSFontContainerRef fontContainerRef
;
57 + (MMBackend
*)sharedInstance
;
59 - (void)setBackgroundColor
:(int)color
;
60 - (void)setForegroundColor
:(int)color
;
61 - (void)setSpecialColor
:(int)color
;
62 - (void)setDefaultColorsBackground
:(int)bg foreground
:(int)fg
;
63 - (NSConnection
*)connection
;
66 - (BOOL
)openVimWindow
;
68 - (void)clearBlockFromRow
:(int)row1 column
:(int)col1
69 toRow
:(int)row2 column
:(int)col2
;
70 - (void)deleteLinesFromRow
:(int)row count
:(int)count
71 scrollBottom
:(int)bottom left
:(int)left right
:(int)right
;
72 - (void)replaceString
:(char*)s length
:(int)len row
:(int)row column
:(int)col
74 - (void)insertLinesFromRow
:(int)row count
:(int)count
75 scrollBottom
:(int)bottom left
:(int)left right
:(int)right
;
76 - (void)drawCursorAtRow
:(int)row column
:(int)col shape
:(int)shape
77 fraction
:(int)percent color
:(int)color
;
78 - (void)flushQueue
:(BOOL
)force
;
79 - (BOOL
)waitForInput
:(int)milliseconds
;
81 - (void)selectTab
:(int)index
;
83 - (BOOL
)tabBarVisible
;
84 - (void)showTabBar
:(BOOL
)enable
;
85 - (void)setRows
:(int)rows columns
:(int)cols
;
86 - (void)setVimWindowTitle
:(char *)title
;
87 - (char *)browseForFileInDirectory
:(char *)dir title
:(char *)title
89 - (int)presentDialogWithType
:(int)type title
:(char *)title message
:(char *)msg
90 buttons
:(char *)btns textField
:(char *)txtfield
;
91 - (void)addMenuWithTag
:(int)tag parent
:(int)parentTag name
:(char *)name
93 - (void)addMenuItemWithTag
:(int)tag parent
:(int)parentTag name
:(char *)name
94 tip
:(char *)tip icon
:(char *)icon
95 keyEquivalent
:(int)key modifiers
:(int)mods
96 action
:(NSString
*)action atIndex
:(int)index
;
97 - (void)removeMenuItemWithTag
:(int)tag
;
98 - (void)enableMenuItemWithTag
:(int)tag state
:(int)enabled
;
99 - (void)showPopupMenuWithName
:(char *)name atMouseLocation
:(BOOL
)mouse
;
100 - (void)showToolbar
:(int)enable flags
:(int)flags
;
101 - (void)createScrollbarWithIdentifier
:(long)ident type
:(int)type
;
102 - (void)destroyScrollbarWithIdentifier
:(long)ident
;
103 - (void)showScrollbarWithIdentifier
:(long)ident state
:(int)visible
;
104 - (void)setScrollbarPosition
:(int)pos length
:(int)len identifier
:(long)ident
;
105 - (void)setScrollbarThumbValue
:(long)val size
:(long)size max
:(long)max
106 identifier
:(long)ident
;
107 - (BOOL
)setFontWithName
:(char *)name
;
108 - (void)executeActionWithName
:(NSString
*)name
;
109 - (void)setMouseShape
:(int)shape
;
110 - (void)setBlinkWait
:(int)wait on
:(int)on off
:(int)off
;
113 - (void)adjustLinespace
:(int)linespace
;
116 - (int)lookupColorWithKey
:(NSString
*)key
;
117 - (BOOL
)hasSpecialKeyWithValue
:(NSString
*)value
;
119 - (void)registerServerWithName
:(NSString
*)name
;
120 - (BOOL
)sendToServer
:(NSString
*)name string
:(NSString
*)string
121 reply
:(char_u
**)reply port
:(int *)port expression
:(BOOL
)expr
123 - (NSArray
*)serverList
;
124 - (NSString
*)peekForReplyOnPort
:(int)port
;
125 - (NSString
*)waitForReplyOnPort
:(int)port
;
126 - (BOOL
)sendReply
:(NSString
*)reply toPort
:(int)port
;