forked from sassembla/EnteringOrbit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
4,210 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,6 @@ | |
|
||
@property (assign) IBOutlet NSWindow *window; | ||
|
||
- (id) initAppDelegateWithParam:(NSDictionary * )dict; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// EntreringOrbit.h | ||
// EnteringOrbit | ||
// | ||
// Created by sassembla on 2013/09/23. | ||
// Copyright (c) 2013年 sassembla. All rights reserved. | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
@interface EntreringOrbit : NSApplication | ||
|
||
int NSApplicationMain(int argc, const char *argv[]); | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// | ||
// EntreringOrbit.m | ||
// EnteringOrbit | ||
// | ||
// Created by sassembla on 2013/09/23. | ||
// Copyright (c) 2013年 sassembla. All rights reserved. | ||
// | ||
|
||
#import "EntreringOrbit.h" | ||
|
||
|
||
#import "AppDelegate.h" | ||
#define KEY_PERFIX (@"-") | ||
|
||
|
||
@implementation EntreringOrbit | ||
|
||
int NSApplicationMain(int argc, const char *argv[]) { | ||
@autoreleasepool { | ||
NSMutableArray * keyAndValueStrArray = [[NSMutableArray alloc]init]; | ||
|
||
for (int i = 0; i < argc; i++) { | ||
|
||
[keyAndValueStrArray addObject:[NSString stringWithUTF8String:argv[i]]]; | ||
|
||
} | ||
|
||
NSMutableDictionary * argsDict = [[NSMutableDictionary alloc]init]; | ||
|
||
for (int i = 0; i < [keyAndValueStrArray count]; i++) { | ||
NSString * keyOrValue = keyAndValueStrArray[i]; | ||
if ([keyOrValue hasPrefix:KEY_PERFIX]) { | ||
NSString * key = keyOrValue; | ||
|
||
// get value | ||
if (i + 1 < [keyAndValueStrArray count]) { | ||
NSString * value = keyAndValueStrArray[i + 1]; | ||
if ([value hasPrefix:KEY_PERFIX]) { | ||
[argsDict setValue:@"" forKey:key]; | ||
} else { | ||
[argsDict setValue:value forKey:key]; | ||
} | ||
} | ||
else { | ||
NSString * value = @""; | ||
[argsDict setValue:value forKey:key]; | ||
} | ||
} | ||
} | ||
|
||
|
||
AppDelegate * delegate = [[AppDelegate alloc] initAppDelegateWithParam:argsDict]; | ||
|
||
NSApplication * application = [NSApplication sharedApplication]; | ||
[application setDelegate:delegate]; | ||
|
||
[NSApp run]; | ||
|
||
return 0; | ||
} | ||
|
||
} | ||
|
||
@end |
Oops, something went wrong.