Everything kryon owns is now addressable and interactable through one file-tree surface: /info, /theme tokens, /input (mouse position, buttons, keys, text, wheel - readable and writable), and /widgets (the live ui_inspect tree with per-widget kind/text/bounds/source plus a tap that clicks for real). Input injection is new underneath: kry_inject keeps a pure-state event queue whose edges derive at each pump (raylib-style previous-vs-current), and the generated backend wrappers consult it before platform input, so injected events reach app code that queries GetMousePosition or IsMouseButtonReleased directly. KryonInjectPump runs from UpdateKeyPlatformState; injected mouse positions serve for one frame (two for taps) so the real mouse keeps working. KryTTap/KryTType/ KryTKey in kryon_test.h now inject for real instead of recording strings. ui_inspect gained SetUIInspectVisible so the SFS can record the widget tree without arming the click-stealing overlay. tests/sfs_test.c covers listing/reading every namespace, edge semantics, tap-to-UIHandleClick, and the KryT helpers; wired into make test (suite green).
53 lines
1.3 KiB
C
53 lines
1.3 KiB
C
#ifndef UI_INSPECT_H
|
|
#define UI_INSPECT_H
|
|
|
|
#include "ui_widget.h"
|
|
|
|
typedef struct UIInspectSelection {
|
|
char id[96];
|
|
char kind[32];
|
|
char action[64];
|
|
char source_path[512];
|
|
Rectangle bounds;
|
|
int flags;
|
|
int kind_index;
|
|
int source_line;
|
|
int valid;
|
|
} UIInspectSelection;
|
|
|
|
typedef struct UIInspectNode {
|
|
char name[96];
|
|
char role[32];
|
|
char text[64];
|
|
char value[128];
|
|
char source_path[512];
|
|
Rectangle bounds;
|
|
int flags;
|
|
int order;
|
|
int parent;
|
|
int source_line;
|
|
int valid;
|
|
} UIInspectNode;
|
|
|
|
void BeginUIInspectFrame(const char *project_root);
|
|
void EndUIInspectFrame(void);
|
|
void SetUIInspectEnabled(int enabled);
|
|
void SetUIInspectVisible(int visible);
|
|
int UIInspectEnabled(void);
|
|
int UIInspectWidgetCount(void);
|
|
int UIInspectNodeCount(void);
|
|
int UIInspectGetNode(int index, UIInspectNode *node);
|
|
int UIInspectFindNode(const char *selector, UIInspectNode *node);
|
|
UIInspectSelection UIInspectGetSelection(void);
|
|
int UIInspectSelectAt(Vector2 point);
|
|
void SetUIInspectCanvasBounds(Rectangle bounds);
|
|
int PushUIInspectTransform(Camera2D camera);
|
|
void PopUIInspectTransform(int token);
|
|
int PushUIInspectChrome(int enabled);
|
|
void PopUIInspectChrome(int token);
|
|
int UIInspectInputCapturesClick(Vector2 point);
|
|
void PushUIInspectSource(const char *path, int line);
|
|
void PopUIInspectSource(void);
|
|
|
|
#endif
|