include/kryon_node.h is deleted. runtime/node_props.kry declares KryonNodeEdit — whose PropertyValue field is the property system's union in the handwritten kryon_property.h host header — as a one-line "#type" record that imports that header, and KryonNodeKindName/KryonNodeInit as "#extern #export" declarations. The node host, kryon.h, and kryon_edit_host.h 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, and the refreshed public-API snapshot pass.
57 lines
1.6 KiB
Plaintext
57 lines
1.6 KiB
Plaintext
#module "node_props"
|
|
#import "kryon_compat.generated.h"
|
|
#import "kryon_property.h"
|
|
|
|
# C-only record: PropertyValue is the property system's union, declared in the
|
|
# handwritten kryon_property.h host header.
|
|
KryonNodeEdit :: struct { const char *node_id; const char *property_id; PropertyValue value; } #type
|
|
|
|
# Implemented by the C-only node host; declared here for the public ABI.
|
|
KryonNodeKindName :: (kind: KryonNodeKind) -> const char* #extern #export
|
|
KryonNodeInit :: (node: *KryonNode, id: const char*, type: const char*, kind: KryonNodeKind) #extern #export
|
|
|
|
KRYON_NODE_ID_MAX :: 96
|
|
KRYON_NODE_NAME_MAX :: 128
|
|
KRYON_NODE_TYPE_MAX :: 64
|
|
KRYON_NODE_PATH_MAX :: 512
|
|
|
|
KryonNodeKind :: enum {
|
|
KRYON_NODE_KIND_UNKNOWN = 0
|
|
KRYON_NODE_KIND_UI = 1
|
|
KRYON_NODE_KIND_2D = 2
|
|
KRYON_NODE_KIND_DATA = 3
|
|
KRYON_NODE_KIND_GROUP = 4
|
|
}
|
|
|
|
KryonNodeFlags :: enum {
|
|
KRYON_NODE_FLAG_SELECTABLE = 1
|
|
KRYON_NODE_FLAG_MOVABLE = 2
|
|
KRYON_NODE_FLAG_RESIZABLE = 4
|
|
KRYON_NODE_FLAG_DELETABLE = 8
|
|
KRYON_NODE_FLAG_INSERTABLE = 16
|
|
KRYON_NODE_FLAG_READONLY = 32
|
|
KRYON_NODE_FLAG_VISIBLE = 64
|
|
KRYON_NODE_FLAG_LOCKED = 128
|
|
}
|
|
|
|
KryonNode :: struct {
|
|
id: [KRYON_NODE_ID_MAX]char
|
|
name: [KRYON_NODE_NAME_MAX]char
|
|
type: [KRYON_NODE_TYPE_MAX]char
|
|
base_type: [KRYON_NODE_TYPE_MAX]char
|
|
parent_id: [KRYON_NODE_ID_MAX]char
|
|
source_path: [KRYON_NODE_PATH_MAX]char
|
|
kind: KryonNodeKind
|
|
flags: unsigned
|
|
bounds: Rectangle
|
|
position: Vector2
|
|
scale: Vector2
|
|
origin: Vector2
|
|
rotation: float
|
|
layer: int
|
|
order: int
|
|
source_line: int
|
|
source_start: int
|
|
source_end: int
|
|
}
|