jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=efac7d523ac4be16e1d81541a887dd847c7d9d2c

commit efac7d523ac4be16e1d81541a887dd847c7d9d2c
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Thu Aug 3 17:23:21 2017 +0900

    edje: Move signal APIs to an interface
    
    This interface will be used by elm_layout as well.
    
    Ref T5315
---
 src/Makefile_Edje.am                           |   1 +
 src/examples/elementary/layout_model_connect.c |   2 +-
 src/lib/edje/Edje_Common.h                     |   3 +-
 src/lib/edje/Edje_Eo.h                         |   1 +
 src/lib/edje/Edje_Legacy.h                     |  58 +++++++++
 src/lib/edje/edje_legacy.c                     |  66 ++++++++++-
 src/lib/edje/edje_message_queue.c              |  13 +--
 src/lib/edje/edje_object.eo                    | 156 ++-----------------------
 src/lib/edje/edje_private.h                    |  14 +--
 src/lib/edje/edje_program.c                    |  97 ++++++---------
 src/lib/edje/edje_signal.c                     |  41 +++----
 src/lib/edje/edje_smart.c                      |   1 +
 src/lib/edje/efl_canvas_layout_signal.eo       | 146 +++++++++++++++++++++++
 src/tests/edje/edje_test_edje.c                |   8 +-
 src/tests/emotion/emotion_test_main-eo.c       |  30 ++---
 15 files changed, 359 insertions(+), 278 deletions(-)

diff --git a/src/Makefile_Edje.am b/src/Makefile_Edje.am
index bf1a7f9a25..15c3f5cdfa 100644
--- a/src/Makefile_Edje.am
+++ b/src/Makefile_Edje.am
@@ -3,6 +3,7 @@
 
 edje_eolian_files = \
        lib/edje/efl_canvas_layout_calc.eo \
+       lib/edje/efl_canvas_layout_signal.eo \
        lib/edje/edje_object.eo \
        lib/edje/efl_canvas_layout_internal.eo \
        lib/edje/efl_canvas_layout_internal_box.eo \
diff --git a/src/examples/elementary/layout_model_connect.c 
b/src/examples/elementary/layout_model_connect.c
index 120ef5f852..b710b49bca 100644
--- a/src/examples/elementary/layout_model_connect.c
+++ b/src/examples/elementary/layout_model_connect.c
@@ -146,7 +146,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
    elm_box_pack_end(bxr, priv->bt);
    elm_object_text_set(priv->bt, "update model");
    evas_object_smart_callback_add(priv->bt, "clicked", _update_cb, priv);
-   edje_obj_signal_callback_add(priv->bt, "test*" , "*", _signal_cb, priv);
+   edje_object_signal_callback_add(priv->bt, "test*" , "*", _signal_cb, priv);
    efl_ui_model_connect(priv->bt, "signal/test-%v", "size");
    evas_object_show(priv->bt);
 
