OSDN Git Service

For macOS 12.0 Beta (21A5506j) 3.1.1
authorkurikinton <kurikinton@users.osdn.me>
Fri, 3 Sep 2021 06:44:22 +0000 (15:44 +0900)
committerkurikinton <kurikinton@users.osdn.me>
Fri, 3 Sep 2021 06:44:22 +0000 (15:44 +0900)
Info.plist
LFApp.h
LFApp.m
LetterFix.m

index 9a632b4..9a5dc60 100644 (file)
        <string>1</string>
        <key>NSPrincipalClass</key>
        <string>LetterFix</string>
+       <key>Supported12.6PluginCompatibilityUUIDs</key>
+       <array>
+               <string>224E7F96-2099-499C-A501-63FB68C79CD2</string>
+       </array>
+       <key>Supported12.5PluginCompatibilityUUIDs</key>
+       <array>
+               <string>224E7F96-2099-499C-A501-63FB68C79CD2</string>
+       </array>
+       <key>Supported12.4PluginCompatibilityUUIDs</key>
+       <array>
+               <string>224E7F96-2099-499C-A501-63FB68C79CD2</string>
+       </array>
+       <key>Supported12.3PluginCompatibilityUUIDs</key>
+       <array>
+               <string>224E7F96-2099-499C-A501-63FB68C79CD2</string>
+       </array>
+       <key>Supported12.2PluginCompatibilityUUIDs</key>
+       <array>
+               <string>224E7F96-2099-499C-A501-63FB68C79CD2</string>
+       </array>
+       <key>Supported12.1PluginCompatibilityUUIDs</key>
+       <array>
+               <string>224E7F96-2099-499C-A501-63FB68C79CD2</string>
+       </array>
+       <key>Supported12.0PluginCompatibilityUUIDs</key>
+       <array>
+               <string>D985F0E4-3BBC-4B95-BBA1-12056AC4A531</string>
+               <string>224E7F96-2099-499C-A501-63FB68C79CD2</string>
+       </array>
+       <key>Supported11.6PluginCompatibilityUUIDs</key>
+       <array>
+               <string>D985F0E4-3BBC-4B95-BBA1-12056AC4A531</string>
+       </array>
        <key>Supported11.5PluginCompatibilityUUIDs</key>
        <array>
                <string>D985F0E4-3BBC-4B95-BBA1-12056AC4A531</string>
diff --git a/LFApp.h b/LFApp.h
index f3e074b..7a3aa7f 100644 (file)
--- a/LFApp.h
+++ b/LFApp.h
@@ -10,7 +10,7 @@
 #import <AppKit/AppKit.h>
 //#import "LFMenu.h"
 
-#define LETTERFIX_VERSION "3.0.3"
+#define LETTERFIX_VERSION "3.1.1"
 
 enum LFversion {
     LF_Unknown = -1,
@@ -21,7 +21,8 @@ enum LFversion {
     LF_HighSierra= 1013,
     LF_Mojave    = 1014,
     LF_Catalina  = 1015,
-    LF_BigSur    = 1100
+    LF_BigSur    = 1100,
+    LF_Monterey  = 1200,
 };
 
 @interface LFApp : NSObject {
diff --git a/LFApp.m b/LFApp.m
index dc4d54f..e1397ee 100644 (file)
--- a/LFApp.m
+++ b/LFApp.m
@@ -66,6 +66,8 @@
                 }
             } else if (systemVersionMajor == 11) {
                 version = LF_BigSur; // 11.x.y
+            } else if (systemVersionMajor == 12) {
+                version = LF_Monterey; // 12.x.y
             } else {
                 version = LF_Unknown;
             }
@@ -83,7 +85,9 @@
             self.shouldFixAllLetters = ![userDefaults boolForKey:@"LetterFixAllLetterFixDisabled"];
             self.shouldAppendCodeInfo = [userDefaults boolForKey:@"LetterFixDoAppendCodeInfo"];
             self.operationModeOnLoad = (int)[userDefaults integerForKey:@"LetterFixOperationAtOpen"];
