commit 5bb3633478903b1c14f01c7633b9b61a9eced856
authorChunEon Park <chuneon.park@samsung.com>
Fri, 22 Mar 2013 10:13:56 +0000 (19:13 +0900)
committerSungho Kwak <sungho1.kwak@samsung.com>
Wed, 12 Jun 2013 04:13:51 +0000 (13:13 +0900)
Author: ChunEon Park <hermet>@hermet.pe.kr>
Date: Fri Mar 22 19:04:12 2013 +0900

elementary/naviframe - Now item popping can be cancelled if user returns
the EINA_FALSE in the pop_cb().

Change-Id: I5849c47fb7828dbb509f8e63f4a63a5d9ba85d66

src/lib/elc_naviframe.c
src/lib/elc_naviframe.h

index bcd2c6e..6a68c1a 100644 (file)
@@ -1674,7 +1674,10 @@ elm_naviframe_item_pop(Evas_Object *obj)
    it = (Elm_Naviframe_Item *)elm_naviframe_top_item_get(obj);
    if (!it) return NULL;
 
-   if (it->pop_cb) it->pop_cb(it->pop_data, (Elm_Object_Item *)it);
+   if (it->pop_cb)
+     {
+        if (!it->pop_cb(it->pop_data, (Elm_Object_Item *)it)) return NULL;
+     }
 
    if (sd->preserve)
      content = it->content;
index 11d21d6..78809aa 100644 (file)
  * @typedef Elm_Naviframe_Item_Pop_Cb
  *
  * Pop callback called when @c it is going to be popped. @c data is user
- * specific data.
+ * specific data. If it returns the @c EINA_FALSE in the callback, item popping
+ * will be cancelled.
  *
  * @see elm_naviframe_item_pop_cb_set()
  *
  * @since 1.8
  */
-typedef void (*Elm_Naviframe_Item_Pop_Cb)(void *data, Elm_Object_Item *it);
+typedef Eina_Bool (*Elm_Naviframe_Item_Pop_Cb)(void *data, Elm_Object_Item *it);
 
 /**
  * @addtogroup Naviframe