Elm Naviframe Item: Migrate to Eo

This commit is contained in:
Daniel Zaoui 2014-09-28 08:15:18 +03:00
parent aaf2ecf9e9
commit 15b23e94f9
5 changed files with 373 additions and 287 deletions

View File

@ -614,7 +614,8 @@ elm_flipselector_item.eo \
elm_menu_item.eo \
elm_ctxpopup_item.eo \
elm_index_item.eo \
elm_multibuttonentry_item.eo
elm_multibuttonentry_item.eo \
elm_naviframe_item.eo
elm_eolian_c = $(elm_eolian_files:%.eo=%.eo.c)
elm_eolian_h = $(elm_eolian_files:%.eo=%.eo.h)
@ -736,7 +737,8 @@ elementaryeolianfiles_DATA = \
elm_menu_item.eo \
elm_ctxpopup_item.eo \
elm_index_item.eo \
elm_multibuttonentry_item.eo
elm_multibuttonentry_item.eo \
elm_naviframe_item.eo
EXTRA_DIST += ${elementaryeolianfiles_DATA}

File diff suppressed because it is too large Load Diff

View File

@ -21,103 +21,18 @@ typedef Eina_Bool (*Elm_Naviframe_Item_Pop_Cb)(void *data, Elm_Object_Item *it);
*/
EAPI Evas_Object *elm_naviframe_add(Evas_Object *parent);
/**
* @brief Pop the items between the top and the above one on the given item.
*
* The items between the top and the given item will be deleted first,
* and then the top item will be popped at last.
*
* @param it The naviframe item
*
* @ingroup Naviframe
*/
EAPI void elm_naviframe_item_pop_to(Elm_Object_Item *it);
/**
* Promote an item already in the naviframe stack to the top of the stack
*
* @param it The naviframe item
*
* This will take the indicated item and promote it to the top of the stack
* as if it had been pushed there. The item must already be inside the
* naviframe stack to work.
*
*/
EAPI void elm_naviframe_item_promote(Elm_Object_Item *it);
/**
* @brief Set an item style
*
* @param it The naviframe item
* @param item_style The current item style name. @c NULL would be default
*
* The following styles are available for this item:
* @li @c "default"
*
* @see also elm_naviframe_item_style_get()
*
* @ingroup Naviframe
*/
EAPI void elm_naviframe_item_style_set(Elm_Object_Item *it, const char *item_style);
/**
* @brief Get an item style
*
* @param it The naviframe item
* @return The current item style name
*
* @see also elm_naviframe_item_style_set()
*
* @ingroup Naviframe
*/
EAPI const char *elm_naviframe_item_style_get(const Elm_Object_Item *it);
/**
* @brief Enable/Disable the title area with transition effect
*
* @param it The naviframe item
* @param enabled If @c EINA_TRUE, title area will be enabled, disabled
* otherwise
* @param transition If @c EINA_TRUE, transition effect of the title will be
* visible, invisible otherwise
*
* When the title area is disabled, then the controls would be hidden so as
* to expand the content area to full-size.
*
* @see also elm_naviframe_item_title_enabled_get()
* @see also elm_naviframe_item_title_visible_set()
*
* @ingroup Naviframe
*/
EAPI void elm_naviframe_item_title_enabled_set(Elm_Object_Item *it, Eina_Bool enabled, Eina_Bool transition);
/**
* @brief Get a value whether title area is enabled or not.
*
* @param it The naviframe item
* @return If @c EINA_TRUE, title area is enabled
*
* @see also elm_naviframe_item_title_enabled_set()
*
* @ingroup Naviframe
*/
EAPI Eina_Bool elm_naviframe_item_title_enabled_get(const Elm_Object_Item *it);
/**
* @brief Set a function to be called when @c it of the naviframe is going to be
* popped.
*
* @param it The item to set the callback on
* @param func the callback function.
* @param data The data to be passed to this @p func call.
*
* @warning Don't set "clicked" callback to the prev button additionally if the
* function does an exact same logic with this @c func. When hardware back key
* is pressed then both callbacks will be called.
*
* @since 1.8
* @ingroup Naviframe
*/
EAPI void elm_naviframe_item_pop_cb_set(Elm_Object_Item *it, Elm_Naviframe_Item_Pop_Cb func, void *data);
Elm_Object_Item *elm_naviframe_item_push(Evas_Object *obj, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style);

View File

