Restructured the source code in the Playdate bindings target.

This commit is contained in:
2026-07-25 12:40:14 +02:00
parent 2e7ee12ec1
commit b435a6e8bd
106 changed files with 3754 additions and 3746 deletions
@@ -0,0 +1,6 @@
/// The user's answer to a permission request (microphone, network).
public enum AccessReply: UInt32, Sendable {
case ask = 0
case deny = 1
case allow = 2
}
@@ -0,0 +1,36 @@
public import CPlaydate
/// A Swift view of `PDSystemEvent` with the key code folded into the
/// key events.
public enum SystemEvent {
case initialize
case initializeLua
case lock
case unlock
case pause
case resume
case terminate
case keyPressed(keyCode: UInt32)
case keyReleased(keyCode: UInt32)
case lowPower
case mirrorStarted
case mirrorEnded
public init?(event: PDSystemEvent, argument: UInt32) {
switch event {
case kEventInit: self = .initialize
case kEventInitLua: self = .initializeLua
case kEventLock: self = .lock
case kEventUnlock: self = .unlock
case kEventPause: self = .pause
case kEventResume: self = .resume
case kEventTerminate: self = .terminate
case kEventKeyPressed: self = .keyPressed(keyCode: argument)
case kEventKeyReleased: self = .keyReleased(keyCode: argument)
case kEventLowPower: self = .lowPower
case kEventMirrorStarted: self = .mirrorStarted
case kEventMirrorEnded: self = .mirrorEnded
default: return nil
}
}
}