/
Platypus.h
executable file
·149 lines (119 loc) · 4.21 KB
/
Platypus.h
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/*
Platypus - program for creating Mac OS X application wrappers around scripts
Copyright (C) 2008 Sveinbjorn Thordarson <sveinbjornt@simnet.is>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#import <Cocoa/Cocoa.h>
#import <Carbon/Carbon.h>
#import <AppKit/AppKit.h>
#import <Foundation/Foundation.h>
#import "CommonDefs.h"
#import "PlatypusAppSpec.h"
#import "FileList.h"
#import "SuffixList.h"
#import "TypesList.h"
#import "IconFamily.h"
#import "STUtil.h"
#import "EnvController.h"
#import "IconController.h"
#import "FileTypesController.h"
#import "ParamsController.h"
#import "ProfilesController.h"
#import "TextSettingsController.h"
@interface Platypus : NSObject
{
//basic controls
IBOutlet id appNameTextField;
IBOutlet id scriptTypePopupMenu;
IBOutlet id scriptPathTextField;
IBOutlet id editScriptButton;
IBOutlet id revealScriptButton;
IBOutlet id outputTypePopupMenu;
IBOutlet id createAppButton;
IBOutlet id textOutputSettingsButton;
IBOutlet id showAdvancedArrow;
IBOutlet id showOptionsTextField;
//advanced options controls
IBOutlet id interpreterTextField;
IBOutlet id versionTextField;
IBOutlet id signatureTextField;
IBOutlet id bundleIdentifierTextField;
IBOutlet id authorTextField;
IBOutlet id rootPrivilegesCheckbox;
IBOutlet id encryptCheckbox;
IBOutlet id isDroppableCheckbox;
IBOutlet id showInDockCheckbox;
IBOutlet id remainRunningCheckbox;
IBOutlet id editTypesButton;
IBOutlet id toggleAdvancedMenuItem;
IBOutlet id appSizeTextField;
//editor
IBOutlet id editorCheckSyntaxButton;
IBOutlet id editorWindow;
IBOutlet id editorScriptPath;
IBOutlet id editorText;
IBOutlet id commandWindow;
IBOutlet id commandTextField;
//menus
IBOutlet id openRecentMenu;
IBOutlet id syntaxCheckerTextField;
IBOutlet id syntaxScriptPathTextField;
//windows
IBOutlet id window;
IBOutlet id syntaxCheckerWindow;//sheet
// interface controllers
IBOutlet id envControl;
IBOutlet id iconControl;
IBOutlet id typesControl;
IBOutlet id paramsControl;
IBOutlet id profilesControl;
IBOutlet id textSettingsControl;
IBOutlet id prefsControl;
FileList *fileList;
NSMutableArray *recentItems;
NSArray *defaultInterpreters;
}
- (void) createAppSupportFolders;
- (IBAction)createButtonPressed: (id)sender;
- (void)createApp:(NSSavePanel *)sPanel returnCode:(int)result contextInfo:(void *)contextInfo;
- (IBAction)editScript:(id)sender;
- (IBAction)newScript:(id)sender;
- (IBAction)revealScript:(id)sender;
- (IBAction)runScript:(id)sender;
- (IBAction)outputTypeWasChanged:(id)sender;
- (IBAction)scriptTypeSelected:(id)sender;
- (IBAction)selectScript:(id)sender;
- (void)selectScriptPanelDidEnd:(NSOpenPanel *)oPanel returnCode:(int)returnCode contextInfo:(void *)contextInfo;
- (IBAction)toggleAdvancedOptions:(id)sender;
- (BOOL)verifyFieldContents;
- (IBAction)isDroppableWasClicked:(id)sender;
- (IBAction)clearAllFields:(id)sender;
- (void)setScriptType: (int)typeNum;
- (void)loadScript:(NSString *)filename;
- (int)getFileTypeFromSuffix: (NSString *)fileName;
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
- (NSString *)generateBundleIdentifier;
- (BOOL)validateMenuItem:(NSMenuItem*)anItem;
-(void) constructOpenRecentMenu;
- (void)updateEstimatedAppSize;
- (NSString *)estimatedAppSize;
-(id)appSpecFromControls;
- (void) controlsFromAppSpec: (id)spec;
//Help
- (IBAction) showHelp:(id)sender;
- (IBAction) showReadme:(id)sender;
- (IBAction) openWebsite: (id)sender;
//Select editor
- (void)openScriptInBuiltInEditor: (NSString *)path;
@end