• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得cocoawindowspythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdombtronvb.netdirectxarduinopreviewerゲームエンジン

SWFファイル内の画像を表示/書き出しするGUIツール


Commit MetaInfo

Revision54c311e7abb6a83763dd7def72efbcf1ddec49c7 (tree)
Zeit2016-10-02 10:28:45
Autormasakih <masakih@user...>
Commitermasakih

Log Message

HMSwfImageをSwiftで書き換えた

Ändern Zusammenfassung

Diff

--- a/KoreNoKaraSu.xcodeproj/project.pbxproj
+++ b/KoreNoKaraSu.xcodeproj/project.pbxproj
@@ -13,11 +13,11 @@
1313 F42ADB321D9A91D400407165 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F42ADB311D9A91D400407165 /* Assets.xcassets */; };
1414 F42ADB351D9A91D400407165 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F42ADB331D9A91D400407165 /* MainMenu.xib */; };
1515 F42ADB401D9A942A00407165 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F42ADB421D9A942A00407165 /* InfoPlist.strings */; };
16- F42ADB451D9A96ED00407165 /* HMSwfImage.m in Sources */ = {isa = PBXBuildFile; fileRef = F42ADB441D9A96ED00407165 /* HMSwfImage.m */; };
1716 F42ADB4C1D9AA56000407165 /* KanColleGraphicDivider in Resources */ = {isa = PBXBuildFile; fileRef = F42ADB4B1D9AA56000407165 /* KanColleGraphicDivider */; };
1817 F42ADB651D9BFDED00407165 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F42ADB631D9BFDED00407165 /* Localizable.strings */; };
1918 F42ADB681D9D5F1300407165 /* HMTemporaryDirectory.m in Sources */ = {isa = PBXBuildFile; fileRef = F42ADB671D9D5F1300407165 /* HMTemporaryDirectory.m */; };
2019 F42ADB6C1D9FC7FD00407165 /* HMSwfDocument.swift in Sources */ = {isa = PBXBuildFile; fileRef = F42ADB6B1D9FC7FD00407165 /* HMSwfDocument.swift */; };
20+ F42ADB8C1DA0909200407165 /* HMSwfImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = F42ADB8B1DA0909200407165 /* HMSwfImage.swift */; };
2121 /* End PBXBuildFile section */
2222
2323 /* Begin PBXContainerItemProxy section */
@@ -49,8 +49,6 @@
4949 F42ADB3E1D9A942300407165 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/HMSwfDocument.strings; sourceTree = "<group>"; };
5050 F42ADB3F1D9A942300407165 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/MainMenu.strings; sourceTree = "<group>"; };
5151 F42ADB411D9A942A00407165 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/InfoPlist.strings; sourceTree = "<group>"; };
52- F42ADB431D9A96ED00407165 /* HMSwfImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMSwfImage.h; sourceTree = "<group>"; };
53- F42ADB441D9A96ED00407165 /* HMSwfImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMSwfImage.m; sourceTree = "<group>"; };
5452 F42ADB471D9AA3EA00407165 /* KanColleGraphicDivider */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = KanColleGraphicDivider; path = "../../Library/Developer/Xcode/DerivedData/KoreNoKaraSu-azymafwtbfcomieoipkjtpgiffzd/Build/Products/Debug/KanColleGraphicDivider"; sourceTree = "<group>"; };
5553 F42ADB4B1D9AA56000407165 /* KanColleGraphicDivider */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; path = KanColleGraphicDivider; sourceTree = BUILT_PRODUCTS_DIR; };
5654 F42ADB581D9BFCD100407165 /* KanColleGraphicDivider.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = KanColleGraphicDivider.xcodeproj; path = KanColleGraphicDivider/KanColleGraphicDivider.xcodeproj; sourceTree = "<group>"; };
@@ -60,6 +58,7 @@
6058 F42ADB671D9D5F1300407165 /* HMTemporaryDirectory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMTemporaryDirectory.m; sourceTree = "<group>"; };
6159 F42ADB6A1D9FC7FC00407165 /* KoreNoKaraSu-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "KoreNoKaraSu-Bridging-Header.h"; sourceTree = "<group>"; };
6260 F42ADB6B1D9FC7FD00407165 /* HMSwfDocument.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMSwfDocument.swift; sourceTree = "<group>"; };
61+ F42ADB8B1DA0909200407165 /* HMSwfImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMSwfImage.swift; sourceTree = "<group>"; };
6362 /* End PBXFileReference section */
6463
6564 /* Begin PBXFrameworksBuildPhase section */
@@ -99,8 +98,7 @@
9998 F42ADB261D9A91D300407165 /* AppDelegate.m */,
10099 F42ADB6B1D9FC7FD00407165 /* HMSwfDocument.swift */,
101100 F42ADB2E1D9A91D400407165 /* HMSwfDocument.xib */,
102- F42ADB431D9A96ED00407165 /* HMSwfImage.h */,
103- F42ADB441D9A96ED00407165 /* HMSwfImage.m */,
101+ F42ADB8B1DA0909200407165 /* HMSwfImage.swift */,
104102 F42ADB661D9D5F1300407165 /* HMTemporaryDirectory.h */,
105103 F42ADB671D9D5F1300407165 /* HMTemporaryDirectory.m */,
106104 F42ADB311D9A91D400407165 /* Assets.xcassets */,
@@ -233,10 +231,10 @@
233231 buildActionMask = 2147483647;
234232 files = (
235233 F42ADB6C1D9FC7FD00407165 /* HMSwfDocument.swift in Sources */,
234+ F42ADB8C1DA0909200407165 /* HMSwfImage.swift in Sources */,
236235 F42ADB2A1D9A91D300407165 /* main.m in Sources */,
237236 F42ADB681D9D5F1300407165 /* HMTemporaryDirectory.m in Sources */,
238237 F42ADB271D9A91D300407165 /* AppDelegate.m in Sources */,
239- F42ADB451D9A96ED00407165 /* HMSwfImage.m in Sources */,
240238 );
241239 runOnlyForDeploymentPostprocessing = 0;
242240 };
--- a/KoreNoKaraSu/HMSwfDocument.swift
+++ b/KoreNoKaraSu/HMSwfDocument.swift
@@ -70,11 +70,7 @@ class HMSwfDocument: NSDocument {
7070 Swift.print("can not create image from \($0.path)")
7171 return nil
7272 }
73- let swfImage = HMSwfImage()
74- swfImage.image = image
75- swfImage.url = $0
76-
77- return swfImage
73+ return HMSwfImage(url: $0, image: image)
7874 }.sorted {
7975 $0.name.numericCompare($1.name)
8076 }
--- a/KoreNoKaraSu/HMSwfImage.h
+++ /dev/null
@@ -1,19 +0,0 @@
1-//
2-// HMSwfImage.h
3-// KoreNoKaraSu
4-//
5-// Created by Hori,Masaki on 2016/09/27.
6-// Copyright © 2016年 Hori,Masaki. All rights reserved.
7-//
8-
9-#import <Foundation/Foundation.h>
10-
11-@interface HMSwfImage : NSObject
12-
13-@property (strong) NSURL *URL;
14-@property (strong) NSImage *image;
15-
16-@property (readonly) NSString *name;
17-@property (readonly) NSString *typeName;
18-
19-@end
--- a/KoreNoKaraSu/HMSwfImage.m
+++ /dev/null
@@ -1,22 +0,0 @@
1-//
2-// HMSwfImage.m
3-// KoreNoKaraSu
4-//
5-// Created by Hori,Masaki on 2016/09/27.
6-// Copyright © 2016年 Hori,Masaki. All rights reserved.
7-//
8-
9-#import "HMSwfImage.h"
10-
11-@implementation HMSwfImage
12-
13-- (NSString *)name
14-{
15- NSString *filename = self.URL.lastPathComponent.stringByDeletingPathExtension;
16-
17- NSArray<NSString *> *comp = [filename componentsSeparatedByString:@"-"];
18- if(comp.count > 1) return comp[1];
19-
20- return filename;
21-}
22-@end
--- /dev/null
+++ b/KoreNoKaraSu/HMSwfImage.swift
@@ -0,0 +1,29 @@
1+//
2+// HMSwfImage.swift
3+// KoreNoKaraSu
4+//
5+// Created by Hori,Masaki on 2016/10/02.
6+// Copyright © 2016年 Hori,Masaki. All rights reserved.
7+//
8+
9+import Cocoa
10+
11+class HMSwfImage : NSObject {
12+ let url: URL
13+ let image: NSImage
14+ var name: String {
15+ let url = self.url
16+ let filename = url.deletingPathExtension().lastPathComponent
17+ let component = filename.components(separatedBy: "-")
18+ if component.count > 1 { return component[1] }
19+ return filename
20+ }
21+ var typeName: String {
22+ return url.pathExtension
23+ }
24+
25+ init(url: URL, image: NSImage) {
26+ self.url = url
27+ self.image = image
28+ }
29+}
--- a/KoreNoKaraSu/KoreNoKaraSu-Bridging-Header.h
+++ b/KoreNoKaraSu/KoreNoKaraSu-Bridging-Header.h
@@ -2,5 +2,4 @@
22 // Use this file to import your target's public headers that you would like to expose to Swift.
33 //
44
5-#import "HMSwfImage.h"
65 #import "HMTemporaryDirectory.h"