elementary/genlist, gengrid - more reviews

SVN revision: 68534
This commit is contained in:
ChunEon Park 2012-02-29 06:22:59 +00:00
parent fd19596e5a
commit ebd409c78a
4 changed files with 83 additions and 66 deletions

View File

@ -1954,7 +1954,7 @@ elm_gengrid_add(Evas_Object *parent)
elm_smart_scroller_object_theme_set(obj, wd->scr, "gengrid", "base",
"default");
elm_smart_scroller_bounce_allow_set(wd->scr, bounce,
_elm_config->thumbscroll_bounce_enable);
_elm_config->thumbscroll_bounce_enable);
elm_widget_resize_object_set(obj, wd->scr);
evas_object_smart_callback_add(wd->scr, "animate,start", _scr_anim_start, obj);
@ -2237,13 +2237,14 @@ elm_gengrid_item_del(Elm_Object_Item *it)
EAPI void
elm_gengrid_horizontal_set(Evas_Object *obj,
Eina_Bool setting)
Eina_Bool horizontal)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (setting == wd->horizontal) return;
wd->horizontal = setting;
horizontal = !!horizontal;
if (horizontal == wd->horizontal) return;
wd->horizontal = horizontal;
/* Update the items to conform to the new layout */
if (wd->calc_job) ecore_job_del(wd->calc_job);
@ -2300,10 +2301,7 @@ elm_gengrid_item_data_set(Elm_Object_Item *it,
EAPI const Elm_Gengrid_Item_Class *
elm_gengrid_item_item_class_get(const Elm_Object_Item *it)
{
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
if (_it->generation < _it->wd->generation) return NULL;
return _it->itc;
return (Elm_Gengrid_Item_Class *) elm_genlist_item_item_class_get(it);
}
EAPI void
@ -2335,7 +2333,7 @@ elm_gengrid_multi_select_set(Evas_Object *obj,
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
wd->multi = multi;
wd->multi = !!multi;
}
EAPI Eina_Bool
@ -2360,10 +2358,7 @@ elm_gengrid_selected_item_get(const Evas_Object *obj)
EAPI const Eina_List *
elm_gengrid_selected_items_get(const Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return NULL;
return wd->selected;
return elm_gengrid_selected_items_get(obj);
}
EAPI void
@ -2571,7 +2566,7 @@ elm_gengrid_reorder_mode_set(Evas_Object *obj,
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
wd->reorder_mode = reorder_mode;
wd->reorder_mode = !!reorder_mode;
}
EAPI Eina_Bool
@ -2787,6 +2782,7 @@ elm_gengrid_item_class_new(void)
return itc;
}
//XXX: notify class version to user if it is mismatched
EAPI void
elm_gengrid_item_class_free(Elm_Gengrid_Item_Class *itc)
{
@ -2802,6 +2798,7 @@ elm_gengrid_item_class_free(Elm_Gengrid_Item_Class *itc)
}
}
//XXX: notify class version to user if it is mismatched
EAPI void
elm_gengrid_item_class_ref(Elm_Gengrid_Item_Class *itc)
{
@ -2812,6 +2809,7 @@ elm_gengrid_item_class_ref(Elm_Gengrid_Item_Class *itc)
}
}
//XXX: notify class version to user if it is mismatched
EAPI void
elm_gengrid_item_class_unref(Elm_Gengrid_Item_Class *itc)
{

View File

@ -585,6 +585,7 @@ EAPI Elm_Object_Item *elm_gengrid_item_sorted_insert(Evas_Object *ob
*
* @ingroup Gengrid
*/
//XXX: should be removed.
EAPI Elm_Object_Item *elm_gengrid_item_direct_sorted_insert(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data);
/**
@ -607,6 +608,7 @@ EAPI Elm_Object_Item *elm_gengrid_item_direct_sorted_insert(Evas_Obj
*
* @ingroup Gengrid
*/
//XXX: How about elm_gengrid_select_mode_set() ?
EAPI void elm_gengrid_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select);
/**
@ -622,6 +624,7 @@ EAPI void elm_gengrid_always_select_mode_set(Evas_Objec
*
* @ingroup Gengrid
*/
//XXX: How about elm_gengrid_select_mode_get() ?
EAPI Eina_Bool elm_gengrid_always_select_mode_get(const Evas_Object *obj);
/**
@ -640,6 +643,7 @@ EAPI Eina_Bool elm_gengrid_always_select_mode_get(const Evas
*
* @ingroup Gengrid
*/
//XXX: elm_gengrid_always_select_mode_set and elm_gengrid_no_select_mode_set API could be merged to elm_genlist_select_mode_set()
EAPI void elm_gengrid_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select);
/**
@ -654,6 +658,7 @@ EAPI void elm_gengrid_no_select_mode_set(Evas_Object *o
*
* @ingroup Gengrid
*/
//XXX: elm_gengrid_always_select_mode_get and elm_gengrid_no_select_mode_get API could be merged to elm_genlist_select_mode_get()
EAPI Eina_Bool elm_gengrid_no_select_mode_get(const Evas_Object *obj);
/**
@ -827,7 +832,7 @@ EAPI void elm_gengrid_page_size_set(Evas_Object *obj, E
EAPI void elm_gengrid_current_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber);
/**
* @brief Get scroll last page number.
* @brief Get gengrid last page number.
*
* @param obj The gengrid object
* @param h_pagenumber The horizontal page number
@ -895,7 +900,7 @@ EAPI void elm_gengrid_page_bring_in(const Evas_Object *
* placing its items.
*
* @param obj The gengrid object.
* @param setting @c EINA_TRUE to make the gengrid expand
* @param horizontal @c EINA_TRUE to make the gengrid expand
* horizontally, @c EINA_FALSE to expand vertically.
*
* When in "horizontal mode" (@c EINA_TRUE), items will be placed
@ -910,7 +915,8 @@ EAPI void elm_gengrid_page_bring_in(const Evas_Object *
*
* @ingroup Gengrid
*/
EAPI void elm_gengrid_horizontal_set(Evas_Object *obj, Eina_Bool setting);
//XXX: elm_gengrid_mode_set()
EAPI void elm_gengrid_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
/**
* Get for what direction a given gengrid widget will expand while
@ -1065,6 +1071,41 @@ EAPI void elm_gengrid_item_pos_get(const Elm_Object_Ite
*/
EAPI void elm_gengrid_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
/**
* Get the selected item in a given gengrid widget
*
* @param obj The gengrid object.
* @return The selected item's handle or @c NULL, if none is
* selected at the moment (and on errors)
*
* This returns the selected item in @p obj. If multi selection is
* enabled on @p obj (@see elm_gengrid_multi_select_set()), only
* the first item in the list is selected, which might not be very
* useful. For that case, see elm_gengrid_selected_items_get().
*
* @ingroup Gengrid
*/
EAPI Elm_Object_Item *elm_gengrid_selected_item_get(const Evas_Object *obj);
/**
* Get <b>a list</b> of selected items in a given gengrid
*
* @param obj The gengrid object.
* @return The list of selected items or @c NULL, if none is
* selected at the moment (and on errors)
*
* This returns a list of the selected items, in the order that
* they appear in the grid. This list is only valid as long as no
* more items are selected or unselected (or unselected implicitly
* by deletion). The list contains #Gengrid item pointers as
* data, naturally.
*
* @see elm_gengrid_selected_item_get()
*
* @ingroup Gengrid
*/
EAPI const Eina_List *elm_gengrid_selected_items_get(const Evas_Object *obj);
/**
* Get whether a given gengrid item is selected or not
*
@ -1099,6 +1140,7 @@ EAPI Eina_Bool elm_gengrid_item_selected_get(const Elm_Objec
*
* @ingroup Gengrid
*/
//XXX: Should be dead.
EAPI const Evas_Object *elm_gengrid_item_object_get(const Elm_Object_Item *it);
/**
@ -1133,6 +1175,8 @@ EAPI void elm_gengrid_item_show(Elm_Object_Item *it);
*/
EAPI void elm_gengrid_item_bring_in(Elm_Object_Item *it);
//XXX: Need to review tooltip & cursor APIs
/**
* Set the text to be shown in a given gengrid item's tooltips.
*
@ -1396,41 +1440,6 @@ EAPI Eina_Bool elm_gengrid_item_cursor_engine_only_get(const
*/
EAPI void elm_gengrid_clear(Evas_Object *obj);
/**
* Get the selected item in a given gengrid widget
*
* @param obj The gengrid object.
* @return The selected item's handle or @c NULL, if none is
* selected at the moment (and on errors)
*
* This returns the selected item in @p obj. If multi selection is
* enabled on @p obj (@see elm_gengrid_multi_select_set()), only
* the first item in the list is selected, which might not be very
* useful. For that case, see elm_gengrid_selected_items_get().
*
* @ingroup Gengrid
*/
EAPI Elm_Object_Item *elm_gengrid_selected_item_get(const Evas_Object *obj);
/**
* Get <b>a list</b> of selected items in a given gengrid
*
* @param obj The gengrid object.
* @return The list of selected items or @c NULL, if none is
* selected at the moment (and on errors)
*
* This returns a list of the selected items, in the order that
* they appear in the grid. This list is only valid as long as no
* more items are selected or unselected (or unselected implicitly
* by deletion). The list contains #Gengrid item pointers as
* data, naturally.
*
* @see elm_gengrid_selected_item_get()
*
* @ingroup Gengrid
*/
EAPI const Eina_List *elm_gengrid_selected_items_get(const Evas_Object *obj);
/**
* Set how the items grid's filled within a given gengrid widget
*
@ -1438,11 +1447,6 @@ EAPI const Eina_List *elm_gengrid_selected_items_get(const Evas_Obj
* @param fill Filled if True
*
* This sets the fill state of the whole grid of items of a gengrid
* within its given viewport. By default, this value is False, meaning
* that if the first line of items grid's aren't filled
*
* Set how the items grid's filled within a given gengrid widget.
* This sets the fill state of the whole grid of items of a gengrid
* within its given viewport. By default, this value is false, meaning
* that if the first line of items grid's isn't filled, the items are
* centered with the alignment
@ -1450,10 +1454,11 @@ EAPI const Eina_List *elm_gengrid_selected_items_get(const Evas_Obj
* @see elm_gengrid_filled_get()
*
* @ingroup Gengrid
*
*/
//XXX: Does this API working well?
EAPI void elm_gengrid_filled_set(Evas_Object *obj, Eina_Bool fill);
/**
* Get how the items grid's filled within a given gengrid widget
*
@ -1468,6 +1473,7 @@ EAPI void elm_gengrid_filled_set(Evas_Object *obj, Eina
*
* @ingroup Gengrid
*/
//XXX: Does this API working well?
EAPI Eina_Bool elm_gengrid_filled_get(const Evas_Object *obj);
#define ELM_GENGRID_ITEM_CLASS_VERSION 2 /* current version number */

