@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.
- package/LICENSE +202 -0
- package/README.md +29 -0
- package/bitmap_font.cpp +165 -0
- package/canvas.cpp +4608 -0
- package/components/Button.d.ts +4 -0
- package/components/Button.tsx +32 -0
- package/components/Image.d.ts +3 -0
- package/components/Image.tsx +17 -0
- package/components/Text.d.ts +3 -0
- package/components/Text.tsx +9 -0
- package/components/View.d.ts +3 -0
- package/components/View.tsx +24 -0
- package/components/index.d.ts +8 -0
- package/components/index.ts +4 -0
- package/css/animation.h +252 -0
- package/css/declarative.h +131 -0
- package/css/easing.h +160 -0
- package/css/engine.h +223 -0
- package/css/interpolate.h +38 -0
- package/image_store.cpp +807 -0
- package/package.json +62 -0
- package/rasterized_font.cpp +570 -0
- package/touch_runtime.cpp +513 -0
- package/ui/absolute_leaf_refresh.cpp +279 -0
- package/ui/absolute_leaf_refresh.h +12 -0
- package/ui/canvas_element.cpp +2314 -0
- package/ui/canvas_element.h +353 -0
- package/ui/canvas_store.cpp +188 -0
- package/ui/canvas_store.h +59 -0
- package/ui/core.cpp +135 -0
- package/ui/css_atom.cpp +155 -0
- package/ui/css_atom.h +21 -0
- package/ui/dirty_regions.cpp +66 -0
- package/ui/dirty_regions.h +34 -0
- package/ui/display_invalidation.cpp +101 -0
- package/ui/display_invalidation.h +15 -0
- package/ui/document.cpp +356 -0
- package/ui/document.h +101 -0
- package/ui/image.h +16 -0
- package/ui/image_element.cpp +13 -0
- package/ui/image_node.cpp +165 -0
- package/ui/input.cpp +936 -0
- package/ui/input_render.cpp +213 -0
- package/ui/internal.h +567 -0
- package/ui/layout.cpp +2025 -0
- package/ui/layout_snapshot.cpp +82 -0
- package/ui/layout_snapshot.h +12 -0
- package/ui/mirror.h +25 -0
- package/ui/node.cpp +243 -0
- package/ui/node.h +154 -0
- package/ui/node_lifecycle.cpp +137 -0
- package/ui/node_lifecycle.h +13 -0
- package/ui/node_model.h +597 -0
- package/ui/refresh_perf.h +235 -0
- package/ui/refresh_trace.h +68 -0
- package/ui/render.cpp +12097 -0
- package/ui/root_scroll_refresh.cpp +859 -0
- package/ui/root_scroll_refresh.h +30 -0
- package/ui/state_init.h +21 -0
- package/ui/style.cpp +14994 -0
- package/ui/style.h +727 -0
- package/ui/style_values.h +31 -0
- package/ui/text.cpp +2010 -0
- package/ui/text.h +15 -0
- package/ui/text_element.cpp +15 -0
- package/ui/tree_events.cpp +621 -0
- package/ui/tree_events.h +69 -0
- package/ui/tree_internal.h +191 -0
- package/ui/tree_nodes.cpp +628 -0
- package/ui/tree_render.cpp +3138 -0
- package/ui/tree_scroll_mirror.cpp +101 -0
- package/ui/tree_state.cpp +574 -0
- package/ui/tree_state.h +235 -0
- package/ui/tree_style.cpp +698 -0
- package/ui/ui.h +9 -0
- package/ui/view.cpp +2232 -0
- package/ui/view.h +14 -0
- package/ui/view_element.cpp +13 -0
- package/ui/viewport_region.cpp +36 -0
- package/ui/viewport_region.h +12 -0
- package/ui/virtual_keyboard.cpp +908 -0
- package/ui/virtual_keyboard.h +59 -0
- package/vendor/AnimatedGIF/AnimatedGIF.c +982 -0
- package/vendor/AnimatedGIF/AnimatedGIF.h +216 -0
- package/vendor/stb/stb_image.h +7988 -0
- package/vendor/stb/stb_truetype.h +5079 -0
package/ui/view.h
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
#pragma once
|
|
3
|
+
|
|
4
|
+
#include "node.h"
|
|
5
|
+
|
|
6
|
+
namespace gea::embedded::ui {
|
|
7
|
+
|
|
8
|
+
class ViewElement : public NodeHandle {
|
|
9
|
+
public:
|
|
10
|
+
using NodeHandle::NodeHandle;
|
|
11
|
+
static ViewElement create();
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
} // namespace gea::embedded::ui
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
#include "view.h"
|
|
3
|
+
|
|
4
|
+
#include "tree_internal.h"
|
|
5
|
+
|
|
6
|
+
namespace gea::embedded::ui {
|
|
7
|
+
|
|
8
|
+
ViewElement ViewElement::create()
|
|
9
|
+
{
|
|
10
|
+
return ViewElement(Tree::instance().createView());
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
} // namespace gea::embedded::ui
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
#include "viewport_region.h"
|
|
3
|
+
|
|
4
|
+
#include "display.h"
|
|
5
|
+
#include "internal.h"
|
|
6
|
+
|
|
7
|
+
namespace gea::embedded::ui {
|
|
8
|
+
|
|
9
|
+
int ViewportRegion::clipRect(int width, int height, int *x, int *y, int *w, int *h)
|
|
10
|
+
{
|
|
11
|
+
if (*w <= 0 || *h <= 0 || width <= 0 || height <= 0) return 0;
|
|
12
|
+
int x0 = *x;
|
|
13
|
+
int y0 = *y;
|
|
14
|
+
int x1 = *x + *w - 1;
|
|
15
|
+
int y1 = *y + *h - 1;
|
|
16
|
+
if (x0 < 0) x0 = 0;
|
|
17
|
+
if (y0 < 0) y0 = 0;
|
|
18
|
+
if (x1 >= width) x1 = width - 1;
|
|
19
|
+
if (y1 >= height) y1 = height - 1;
|
|
20
|
+
if (x0 > x1 || y0 > y1) return 0;
|
|
21
|
+
*x = x0;
|
|
22
|
+
*y = y0;
|
|
23
|
+
*w = x1 - x0 + 1;
|
|
24
|
+
*h = y1 - y0 + 1;
|
|
25
|
+
return 1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
void ViewportRegion::replayDisplayRegion(int x, int y, int w, int h)
|
|
29
|
+
{
|
|
30
|
+
if (w <= 0 || h <= 0) return;
|
|
31
|
+
gea::platform::display::Display::pushClip(x, y, w, h);
|
|
32
|
+
DisplayList::instance().replay();
|
|
33
|
+
gea::platform::display::Display::popClip();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
} // namespace gea::embedded::ui
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
#pragma once
|
|
3
|
+
|
|
4
|
+
namespace gea::embedded::ui {
|
|
5
|
+
|
|
6
|
+
class ViewportRegion {
|
|
7
|
+
public:
|
|
8
|
+
static int clipRect(int width, int height, int *x, int *y, int *w, int *h);
|
|
9
|
+
static void replayDisplayRegion(int x, int y, int w, int h);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
} // namespace gea::embedded::ui
|