From ebdb8e497d9653cf74a4139630ed41b4907478e2 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 16 Feb 2012 21:14:32 +0000 Subject: [PATCH] naviframe now supports content_get SVN revision: 68037 --- legacy/elementary/src/lib/elc_naviframe.c | 18 ++++++++++++++++++ legacy/elementary/src/lib/elc_naviframe.h | 9 ++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/legacy/elementary/src/lib/elc_naviframe.c b/legacy/elementary/src/lib/elc_naviframe.c index e475a76d6e..bbcec7e1ea 100644 --- a/legacy/elementary/src/lib/elc_naviframe.c +++ b/legacy/elementary/src/lib/elc_naviframe.c @@ -59,6 +59,8 @@ static const Evas_Smart_Cb_Description _signals[] = { {NULL, NULL} }; +static Evas_Object *_content_get_hook(const Evas_Object *obj, + const char *part); static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _emit_hook(Evas_Object *obj, @@ -463,6 +465,21 @@ _back_btn_new(Evas_Object *obj) return btn; } +static Evas_Object * +_content_get_hook(const Evas_Object *obj, const char *part) +{ + Widget_Data *wd; + Elm_Naviframe_Item *it; + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + + if (part && strcmp(part, "default")) return NULL; + wd = elm_widget_data_get(obj); + if ((!wd) || (!wd->stack)) return NULL; + it = (Elm_Naviframe_Item *) (EINA_INLIST_CONTAINER_GET(wd->stack->last, + Elm_Naviframe_Item)); + return it->content; +} + static void _title_content_del(void *data, Evas *e __UNUSED__, @@ -1051,6 +1068,7 @@ elm_naviframe_add(Evas_Object *parent) elm_widget_del_hook_set(obj, _del_hook); elm_widget_disable_hook_set(obj, _disable_hook); elm_widget_theme_hook_set(obj, _theme_hook); + elm_widget_content_get_hook_set(obj, _content_get_hook); elm_widget_signal_emit_hook_set(obj, _emit_hook); elm_widget_can_focus_set(obj, EINA_FALSE); elm_widget_focus_next_hook_set(obj, _focus_next_hook); diff --git a/legacy/elementary/src/lib/elc_naviframe.h b/legacy/elementary/src/lib/elc_naviframe.h index 5c56ded1d1..a882035486 100644 --- a/legacy/elementary/src/lib/elc_naviframe.h +++ b/legacy/elementary/src/lib/elc_naviframe.h @@ -14,14 +14,17 @@ * Since each item could keep the different styles, users could keep the * same look & feel for the pages or different styles for the items in it's * application. - * + * + * Default content parts of the naviframe that you can use content hooks for are: + * @li "default" - The main content of the current page + * * Signals that you can add callback for are: * @li "transition,finished" - When the transition is finished in changing * the item * @li "title,clicked" - User clicked title area * - * Default contents parts of the naviframe items that you can use for are: - * @li "default" - A main content of the page + * Default content parts of the naviframe items that you can use content hooks for are: + * @li "default" - The main content of the page * @li "icon" - An icon in the title area * @li "prev_btn" - A button to go to the previous page * @li "next_btn" - A button to go to the next page