Use the Apps frame type in portable Apfelwurm
This commit is contained in:
1 parent
176bd9259e
commit
64aa16fcbb
3 files changed
+9
-20
No files matched your search
@@ -2,6 +2,8 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
- Use the Apps frame type so Apfelwurm and its editor open in Arcade inside Breeze.
|
||||
|
||||
- Use Mesh naming and its canonical local referral fixture for browser tests.
|
||||
|
||||
- Use Ziran’s standard audio mixer and SDL, Android and WebAudio sinks, preserving music transitions and volume while testing playback, pause, seek and loop behavior. Take desktop codecs from Kryon’s desktop artifact.
|
||||
|
||||
+5
-18
@@ -1,28 +1,13 @@
|
||||
Apps :: #import "apps/node_types";
|
||||
Node :: #import "apps/node_app";
|
||||
#import "kryon/geometry"
|
||||
#import "kryon/session"
|
||||
UiSession :: #import "kryon/session";
|
||||
App :: #import, file "app.zi";
|
||||
Runtime :: #import "portable_runtime";
|
||||
Locale :: #import, file "localization.zi";
|
||||
host_api :: #system_library "host_api";
|
||||
|
||||
// Keep the portable UI ABI on this app's Kryon package. Apps.AppUiFrame has
|
||||
// the same public value layout, but importing its Session would couple the
|
||||
// portable entry to whichever Kryon revision the host package was built with.
|
||||
AppUiFrame :: struct {
|
||||
session: Session
|
||||
width: s32
|
||||
height: s32
|
||||
bottom: s32
|
||||
top: s32
|
||||
scale: float32
|
||||
font: s32
|
||||
now: float64
|
||||
dark: bool
|
||||
}
|
||||
|
||||
ReadAppUiHost :: () -> AppUiFrame #foreign host_api;
|
||||
ReadAppUiHost :: () -> Apps.AppUiFrame #foreign host_api;
|
||||
|
||||
#program_export
|
||||
Main :: () -> s32 { return Node.RunNodeApp(WurmFrame, WurmBack) }
|
||||
@@ -33,7 +18,9 @@ WurmFrame :: (message: Apps.AppMessage) -> bool {
|
||||
Runtime.FrameTime(frame.now)
|
||||
area := Rectangle.{0.0, cast(float32)frame.top, cast(float32)frame.width,
|
||||
cast(float32)(frame.height - frame.top - frame.bottom)}
|
||||
return App.Frame(frame.session, area) == 0
|
||||
// The portable entry and Apps may use different Kryon revisions.
|
||||
session := UiSession.Session.{.slot = frame.session.slot, .epoch = frame.session.epoch}
|
||||
return App.Frame(session, area) == 0
|
||||
}
|
||||
|
||||
WurmBack :: (message: Apps.AppMessage) -> bool {
|
||||
|
||||
@@ -26,7 +26,7 @@ Own :: #import, file "../src/own_levels.zi";
|
||||
using WidgetKind;
|
||||
|
||||
message: Apps.AppMessage;
|
||||
frame: Portable.AppUiFrame;
|
||||
frame: Apps.AppUiFrame;
|
||||
profile_opens: s32;
|
||||
balance_reads: s32;
|
||||
failures: s32;
|
||||
@@ -48,7 +48,7 @@ ReadAppHost :: () -> Apps.AppMessage { return message }
|
||||
#program_export
|
||||
WriteAppHost :: (value: Apps.AppMessage) { message = value }
|
||||
#program_export
|
||||
ReadAppUiHost :: () -> Portable.AppUiFrame { return frame }
|
||||
ReadAppUiHost :: () -> Apps.AppUiFrame { return frame }
|
||||
field_input: TextField.Input;
|
||||
// Scripted input reaches the real collection/search field widget.
|
||||
#program_export
|
||||
|
||||
Reference in new issue
Block a user