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.
165 lines
6.9 KiB
C
165 lines
6.9 KiB
C
/* Generated by k2c from runtime/tree_props.kry. */
|
|
#ifndef K_RUNTIME_TREE_PROPS_H
|
|
#define K_RUNTIME_TREE_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"
|
|
#include "ui_control_props.generated.h"
|
|
#include "ui_drawing_props.generated.h"
|
|
#include "ui_layout_props.generated.h"
|
|
#include "ui_input_props.generated.h"
|
|
#include "ui_accessibility_node.generated.h"
|
|
#include "ui_accessibility_props.generated.h"
|
|
#include "ui_icon_types.h"
|
|
#include "ui_router_props.generated.h"
|
|
#include "ui_text_props.generated.h"
|
|
#include "ui_text_input_props.generated.h"
|
|
#include "ui_button_props.generated.h"
|
|
#include "ui_card_props.generated.h"
|
|
#include "ui_checkbox_props.generated.h"
|
|
#include "ui_collapsible_props.generated.h"
|
|
#include "ui_color_picker_props.generated.h"
|
|
#include "ui_drag_props.generated.h"
|
|
#include "ui_drag_drop_props.generated.h"
|
|
#include "ui_dropdown_props.generated.h"
|
|
#include "ui_fieldset_props.generated.h"
|
|
#include "ui_grid_props.generated.h"
|
|
#include "ui_list_box_props.generated.h"
|
|
#include "ui_modal_props.generated.h"
|
|
#include "ui_navigation_bar_props.generated.h"
|
|
#include "ui_paned_view_props.generated.h"
|
|
#include "ui_plot_props.generated.h"
|
|
#include "ui_progress_props.generated.h"
|
|
#include "ui_radio_props.generated.h"
|
|
#include "ui_selectable_props.generated.h"
|
|
#include "ui_separator_props.generated.h"
|
|
#include "ui_slider_props.generated.h"
|
|
#include "ui_spinbox_props.generated.h"
|
|
#include "ui_table_view_props.generated.h"
|
|
#include "ui_title_bar_props.generated.h"
|
|
#include "ui_toggle_props.generated.h"
|
|
#include "ui_toolbar_props.generated.h"
|
|
#include "ui_tab_bar_props.generated.h"
|
|
#include "ui_tree_view_props.generated.h"
|
|
#define ROUTER_NO_ROUTE -2147483647
|
|
|
|
typedef enum { EVENT_NONE = 0, EVENT_CLICK = 1, EVENT_VALUE_CHANGED = 2, EVENT_TEXT_CHANGED = 3, EVENT_TEXT_COMMIT = 4, EVENT_SELECTION_CHANGED = 5, EVENT_COMPOSITION_CHANGED = 6, EVENT_FOCUS = 7, EVENT_BLUR = 8 } EventKind;
|
|
|
|
typedef enum { INVALIDATE_NONE = 0, INVALIDATE_PAINT = 1, INVALIDATE_LAYOUT = 2, INVALIDATE_TREE = 4 } Invalidation;
|
|
|
|
typedef int NodeId;
|
|
|
|
typedef struct TreeNode TreeNode;
|
|
|
|
typedef void (*AccessibilitySink)(const AccessibilityNode *nodes, int count, void *userdata);
|
|
|
|
typedef ColumnProps RowProps;
|
|
|
|
typedef ColumnProps FlowProps;
|
|
|
|
typedef struct Event { KeyID key; EventKind kind; double timestamp; union { int value; struct { int start, end; } selection; struct { int bytes; } text; } data; } Event;
|
|
void BeginTree(KeyID screen_key);
|
|
void EndTree(void);
|
|
void End(void);
|
|
KeyID Key(const char* text);
|
|
void InvalidateTree(Invalidation invalidation);
|
|
int32_t NextEvent(Event* event);
|
|
int32_t SetSelection(KeyID key, int32_t anchor, int32_t cursor);
|
|
void ReconcileTree(void);
|
|
void LayoutTree(void);
|
|
void RouteInput(void);
|
|
void UpdateTree(void);
|
|
void Overlays(void);
|
|
const TreeNode* GetTreeNodes(int32_t* count);
|
|
int32_t GetNodeId(const TreeNode* node);
|
|
int32_t GetNodeKind(const TreeNode* node);
|
|
const char* GetNodeKindName(int32_t kind);
|
|
Rectangle GetNodeBounds(const TreeNode* node);
|
|
int32_t GetNodeParent(const TreeNode* node);
|
|
int32_t GetNodeFirstChild(const TreeNode* node);
|
|
int32_t GetNodeNextSibling(const TreeNode* node);
|
|
int32_t GetNodeHeightById(int32_t id);
|
|
const TreeNode* GetNode(NodeId id);
|
|
NodeId HitTestNode(Vector2 point);
|
|
int32_t GetAccessibilitySnapshot(AccessibilityNode* nodes, int32_t capacity);
|
|
void SetAccessibilitySink(AccessibilitySink sink, void* userdata);
|
|
int32_t QueueAccessibilityAction(int32_t focus_id, uint64_t generation, AccessibilityAction action);
|
|
int32_t QueueAccessibilityValue(int32_t focus_id, uint64_t generation, const char* value);
|
|
int32_t QueueAccessibilitySelection(int32_t focus_id, uint64_t generation, int32_t anchor, int32_t cursor);
|
|
int32_t QueueAccessibilityItem(int32_t focus_id, uint64_t generation, int32_t index, int32_t selected);
|
|
void AppBackground(void);
|
|
void Background(Color color);
|
|
void Surface(Rectangle bounds, Style style);
|
|
int32_t Card(CardProps card);
|
|
void Text(TextProps props);
|
|
void Paragraph(ParagraphSpec paragraph, int32_t x, int32_t* y);
|
|
void Box(Rectangle bounds, Color fill, Color border);
|
|
void Circle(int32_t center_x, int32_t center_y, int32_t radius, Color color);
|
|
void Ring(int32_t center_x, int32_t center_y, int32_t inner_radius, int32_t outer_radius, Color color);
|
|
void Line(int32_t x1, int32_t y1, int32_t x2, int32_t y2, Color color);
|
|
void Triangle(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t x3, int32_t y3, Color color);
|
|
void Bevel(int32_t x, int32_t y, int32_t w, int32_t h, Color light, Color dark);
|
|
void Icon(int32_t id, int32_t x, int32_t y, int32_t size, IconType icon, Color tint);
|
|
int32_t TextField(TextFieldProps field);
|
|
int32_t Dropdown(DropdownProps dropdown);
|
|
int32_t Toggle(ToggleProps toggle);
|
|
int32_t Checkbox(CheckboxProps checkbox);
|
|
void Separator(SeparatorProps separator);
|
|
int32_t DragDrop(DragDropProps drag_drop);
|
|
int32_t Radio(RadioProps radio);
|
|
void Progress(ProgressProps progress);
|
|
void Plot(PlotProps plot);
|
|
int32_t Drag(DragProps drag);
|
|
int32_t Input(InputProps input);
|
|
int32_t Slider(SliderProps slider);
|
|
int32_t Spinbox(SpinboxProps spinbox);
|
|
void Fieldset(FieldsetProps frame);
|
|
int32_t ListBox(ListBoxProps list);
|
|
int32_t TreeView(TreeViewProps tree);
|
|
int32_t TableView(TableViewProps table);
|
|
int32_t TextArea(TextAreaProps area);
|
|
void CanvasGrid(Rectangle bounds, int32_t step, Color color);
|
|
int32_t PanedView(PanedViewProps panes);
|
|
int32_t Collapsible(CollapsibleProps section);
|
|
int32_t ColorPicker(ColorPickerProps picker);
|
|
void Focus(Rectangle bounds);
|
|
NavigationBarResult NavigationBar(NavigationBarProps nav);
|
|
ToolbarResult Toolbar(ToolbarProps toolbar);
|
|
int32_t TabBar(TabBarProps bar);
|
|
int32_t Modal(ModalProps modal);
|
|
int32_t TitleBar(TitleBarProps title_bar);
|
|
int32_t Button(ButtonProps button);
|
|
int32_t Selectable(SelectableProps selectable);
|
|
void Bullet(Rectangle bounds);
|
|
void RouterStateInit(RouterState* state, int32_t initial_route);
|
|
void RouterNavigate(RouterState* state, int32_t route_id);
|
|
int32_t RouterSetRoute(RouterProps props, int32_t route_id, int32_t push);
|
|
const RouterRoute* RouterFindRoute(const RouterRoute* routes, int32_t route_count, int32_t route_id);
|
|
RouterResult Router(RouterProps props);
|
|
NodeId Column(ColumnProps props);
|
|
NodeId Row(RowProps props);
|
|
NodeId Grid(GridProps props);
|
|
NodeId Group(ColumnProps props);
|
|
NodeId Stack(ColumnProps props);
|
|
NodeId Screen(ColumnProps props);
|
|
|
|
#endif /* K_RUNTIME_TREE_PROPS_H */
|