Fix "Special Characters" palette bug
[MacVim.git] / src / MacVim / Miscellaneous.h
blobce4a02b55fabd1f604112d9336deaadd201cefea
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;
56 extern NSString *MMFakeEscModifierKey;
57 extern NSString *MMFakeEscTimeoutKey;
58 extern NSString *MMFakeEscOnKeyDownKey;
61 // Enum for MMUntitledWindowKey
62 enum {
63 MMUntitledWindowNever = 0,
64 MMUntitledWindowOnOpen = 1,
65 MMUntitledWindowOnReopen = 2,
66 MMUntitledWindowAlways = 3
69 // Enum for MMOpenLayoutKey (first 4 must match WIN_* defines in main.c)
70 enum {
71 MMLayoutArglist = 0,
72 MMLayoutHorizontalSplit = 1,
73 MMLayoutVerticalSplit = 2,
74 MMLayoutTabs = 3,
75 MMLayoutWindows = 4,
78 // Enum for MMLastWindowClosedBehaviorKey
79 enum {
80 MMDoNothingWhenLastWindowClosed = 0,
81 MMHideWhenLastWindowClosed = 1,
82 MMTerminateWhenLastWindowClosed = 2,
85 // Enum for MMFakeEscModifierKey
86 enum {
87 MMDisableFakeEsc = 0,
88 MMCtrlFakeEsc = 1,
89 MMAltFakeEsc = 2,
90 MMCmdFakeEsc = 3
96 @interface NSIndexSet (MMExtras)
97 + (id)indexSetWithVimList:(NSString *)list;
98 @end
101 @interface NSDocumentController (MMExtras)
102 - (void)noteNewRecentFilePath:(NSString *)path;
103 - (void)noteNewRecentFilePaths:(NSArray *)paths;
104 @end
107 @interface NSOpenPanel (MMExtras)
108 - (void)hiddenFilesButtonToggled:(id)sender;
109 - (void)setShowsHiddenFiles:(BOOL)show;
110 @end
113 @interface NSMenu (MMExtras)
114 - (int)indexOfItemWithAction:(SEL)action;
115 - (NSMenuItem *)itemWithAction:(SEL)action;
116 - (NSMenu *)findMenuContainingItemWithAction:(SEL)action;
117 - (NSMenu *)findWindowsMenu;
118 - (NSMenu *)findApplicationMenu;
119 - (NSMenu *)findServicesMenu;
120 - (NSMenu *)findFileMenu;
121 @end
124 @interface NSToolbar (MMExtras)
125 - (int)indexOfItemWithItemIdentifier:(NSString *)identifier;
126 - (NSToolbarItem *)itemAtIndex:(int)idx;
127 - (NSToolbarItem *)itemWithItemIdentifier:(NSString *)identifier;
128 @end
131 @interface NSTabView (MMExtras)
132 - (void)removeAllTabViewItems;
133 @end
136 @interface NSNumber (MMExtras)
137 - (int)tag;
138 @end
142 // Create a view to be used as accessory for open panel. This function assumes
143 // ownership of the view so do not release it.
144 NSView *openPanelAccessoryView();