Vim talks only to app controller
[MacVim.git] / src / MacVim / MMBackend.h
blob2a20228868f97a92fe177867e82772b57afcd693
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 <Foundation/Foundation.h>
12 #import "MacVim.h"
13 #import "vim.h"
18 @interface MMBackend : NSObject <MMBackendProtocol, MMVimServerProtocol,
19 MMVimClientProtocol> {
20 NSMutableArray *outputQueue;
21 NSMutableArray *inputQueue;
22 NSMutableData *drawData;
23 NSConnection *connection;
24 id appProxy;
25 unsigned identifier;
26 NSDictionary *colorDict;
27 NSDictionary *sysColorDict;
28 NSDictionary *actionDict;
29 BOOL tabBarVisible;
30 unsigned backgroundColor;
31 unsigned foregroundColor;
32 unsigned specialColor;
33 unsigned defaultBackgroundColor;
34 unsigned defaultForegroundColor;
35 id dialogReturn;
36 NSTimer *blinkTimer;
37 int blinkState;
38 NSTimeInterval blinkWaitInterval;
39 NSTimeInterval blinkOnInterval;
40 NSTimeInterval blinkOffInterval;
41 NSMutableDictionary *connectionNameDict;
42 NSMutableDictionary *clientProxyDict;
43 NSMutableDictionary *serverReplyDict;
44 NSString *alternateServerName;
45 GuiFont oldWideFont;
46 BOOL isTerminating;
47 BOOL waitForAck;
48 int initialWindowLayout;
49 BOOL flushDisabled;
50 unsigned numWholeLineChanges;
51 unsigned offsetForDrawDataPrune;
54 + (MMBackend *)sharedInstance;
56 - (void)setBackgroundColor:(int)color;
57 - (void)setForegroundColor:(int)color;
58 - (void)setSpecialColor:(int)color;
59 - (void)setDefaultColorsBackground:(int)bg foreground:(int)fg;
60 - (NSConnection *)connection;
61 - (NSDictionary *)actionDict;
62 - (int)initialWindowLayout;
64 - (void)queueMessage:(int)msgid properties:(NSDictionary *)props;
65 - (BOOL)checkin;
66 - (BOOL)openGUIWindow;
67 - (void)clearAll;
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)drawString:(char*)s length:(int)len row:(int)row column:(int)col
73 cells:(int)cells flags:(int)flags;
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)drawInvertedRectAtRow:(int)row column:(int)col numRows:(int)nr
79 numColumns:(int)nc invert:(int)invert;
80 - (void)update;
81 - (void)flushQueue:(BOOL)force;
82 - (BOOL)waitForInput:(int)milliseconds;
83 - (void)exit;
84 - (void)selectTab:(int)index;
85 - (void)updateTabBar;
86 - (BOOL)tabBarVisible;
87 - (void)showTabBar:(BOOL)enable;
88 - (void)setRows:(int)rows columns:(int)cols;
89 - (void)setWindowTitle:(char *)title;
90 - (void)setDocumentFilename:(char *)filename;
91 - (char *)browseForFileWithAttributes:(NSDictionary *)attr;
92 - (int)showDialogWithAttributes:(NSDictionary *)attr textField:(char *)txtfield;
93 - (void)showToolbar:(int)enable flags:(int)flags;
94 - (void)createScrollbarWithIdentifier:(long)ident type:(int)type;
95 - (void)destroyScrollbarWithIdentifier:(long)ident;
96 - (void)showScrollbarWithIdentifier:(long)ident state:(int)visible;
97 - (void)setScrollbarPosition:(int)pos length:(int)len identifier:(long)ident;
98 - (void)setScrollbarThumbValue:(long)val size:(long)size max:(long)max
99 identifier:(long)ident;
100 - (void)setFont:(GuiFont)font wide:(BOOL)wide;
101 - (void)executeActionWithName:(NSString *)name;
102 - (void)setMouseShape:(int)shape;
103 - (void)setBlinkWait:(int)wait on:(int)on off:(int)off;
104 - (void)startBlink;
105 - (void)stopBlink;
106 - (void)adjustLinespace:(int)linespace;
107 - (void)activate;
108 - (void)setPreEditRow:(int)row column:(int)col;
110 - (int)lookupColorWithKey:(NSString *)key;
111 - (BOOL)hasSpecialKeyWithValue:(NSString *)value;
113 - (void)enterFullscreen:(int)fuoptions background:(int)bg;
114 - (void)leaveFullscreen;
115 - (void)setFullscreenBackgroundColor:(int)color;
117 - (void)setAntialias:(BOOL)antialias;
119 - (void)updateModifiedFlag;
121 - (void)registerServerWithName:(NSString *)name;
122 - (BOOL)sendToServer:(NSString *)name string:(NSString *)string
123 reply:(char_u **)reply port:(int *)port expression:(BOOL)expr
124 silent:(BOOL)silent;
125 - (NSArray *)serverList;
126 - (NSString *)peekForReplyOnPort:(int)port;
127 - (NSString *)waitForReplyOnPort:(int)port;
128 - (BOOL)sendReply:(NSString *)reply toPort:(int)port;
130 - (BOOL)waitForAck;
131 - (void)setWaitForAck:(BOOL)yn;
132 - (void)waitForConnectionAcknowledgement;
134 @end
138 @interface NSString (VimStrings)
139 + (id)stringWithVimString:(char_u *)s;
140 - (char_u *)vimStringSave;
141 @end