Added partial client/server support (scripting not yet supported)
[MacVim/jjgod.git] / MMBackend.h
blob7cee92b12bb54af06c63ab1eee627cf95c0835b5
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"
15 // If disabled, all input is dropped if input is already being processed. (If
16 // enabled, same thing happens at the moment actually. So this is pretty
17 // useless.)
18 #define MM_USE_INPUT_QUEUE 0
23 @interface MMBackend : NSObject <MMBackendProtocol> {
24 NSMutableArray *queue;
25 NSMutableData *drawData;
26 NSConnection *connection;
27 id frontendProxy;
28 NSDictionary *colorDict;
29 NSDictionary *sysColorDict;
30 BOOL inputReceived;
31 BOOL tabBarVisible;
32 int backgroundColor;
33 int foregroundColor;
34 int specialColor;
35 int defaultBackgroundColor;
36 int defaultForegroundColor;
37 NSDate *lastFlushDate;
38 id dialogReturn;
39 NSTimer *blinkTimer;
40 int blinkState;
41 NSTimeInterval blinkWaitInterval;
42 NSTimeInterval blinkOnInterval;
43 NSTimeInterval blinkOffInterval;
44 BOOL inProcessInput;
45 #if MM_USE_INPUT_QUEUE
46 NSMutableArray *inputQueue;
47 #endif
50 + (MMBackend *)sharedInstance;
52 - (void)setBackgroundColor:(int)color;
53 - (void)setForegroundColor:(int)color;
54 - (void)setSpecialColor:(int)color;
55 - (void)setDefaultColorsBackground:(int)bg foreground:(int)fg;
57 - (NSString *)macVimConnectionName;
58 - (BOOL)checkin;
59 - (BOOL)openVimWindow;
60 - (void)clearAll;
61 - (void)clearBlockFromRow:(int)row1 column:(int)col1
62 toRow:(int)row2 column:(int)col2;
63 - (void)deleteLinesFromRow:(int)row count:(int)count
64 scrollBottom:(int)bottom left:(int)left right:(int)right;
65 - (void)replaceString:(char*)s length:(int)len row:(int)row column:(int)col
66 flags:(int)flags;
67 - (void)insertLinesFromRow:(int)row count:(int)count
68 scrollBottom:(int)bottom left:(int)left right:(int)right;
69 - (void)drawCursorAtRow:(int)row column:(int)col shape:(int)shape
70 fraction:(int)percent color:(int)color;
71 - (void)flushQueue:(BOOL)force;
72 - (BOOL)waitForInput:(int)milliseconds;
73 - (void)exit;
74 - (void)selectTab:(int)index;
75 - (void)updateTabBar;
76 - (BOOL)tabBarVisible;
77 - (void)showTabBar:(BOOL)enable;
78 - (void)setRows:(int)rows columns:(int)cols;
79 - (void)setVimWindowTitle:(char *)title;
80 - (char *)browseForFileInDirectory:(char *)dir title:(char *)title
81 saving:(int)saving;
82 - (int)presentDialogWithType:(int)type title:(char *)title message:(char *)msg
83 buttons:(char *)btns textField:(char *)txtfield;
84 - (void)addMenuWithTag:(int)tag parent:(int)parentTag name:(char *)name
85 atIndex:(int)index;
86 - (void)addMenuItemWithTag:(int)tag parent:(int)parentTag name:(char *)name
87 tip:(char *)tip icon:(char *)icon
88 keyEquivalent:(int)key modifiers:(int)mods
89 action:(NSString *)action atIndex:(int)index;
90 - (void)removeMenuItemWithTag:(int)tag;
91 - (void)enableMenuItemWithTag:(int)tag state:(int)enabled;
92 - (void)showPopupMenuWithName:(char *)name atMouseLocation:(BOOL)mouse;
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 - (BOOL)setFontWithName:(char *)name;
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;
109 - (int)lookupColorWithKey:(NSString *)key;
110 - (BOOL)hasSpecialKeyWithValue:(NSString *)value;
112 @end