View File

@ -5602,6 +5602,7 @@ elm_genlist_item_class_new(void)
return itc;
}
//XXX: notify the class version if it is mismatched
EAPI void
elm_genlist_item_class_free(Elm_Genlist_Item_Class *itc)
{
@ -5617,6 +5618,7 @@ elm_genlist_item_class_free(Elm_Genlist_Item_Class *itc)
}
}
//XXX: notify the class version if it is mismatched
EAPI void
elm_genlist_item_class_ref(Elm_Genlist_Item_Class *itc)
{
@ -5627,6 +5629,7 @@ elm_genlist_item_class_ref(Elm_Genlist_Item_Class *itc)
}
}
//XXX: notify the class version if it is mismatched
EAPI void
elm_genlist_item_class_unref(Elm_Genlist_Item_Class *itc)
{
@ -5695,8 +5698,7 @@ _elm_genlist_current_page_get(const Evas_Object *obj,
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->scr)
elm_smart_scroller_current_page_get(wd->scr, h_pagenumber, v_pagenumber);
elm_smart_scroller_current_page_get(wd->scr, h_pagenumber, v_pagenumber);
}
/* for gengrid as of now */
@ -5708,8 +5710,7 @@ _elm_genlist_last_page_get(const Evas_Object *obj,
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->scr)
elm_smart_scroller_last_page_get(wd->scr, h_pagenumber, v_pagenumber);
elm_smart_scroller_last_page_get(wd->scr, h_pagenumber, v_pagenumber);
}
/* for gengrid as of now */
@ -5721,8 +5722,7 @@ _elm_genlist_page_show(const Evas_Object *obj,
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->scr)
elm_smart_scroller_page_show(wd->scr, h_pagenumber, v_pagenumber);
elm_smart_scroller_page_show(wd->scr, h_pagenumber, v_pagenumber);
}
/* for gengrid as of now */
@ -5734,8 +5734,7 @@ _elm_genlist_page_bring_in(const Evas_Object *obj,
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->scr)
elm_smart_scroller_page_bring_in(wd->scr, h_pagenumber, v_pagenumber);
elm_smart_scroller_page_bring_in(wd->scr, h_pagenumber, v_pagenumber);
}
void

View File

@ -1422,8 +1422,22 @@ EAPI void elm_genlist_item_fields_update(Elm_Object_Ite
* @ingroup Genlist
*/
EAPI void elm_genlist_item_item_class_update(Elm_Object_Item *it, const Elm_Genlist_Item_Class *itc);
/**
* Get the Genlist Item class for the given Genlist Item.
*
* @param it The genlist item
*
* This returns the Genlist_Item_Class for the given item. It can be used to
* examine the function pointers and item_style.
*
* @ingroup Genlist
*/
EAPI const Elm_Genlist_Item_Class *elm_genlist_item_item_class_get(const Elm_Object_Item *it);
//XXX: elm_genlist_item_item_class_set() ?
//XXX: Need to review tooltip & cursor APIs
/**
* Set the text to be shown in a given genlist item's tooltips.
*