@ -0,0 +1,111 @@
class Elm_Naviframe_Item(Elm_Widget_Item)
{
legacy_prefix: null;
eo_prefix: elm_obj_naviframe_item;
properties {
style {
get {
/*@
Get an item style
@see also elm_naviframe_item_style_set()
@ingroup Naviframe
*/
}
set {
/*@
Set an item style
The following styles are available for this item:
@li @c "default"
@see also elm_naviframe_item_style_get()
@ingroup Naviframe
*/
}
values {
const (char) *style; /*@ The current item style name. @c NULL would be default */
}
}
}
methods {
pop_to {
/*@
Pop the items between the top and the above one on the given item.
The items between the top and the given item will be deleted first,
and then the top item will be popped at last.
@ingroup Naviframe
*/
}
title_enabled_get @const {
/*@
Get a value whether title area is enabled or not.
@see also elm_naviframe_item_title_enabled_set()
@ingroup Naviframe
*/
return: bool; /*@ If @c EINA_TRUE, title area will be enabled, disabled otherwise */
}
title_enabled_set {
/*@
Enable/Disable the title area with transition effect
When the title area is disabled, then the controls would be hidden so as
to expand the content area to full-size.
@see also elm_naviframe_item_title_enabled_get()
@see also elm_naviframe_item_title_visible_set()
@ingroup Naviframe
*/
params {
@in Eina_Bool enable; /*@ If @c EINA_TRUE, title area will be enabled, disabled otherwise */
@in Eina_Bool transition; /*@ If @c EINA_TRUE, transition effect of the title will be visible, invisible otherwise */
}
}
promote {
/*@
Promote an item already in the naviframe stack to the top of the stack
This will take the indicated item and promote it to the top of the stack
as if it had been pushed there. The item must already be inside the
naviframe stack to work.
*/
}
pop_cb_set {
/*@
Set a function to be called when @c it of the naviframe is going to be
popped.
@param func the callback function.
@warning Don't set "clicked" callback to the prev button additionally if the
function does an exact same logic with this @c func. When hardware back key
is pressed then both callbacks will be called.
@since 1.8
@ingroup Naviframe
*/
params {
@in Elm_Naviframe_Item_Pop_Cb func; /*@ The callback function */
@in void *data; /*@ Data to be passed to func call */
}
}
}
implements {
Eo.Base.constructor;
Elm_Widget_Item.del_pre;
Elm_Widget_Item.signal_emit;
Elm_Widget_Item.part_text.set;
Elm_Widget_Item.part_text.get;
Elm_Widget_Item.part_content.get;
Elm_Widget_Item.part_content.set;
Elm_Widget_Item.part_content_unset;
}
}

View File

@ -2,6 +2,7 @@
#define ELM_WIDGET_NAVIFRAME_H
#include "Elementary.h"
#include "elm_naviframe_item.eo.h"
/* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR
* CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT
@ -9,6 +10,7 @@
* IT AT RUNTIME.
*/
#include "elm_object_item_migration_temp.h"
/**
* @addtogroup Widget
* @{
@ -37,10 +39,10 @@ struct _Elm_Naviframe_Data
Eina_Bool freeze_events : 1;
};
typedef struct _Elm_Naviframe_Item Elm_Naviframe_Item;
struct _Elm_Naviframe_Item
typedef struct _Elm_Naviframe_Item_Data Elm_Naviframe_Item_Data;
struct _Elm_Naviframe_Item_Data
{
ELM_WIDGET_ITEM;
Elm_Widget_Item_Data *base;
EINA_INLIST;
Eina_Inlist *content_list;
@ -73,7 +75,7 @@ struct _Elm_Naviframe_Content_Item_Pair
EINA_INLIST;
const char *part;
Evas_Object *content;
Elm_Naviframe_Item *it;
Elm_Naviframe_Item_Data *it;
};
typedef struct _Elm_Naviframe_Text_Item_Pair Elm_Naviframe_Text_Item_Pair;
@ -113,11 +115,14 @@ struct _Elm_Naviframe_Text_Item_Pair
return
#define ELM_NAVIFRAME_ITEM_CHECK(it) \
ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, ); \
ELM_NAVIFRAME_CHECK(it->base.widget);
if (EINA_UNLIKELY(!eo_isa((it->base->eo_obj), ELM_NAVIFRAME_ITEM_CLASS))) \
return
#define ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(it, ...) \
ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, __VA_ARGS__); \
ELM_NAVIFRAME_CHECK(it->base.widget) __VA_ARGS__;
#define ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(it, ...) \
if (EINA_UNLIKELY(!eo_isa((it->base->eo_obj), ELM_NAVIFRAME_ITEM_CLASS))) \
return __VA_ARGS__;
#define ELM_NAVIFRAME_ITEM_DATA_GET(o, sd) \
Elm_Naviframe_Item_Data *sd = eo_data_scope_get((Eo *)o, ELM_NAVIFRAME_ITEM_CLASS)
#endif