Skip to content

Commit

Permalink
Merging with @yury thread-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
N-Holzschuch committed Mar 24, 2018
1 parent 1c79f2a commit 5186127
Show file tree
Hide file tree
Showing 38 changed files with 4,574 additions and 450 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,16 @@ Frameworks/openssl.framework
*.dSYM.zip
*.dSYM

# make and build files
*.lst
*.eep
*.o
*.lo
*.la
*.dylib
*.lss
*.map
*.sym

## Fonts
Resources/Fonts/PragmataPro*
132 changes: 113 additions & 19 deletions Blink.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "934B13A09809163D67AAD90B10B7B0D1F0102B9E",
"DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {

},
"DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
"587450D0945AB07E634FC3A41016F84E296CA37C" : 9223372036854775807,
"934B13A09809163D67AAD90B10B7B0D1F0102B9E" : 9223372036854775807,
"4182765C525509B305166AB949D5935FD5C85212" : 9223372036854775807,
"5928309140879E871CA2C91C35635A4223DBC07C" : 9223372036854775807
},
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "54E7A5E6-210F-4104-AD95-E72D9D2B13EC",
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
"587450D0945AB07E634FC3A41016F84E296CA37C" : "blink\/Frameworks\/PasscodeLock\/",
"934B13A09809163D67AAD90B10B7B0D1F0102B9E" : "blink\/",
"4182765C525509B305166AB949D5935FD5C85212" : "blink\/Frameworks\/MBProgressHUD\/",
"5928309140879E871CA2C91C35635A4223DBC07C" : "blink\/Frameworks\/UICKeyChainStore\/"
},
"DVTSourceControlWorkspaceBlueprintNameKey" : "Blink",
"DVTSourceControlWorkspaceBlueprintVersion" : 204,
"DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "Blink.xcodeproj",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
{
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/blinksh\/MBProgressHUD.git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "4182765C525509B305166AB949D5935FD5C85212"
},
{
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/blinksh\/SwiftPasscodeLock.git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "587450D0945AB07E634FC3A41016F84E296CA37C"
},
{
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/kishikawakatsumi\/UICKeyChainStore.git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "5928309140879E871CA2C91C35635A4223DBC07C"
},
{
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/blinksh\/blink.git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "934B13A09809163D67AAD90B10B7B0D1F0102B9E"
}
]
}
29 changes: 17 additions & 12 deletions Blink.xcodeproj/xcshareddata/xcschemes/Blink.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForTesting = "NO"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
Expand All @@ -20,6 +20,20 @@
ReferencedContainer = "container:Blink.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "NO"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA0BA1A31C0CC57B00719C1A"
BuildableName = "Blink.xctest"
BlueprintName = "BlinkUITests"
ReferencedContainer = "container:Blink.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
Expand All @@ -29,16 +43,6 @@
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA0BA1A31C0CC57B00719C1A"
BuildableName = "Blink.xctest"
BlueprintName = "BlinkUITests"
ReferencedContainer = "container:Blink.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
Expand All @@ -61,6 +65,7 @@
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
stopOnEveryMainThreadCheckerIssue = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
Expand All @@ -77,7 +82,7 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
Expand Down
4 changes: 2 additions & 2 deletions Blink/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@

@import CloudKit;

#undef HOCKEYSDK
#if HOCKEYSDK
@import HockeySDK;
#endif

@interface AppDelegate ()

@end

@implementation AppDelegate {
Expand All @@ -59,6 +59,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
signal(SIGPIPE, _on_pipebroken_signal);

[[BKTouchIDAuthManager sharedManager]registerforDeviceLockNotif];

// Override point for customization after application launch.
#if HOCKEYSDK
NSString *hockeyID = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"HockeyID"];
Expand Down Expand Up @@ -149,7 +150,6 @@ - (void)_startMonitoringForSuspending
repeats:NO];
}


- (BOOL)application:(UIApplication *)application shouldSaveApplicationState:(nonnull NSCoder *)coder
{
return YES;
Expand Down
2 changes: 1 addition & 1 deletion Blink/Blink.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<string>$(TeamIdentifierPrefix)$(CFBundleIdentifier)</string>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)Com.CarlosCabanero.Blink</string>
<string>$(AppIdentifierPrefix)Com.CarlosCabanero.BlinkShell</string>
</array>
</dict>
</plist>
87 changes: 84 additions & 3 deletions Blink/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@
<string>en</string>
<key>CFBundleDisplayName</key>
<string>Blink</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array>
<string>/Users/holzschu/src/Xcode_iPad/blink/Media.xcassets/Settings/appearance.imageset/appearance.png</string>
</array>
<key>CFBundleTypeName</key>
<string>all files</string>
<key>CFBundleTypeRole</key>
<string>Shell</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>public.content</string>
<string>public.archive</string>
</array>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
Expand All @@ -20,12 +40,35 @@
<string>10.104</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>Blink</string>
<key>CFBundleURLSchemes</key>
<array>
<string>blinkshell</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>2</string>
<string>1</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>blinkshell</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>NSAppleMusicUsageDescription</key>
<string>Blink will show current track</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>keyboard</string>
<key>NSSiriUsageDescription</key>
<string>storing commands</string>
<key>NSUserActivityTypes</key>
<array>
<string>com.blink.cmdline</string>
Expand All @@ -35,6 +78,8 @@
<string>fetch</string>
<string>remote-notification</string>
</array>
<key>UIFileSharingEnabled</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
Expand All @@ -43,10 +88,46 @@
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportsDocumentBrowser</key>
<true/>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeIdentifier</key>
<string>public.item</string>
<key>UTTypeSize320IconFile</key>
<string>blink</string>
<key>UTTypeSize64IconFile</key>
<string>blink</string>
</dict>
</array>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeDescription</key>
<string>all files</string>
<key>UTTypeIdentifier</key>
<string>public.item</string>
<key>UTTypeSize320IconFile</key>
<string>blink</string>
<key>UTTypeSize64IconFile</key>
<string>blink</string>
</dict>
<dict>
<key>UTTypeDescription</key>
<string>all files</string>
<key>UTTypeIdentifier</key>
<string>public.content</string>
<key>UTTypeSize320IconFile</key>
<string>blink</string>
<key>UTTypeSize64IconFile</key>
<string>blink</string>
</dict>
</array>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Blink/SmartKeys/SmartKeysView.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
////////////////////////////////////////////////////////////////////////////////

