Don't use +[NSConnection defaultConnection]
[MacVim.git] / src / MacVim / MMBackend.h
blob83f5313340bf694d8893cdcb8f4cfd5384c5d87b
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 NSConnection *vimServerConnection;
25 id appProxy;
26 unsigned identifier;
27 NSDictionary *colorDict;
28 NSDictionary *sysColorDict;
29 NSDictionary *actionDict;
30 BOOL tabBarVisible;
31 unsigned backgroundColor;
32 unsigned foregroundColor;
33 unsigned specialColor;
34 unsigned defaultBackgroundColor;
35 unsigned defaultForegroundColor;
36 id dialogReturn;
37 NSTimer *blinkTimer;
38 int blinkState;
39 NSTimeInterval blinkWaitInterval;
40 NSTimeInterval blinkOnInterval;
41 NSTimeInterval blinkOffInterval;
42 NSMutableDictionary *connectionNameDict;
43 NSMutableDictionary *clientProxyDict;
44 NSMutableDictionary *serverReplyDict;
45 NSString *alternateServerName;
46 GuiFont oldWideFont;
47 BOOL isTerminating;
48 BOOL waitForAck;
49 int initialWindowLayout;
50 BOOL flushDisabled;
51 unsigned numWholeLineChanges;
52 unsigned offsetForDrawDataPrune;
53 BOOL imState;
54 CFSocketRef netbeansSocket;
55 CFRunLoopSourceRef netbeansRunLoopSource;
58 + (MMBackend *)sharedInstance;
60 - (void)setBackgroundColor:(int)color;
61 - (void)setForegroundColor:(int)color;
62 - (void)setSpecialColor:(int)color;
63 - (void)setDefaultColorsBackground:(int)bg foreground:(int)fg;
64 - (NSConnection *)connection;
65 - (NSDictionary *)actionDict;
66 - (int)initialWindowLayout;
68 - (void)queueMessage:(int)msgid properties:(NSDictionary *)props;
69 - (BOOL)checkin;
70 - (BOOL)openGUIWindow;
71 - (void)clearAll;
72 - (void)clearBlockFromRow:(int)row1 column:(int)col1
73 toRow:(int)row2 column:(int)col2;
74 - (void)deleteLinesFromRow:(int)row count:(int)count
75 scrollBottom:(int)bottom left:(int)left right:(int)right;
76 - (void)drawString:(char*)s length:(int)len row:(int)row column:(int)col
77 cells:(int)cells flags:(int)flags;
78 - (void)insertLinesFromRow:(int)row count:(int)count
79 scrollBottom:(int)bottom left:(int)left right:(int)right;
80 - (void)drawCursorAtRow:(int)row column:(int)col shape:(int)shape
81 fraction:(int)percent color:(int)color;
82 - (void)drawInvertedRectAtRow:(int)row column:(int)col numRows:(int)nr
83 numColumns:(int)nc invert:(int)invert;
84 - (void)update;
85 - (void)flushQueue:(BOOL)force;
86 - (BOOL)waitForInput:(int)milliseconds;
87 - (void)exit;
88 - (void)selectTab:(int)index;
89 - (void)updateTabBar;
90 - (BOOL)tabBarVisible;
91 - (void)showTabBar:(BOOL)enable;
92 - (void)setRows:(int)rows columns:(int)cols;
93 - (void)setWindowTitle:(char *)title;
94 - (void)setDocumentFilename:(char *)filename;
95 - (char *)browseForFileWithAttributes:(NSDictionary *)attr;
96 - (int)showDialogWithAttributes:(NSDictionary *)attr textField:(char *)txtfield;
97 - (void)showToolbar:(int)enable flags:(int)flags;
98 - (void)createScrollbarWithIdentifier:(long)ident type:(int)type;
99 - (void)destroyScrollbarWithIdentifier:(long)ident;
100 - (void)showScrollbarWithIdentifier:(long)ident state:(int)visible;
101 - (void)setScrollbarPosition:(int)pos length:(int)len identifier:(long)ident;
102 - (void)setScrollbarThumbValue:(long)val size:(long)size max:(long)max
103 identifier:(long)ident;
104 - (void)setFont:(GuiFont)font wide:(BOOL)wide;
105 - (void)executeActionWithName:(NSString *)name;
106 - (void)setMouseShape:(int)shape;
107 - (void)setBlinkWait:(int)wait on:(int)on off:(int)off;
108 - (void)startBlink;
109 - (void)stopBlink;
110 - (void)adjustLinespace:(int)linespace;
111 - (void)activate;
112 - (void)setPreEditRow:(int)row column:(int)col;
114 - (int)lookupColorWithKey:(NSString *)key;
115 - (BOOL)hasSpecialKeyWithValue:(char_u *)value;
117 - (void)enterFullscreen:(int)fuoptions background:(int)bg;
118 - (void)leaveFullscreen;
119 - (void)setFullscreenBackgroundColor:(int)color;
121 - (void)setAntialias:(BOOL)antialias;
123 - (void)updateModifiedFlag;
125 - (void)registerServerWithName:(NSString *)name;
126 - (BOOL)sendToServer:(NSString *)name string:(NSString *)string
127 reply:(char_u **)reply port:(int *)port expression:(BOOL)expr
128 silent:(BOOL)silent;
129 - (NSArray *)serverList;
130 - (NSString *)peekForReplyOnPort:(int)port;
131 - (NSString *)waitForReplyOnPort:(int)port;
132 - (BOOL)sendReply:(NSString *)reply toPort:(int)port;
134 - (BOOL)waitForAck;
135 - (void)setWaitForAck:(BOOL)yn;
136 - (void)waitForConnectionAcknowledgement;
138 - (BOOL)imState;
139 - (void)setImState:(BOOL)activated;
141 - (void)messageFromNetbeans;
142 - (void)setNetbeansSocket:(int)socket;
144 @end
148 @interface NSString (VimStrings)
149 + (id)stringWithVimString:(char_u *)s;
150 - (char_u *)vimStringSave;
151 @end