@geastack/engine 0.1.5

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.
Files changed (86) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +29 -0
  3. package/bitmap_font.cpp +165 -0
  4. package/canvas.cpp +4608 -0
  5. package/components/Button.d.ts +4 -0
  6. package/components/Button.tsx +32 -0
  7. package/components/Image.d.ts +3 -0
  8. package/components/Image.tsx +17 -0
  9. package/components/Text.d.ts +3 -0
  10. package/components/Text.tsx +9 -0
  11. package/components/View.d.ts +3 -0
  12. package/components/View.tsx +24 -0
  13. package/components/index.d.ts +8 -0
  14. package/components/index.ts +4 -0
  15. package/css/animation.h +252 -0
  16. package/css/declarative.h +131 -0
  17. package/css/easing.h +160 -0
  18. package/css/engine.h +223 -0
  19. package/css/interpolate.h +38 -0
  20. package/image_store.cpp +807 -0
  21. package/package.json +62 -0
  22. package/rasterized_font.cpp +570 -0
  23. package/touch_runtime.cpp +513 -0
  24. package/ui/absolute_leaf_refresh.cpp +279 -0
  25. package/ui/absolute_leaf_refresh.h +12 -0
  26. package/ui/canvas_element.cpp +2314 -0
  27. package/ui/canvas_element.h +353 -0
  28. package/ui/canvas_store.cpp +188 -0
  29. package/ui/canvas_store.h +59 -0
  30. package/ui/core.cpp +135 -0
  31. package/ui/css_atom.cpp +155 -0
  32. package/ui/css_atom.h +21 -0
  33. package/ui/dirty_regions.cpp +66 -0
  34. package/ui/dirty_regions.h +34 -0
  35. package/ui/display_invalidation.cpp +101 -0
  36. package/ui/display_invalidation.h +15 -0
  37. package/ui/document.cpp +356 -0
  38. package/ui/document.h +101 -0
  39. package/ui/image.h +16 -0
  40. package/ui/image_element.cpp +13 -0
  41. package/ui/image_node.cpp +165 -0
  42. package/ui/input.cpp +936 -0
  43. package/ui/input_render.cpp +213 -0
  44. package/ui/internal.h +567 -0
  45. package/ui/layout.cpp +2025 -0
  46. package/ui/layout_snapshot.cpp +82 -0
  47. package/ui/layout_snapshot.h +12 -0
  48. package/ui/mirror.h +25 -0
  49. package/ui/node.cpp +243 -0
  50. package/ui/node.h +154 -0
  51. package/ui/node_lifecycle.cpp +137 -0
  52. package/ui/node_lifecycle.h +13 -0
  53. package/ui/node_model.h +597 -0
  54. package/ui/refresh_perf.h +235 -0
  55. package/ui/refresh_trace.h +68 -0
  56. package/ui/render.cpp +12097 -0
  57. package/ui/root_scroll_refresh.cpp +859 -0
  58. package/ui/root_scroll_refresh.h +30 -0
  59. package/ui/state_init.h +21 -0
  60. package/ui/style.cpp +14994 -0
  61. package/ui/style.h +727 -0
  62. package/ui/style_values.h +31 -0
  63. package/ui/text.cpp +2010 -0
  64. package/ui/text.h +15 -0
  65. package/ui/text_element.cpp +15 -0
  66. package/ui/tree_events.cpp +621 -0
  67. package/ui/tree_events.h +69 -0
  68. package/ui/tree_internal.h +191 -0
  69. package/ui/tree_nodes.cpp +628 -0
  70. package/ui/tree_render.cpp +3138 -0
  71. package/ui/tree_scroll_mirror.cpp +101 -0
  72. package/ui/tree_state.cpp +574 -0
  73. package/ui/tree_state.h +235 -0
  74. package/ui/tree_style.cpp +698 -0
  75. package/ui/ui.h +9 -0
  76. package/ui/view.cpp +2232 -0
  77. package/ui/view.h +14 -0
  78. package/ui/view_element.cpp +13 -0
  79. package/ui/viewport_region.cpp +36 -0
  80. package/ui/viewport_region.h +12 -0
  81. package/ui/virtual_keyboard.cpp +908 -0
  82. package/ui/virtual_keyboard.h +59 -0
  83. package/vendor/AnimatedGIF/AnimatedGIF.c +982 -0
  84. package/vendor/AnimatedGIF/AnimatedGIF.h +216 -0
  85. package/vendor/stb/stb_image.h +7988 -0
  86. package/vendor/stb/stb_truetype.h +5079 -0
@@ -0,0 +1,59 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ // Built-in on-screen QWERTY keyboard for pixel-backed targets (ESP32 etc.).
3
+ //
4
+ // Implemented as real document-tree nodes — `keyboard_root → row[0..3] →
5
+ // key[0..N] + label` — created the first time an `<input>` element gets
6
+ // focus and toggled via Property::Display thereafter. Each key carries a
7
+ // reserved pressId; a single body-level "click" listener intercepts taps
8
+ // in that pressId range and routes them into the focused input's `value`
9
+ // attribute, then dispatches synthetic `input` / `keydown` PointerEvents
10
+ // so JSX `onInput` / `onKeyDown` handlers fire the same way they do on
11
+ // macOS / browsers.
12
+ //
13
+ // Native-text-input targets disable this with
14
+ // GEA_EMBEDDED_ENABLE_VIRTUAL_KEYBOARD=0 and use their platform keyboard
15
+ // instead. Pixel-only targets keep it enabled as their text-entry path.
16
+
17
+ #pragma once
18
+
19
+ namespace gea::embedded::ui {
20
+
21
+ class VirtualKeyboard {
22
+ public:
23
+ static VirtualKeyboard &instance();
24
+
25
+ // Whether the keyboard is currently visible. Mirrors
26
+ // `Tree::activeInputId() >= 0` but is cheap to query so the renderer
27
+ // doesn't have to chase the Tree singleton.
28
+ bool active() const;
29
+
30
+ // Reset everything (called on app teardown so the next app starts
31
+ // with a clean slate — node ids from the previous tree are stale).
32
+ void reset();
33
+
34
+ // Diagnostics: the keyboard root node id (-1 before first mount).
35
+ int debugRootNode() const;
36
+
37
+ // Reconcile keyboard visibility / contents against Tree state.
38
+ // Called from touch_runtime after focus changes; the keyboard reads
39
+ // `Tree::activeInputId()` to decide whether to show, mount nodes
40
+ // lazily on first show, and updates the existing nodes on subsequent
41
+ // shows. Idempotent — safe to call after every press.
42
+ void sync();
43
+
44
+ // True when nodeId is inside the keyboard subtree (root or any
45
+ // descendant — label texts, individual keys, rows). touch_runtime
46
+ // asks before running its focus-management logic so taps that
47
+ // land anywhere on the keyboard don't accidentally clear the
48
+ // focused input (which would close the keyboard mid-typing).
49
+ // pressId-only checks miss this case because hitTestNode returns
50
+ // the deepest descendant (often the label text node), which
51
+ // inherits the key's press id through bubble dispatch but doesn't
52
+ // carry it directly on the attribute.
53
+ bool containsNode(int nodeId) const;
54
+
55
+ private:
56
+ VirtualKeyboard() = default;
57
+ };
58
+
59
+ } // namespace gea::embedded::ui