Skip to content

Commit

Permalink
Merge branch 'dev' into ali_translate
Browse files Browse the repository at this point in the history
  • Loading branch information
choykarl authored Dec 30, 2023
2 parents da70ef8 + 79cd67b commit 0cb2216
Show file tree
Hide file tree
Showing 196 changed files with 3,776 additions and 11,720 deletions.
23 changes: 23 additions & 0 deletions Easydict.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
039F5504294B6E29004AB940 /* EZPreferencesWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 039F54FD294B6E29004AB940 /* EZPreferencesWindowController.m */; };
039F5506294B6E29004AB940 /* EZSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 039F5501294B6E29004AB940 /* EZSettingViewController.m */; };
039F5508294B6E29004AB940 /* EZAboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 039F5503294B6E29004AB940 /* EZAboutViewController.m */; };
03A8308D2B405F8E00112834 /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 03A8308C2B405F8E00112834 /* Sparkle */; };
03B022E629231FA6001C7E63 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 03B0221D29231FA6001C7E63 /* Assets.xcassets */; };
03B022E729231FA6001C7E63 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 03B0221F29231FA6001C7E63 /* Main.storyboard */; };
03B022E829231FA6001C7E63 /* entry.m in Sources */ = {isa = PBXBuildFile; fileRef = 03B0222129231FA6001C7E63 /* entry.m */; };
Expand Down Expand Up @@ -241,6 +242,7 @@
62E5BABE2B32956700F5F728 /* AliService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62E5BABD2B32956700F5F728 /* AliService.swift */; };
62E8E6E62B32F7EC005BFAD3 /* AliResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62E8E6E52B32F7EC005BFAD3 /* AliResponse.swift */; };
62ED29A22B15F1F500901F51 /* EZWrapView.m in Sources */ = {isa = PBXBuildFile; fileRef = 62ED29A12B15F1F500901F51 /* EZWrapView.m */; };
9672D7D22B4008B40023B8FB /* MASShortcutBinder+EZMASShortcutBinder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9672D7D12B4008B40023B8FB /* MASShortcutBinder+EZMASShortcutBinder.m */; };
A0B65CA0F31AC8ECFB8347CC /* Pods_EasydictTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 378E73A7EA8FC8FB9C975A63 /* Pods_EasydictTests.framework */; };
B87AC7E36367075BA5D13234 /* Pods_Easydict.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6372B33DFF803C7096A82250 /* Pods_Easydict.framework */; };
C4DD01E92B12B3C80025EE8E /* TencentService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4DD01E82B12B3C80025EE8E /* TencentService.swift */; };
Expand Down Expand Up @@ -715,6 +717,8 @@
62ED29A12B15F1F500901F51 /* EZWrapView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EZWrapView.m; sourceTree = "<group>"; };
6372B33DFF803C7096A82250 /* Pods_Easydict.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Easydict.framework; sourceTree = BUILT_PRODUCTS_DIR; };
91E3E579C6DB88658B4BB102 /* Pods-Easydict.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Easydict.release.xcconfig"; path = "Target Support Files/Pods-Easydict/Pods-Easydict.release.xcconfig"; sourceTree = "<group>"; };
9672D7D02B4008B40023B8FB /* MASShortcutBinder+EZMASShortcutBinder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MASShortcutBinder+EZMASShortcutBinder.h"; sourceTree = "<group>"; };
9672D7D12B4008B40023B8FB /* MASShortcutBinder+EZMASShortcutBinder.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "MASShortcutBinder+EZMASShortcutBinder.m"; sourceTree = "<group>"; };
A230E9A2358C7FBC7FB26189 /* Pods-EasydictTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EasydictTests.debug.xcconfig"; path = "Target Support Files/Pods-EasydictTests/Pods-EasydictTests.debug.xcconfig"; sourceTree = "<group>"; };
C4DD01E82B12B3C80025EE8E /* TencentService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TencentService.swift; sourceTree = "<group>"; };
C4DD01EA2B12BA250025EE8E /* TencentResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TencentResponse.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -760,6 +764,7 @@
03FD68BB2B1DC59600FD388E /* CryptoSwift in Frameworks */,
03CF28002B3DA7D500E19B57 /* RealmSwift in Frameworks */,
03022F222B36D1A400B63209 /* SnapKit in Frameworks */,
03A8308D2B405F8E00112834 /* Sparkle in Frameworks */,
B87AC7E36367075BA5D13234 /* Pods_Easydict.framework in Frameworks */,
03022F1C2B35DEBA00B63209 /* Hue in Frameworks */,
03CF27FE2B3DA7D500E19B57 /* Realm in Frameworks */,
Expand Down Expand Up @@ -1234,6 +1239,8 @@
children = (
03F25CB129327BC200E66A12 /* EZShortcut.h */,
03F25CB229327BC200E66A12 /* EZShortcut.m */,
9672D7D02B4008B40023B8FB /* MASShortcutBinder+EZMASShortcutBinder.h */,
9672D7D12B4008B40023B8FB /* MASShortcutBinder+EZMASShortcutBinder.m */,
);
path = Shortcut;
sourceTree = "<group>";
Expand Down Expand Up @@ -2213,6 +2220,7 @@
03022F212B36D1A400B63209 /* SnapKit */,
03CF27FD2B3DA7D500E19B57 /* Realm */,
03CF27FF2B3DA7D500E19B57 /* RealmSwift */,
03A8308C2B405F8E00112834 /* Sparkle */,
);
productName = Bob;
productReference = C99EEB182385796700FEE666 /* Easydict-debug.app */;
Expand Down Expand Up @@ -2265,6 +2273,7 @@
03022F1D2B36CF3100B63209 /* XCRemoteSwiftPackageReference "SwiftShell" */,
03022F202B36D1A300B63209 /* XCRemoteSwiftPackageReference "SnapKit" */,
03CF27FC2B3DA7D500E19B57 /* XCRemoteSwiftPackageReference "realm-swift" */,
03A8308B2B405F8E00112834 /* XCRemoteSwiftPackageReference "Sparkle" */,
);
productRefGroup = C99EEB192385796700FEE666 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -2505,6 +2514,7 @@
03B0230129231FA6001C7E63 /* EZQueryView.m in Sources */,
03542A3D2937AF4F00C34C33 /* EZQueryResult.m in Sources */,
03262C1F29EF8EE500EFECA0 /* EZPrivacyViewController.m in Sources */,
9672D7D22B4008B40023B8FB /* MASShortcutBinder+EZMASShortcutBinder.m in Sources */,
03BDA7BF2A26DA280079D04F /* NSScanner+EscapedScanning.m in Sources */,
03542A4C2937B5F100C34C33 /* EZYoudaoTranslate.m in Sources */,
037852B329583F5200D0E2CF /* EZServiceCell.m in Sources */,
Expand Down Expand Up @@ -3143,6 +3153,14 @@
minimumVersion = 5.6.0;
};
};
03A8308B2B405F8E00112834 /* XCRemoteSwiftPackageReference "Sparkle" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/sparkle-project/Sparkle";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 2.5.2;
};
};
03CF27FC2B3DA7D500E19B57 /* XCRemoteSwiftPackageReference "realm-swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/realm/realm-swift.git";
Expand Down Expand Up @@ -3185,6 +3203,11 @@
package = 03022F202B36D1A300B63209 /* XCRemoteSwiftPackageReference "SnapKit" */;
productName = SnapKit;
};
03A8308C2B405F8E00112834 /* Sparkle */ = {
isa = XCSwiftPackageProductDependency;
package = 03A8308B2B405F8E00112834 /* XCRemoteSwiftPackageReference "Sparkle" */;
productName = Sparkle;
};
03CF27FD2B3DA7D500E19B57 /* Realm */ = {
isa = XCSwiftPackageProductDependency;
package = 03CF27FC2B3DA7D500E19B57 /* XCRemoteSwiftPackageReference "realm-swift" */;
Expand Down
9 changes: 9 additions & 0 deletions Easydict.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@
"version" : "5.6.0"
}
},
{
"identity" : "sparkle",
"kind" : "remoteSourceControl",
"location" : "https://github.com/sparkle-project/Sparkle",
"state" : {
"revision" : "47d3d90aee3c52b6f61d04ceae426e607df62347",
"version" : "2.5.2"
}
},
{
"identity" : "swiftshell",
"kind" : "remoteSourceControl",
Expand Down
11 changes: 6 additions & 5 deletions Easydict/Feature/Shortcut/EZShortcut.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#import "EZShortcut.h"
#import "EZWindowManager.h"
#import "MASShortcutBinder+EZMASShortcutBinder.h"

@implementation EZShortcut

Expand Down Expand Up @@ -48,23 +49,23 @@ + (void)setup {
[[MASShortcutBinder sharedBinder] setBindingOptions:@{NSValueTransformerNameBindingOption: NSSecureUnarchiveFromDataTransformerName}];
*/

[[MASShortcutBinder sharedBinder] bindShortcutWithDefaultsKey:EZSelectionShortcutKey toAction:^{
[[MASShortcutBinder sharedBinder] ez_bindShortcutWithDefaultsKey:EZSelectionShortcutKey toAction:^{
[windowManager selectTextTranslate];
}];

[[MASShortcutBinder sharedBinder] bindShortcutWithDefaultsKey:EZSnipShortcutKey toAction:^{
[[MASShortcutBinder sharedBinder] ez_bindShortcutWithDefaultsKey:EZSnipShortcutKey toAction:^{
[windowManager snipTranslate];
}];

[[MASShortcutBinder sharedBinder] bindShortcutWithDefaultsKey:EZInputShortcutKey toAction:^{
[[MASShortcutBinder sharedBinder] ez_bindShortcutWithDefaultsKey:EZInputShortcutKey toAction:^{
[windowManager inputTranslate];
}];

[[MASShortcutBinder sharedBinder] bindShortcutWithDefaultsKey:EZShowMiniShortcutKey toAction:^{
[[MASShortcutBinder sharedBinder] ez_bindShortcutWithDefaultsKey:EZShowMiniShortcutKey toAction:^{
[windowManager showMiniFloatingWindow];
}];

[[MASShortcutBinder sharedBinder] bindShortcutWithDefaultsKey:EZScreenshotOCRShortcutKey toAction:^{
[[MASShortcutBinder sharedBinder] ez_bindShortcutWithDefaultsKey:EZScreenshotOCRShortcutKey toAction:^{
[windowManager screenshotOCR];
}];

Expand Down
18 changes: 18 additions & 0 deletions Easydict/Feature/Shortcut/MASShortcutBinder+EZMASShortcutBinder.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// MASShortcutBinder+EZMASShortcutBinder.h
// Easydict
//
// Created by Sharker on 2023/12/30.
// Copyright © 2023 izual. All rights reserved.
//

@import MASShortcut;

NS_ASSUME_NONNULL_BEGIN

@interface MASShortcutBinder (EZMASShortcutBinder)
// hidden pop button when user playing shortcut
- (void)ez_bindShortcutWithDefaultsKey: (NSString*) defaultsKeyName toAction: (dispatch_block_t) action;
@end

NS_ASSUME_NONNULL_END
18 changes: 18 additions & 0 deletions Easydict/Feature/Shortcut/MASShortcutBinder+EZMASShortcutBinder.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// MASShortcutBinder+EZMASShortcutBinder.m
// Easydict
//
// Created by Sharker on 2023/12/30.
// Copyright © 2023 izual. All rights reserved.
//

#import "MASShortcutBinder+EZMASShortcutBinder.h"
#import "EZWindowManager.h"

@implementation MASShortcutBinder (EZMASShortcutBinder)
- (void)ez_bindShortcutWithDefaultsKey:(NSString *)defaultsKeyName toAction:(dispatch_block_t)action {
EZWindowManager *windowManager = [EZWindowManager shared];
[windowManager.popButtonWindow close];
[self bindShortcutWithDefaultsKey:defaultsKeyName toAction:action];
}
@end
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,7 @@ - (void)setupEventMonitor {
}];

[self.eventMonitor setDoubleCommandBlock:^{
NSLog(@"double command");

// TODO: Let users customize double-click shortcuts later on
#if DEBUG
mm_strongify(self);
[self showMiniFloatingWindow];
#endif
NSLog(@"double command block");
}];
}

Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source 'https://rubygems.org'
gem 'cocoapods', '1.14.2'
107 changes: 107 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.6)
rexml
activesupport (7.1.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
base64 (0.2.0)
bigdecimal (3.1.5)
claide (1.1.0)
cocoapods (1.14.2)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.14.2)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.14.2)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (2.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
drb (2.2.0)
ruby2_keywords
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.16.3)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.7.1)
minitest (5.20.0)
molinillo (0.8.0)
mutex_m (0.2.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
public_suffix (4.0.7)
rexml (3.2.6)
ruby-macho (2.5.1)
ruby2_keywords (0.0.5)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.23.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)

PLATFORMS
arm64-darwin-22

DEPENDENCIES
cocoapods (= 1.14.2)!

BUNDLED WITH
2.2.3
5 changes: 2 additions & 3 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ target 'Easydict' do
pod 'MJExtension', '~> 3.2.1'
pod 'Masonry', '~> 1.1.0'
pod 'ReactiveObjC', '~> 3.1.1'
pod 'MASShortcut', '~> 2.4.0'
pod 'MASShortcut', :git => '[email protected]:AkaShark/MASShortcut.git', :branch => 'double_click_modifier'
pod 'MASPreferences', '~> 1.4.1'
pod 'CocoaLumberjack/Swift', '~> 3.6.0'
pod 'SSZipArchive', '~> 2.2.2'
pod 'Sparkle', '~> 2.5.1'
pod 'KVOController', '~> 1.2.0'
pod 'JLRoutes', '~> 2.1'

Expand All @@ -34,7 +33,7 @@ target 'EasydictTests' do
pod 'MJExtension', '~> 3.2.1'
pod 'Masonry', '~> 1.1.0'
pod 'ReactiveObjC', '~> 3.1.1'
pod 'MASShortcut', '~> 2.4.0'
pod 'MASShortcut', :git => '[email protected]:AkaShark/MASShortcut.git', :branch => 'double_click_modifier'
pod 'MASPreferences', '~> 1.4.1'
pod 'CocoaLumberjack/Swift', '~> 3.6.0'
pod 'SSZipArchive', '~> 2.2.2'
Expand Down
19 changes: 12 additions & 7 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ PODS:
- nanopb/encode (2.30909.1)
- PromisesObjC (2.3.1)
- ReactiveObjC (3.1.1)
- Sparkle (2.5.1)
- SSZipArchive (2.2.3)
- SwiftFormat/CLI (0.52.11)

Expand All @@ -117,10 +116,9 @@ DEPENDENCIES:
- KVOController (~> 1.2.0)
- Masonry (~> 1.1.0)
- MASPreferences (~> 1.4.1)
- MASShortcut (~> 2.4.0)
- "MASShortcut (from `[email protected]:AkaShark/MASShortcut.git`, branch `double_click_modifier`)"
- MJExtension (~> 3.2.1)
- ReactiveObjC (~> 3.1.1)
- Sparkle (~> 2.5.1)
- SSZipArchive (~> 2.2.2)
- SwiftFormat/CLI (~> 0.52.11)

Expand All @@ -139,15 +137,23 @@ SPEC REPOS:
- KVOController
- Masonry
- MASPreferences
- MASShortcut
- MJExtension
- nanopb
- PromisesObjC
- ReactiveObjC
- Sparkle
- SSZipArchive
- SwiftFormat

EXTERNAL SOURCES:
MASShortcut:
:branch: double_click_modifier
:git: "[email protected]:AkaShark/MASShortcut.git"

CHECKOUT OPTIONS:
MASShortcut:
:commit: 694922e088bc91eb70eff42ddaf7602c5b87f1f1
:git: "[email protected]:AkaShark/MASShortcut.git"

SPEC CHECKSUMS:
AFNetworking: cb604b1c2bded0871f5f61f5d53653739e841d6b
AppCenter: 85c92db0759d2792a65eb61d6842d2e86611a49a
Expand All @@ -167,10 +173,9 @@ SPEC CHECKSUMS:
nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
ReactiveObjC: 011caa393aa0383245f2dcf9bf02e86b80b36040
Sparkle: ce9957501a2655dd4c8264312c6134ff478a777c
SSZipArchive: 62d4947b08730e4cda640473b0066d209ff033c9
SwiftFormat: 2ca3d0b75754193f0f3ba532291f25ae08dd1e42

PODFILE CHECKSUM: a35287f08d36ebe90dd9f3362e15bf7aaeeaf0f5
PODFILE CHECKSUM: f40ab9f504bd3624478acda6ba9982bd089edb96

COCOAPODS: 1.14.2
Loading

0 comments on commit 0cb2216

Please sign in to comment.