New pager smart callback: show,finished.

Plus doxygen love.



SVN revision: 65486
This commit is contained in:
Gustavo Lima Chaves 2011-11-21 15:46:21 +00:00
parent c916a9a3fa
commit 978dedcfa8
2 changed files with 52 additions and 23 deletions

View File

@ -20231,37 +20231,47 @@ extern "C" {
* @image html img/widget/pager/preview-00.png
* @image latex img/widget/pager/preview-00.eps
*
* @brief Widget that allows flipping between 1 or more pages of objects.
* @brief Widget that allows flipping between one or more pages
* of objects.
*
* The flipping between pages of objects is animated. All content in pager
* is kept in a stack, the last content to be added will be on the top of the
* stack(be visible).
* The flipping between pages of objects is animated. All content
* in the pager is kept in a stack, being the last content added
* (visible one) on the top of that stack.
*
* Objects can be pushed or popped from the stack or deleted as normal.
* Pushes and pops will animate (and a pop will delete the object once the
* animation is finished). Any object already in the pager can be promoted to
* the top(from its current stacking position) through the use of
* elm_pager_content_promote(). Objects are pushed to the top with
* elm_pager_content_push() and when the top item is no longer wanted, simply
* pop it with elm_pager_content_pop() and it will also be deleted. If an
* object is no longer needed and is not the top item, just delete it as
* normal. You can query which objects are the top and bottom with
* Objects can be pushed or popped from the stack or deleted as
* well. Pushes and pops will animate the widget accordingly to its
* style (a pop will also delete the child object once the
* animation is finished). Any object already in the pager can be
* promoted to the top (from its current stacking position) through
* the use of elm_pager_content_promote(). New objects are pushed
* to the top with elm_pager_content_push(). When the top item is
* no longer wanted, simply pop it with elm_pager_content_pop() and
* it will also be deleted. If an object is no longer needed and is
* not the top item, just delete it as normal. You can query which
* objects are the top and bottom with
* elm_pager_content_bottom_get() and elm_pager_content_top_get().
*
* Signals that you can add callbacks for are:
* "hide,finished" - when the previous page is hided
* - @c "show,finished" - when a new page is actually shown on the top
* - @c "hide,finished" - when a previous page is hidden
*
* Only after the first of that signals the child object is
* guaranteed to be visible, as in @c evas_object_visible_get().
*
* This widget has the following styles available:
* @li default
* @li fade
* @li fade_translucide
* @li fade_invisible
* @note This styles affect only the flipping animations, the appearance when
* not animating is unaffected by styles.
* - @c "default"
* - @c "fade"
* - @c "fade_translucide"
* - @c "fade_invisible"
*
* @note These styles affect only the flipping animations on the
* default theme; the appearance when not animating is unaffected
* by them.
*
* @ref tutorial_pager gives a good overview of the usage of the API.
* @{
*/
/**
* Add a new pager to the parent
*
@ -20271,6 +20281,7 @@ extern "C" {
* @ingroup Pager
*/
EAPI Evas_Object *elm_pager_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
/**
* @brief Push an object to the top of the pager stack (and show it).
*
@ -20286,6 +20297,7 @@ extern "C" {
* undefined behavior.
*/
EAPI void elm_pager_content_push(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1);
/**
* @brief Pop the object that is on top of the stack
*
@ -20296,6 +20308,7 @@ extern "C" {
* the stack will become visible.
*/
EAPI void elm_pager_content_pop(Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
* @brief Moves an object already in the pager stack to the top of the stack.
*
@ -20311,6 +20324,7 @@ extern "C" {
* results in undefined behavior.
*/
EAPI void elm_pager_content_promote(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1);
/**
* @brief Return the object at the bottom of the pager stack
*
@ -20318,6 +20332,7 @@ extern "C" {
* @return The bottom object or NULL if none
*/
EAPI Evas_Object *elm_pager_content_bottom_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
* @brief Return the object at the top of the pager stack
*

View File

@ -34,9 +34,11 @@ static void _content_del(void *data,
static Eina_List *_item_get(Evas_Object *obj, Evas_Object *content);
static const char SIG_HIDE_FINISHED[] = "hide,finished";
static const char SIG_SHOW_FINISHED[] = "show,finished";
static const Evas_Smart_Cb_Description _signals[] = {
{SIG_HIDE_FINISHED, ""},
{SIG_SHOW_FINISHED, ""},
{NULL, NULL}
};
@ -238,7 +240,17 @@ _resize(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNU
}
static void
_signal_hide_finished(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
_show_finished_cb(void *data, Evas_Object *o __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{
Item *it = data;
Evas_Object *obj = it->obj;
Evas_Object *content = it->content;
evas_object_smart_callback_call(obj, SIG_SHOW_FINISHED, content);
}
static void
_hide_finished_cb(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{
Item *it = data;
Evas_Object *obj2 = it->obj;
@ -333,10 +345,12 @@ elm_pager_content_push(Evas_Object *obj, Evas_Object *content)
"pager",
"base",
elm_widget_style_get(obj));
edje_object_signal_callback_add
(it->base, "elm,action,show,finished", "", _show_finished_cb, it);
edje_object_signal_callback_add(it->base,
"elm,action,hide,finished",
"",
_signal_hide_finished,
_hide_finished_cb,
it);
evas_object_event_callback_add(it->content,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
@ -432,4 +446,4 @@ elm_pager_content_top_get(const Evas_Object *obj)
if (!wd) return NULL;
if (!wd->top) return NULL;
return wd->top->content;
}
}