Add IM control support
[MacVim/jjgod.git] / src / MacVim / MMBackend.h
blob02b959e19595d51cd7382a9fda74d84bf52ba49d
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 BOOL inputReceived;
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;
49 + (MMBackend *)sharedInstance;
51 - (void)setBackgroundColor:(int)color;
52 - (void)setForegroundColor:(int)color;
53 - (void)setSpecialColor:(int)color;
54 - (void)setDefaultColorsBackground:(int)bg foreground:(int)fg;
55 - (NSConnection *)connection;
57 - (BOOL)checkin;
58 - (BOOL)openVimWindow;
59 - (void)clearAll;
60 - (void)clearBlockFromRow:(int)row1 column:(int)col1
61 toRow:(int)row2 column:(int)col2;
62 - (void)deleteLinesFromRow:(int)row count:(int)count
63 scrollBottom:(int)bottom left:(int)left right:(int)right;
64 - (void)drawString:(char*)s length:(int)len row:(int)row column:(int)col
65 cells:(int)cells flags:(int)flags;
66 - (void)insertLinesFromRow:(int)row count:(int)count
67 scrollBottom:(int)bottom left:(int)left right:(int)right;
68 - (void)drawCursorAtRow:(int)row column:(int)col shape:(int)shape
69 fraction:(int)percent color:(int)color;
70 - (void)update;
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)setWindowTitle:(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 - (void)setFont:(NSFont *)font;
101 - (void)setWideFont:(NSFont *)font;
102 - (void)executeActionWithName:(NSString *)name;
103 - (void)setMouseShape:(int)shape;
104 - (void)setBlinkWait:(int)wait on:(int)on off:(int)off;
105 - (void)startBlink;
106 - (void)stopBlink;
107 - (void)adjustLinespace:(int)linespace;
108 - (void)activate;
109 - (void)setPreEditRow:(int)row column:(int)col;
111 - (int)lookupColorWithKey:(NSString *)key;
112 - (BOOL)hasSpecialKeyWithValue:(NSString *)value;
114 - (void)enterFullscreen;
115 - (void)leaveFullscreen;
117 - (void)updateModifiedFlag;
119 - (void)registerServerWithName:(NSString *)name;
120 - (BOOL)sendToServer:(NSString *)name string:(NSString *)string
121 reply:(char_u **)reply port:(int *)port expression:(BOOL)expr
122 silent:(BOOL)silent;
123 - (NSArray *)serverList;
124 - (NSString *)peekForReplyOnPort:(int)port;
125 - (NSString *)waitForReplyOnPort:(int)port;
126 - (BOOL)sendReply:(NSString *)reply toPort:(int)port;
128 @end