-            if (version == LF_HighSierra || version == LF_Mojave || version == LF_Catalina || version == LF_BigSur )
+            if (version == LF_HighSierra || version == LF_Mojave ||
+                version == LF_Catalina || version == LF_BigSur ||
+                version == LF_Monterey )
                 self.shouldCheckSubject = [userDefaults integerForKey:@"LetterFixCheckSubjectEnabled"];
             else
                 self.shouldCheckSubject = ![userDefaults integerForKey:@"LetterFixCheckSubjectDisabled"];
index b95794c..44ce52d 100644 (file)
@@ -79,7 +79,7 @@ static void backendSetPreferredEncoding(id backend, unsigned long long encoding)
     } else if (app.version == LF_Yosemite || app.version == LF_ElCapitan ||
                app.version == LF_Sierra || app.version == LF_HighSierra ||
                app.version == LF_Mojave || app.version == LF_Catalina ||
-               app.version == LF_BigSur ) {
+               app.version == LF_BigSur || app.version == LF_Monterey) {
        [backend setEncodingHint: encoding];
     }
 }
@@ -93,7 +93,7 @@ static unsigned long long backendGetPreferredEncoding(id backend)
     } else if (app.version == LF_Yosemite || app.version == LF_ElCapitan ||
                app.version == LF_Sierra || app.version == LF_HighSierra ||
                app.version == LF_Mojave || app.version == LF_Catalina ||
-               app.version == LF_BigSur ) {
+               app.version == LF_BigSur || app.version == LF_Monterey) {
        return [backend encodingHint];
     }
     return LF_Encoding_Auto;
@@ -383,7 +383,8 @@ BOOL _LF_IMP_isLoaded(id self, SEL _cmd)
                                 fixLetter(self, [self webView], NO, YES);
                             } else if (app.version == LF_ElCapitan || app.version == LF_Sierra ||
                                        app.version == LF_HighSierra|| app.version == LF_Mojave ||
-                                       app.version == LF_Catalina  || app.version == LF_BigSur ) {
+                                       app.version == LF_Catalina  || app.version == LF_BigSur ||
+                                       app.version == LF_Monterey) {
                                 fixLetter(self, [self composeWebView], NO, YES);
                             }
                         } else if (returnCode == NSAlertSecondButtonReturn) {
@@ -458,7 +459,8 @@ void _LF_IMP_finishLoadingEditor(id self, SEL _cmd)
                             fixSubject(self, NO, YES);
                             if (app.version == LF_ElCapitan || app.version == LF_Sierra ||
                                 app.version == LF_HighSierra|| app.version == LF_Mojave ||
-                                app.version == LF_Catalina  || app.version == LF_BigSur ) {
+                                app.version == LF_Catalina  || app.version == LF_BigSur ||
+                                app.version == LF_Monterey) {
                                 fixLetter(self, [self composeWebView], NO, YES);
                             }
                         } else if (returnCode == NSAlertSecondButtonReturn) {
@@ -498,7 +500,8 @@ void _LF_IMP_send_(id self, SEL _cmd, id arg1)
         composeView = [self webView];
     } else if (app.version == LF_ElCapitan || app.version == LF_Sierra ||
                app.version == LF_HighSierra|| app.version == LF_Mojave ||
-               app.version == LF_Catalina  || app.version == LF_BigSur ) {
+               app.version == LF_Catalina  || app.version == LF_BigSur ||
+               app.version == LF_Monterey) {
         composeView = [self composeWebView];
     } else {
         [self _LF_send: arg1];
@@ -522,7 +525,8 @@ void _LF_IMP_send_(id self, SEL _cmd, id arg1)
                     fixLetter(self, [self webView], NO, NO);
                 } else if (app.version == LF_ElCapitan || app.version == LF_Sierra ||
                            app.version == LF_HighSierra|| app.version == LF_Mojave ||
-                           app.version == LF_Catalina  || app.version == LF_BigSur ) {
+                           app.version == LF_Catalina  || app.version == LF_BigSur ||
+                           app.version == LF_Monterey) {
                     fixLetter(self, [self composeWebView], NO, NO);
                 }
                 if (backendGetPreferredEncoding([self backEnd]) != LF_Encoding_ISO2022JP) backendSetPreferredEncoding([self backEnd], LF_Encoding_ISO2022JP);
