- Added support for popup menus
[MacVim/jjgod.git] / MacVim.h
blob7ce529323bd245b2d9c93e12d32ead34db53d247
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>
17 // This is the protocol MMBackend implements.
19 // Only processInput:data: is allowed to cause state changes in Vim; all other
20 // messages should only read the Vim state.
22 @protocol MMBackendProtocol
23 - (oneway void)processInput:(int)msgid data:(in NSData *)data;
24 - (BOOL)checkForModifiedBuffers;
25 - (oneway void)setBrowseForFileString:(in bycopy NSString *)string;
26 - (BOOL)starRegisterToPasteboard:(byref NSPasteboard *)pboard;
27 - (BOOL)starRegisterFromPasteboard:(byref NSPasteboard *)pboard;
28 @end
32 // This is the protocol MMVimController implements.
34 @protocol MMFrontendProtocol
35 - (oneway void)processCommandQueue:(in NSArray *)queue;
36 - (oneway void)showSavePanelForDirectory:(in bycopy NSString *)dir
37 title:(in bycopy NSString *)title
38 saving:(int)saving;
39 @end
43 // This is the protocol MMAppController implements.
45 // It handles connections between MacVim and Vim.
47 @protocol MMAppProtocol
48 - (byref id <MMFrontendProtocol>)connectBackend:
49 (byref in id <MMBackendProtocol>)backend;
50 @end
55 // The following enum lists all messages that are passed between MacVim and
56 // Vim. These can be sent in processInput:data: and in processCommandQueue:.
59 // NOTE! This array must be updated whenever the enum below changes!
60 extern char *MessageStrings[];
62 enum {
63 CheckinMsgID = 1,
64 ConnectedMsgID,
65 KillTaskMsgID,
66 TaskExitedMsgID,
67 OpenVimWindowMsgID,
68 InsertTextMsgID,
69 KeyDownMsgID,
70 CmdKeyMsgID,
71 BatchDrawMsgID,
72 SelectTabMsgID,
73 CloseTabMsgID,
74 AddNewTabMsgID,
75 DraggedTabMsgID,
76 UpdateTabBarMsgID,
77 ShowTabBarMsgID,
78 HideTabBarMsgID,
79 SetTextDimensionsMsgID,
80 SetVimWindowTitleMsgID,
81 ScrollWheelMsgID,
82 MouseDownMsgID,
83 MouseUpMsgID,
84 MouseDraggedMsgID,
85 BrowseForFileMsgID,
86 BrowseForFileReplyMsgID,
87 FlushQueueMsgID,
88 UpdateInsertionPointMsgID,
89 AddMenuMsgID,
90 AddMenuItemMsgID,
91 RemoveMenuItemMsgID,
92 EnableMenuItemMsgID,
93 ExecuteMenuMsgID,
94 ShowToolbarMsgID,
95 CreateScrollbarMsgID,
96 DestroyScrollbarMsgID,
97 ShowScrollbarMsgID,
98 SetScrollbarPositionMsgID,
99 SetScrollbarThumbMsgID,
100 ScrollbarEventMsgID,
101 SetFontMsgID,
102 VimShouldCloseMsgID,
103 SetDefaultColorsMsgID,
104 ExecuteActionMsgID,
105 DropFilesMsgID,
106 DropStringMsgID,
107 ShowPopupMenuMsgID,
111 enum {
112 ClearAllDrawType = 1,
113 ClearBlockDrawType,
114 DeleteLinesDrawType,
115 ReplaceStringDrawType,
116 InsertLinesDrawType
120 // NOTE! These values must be close to zero, or the 'add menu' message might
121 // fail to distinguish type from tag.
122 enum {
123 MenuMenubarType = 0,
124 MenuPopupType,
125 MenuToolbarType
129 enum {
130 ToolbarLabelFlag = 1,
131 ToolbarIconFlag = 2,
132 ToolbarSizeRegularFlag = 4
136 // vim: set ft=objc: