Eobj: Added EOBJ_CALLBACK_STOP/CONTINUE macros.
authortasn <tasn>
Mon, 23 Apr 2012 08:09:58 +0000 (08:09 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 23 Apr 2012 08:09:58 +0000 (08:09 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/PROTO/eobj@70408 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

examples/composite_objects/main.c
examples/evas/test.c
examples/signals/simple.c
lib/Eobj.h
lib/eobj.c

index a1101b7..0ebddcd 100644 (file)
@@ -16,7 +16,7 @@ _a_changed_cb(void *data, Eobj *obj, const Eobj_Event_Description *desc, void *e
 
    cb_called = EINA_TRUE;
 
-   return EINA_TRUE;
+   return EOBJ_CALLBACK_CONTINUE;
 }
 
 int
index 0145cbb..c442e90 100644 (file)
@@ -14,7 +14,7 @@ _btn_clicked_cb(void *data, Eobj *obj, const Eobj_Event_Description *desc, void
    const Eobj_Class *klass = eobj_class_get(obj);
    printf("%s obj-type:'%s' data:'%s'\n", desc->name, eobj_class_name_get(klass), (const char *) data);
 
-   return EINA_TRUE;
+   return EOBJ_CALLBACK_CONTINUE;
 }
 
 int
index 5635670..0a23d59 100644 (file)
@@ -42,7 +42,7 @@ _cb_added(void *data, Eobj *obj, const Eobj_Event_Description *desc, void *event
    pd->cb_count++;
 
    printf("Added SIG_A_CHANGED callback to %p. Count: %d\n", obj, pd->cb_count);
-   return EINA_TRUE;
+   return EOBJ_CALLBACK_CONTINUE;
 }
 
 Eina_Bool
@@ -59,7 +59,7 @@ _cb_deled(void *data, Eobj *obj, const Eobj_Event_Description *desc, void *event
    pd->cb_count--;
 
    printf("Removed SIG_A_CHANGED callback from %p. Count: %d\n", obj, pd->cb_count);
-   return EINA_TRUE;
+   return EOBJ_CALLBACK_CONTINUE;
 }
 
 static void
index 46667ff..076a21a 100644 (file)
@@ -626,6 +626,20 @@ EAPI Eina_Bool eobj_composite_is(Eobj *comp_obj);
 typedef short Eobj_Callback_Priority;
 
 /**
+ * @def EOBJ_CALLBACK_STOP
+ * Stop calling callbacks for the even of which the callback was called for.
+ * @see EOBJ_CALLBACK_CONTINUE
+ */
+#define EOBJ_CALLBACK_STOP EINA_FALSE
+
+/**
+ * @def EOBJ_CALLBACK_CONTINUE
+ * Continue calling callbacks for the even of which the callback was called for.
+ * @see EOBJ_CALLBACK_STOP
+ */
+#define EOBJ_CALLBACK_CONTINUE EINA_TRUE
+
+/**
  * @typedef Eobj_Event_Cb
  *
  * An event callback prototype.
@@ -634,7 +648,7 @@ typedef short Eobj_Callback_Priority;
  * @param obj The object which initiated the event.
  * @param desc The event's description.
  * @param event_info additional data passed with the event.
- * @return #EINA_FALSE to stop calling additional callbacks for the event, #EINA_TRUE to continue.
+ * @return #EOBJ_CALLBACK_STOP to stop calling additional callbacks for the event, #EOBJ_CALLBACK_CONTINUE to continue.
  */
 typedef Eina_Bool (*Eobj_Event_Cb)(void *data, Eobj *obj, const Eobj_Event_Description *desc, void *event_info);
 
index 66e233e..8a29264 100644 (file)
@@ -1031,7 +1031,7 @@ _eobj_weak_ref_cb(void *data, Eobj *obj EINA_UNUSED, const Eobj_Event_Descriptio
    Eobj_Weak_Ref *wref = data;
    wref->obj = NULL;
 
-   return EINA_TRUE;
+   return EOBJ_CALLBACK_CONTINUE;
 }
 
 EAPI Eobj_Weak_Ref *