@@ -544,7 +548,8 @@ void _LF_IMP_send_(id self, SEL _cmd, id arg1)
                     fixLetter(self, [self webView], NO, NO);
                 } else if (app.version == LF_ElCapitan || app.version == LF_Sierra ||
                            app.version == LF_HighSierra|| app.version == LF_Mojave ||
-                           app.version == LF_Catalina  || app.version == LF_BigSur ) {
+                           app.version == LF_Catalina  || app.version == LF_BigSur ||
+                           app.version == LF_Monterey) {
                     fixLetter(self, [self composeWebView], NO, NO);
                 }
                 if (backendGetPreferredEncoding([self backEnd]) != LF_Encoding_ISO2022JP) backendSetPreferredEncoding([self backEnd], LF_Encoding_ISO2022JP);
@@ -592,7 +597,8 @@ void _LF_IMP_saveDocument_(id self, SEL _cmd, id arg1)
     } else if (app.shouldCheckOnSave &&
                (app.version == LF_ElCapitan || app.version == LF_Sierra ||
                 app.version == LF_HighSierra|| app.version == LF_Mojave ||
-                app.version == LF_Catalina  || app.version == LF_BigSur )) {
+                app.version == LF_Catalina  || app.version == LF_BigSur ||
+                app.version == LF_Monterey)) {
         composeView = [self composeWebView];
     } else {
         [self _LF_saveDocument: arg1];
@@ -614,7 +620,8 @@ void _LF_IMP_saveDocument_(id self, SEL _cmd, id arg1)
                     fixLetter(self, [self webView], NO, NO);
                 } else if (app.version == LF_ElCapitan || app.version == LF_Sierra ||
                            app.version == LF_HighSierra|| app.version == LF_Mojave ||
-                           app.version == LF_Catalina  || app.version == LF_BigSur ) {
+                           app.version == LF_Catalina  || app.version == LF_BigSur ||
+                           app.version == LF_Monterey) {
                     fixLetter(self, [self composeWebView], NO, NO);
                 }
             } else if (returnCode == NSAlertSecondButtonReturn) {
@@ -640,7 +647,7 @@ NSWindow *_LF_IMP_window(id self, SEL _cmd)
         return [self window];
     } else if (app.version == LF_Sierra || app.version == LF_HighSierra||
                app.version == LF_Mojave || app.version == LF_Catalina  ||
-               app.version == LF_BigSur ) {
+               app.version == LF_BigSur || app.version == LF_Monterey) {
         return [(NSView *)[self view] window];
     }
     return nil;
@@ -665,7 +672,8 @@ NSWindow *_LF_IMP_window(id self, SEL _cmd)
         editorClass = NSClassFromString(@"DocumentEditor");
     } else if (app.version == LF_ElCapitan || app.version == LF_Sierra ||
                app.version == LF_HighSierra|| app.version == LF_Mojave ||
-               app.version == LF_Catalina  || app.version == LF_BigSur ) {
+               app.version == LF_Catalina  || app.version == LF_BigSur ||
+               app.version == LF_Monterey) {
         editorClass = NSClassFromString(@"ComposeViewController");
     } else {
         return;
@@ -680,7 +688,9 @@ NSWindow *_LF_IMP_window(id self, SEL _cmd)
         swizzlingMethod(editorClass, @selector(_animationCompleted), @selector(_LF_animationCompleted), (IMP)_LF_IMP_animationCompleted);
     } else if (app.version == LF_ElCapitan) {
         swizzlingMethod(editorClass, @selector(finishLoadingEditor), @selector(_LF_finishLoadingEditor), (IMP)_LF_IMP_finishLoadingEditor);
-    } else if (app.version == LF_Sierra || app.version == LF_HighSierra || app.version == LF_Mojave || app.version == LF_Catalina || app.version == LF_BigSur ) {
+    } else if (app.version == LF_Sierra || app.version == LF_HighSierra ||
+               app.version == LF_Mojave || app.version == LF_Catalina ||
+               app.version == LF_BigSur || app.version == LF_Monterey) {
         swizzlingMethod(editorClass, @selector(_finishLoadingEditor), @selector(_LF_finishLoadingEditor), (IMP)_LF_IMP_finishLoadingEditor);
     }
     swizzlingMethod(editorClass, @selector(saveDocument:), @selector(_LF_saveDocument:), (IMP)_LF_IMP_saveDocument_);