Do not allow input queue to fill up
[MacVim.git] / src / MacVim / MMBackend.h
blobf0560263fb0536d1f1d0ec891f7cf4f5fec44db9
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 frontendProxy;
25 NSDictionary *colorDict;
26 NSDictionary *sysColorDict;
27 NSDictionary *actionDict;
28 BOOL tabBarVisible;
29 unsigned backgroundColor;
30 unsigned foregroundColor;
31 unsigned specialColor;
32 unsigned defaultBackgroundColor;
33 unsigned defaultForegroundColor;
34 NSDate *lastFlushDate;
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 ATSFontContainerRef fontContainerRef;
46 NSFont *oldWideFont;
47 BOOL isTerminating;
48 BOOL waitForAck;
49 int initialWindowLayout;
50 BOOL flushDisabled;
53 + (MMBackend *)sharedInstance;
55 - (void)setBackgroundColor:(int)color;
56 - (void)setForegroundColor:(int)color;
57 - (void)setSpecialColor:(int)color;
58 - (void)setDefaultColorsBackground:(int)bg foreground:(int)fg;
59 - (NSConnection *)connection;
60 - (NSDictionary *)actionDict;
61 - (int)initialWindowLayout;
63 - (void)queueMessage:(int)msgid properties:(NSDictionary *)props;
64 - (BOOL)checkin;
65 - (BOOL)openGUIWindow;
66 - (void)clearAll;
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)drawString:(char*)s length:(int)len row:(int)row column:(int)col
72 cells:(int)cells flags:(int)flags;
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)drawInvertedRectAtRow:(int)row column:(int)col numRows:(int)nr
78 numColumns:(int)nc invert:(int)invert;
79 - (void)update;
80 - (void)flushQueue:(BOOL)force;
81 - (BOOL)waitForInput:(int)milliseconds;
82 - (void)exit;
83 - (void)selectTab:(int)index;
84 - (void)updateTabBar;
85 - (BOOL)tabBarVisible;
86 - (void)showTabBar:(BOOL)enable;
87 - (void)setRows:(int)rows columns:(int)cols;
88 - (void)setWindowTitle:(char *)title;
89 - (void)setDocumentFilename:(char *)filename;
90 - (char *)browseForFileWithAttributes:(NSDictionary *)attr;
91 - (int)showDialogWithAttributes:(NSDictionary *)attr textField:(char *)txtfield;
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 - (void)setFont:(NSFont *)font;
100 - (void)setWideFont:(NSFont *)font;
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;
116 - (void)setAntialias:(BOOL)antialias;
118 - (void)updateModifiedFlag;
120 - (void)registerServerWithName:(NSString *)name;
121 - (BOOL)sendToServer:(NSString *)name string:(NSString *)string
122 reply:(char_u **)reply port:(int *)port expression:(BOOL)expr
123 silent:(BOOL)silent;
124 - (NSArray *)serverList;
125 - (NSString *)peekForReplyOnPort:(int)port;
126 - (NSString *)waitForReplyOnPort:(int)port;
127 - (BOOL)sendReply:(NSString *)reply toPort:(int)port;
129 - (BOOL)waitForAck;
130 - (void)setWaitForAck:(BOOL)yn;
131 - (void)waitForConnectionAcknowledgement;
133 @end
137 @interface NSString (VimStrings)
138 + (id)stringWithVimString:(char_u *)s;
139 - (char_u *)vimStringSave;
140 @end