forked from macvim-dev/macvim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMMAppController.h
More file actions
134 lines (115 loc) · 3.96 KB
/
MMAppController.h
File metadata and controls
134 lines (115 loc) · 3.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/* vi:set ts=8 sts=4 sw=4 ft=objc:
*
* VIM - Vi IMproved by Bram Moolenaar
* MacVim GUI port by Bjorn Winckler
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
#import <Cocoa/Cocoa.h>
#import "MacVim.h"
@class MMWindowController;
@class MMVimController;
#if !DISABLE_SPARKLE
#if USE_SPARKLE_1
@class SUUpdater;
#else
@class SPUStandardUpdaterController;
@class MMSparkle2Delegate;
#endif
#endif
@interface MMAppController : NSObject <
MMAppProtocol,
NSUserInterfaceItemSearching
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14
, NSMenuItemValidation
#endif
> {
enum NewWindowMode {
NewWindowNormal = 0,
NewWindowClean,
NewWindowCleanNoDefaults,
};
NSConnection *connection;
NSMutableArray *vimControllers;
NSString *openSelectionString;
NSMutableDictionary *pidArguments;
NSMenu *defaultMainMenu;
NSMenu *currentMainMenu;
BOOL mainMenuDirty;
NSMenuItem *appMenuItemTemplate;
NSMenuItem *recentFilesMenuItem;
NSMutableArray *cachedVimControllers;
int preloadPid;
BOOL shouldActivateWhenNextWindowOpens;
int numChildProcesses;
NSMutableDictionary *inputQueues;
int processingFlag;
BOOL hasShownWindowBefore;
BOOL shouldShowWhatsNewPage;
#if !DISABLE_SPARKLE
#if USE_SPARKLE_1
SUUpdater *updater;
#else
SPUStandardUpdaterController *updater;
MMSparkle2Delegate *sparkle2delegate; ///< Sparkle 2 delegate which allows us to customize the updater's behavior.
#endif
#endif
FSEventStreamRef fsEventStream;
}
+ (MMAppController *)sharedInstance;
- (NSMenu *)defaultMainMenu;
- (NSMenuItem *)appMenuItemTemplate;
- (MMVimController *)keyVimController;
- (void)removeVimController:(id)controller;
- (void)windowControllerWillOpen:(MMWindowController *)windowController;
- (void)setMainMenu:(NSMenu *)mainMenu;
- (void)markMainMenuDirty:(NSMenu *)mainMenu;
- (void)refreshMainMenu;
- (NSArray *)filterOpenFiles:(NSArray *)filenames;
- (BOOL)openFiles:(NSArray *)filenames withArguments:(NSDictionary *)args;
- (void)refreshAllAppearances;
- (void)refreshAllTabProperties;
- (void)refreshAllFonts;
- (void)refreshAllResizeConstraints;
- (void)refreshAllTextViews;
- (void)openNewWindow:(enum NewWindowMode)mode activate:(BOOL)activate extraArgs:(NSArray *)args;
- (void)openNewWindow:(enum NewWindowMode)mode activate:(BOOL)activate;
//
// NSMenuItemValidation
//
- (BOOL)validateMenuItem:(NSMenuItem *)item;
//
// Actions exposed to Vim
//
- (IBAction)newWindow:(id)sender;
- (IBAction)newWindowClean:(id)sender;
- (IBAction)newWindowCleanNoDefaults:(id)sender;
- (IBAction)newWindowAndActivate:(id)sender;
- (IBAction)newWindowCleanAndActivate:(id)sender;
- (IBAction)newWindowCleanNoDefaultsAndActivate:(id)sender;
- (IBAction)fileOpen:(id)sender;
- (IBAction)selectNextWindow:(id)sender;
- (IBAction)selectPreviousWindow:(id)sender;
- (IBAction)orderFrontPreferencePanel:(id)sender;
- (IBAction)openWebsite:(id)sender;
- (IBAction)showWhatsNew:(id)sender;
- (IBAction)showVimHelp:(id)sender withCmd:(NSString *)cmd;
- (IBAction)showVimHelp:(id)sender;
- (IBAction)checkForUpdates:(id)sender;
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_13
- (IBAction)zoomAll:(id)sender;
#endif
- (IBAction)stayInFront:(id)sender;
- (IBAction)stayInBack:(id)sender;
- (IBAction)stayLevelNormal:(id)sender;
//
// NSUserInterfaceItemSearching
//
- (NSArray<NSString *> *)localizedTitlesForItem:(id)item;
- (void)searchForItemsWithSearchString:(NSString *)searchString
resultLimit:(NSInteger)resultLimit
matchedItemHandler:(void (^)(NSArray *items))handleMatchedItems;
- (void)performActionForItem:(id)item;
@end