diff --git a/Plugins/MacOS/StandaloneFileBrowser/StandaloneFileBrowser.xcodeproj/project.pbxproj b/Plugins/MacOS/StandaloneFileBrowser/StandaloneFileBrowser.xcodeproj/project.pbxproj index 5af7a68..b399be0 100755 --- a/Plugins/MacOS/StandaloneFileBrowser/StandaloneFileBrowser.xcodeproj/project.pbxproj +++ b/Plugins/MacOS/StandaloneFileBrowser/StandaloneFileBrowser.xcodeproj/project.pbxproj @@ -105,10 +105,11 @@ 089C1669FE841209C02AAC07 /* Project object */ = { isa = PBXProject; attributes = { + LastUpgradeCheck = 1310; }; buildConfigurationList = 4FADC23708B4156C00ABE55E /* Build configuration list for PBXProject "StandaloneFileBrowser" */; compatibilityVersion = "Xcode 3.1"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( English, @@ -160,12 +161,36 @@ 4FADC23808B4156C00ABE55E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; + ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; name = Debug; @@ -173,12 +198,35 @@ 4FADC23908B4156C00ABE55E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; SDKROOT = macosx; }; name = Release; @@ -188,9 +236,9 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD)"; + CLANG_ENABLE_OBJC_WEAK = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -201,7 +249,6 @@ "-framework", Carbon, ); - PREBINDING = NO; PRODUCT_BUNDLE_IDENTIFIER = com.gkngkc.sfb; PRODUCT_NAME = StandaloneFileBrowser; VALID_ARCHS = "$(ARCHS_STANDARD)"; @@ -214,9 +261,9 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD)"; + CLANG_ENABLE_OBJC_WEAK = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h"; @@ -226,7 +273,6 @@ "-framework", Carbon, ); - PREBINDING = NO; PRODUCT_BUNDLE_IDENTIFIER = com.gkngkc.sfb; PRODUCT_NAME = StandaloneFileBrowser; VALID_ARCHS = "$(ARCHS_STANDARD)"; diff --git a/Plugins/MacOS/StandaloneFileBrowser/StandaloneFileBrowser.xcodeproj/project.xcworkspace/xcuserdata/ruccho.xcuserdatad/UserInterfaceState.xcuserstate b/Plugins/MacOS/StandaloneFileBrowser/StandaloneFileBrowser.xcodeproj/project.xcworkspace/xcuserdata/ruccho.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index b3d08ce..0000000 Binary files a/Plugins/MacOS/StandaloneFileBrowser/StandaloneFileBrowser.xcodeproj/project.xcworkspace/xcuserdata/ruccho.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/Plugins/MacOS/StandaloneFileBrowser/StandaloneFileBrowser.xcodeproj/project.xcworkspace/xcuserdata/tonidurans.xcuserdatad/UserInterfaceState.xcuserstate b/Plugins/MacOS/StandaloneFileBrowser/StandaloneFileBrowser.xcodeproj/project.xcworkspace/xcuserdata/tonidurans.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..16b81df Binary files /dev/null and b/Plugins/MacOS/StandaloneFileBrowser/StandaloneFileBrowser.xcodeproj/project.xcworkspace/xcuserdata/tonidurans.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Plugins/MacOS/StandaloneFileBrowser/StandaloneFileBrowser.xcodeproj/xcuserdata/ruccho.xcuserdatad/xcschemes/xcschememanagement.plist b/Plugins/MacOS/StandaloneFileBrowser/StandaloneFileBrowser.xcodeproj/xcuserdata/tonidurans.xcuserdatad/xcschemes/xcschememanagement.plist similarity index 100% rename from Plugins/MacOS/StandaloneFileBrowser/StandaloneFileBrowser.xcodeproj/xcuserdata/ruccho.xcuserdatad/xcschemes/xcschememanagement.plist rename to Plugins/MacOS/StandaloneFileBrowser/StandaloneFileBrowser.xcodeproj/xcuserdata/tonidurans.xcuserdatad/xcschemes/xcschememanagement.plist diff --git a/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle.meta b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle.meta index 259e0b1..28ccd38 100644 --- a/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle.meta +++ b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle.meta @@ -1,14 +1,35 @@ fileFormatVersion: 2 -guid: d5089fef20a7f094cba97e5427e45726 +guid: 110fdfb459db4fc448a2ccd37e200fa4 folderAsset: yes PluginImporter: externalObjects: {} serializedVersion: 2 iconMap: {} executionOrder: {} + defineConstraints: [] isPreloaded: 0 isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 0 + Exclude Linux64: 1 + Exclude OSXUniversal: 0 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 - first: Any: second: @@ -19,7 +40,15 @@ PluginImporter: second: enabled: 1 settings: + CPU: AnyCPU DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None - first: Standalone: OSXIntel second: @@ -34,7 +63,29 @@ PluginImporter: Standalone: OSXUniversal second: enabled: 1 - settings: {} + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: x86_64 + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: userData: assetBundleName: assetBundleVariant: diff --git a/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents.meta b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents.meta new file mode 100644 index 0000000..37ed2fc --- /dev/null +++ b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 996ea0b0fb9804844ba9595686ee3e7a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist index c4aa597..1643680 100644 --- a/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist +++ b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 21F79 + 21A559 CFBundleDevelopmentRegion English CFBundleExecutable @@ -31,20 +31,20 @@ DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 13E500a + 13A1030d DTPlatformName macosx DTPlatformVersion - 12.3 + 12.0 DTSDKBuild - 21E226 + 21A344 DTSDKName - macosx12.3 + macosx12.0 DTXcode - 1331 + 1310 DTXcodeBuild - 13E500a + 13A1030d LSMinimumSystemVersion - 12.3 + 12.0 diff --git a/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist.meta b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist.meta new file mode 100644 index 0000000..89e7c7d --- /dev/null +++ b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ce685769797f44046afa3e567860c94c +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS.meta b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS.meta new file mode 100644 index 0000000..bd2d540 --- /dev/null +++ b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a5a66f5db020f344c9327188aec2c060 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser old mode 100644 new mode 100755 index 8dc42a6..3d9f981 Binary files a/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser and b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser differ diff --git a/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser.meta b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser.meta new file mode 100644 index 0000000..9c3a600 --- /dev/null +++ b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ddf122e0e89124ce78aacfeecb3ec554 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/_CodeSignature.meta b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/_CodeSignature.meta new file mode 100644 index 0000000..71037e6 --- /dev/null +++ b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/_CodeSignature.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e6cebbdcd59894d7a8bdee7372ecad5d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/_CodeSignature/CodeResources.meta b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/_CodeSignature/CodeResources.meta new file mode 100644 index 0000000..66e7146 --- /dev/null +++ b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/_CodeSignature/CodeResources.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c817908af99224e82a0f7ca523cfeeee +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.jslib b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.jslib index 1198f38..ca09823 100644 --- a/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.jslib +++ b/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.jslib @@ -9,9 +9,9 @@ var StandaloneFileBrowserWebGLPlugin = { // Custom: ".plist, .xml, .yaml" // multiselect: Allows multiple file selection UploadFile: function(gameObjectNamePtr, methodNamePtr, filterPtr, multiselect) { - gameObjectName = Pointer_stringify(gameObjectNamePtr); - methodName = Pointer_stringify(methodNamePtr); - filter = Pointer_stringify(filterPtr); + gameObjectName = UTF8ToString(gameObjectNamePtr); + methodName = UTF8ToString(methodNamePtr); + filter = UTF8ToString(filterPtr); // Delete if element exist var fileInput = document.getElementById(gameObjectName) @@ -54,6 +54,39 @@ var StandaloneFileBrowserWebGLPlugin = { } }, + // Save file from span of bytes + // DownloadFile method does not open SaveFileDialog like standalone builds, its just allows user to download file + // gameObjectNamePtr: Unique GameObject name. Required for calling back unity with SendMessage. + // methodNamePtr: Callback method name on given GameObject. + // filenamePtr: Filename with extension + // byteArray: byte[] to pull a span from + // byteSpanStart: start index of span + // byteSpanSize: length of span + DownloadFileSpan: function(gameObjectNamePtr, methodNamePtr, filenamePtr, byteArray, byteSpanStart, byteSpanSize) { + gameObjectName = UTF8ToString(gameObjectNamePtr); + methodName = UTF8ToString(methodNamePtr); + filename = UTF8ToString(filenamePtr); + + var bytes = new Uint8Array(byteSpanSize); + for (var i = 0; i < byteSpanSize; i++) { + bytes[i] = HEAPU8[byteArray + byteSpanStart + i]; + } + + var downloader = window.document.createElement('a'); + downloader.setAttribute('id', gameObjectName); + downloader.href = window.URL.createObjectURL(new Blob([bytes], { type: 'application/octet-stream' })); + downloader.download = filename; + document.body.appendChild(downloader); + + document.onmouseup = function() { + downloader.click(); + document.body.removeChild(downloader); + document.onmouseup = null; + + SendMessage(gameObjectName, methodName); + } + }, + // Save file // DownloadFile method does not open SaveFileDialog like standalone builds, its just allows user to download file // gameObjectNamePtr: Unique GameObject name. Required for calling back unity with SendMessage. @@ -62,9 +95,9 @@ var StandaloneFileBrowserWebGLPlugin = { // byteArray: byte[] // byteArraySize: byte[].Length DownloadFile: function(gameObjectNamePtr, methodNamePtr, filenamePtr, byteArray, byteArraySize) { - gameObjectName = Pointer_stringify(gameObjectNamePtr); - methodName = Pointer_stringify(methodNamePtr); - filename = Pointer_stringify(filenamePtr); + gameObjectName = UTF8ToString(gameObjectNamePtr); + methodName = UTF8ToString(methodNamePtr); + filename = UTF8ToString(filenamePtr); var bytes = new Uint8Array(byteArraySize); for (var i = 0; i < byteArraySize; i++) { @@ -87,4 +120,4 @@ var StandaloneFileBrowserWebGLPlugin = { } }; -mergeInto(LibraryManager.library, StandaloneFileBrowserWebGLPlugin); \ No newline at end of file +mergeInto(LibraryManager.library, StandaloneFileBrowserWebGLPlugin); diff --git a/StandaloneFileBrowser/package.json b/StandaloneFileBrowser/package.json index 0f30694..2ca4129 100644 --- a/StandaloneFileBrowser/package.json +++ b/StandaloneFileBrowser/package.json @@ -3,7 +3,7 @@ "description": "Native open and save UIs for Windows, MacOS, Linux, WebGL", "name": "com.virtualmaker.filebrowser", "unity": "2019.4", - "version": "1.0.1", + "version": "1.0.5", "category": "utilities", "dependencies": {} -} \ No newline at end of file +}