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

git pushed a commit to branch master
in repository efl.

View the commit online.

commit 70f64d95ef90336139cdcc2baa1b65cffeff41ca
Author: Cedric BAIL <[email protected]>
AuthorDate: Sat Nov 7 23:08:40 2026 -0600

    edje: a message takes an integer of any width when it fits
    
    efl_layout_signal_message_send accepted only a 32 bit INT as an integer
    message; any other integer type was logged as unsupported and dropped.
    A binding with one 64 bit integer type could therefore never send one.
    An integer of another width is now converted to an int when it fits, and
    refused with a message when it does not.
    
    An empty value is still refused, and no longer hands NULL to
    eina_value_type_name_get() to say so.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 src/lib/edje/edje_message_queue.c | 24 +++++++++++++++++++++++-
 src/tests/edje/edje_test_signal.c | 37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+), 1 deletion(-)

diff --git a/src/lib/edje/edje_message_queue.c b/src/lib/edje/edje_message_queue.c
index 75088c1f4b..f838d19b29 100644
--- a/src/lib/edje/edje_message_queue.c
+++ b/src/lib/edje/edje_message_queue.c
@@ -105,6 +105,28 @@ _efl_canvas_layout_efl_layout_signal_message_send(Eo *obj, Edje *pd EINA_UNUSED,
         eina_value_get(&val, &msg.i.val);
         msgtype = EDJE_MESSAGE_INT;
      }
+   else if ((valtype == EINA_VALUE_TYPE_UCHAR) || (valtype == EINA_VALUE_TYPE_CHAR) ||
+            (valtype == EINA_VALUE_TYPE_USHORT) || (valtype == EINA_VALUE_TYPE_SHORT) ||
+            (valtype == EINA_VALUE_TYPE_UINT) || (valtype == EINA_VALUE_TYPE_LONG) ||
+            (valtype == EINA_VALUE_TYPE_ULONG) || (valtype == EINA_VALUE_TYPE_INT64) ||
+            (valtype == EINA_VALUE_TYPE_UINT64))
+     {
+        /* An integer of any other width is an int when it fits: a binding
+         * that has only one integer type of 64 bits sends this. */
+        Eina_Value as_int;
+        Eina_Bool ok;
+
+        ok = eina_value_setup(&as_int, EINA_VALUE_TYPE_INT) &&
+          eina_value_convert(&val, &as_int) &&
+          eina_value_get(&as_int, &msg.i.val);
+        eina_value_flush(&as_int);
+        if (!ok)
+          {
+             ERR("The integer value does not fit in an int.");
+             return;
+          }
+        msgtype = EDJE_MESSAGE_INT;
+     }
    else if (valtype == EINA_VALUE_TYPE_FLOAT)
      {
         float f;
@@ -172,7 +194,7 @@ _efl_canvas_layout_efl_layout_signal_message_send(Eo *obj, Edje *pd EINA_UNUSED,
 bad_type:
    ERR("Unsupported value type: %s. Only primitives types int, real "
        "(float or double), string or arrays of those types are supported.",
-       eina_value_type_name_get(valtype));
+       valtype ? eina_value_type_name_get(valtype) : "empty");
    return;
 }
 
diff --git a/src/tests/edje/edje_test_signal.c b/src/tests/edje/edje_test_signal.c
index 536c7987a8..4f332a50a3 100644
--- a/src/tests/edje/edje_test_signal.c
+++ b/src/tests/edje/edje_test_signal.c
@@ -153,6 +153,42 @@ EFL_START_TEST(edje_test_message_send_eo)
 }
 EFL_END_TEST
 
+EFL_START_TEST(edje_test_message_send_wide_int)
+{
+   Evas *evas;
+   Evas_Object *obj;
+   Eina_Value v;
+   int id = 0;
+
+   evas = _setup_evas();
+
+   obj = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
+                 efl_file_set(efl_added, test_layout_get("test_messages.edj")),
+                 efl_file_key_set(efl_added, "test_group"));
+   edje_object_signal_callback_add(obj, "*", "edc", _message_signal_reply_cb, &id);
+
+   /* an integer of 64 bits that fits is an int message */
+   eina_value_setup(&v, EINA_VALUE_TYPE_INT64);
+   eina_value_set(&v, (int64_t)42);
+   efl_layout_signal_message_send(obj, 1, v);
+   eina_value_flush(&v);
+   edje_message_signal_process();
+   edje_object_calc_force(obj);
+   ck_assert_int_eq(id, 1);
+
+   /* one that does not is refused, not truncated */
+   eina_value_setup(&v, EINA_VALUE_TYPE_INT64);
+   eina_value_set(&v, (int64_t)1 << 40);
+   efl_layout_signal_message_send(obj, 1, v);
+   eina_value_flush(&v);
+   edje_message_signal_process();
+   edje_object_calc_force(obj);
+   ck_assert_int_eq(id, 1);
+
+   efl_del(obj);
+}
+EFL_END_TEST
+
 EFL_START_TEST(edje_test_signals)
 {
    Evas *evas;
@@ -300,6 +336,7 @@ void edje_test_signal(TCase *tc)
 {
    tcase_add_test(tc, edje_test_message_send_legacy);
    tcase_add_test(tc, edje_test_message_send_eo);
+   tcase_add_test(tc, edje_test_message_send_wide_int);
    tcase_add_test(tc, edje_test_signals);
    tcase_add_test(tc, edje_test_signal_callback_del_full);
    tcase_add_test(tc, edje_test_signal_callback_free_once);

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

Reply via email to