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 79d8949e4cc44615a94cf6ee4e9cc31e17c40eab
Author: [email protected] <[email protected]>
AuthorDate: Tue Apr 28 12:25:16 2026 -0600
edje: add common node-property statements for vector nodes (Task 2.5)
Register eight universal node properties — name, visible, color, color_class,
and the four transform fields — across all node kinds (shape, container,
gradient_linear, gradient_radial) at all nesting depths via paired macros
VG_NODE_COMMON_STATEMENTS and VG_NODE_ALL_KINDS_STATEMENTS.
This expands to 256 dispatch entries (8 properties × 4 kinds × 4 depths ×
2 toplevel prefixes). The three decomposed transform handlers (translate,
rotate, scale) clear has_matrix to 0 on assignment; transform.matrix sets
it to 1. This enforces symmetric "last-write-wins" — whichever form the EDC
author writes most recently is the one the runtime honours.
Includes Doxygen @property blocks documenting each statement.
Shape-specific properties (path, fill, stroke, fill_rule) follow in Task 2.6;
gradient-specific properties (start, end, radius, stop) in Task 2.7.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
---
src/bin/edje/edje_cc_handlers.c | 214 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 214 insertions(+)
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index 60f320ebad..2b6319b968 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -289,6 +289,14 @@ static void ob_vg_container(void);
static void ob_vg_gradient_linear(void);
static void ob_vg_gradient_radial(void);
static void _vg_close_node(void);
+static void st_vg_node_name(void);
+static void st_vg_node_visible(void);
+static void st_vg_node_color(void);
+static void st_vg_node_color_class(void);
+static void st_vg_node_transform_translate(void);
+static void st_vg_node_transform_rotate(void);
+static void st_vg_node_transform_scale(void);
+static void st_vg_node_transform_matrix(void);
static void ob_filters_filter(void);
static void ob_filters_filter_script(void);
@@ -659,6 +667,27 @@ static void _handle_vector_image(void);
{PREFIX "filters.filter.file", st_filters_filter_file}, \
{PREFIX "filters.filter.name", st_filters_filter_name},
+/* Expands to the eight common-property statement entries for a single
+ * fully-qualified node prefix (e.g. "vectors.vector.shape.").
+ * Valid on every node kind (shape, container, gradient_*). */
+#define VG_NODE_COMMON_STATEMENTS(PFX) \
+ {PFX "name", st_vg_node_name}, /* dup */ \
+ {PFX "visible", st_vg_node_visible}, /* dup */ \
+ {PFX "color", st_vg_node_color}, /* dup */ \
+ {PFX "color_class", st_vg_node_color_class}, /* dup */ \
+ {PFX "transform.translate", st_vg_node_transform_translate}, /* dup */ \
+ {PFX "transform.rotate", st_vg_node_transform_rotate}, /* dup */ \
+ {PFX "transform.scale", st_vg_node_transform_scale}, /* dup */ \
+ {PFX "transform.matrix", st_vg_node_transform_matrix}, /* dup */
+
+/* Expands common statements for all four node kinds at one parent prefix.
+ * PARENT_PFX must end with a dot (e.g. "vectors.vector."). */
+#define VG_NODE_ALL_KINDS_STATEMENTS(PARENT_PFX) \
+ VG_NODE_COMMON_STATEMENTS(PARENT_PFX "shape.") \
+ VG_NODE_COMMON_STATEMENTS(PARENT_PFX "container.") \
+ VG_NODE_COMMON_STATEMENTS(PARENT_PFX "gradient_linear.") \
+ VG_NODE_COMMON_STATEMENTS(PARENT_PFX "gradient_radial.")
+
New_Statement_Handler statement_handlers[] =
{
{"id", st_id},
@@ -671,6 +700,11 @@ New_Statement_Handler statement_handlers[] =
SIZE_CLASS_STATEMENTS("")
{"vectors.vector.name", st_vectors_vector_name},
{"vectors.vector.viewbox", st_vectors_vector_viewbox},
+ /* Task 2.5: common node-property statements — toplevel vectors.vector prefix. */
+ VG_NODE_ALL_KINDS_STATEMENTS("vectors.vector.")
+ VG_NODE_ALL_KINDS_STATEMENTS("vectors.vector.container.")
+ VG_NODE_ALL_KINDS_STATEMENTS("vectors.vector.container.container.")
+ VG_NODE_ALL_KINDS_STATEMENTS("vectors.vector.container.container.container.")
{
"data.item", st_data_item
},
@@ -689,6 +723,11 @@ New_Statement_Handler statement_handlers[] =
SIZE_CLASS_STATEMENTS("collections.")
{"collections.vectors.vector.name", st_vectors_vector_name}, /* dup */
{"collections.vectors.vector.viewbox", st_vectors_vector_viewbox}, /* dup */
+ /* Task 2.5: common node-property statements — collections.vectors.vector prefix. */
+ VG_NODE_ALL_KINDS_STATEMENTS("collections.vectors.vector.")
+ VG_NODE_ALL_KINDS_STATEMENTS("collections.vectors.vector.container.")
+ VG_NODE_ALL_KINDS_STATEMENTS("collections.vectors.vector.container.container.")
+ VG_NODE_ALL_KINDS_STATEMENTS("collections.vectors.vector.container.container.container.")
{
"collections.base_scale", st_collections_base_scale
},
@@ -1594,6 +1633,181 @@ _vg_close_node(void)
current_vg_node = current_vg_tree ? current_vg_tree->root : NULL;
}
+/**
+ * @page edcref
+ * @property
+ * name
+ * @parameters
+ * [string]
+ * @effect
+ * Assigns a unique identifier string to this vector node. The name is
+ * used to target the node from per-description overrides and runtime
+ * lookups. Must be unique within the containing vector tree.
+ * @endproperty
+ */
+static void
+st_vg_node_name(void)
+{
+ check_arg_count(1);
+ if (!current_vg_node) error_and_abort(NULL, "name: outside node");
+ char *s = parse_str(0);
+ eina_stringshare_replace(¤t_vg_node->name, s);
+ free(s);
+}
+
+/**
+ * @page edcref
+ * @property
+ * visible
+ * @parameters
+ * [0 or 1]
+ * @effect
+ * Controls the initial visibility of the node. 0 hides the node and
+ * all its children; 1 (default) makes it visible.
+ * @endproperty
+ */
+static void
+st_vg_node_visible(void)
+{
+ check_arg_count(1);
+ if (!current_vg_node) error_and_abort(NULL, "visible: outside node");
+ current_vg_node->visible = parse_bool(0) ? 1 : 0;
+}
+
+/**
+ * @page edcref
+ * @property
+ * color
+ * @parameters
+ * [red] [green] [blue] [alpha]
+ * @effect
+ * Multiplicative RGBA color applied to this node and its subtree.
+ * Each channel is an integer in [0, 255]. Default is 255 255 255 255
+ * (fully opaque white — identity multiply). Stored as raw non-premul
+ * values; no alpha premultiplication is performed at parse time.
+ * @endproperty
+ */
+static void
+st_vg_node_color(void)
+{
+ check_arg_count(4);
+ if (!current_vg_node) error_and_abort(NULL, "color: outside node");
+ current_vg_node->color.r = parse_int_range(0, 0, 255);
+ current_vg_node->color.g = parse_int_range(1, 0, 255);
+ current_vg_node->color.b = parse_int_range(2, 0, 255);
+ current_vg_node->color.a = parse_int_range(3, 0, 255);
+}
+
+/**
+ * @page edcref
+ * @property
+ * color_class
+ * @parameters
+ * [string]
+ * @effect
+ * Associates a color class with this node's multiplicative color slot.
+ * When a color class is set the runtime replaces the node's base color
+ * with the class's resolved value, enabling theme-time color overrides.
+ * @endproperty
+ */
+static void
+st_vg_node_color_class(void)
+{
+ check_arg_count(1);
+ if (!current_vg_node) error_and_abort(NULL, "color_class: outside node");
+ char *s = parse_str(0);
+ eina_stringshare_replace(¤t_vg_node->color.color_class, s);
+ free(s);
+}
+
+/**
+ * @page edcref
+ * @property
+ * transform.translate
+ * @parameters
+ * [x] [y]
+ * @effect
+ * Translation component of the node's local transform, in viewbox units.
+ * Applied after scale and rotate. Mutually exclusive with
+ * transform.matrix: the last written property wins; the runtime uses
+ * has_matrix to decide which form to honour.
+ * @endproperty
+ */
+static void
+st_vg_node_transform_translate(void)
+{
+ check_arg_count(2);
+ if (!current_vg_node) error_and_abort(NULL, "transform.translate: outside node");
+ current_vg_node->xform.tx = parse_float(0);
+ current_vg_node->xform.ty = parse_float(1);
+ current_vg_node->xform.has_matrix = 0;
+}
+
+/**
+ * @page edcref
+ * @property
+ * transform.rotate
+ * @parameters
+ * [degrees]
+ * @effect
+ * Rotation angle in degrees (clockwise) around the node's local origin.
+ * Mutually exclusive with transform.matrix.
+ * @endproperty
+ */
+static void
+st_vg_node_transform_rotate(void)
+{
+ check_arg_count(1);
+ if (!current_vg_node) error_and_abort(NULL, "transform.rotate: outside node");
+ current_vg_node->xform.angle = parse_float(0);
+ current_vg_node->xform.has_matrix = 0;
+}
+
+/**
+ * @page edcref
+ * @property
+ * transform.scale
+ * @parameters
+ * [sx] [sy]
+ * @effect
+ * Per-axis scale factors for the node's local transform. Default is
+ * 1.0 1.0 (identity). Mutually exclusive with transform.matrix.
+ * @endproperty
+ */
+static void
+st_vg_node_transform_scale(void)
+{
+ check_arg_count(2);
+ if (!current_vg_node) error_and_abort(NULL, "transform.scale: outside node");
+ current_vg_node->xform.sx = parse_float(0);
+ current_vg_node->xform.sy = parse_float(1);
+ current_vg_node->xform.has_matrix = 0;
+}
+
+/**
+ * @page edcref
+ * @property
+ * transform.matrix
+ * @parameters
+ * [m11] [m12] [m13] [m21] [m22] [m23] [m31] [m32] [m33]
+ * @effect
+ * Explicit row-major 3x3 affine matrix for the node's local transform.
+ * When present (has_matrix == 1) the runtime ignores the decomposed
+ * translate/rotate/scale fields. Mutually exclusive with the decomposed
+ * form: last-write-wins at parse time; the runtime honours has_matrix.
+ * @endproperty
+ */
+static void
+st_vg_node_transform_matrix(void)
+{
+ check_arg_count(9);
+ if (!current_vg_node) error_and_abort(NULL, "transform.matrix: outside node");
+ int i;
+ for (i = 0; i < 9; i++)
+ current_vg_node->xform.m[i] = parse_float(i);
+ current_vg_node->xform.has_matrix = 1;
+}
+
#define PROGRAM_OBJECTS(PREFIX) \
{PREFIX ".program", ob_collections_group_programs_program}, /* dup */ \
{PREFIX ".program.script", ob_collections_group_programs_program_script}, /* dup */ \
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.