Add support for :winpos
[MacVim.git] / src / MacVim / MMBackend.h
blobac9499ca3b8b07b60a8e966b627a40b459deed29
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;
56 int winposX;
57 int winposY;
60 + (MMBackend *)sharedInstance;
62 - (void)setBackgroundColor:(int)color;
63 - (void)setForegroundColor:(int)color;
64 - (void)setSpecialColor:(int)color;
65 - (void)setDefaultColorsBackground:(int)bg foreground:(int)fg;
66 - (NSConnection *)connection;
67 - (NSDictionary *)actionDict;
68 - (int)initialWindowLayout;
69 - (void)getWindowPositionX:(int*)x Y:(int*)y;
70 - (void)setWindowPositionX:(int)x Y:(int)y;
72 - (void)queueMessage:(int)msgid properties:(NSDictionary *)props;
73 - (BOOL)checkin;
74 - (BOOL)openGUIWindow;
75 - (void)clearAll;
76 - (void)clearBlockFromRow:(int)row1 column:(int)col1
77 toRow:(int)row2 column:(int)col2;
78 - (void)deleteLinesFromRow:(int)row count:(int)count
79 scrollBottom:(int)bottom left:(int)left right:(int)right;
80 - (void)drawString:(char_u*)s length:(int)len row:(int)row
81 column:(int)col cells:(int)cells flags:(int)flags;
82 - (void)insertLinesFromRow:(int)row count:(int)count
83 scrollBottom:(int)bottom left:(int)left right:(int)right;
84 - (void)drawCursorAtRow:(int)row column:(int)col shape:(int)shape
85 fraction:(int)percent color:(int)color;
86 - (void)drawInvertedRectAtRow:(int)row column:(int)col numRows:(int)nr
87 numColumns:(int)nc invert:(int)invert;
88 - (void)update;
89 - (void)flushQueue:(BOOL)force;
90 - (BOOL)waitForInput:(int)milliseconds;
91 - (void)exit;
92 - (void)selectTab:(int)index;
93 - (void)updateTabBar;
94 - (BOOL)tabBarVisible;
95 - (void)showTabBar:(BOOL)enable;
96 - (void)setRows:(int)rows columns:(int)cols;
97 - (void)setWindowTitle:(char *)title;
98 - (void)setDocumentFilename:(char *)filename;
99 - (char *)browseForFileWithAttributes:(NSDictionary *)attr;
100 - (int)showDialogWithAttributes:(NSDictionary *)attr textField:(char *)txtfield;
101 - (void)showToolbar:(int)enable flags:(int)flags;
102 - (void)createScrollbarWithIdentifier:(int32_t)ident type:(int)type;
103 - (void)destroyScrollbarWithIdentifier:(int32_t)ident;
104 - (void)showScrollbarWithIdentifier:(int32_t)ident state:(int)visible;
105 - (void)setScrollbarPosition:(int)pos length:(int)len identifier:(int32_t)ident;
106 - (void)setScrollbarThumbValue:(long)val size:(long)size max:(long)max
107 identifier:(int32_t)ident;
108 - (void)setFont:(GuiFont)font wide:(BOOL)wide;
109 - (void)executeActionWithName:(NSString *)name;
110 - (void)setMouseShape:(int)shape;
111 - (void)setBlinkWait:(int)wait on:(int)on off:(int)off;
112 - (void)startBlink;
113 - (void)stopBlink;
114 - (void)adjustLinespace:(int)linespace;
115 - (void)activate;
116 - (void)setPreEditRow:(int)row column:(int)col;
118 - (int)lookupColorWithKey:(NSString *)key;
119 - (BOOL)hasSpecialKeyWithValue:(char_u *)value;
121 - (void)enterFullscreen:(int)fuoptions background:(int)bg;
122 - (void)leaveFullscreen;
123 - (void)setFullscreenBackgroundColor:(int)color;
125 - (void)setAntialias:(BOOL)antialias;
127 - (void)updateModifiedFlag;
129 - (void)registerServerWithName:(NSString *)name;
130 - (BOOL)sendToServer:(NSString *)name string:(NSString *)string
131 reply:(char_u **)reply port:(int *)port expression:(BOOL)expr
132 silent:(BOOL)silent;
133 - (NSArray *)serverList;
134 - (NSString *)peekForReplyOnPort:(int)port;
135 - (NSString *)waitForReplyOnPort:(int)port;
136 - (BOOL)sendReply:(NSString *)reply toPort:(int)port;
138 - (BOOL)waitForAck;
139 - (void)setWaitForAck:(BOOL)yn;
140 - (void)waitForConnectionAcknowledgement;
142 - (BOOL)imState;
143 - (void)setImState:(BOOL)activated;
145 - (void)messageFromNetbeans;
146 - (void)setNetbeansSocket:(int)socket;
148 @end
152 @interface NSString (VimStrings)
153 + (id)stringWithVimString:(char_u *)s;
154 - (char_u *)vimStringSave;
155 @end