@nativedesktop/native 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/include/nd.h +23 -3
- package/package.json +1 -1
package/include/nd.h
CHANGED
|
@@ -49,9 +49,20 @@ typedef struct nd_backend {
|
|
|
49
49
|
bool (*node_visible)(nd_context*, nd_widget);
|
|
50
50
|
bool (*node_bounds)(nd_context*, nd_widget, nd_rect* out); /* false = no bounds */
|
|
51
51
|
bool (*snapshot)(nd_context*, const char* png_path); /* in-process render */
|
|
52
|
-
/*
|
|
53
|
-
|
|
54
|
-
caller frees via nd_free)
|
|
52
|
+
/* Open-ended string dispatch: the automation surface grows here instead of
|
|
53
|
+
growing the vtable. arg_json carries params, result_json_out the answer
|
|
54
|
+
(both nullable, caller frees via nd_free); returns 0 ok, or a negative
|
|
55
|
+
JSON-RPC-style code, with err_json_out carrying a data object on failure.
|
|
56
|
+
Actions today:
|
|
57
|
+
act "click" | "setValue" | "type" | "scroll" | "rowAction" |
|
|
58
|
+
"focus" | "scrollIntoView"
|
|
59
|
+
probe "a11y" | "windowState" | "snapshotNode"
|
|
60
|
+
window "window.close" | "window.setFrame"
|
|
61
|
+
input "pointer" | "drag" | "keys" | "doubleClick" | "rightClick" |
|
|
62
|
+
"hover" (-32003 on a backend without synthetic input)
|
|
63
|
+
webview "webviewInfo" | "webviewEvalStart" | "webviewEvalPoll" |
|
|
64
|
+
"webviewPageText"
|
|
65
|
+
An unknown action answers -32601, so a backend may implement a subset. */
|
|
55
66
|
int32_t (*semantic_action)(nd_context*, nd_widget, uint32_t node_id,
|
|
56
67
|
const char* action, const char* arg_json,
|
|
57
68
|
char** result_json_out, char** err_json_out);
|
|
@@ -154,4 +165,13 @@ void nd_system_response(nd_context*, uint32_t id, bool ok, const char* json);
|
|
|
154
165
|
NUL-terminated JSON payload. */
|
|
155
166
|
void nd_system_event(nd_context*, const char* channel, const char* data_json);
|
|
156
167
|
|
|
168
|
+
/* backend -> core: register one widget of the host-drawn crash overlay in the
|
|
169
|
+
automation tree, so getTree still sees the crash the embedder painted.
|
|
170
|
+
`text` may be NULL. The core takes no ownership reference; call
|
|
171
|
+
nd_overlay_clear_nodes before the widgets are torn down. */
|
|
172
|
+
void nd_overlay_register_node(nd_context*, nd_widget, const char* widget_type,
|
|
173
|
+
const char* test_id, const char* text);
|
|
174
|
+
/* backend -> core: drop every node registered by nd_overlay_register_node. */
|
|
175
|
+
void nd_overlay_clear_nodes(nd_context*);
|
|
176
|
+
|
|
157
177
|
#endif /* ND_H */
|