@elurjs/universal 0.1.9 → 0.1.11

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 (58) hide show
  1. package/cli/create-app.mjs +15 -8
  2. package/cli/dev.mjs +45 -16
  3. package/cli/doctor.mjs +40 -14
  4. package/cli/elur.mjs +18 -4
  5. package/docs/INSTALACION-Y-DEV.md +13 -6
  6. package/package.json +5 -1
  7. package/targets/linux/CMakeLists.txt +196 -0
  8. package/targets/linux/README.md +422 -0
  9. package/targets/linux/ci/tsan.supp +15 -0
  10. package/targets/linux/generated/elur_module_registrar.cpp +14 -0
  11. package/targets/linux/generated/module_sources.cmake +5 -0
  12. package/targets/linux/src/elur_applicator.cpp +5073 -0
  13. package/targets/linux/src/elur_applicator.h +387 -0
  14. package/targets/linux/src/elur_clip.cpp +76 -0
  15. package/targets/linux/src/elur_clip.h +23 -0
  16. package/targets/linux/src/elur_crypto_module.cpp +121 -0
  17. package/targets/linux/src/elur_events.h +57 -0
  18. package/targets/linux/src/elur_fonts.cpp +106 -0
  19. package/targets/linux/src/elur_fonts.h +31 -0
  20. package/targets/linux/src/elur_host.cpp +1041 -0
  21. package/targets/linux/src/elur_host.h +66 -0
  22. package/targets/linux/src/elur_http_module.cpp +437 -0
  23. package/targets/linux/src/elur_js.h +40 -0
  24. package/targets/linux/src/elur_modules.cpp +453 -0
  25. package/targets/linux/src/elur_modules.h +159 -0
  26. package/targets/linux/src/elur_renderer.h +46 -0
  27. package/targets/linux/src/elur_shot.cpp +64 -0
  28. package/targets/linux/src/elur_shot.h +17 -0
  29. package/targets/linux/src/elur_skia_a11y.cpp +987 -0
  30. package/targets/linux/src/elur_skia_a11y.h +146 -0
  31. package/targets/linux/src/elur_skia_app.cpp +1770 -0
  32. package/targets/linux/src/elur_skia_app.h +18 -0
  33. package/targets/linux/src/elur_state_module.cpp +99 -0
  34. package/targets/linux/src/elur_tck_module.cpp +186 -0
  35. package/targets/linux/src/elur_ui_module.cpp +84 -0
  36. package/targets/linux/src/elur_yoga.cpp +452 -0
  37. package/targets/linux/src/elur_yoga.h +95 -0
  38. package/targets/linux/src/main.cpp +294 -0
  39. package/targets/windows/Package.appxmanifest +28 -0
  40. package/targets/windows/README.md +44 -0
  41. package/targets/windows/elur-windows.vcxproj +133 -0
  42. package/targets/windows/packages.config +10 -0
  43. package/targets/windows/src/elur_crypto_module_win.cpp +106 -0
  44. package/targets/windows/src/elur_events.h +58 -0
  45. package/targets/windows/src/elur_host_win.cpp +645 -0
  46. package/targets/windows/src/elur_host_win.h +75 -0
  47. package/targets/windows/src/elur_http_module_win.cpp +331 -0
  48. package/targets/windows/src/elur_js.h +40 -0
  49. package/targets/windows/src/elur_modules.cpp +460 -0
  50. package/targets/windows/src/elur_modules.h +159 -0
  51. package/targets/windows/src/elur_state_module.cpp +99 -0
  52. package/targets/windows/src/elur_ui_module_win.cpp +75 -0
  53. package/targets/windows/src/elur_uia_host.h +129 -0
  54. package/targets/windows/src/elur_win_applicator.cpp +3118 -0
  55. package/targets/windows/src/elur_win_applicator.h +186 -0
  56. package/targets/windows/src/elur_yoga.cpp +452 -0
  57. package/targets/windows/src/elur_yoga.h +95 -0
  58. package/targets/windows/src/main.cpp +321 -0