#import "SmartKeysView.h"
#import "SKNonModifierButton.h"
#import "CustomViews/Button/SKNonModifierButton.h"

NSString *const KbdLeftArrowKey = @"";
NSString *const KbdRightArrowKey = @"";
Expand Down
1 change: 1 addition & 0 deletions Blink/TermController.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
@property (strong) MCPSessionParameters *sessionParameters;

- (void)write:(NSString *)input;
- (BOOL)handleControl:(NSString *)control;
- (void)terminate;
- (void)suspend;
- (void)resume;
Expand Down
5 changes: 5 additions & 0 deletions Blink/TermController.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ - (void)write:(NSString *)input
write(_pinput[1], str, [input lengthOfBytesUsingEncoding:NSUTF8StringEncoding]);
}

- (BOOL)handleControl:(NSString *)control
{
return [_session handleControl:control];
}

- (void)indexCommand:(NSString *)cmdLine {

NSUserActivity * activity = [[NSUserActivity alloc] initWithActivityType:BKUserActivityTypeCommandLine];
Expand Down
38 changes: 31 additions & 7 deletions Blink/TermInput.m
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,12 @@ - (void)_insertText:(NSString *)text
}
} else {
NSUInteger modifiers = [[_smartKeys view] modifiers];
if (modifiers & KbdCtrlModifier) {
[_termDelegate write:[CC CTRL:text]];
} else if (modifiers & KbdAltModifier) {
[_termDelegate write:[CC ESC:text]];
if (modifiers == KbdCtrlModifier) {
[self _ctrlSeqWithInput:text];
} else if (modifiers == KbdAltModifier) {
[self _escSeqWithInput:text];
} else if (modifiers == (KbdCtrlModifier | KbdAltModifier)) {
[self _escCtrlSeqWithInput: text];
} else {
[_termDelegate write:[CC KEY:text MOD:0 RAW:_raw]];
}
Expand Down Expand Up @@ -572,6 +574,9 @@ - (void)_ctrlSeqWithInput:(NSString *)input
if (_termDelegate.termView.hasSelection) {
[self _changeSelectionWithInput:input andFlags:UIKeyModifierControl];
} else {
if ([_termDelegate handleControl:input]) {
return;
}
[_termDelegate write:[CC CTRL:input]];
}
}
Expand All @@ -581,13 +586,18 @@ - (void)ctrlSeq:(UIKeyCommand *)cmd
[self _ctrlSeqWithInput:cmd.input];
}

- (void)_escCtrlSeqWithInput:(NSString *)input
{
NSString *seq = [NSString stringWithFormat:@"%@%@", [CC ESC:nil], [CC CTRL:input]];
[_termDelegate write:seq];
}

- (void)escCtrlSeq:(UIKeyCommand *)cmd
{
if (_termDelegate.termView.hasSelection) {
[self _changeSelectionWithInput:cmd.input andFlags:UIKeyModifierControl | UIKeyModifierAlternate];
} else {
NSString *seq = [NSString stringWithFormat:@"%@%@", [CC ESC:nil], [CC CTRL:cmd.input]];
[_termDelegate write:seq];
[self _escCtrlSeqWithInput:cmd.input];
}
}

Expand Down Expand Up @@ -626,7 +636,21 @@ - (void)autoRepeatSeq:(id)sender
if (_termDelegate.termView.hasSelection) {
[self _changeSelection:command];
} else {
[_termDelegate write:command.input];
if (self.inputAccessoryView.hidden) {
return [_termDelegate write:command.input];
}

NSString *text = command.input;
NSUInteger modifiers = [[_smartKeys view] modifiers];
if (modifiers == KbdCtrlModifier) {
[self _ctrlSeqWithInput:text];
} else if (modifiers == KbdAltModifier) {
[self _escSeqWithInput:text];
} else if (modifiers == (KbdCtrlModifier | KbdAltModifier)) {
[self _escCtrlSeqWithInput: text];
} else {
[_termDelegate write:text];
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions Blink/TermJS.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,10 @@ NSString *term_modifySideSelection()
return @"term_modifySideSelection();";
}

NSString *term_setAutoCarriageReturn(BOOL state)
{
return [NSString stringWithFormat:@"term_setAutoCarriageReturn(%@)", state ? @"true" : @"false"];
}


#endif /* TermJS_h */
Loading

0 comments on commit 5186127

Please sign in to comment.