@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 52;
objects = {

/* Begin PBXBuildFile section */
@@ -13,6 +13,9 @@
B0581F3225C272C3000AEF90 /* STXDocumentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0581F3125C272C3000AEF90 /* STXDocumentViewController.swift */; };
B0581F3625C276C6000AEF90 /* Number+Scaling.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0581F3525C276C6000AEF90 /* Number+Scaling.swift */; };
B05C9E9525C4BEB8002DE786 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = B05C9E9425C4BEB8002DE786 /* InfoPlist.strings */; };
B08BC08A25C5143D00C08C81 /* AppKitIntegration.h in Headers */ = {isa = PBXBuildFile; fileRef = B08BC08825C5143D00C08C81 /* AppKitIntegration.h */; settings = {ATTRIBUTES = (Public, ); }; };
B08BC09625C5147100C08C81 /* AppKitIntegration.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B08BC08625C5143D00C08C81 /* AppKitIntegration.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
B08BC09925C5148200C08C81 /* AppKitController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B08BC09825C5148200C08C81 /* AppKitController.swift */; };
B09299E625C394F30072E89A /* STXFontButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B09299E525C394F30072E89A /* STXFontButton.swift */; };
B0A6BA8425C26B49007F945E /* STXAppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0A6BA8325C26B49007F945E /* STXAppDelegate.swift */; };
B0A6BA8A25C26B49007F945E /* STXDocument.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0A6BA8925C26B49007F945E /* STXDocument.swift */; };
@@ -21,6 +24,29 @@
B0A6BA9F25C26BE9007F945E /* STXWindowScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0A6BA9E25C26BE9007F945E /* STXWindowScene.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
B08BC09025C5144B00C08C81 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = B0A6BA7825C26B49007F945E /* Project object */;
proxyType = 1;
remoteGlobalIDString = B08BC08525C5143D00C08C81;
remoteInfo = AppKitIntegration;
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
B08BC09525C5146700C08C81 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
B08BC09625C5147100C08C81 /* AppKitIntegration.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
B04A806D25C38E8200CCC1D8 /* STXVisualEffectView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = STXVisualEffectView.swift; sourceTree = "<group>"; };
B04A807125C38EE600CCC1D8 /* STXColorButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = STXColorButton.swift; sourceTree = "<group>"; };
@@ -29,6 +55,10 @@
B0581F3525C276C6000AEF90 /* Number+Scaling.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Number+Scaling.swift"; sourceTree = "<group>"; };
B05C9E9425C4BEB8002DE786 /* InfoPlist.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; path = InfoPlist.strings; sourceTree = "<group>"; };
B05C9E9725C4C1A1002DE786 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
B08BC08625C5143D00C08C81 /* AppKitIntegration.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AppKitIntegration.framework; sourceTree = BUILT_PRODUCTS_DIR; };
B08BC08825C5143D00C08C81 /* AppKitIntegration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppKitIntegration.h; sourceTree = "<group>"; };
B08BC08925C5143D00C08C81 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
B08BC09825C5148200C08C81 /* AppKitController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppKitController.swift; sourceTree = "<group>"; };
B09299E525C394F30072E89A /* STXFontButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = STXFontButton.swift; sourceTree = "<group>"; };
B0A6BA8025C26B49007F945E /* smalltext.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = smalltext.app; sourceTree = BUILT_PRODUCTS_DIR; };
B0A6BA8325C26B49007F945E /* STXAppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = STXAppDelegate.swift; sourceTree = "<group>"; };
@@ -41,6 +71,13 @@
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
B08BC08325C5143D00C08C81 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
B0A6BA7D25C26B49007F945E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -81,19 +118,39 @@
path = Controllers;
sourceTree = "<group>";
};
B08BC08725C5143D00C08C81 /* AppKitIntegration */ = {
isa = PBXGroup;
children = (
B08BC08825C5143D00C08C81 /* AppKitIntegration.h */,
B08BC09825C5148200C08C81 /* AppKitController.swift */,
B08BC08925C5143D00C08C81 /* Info.plist */,
);
path = AppKitIntegration;
sourceTree = "<group>";
};
B08BC09225C5145000C08C81 /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "<group>";
};
B0A6BA7725C26B49007F945E = {
isa = PBXGroup;
children = (
B05C9E9725C4C1A1002DE786 /* README.md */,
B0A6BA8225C26B49007F945E /* smalltext */,
B08BC08725C5143D00C08C81 /* AppKitIntegration */,
B0A6BA8125C26B49007F945E /* Products */,
B08BC09225C5145000C08C81 /* Frameworks */,
);
sourceTree = "<group>";
};
B0A6BA8125C26B49007F945E /* Products */ = {
isa = PBXGroup;
children = (
B0A6BA8025C26B49007F945E /* smalltext.app */,
B08BC08625C5143D00C08C81 /* AppKitIntegration.framework */,
);
name = Products;
sourceTree = "<group>";
@@ -115,18 +172,49 @@
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
B08BC08125C5143D00C08C81 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
B08BC08A25C5143D00C08C81 /* AppKitIntegration.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */

/* Begin PBXNativeTarget section */
B08BC08525C5143D00C08C81 /* AppKitIntegration */ = {
isa = PBXNativeTarget;
buildConfigurationList = B08BC08D25C5143D00C08C81 /* Build configuration list for PBXNativeTarget "AppKitIntegration" */;
buildPhases = (
B08BC08125C5143D00C08C81 /* Headers */,
B08BC08225C5143D00C08C81 /* Sources */,
B08BC08325C5143D00C08C81 /* Frameworks */,
B08BC08425C5143D00C08C81 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = AppKitIntegration;
productName = AppKitIntegration;
productReference = B08BC08625C5143D00C08C81 /* AppKitIntegration.framework */;
productType = "com.apple.product-type.framework";
};
B0A6BA7F25C26B49007F945E /* smalltext */ = {
isa = PBXNativeTarget;
buildConfigurationList = B0A6BA9625C26B4B007F945E /* Build configuration list for PBXNativeTarget "smalltext" */;
buildPhases = (
B0A6BA7C25C26B49007F945E /* Sources */,
B0A6BA7D25C26B49007F945E /* Frameworks */,
B0A6BA7E25C26B49007F945E /* Resources */,
B08BC09525C5146700C08C81 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
B08BC09125C5144B00C08C81 /* PBXTargetDependency */,
);
name = smalltext;
productName = smalltext;
@@ -143,6 +231,10 @@
LastSwiftUpdateCheck = 1240;
LastUpgradeCheck = 1240;
TargetAttributes = {
B08BC08525C5143D00C08C81 = {
CreatedOnToolsVersion = 12.4;
LastSwiftMigration = 1240;
};
B0A6BA7F25C26B49007F945E = {
CreatedOnToolsVersion = 12.4;
};
@@ -162,11 +254,19 @@
projectRoot = "";
targets = (
B0A6BA7F25C26B49007F945E /* smalltext */,
B08BC08525C5143D00C08C81 /* AppKitIntegration */,
);
};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
B08BC08425C5143D00C08C81 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
B0A6BA7E25C26B49007F945E /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -180,6 +280,14 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
B08BC08225C5143D00C08C81 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B08BC09925C5148200C08C81 /* AppKitController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
B0A6BA7C25C26B49007F945E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -198,6 +306,15 @@
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
B08BC09125C5144B00C08C81 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
platformFilter = maccatalyst;
target = B08BC08525C5143D00C08C81 /* AppKitIntegration */;
targetProxy = B08BC09025C5144B00C08C81 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
B0A6BA9025C26B4B007F945E /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
@@ -210,6 +327,67 @@
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
B08BC08B25C5143D00C08C81 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 2ZDN69KUUV;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = AppKitIntegration/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.1;
PRODUCT_BUNDLE_IDENTIFIER = com.highcaffeinecontent.AppKitIntegration;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
B08BC08C25C5143D00C08C81 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 2ZDN69KUUV;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = AppKitIntegration/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.1;
PRODUCT_BUNDLE_IDENTIFIER = com.highcaffeinecontent.AppKitIntegration;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
B0A6BA9425C26B4B007F945E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -329,10 +507,12 @@
B0A6BA9725C26B4B007F945E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = smalltext/smalltext.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 2ZDN69KUUV;
INFOPLIST_FILE = smalltext/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
@@ -352,10 +532,12 @@
B0A6BA9825C26B4B007F945E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = smalltext/smalltext.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 2ZDN69KUUV;
INFOPLIST_FILE = smalltext/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
@@ -375,6 +557,15 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
B08BC08D25C5143D00C08C81 /* Build configuration list for PBXNativeTarget "AppKitIntegration" */ = {
isa = XCConfigurationList;
buildConfigurations = (
B08BC08B25C5143D00C08C81 /* Debug */,
B08BC08C25C5143D00C08C81 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
B0A6BA7B25C26B49007F945E /* Build configuration list for PBXProject "smalltext" */ = {
isa = XCConfigurationList;
buildConfigurations = (
@@ -7,40 +7,86 @@
import UIKit

extension NSObject {
@objc public func _marzipan_setupWindow(_ sender:Any) {

}

@objc public func hideWindowForSceneIdentifier(_ sceneIdentifier:String) {

}

@objc public func showWindowForSceneIdentifier(_ sceneIdentifier:String) {

}
}

@main
class STXAppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


#if targetEnvironment(macCatalyst)

static var appKitController:NSObject?

class func loadAppKitIntegrationFramework() {

if let frameworksPath = Bundle.main.privateFrameworksPath {
let bundlePath = "\(frameworksPath)/AppKitIntegration.framework"
do {
try Bundle(path: bundlePath)?.loadAndReturnError()

let bundle = Bundle(path: bundlePath)!
NSLog("[APPKIT BUNDLE] Loaded Successfully")

if let appKitControllerClass = bundle.classNamed("AppKitIntegration.AppKitController") as? NSObject.Type {
appKitController = appKitControllerClass.init()

NotificationCenter.default.addObserver(appKitController, selector: #selector(_marzipan_setupWindow(_:)), name: NSNotification.Name("UISBHSDidCreateWindowForSceneNotification"), object: nil)
}
}
catch {
NSLog("[APPKIT BUNDLE] Error loading: \(error)")
}
}
}
#endif


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
#if targetEnvironment(macCatalyst)
STXAppDelegate.loadAppKitIntegrationFramework()
#endif
return true
}

func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}

func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
}

func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func application(_ app: UIApplication, open inputURL: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
// Ensure the URL is a file URL
guard inputURL.isFileURL else { return false }

// Reveal / import the document at the URL
guard let documentBrowserViewController = window?.rootViewController as? STXDocumentBrowserViewController else { return false }

documentBrowserViewController.revealDocument(at: inputURL, importIfNeeded: true) { (revealedDocumentURL, error) in
if let error = error {
// Handle the error appropriately
@@ -51,9 +97,9 @@ class STXAppDelegate: UIResponder, UIApplicationDelegate {
// Present the Document View Controller for the revealed URL
documentBrowserViewController.presentDocument(at: revealedDocumentURL!)
}

return true
}

}

@@ -80,9 +80,12 @@ class STXDocumentBrowserViewController: UIDocumentBrowserViewController, UIDocum

documentViewController.modalPresentationStyle = .overFullScreen

STXAppDelegate.appKitController?.perform(NSSelectorFromString("showWindowForSceneIdentifier:"), with: self.view.window?.windowScene?.session.persistentIdentifier)

self.present(documentViewController, animated: animated, completion: nil)
} else {
// Make sure to handle the failed import appropriately, e.g., by presenting an error message to the user.
STXAppDelegate.appKitController?.perform(NSSelectorFromString("hideWindowForSceneIdentifier:"), with: self.view.window?.windowScene?.session.persistentIdentifier)

}
})
}
@@ -13,6 +13,8 @@ class STXWindowScene : NSObject, UISceneDelegate, UIWindowSceneDelegate {
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
window = UIWindow(windowScene: scene as! UIWindowScene)

NSLog("id = \(session.persistentIdentifier)")

if let window = window {
let documentBrowserViewController = STXDocumentBrowserViewController()
window.rootViewController = documentBrowserViewController
@@ -73,7 +73,7 @@ class STXDocumentViewController: UIViewController, UIColorPickerViewControllerDe
let padding = UIFloat(8)
let topBarHeight = swatchHeight + padding * 2

let safeRect = CGRect(x: view.safeAreaInsets.left, y: view.safeAreaInsets.top, width: view.bounds.width-view.safeAreaInsets.left-view.safeAreaInsets.right, height: view.bounds.height-view.safeAreaInsets.top-view.safeAreaInsets.bottom)
let safeRect = view.bounds.inset(by: view.safeAreaInsets)
let divisor = safeRect.divided(atDistance: topBarHeight, from: .minYEdge)


@@ -34,7 +34,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSRequiresIPhoneOS</key>