Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 161 lines (126 sloc) 4.757 kB
ad5cf22 @b4winckler Add file for misc code in frontend
authored
1 /* vi:set ts=8 sts=4 sw=4 ft=objc:
2 *
3 * VIM - Vi IMproved by Bram Moolenaar
4 * MacVim GUI port by Bjorn Winckler
5 *
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 */
10
11
12 #import <Cocoa/Cocoa.h>
754d698 @vatic42 Add menu item to toggle the plugin view drawer
vatic42 authored
13 #import "MacVim.h"
ad5cf22 @b4winckler Add file for misc code in frontend
authored
14
5c2795b @b4winckler More file opening options (plus quickstart feature)
authored
15
ae400c2 @b4winckler Add user default MMUseInlineIm
authored
16 // TODO: Remove this when the inline IM code has been tested
17 #define INCLUDE_OLD_IM_CODE
18
34d334c @b4winckler Implemented CoreText renderer
authored
19 // Use Core Text instead of ATSUI when compiling on 10.5+.
20 // Note: Core Text was introduced with 10.5, ATSUI was deprecated on 10.6.
21 #define MM_ENABLE_ATSUI (MAC_OS_X_VERSION_MIN_REQUIRED<MAC_OS_X_VERSION_10_5)
67df700 @b4winckler Disable the ATSUI renderer on 10.6
authored
22
ad5cf22 @b4winckler Add file for misc code in frontend
authored
23
24 // NSUserDefaults keys
25 extern NSString *MMTabMinWidthKey;
26 extern NSString *MMTabMaxWidthKey;
27 extern NSString *MMTabOptimumWidthKey;
e1c4adc @b4winckler Add user default to toggle the "add tab" button
authored
28 extern NSString *MMShowAddTabButtonKey;
ad5cf22 @b4winckler Add file for misc code in frontend
authored
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;
5c2795b @b4winckler More file opening options (plus quickstart feature)
authored
38 extern NSString *MMOpenInCurrentWindowKey;
ad5cf22 @b4winckler Add file for misc code in frontend
authored
39 extern NSString *MMNoFontSubstitutionKey;
40 extern NSString *MMLoginShellKey;
41 extern NSString *MMUntitledWindowKey;
42 extern NSString *MMTexturedWindowKey;
43 extern NSString *MMZoomBothKey;
44 extern NSString *MMCurrentPreferencePaneKey;
45 extern NSString *MMLoginShellCommandKey;
46 extern NSString *MMLoginShellArgumentKey;
47 extern NSString *MMDialogsTrackPwdKey;
5c2795b @b4winckler More file opening options (plus quickstart feature)
authored
48 extern NSString *MMOpenLayoutKey;
49 extern NSString *MMVerticalSplitKey;
50 extern NSString *MMPreloadCacheSizeKey;
27c6830 @b4winckler Add option to hide MacVim when last window closes
authored
51 extern NSString *MMLastWindowClosedBehaviorKey;
ae400c2 @b4winckler Add user default MMUseInlineIm
authored
52 #ifdef INCLUDE_OLD_IM_CODE
53 extern NSString *MMUseInlineImKey;
54 #endif // INCLUDE_OLD_IM_CODE
75ca477 @b4winckler Add suppression tick box to termination alert
authored
55 extern NSString *MMSuppressTerminationAlertKey;
98346d0 @b4winckler Add user default for native/custom full screen
authored
56 extern NSString *MMNativeFullScreenKey;
5c2795b @b4winckler More file opening options (plus quickstart feature)
authored
57
754d698 @vatic42 Add menu item to toggle the plugin view drawer
vatic42 authored
58
ad5cf22 @b4winckler Add file for misc code in frontend
authored
59 // Enum for MMUntitledWindowKey
60 enum {
61 MMUntitledWindowNever = 0,
62 MMUntitledWindowOnOpen = 1,
63 MMUntitledWindowOnReopen = 2,
64 MMUntitledWindowAlways = 3
65 };
66
5c2795b @b4winckler More file opening options (plus quickstart feature)
authored
67 // Enum for MMOpenLayoutKey (first 4 must match WIN_* defines in main.c)
68 enum {
69 MMLayoutArglist = 0,
70 MMLayoutHorizontalSplit = 1,
71 MMLayoutVerticalSplit = 2,
72 MMLayoutTabs = 3,
73 MMLayoutWindows = 4,
74 };
75
27c6830 @b4winckler Add option to hide MacVim when last window closes
authored
76 // Enum for MMLastWindowClosedBehaviorKey
77 enum {
78 MMDoNothingWhenLastWindowClosed = 0,
79 MMHideWhenLastWindowClosed = 1,
80 MMTerminateWhenLastWindowClosed = 2,
81 };
82
5c2795b @b4winckler More file opening options (plus quickstart feature)
authored
83
ad5cf22 @b4winckler Add file for misc code in frontend
authored
84
b7571e2 @b4winckler Fix window dimension autosave regression
authored
85 enum {
86 // These values are chosen so that the min text view size is not too small
87 // with the default font (they only affect resizing with the mouse, you can
88 // still use e.g. ":set lines=2" to go below these values).
89 MMMinRows = 4,
90 MMMinColumns = 30
91 };
92
93
ad5cf22 @b4winckler Add file for misc code in frontend
authored
94
95 @interface NSIndexSet (MMExtras)
96 + (id)indexSetWithVimList:(NSString *)list;
97 @end
98
99
100 @interface NSDocumentController (MMExtras)
101 - (void)noteNewRecentFilePath:(NSString *)path;
5c2795b @b4winckler More file opening options (plus quickstart feature)
authored
102 - (void)noteNewRecentFilePaths:(NSArray *)paths;
ad5cf22 @b4winckler Add file for misc code in frontend
authored
103 @end
104
105
e70fb38 @b4winckler Add "show hidden files" checkbox to save dialog
authored
106 @interface NSSavePanel (MMExtras)
ad5cf22 @b4winckler Add file for misc code in frontend
authored
107 - (void)hiddenFilesButtonToggled:(id)sender;
8c1e930 @b4winckler Use public API to toggle display of hidden files
authored
108 #if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6)
109 // This method is a part of a public API as of Mac OS X 10.6. Only use this
110 // hack for earlier versions of Mac OS X.
ad5cf22 @b4winckler Add file for misc code in frontend
authored
111 - (void)setShowsHiddenFiles:(BOOL)show;
8c1e930 @b4winckler Use public API to toggle display of hidden files
authored
112 #endif
ad5cf22 @b4winckler Add file for misc code in frontend
authored
113 @end
114
115
116 @interface NSMenu (MMExtras)
117 - (int)indexOfItemWithAction:(SEL)action;
118 - (NSMenuItem *)itemWithAction:(SEL)action;
119 - (NSMenu *)findMenuContainingItemWithAction:(SEL)action;
120 - (NSMenu *)findWindowsMenu;
121 - (NSMenu *)findApplicationMenu;
122 - (NSMenu *)findServicesMenu;
123 - (NSMenu *)findFileMenu;
124 @end
125
126
127 @interface NSToolbar (MMExtras)
be45005 @b4winckler Prepare for 64 bit
authored
128 - (NSUInteger)indexOfItemWithItemIdentifier:(NSString *)identifier;
129 - (NSToolbarItem *)itemAtIndex:(NSUInteger)idx;
ad5cf22 @b4winckler Add file for misc code in frontend
authored
130 - (NSToolbarItem *)itemWithItemIdentifier:(NSString *)identifier;
131 @end
132
133
134 @interface NSTabView (MMExtras)
135 - (void)removeAllTabViewItems;
136 @end
137
138
26335ef @b4winckler Cmd-=/- work again
authored
139 @interface NSNumber (MMExtras)
be45005 @b4winckler Prepare for 64 bit
authored
140 // HACK to allow font size to be changed via menu (bound to Cmd+/Cmd-)
141 - (NSInteger)tag;
26335ef @b4winckler Cmd-=/- work again
authored
142 @end
143
144
ad5cf22 @b4winckler Add file for misc code in frontend
authored
145
e70fb38 @b4winckler Add "show hidden files" checkbox to save dialog
authored
146 // Create a view with a "show hidden files" button to be used as accessory for
147 // open/save panels. This function assumes ownership of the view so do not
148 // release it.
149 NSView *showHiddenFilesView();
ad5cf22 @b4winckler Add file for misc code in frontend
authored
150
edbdca2 @b4winckler Normalize filenames to NFKC before opening
authored
151
36154dd @b4winckler More normalization of filenames, use NFC
authored
152 // Convert filenames (which are in a variant of decomposed form, NFD, on HFS+)
153 // to normalization form C (NFC). (This is necessary because Vim does not
154 // automatically compose NFD.) For more information see:
155 // http://developer.apple.com/technotes/tn/tn1150.html
156 // http://developer.apple.com/technotes/tn/tn1150table.html
157 // http://developer.apple.com/qa/qa2001/qa1235.html
158 // http://www.unicode.org/reports/tr15/
159 NSString *normalizeFilename(NSString *filename);
edbdca2 @b4winckler Normalize filenames to NFKC before opening
authored
160 NSArray *normalizeFilenames(NSArray *filenames);
Something went wrong with that request. Please try again.