Moved
[MacVim/jjgod.git] / MMBackend.h
blobcca74e368ed98f8a69720d8faba53bebe0c2ca25
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"
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
18 // useless.)
19 #define MM_USE_INPUT_QUEUE 0
24 @interface MMBackend : NSObject <MMBackendProtocol, MMVimServerProtocol,
25 MMVimClientProtocol> {
26 NSMutableArray *queue;
27 NSMutableData *drawData;
28 NSConnection *connection;
29 id frontendProxy;
30 NSDictionary *colorDict;
31 NSDictionary *sysColorDict;
32 BOOL inputReceived;
33 BOOL tabBarVisible;
34 int backgroundColor;
35 int foregroundColor;
36 int specialColor;
37 int defaultBackgroundColor;
38 int defaultForegroundColor;
39 NSDate *lastFlushDate;
40 id dialogReturn;
41 NSTimer *blinkTimer;
42 int blinkState;
43 NSTimeInterval blinkWaitInterval;
44 NSTimeInterval blinkOnInterval;
45 NSTimeInterval blinkOffInterval;
46 BOOL inProcessInput;
47 #if MM_USE_INPUT_QUEUE
48 NSMutableArray *inputQueue;
49 #endif
50 NSMutableDictionary *connectionNameDict;
51 NSMutableDictionary *clientProxyDict;
52 NSMutableDictionary *serverReplyDict;
53 NSString *alternateServerName;
56 + (MMBackend *)sharedInstance;
58 - (void)setBackgroundColor:(int)color;
59 - (void)setForegroundColor:(int)color;
60 - (void)setSpecialColor:(int)color;
61 - (void)setDefaultColorsBackground:(int)bg foreground:(int)fg;
62 - (NSConnection *)connection;
64 - (BOOL)checkin;
65 - (BOOL)openVimWindow;
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)replaceString:(char*)s length:(int)len row:(int)row column:(int)col
72 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)flushQueue:(BOOL)force;
78 - (BOOL)waitForInput:(int)milliseconds;
79 - (void)exit;
80 - (void)selectTab:(int)index;
81 - (void)updateTabBar;
82 - (BOOL)tabBarVisible;
83 - (void)showTabBar:(BOOL)enable;
84 - (void)setRows:(int)rows columns:(int)cols;
85 - (void)setVimWindowTitle:(char *)title;
86 - (char *)browseForFileInDirectory:(char *)dir title:(char *)title
87 saving:(int)saving;
88 - (int)presentDialogWithType:(int)type title:(char *)title message:(char *)msg
89 buttons:(char *)btns textField:(char *)txtfield;
90 - (void)addMenuWithTag:(int)tag parent:(int)parentTag name:(char *)name
91 atIndex:(int)index;
92 - (void)addMenuItemWithTag:(int)tag parent:(int)parentTag name:(char *)name
93 tip:(char *)tip icon:(char *)icon
94 keyEquivalent:(int)key modifiers:(int)mods
95 action:(NSString *)action atIndex:(int)index;
96 - (void)removeMenuItemWithTag:(int)tag;
97 - (void)enableMenuItemWithTag:(int)tag state:(int)enabled;
98 - (void)showPopupMenuWithName:(char *)name atMouseLocation:(BOOL)mouse;
99 - (void)showToolbar:(int)enable flags:(int)flags;
100 - (void)createScrollbarWithIdentifier:(long)ident type:(int)type;
101 - (void)destroyScrollbarWithIdentifier:(long)ident;
102 - (void)showScrollbarWithIdentifier:(long)ident state:(int)visible;
103 - (void)setScrollbarPosition:(int)pos length:(int)len identifier:(long)ident;
104 - (void)setScrollbarThumbValue:(long)val size:(long)size max:(long)max
105 identifier:(long)ident;
106 - (BOOL)setFontWithName:(char *)name;
107 - (void)executeActionWithName:(NSString *)name;
108 - (void)setMouseShape:(int)shape;
109 - (void)setBlinkWait:(int)wait on:(int)on off:(int)off;
110 - (void)startBlink;
111 - (void)stopBlink;
112 - (void)adjustLinespace:(int)linespace;
113 - (void)activate;
115 - (int)lookupColorWithKey:(NSString *)key;
116 - (BOOL)hasSpecialKeyWithValue:(NSString *)value;
118 - (void)registerServerWithName:(NSString *)name;
119 - (BOOL)sendToServer:(NSString *)name string:(NSString *)string
120 reply:(char_u **)reply port:(int *)port expression:(BOOL)expr
121 silent:(BOOL)silent;
122 - (NSArray *)serverList;
123 - (NSString *)peekForReplyOnPort:(int)port;
124 - (NSString *)waitForReplyOnPort:(int)port;
125 - (BOOL)sendReply:(NSString *)reply toPort:(int)port;
127 @end