include/ui_window.h is deleted. runtime/window_props.kry declares NativeWindow as a one-line opaque "#type" (struct NativeWindow NativeWindow;) — an opaque forward declaration is just C text, no emitter feature needed — and the eleven window lifecycle/input calls as "#extern #export" declarations. The window host, policy host, kryon.h, and the window test include the props header directly. Gates: generated-runtime-parity-test, fast-test, k2c/k2cpp/k2go-syntax-test, go-runtime-test, examples-syntax-test, kryon-boundary-check, the ui_window_test binary, and the refreshed public-API snapshot pass.
48 lines
1.7 KiB
C
48 lines
1.7 KiB
C
/* Generated by k2c from runtime/window_props.kry. */
|
|
#ifndef K_RUNTIME_WINDOW_PROPS_H
|
|
#define K_RUNTIME_WINDOW_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
|
|
#include "kryon_compat.generated.h"
|
|
|
|
typedef struct NativeWindow NativeWindow;
|
|
|
|
typedef enum NativeWindowFlags {
|
|
NATIVE_WINDOW_BORDERLESS = 1,
|
|
NATIVE_WINDOW_ALWAYS_ON_TOP = 2,
|
|
NATIVE_WINDOW_SKIP_TASKBAR = 4,
|
|
NATIVE_WINDOW_TOP_RIGHT = 8,
|
|
NATIVE_WINDOW_CENTER = 16,
|
|
NATIVE_WINDOW_STICKY = 32,
|
|
} NativeWindowFlags;
|
|
NativeWindow* OpenNativeWindow(const char* title, int32_t x, int32_t y, int32_t width, int32_t height, int32_t flags, Color background, float ui_scale);
|
|
void CloseNativeWindow(NativeWindow* window);
|
|
void BeginNativeWindow(NativeWindow* window);
|
|
void EndNativeWindow(void);
|
|
int32_t IsNativeWindowClicked(NativeWindow* window);
|
|
int32_t IsNativeWindowRightClicked(NativeWindow* window);
|
|
int32_t IsNativeWindowDragged(NativeWindow* window);
|
|
void PumpWindows(void);
|
|
int32_t StealCoreWindowClose(void);
|
|
void GetNativeWindowPosition(NativeWindow* window, int32_t* x, int32_t* y);
|
|
void GetNativeWindowClickPosition(NativeWindow* window, int32_t* x, int32_t* y);
|
|
|
|
#endif /* K_RUNTIME_WINDOW_PROPS_H */
|