|
6 | 6 | // |
7 | 7 |
|
8 | 8 | #import <Cocoa/Cocoa.h> |
9 | | -#import "ConfigWindowController.h" |
10 | 9 |
|
11 | | -@interface AppDelegate : NSObject <NSApplicationDelegate, ConfigWindowControllerDelegate> |
| 10 | +#define kV2RayXHelper @"/Library/Application Support/V2RayX/v2rayx_sysconf" |
| 11 | +#define kSysconfVersion @"v2rayx_sysconf 1.0.0" |
| 12 | +#define kV2RayXSettingVersion 3 |
| 13 | +#define nilCoalescing(a,b) ( (a != nil) ? (a) : (b) ) // equivalent to ?? operator in Swift |
| 14 | + |
| 15 | +typedef enum ProxyMode : NSInteger{ |
| 16 | + rules, |
| 17 | + pac, |
| 18 | + global, |
| 19 | + manual |
| 20 | +} ProxyMode; |
| 21 | + |
| 22 | + |
| 23 | +@interface AppDelegate : NSObject <NSApplicationDelegate> { |
| 24 | + BOOL proxyState; |
| 25 | + ProxyMode proxyMode; |
| 26 | + NSInteger localPort; |
| 27 | + NSInteger httpPort; |
| 28 | + BOOL udpSupport; |
| 29 | + BOOL shareOverLan; |
| 30 | + NSInteger selectedServerIndex; |
| 31 | + NSString* dnsString; |
| 32 | + NSMutableArray *profiles; |
| 33 | + NSString* logLevel; |
| 34 | + |
| 35 | + |
| 36 | + NSString* plistPath; |
| 37 | + NSString* pacPath; |
| 38 | + NSString* logDirPath; |
| 39 | +} |
| 40 | + |
| 41 | +@property NSString* logDirPath; |
| 42 | + |
| 43 | +@property BOOL proxyState; |
| 44 | +@property ProxyMode proxyMode; |
| 45 | +@property NSInteger localPort; |
| 46 | +@property NSInteger httpPort; |
| 47 | +@property BOOL udpSupport; |
| 48 | +@property BOOL shareOverLan; |
| 49 | +@property NSInteger selectedServerIndex; |
| 50 | +@property NSString* dnsString; |
| 51 | +@property NSMutableArray *profiles; |
| 52 | +@property NSString* logLevel; |
| 53 | + |
12 | 54 |
|
13 | 55 | - (IBAction)showHelp:(id)sender; |
14 | 56 | - (IBAction)enableProxy:(id)sender; |
|
18 | 60 | - (IBAction)chooseManualMode:(id)sender; |
19 | 61 | - (IBAction)showConfigWindow:(id)sender; |
20 | 62 | - (IBAction)editPac:(id)sender; |
| 63 | +- (IBAction)viewLog:(id)sender; |
| 64 | + |
| 65 | +- (void)configurationDidChange; |
21 | 66 | - (NSString*)logDirPath; |
22 | | -//- (NSArray*)readDefaultsAsArray; |
23 | | -- (NSDictionary*)readDefaultsAsDictionary; |
| 67 | + |
24 | 68 | @property (strong, nonatomic) NSStatusItem *statusBarItem; |
25 | 69 | @property (strong, nonatomic) IBOutlet NSMenu *statusBarMenu; |
26 | 70 | @property (weak, nonatomic) IBOutlet NSMenuItem *v2rayStatusItem; |
|
0 commit comments