Files
kryon/include/ui_layout_props.generated.h
T
waozi dcb56c8fed Declare the widget key identity in a props module
include/kryon_key.h — a single typedef — is deleted. runtime/key_props.kry
declares KeyID as a one-line "#type"; the four props modules that imported the
handwritten header now import the generated one.

Gates: generated-runtime-parity-test, fast-test, k2c/k2cpp/k2go-syntax-test,
go-runtime-test, examples-syntax-test, kryon-boundary-check, and the refreshed
public-API snapshot pass.
2026-09-21 03:44:14 -03:00

81 lines
2.0 KiB
C

/* Generated by k2c from runtime/layout_props.kry. */
#ifndef K_RUNTIME_LAYOUT_PROPS_H
#define K_RUNTIME_LAYOUT_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"
#include "ui_key_props.generated.h"
typedef struct ColumnProps {
Rectangle bounds;
int32_t gap;
int32_t padding;
KeyID key;
} ColumnProps;
typedef enum FlexDirection {
FlexRow = 0,
FlexColumn,
} FlexDirection;
typedef enum JustifyContent {
JustifyStart = 0,
JustifyCenter,
JustifyEnd,
JustifySpaceBetween,
JustifySpaceAround,
JustifySpaceEvenly,
} JustifyContent;
typedef enum AlignItems {
AlignStart = 0,
AlignCenter,
AlignEnd,
AlignStretch,
} AlignItems;
typedef struct FlexProps {
Rectangle bounds;
FlexDirection direction;
JustifyContent justify_content;
AlignItems align_items;
int32_t gap;
int32_t padding;
} FlexProps;
typedef struct FlexCursor {
Rectangle content;
Rectangle item;
FlexDirection direction;
AlignItems align_items;
float position;
float gap;
int32_t remaining;
} FlexCursor;
FlexCursor BeginFlexCursor(FlexProps props, int32_t count, float total_item_extent);
FlexCursor FlexStep(FlexCursor cursor, float width, float height);
void SetViewSize(int32_t width, int32_t height);
int32_t GetViewWidth(void);
int32_t GetViewHeight(void);
void GetCenteredColumn(int32_t max_w, int32_t side_pad, int32_t* x, int32_t* w);
int32_t GetPageSidePadding(void);
#endif /* K_RUNTIME_LAYOUT_PROPS_H */