Revert "Modifier key sends Esc" related commits
[MacVim.git] / src / MacVim / Miscellaneous.h
blob23c3ebe2069170f5b802c7e4ed9d9774d2f97881
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 */
12 #import <Cocoa/Cocoa.h>
13 #import "MacVim.h"
15 #define MM_LOG_DEALLOCATIONS 0
18 #if MM_LOG_DEALLOCATIONS
19 # define LOG_DEALLOC NSLog(@"%s %@", _cmd, [self className]);
20 #else
21 # define LOG_DEALLOC
22 #endif
25 // NSUserDefaults keys
26 extern NSString *MMTabMinWidthKey;
27 extern NSString *MMTabMaxWidthKey;
28 extern NSString *MMTabOptimumWidthKey;
29 extern NSString *MMTextInsetLeftKey;
30 extern NSString *MMTextInsetRightKey;
31 extern NSString *MMTextInsetTopKey;
32 extern NSString *MMTextInsetBottomKey;
33 extern NSString *MMTypesetterKey;
34 extern NSString *MMCellWidthMultiplierKey;
35 extern NSString *MMBaselineOffsetKey;
36 extern NSString *MMTranslateCtrlClickKey;
37 extern NSString *MMTopLeftPointKey;
38 extern NSString *MMOpenInCurrentWindowKey;
39 extern NSString *MMNoFontSubstitutionKey;
40 extern NSString *MMLoginShellKey;
41 extern NSString *MMAtsuiRendererKey;
42 extern NSString *MMUntitledWindowKey;
43 extern NSString *MMTexturedWindowKey;
44 extern NSString *MMZoomBothKey;
45 extern NSString *MMCurrentPreferencePaneKey;
46 extern NSString *MMLoginShellCommandKey;
47 extern NSString *MMLoginShellArgumentKey;
48 extern NSString *MMDialogsTrackPwdKey;
49 #ifdef MM_ENABLE_PLUGINS
50 extern NSString *MMShowLeftPlugInContainerKey;
51 #endif
52 extern NSString *MMOpenLayoutKey;
53 extern NSString *MMVerticalSplitKey;
54 extern NSString *MMPreloadCacheSizeKey;
55 extern NSString *MMLastWindowClosedBehaviorKey;
58 // Enum for MMUntitledWindowKey
59 enum {
60 MMUntitledWindowNever = 0,
61 MMUntitledWindowOnOpen = 1,
62 MMUntitledWindowOnReopen = 2,
63 MMUntitledWindowAlways = 3
66 // Enum for MMOpenLayoutKey (first 4 must match WIN_* defines in main.c)
67 enum {
68 MMLayoutArglist = 0,
69 MMLayoutHorizontalSplit = 1,
70 MMLayoutVerticalSplit = 2,
71 MMLayoutTabs = 3,
72 MMLayoutWindows = 4,
75 // Enum for MMLastWindowClosedBehaviorKey
76 enum {
77 MMDoNothingWhenLastWindowClosed = 0,
78 MMHideWhenLastWindowClosed = 1,
79 MMTerminateWhenLastWindowClosed = 2,
85 @interface NSIndexSet (MMExtras)
86 + (id)indexSetWithVimList:(NSString *)list;
87 @end
90 @interface NSDocumentController (MMExtras)
91 - (void)noteNewRecentFilePath:(NSString *)path;
92 - (void)noteNewRecentFilePaths:(NSArray *)paths;
93 @end
96 @interface NSOpenPanel (MMExtras)
97 - (void)hiddenFilesButtonToggled:(id)sender;
98 - (void)setShowsHiddenFiles:(BOOL)show;
99 @end
102 @interface NSMenu (MMExtras)
103 - (int)indexOfItemWithAction:(SEL)action;
104 - (NSMenuItem *)itemWithAction:(SEL)action;
105 - (NSMenu *)findMenuContainingItemWithAction:(SEL)action;
106 - (NSMenu *)findWindowsMenu;
107 - (NSMenu *)findApplicationMenu;
108 - (NSMenu *)findServicesMenu;
109 - (NSMenu *)findFileMenu;
110 @end
113 @interface NSToolbar (MMExtras)
114 - (int)indexOfItemWithItemIdentifier:(NSString *)identifier;
115 - (NSToolbarItem *)itemAtIndex:(int)idx;
116 - (NSToolbarItem *)itemWithItemIdentifier:(NSString *)identifier;
117 @end
120 @interface NSTabView (MMExtras)
121 - (void)removeAllTabViewItems;
122 @end
125 @interface NSNumber (MMExtras)
126 - (int)tag;
127 @end
131 // Create a view to be used as accessory for open panel. This function assumes
132 // ownership of the view so do not release it.
133 NSView *openPanelAccessoryView();