This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch edje-vector-intergration
in repository efl.

View the commit online.

commit 470f06d9b25343853a38e609bf1db0d6ae97bcc2
Author: [email protected] <[email protected]>
AuthorDate: Mon Apr 27 17:23:25 2026 -0600

    edje: add vector state-animation data model (Task 1.1)
    
    This commit introduces the core in-memory substrate for "Vector Part
    State-Based Animation in Edje": typedefs, enums, structs, and field-mask
    macros for representing hierarchical vector graphics with overrideable
    properties.
    
    The model supports:
    - Edje_Vg_Tree: viewbox + root container
    - Edje_Vg_Node: typed node (shape/container/gradient) with payload
    - Edje_Vg_Stop: gradient stop (offset + color binding)
    - Edje_Vg_Transform: translate/rotate/scale or 3x3 matrix
    - Edje_Vg_Color_Binding: raw RGBA + optional color_class name
    - Edje_Vg_Override: sparse property delta with field_mask + payload
    - Edje_Vg_Directory: per-file trees + class-name index
    - Edje_Vg_Node_Type enum with stable numeric values for Eet on-disk format
    - EDJE_VG_OVR_* macros for override field bits
    
    No consumers yet—this is purely substrate. Phases 1.2–8 will build
    parsers, descriptors, and runtime rendering on top of this model.
    
    Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
---
 src/lib/edje/edje_private.h | 118 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 118 insertions(+)

diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index d7f8ff6a3e..be86feeafe 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -689,6 +689,124 @@ struct _Edje_Vector_Directory_Entry
    Edje_Vector_File_Type type;
 };
 
+/* -----------------------------------------------------------------------
+ * Edje Vector-Graphics (VG) tree data model — spec §8.1
+ * These types represent the in-memory form of a serialized VG tree.
+ * Ownership rules:
+ *   const char * fields — mmap-backed via EET_T_STRING; must NOT be freed.
+ *   double *stroke_dash, Edje_Vg_Stop *stops — heap-allocated by Eet via
+ *   EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY; freed by the descriptor's free pass,
+ *   not by edje code directly.
+ * ----------------------------------------------------------------------- */
+
+typedef struct _Edje_Vg_Color_Binding   Edje_Vg_Color_Binding;
+typedef struct _Edje_Vg_Stop            Edje_Vg_Stop;
+typedef struct _Edje_Vg_Node            Edje_Vg_Node;
+typedef struct _Edje_Vg_Tree            Edje_Vg_Tree;
+typedef struct _Edje_Vg_Override        Edje_Vg_Override;
+typedef struct _Edje_Vg_Directory       Edje_Vg_Directory;
+
+typedef enum {
+   EDJE_VG_NODE_SHAPE           = 0,
+   EDJE_VG_NODE_CONTAINER       = 1,
+   EDJE_VG_NODE_GRADIENT_LINEAR = 2,
+   EDJE_VG_NODE_GRADIENT_RADIAL = 3,
+} Edje_Vg_Node_Type;
+
+struct _Edje_Vg_Color_Binding {
+   unsigned char  r, g, b, a;   /* raw base; non-premul */
+   const char    *color_class;  /* NULL or "" => no class */
+};
+
+struct _Edje_Vg_Stop {
+   double                offset;
+   Edje_Vg_Color_Binding color;
+};
+
+/* Decomposed transform; matrix mode uses the 3x3 array and sets has_matrix. */
+typedef struct {
+   double    tx, ty;
+   double    angle;         /* degrees */
+   double    sx, sy;
+   double    m[9];          /* row-major, only valid when has_matrix */
+   Eina_Bool has_matrix : 1;
+} Edje_Vg_Transform;
+
+struct _Edje_Vg_Node {
+   const char           *name;       /* may be NULL */
+   Edje_Vg_Node_Type     type;
+   Eina_Bool             visible : 1;
+   Edje_Vg_Color_Binding color;      /* node-level multiplicative */
+   Edje_Vg_Transform     xform;
+
+   /* Discriminated payload — only one is valid per `type`. */
+   struct {
+      const char            *path;            /* SVG d-string */
+      Edje_Vg_Color_Binding  fill;
+      Edje_Vg_Color_Binding  stroke_color;
+      double                 stroke_width;
+      double                *stroke_dash;     /* alternating len/gap */
+      unsigned int           stroke_dash_count;
+      const char            *gradient_ref;    /* fill.gradient name; may be NULL */
+      Efl_Gfx_Cap            stroke_cap;
+      Efl_Gfx_Join           stroke_join;
+      Efl_Gfx_Fill_Rule      fill_rule;
+   } shape;
+
+   struct {
+      Eina_List *children;  /* of Edje_Vg_Node*; preserves source order */
+   } container;
+
+   struct {
+      Efl_Gfx_Gradient_Spread spread;
+      double                   x0, y0, x1, y1; /* linear: start/end, radial: center+focal repurposed via flag */
+      double                   radius;          /* radial only */
+      Eina_Bool                is_radial : 1;
+      Edje_Vg_Stop            *stops;
+      unsigned int             stops_count;
+   } gradient;
+};
+
+struct _Edje_Vg_Tree {
+   double        vbx, vby, vbw, vbh;  /* viewbox */
+   Edje_Vg_Node *root;                /* always a CONTAINER */
+};
+
+/* Override field bitmask — keep stable across .edj versions. */
+#define EDJE_VG_OVR_VISIBLE        (1ULL << 0)
+#define EDJE_VG_OVR_COLOR_RAW      (1ULL << 1)
+#define EDJE_VG_OVR_COLOR_CLASS    (1ULL << 2)
+#define EDJE_VG_OVR_TRANSFORM      (1ULL << 3)
+#define EDJE_VG_OVR_PATH           (1ULL << 4)
+#define EDJE_VG_OVR_FILL_RAW       (1ULL << 5)
+#define EDJE_VG_OVR_FILL_CLASS     (1ULL << 6)
+#define EDJE_VG_OVR_STROKE_RAW     (1ULL << 7)
+#define EDJE_VG_OVR_STROKE_CLASS   (1ULL << 8)
+#define EDJE_VG_OVR_STROKE_WIDTH   (1ULL << 9)
+#define EDJE_VG_OVR_STROKE_DASH    (1ULL << 10)
+#define EDJE_VG_OVR_STROKE_CAP     (1ULL << 11)
+#define EDJE_VG_OVR_STROKE_JOIN    (1ULL << 12)
+#define EDJE_VG_OVR_FILL_RULE      (1ULL << 13)
+#define EDJE_VG_OVR_GRAD_GEOM      (1ULL << 14)
+#define EDJE_VG_OVR_GRAD_SPREAD    (1ULL << 15)
+#define EDJE_VG_OVR_GRAD_STOPS     (1ULL << 16)
+
+struct _Edje_Vg_Override {
+   const char         *target_name;
+   Edje_Vg_Node_Type   expected_type;
+   uint64_t            field_mask;
+   Edje_Vg_Node        payload;        /* sparse — only field_mask bits valid */
+};
+
+struct _Edje_Vg_Directory {
+   Edje_Vg_Tree **trees;        /* indexed by tree_id */
+   unsigned int   trees_count;
+   const char   **class_names;  /* flat list of class names referenced */
+   unsigned int   class_names_count;
+};
+
+/* ----------------------------------------------------------------------- */
+
 struct _Edje_Image_Directory_Entry
 {
    const char *entry; /* the nominal name of the image - if any */

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to