@geastack/apple 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +54 -0
- package/dist/index.d.ts +127 -0
- package/dist/index.js +3076 -0
- package/generated/AVFoundation.d.ts +112 -0
- package/generated/ActivityKit.d.ts +7 -0
- package/generated/AppKit.d.ts +268 -0
- package/generated/CoreGraphics.d.ts +18 -0
- package/generated/CoreLocation.d.ts +28 -0
- package/generated/CoreMedia.d.ts +8 -0
- package/generated/Dispatch.d.ts +2 -0
- package/generated/Foundation.d.ts +13 -0
- package/generated/MapKit.d.ts +28 -0
- package/generated/Metal.d.ts +91 -0
- package/generated/MetalKit.d.ts +22 -0
- package/generated/Photos.d.ts +5 -0
- package/generated/QuartzCore.d.ts +12 -0
- package/generated/SwiftData.d.ts +11 -0
- package/generated/UIKit.d.ts +187 -0
- package/package.json +123 -0
- package/runtime/AVFoundation.js +136 -0
- package/runtime/ActivityKit.js +18 -0
- package/runtime/AppKit.js +313 -0
- package/runtime/CoreGraphics.js +15 -0
- package/runtime/CoreLocation.js +30 -0
- package/runtime/CoreMedia.js +7 -0
- package/runtime/Dispatch.js +11 -0
- package/runtime/Foundation.js +21 -0
- package/runtime/MapKit.js +22 -0
- package/runtime/Metal.js +126 -0
- package/runtime/MetalKit.js +15 -0
- package/runtime/Photos.js +9 -0
- package/runtime/QuartzCore.js +9 -0
- package/runtime/SwiftData.js +29 -0
- package/runtime/UIKit.js +242 -0
- package/runtime/empty.js +1 -0
- package/targets/ios/Info.plist.in +25 -0
- package/targets/ios/README.md +46 -0
- package/targets/ios/build-ios.sh +395 -0
- package/targets/ios/detect-development-team.mjs +109 -0
- package/targets/ios/generate-resident-entry.mjs +67 -0
- package/targets/ios/generate-resident-registry.mjs +162 -0
- package/targets/ios/generate-xcode-project.mjs +520 -0
- package/targets/ios/main/canvas_view.h +7 -0
- package/targets/ios/main/canvas_view.mm +94 -0
- package/targets/ios/main/font_registry.h +17 -0
- package/targets/ios/main/font_registry.mm +129 -0
- package/targets/ios/main/image_bridge.h +13 -0
- package/targets/ios/main/image_bridge.mm +53 -0
- package/targets/ios/main/ios_apps.c +28 -0
- package/targets/ios/main/ios_camera.mm +446 -0
- package/targets/ios/main/ios_display.mm +344 -0
- package/targets/ios/main/ios_main.mm +811 -0
- package/targets/ios/main/ios_memory.cpp +55 -0
- package/targets/ios/main/ios_renderer.h +20 -0
- package/targets/ios/main/ios_renderer.mm +27 -0
- package/targets/ios/main/ios_root_background.cpp +20 -0
- package/targets/ios/main/ios_root_background.h +11 -0
- package/targets/ios/main/ios_sensors.mm +244 -0
- package/targets/ios/main/ios_timers.mm +53 -0
- package/targets/ios/main/renderer/ios_renderer_internal.h +65 -0
- package/targets/ios/main/renderer/ios_renderer_support.mm +111 -0
- package/targets/ios/main/renderer/native_button.mm +179 -0
- package/targets/ios/main/renderer/native_label.mm +161 -0
- package/targets/ios/main/renderer/native_scroll_container.mm +279 -0
- package/targets/ios/main/renderer/view_reconciler.mm +274 -0
- package/targets/macos/Info.plist.in +26 -0
- package/targets/macos/README.md +131 -0
- package/targets/macos/build-child-lifecycle.sh +119 -0
- package/targets/macos/build-macos.sh +2156 -0
- package/targets/macos/check-module-graph-freshness.mjs +82 -0
- package/targets/macos/compiler-input-fingerprint.mjs +32 -0
- package/targets/macos/finalize-apple-native-output.mjs +77 -0
- package/targets/macos/generate-resident-entry.mjs +80 -0
- package/targets/macos/generate-resident-registry.mjs +141 -0
- package/targets/macos/heavy-build-lock.sh +176 -0
- package/targets/macos/main/canvas_view.h +9 -0
- package/targets/macos/main/canvas_view.mm +176 -0
- package/targets/macos/main/color_convert.h +18 -0
- package/targets/macos/main/color_convert.mm +39 -0
- package/targets/macos/main/font_registry.h +35 -0
- package/targets/macos/main/font_registry.mm +350 -0
- package/targets/macos/main/image_bridge.h +16 -0
- package/targets/macos/main/image_bridge.mm +52 -0
- package/targets/macos/main/macos_app_platform.mm +95 -0
- package/targets/macos/main/macos_apps.c +31 -0
- package/targets/macos/main/macos_device_control.mm +56 -0
- package/targets/macos/main/macos_display.mm +484 -0
- package/targets/macos/main/macos_host_device_control.mm +95 -0
- package/targets/macos/main/macos_main.mm +839 -0
- package/targets/macos/main/macos_memory.cpp +31 -0
- package/targets/macos/main/macos_native_shell.h +31 -0
- package/targets/macos/main/macos_native_shell.mm +396 -0
- package/targets/macos/main/macos_network.mm +253 -0
- package/targets/macos/main/macos_renderer.h +39 -0
- package/targets/macos/main/macos_renderer.mm +1969 -0
- package/targets/macos/main/macos_sensors.cpp +148 -0
- package/targets/macos/main/macos_smoke_app.cpp +65 -0
- package/targets/macos/main/macos_timers.mm +52 -0
- package/targets/macos/main/press_bridge.h +21 -0
- package/targets/macos/main/press_bridge.mm +72 -0
- package/targets/macos/main/thermalright_hid_display.h +14 -0
- package/targets/macos/main/thermalright_hid_display.mm +995 -0
- package/targets/macos/native-artifact-provenance.mjs +421 -0
- package/targets/macos/order-compile-edges.mjs +64 -0
- package/targets/macos/preflight-hard-muted-artifact.mjs +93 -0
- package/targets/macos/prune-generated-modules.mjs +147 -0
- package/targets/macos/sync-resources.mjs +153 -0
- package/targets/shared/analyze-audio-capture.mjs +131 -0
- package/targets/shared/apple_audio.mm +1194 -0
- package/targets/shared/apple_audio_selftest.mm +602 -0
- package/targets/shared/apple_audio_testing.h +34 -0
- package/targets/shared/build-audio-selftest.sh +50 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Generates the iOS resident-app registry used by app-launcher simulator builds.
|
|
3
|
+
|
|
4
|
+
import { writeFileSync } from 'node:fs'
|
|
5
|
+
|
|
6
|
+
const [, , outPath, launcherId, ...appIds] = process.argv
|
|
7
|
+
if (!outPath || !launcherId || appIds.length === 0) {
|
|
8
|
+
console.error('Usage: generate-resident-registry.mjs <out-cpp> <launcher-id> <app-id...>')
|
|
9
|
+
process.exit(1)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const safe = (id) => id.replace(/[^A-Za-z0-9_]/g, '_')
|
|
13
|
+
const prefix = (id) => `gea_resident_${safe(id)}`
|
|
14
|
+
const quote = (s) => s.replace(/\\/g, '\\\\').replace(/"/g, '\\"')
|
|
15
|
+
|
|
16
|
+
const lines = []
|
|
17
|
+
lines.push('// Auto-generated by targets/ios/generate-resident-registry.mjs.')
|
|
18
|
+
lines.push('// Do not edit.')
|
|
19
|
+
lines.push('#include "app.h"')
|
|
20
|
+
lines.push('#include "resident_apps.h"')
|
|
21
|
+
lines.push('#include "graphics/font.h"')
|
|
22
|
+
lines.push('')
|
|
23
|
+
lines.push('#include <cstdio>')
|
|
24
|
+
lines.push('#include <cstring>')
|
|
25
|
+
lines.push('#include <mutex>')
|
|
26
|
+
lines.push('')
|
|
27
|
+
|
|
28
|
+
for (const id of appIds) {
|
|
29
|
+
const p = prefix(id)
|
|
30
|
+
lines.push(`extern void ${p}_init(int width, int height, double devicePixelRatio);`)
|
|
31
|
+
lines.push(`extern void ${p}_frame(int timestampMs);`)
|
|
32
|
+
lines.push(`extern void ${p}_settings_toggle();`)
|
|
33
|
+
lines.push(`extern const gea::framework::graphics::RasterizedFontData *${p}_lookup_font(int fontId);`)
|
|
34
|
+
lines.push(`extern const gea::framework::graphics::RasterizedFontData *${p}_lookup_font_for_family(int familyId, int sizePx);`)
|
|
35
|
+
lines.push(`extern int ${p}_lookup_font_family(const char *family);`)
|
|
36
|
+
lines.push(`extern const char *${p}_lookup_font_family_name(int familyId);`)
|
|
37
|
+
}
|
|
38
|
+
lines.push('')
|
|
39
|
+
|
|
40
|
+
lines.push('namespace gea::framework::apps {')
|
|
41
|
+
lines.push('namespace {')
|
|
42
|
+
lines.push(`constexpr const char *kLauncherAppId = "${quote(launcherId)}";`)
|
|
43
|
+
lines.push('std::mutex &pendingLock() { static std::mutex lock; return lock; }')
|
|
44
|
+
lines.push('char pendingLaunchAppId[64] = "";')
|
|
45
|
+
lines.push('bool pendingLaunchValid = false;')
|
|
46
|
+
lines.push('')
|
|
47
|
+
lines.push('const ResidentApp residentApps[] = {')
|
|
48
|
+
for (const id of appIds) {
|
|
49
|
+
const p = prefix(id)
|
|
50
|
+
lines.push('\t{')
|
|
51
|
+
lines.push(`\t\t.id = "${quote(id)}",`)
|
|
52
|
+
lines.push('\t\t.displayFlushChunkRows = 0,')
|
|
53
|
+
lines.push('\t\t.displayFlushQueueDepth = 0,')
|
|
54
|
+
lines.push(`\t\t.init = ${p}_init,`)
|
|
55
|
+
lines.push(`\t\t.frame = ${p}_frame,`)
|
|
56
|
+
lines.push(`\t\t.settingsToggle = ${p}_settings_toggle,`)
|
|
57
|
+
lines.push(`\t\t.lookupFont = ${p}_lookup_font,`)
|
|
58
|
+
lines.push(`\t\t.lookupFontForFamily = ${p}_lookup_font_for_family,`)
|
|
59
|
+
lines.push(`\t\t.lookupFontFamily = ${p}_lookup_font_family,`)
|
|
60
|
+
lines.push(`\t\t.lookupFontFamilyName = ${p}_lookup_font_family_name,`)
|
|
61
|
+
lines.push('\t},')
|
|
62
|
+
}
|
|
63
|
+
lines.push('};')
|
|
64
|
+
lines.push(`constexpr int kResidentAppCount = ${appIds.length};`)
|
|
65
|
+
lines.push('const ResidentApp *activeApp = &residentApps[0];')
|
|
66
|
+
lines.push('')
|
|
67
|
+
lines.push('const ResidentApp *findApp(const char *appId)')
|
|
68
|
+
lines.push('{')
|
|
69
|
+
lines.push("\tif (!appId || appId[0] == '\\0') return nullptr;")
|
|
70
|
+
lines.push('\tfor (int i = 0; i < kResidentAppCount; i++) {')
|
|
71
|
+
lines.push('\t\tif (std::strcmp(residentApps[i].id, appId) == 0) return &residentApps[i];')
|
|
72
|
+
lines.push('\t}')
|
|
73
|
+
lines.push('\treturn nullptr;')
|
|
74
|
+
lines.push('}')
|
|
75
|
+
lines.push('} // namespace')
|
|
76
|
+
lines.push('')
|
|
77
|
+
lines.push('namespace generated {')
|
|
78
|
+
lines.push('const ResidentApp *activeResidentApp() { return activeApp; }')
|
|
79
|
+
lines.push('} // namespace generated')
|
|
80
|
+
lines.push('')
|
|
81
|
+
lines.push('bool ResidentApps::isEnabled() { return kResidentAppCount > 0; }')
|
|
82
|
+
lines.push('const char *ResidentApps::activeId() { return activeApp ? activeApp->id : nullptr; }')
|
|
83
|
+
lines.push('')
|
|
84
|
+
lines.push('bool ResidentApps::select(const char *appId)')
|
|
85
|
+
lines.push('{')
|
|
86
|
+
lines.push('\tconst ResidentApp *next = findApp(appId);')
|
|
87
|
+
lines.push('\tif (!next) return false;')
|
|
88
|
+
lines.push('\tactiveApp = next;')
|
|
89
|
+
lines.push('\treturn true;')
|
|
90
|
+
lines.push('}')
|
|
91
|
+
lines.push('')
|
|
92
|
+
lines.push('bool ResidentApps::requestLaunch(const char *appId)')
|
|
93
|
+
lines.push('{')
|
|
94
|
+
lines.push('\tif (!findApp(appId)) return false;')
|
|
95
|
+
lines.push('\tstd::lock_guard guard(pendingLock());')
|
|
96
|
+
lines.push('\tstd::snprintf(pendingLaunchAppId, sizeof(pendingLaunchAppId), "%s", appId);')
|
|
97
|
+
lines.push('\tpendingLaunchValid = true;')
|
|
98
|
+
lines.push('\treturn true;')
|
|
99
|
+
lines.push('}')
|
|
100
|
+
lines.push('')
|
|
101
|
+
lines.push('bool ResidentApps::consumeLaunch(char *dst, std::size_t cap)')
|
|
102
|
+
lines.push('{')
|
|
103
|
+
lines.push('\tstd::lock_guard guard(pendingLock());')
|
|
104
|
+
lines.push('\tif (!pendingLaunchValid) return false;')
|
|
105
|
+
lines.push('\tif (dst && cap > 0) std::snprintf(dst, cap, "%s", pendingLaunchAppId);')
|
|
106
|
+
lines.push('\tpendingLaunchValid = false;')
|
|
107
|
+
lines.push("\tpendingLaunchAppId[0] = '\\0';")
|
|
108
|
+
lines.push('\treturn true;')
|
|
109
|
+
lines.push('}')
|
|
110
|
+
lines.push('')
|
|
111
|
+
lines.push('bool ResidentApps::returnToLauncher(const char *trigger)')
|
|
112
|
+
lines.push('{')
|
|
113
|
+
lines.push('\t(void)trigger;')
|
|
114
|
+
lines.push('\tif (!activeApp || std::strcmp(activeApp->id, kLauncherAppId) == 0) return false;')
|
|
115
|
+
lines.push('\treturn ResidentApps::requestLaunch(kLauncherAppId);')
|
|
116
|
+
lines.push('}')
|
|
117
|
+
lines.push('')
|
|
118
|
+
lines.push('} // namespace gea::framework::apps')
|
|
119
|
+
lines.push('')
|
|
120
|
+
lines.push('namespace gea::framework::app {')
|
|
121
|
+
lines.push('void Application::init(int width, int height, double devicePixelRatio)')
|
|
122
|
+
lines.push('{')
|
|
123
|
+
lines.push('\tconst auto *active = gea::framework::apps::generated::activeResidentApp();')
|
|
124
|
+
lines.push('\tif (active && active->init) active->init(width, height, devicePixelRatio);')
|
|
125
|
+
lines.push('}')
|
|
126
|
+
lines.push('void Application::frame(int timestampMs)')
|
|
127
|
+
lines.push('{')
|
|
128
|
+
lines.push('\tconst auto *active = gea::framework::apps::generated::activeResidentApp();')
|
|
129
|
+
lines.push('\tif (active && active->frame) active->frame(timestampMs);')
|
|
130
|
+
lines.push('}')
|
|
131
|
+
lines.push('void Application::toggleSettings()')
|
|
132
|
+
lines.push('{')
|
|
133
|
+
lines.push('\tconst auto *active = gea::framework::apps::generated::activeResidentApp();')
|
|
134
|
+
lines.push('\tif (active && active->settingsToggle) active->settingsToggle();')
|
|
135
|
+
lines.push('}')
|
|
136
|
+
lines.push('} // namespace gea::framework::app')
|
|
137
|
+
lines.push('')
|
|
138
|
+
lines.push('namespace gea::framework::graphics::generated {')
|
|
139
|
+
lines.push('void ensureLinked() {}')
|
|
140
|
+
lines.push('const RasterizedFontData *lookupFont(int fontId)')
|
|
141
|
+
lines.push('{')
|
|
142
|
+
lines.push('\tconst auto *active = gea::framework::apps::generated::activeResidentApp();')
|
|
143
|
+
lines.push('\treturn active && active->lookupFont ? active->lookupFont(fontId) : nullptr;')
|
|
144
|
+
lines.push('}')
|
|
145
|
+
lines.push('const RasterizedFontData *lookupFontForFamily(int familyId, int sizePx)')
|
|
146
|
+
lines.push('{')
|
|
147
|
+
lines.push('\tconst auto *active = gea::framework::apps::generated::activeResidentApp();')
|
|
148
|
+
lines.push('\treturn active && active->lookupFontForFamily ? active->lookupFontForFamily(familyId, sizePx) : nullptr;')
|
|
149
|
+
lines.push('}')
|
|
150
|
+
lines.push('int lookupFontFamily(const char *family)')
|
|
151
|
+
lines.push('{')
|
|
152
|
+
lines.push('\tconst auto *active = gea::framework::apps::generated::activeResidentApp();')
|
|
153
|
+
lines.push('\treturn active && active->lookupFontFamily ? active->lookupFontFamily(family) : -1;')
|
|
154
|
+
lines.push('}')
|
|
155
|
+
lines.push('const char *lookupFontFamilyName(int familyId)')
|
|
156
|
+
lines.push('{')
|
|
157
|
+
lines.push('\tconst auto *active = gea::framework::apps::generated::activeResidentApp();')
|
|
158
|
+
lines.push('\treturn active && active->lookupFontFamilyName ? active->lookupFontFamilyName(familyId) : nullptr;')
|
|
159
|
+
lines.push('}')
|
|
160
|
+
lines.push('} // namespace gea::framework::graphics::generated')
|
|
161
|
+
|
|
162
|
+
writeFileSync(outPath, lines.join('\n') + '\n')
|