-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
87 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// OpenSwiftUIGlue.swift | ||
// OpenSwiftUI | ||
// | ||
// Audited for iOS 18.0 | ||
// Status: Empty | ||
|
||
@_spi(ForOpenSwiftUIOnly) | ||
import OpenSwiftUICore | ||
|
||
@_cdecl("OpenSwiftUIGlueClass") | ||
func OpenSwiftUIGlueClass() -> CoreGlue.Type { | ||
OpenSwiftUIGlue.self | ||
} | ||
|
||
final class OpenSwiftUIGlue: CoreGlue { | ||
override func makeDefaultLayoutComputer() -> MakeDefaultLayoutComputerResult { | ||
MakeDefaultLayoutComputerResult(value: ViewGraph.current.$defaultLayoutComputer) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// CoreGlue.h | ||
// OpenSwiftUI_SPI | ||
// | ||
// Audited for iOS 15.5 | ||
// Status: Complete | ||
|
||
#ifndef CoreGlue_h | ||
#define CoreGlue_h | ||
|
||
#include "OpenSwiftUIBase.h" | ||
|
||
id _initializeCoreGlue(); | ||
|
||
#endif /* CoreGlue_h */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// CoreGlue.m | ||
// OpenSwiftUI_SPI | ||
// | ||
// Audited for iOS 18.0 | ||
// Status: Complete | ||
|
||
#include "CoreGlue.h" | ||
#include <dlfcn.h> | ||
|
||
void abort_report_np(const char*, ...); | ||
|
||
void* OpenSwiftUILibrary(); | ||
void * getSwiftUIGlueClassSymbolLoc(); | ||
|
||
id _initializeCoreGlue() { | ||
void *location = getSwiftUIGlueClassSymbolLoc(); | ||
Class (*classFunc)(void) = (Class (*)(void))location; | ||
Class glueClass = classFunc(); | ||
return [[glueClass alloc] init]; | ||
} | ||
|
||
void* OpenSwiftUILibrary() { | ||
// Since we are staticlly linking OpenSwiftUI and OpenSwiftUICore into the final binary, | ||
// we can just use dlopen(NULL, RTLD_LAZY) to get the current macho binary handle | ||
return dlopen(NULL, RTLD_LAZY); | ||
} | ||
|
||
void *getSwiftUIGlueClassSymbolLoc() { | ||
static void *ptr; | ||
if (ptr == NULL) { | ||
@try { | ||
ptr = dlsym(OpenSwiftUILibrary(), "OpenSwiftUIGlueClass"); | ||
} @finally { | ||
} | ||
} | ||
if (ptr == NULL) { | ||
const char *error = dlerror(); | ||
abort_report_np("%s", error); | ||
} | ||
return ptr; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// LockedPointer.h | ||
// OpenSwiftUI | ||
// OpenSwiftUI_SPI | ||
// | ||
// Audited for iOS 15.5 | ||
// Status: Complete | ||
|