diff --git a/src/lib/edje/Edje_Common.h b/src/lib/edje/Edje_Common.h
index 31b38c7882..cbc40f0e1e 100644
--- a/src/lib/edje/Edje_Common.h
+++ b/src/lib/edje/Edje_Common.h
@@ -89,7 +89,8 @@ struct _Edje_Size_Class
  * @{
  */
 
-typedef void         (*Edje_Signal_Cb)          (void *data, Evas_Object *obj, 
const char *emission, const char *source); /**< Edje signal callback 
functions's prototype definition. @c data will have the auxiliary data pointer 
set at the time the callback registration. @c obj will be a pointer the Edje 
object where the signal comes from. @c emission will identify the exact 
signal's emission string and @c source the exact signal's source one. */
+typedef void (*Efl_Signal_Cb) (void *data, Evas_Object *obj, const char 
*emission, const char *source); /**< Edje signal callback functions's prototype 
definition. @c data will have the auxiliary data pointer set at the time the 
callback registration. @c obj will be a pointer the Edje object where the 
signal comes from. @c emission will identify the exact signal's emission string 
and @c source the exact signal's source one. */
+typedef Efl_Signal_Cb Edje_Signal_Cb;
 
 /**
  * @brief Gets extra data passed to callbacks.
diff --git a/src/lib/edje/Edje_Eo.h b/src/lib/edje/Edje_Eo.h
index 44dd896db0..e59610b2bc 100644
--- a/src/lib/edje/Edje_Eo.h
+++ b/src/lib/edje/Edje_Eo.h
@@ -1,6 +1,7 @@
 #include <Efl.h>
 
 #include "efl_canvas_layout_calc.eo.h"
+#include "efl_canvas_layout_signal.eo.h"
 #include "edje_object.eo.h"
 #include "edje_edit.eo.h"
 
diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h
index 2adee590bf..0ffbc28135 100644
--- a/src/lib/edje/Edje_Legacy.h
+++ b/src/lib/edje/Edje_Legacy.h
@@ -52,6 +52,64 @@
 EAPI Evas_Object *edje_object_add                 (Evas *evas);
 
 /**
+ * @brief Adds a callback for an arriving Edje signal, emitted by a given Edje
+ * object.
+ *
+ * Edje signals are one of the communication interfaces between code and a
+ * given Edje object's theme. With signals, one can communicate two string
+ * values at a time, which are: - "emission" value: the name of the signal, in
+ * general - "source" value: a name for the signal's context, in general
+ *
+ * Though there are those common uses for the two strings, one is free to use
+ * them however they like.
+ *
+ * Signal callback registration is powerful, in the way that  blobs may be used
+ * to match multiple signals at once. All the "*?[\" set of @c fnmatch()
+ * operators can be used, both for emission and source.
+ *
+ * Edje has  internal signals it will emit, automatically, on various actions
+ * taking place on group parts. For example, the mouse cursor being moved,
+ * pressed, released, etc., over a given part's area, all generate individual
+ * signals.
+ *
+ * By using something like edje_object_signal_callback_add(obj, "mouse,down,*",
+ * "button.*", signal_cb, NULL); being @ref "button.*" the pattern for the
+ * names of parts implementing buttons on an interface, you'd be registering
+ * for notifications on events of mouse buttons being pressed down on either of
+ * those parts (those events all have the @"mouse,down," common prefix on their
+ * names, with a suffix giving the button number). The actual emission and
+ * source strings of an event will be passed in as the  emission and  source
+ * parameters of the callback function (e.g. "mouse,down,2" and
+ * @"button.close"), for each of those events.
+ *
+ * @note See @ref edcref "the syntax" for EDC files See also
+ * @ref edje_object_signal_emit() on how to emits Edje signals from code to a
+ * an object @ref edje_object_signal_callback_del_full()
+ *
+ * @param[in] emission The signal's "emission" string
+ * @param[in] source The signal's "source" string
+ * @param[in] func The callback function to be executed when the signal is
+ * emitted.
+ * @param[in] data A pointer to data to pass in to func.
+ */
+EAPI void edje_object_signal_callback_add(Evas_Object *obj, const char 
*emission, const char *source, Edje_Signal_Cb func, void *data);
+
+/**
+ * @brief Sends/emits an Edje signal to a given Edje object
+ *
+ * This function sends a signal to the object  obj. An Edje program, at obj's
+ * EDC specification level, can respond to a signal by having declared matching
+ * @'signal' and @'source' fields on its block (see @ref edcref "the syntax"
+ * for EDC files).
+ *
+ * See also @ref edje_object_signal_callback_add() for more on Edje signals.
+ *
+ * @param[in] emission The signal's "emission" string
+ * @param[in] source The signal's "source" string
+ */
+EAPI void edje_object_signal_emit(Evas_Object *obj, const char *emission, 
const char *source);
+
+/**
  * @brief Removes a signal-triggered callback from an object.
  *
  * @param obj A valid Evas_Object handle.
diff --git a/src/lib/edje/edje_legacy.c b/src/lib/edje/edje_legacy.c
index f41f2f681e..a917903f32 100644
--- a/src/lib/edje/edje_legacy.c
+++ b/src/lib/edje/edje_legacy.c
@@ -51,14 +51,76 @@ edje_object_part_state_get(const Edje_Object *obj, const 
char * part, double *va
 EAPI void
 edje_object_message_signal_process(Edje_Object *obj)
 {
-   edje_obj_message_signal_process(obj, EINA_FALSE);
+   efl_canvas_layout_signal_process(obj, EINA_FALSE);
 }
 
 /* since 1.20 */
 EAPI void
 edje_object_message_signal_recursive_process(Edje_Object *obj)
 {
-   edje_obj_message_signal_process(obj, EINA_TRUE);
+   efl_canvas_layout_signal_process(obj, EINA_TRUE);
+}
+
+EAPI void
+edje_object_signal_callback_add(Evas_Object *obj, const char *emission, const 
char *source, Edje_Signal_Cb func, void *data)
+{
+   efl_canvas_layout_signal_callback_add(obj, emission, source, 
(Efl_Signal_Cb) func, data);
+}
+
+EAPI void *
+edje_object_signal_callback_del_full(Evas_Object *obj, const char *emission, 
const char *source, Edje_Signal_Cb func, void *data)
+{
+   Edje_Signal_Callback_Group *gp;
+   Edje *ed = _edje_fetch(obj);
+   Eina_Bool ok;
+
+   if (!ed || ed->delete_me) return NULL;
+
+   gp = (Edje_Signal_Callback_Group *) ed->callbacks;
+   if (!gp) return NULL;
+
+   emission = eina_stringshare_add(emission);
+   source = eina_stringshare_add(source);
+
+   ok = _edje_signal_callback_disable(gp, emission, source, func, data);
+
+   // Legacy only
+   if (!ok && !data)
+     {
+        for (unsigned i = 0; i < gp->matches->matches_count; ++i)
+          {
+             if (emission == gp->matches->matches[i].signal &&
+                 source == gp->matches->matches[i].source &&
+                 func == gp->matches->matches[i].func &&
+                 !gp->flags[i].delete_me)
+               {
+                  gp->flags[i].delete_me = EINA_TRUE;
+                  //return gp->custom_data[i];
+                  break;
+               }
+          }
+     }
+
+   eina_stringshare_del(emission);
+   eina_stringshare_del(source);
+
+   // Note: This function seems to have returned NULL since ~2013, despite
+   // what the documentation says.
+   return NULL;
+}
+
+EAPI void *
+edje_object_signal_callback_del(Evas_Object *obj, const char *emission, const 
char *source, Edje_Signal_Cb func)
+{
+   // Legacy del_full seems to have been sloppy with NULL data, as that would
+   // match the first callback found. Keeping this legacy behaviour unchanged.
+   return edje_object_signal_callback_del_full(obj, emission, source, func, 
NULL);
+}
+
+EAPI void
+edje_object_signal_emit(Evas_Object *obj, const char *emission, const char 
*source)
+{
+   efl_canvas_layout_signal_emit(obj, emission, source);
 }
 
 EAPI Eina_Bool
diff --git a/src/lib/edje/edje_message_queue.c 
b/src/lib/edje/edje_message_queue.c
index 37e937d194..4e132154ec 100644
--- a/src/lib/edje/edje_message_queue.c
+++ b/src/lib/edje/edje_message_queue.c
@@ -32,7 +32,7 @@ _edje_object_message_propagate_send(Evas_Object *obj, 
Edje_Message_Type type, in
 }
 
 EOLIAN void
-_edje_object_message_send(Eo *obj, Edje *pd EINA_UNUSED, int id, const 
Eina_Value val)
+_edje_object_efl_canvas_layout_signal_message_send(Eo *obj, Edje *pd 
EINA_UNUSED, int id, const Eina_Value val)
 {
    const Eina_Value_Type *valtype;
    Edje_Message_Type msgtype;
@@ -228,22 +228,17 @@ end:
 }
 
 EOLIAN void
-_edje_object_message_signal_process(Eo *obj, Edje *ed, Eina_Bool recurse)
+_edje_object_efl_canvas_layout_signal_signal_process(Eo *obj, Edje *ed, 
Eina_Bool recurse)
 {
-   Edje *sub_ed;
    Eina_List *l;
    Evas_Object *o;
 
+   if (ed->delete_me) return;
    _edje_object_message_signal_process_do(obj, ed);
    if (!recurse) return;
 
    EINA_LIST_FOREACH(ed->subobjs, l, o)
-     {
-        sub_ed = _edje_fetch(o);
-        if (!sub_ed) continue;
-
-        _edje_object_message_signal_process(o, sub_ed, EINA_TRUE);
-     }
+     efl_canvas_layout_signal_process(o, EINA_TRUE);
 }
 
 static Eina_Bool
diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo
index 5aacfa15a8..6f403ba0fe 100644
--- a/src/lib/edje/edje_object.eo
+++ b/src/lib/edje/edje_object.eo
@@ -3,7 +3,8 @@ import edje_types;
 // FIXME: This EO doc needs a direct link to the "edcref" doc
 
 class Edje.Object (Efl.Canvas.Group.Clipped, Efl.File, Efl.Container, Efl.Part,
-                   Efl.Observer, Efl.Ui.Base, Efl.Canvas.Layout_Calc)
+                   Efl.Observer, Efl.Ui.Base, Efl.Canvas.Layout_Calc,
+                   Efl.Canvas.Layout_Signal)
 {
    [[Edje object class]]
    legacy_prefix: edje_object;
@@ -238,154 +239,6 @@ class Edje.Object (Efl.Canvas.Group.Clipped, Efl.File, 
Efl.Container, Efl.Part,
       }
       /* EDJE GROUP DATA APIS END ------------------------------------------ */
 
-      /* MESSAGE & SIGNAL APIS BEGIN --------------------------------------- */
-      message_send {
-         [[Sends an (Edje) message to a given Edje object
-
-           This function sends an Edje message to obj and to all of its
-           child objects, if it has any (swallowed objects are one kind of
-           child object). Only a few types are supported:
-             - int,
-             - float/double,
-             - string/stringshare,
-             - arrays of int, float, double or strings.
-
-           The id argument as a form of code and theme defining a common
-           interface on message communication. One should define the same IDs
-           on both code and EDC declaration, to individualize messages
-           (binding them to a given context).
-         ]]
-         params {
-            @in id: int; [[A identification number for the message to be sent]]
-            @in msg: const(generic_value); [[The message's payload]]
-         }
-         legacy: null;
-      }
-      signal_callback_add {
-         [[Adds a callback for an arriving Edje signal, emitted by
-           a given Edje object.
-
-           Edje signals are one of the communication interfaces between
-            code and a given Edje object's theme. With signals, one can
-           communicate two string values at a time, which are:
-           - "emission" value: the name of the signal, in general
-           - "source" value: a name for the signal's context, in general
-
-           Though there are those common uses for the two strings, one is free
-           to use them however they like.
-
-           Signal callback registration is powerful, in the way that  blobs
-           may be used to match multiple signals at once. All the
-           "*?[\" set of $fnmatch() operators can be used, both for
-           emission and source.
-
-           Edje has  internal signals it will emit, automatically, on
-           various actions taking place on group parts. For example, the mouse
-           cursor being moved, pressed, released, etc., over a given part's
-           area, all generate individual signals.
-
-           By using something like
-           edje_object_signal_callback_add(obj, "mouse,down,*", "button.*",
-           signal_cb, NULL);
-           being \@ref "button.*" the pattern for the names of parts 
implementing
-           buttons on an interface, you'd be registering for notifications on
-           events of mouse buttons being pressed down on either of those parts
-           (those events all have the @"mouse,down," common prefix on their
-           names, with a suffix giving the button number). The actual emission
-           and source strings of an event will be passed in as the  emission
-           and  source parameters of the callback function (e.g.
-           "mouse,down,2" and @"button.close"), for each of those events.
-
-           Note: See \@ref edcref "the syntax" for EDC files
-           See also @.signal_emit() on how to emits Edje signals from
-           code to a an object
-           \@ref edje_object_signal_callback_del_full()]]
-           /* FIXME-doc
-            * This function adds a callback function to a signal emitted by  
obj, to
-            * be issued every time an EDC program like the following
-            * @code
-            * program
-            *   {
-            *      name: "emit_example";
-            *      action: SIGNAL_EMIT "a_signal" "a_source";
-            *   }
-            * @endcode
-            * is run, if emission and source are given those same values,
-            * here.
-            */
-
-         params {
-            @in emission: string; [[The signal's "emission" string]]
-            @in source: string; [[The signal's "source" string]]
-            @in func: Edje.Signal_Cb; [[The callback function to be executed 
when the signal is
-                                        emitted.]]
-            @in data: void_ptr; [[A pointer to data to pass in to func.]]
-         }
-      }
-      signal_callback_del {
-         [[Removes a signal-triggered callback from an object.
-
-           This function removes a callback, previously attached to the
-           emission of a signal, from the object  obj. The parameters
-           emission,  source and  func must match exactly those passed to
-           a previous call to edje_object_signal_callback_add(). The data
-           pointer that was passed to this call will be returned.
-
-           See also @.signal_callback_add().
-           \@ref edje_object_signal_callback_del_full().]]
-
-         legacy: null;
-         return: void_ptr; [[The data pointer]]
-         params {
-            @in emission: string; [[The emission string.]]
-            @in source: string; [[The source string.]]
-            @in func: Edje.Signal_Cb; [[The callback function.]]
-            @in data: void_ptr; [[The callback function.]]
-         }
-      }
-      signal_emit {
-         [[Sends/emits an Edje signal to a given Edje object
-
-           This function sends a signal to the object  obj. An Edje program,
-           at obj's EDC specification level, can respond to a signal by
-           having declared matching @'signal' and @'source' fields on its
-           block (see \@ref edcref "the syntax" for EDC files).
-
-           See also @.signal_callback_add() for more on Edje signals.]]
-           /* FIXME-doc
-            * @code
-            * program
-            *   {
-            *      name: "a_program";
-            *      signal: "a_signal";
-            *      source: "";
-            *      action: ...
-            *   }
-            * @endcode
-            */
-         params {
-            @in emission: string; [[The signal's "emission" string]]
-            @in source: string; [[The signal's "source" string]]
-         }
-      }
-      message_signal_process {
-         [[Processes an object's message queue.
-
-           This function goes through the object message queue processing the
-           pending messages for this specific Edje object. Normally they'd
-           be processed only at idle time.
-
-           If $recurse is $true, this function will be called recursively
-           on all subobjects.
-         ]]
-         params {
-            recurse: bool @optional; [[Whether to process messages on children
-                                       objects.]]
-         }
-         legacy: null;
-      }
-      /* MESSAGE & SIGNAL APIS END ----------------------------------------- */
-
       /* CLASS APIS BEGIN -------------------------------------------------- */
       @property global_color_class @class {
          set {
@@ -1060,6 +913,11 @@ class Edje.Object (Efl.Canvas.Group.Clipped, Efl.File, 
Efl.Container, Efl.Part,
       Efl.Canvas.Layout_Calc.calc_freeze;
       Efl.Canvas.Layout_Calc.calc_thaw;
       Efl.Canvas.Layout_Calc.calc_force;
+      Efl.Canvas.Layout_Signal.message_send;
+      Efl.Canvas.Layout_Signal.signal_callback_add;
+      Efl.Canvas.Layout_Signal.signal_callback_del;
+      Efl.Canvas.Layout_Signal.signal_emit;
+      Efl.Canvas.Layout_Signal.signal_process;
       Efl.Ui.Base.mirrored { set; get; }
       Efl.Ui.Base.language { set; get; }
       Efl.Ui.Base.scale { set; get; }
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 26b85ee19f..139272066e 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -2469,13 +2469,13 @@ void  _edje_callbacks_focus_del(Evas_Object *obj, Edje 
*ed);
 
 const Edje_Signal_Callback_Group *_edje_signal_callback_alloc(void);
 void _edje_signal_callback_free(const Edje_Signal_Callback_Group *cgp);
-void _edje_signal_callback_push(const Edje_Signal_Callback_Group *cgp,
-                                const char *signal, const char *source,
-                                Edje_Signal_Cb func, void *data,
-                                Eina_Bool propagate);
-void *_edje_signal_callback_disable(const Edje_Signal_Callback_Group *cgp,
-                                    const char *signal, const char *source,
-                                    Edje_Signal_Cb func, void *data);
+Eina_Bool _edje_signal_callback_push(Edje_Signal_Callback_Group *cgp,
+                                     const char *signal, const char *source,
+                                     Edje_Signal_Cb func, void *data,
+                                     Eina_Bool propagate);
+Eina_Bool _edje_signal_callback_disable(Edje_Signal_Callback_Group *cgp,
+                                        const char *signal, const char *source,
+                                        Edje_Signal_Cb func, void *data);
 
 EAPI void _edje_edd_init(void);
 EAPI void _edje_edd_shutdown(void);
diff --git a/src/lib/edje/edje_program.c b/src/lib/edje/edje_program.c
index 28b9300ccf..8aeb63e9ab 100644
--- a/src/lib/edje/edje_program.c
+++ b/src/lib/edje/edje_program.c
@@ -226,102 +226,75 @@ _edje_object_transition_duration_factor_get(Eo *obj 
EINA_UNUSED, Edje *pd)
    return pd->duration_scale;
 }
 
-void
-edje_object_propagate_callback_add(Evas_Object *obj, void (*func)(void *data, 
Evas_Object *o, const char *emission, const char *source), void *data)
+static inline Eina_Bool
+_edje_object_signal_callback_add(Edje *ed, const char *emission, const char 
*source, Efl_Signal_Cb func, void *data)
 {
+   Edje_Signal_Callback_Group *gp;
    const char *sig;
    const char *src;
-   Edje *ed;
-
-   ed = _edje_fetch(obj);
-   if (!ed) return;
-   if (ed->delete_me) return;
+   Eina_Bool ok;
 
    if (!ed->callbacks)
      ed->callbacks = _edje_signal_callback_alloc();
-   if (!ed->callbacks) return;
+   if (!ed->callbacks) return EINA_FALSE;
 
-   sig = eina_stringshare_add("*");
-   src = eina_stringshare_add("*");
+   sig = eina_stringshare_add(emission);
+   src = eina_stringshare_add(source);
 
-   if (ed->callbacks)
-     _edje_signal_callback_push(ed->callbacks,
-                                sig, src,
-                                func, data,
-                                EINA_TRUE);
+   gp = (Edje_Signal_Callback_Group *) ed->callbacks;
+   ok = _edje_signal_callback_push(gp, sig, src, func, data, EINA_TRUE);
 
    eina_stringshare_del(sig);
    eina_stringshare_del(src);
+
+   return ok;
 }
 
-EOLIAN void
-_edje_object_signal_callback_add(Eo *obj EINA_UNUSED, Edje *ed, const char 
*emission, const char *source, Edje_Signal_Cb func, void *data)
+void
+edje_object_propagate_callback_add(Evas_Object *obj, Efl_Signal_Cb func, void 
*data)
 {
-   if ((!emission) || (!source) || (!func)) return;
-
-   if (!ed) return;
-   if (ed->delete_me) return;
-
-   emission = eina_stringshare_add(emission);
-   source = eina_stringshare_add(source);
-
-   if (!ed->callbacks)
-     ed->callbacks = _edje_signal_callback_alloc();
-   if (!ed->callbacks) return;
-
-   _edje_signal_callback_push(ed->callbacks,
-                              emission, source,
-                              func, data, EINA_FALSE);
+   Edje *ed;
 
-   eina_stringshare_del(emission);
-   eina_stringshare_del(source);
+   ed = _edje_fetch(obj);
+   if (!ed || ed->delete_me) return;
+   _edje_object_signal_callback_add(ed, "*", "*", func, data);
 }
 
-EAPI void *
-edje_object_signal_callback_del(Evas_Object *obj, const char *emission, const 
char *source, void (*func)(void *data, Evas_Object *o, const char *emission, 
const char *source))
+EOLIAN Eina_Bool
+_edje_object_efl_canvas_layout_signal_signal_callback_add(Eo *obj EINA_UNUSED, 
Edje *ed, const char *emission, const char *source, Efl_Signal_Cb func, void 
*data)
 {
-   if (!obj) return NULL;
-   void *ret = NULL;
-   ret = edje_obj_signal_callback_del(obj, emission, source, 
(Edje_Signal_Cb)func, NULL);
-   return ret;
+   return _edje_object_signal_callback_add(ed, emission, source, func, data);
 }
 
-EOLIAN void *
-_edje_object_signal_callback_del(Eo *obj EINA_UNUSED, Edje *ed, const char 
*emission, const char *source, Edje_Signal_Cb func, void *data)
+EOLIAN Eina_Bool
+_edje_object_efl_canvas_layout_signal_signal_callback_del(Eo *obj EINA_UNUSED, 
Edje *ed, const char *emission, const char *source, Efl_Signal_Cb func, void 
*data)
 {
-   if ((!emission) || (!source) || (!func)) return NULL;
-   if (!ed) return NULL;
-   if (ed->delete_me) return NULL;
+   Edje_Signal_Callback_Group *gp;
+   Eina_Bool ok;
+
+   if (ed->delete_me) return EINA_FALSE;
+   if ((!emission) || (!source) || (!func)) return EINA_FALSE;
+
+   gp = (Edje_Signal_Callback_Group *) ed->callbacks;
+   if (!gp) return EINA_FALSE;
 
    emission = eina_stringshare_add(emission);
    source = eina_stringshare_add(source);
 
-   _edje_signal_callback_disable(ed->callbacks,
-                                 emission, source,
-                                 func, data);
+   ok = _edje_signal_callback_disable(gp, emission, source, func, data);
 
    eina_stringshare_del(emission);
    eina_stringshare_del(source);
 
-   return NULL;
-}
-
-EAPI void *
-edje_object_signal_callback_del_full(Evas_Object *obj, const char *emission, 
const char *source, Edje_Signal_Cb func, void *data)
-{
-   if (!obj) return NULL;
-   void *ret = NULL;
-   ret = edje_obj_signal_callback_del(obj, emission, source, func, data);
-   return ret;
+   return ok;
 }
 
 EOLIAN void
-_edje_object_signal_emit(Eo *obj EINA_UNUSED, Edje *ed, const char *emission, 
const char *source)
+_edje_object_efl_canvas_layout_signal_signal_emit(Eo *obj EINA_UNUSED, Edje 
*ed, const char *emission, const char *source)
 {
-   if ((!emission) || (!source)) return;
-   if (!ed) return;
    if (ed->delete_me) return;
-   _edje_emit(ed, (char *)emission, (char *)source);
+   if ((!emission) || (!source)) return;
+   _edje_emit(ed, emission, source);
 }
 
 /* FIXDOC: Verify/Expand */
diff --git a/src/lib/edje/edje_signal.c b/src/lib/edje/edje_signal.c
index 0e381c17a6..2f4bab3bd6 100644
--- a/src/lib/edje/edje_signal.c
+++ b/src/lib/edje/edje_signal.c
@@ -169,12 +169,11 @@ _edje_signal_callback_grow(Edje_Signal_Callback_Group *gp)
    return gp;
 }
 
-void
-_edje_signal_callback_push(const Edje_Signal_Callback_Group *cgp,
+Eina_Bool
+_edje_signal_callback_push(Edje_Signal_Callback_Group *gp,
                            const char *sig, const char *src,
                            Edje_Signal_Cb func, void *data, Eina_Bool 
propagate)
 {
-   Edje_Signal_Callback_Group *gp = (Edje_Signal_Callback_Group *)cgp;
    unsigned int i;
    Edje_Signal_Callback_Flags flags;
    Edje_Signal_Callback_Matches *tmp;
@@ -195,7 +194,7 @@ _edje_signal_callback_push(const Edje_Signal_Callback_Group 
*cgp,
           {
              _edje_signal_callback_unset(gp, i);
              _edje_signal_callback_set(gp, i, sig, src, func, data, flags);
-             return;
+             return EINA_TRUE;
           }
      }
 
@@ -211,7 +210,7 @@ _edje_signal_callback_push(const Edje_Signal_Callback_Group 
*cgp,
              Edje_Signal_Callback_Matches *tmp_dup =
                (Edje_Signal_Callback_Matches *)
                _edje_signal_callback_matches_dup(tmp);
-             if (!tmp_dup) return;
+             if (!tmp_dup) return EINA_FALSE;
              EINA_REFCOUNT_UNREF(tmp)
                (void) 0; // do nothing because if refcount == 1 handle above.
              gp->matches = tmp = tmp_dup;
@@ -226,7 +225,7 @@ _edje_signal_callback_push(const Edje_Signal_Callback_Group 
*cgp,
           {
              _edje_signal_callback_unset(gp, i);
              _edje_signal_callback_set(gp, i, sig, src, func, data, flags);
-             return;
+             return EINA_TRUE;
           }
      }
 
@@ -234,6 +233,8 @@ _edje_signal_callback_push(const Edje_Signal_Callback_Group 
*cgp,
    // Set propagate and just_added flags
    _edje_signal_callback_set(gp, tmp->matches_count - 1,
                              sig, src, func, data, flags);
+
+   return EINA_TRUE;
 }
 
 const Edje_Signal_Callback_Group *
@@ -300,17 +301,15 @@ _edje_signal_callback_free(const 
Edje_Signal_Callback_Group *cgp)
    free(gp);
 }
 
-void *
-_edje_signal_callback_disable(const Edje_Signal_Callback_Group *cgp,
+Eina_Bool
+_edje_signal_callback_disable(Edje_Signal_Callback_Group *gp,
                               const char *sig, const char *src,
                               Edje_Signal_Cb func, void *data)
 {
-   Edje_Signal_Callback_Group *gp = (Edje_Signal_Callback_Group *)cgp;
    unsigned int i;
 
-   if (!gp || !gp->matches) return NULL;
+   if (!gp || !gp->matches) return EINA_FALSE;
 
-   // FIXME: Shall we check DELETE_ME flags ?
    for (i = 0; i < gp->matches->matches_count; ++i)
      {
         if (sig == gp->matches->matches[i].signal &&
@@ -320,26 +319,12 @@ _edje_signal_callback_disable(const 
Edje_Signal_Callback_Group *cgp,
             !gp->flags[i].delete_me)
           {
              gp->flags[i].delete_me = EINA_TRUE;
-             return gp->custom_data[i];
-          }
-     }
-
-   if (data == NULL)
-     {
-        for (i = 0; i < gp->matches->matches_count; ++i)
-          {
-             if (sig == gp->matches->matches[i].signal &&
-                 src == gp->matches->matches[i].source &&
-                 func == gp->matches->matches[i].func &&
-                 !gp->flags[i].delete_me)
-               {
-                  gp->flags[i].delete_me = EINA_TRUE;
-                  return gp->custom_data[i];
-               }
+             //return gp->custom_data[i];
+             return EINA_TRUE;
           }
      }
 
-   return NULL;
+   return EINA_FALSE;
 }
 
 static void
diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c
index 4a6a76bbca..e33482ad3c 100644
--- a/src/lib/edje/edje_smart.c
+++ b/src/lib/edje/edje_smart.c
@@ -562,3 +562,4 @@ _edje_object_efl_observer_update(Eo *obj EINA_UNUSED, Edje 
*ed, Efl_Object *obs,
 
 #include "edje_object.eo.c"
 #include "efl_canvas_layout_calc.eo.c"
+#include "efl_canvas_layout_signal.eo.c"
diff --git a/src/lib/edje/efl_canvas_layout_signal.eo 
b/src/lib/edje/efl_canvas_layout_signal.eo
new file mode 100644
index 0000000000..a7d971bf9a
--- /dev/null
+++ b/src/lib/edje/efl_canvas_layout_signal.eo
@@ -0,0 +1,146 @@
+/*
+  Edje signaling interface.
+
+  Note: This API must be manually bound in other languages as this uses 
function
+  pointers! This is by design, to keep the API simplhe API simple.
+
+  If function pointers really become allowed in EO this needs to be altered to
+  match that.
+*/
+
+//type Edje.Signal_Cb: __undefined_type; [[Edje signal callback type]]
+
+type Efl.Signal_Cb: __undefined_type; [[Signal callback.]]
+
+interface Efl.Canvas.Layout_Signal
+{
+   [[Layouts asynchronous messaging and signaling interface.
+
+     @since 1.21
+   ]]
+   methods {
+      // FIXME: There is no message_handler in EO!
+      message_send {
+         [[Sends an (Edje) message to a given Edje object
+
+           This function sends an Edje message to obj and to all of its child
+           objects, if it has any (swallowed objects are one kind of child
+           object). Only a few types are supported:
+             - int,
+             - float/double,
+             - string/stringshare,
+             - arrays of int, float, double or strings.
+
+           Messages can go both ways, from code to theme, or theme to code.
+
+           The id argument as a form of code and theme defining a common
+           interface on message communication. One should define the same IDs 
on
+           both code and EDC declaration, to individualize messages (binding
+           them to a given context).
+         ]]
+         params {
+            @in id: int; [[A identification number for the message to be sent]]
+            @in msg: const(generic_value); [[The message's payload]]
+         }
+      }
+      signal_callback_add {
+         [[Adds a callback for an arriving Edje signal, emitted by
+           a given Edje object.
+
+           Edje signals are one of the communication interfaces between code 
and
+           a given Edje object's theme. With signals, one can communicate two
+           string values at a time, which are:
+           - "emission" value: the name of the signal, in general
+           - "source" value: a name for the signal's context, in general
+
+           Signals can go both ways, from code to theme, or theme to code.
+
+           Though there are those common uses for the two strings, one is free
+           to use them however they like.
+
+           Signal callback registration is powerful, in the way that blobs may
+           be used to match multiple signals at once. All the "*?[\" set of
+           $fnmatch() operators can be used, both for emission and source.
+
+           Edje has internal signals it will emit, automatically, on various
+           actions taking place on group parts. For example, the mouse cursor
+           being moved, pressed, released, etc., over a given part's area, all
+           generate individual signals.
+
+           With something like emission = "mouse,down,*", source = "button.*"
+           where "button.*" is the pattern for the names of parts implementing
+           buttons on an interface, you'd be registering for notifications on
+           events of mouse buttons being pressed down on either of those parts
+           (those events all have the "mouse,down," common prefix on their
+           names, with a suffix giving the button number). The actual emission
+           and source strings of an event will be passed in as the emission and
+           source parameters of the callback function (e.g. "mouse,down,2" and
+           "button.close"), for each of those events.
+
+           See also the Edje Data Collection Reference for EDC files.
+
+           See @.signal_emit on how to emit signals from code to a an object
+           See @.signal_callback_del.
+         ]]
+         params {
+            @in emission: string; [[The signal's "emission" string]]
+            @in source: string; [[The signal's "source" string]]
+            @in func: Efl.Signal_Cb;
+               [[The callback function to be executed when the signal is 
emitted.]]
+            @in data: void_ptr; [[A pointer to data to pass to $func.]]
+         }
+         return: bool; [[$true in case of success, $false in case of error.]]
+      }
+      signal_callback_del {
+         [[Removes a signal-triggered callback from an object.
+
+           This function removes a callback, previously attached to the 
emission
+           of a signal, from the object  obj. The parameters emission, source
+           and func must match exactly those passed to a previous call to
+           @.signal_callback_add().
+
+           See @.signal_callback_add.
+         ]]
+         params {
+            @in emission: string; [[The signal's "emission" string]]
+            @in source: string; [[The signal's "source" string]]
+            @in func: Efl.Signal_Cb;
+               [[The callback function to be executed when the signal is 
emitted.]]
+            @in data: void_ptr; [[A pointer to data to pass to $func.]]
+         }
+         return: bool; [[$true in case of success, $false in case of error.]]
+      }
+      signal_emit {
+         [[Sends/emits an Edje signal to this layout.
+
+           This function sends a signal to the object. An Edje program, at the
+           EDC specification level, can respond to a signal by having declared
+           matching "signal" and "source" fields on its block.
+
+           See also the Edje Data Collection Reference for EDC files.
+
+           See @.signal_callback_add() for more on Edje signals.
+         ]]
+         params {
+            @in emission: string; [[The signal's "emission" string]]
+            @in source: string; [[The signal's "source" string]]
+         }
+      }
+      signal_process {
+         [[Processes an object's messages and signals queue.
+
+           This function goes through the object message queue processing the
+           pending messages for this specific Edje object. Normally they'd be
+           processed only at idle time.
+
+           If $recurse is $true, this function will be called recursively on 
all
+           subobjects.
+         ]]
+         // FIXME: Should be $true by default!
+         params {
+            recurse: bool @optional; [[Whether to process messages on children
+                                       objects.]]
+         }
+      }
+   }
+}
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index f7b017566f..efd11db21a 100644
--- a/src/tests/edje/edje_test_edje.c
+++ b/src/tests/edje/edje_test_edje.c
@@ -828,7 +828,7 @@ START_TEST(edje_test_message_send_eo)
 
    eina_value_setup(&v, EINA_VALUE_TYPE_STRING);
    eina_value_set(&v, "hello world");
-   edje_obj_message_send(obj, 0, v);
+   efl_canvas_layout_signal_message_send(obj, 0, v);
    eina_value_flush(&v);
    edje_message_signal_process();
    edje_object_calc_force(obj);
@@ -836,7 +836,7 @@ START_TEST(edje_test_message_send_eo)
 
    eina_value_setup(&v, EINA_VALUE_TYPE_INT);
    eina_value_set(&v, 42);
-   edje_obj_message_send(obj, 1, v);
+   efl_canvas_layout_signal_message_send(obj, 1, v);
    eina_value_flush(&v);
    edje_message_signal_process();
    edje_object_calc_force(obj);
@@ -844,7 +844,7 @@ START_TEST(edje_test_message_send_eo)
 
    eina_value_setup(&v, EINA_VALUE_TYPE_FLOAT);
    eina_value_set(&v, 0.12);
-   edje_obj_message_send(obj, 2, v);
+   efl_canvas_layout_signal_message_send(obj, 2, v);
    eina_value_flush(&v);
    edje_message_signal_process();
    edje_object_calc_force(obj);
@@ -855,7 +855,7 @@ START_TEST(edje_test_message_send_eo)
    eina_value_array_append(va, 12);
    eina_value_array_append(va, 42);
    eina_value_array_append(va, 255);
-   edje_obj_message_send(obj, 3, *va);
+   efl_canvas_layout_signal_message_send(obj, 3, *va);
    eina_value_free(va);
    edje_message_signal_process();
    edje_object_calc_force(obj);
diff --git a/src/tests/emotion/emotion_test_main-eo.c 
b/src/tests/emotion/emotion_test_main-eo.c
index 0848db5fef..0f33f5a7af 100644
--- a/src/tests/emotion/emotion_test_main-eo.c
+++ b/src/tests/emotion/emotion_test_main-eo.c
@@ -434,7 +434,7 @@ video_obj_signal_play_cb(void *data, Evas_Object *o, const 
char *emission EINA_U
 {
    Evas_Object *ov = data;
    emotion_object_play_set(ov, EINA_TRUE);
-   edje_obj_signal_emit(o, "video_state", "play");
+   efl_canvas_layout_signal_emit(o, "video_state", "play");
 }
 
 static void
@@ -442,7 +442,7 @@ video_obj_signal_pause_cb(void *data, Evas_Object *o, const 
char *emission EINA_
 {
    Evas_Object *ov = data;
    emotion_object_play_set(ov, EINA_FALSE);
-   edje_obj_signal_emit(o, "video_state", "pause");
+   efl_canvas_layout_signal_emit(o, "video_state", "pause");
 }
 
 static void
@@ -451,7 +451,7 @@ video_obj_signal_stop_cb(void *data, Evas_Object *o, const 
char *emission EINA_U
    Evas_Object *ov = data;
    emotion_object_play_set(ov, EINA_FALSE);
    emotion_object_position_set(ov, 0.0);
-   edje_obj_signal_emit(o, "video_state", "stop");
+   efl_canvas_layout_signal_emit(o, "video_state", "stop");
 }
 
 static void
@@ -630,22 +630,22 @@ init_video_object(const char *module_filename, const char 
*filename)
 
    efl_event_callback_array_add(o, emotion_object_test_callbacks(), oe);
 
-   edje_obj_signal_callback_add(oe, "video_control", "play", 
video_obj_signal_play_cb, o);
-   edje_obj_signal_callback_add(oe, "video_control", "pause", 
video_obj_signal_pause_cb, o);
-   edje_obj_signal_callback_add(oe, "video_control", "stop", 
video_obj_signal_stop_cb, o);
-   edje_obj_signal_callback_add(oe, "drag", "video_progress", 
video_obj_signal_jump_cb, o);
-   edje_obj_signal_callback_add(oe, "drag", "video_alpha", 
video_obj_signal_alpha_cb, o);
-   edje_obj_signal_callback_add(oe, "drag", "video_volume", 
video_obj_signal_vol_cb, o);
-   edje_obj_signal_callback_add(oe, "frame_move", "start", 
video_obj_signal_frame_move_start_cb, oe);
-   edje_obj_signal_callback_add(oe, "frame_move", "stop", 
video_obj_signal_frame_move_stop_cb, oe);
-   edje_obj_signal_callback_add(oe, "frame_resize", "start", 
video_obj_signal_frame_resize_start_cb, oe);
-   edje_obj_signal_callback_add(oe, "frame_resize", "stop", 
video_obj_signal_frame_resize_stop_cb, oe);
-   edje_obj_signal_callback_add(oe, "mouse, move", "*", 
video_obj_signal_frame_move_cb, oe);
+   efl_canvas_layout_signal_callback_add(oe, "video_control", "play", 
video_obj_signal_play_cb, o);
+   efl_canvas_layout_signal_callback_add(oe, "video_control", "pause", 
video_obj_signal_pause_cb, o);
+   efl_canvas_layout_signal_callback_add(oe, "video_control", "stop", 
video_obj_signal_stop_cb, o);
+   efl_canvas_layout_signal_callback_add(oe, "drag", "video_progress", 
video_obj_signal_jump_cb, o);
+   efl_canvas_layout_signal_callback_add(oe, "drag", "video_alpha", 
video_obj_signal_alpha_cb, o);
+   efl_canvas_layout_signal_callback_add(oe, "drag", "video_volume", 
video_obj_signal_vol_cb, o);
+   efl_canvas_layout_signal_callback_add(oe, "frame_move", "start", 
video_obj_signal_frame_move_start_cb, oe);
+   efl_canvas_layout_signal_callback_add(oe, "frame_move", "stop", 
video_obj_signal_frame_move_stop_cb, oe);
+   efl_canvas_layout_signal_callback_add(oe, "frame_resize", "start", 
video_obj_signal_frame_resize_start_cb, oe);
+   efl_canvas_layout_signal_callback_add(oe, "frame_resize", "stop", 
video_obj_signal_frame_resize_stop_cb, oe);
+   efl_canvas_layout_signal_callback_add(oe, "mouse, move", "*", 
video_obj_signal_frame_move_cb, oe);
    efl_ui_drag_value_set(efl_part(oe, "video_alpha"), 0.0, 1.0);
    efl_text_set(efl_part(oe, "video_alpha_txt"), "alpha 255");
    efl_ui_drag_value_set(efl_part(oe, "video_volume"), 0.0, 0.5);
    efl_text_set(efl_part(oe, "video_volume_txt"), "vol 0.50");
-   edje_obj_signal_emit(oe, "video_state", "play");
+   efl_canvas_layout_signal_emit(oe, "video_state", "play");
    efl_gfx_visible_set(oe, EINA_TRUE);
 }
 

-- 


Reply via email to