hermet pushed a commit to branch master.
commit 5bb3633478903b1c14f01c7633b9b61a9eced856
Author: ChunEon Park <[email protected]>
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().
---
src/lib/elc_naviframe.c | 7 ++++++-
src/lib/elc_naviframe.h | 5 +++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c
index 6a514c6..e2410f4 100644
--- a/src/lib/elc_naviframe.c
+++ b/src/lib/elc_naviframe.c
@@ -1353,6 +1353,8 @@ _elm_naviframe_smart_event(Eo *obj, void *_pd
EINA_UNUSED, va_list *list)
eo_do(obj, elm_obj_naviframe_top_item_get((Elm_Object_Item **)&it));
if (!it) return;
+ //FIXME: Replace this below code to elm_naviframe_item_pop() at elm 2.0.
+ ///Leave for compatibility.
if (it->title_prev_btn)
evas_object_smart_callback_call(it->title_prev_btn, SIG_CLICKED, NULL);
@@ -1615,7 +1617,10 @@ _item_pop(Eo *obj, void *_pd, va_list *list)
it = (Elm_Naviframe_Item *)elm_naviframe_top_item_get(obj);
if (!it) return;
- 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;
+ }
if (sd->preserve)
content = it->content;
diff --git a/src/lib/elc_naviframe.h b/src/lib/elc_naviframe.h
index 3c4eea8..222ae5a 100644
--- a/src/lib/elc_naviframe.h
+++ b/src/lib/elc_naviframe.h
@@ -290,13 +290,14 @@ enum
* @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
--
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar