k2go now skips '#type' declarations in runtime-implementation modules instead
of exiting: the typedef declares the C ABI (function-pointer callback types
and similar), Go emits nothing for it, and any reference from a Go-visible
function still fails as an unresolved type. Standalone compilations keep the
loud diagnostic, so the go_type_diagnostics guard is unchanged.
That unlocks runtime/frame_props.kry, which declares KryonPostFrameCallback as
a '#type' and the twelve frame lifecycle/pacing calls — including
SchedulePostFrameCallback's callback parameter — as '#extern #export'
declarations, so include/kryon_frame.h is deleted and kryon.h, the frame
hosts, and the pacing test include the props header directly.
tests/frame_pacing_test.kry gains no-op PushInspectSource/PopInspectSource
definitions: its generated module has carried source instrumentation all along,
but the standalone link never provided them (latent, surfaced by the header
swap). The Makefile target depends on the props header. runtime-declarations-
check's C and Go comparisons pass; its final web artifact cmp fails because
generating web/control_props.js (the paused k2js target over the full runtime
set incl. kss_parser) has been broken since 405fc5c5, independent of this
change.
Gates: generated-runtime-parity-test, fast-test, k2c/k2cpp/k2go-syntax-test,
go-runtime-test, examples-syntax-test, frame_pacing_test, kryon-boundary-check,
and the refreshed public-API snapshot pass.
39 lines
1.2 KiB
C
39 lines
1.2 KiB
C
/* Generated by k2c from runtime/frame_props.kry. */
|
|
#ifndef K_RUNTIME_FRAME_PROPS_H
|
|
#define K_RUNTIME_FRAME_PROPS_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include "kry_bounds.h"
|
|
|
|
#ifndef KIR_STRING_VALUE_DEFINED
|
|
#define KIR_STRING_VALUE_DEFINED
|
|
#include <stddef.h>
|
|
#include <string.h>
|
|
/* Immutable borrowed UTF-8 bytes; length preserves embedded nulls. */
|
|
typedef struct String { const char *data; size_t length; } String;
|
|
static inline String StringView(const char *data, size_t length) {
|
|
String value = {data, length};
|
|
return value;
|
|
}
|
|
static inline bool StringEqual(String a, String b) {
|
|
return a.length == b.length && (a.length == 0 || memcmp(a.data, b.data, a.length) == 0);
|
|
}
|
|
#endif
|
|
|
|
typedef void (*KryonPostFrameCallback)(void* userdata);
|
|
void BeginFrame(void);
|
|
void EndFrame(void);
|
|
void SyncFrame(void);
|
|
int32_t GetFrameWidth(void);
|
|
int32_t GetFrameHeight(void);
|
|
float GetFrameScale(void);
|
|
void ConfigureFramePacing(int32_t idle_fps, int32_t active_fps);
|
|
void DisableFramePacing(void);
|
|
void SetFramePacingActive(int32_t active);
|
|
void UpdateFramePacing(void);
|
|
int32_t GetFramePacingTargetFPS(void);
|
|
int32_t SchedulePostFrameCallback(KryonPostFrameCallback callback, void* userdata);
|
|
|
|
#endif /* K_RUNTIME_FRAME_PROPS_H */
|