Use 'keymodel=startsel' instead of 'behave mswin' since the latter ends visual
[MacVim/jjgod.git] / MacVim.h
blob4bead2863a2ecd8a65dbb77f471ea76d23cf0fdc
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 <Cocoa/Cocoa.h>
14 // Enable to use experimental 'enc' support.
15 #define MM_ENABLE_CONV 0
20 // This is the protocol MMBackend implements.
22 // Only processInput:data: is allowed to cause state changes in Vim; all other
23 // messages should only read the Vim state. (Note that setDialogReturn: is an
24 // exception to this rule; there really is no other way to deal with dialogs
25 // since they work with callbacks, so we cannot wait for them to return.)
27 // Be careful with messages with return type other than 'oneway void' -- there
28 // is a reply timeout set in MMAppController, if a message fails to get a
29 // response within the given timeout an exception will be thrown. Use
30 // @try/@catch/@finally to deal with timeouts.
32 @protocol MMBackendProtocol
33 - (oneway void)processInput:(int)msgid data:(in NSData *)data;
34 - (oneway void)processInputAndData:(in NSArray *)messages;
35 - (BOOL)checkForModifiedBuffers;
36 - (oneway void)setDialogReturn:(in bycopy id)obj;
37 - (BOOL)starRegisterToPasteboard:(byref NSPasteboard *)pboard;
38 @end
42 // This is the protocol MMVimController implements.
44 @protocol MMFrontendProtocol
45 - (oneway void)processCommandQueue:(in NSArray *)queue;
46 - (oneway void)showSavePanelForDirectory:(in bycopy NSString *)dir
47 title:(in bycopy NSString *)title
48 saving:(int)saving;
49 - (oneway void)presentDialogWithStyle:(int)style
50 message:(in bycopy NSString *)message
51 informativeText:(in bycopy NSString *)text
52 buttonTitles:(in bycopy NSArray *)buttonTitles
53 textFieldString:(in bycopy NSString *)textFieldString;
54 @end
58 // This is the protocol MMAppController implements.
60 // It handles connections between MacVim and Vim.
62 @protocol MMAppProtocol
63 - (byref id <MMFrontendProtocol>)connectBackend:
64 (byref in id <MMBackendProtocol>)backend pid:(int)pid;
65 @end
70 // The following enum lists all messages that are passed between MacVim and
71 // Vim. These can be sent in processInput:data: and in processCommandQueue:.
74 // NOTE! This array must be updated whenever the enum below changes!
75 extern char *MessageStrings[];
77 enum {
78 OpenVimWindowMsgID = 1,
79 InsertTextMsgID,
80 KeyDownMsgID,
81 CmdKeyMsgID,
82 BatchDrawMsgID,
83 SelectTabMsgID,
84 CloseTabMsgID,
85 AddNewTabMsgID,
86 DraggedTabMsgID,
87 UpdateTabBarMsgID,
88 ShowTabBarMsgID,
89 HideTabBarMsgID,
90 SetTextDimensionsMsgID,
91 SetVimWindowTitleMsgID,
92 ScrollWheelMsgID,
93 MouseDownMsgID,
94 MouseUpMsgID,
95 MouseDraggedMsgID,
96 FlushQueueMsgID,
97 AddMenuMsgID,
98 AddMenuItemMsgID,
99 RemoveMenuItemMsgID,
100 EnableMenuItemMsgID,
101 ExecuteMenuMsgID,
102 ShowToolbarMsgID,
103 ToggleToolbarMsgID,
104 CreateScrollbarMsgID,
105 DestroyScrollbarMsgID,
106 ShowScrollbarMsgID,
107 SetScrollbarPositionMsgID,
108 SetScrollbarThumbMsgID,
109 ScrollbarEventMsgID,
110 SetFontMsgID,
111 VimShouldCloseMsgID,
112 SetDefaultColorsMsgID,
113 ExecuteActionMsgID,
114 DropFilesMsgID,
115 DropStringMsgID,
116 ShowPopupMenuMsgID,
117 GotFocusMsgID,
118 LostFocusMsgID,
119 MouseMovedMsgID,
120 SetMouseShapeMsgID,
124 enum {
125 ClearAllDrawType = 1,
126 ClearBlockDrawType,
127 DeleteLinesDrawType,
128 ReplaceStringDrawType,
129 InsertLinesDrawType,
130 DrawCursorDrawType
133 enum {
134 MMInsertionPointBlock,
135 MMInsertionPointHorizontal,
136 MMInsertionPointVertical,
137 MMInsertionPointHollow,
141 // NOTE! These values must be close to zero, or the 'add menu' message might
142 // fail to distinguish type from tag.
143 enum {
144 MenuMenubarType = 0,
145 MenuPopupType,
146 MenuToolbarType
150 enum {
151 ToolbarLabelFlag = 1,
152 ToolbarIconFlag = 2,
153 ToolbarSizeRegularFlag = 4
157 // NSUserDefaults keys
158 extern NSString *MMNoWindowKey;
159 extern NSString *MMTabMinWidthKey;
160 extern NSString *MMTabMaxWidthKey;
161 extern NSString *MMTabOptimumWidthKey;
162 extern NSString *MMTextInsetLeftKey;
163 extern NSString *MMTextInsetRightKey;
164 extern NSString *MMTextInsetTopKey;
165 extern NSString *MMTextInsetBottomKey;
166 extern NSString *MMTerminateAfterLastWindowClosedKey;
167 extern NSString *MMTypesetterKey;
168 extern NSString *MMCellWidthMultiplierKey;
169 extern NSString *MMBaselineOffsetKey;
170 extern NSString *MMTranslateCtrlClickKey;
171 extern NSString *MMTopLeftPointKey;
172 extern NSString *MMOpenFilesInTabsKey;
177 // vim: set ft=objc: