diff --git a/TouchBar Simulator.xcodeproj/project.pbxproj b/TouchBar Simulator.xcodeproj/project.pbxproj new file mode 100644 index 0000000..067557d --- /dev/null +++ b/TouchBar Simulator.xcodeproj/project.pbxproj @@ -0,0 +1,530 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 0906CDDB24E89EE6006B05A4 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0906CDDA24E89EE6006B05A4 /* AppDelegate.m */; }; + 0906CDDD24E89EE9006B05A4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0906CDDC24E89EE9006B05A4 /* Assets.xcassets */; }; + 0906CDE024E89EE9006B05A4 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0906CDDE24E89EE9006B05A4 /* MainMenu.xib */; }; + 0906CDE324E89EE9006B05A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 0906CDE224E89EE9006B05A4 /* main.m */; }; + 0906CDED24E89F1B006B05A4 /* ViewBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0906CDEC24E89F1B006B05A4 /* ViewBridge.framework */; }; + 0906CDFB24E89F3B006B05A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 0906CDFA24E89F3B006B05A4 /* main.m */; }; + 0906CDFF24E89F3B006B05A4 /* TouchBarSimulatorService.xpc in Embed XPC Services */ = {isa = PBXBuildFile; fileRef = 0906CDF424E89F3B006B05A4 /* TouchBarSimulatorService.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 0906CE0424E89F41006B05A4 /* ViewBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0906CDEC24E89F1B006B05A4 /* ViewBridge.framework */; }; + 0906CE0E24E8AD24006B05A4 /* TouchBarSimulatorService.m in Sources */ = {isa = PBXBuildFile; fileRef = 0906CE0C24E8AD24006B05A4 /* TouchBarSimulatorService.m */; }; + 0906CE0F24E8AD24006B05A4 /* TouchBarSimulatorService.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0906CE0D24E8AD24006B05A4 /* TouchBarSimulatorService.xib */; }; + 0906CE1124E8AE41006B05A4 /* DFRFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0906CE1024E8AE41006B05A4 /* DFRFoundation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 0906CDFD24E89F3B006B05A4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0906CDCE24E89EE6006B05A4 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 0906CDF324E89F3B006B05A4; + remoteInfo = TouchBarSimulatorService; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 0906CE0324E89F3B006B05A4 /* Embed XPC Services */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(CONTENTS_FOLDER_PATH)/XPCServices"; + dstSubfolderSpec = 16; + files = ( + 0906CDFF24E89F3B006B05A4 /* TouchBarSimulatorService.xpc in Embed XPC Services */, + ); + name = "Embed XPC Services"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 0906CDD624E89EE6006B05A4 /* TouchBar Simulator.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "TouchBar Simulator.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 0906CDD924E89EE6006B05A4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 0906CDDA24E89EE6006B05A4 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 0906CDDC24E89EE9006B05A4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 0906CDDF24E89EE9006B05A4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 0906CDE124E89EE9006B05A4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 0906CDE224E89EE9006B05A4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 0906CDE424E89EE9006B05A4 /* TouchBar_Simulator.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = TouchBar_Simulator.entitlements; sourceTree = ""; }; + 0906CDEA24E89F03006B05A4 /* NSRemoteView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSRemoteView.h; sourceTree = ""; }; + 0906CDEC24E89F1B006B05A4 /* ViewBridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ViewBridge.framework; path = ../../../../System/Library/PrivateFrameworks/ViewBridge.framework; sourceTree = ""; }; + 0906CDF424E89F3B006B05A4 /* TouchBarSimulatorService.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = TouchBarSimulatorService.xpc; sourceTree = BUILT_PRODUCTS_DIR; }; + 0906CDF624E89F3B006B05A4 /* DFRFoundation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DFRFoundation.h; sourceTree = ""; }; + 0906CDFA24E89F3B006B05A4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 0906CDFC24E89F3B006B05A4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 0906CE0824E8A505006B05A4 /* NSRemoteViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSRemoteViewController.h; sourceTree = ""; }; + 0906CE0924E8A5CC006B05A4 /* NSServiceViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSServiceViewController.h; sourceTree = ""; }; + 0906CE0A24E8A641006B05A4 /* ViewBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewBridge.h; sourceTree = ""; }; + 0906CE0B24E8AD24006B05A4 /* TouchBarSimulatorService.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TouchBarSimulatorService.h; sourceTree = ""; }; + 0906CE0C24E8AD24006B05A4 /* TouchBarSimulatorService.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TouchBarSimulatorService.m; sourceTree = ""; }; + 0906CE0D24E8AD24006B05A4 /* TouchBarSimulatorService.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TouchBarSimulatorService.xib; sourceTree = ""; }; + 0906CE1024E8AE41006B05A4 /* DFRFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DFRFoundation.framework; path = ../../../../System/Library/PrivateFrameworks/DFRFoundation.framework; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 0906CDD324E89EE6006B05A4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 0906CDED24E89F1B006B05A4 /* ViewBridge.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 0906CDF124E89F3B006B05A4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 0906CE1124E8AE41006B05A4 /* DFRFoundation.framework in Frameworks */, + 0906CE0424E89F41006B05A4 /* ViewBridge.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0906CDCD24E89EE6006B05A4 = { + isa = PBXGroup; + children = ( + 0906CE0724E8A1BA006B05A4 /* ViewBridge */, + 0906CDD824E89EE6006B05A4 /* TouchBar Simulator */, + 0906CDF524E89F3B006B05A4 /* TouchBarSimulatorService */, + 0906CDD724E89EE6006B05A4 /* Products */, + 0906CDEB24E89F1B006B05A4 /* Frameworks */, + ); + sourceTree = ""; + }; + 0906CDD724E89EE6006B05A4 /* Products */ = { + isa = PBXGroup; + children = ( + 0906CDD624E89EE6006B05A4 /* TouchBar Simulator.app */, + 0906CDF424E89F3B006B05A4 /* TouchBarSimulatorService.xpc */, + ); + name = Products; + sourceTree = ""; + }; + 0906CDD824E89EE6006B05A4 /* TouchBar Simulator */ = { + isa = PBXGroup; + children = ( + 0906CDD924E89EE6006B05A4 /* AppDelegate.h */, + 0906CDDA24E89EE6006B05A4 /* AppDelegate.m */, + 0906CDDC24E89EE9006B05A4 /* Assets.xcassets */, + 0906CDDE24E89EE9006B05A4 /* MainMenu.xib */, + 0906CDE124E89EE9006B05A4 /* Info.plist */, + 0906CDE224E89EE9006B05A4 /* main.m */, + 0906CDE424E89EE9006B05A4 /* TouchBar_Simulator.entitlements */, + ); + path = "TouchBar Simulator"; + sourceTree = ""; + }; + 0906CDEB24E89F1B006B05A4 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 0906CE1024E8AE41006B05A4 /* DFRFoundation.framework */, + 0906CDEC24E89F1B006B05A4 /* ViewBridge.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 0906CDF524E89F3B006B05A4 /* TouchBarSimulatorService */ = { + isa = PBXGroup; + children = ( + 0906CDF624E89F3B006B05A4 /* DFRFoundation.h */, + 0906CE0D24E8AD24006B05A4 /* TouchBarSimulatorService.xib */, + 0906CE0B24E8AD24006B05A4 /* TouchBarSimulatorService.h */, + 0906CE0C24E8AD24006B05A4 /* TouchBarSimulatorService.m */, + 0906CDFA24E89F3B006B05A4 /* main.m */, + 0906CDFC24E89F3B006B05A4 /* Info.plist */, + ); + path = TouchBarSimulatorService; + sourceTree = ""; + }; + 0906CE0724E8A1BA006B05A4 /* ViewBridge */ = { + isa = PBXGroup; + children = ( + 0906CDEA24E89F03006B05A4 /* NSRemoteView.h */, + 0906CE0824E8A505006B05A4 /* NSRemoteViewController.h */, + 0906CE0924E8A5CC006B05A4 /* NSServiceViewController.h */, + 0906CE0A24E8A641006B05A4 /* ViewBridge.h */, + ); + path = ViewBridge; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 0906CDD524E89EE6006B05A4 /* TouchBar Simulator */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0906CDE724E89EE9006B05A4 /* Build configuration list for PBXNativeTarget "TouchBar Simulator" */; + buildPhases = ( + 0906CDD224E89EE6006B05A4 /* Sources */, + 0906CDD324E89EE6006B05A4 /* Frameworks */, + 0906CDD424E89EE6006B05A4 /* Resources */, + 0906CE0324E89F3B006B05A4 /* Embed XPC Services */, + ); + buildRules = ( + ); + dependencies = ( + 0906CDFE24E89F3B006B05A4 /* PBXTargetDependency */, + ); + name = "TouchBar Simulator"; + productName = "TouchBar Simulator"; + productReference = 0906CDD624E89EE6006B05A4 /* TouchBar Simulator.app */; + productType = "com.apple.product-type.application"; + }; + 0906CDF324E89F3B006B05A4 /* TouchBarSimulatorService */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0906CE0024E89F3B006B05A4 /* Build configuration list for PBXNativeTarget "TouchBarSimulatorService" */; + buildPhases = ( + 0906CDF024E89F3B006B05A4 /* Sources */, + 0906CDF124E89F3B006B05A4 /* Frameworks */, + 0906CDF224E89F3B006B05A4 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TouchBarSimulatorService; + productName = TouchBarSimulatorService; + productReference = 0906CDF424E89F3B006B05A4 /* TouchBarSimulatorService.xpc */; + productType = "com.apple.product-type.xpc-service"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 0906CDCE24E89EE6006B05A4 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1200; + TargetAttributes = { + 0906CDD524E89EE6006B05A4 = { + CreatedOnToolsVersion = 12.0; + }; + 0906CDF324E89F3B006B05A4 = { + CreatedOnToolsVersion = 12.0; + }; + }; + }; + buildConfigurationList = 0906CDD124E89EE6006B05A4 /* Build configuration list for PBXProject "TouchBar Simulator" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 0906CDCD24E89EE6006B05A4; + productRefGroup = 0906CDD724E89EE6006B05A4 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 0906CDD524E89EE6006B05A4 /* TouchBar Simulator */, + 0906CDF324E89F3B006B05A4 /* TouchBarSimulatorService */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 0906CDD424E89EE6006B05A4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0906CDDD24E89EE9006B05A4 /* Assets.xcassets in Resources */, + 0906CDE024E89EE9006B05A4 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 0906CDF224E89F3B006B05A4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0906CE0F24E8AD24006B05A4 /* TouchBarSimulatorService.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 0906CDD224E89EE6006B05A4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0906CDE324E89EE9006B05A4 /* main.m in Sources */, + 0906CDDB24E89EE6006B05A4 /* AppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 0906CDF024E89F3B006B05A4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0906CE0E24E8AD24006B05A4 /* TouchBarSimulatorService.m in Sources */, + 0906CDFB24E89F3B006B05A4 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 0906CDFE24E89F3B006B05A4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 0906CDF324E89F3B006B05A4 /* TouchBarSimulatorService */; + targetProxy = 0906CDFD24E89F3B006B05A4 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 0906CDDE24E89EE9006B05A4 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 0906CDDF24E89EE9006B05A4 /* Base */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 0906CDE524E89EE9006B05A4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = 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_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = 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_OBJC_ROOT_CLASS = YES_ERROR; + 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_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 0906CDE624E89EE9006B05A4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = 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_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = 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_OBJC_ROOT_CLASS = YES_ERROR; + 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_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = macosx; + }; + name = Release; + }; + 0906CDE824E89EE9006B05A4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = "TouchBar Simulator/TouchBar_Simulator.entitlements"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = G9T88PYL48; + ENABLE_HARDENED_RUNTIME = YES; + HEADER_SEARCH_PATHS = "$(PROJECT_DIR)"; + INFOPLIST_FILE = "TouchBar Simulator/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.15; + PRODUCT_BUNDLE_IDENTIFIER = "com.github.jslegendre.TouchBar-Simulator"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SYSTEM_FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks", + ); + }; + name = Debug; + }; + 0906CDE924E89EE9006B05A4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = "TouchBar Simulator/TouchBar_Simulator.entitlements"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = G9T88PYL48; + ENABLE_HARDENED_RUNTIME = YES; + HEADER_SEARCH_PATHS = "$(PROJECT_DIR)"; + INFOPLIST_FILE = "TouchBar Simulator/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.15; + PRODUCT_BUNDLE_IDENTIFIER = "com.github.jslegendre.TouchBar-Simulator"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SYSTEM_FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks", + ); + }; + name = Release; + }; + 0906CE0124E89F3B006B05A4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = G9T88PYL48; + ENABLE_HARDENED_RUNTIME = YES; + HEADER_SEARCH_PATHS = "$(PROJECT_DIR)"; + INFOPLIST_FILE = TouchBarSimulatorService/Info.plist; + MACOSX_DEPLOYMENT_TARGET = 10.15; + PRODUCT_BUNDLE_IDENTIFIER = com.github.jslegendre.TouchBarSimulatorService; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SYSTEM_FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks", + ); + }; + name = Debug; + }; + 0906CE0224E89F3B006B05A4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = G9T88PYL48; + ENABLE_HARDENED_RUNTIME = YES; + HEADER_SEARCH_PATHS = "$(PROJECT_DIR)"; + INFOPLIST_FILE = TouchBarSimulatorService/Info.plist; + MACOSX_DEPLOYMENT_TARGET = 10.15; + PRODUCT_BUNDLE_IDENTIFIER = com.github.jslegendre.TouchBarSimulatorService; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SYSTEM_FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks", + ); + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 0906CDD124E89EE6006B05A4 /* Build configuration list for PBXProject "TouchBar Simulator" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0906CDE524E89EE9006B05A4 /* Debug */, + 0906CDE624E89EE9006B05A4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 0906CDE724E89EE9006B05A4 /* Build configuration list for PBXNativeTarget "TouchBar Simulator" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0906CDE824E89EE9006B05A4 /* Debug */, + 0906CDE924E89EE9006B05A4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 0906CE0024E89F3B006B05A4 /* Build configuration list for PBXNativeTarget "TouchBarSimulatorService" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0906CE0124E89F3B006B05A4 /* Debug */, + 0906CE0224E89F3B006B05A4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 0906CDCE24E89EE6006B05A4 /* Project object */; +} diff --git a/TouchBar Simulator.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/TouchBar Simulator.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/TouchBar Simulator.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/TouchBar Simulator.xcodeproj/project.xcworkspace/xcuserdata/j.xcuserdatad/UserInterfaceState.xcuserstate b/TouchBar Simulator.xcodeproj/project.xcworkspace/xcuserdata/j.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..f229678 Binary files /dev/null and b/TouchBar Simulator.xcodeproj/project.xcworkspace/xcuserdata/j.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/TouchBar Simulator.xcodeproj/xcshareddata/xcschemes/TouchBar Simulator.xcscheme b/TouchBar Simulator.xcodeproj/xcshareddata/xcschemes/TouchBar Simulator.xcscheme new file mode 100644 index 0000000..14c7e3a --- /dev/null +++ b/TouchBar Simulator.xcodeproj/xcshareddata/xcschemes/TouchBar Simulator.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TouchBar Simulator.xcodeproj/xcuserdata/j.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/TouchBar Simulator.xcodeproj/xcuserdata/j.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..7611e98 --- /dev/null +++ b/TouchBar Simulator.xcodeproj/xcuserdata/j.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/TouchBar Simulator.xcodeproj/xcuserdata/j.xcuserdatad/xcschemes/xcschememanagement.plist b/TouchBar Simulator.xcodeproj/xcuserdata/j.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..334db3b --- /dev/null +++ b/TouchBar Simulator.xcodeproj/xcuserdata/j.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + TouchBar Simulator.xcscheme_^#shared#^_ + + orderHint + 0 + + TouchBarSimulatorService.xcscheme_^#shared#^_ + + orderHint + 1 + + + SuppressBuildableAutocreation + + 0906CDD524E89EE6006B05A4 + + primary + + + + + diff --git a/TouchBar Simulator/AppDelegate.h b/TouchBar Simulator/AppDelegate.h new file mode 100644 index 0000000..c0a161d --- /dev/null +++ b/TouchBar Simulator/AppDelegate.h @@ -0,0 +1,14 @@ +// +// AppDelegate.h +// TouchBar Simulator +// +// Created by Jeremy on 8/15/20. +// + +#import + +@interface AppDelegate : NSObject + + +@end + diff --git a/TouchBar Simulator/AppDelegate.m b/TouchBar Simulator/AppDelegate.m new file mode 100644 index 0000000..e995413 --- /dev/null +++ b/TouchBar Simulator/AppDelegate.m @@ -0,0 +1,47 @@ +// +// AppDelegate.m +// TouchBar Simulator +// +// Created by Jeremy on 8/15/20. +// + +#import + +#import "AppDelegate.h" + +@interface NSWindow (Private) +- (void )_setPreventsActivation:(bool)preventsActivation; +@end + +@interface AppDelegate () + +@property (strong) IBOutlet NSPanel *window; +@end + +@implementation AppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + self.window.worksWhenModal = YES; + [self.window _setPreventsActivation:YES]; + self.window.styleMask |= NSWindowStyleMaskUtilityWindow; + self.window.movableByWindowBackground = NO; + self.window.contentView.wantsLayer = YES; + self.window.contentView.layer.backgroundColor = NSColor.blackColor.CGColor; + self.window.collectionBehavior |= NSWindowCollectionBehaviorCanJoinAllSpaces; + + [NSRemoteViewController requestViewController:@"TouchBarSimulatorService" fromServiceWithBundleIdentifier:@"com.github.jslegendre.TouchBarSimulatorService" connectionHandler:^(NSRemoteViewController* remoteViewController){ + self.window.contentViewController = remoteViewController; + }]; +} + + +- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender { + return YES; +} + +- (void)applicationWillTerminate:(NSNotification *)aNotification { + [(NSRemoteViewController *)self.window.contentViewController disconnect]; +} + + +@end diff --git a/TouchBar Simulator/Assets.xcassets/AccentColor.colorset/Contents.json b/TouchBar Simulator/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/TouchBar Simulator/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/TouchBar Simulator/Assets.xcassets/AppIcon.appiconset/Contents.json b/TouchBar Simulator/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..3f00db4 --- /dev/null +++ b/TouchBar Simulator/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/TouchBar Simulator/Assets.xcassets/Contents.json b/TouchBar Simulator/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/TouchBar Simulator/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/TouchBar Simulator/Base.lproj/MainMenu.xib b/TouchBar Simulator/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..fe7cad4 --- /dev/null +++ b/TouchBar Simulator/Base.lproj/MainMenu.xib @@ -0,0 +1,695 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TouchBar Simulator/Info.plist b/TouchBar Simulator/Info.plist new file mode 100644 index 0000000..2c5c41c --- /dev/null +++ b/TouchBar Simulator/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + LSUIElement + + + diff --git a/TouchBar Simulator/TouchBar_Simulator.entitlements b/TouchBar Simulator/TouchBar_Simulator.entitlements new file mode 100644 index 0000000..f2ef3ae --- /dev/null +++ b/TouchBar Simulator/TouchBar_Simulator.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/TouchBar Simulator/main.m b/TouchBar Simulator/main.m new file mode 100644 index 0000000..f840baf --- /dev/null +++ b/TouchBar Simulator/main.m @@ -0,0 +1,15 @@ +// +// main.m +// TouchBar Simulator +// +// Created by Jeremy on 8/15/20. +// + +#import + +int main(int argc, const char * argv[]) { + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + } + return NSApplicationMain(argc, argv); +} diff --git a/TouchBarSimulatorService/DFRFoundation.h b/TouchBarSimulatorService/DFRFoundation.h new file mode 100644 index 0000000..97c7dc2 --- /dev/null +++ b/TouchBarSimulatorService/DFRFoundation.h @@ -0,0 +1,38 @@ +// +// TouchBarSimulatorServiceProtocol.h +// TouchBarSimulatorService +// +// Created by Jeremy on 8/15/20. +// + +/* From DFRFoundation.framework */ +@class DFRTouchBarSimulator, DFRTouchBar; + +typedef enum { + DFRTouchBarFirstGeneration = 2, + DFRTouchBarSecondGeneration = 3, +} DFRTouchBarStyle; + +/*! + @function DFRTouchBarSimulatorCreate + @abstract C-style initializer for DFRTouchBarSimulator + @param generation First generation (2) uses legacy API, secon generation uses newer API as shown in this project + @param properties This is always NULL so I'm really not sure what options exist. + @param sameAsGeneration Not sure why this is needed but if it holds a different value than generation, it won't work. + */ +DFRTouchBarSimulator* DFRTouchBarSimulatorCreate(DFRTouchBarStyle generation, id properties, DFRTouchBarStyle sameAsGeneration); + +DFRTouchBar* DFRTouchBarSimulatorGetTouchBar(DFRTouchBarSimulator*); + +BOOL DFRTouchBarSimulatorPostEventWithMouseActivity(DFRTouchBarSimulator*, NSEventType type, NSPoint p); + +CGDisplayStreamRef DFRTouchBarCreateDisplayStream(DFRTouchBar *touchBar, int displayID, dispatch_queue_t queue, CGDisplayStreamFrameAvailableHandler handler); + +void DFRTouchBarSimulatorInvalidate(DFRTouchBarSimulator*); + + +/* Legacy +void DFRSetStatus(int status); +BOOL DFRFoundationPostEventWithMouseActivity(NSEventType type, NSPoint p); +void DFRSetStatus(int status); CGDisplayStreamRef SLSDFRDisplayStreamCreate(int displayID, dispatch_queue_t queue, CGDisplayStreamFrameAvailableHandler handler); +*/ diff --git a/TouchBarSimulatorService/Info.plist b/TouchBarSimulatorService/Info.plist new file mode 100644 index 0000000..21ffd36 --- /dev/null +++ b/TouchBarSimulatorService/Info.plist @@ -0,0 +1,35 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + TouchBarSimulatorService + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + NSPrincipalClass + NSViewServiceApplication + XPCService + + ServiceType + Application + JoinExistingSession + + RunLoopType + _NSApplicationMain + + + diff --git a/TouchBarSimulatorService/TouchBarSimulatorService.h b/TouchBarSimulatorService/TouchBarSimulatorService.h new file mode 100644 index 0000000..ce6ccf3 --- /dev/null +++ b/TouchBarSimulatorService/TouchBarSimulatorService.h @@ -0,0 +1,20 @@ +// +// TouchBarSimulatorService.h +// TouchBarSimulatorService +// +// Created by Jeremy on 8/15/20. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TouchBarSimulatorServiceView : NSView +@end + +@interface TouchBarSimulatorService : NSServiceViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/TouchBarSimulatorService/TouchBarSimulatorService.m b/TouchBarSimulatorService/TouchBarSimulatorService.m new file mode 100644 index 0000000..40a7155 --- /dev/null +++ b/TouchBarSimulatorService/TouchBarSimulatorService.m @@ -0,0 +1,109 @@ +// +// TouchBarSimulatorService.m +// TouchBarSimulatorService +// +// Created by Jeremy on 8/15/20. +// + +#import +#import "TouchBarSimulatorService.h" +#import "DFRFoundation.h" +@import QuartzCore; + + +@interface TouchBarSimulatorStreamView : NSView +@property DFRTouchBarSimulator *simulator; +@end + +@implementation TouchBarSimulatorStreamView + +- (void)mouseEvent:(NSEvent *)event { + NSPoint location = [self convertPoint:event.locationInWindow fromView:nil]; + DFRTouchBarSimulatorPostEventWithMouseActivity(self.simulator, event.type, location); +} + +- (void)mouseDown:(NSEvent *)event { + [self mouseEvent:event]; +} + +- (void)mouseUp:(NSEvent *)event { + [self mouseEvent:event]; +} + +- (void)mouseDragged:(NSEvent *)event { + [self mouseEvent:event]; +} + +- (void)mouseEntered:(NSEvent *)event { + [self mouseEvent:event]; +} + +- (void)mouseMoved:(NSEvent *)event { + [self mouseEvent:event]; +} + +//- (void)awakeFromNib { +// self.layer.backgroundColor = NSColor.blackColor.CGColor; +// self.wantsLayer = YES; +//} + +- (instancetype)initWithFrame:(NSRect)frameRect { + self = [super initWithFrame:frameRect]; + self.layer.backgroundColor = NSColor.blackColor.CGColor; + self.wantsLayer = YES; + return self; +} + +@end + +@interface TouchBarSimulatorServiceView () +@end + +@implementation TouchBarSimulatorServiceView + +- (void)awakeFromNib { + [self.window setColorSpace:[NSColorSpace displayP3ColorSpace]]; + self.wantsLayer = YES; + self.layer.backgroundColor = NSColor.blackColor.CGColor; +} + +@end + +@interface TouchBarSimulatorService () +@property CGDisplayStreamRef touchBarStream; +@property DFRTouchBarSimulator *simulator; +@end + +@implementation TouchBarSimulatorService + +- (void)viewDidLoad { + [super viewDidLoad]; + + TouchBarSimulatorStreamView *streamView = [[TouchBarSimulatorStreamView alloc] initWithFrame:NSMakeRect(5, 5, 1004, 30)]; + [self.view addSubview:streamView]; + + self.simulator = DFRTouchBarSimulatorCreate(3, 0, 3); + DFRTouchBar *touchBar = DFRTouchBarSimulatorGetTouchBar(self.simulator); + + self.touchBarStream = DFRTouchBarCreateDisplayStream(touchBar, 0, dispatch_get_main_queue(), ^(CGDisplayStreamFrameStatus status, uint64_t displayTime, IOSurfaceRef _Nullable frameSurface, CGDisplayStreamUpdateRef _Nullable updateRef) { + [CATransaction begin]; + [CATransaction setDisableActions:YES]; + [streamView.layer setContents:(__bridge id _Nullable)(frameSurface)]; + [CATransaction commit]; + }); + + if (self.touchBarStream) { + CGDisplayStreamStart(self.touchBarStream); + } + + [streamView setSimulator:self.simulator]; +} + +- (void)viewWillDisappear { + if (self.touchBarStream) { + DFRTouchBarSimulatorInvalidate(self.simulator); + CGDisplayStreamStop(self.touchBarStream); + CFRelease(self.touchBarStream); + } +} +@end diff --git a/TouchBarSimulatorService/TouchBarSimulatorService.xib b/TouchBarSimulatorService/TouchBarSimulatorService.xib new file mode 100644 index 0000000..93b25ee --- /dev/null +++ b/TouchBarSimulatorService/TouchBarSimulatorService.xib @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/TouchBarSimulatorService/main.m b/TouchBarSimulatorService/main.m new file mode 100644 index 0000000..87a54c5 --- /dev/null +++ b/TouchBarSimulatorService/main.m @@ -0,0 +1,50 @@ +// +// main.m +// TouchBarSimulatorService +// +// Created by Jeremy on 8/15/20. +// + +#import +#import +#import "TouchBarSimulatorService.h" + +//@interface ServiceDelegate : NSObject +//@end +// +//@implementation ServiceDelegate +// +//- (BOOL)listener:(NSXPCListener *)listener shouldAcceptNewConnection:(NSXPCConnection *)newConnection { +// // This method is where the NSXPCListener configures, accepts, and resumes a new incoming NSXPCConnection. +// +// // Configure the connection. +// // First, set the interface that the exported object implements. +// newConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(TouchBarSimulatorServiceProtocol)]; +// +// // Next, set the object that the connection exports. All messages sent on the connection to this service will be sent to the exported object to handle. The connection retains the exported object. +// TouchBarSimulatorService *exportedObject = [TouchBarSimulatorService new]; +// newConnection.exportedObject = exportedObject; +// +// // Resuming the connection allows the system to deliver more incoming messages. +// [newConnection resume]; +// +// // Returning YES from this method tells the system that you have accepted this connection. If you want to reject the connection for some reason, call -invalidate on the connection and return NO. +// return YES; +//} +// +//@end + +int main(int argc, const char *argv[]) +{ +// // Create the delegate for the service. +// ServiceDelegate *delegate = [ServiceDelegate new]; +// +// // Set up the one NSXPCListener for this service. It will handle all incoming connections. +// NSXPCListener *listener = [NSXPCListener serviceListener]; +// listener.delegate = delegate; +// +// // Resuming the serviceListener starts this service. This method does not return. +// [listener resume]; + NSViewServiceApplicationMain(); + return 0; +} diff --git a/ViewBridge/NSRemoteView.h b/ViewBridge/NSRemoteView.h new file mode 100644 index 0000000..480e122 --- /dev/null +++ b/ViewBridge/NSRemoteView.h @@ -0,0 +1,15 @@ +// +// NSRemoteView.h +// TouchBar-Simulator +// +// Created by Jeremy on 8/15/20. +// + +@interface NSRemoteView : NSView +@property(nonatomic, copy) NSString *serviceSubclassName; +@property(nonatomic, copy) NSString *serviceName; +- (BOOL)advanceToRunPhaseIfNeeded:(void (^)(NSError*))arg1; +- (void)setSynchronizesImplicitAnimations:(BOOL)arg1; +- (void)setShouldMaskToBounds:(BOOL)arg1; + +@end diff --git a/ViewBridge/NSRemoteViewController.h b/ViewBridge/NSRemoteViewController.h new file mode 100644 index 0000000..46ca045 --- /dev/null +++ b/ViewBridge/NSRemoteViewController.h @@ -0,0 +1,32 @@ +// +// NSRemoteViewService.h +// TouchBar Simulator +// +// Created by Jeremy on 8/15/20. +// + +@class NSRemoteViewController; +typedef void (^NSRemoteViewControllerConnectionHandler)(NSRemoteViewController *); + +@interface NSRemoteViewController : NSViewController + ++ (void)requestViewController:(NSString *)className +fromServiceWithBundleIdentifier:(NSString *)bundleIdentifier + connectionHandler:(NSRemoteViewControllerConnectionHandler)connectionHandler; + +@property (readonly) NSString *serviceViewControllerClassName; +@property (readonly) NSString *serviceBundleIdentifier; +@property (readonly) NSString *remoteViewIdentifier; + +- (void)disconnect; + +- (id)exportedObject; +- (NSXPCInterface *)exportedInterface; +- (NSXPCInterface *)serviceViewControllerInterface; +- (id)serviceViewControllerProxyWithErrorHandler:(void (^)(NSError *error))errorHandler; +- (id)serviceViewControllerProxy; + +- (void)setServiceViewControllerClassName:(NSString *)className; +- (void)setServiceBundleIdentifier:(NSString *)bundleIdentifier; +- (void)setServiceListenerEndpoint:(NSXPCListenerEndpoint *)listenerEndpoint; +@end diff --git a/ViewBridge/NSServiceViewController.h b/ViewBridge/NSServiceViewController.h new file mode 100644 index 0000000..cf6dfd7 --- /dev/null +++ b/ViewBridge/NSServiceViewController.h @@ -0,0 +1,83 @@ +// +// NSServiceViewController.h +// TouchBar Simulator +// +// Created by Jeremy on 8/15/20. +// + +#import + +@interface NSServiceViewController : NSViewController + ++ (id)serviceBundle; ++ (void)deferBlockOntoMainThread:(id)arg1; ++ (void)withHostProcessIdentifier:(int)arg1 invoke:(id)arg2; ++ (id)serviceViewControllerForWindow:(NSWindow *)window; ++ (id)listenerEndpoint; ++ (BOOL)setAccessibilityParent:(long long)arg1 forWindow:(id)arg2; ++ (BOOL)currentAppIsViewService; ++ (id)hostAppDescription:(int)arg1; ++ (unsigned int)_windowForContextID:(unsigned int)arg1 fromViewService:(int)arg2 error:(id *)arg3; ++ (unsigned int)declinedEventMask; + +@property (readonly) NSInteger hostSDKVersion; +@property (readonly) NSWindow *serviceWindow; +@property (readonly) NSInteger callsToSetViewCount; +@property (readonly) BOOL mostRecentCallToSetViewWasNonNil; +@property (readonly) BOOL valid; +@property (readonly) CGSize sizeHint; +@property (readonly) NSString *remoteViewIdentifier; +@property (readonly) BOOL adjustLayoutInProgress; +@property (readonly) CGSize remoteViewSize; +@property (readonly) BOOL makesExplicitResizeRequests; +@property (readonly) BOOL allowsImplicitResizeRequests; +@property (readonly) BOOL allowsWindowFrameOriginChanges; + +- (instancetype)initWithWindow:(id)arg1; + +- (id)remoteViewControllerProxyWithErrorHandler:(id)arg1; +- (id)remoteViewControllerProxy; +- (id)exportedObject; +- (NSXPCInterface *)exportedInterface; +- (id)remoteViewControllerInterface; + +- (NSUInteger)awakeFromRemoteView; +- (void)advanceToRunPhase; +- (void)retreatToConfigPhase; + +- (BOOL)invalid; +- (void)invalidate; + +- (void)_windowFrameWillChange; +- (void)_windowFrameDidChange; +- (void)_didDisassociateFromHostWindow; +- (void)_didAssociateWithHostWindow; +- (BOOL)_shouldNormalizeAppearance; +- (CGRect)_serviceWindowFrameForRemoteViewFrame:(CGRect)arg1; +- (void)_setHostSDKVersion:(NSInteger)arg1; +- (void)_endPrivateEventLoop; +- (void)hostWindowReceivedEventType:(NSUInteger)arg1; +- (void)setAccessoryViewSize:(CGSize)arg1; +- (void)forgetAccessoryView; +- (void)_invalidateRendezvousWindowControllers; +- (void)childWindowDidInvalidate:(id)arg1 dueToError:(id)arg2; +- (void)_retainMarshal; +- (BOOL)isLayerCentric; +- (void)whileMouseIsDisassociatedFromMouseCursorPosition:(id)arg1; +- (void)associateMouseAndMouseCursorPosition:(BOOL)arg1 completion:(id)arg2; +- (id)requestResize:(CGSize)arg1 animation:(id)arg2 completion:(id)arg3; +- (id)_requestResize:(CGSize)arg1 hostShouldAnimate:(BOOL)arg2 animation:(id)arg3 completion:(id)arg4; +- (BOOL)remoteViewSizeChanged:(CGSize)arg1 transaction:(id)arg2; +- (BOOL)remoteViewSizeChanged:(CGSize)arg1 transactions:(id)arg2; +- (void)adjustLayout:(id)arg1 animation:(id)arg2 completion:(id)arg3; +- (void)_animateLayout:(id)arg1 forWindow:(id)arg2 withNewFittingSize:(CGSize)arg3 completion:(id)arg4; +- (void)defaultResizeBehavior; +- (BOOL)_explicitSizeRequestInhibitsImplicitSizeRequests; +- (NSUInteger)filterStyleMask:(NSUInteger)arg1; +- (NSUInteger)acceptableStyleMask; +- (id)leastRecentError; +- (void)errorOccurred:(id)arg1; +- (void)deferBlockOntoMainThread:(id)arg1; +- (void)withHostContextInvoke:(id)arg1; +- (unsigned int)declinedEventMask; +@end diff --git a/ViewBridge/ViewBridge.h b/ViewBridge/ViewBridge.h new file mode 100644 index 0000000..6c4e8dc --- /dev/null +++ b/ViewBridge/ViewBridge.h @@ -0,0 +1,12 @@ +// +// ViewBridge.h +// TouchBar Simulator +// +// Created by Jeremy on 8/15/20. +// + +#import "NSServiceViewController.h" +#import "NSRemoteViewController.h" +#import "NSRemoteView.h" + +extern int NSViewServiceApplicationMain(void);