@@ -0,0 +1,64 @@
1
+ #include "elur_shot.h"
2
+ #include <gtk/gtkwidgetpaintable.h>
3
+
4
+ namespace elur {
5
+ namespace {
6
+
7
+ struct ShotCtx {
8
+ GtkWidget *window;
9
+ std::string path;
10
+ };
11
+
12
+ gboolean doShot(gpointer data) {
13
+ ShotCtx *ctx = static_cast<ShotCtx *>(data);
14
+ // Snapshot sobre la VENTANA — gtk_widget_paintable_new del child
15
+ // (GtkFixed) no graba hijos vía paintable; el de la window sí.
16
+ GtkWidget *w_ = ctx->window;
17
+ int w = gtk_widget_get_width(w_);
18
+ int h = gtk_widget_get_height(w_);
19
+ if (w <= 0 || h <= 0) {
20
+ g_warning("[shot] child %dx%d — sin caja aún", w, h);
21
+ delete ctx;
22
+ return G_SOURCE_REMOVE;
23
+ }
24
+ // GtkWidgetPaintable dispara el snapshot/draw real del widget
25
+ // (en skia corre el draw_func — captura el raster Skia tal cual).
26
+ GdkPaintable *paintable = gtk_widget_paintable_new(w_);
27
+ GtkSnapshot *snap = gtk_snapshot_new();
28
+ gdk_paintable_snapshot(paintable, snap, w, h);
29
+ g_object_unref(paintable);
30
+ GskRenderNode *node = gtk_snapshot_free_to_node(snap);
31
+ if (node) {
32
+ GdkSurface *surface = gtk_native_get_surface(GTK_NATIVE(w_));
33
+ GskRenderer *renderer = gsk_renderer_new_for_surface(surface);
34
+ graphene_rect_t bounds;
35
+ graphene_rect_init(&bounds, 0, 0, (float)w, (float)h);
36
+ GdkTexture *tex = gsk_renderer_render_texture(renderer, node, &bounds);
37
+ if (tex) {
38
+ gdk_texture_save_to_png(tex, ctx->path.c_str());
39
+ g_message("[shot] %s (%dx%d)", ctx->path.c_str(), w, h);
40
+ g_object_unref(tex);
41
+ } else {
42
+ g_warning("[shot] render_texture devolvió null");
43
+ }
44
+ gsk_renderer_unrealize(renderer);
45
+ g_object_unref(renderer);
46
+ gsk_render_node_unref(node);
47
+ } else {
48
+ g_warning("[shot] snapshot vacío");
49
+ }
50
+ // Cierre limpio: baja la ventana → el main loop sale y corre
51
+ // hostShutdown (mismo camino que el cierre por usuario).
52
+ gtk_window_close(GTK_WINDOW(w_));
53
+ delete ctx;
54
+ return G_SOURCE_REMOVE;
55
+ }
56
+
57
+ } // namespace
58
+
59
+ void scheduleShot(GtkWidget *window, const std::string &path, int delayMs) {
60
+ ShotCtx *ctx = new ShotCtx{window, path};
61
+ g_timeout_add(delayMs > 0 ? (guint)delayMs : 900, doShot, ctx);
62
+ }
63
+
64
+ } // namespace elur
@@ -0,0 +1,17 @@
1
+ // elur_shot.h — captura PNG de la ventana tras el boot (--shot).
2
+ // Renderer-agnóstico: snapshot del widget raíz (GtkFixed con sus
3
+ // widgets en views; GtkDrawingArea ejecutando su draw_func en skia) →
4
+ // GdkTexture vía GskRenderer → gdk_texture_save_to_png. Sirve de
5
+ // evidencia pixel-parity del carril Skia contra el path de views.
6
+ #pragma once
7
+
8
+ #include <gtk/gtk.h>
9
+ #include <string>
10
+
11
+ namespace elur {
12
+
13
+ // Agenda la captura a `path` tras `delayMs` del arranque y cierra la
14
+ // app (ventana → quit del main loop).
15
+ void scheduleShot(GtkWidget *window, const std::string &path, int delayMs);
16
+
17
+ } // namespace elur