2015-05-20 04:15:49 -07:00
|
|
|
import elm_general;
|
|
|
|
|
2015-04-22 04:43:05 -07:00
|
|
|
class Elm.Gengrid_Item(Elm.Widget_Item)
|
2014-09-27 22:15:37 -07:00
|
|
|
{
|
|
|
|
eo_prefix: elm_obj_gengrid_item;
|
|
|
|
data: Elm_Gen_Item;
|
2015-05-07 09:32:53 -07:00
|
|
|
methods {
|
|
|
|
@property prev {
|
2014-09-27 22:15:37 -07:00
|
|
|
get {
|
|
|
|
/*@
|
|
|
|
Get the @b previous item in a gengrid widget's internal list of items,
|
|
|
|
given a handle to one of those items.
|
|
|
|
|
|
|
|
This returns the item placed before the @p item, on the container
|
|
|
|
gengrid.
|
|
|
|
|
|
|
|
@see elm_gengrid_item_next_get()
|
|
|
|
|
|
|
|
@ingroup Gengrid
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
values {
|
2015-05-18 08:16:08 -07:00
|
|
|
item: Elm_Object_Item *; /*@ @return The item before @p item, or @c NULL if there's none (and on errors) */
|
2014-09-27 22:15:37 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property next {
|
2014-09-27 22:15:37 -07:00
|
|
|
get {
|
|
|
|
/*@
|
|
|
|
Get the @b next item in a gengrid widget's internal list of items,
|
|
|
|
given a handle to one of those items.
|
|
|
|
|
|
|
|
This returns the item placed after the @p item, on the container
|
|
|
|
gengrid.
|
|
|
|
|
|
|
|
@see elm_gengrid_item_prev_get()
|
|
|
|
|
|
|
|
@ingroup Gengrid
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
values {
|
2015-05-18 08:16:08 -07:00
|
|
|
item: Elm_Object_Item *; /*@ @return The item after @p item, or @c NULL if there's none (and on errors) */
|
2014-09-27 22:15:37 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property selected {
|
2014-09-27 22:15:37 -07:00
|
|
|
get {
|
|
|
|
/*@
|
|
|
|
Get whether a given gengrid item is selected or not
|
|
|
|
|
|
|
|
This API returns EINA_TRUE for all the items selected in multi-select mode as well.
|
|
|
|
|
|
|
|
@see elm_gengrid_item_selected_set() for more details
|
|
|
|
|
|
|
|
@ingroup Gengrid
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
set {
|
|
|
|
/*@
|
|
|
|
Set whether a given gengrid item is selected or not
|
|
|
|
|
|
|
|
This sets the selected state of an item. If multi-selection is
|
|
|
|
not enabled on the containing gengrid and @p selected is @c
|
|
|
|
EINA_TRUE, any other previously selected items will get
|
|
|
|
unselected in favor of this new one.
|
|
|
|
|
|
|
|
@see elm_gengrid_item_selected_get()
|
|
|
|
|
|
|
|
@ingroup Gengrid
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
values {
|
2015-05-18 08:27:18 -07:00
|
|
|
selected: bool; /*@ the selected state (@c EINA_TRUE selected, @c EINA_FALSE not selected) */
|
2014-09-27 22:15:37 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property item_class {
|
2014-09-27 22:15:37 -07:00
|
|
|
get {
|
|
|
|
/*@
|
|
|
|
Get the Gengrid Item class for the given Gengrid Item.
|
|
|
|
|
|
|
|
This returns the Gengrid_Item_Class for the given item. It can be used to examine
|
|
|
|
the function pointers and item_style.
|
|
|
|
|
|
|
|
@ingroup Gengrid
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
values {
|
2015-05-18 08:16:08 -07:00
|
|
|
itc: const (Elm_Gengrid_Item_Class) *; /*@ Gengrid Item class for the given item */
|
2014-09-27 22:15:37 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property index {
|
2014-09-27 22:15:37 -07:00
|
|
|
get {
|
|
|
|
/*@
|
|
|
|
Get the index of the item. It is only valid once displayed.
|
|
|
|
|
|
|
|
@ingroup Gengrid
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
values {
|
2015-05-18 08:16:08 -07:00
|
|
|
index: int(-1); /*@ @return the position inside the list of item. */
|
2014-09-27 22:15:37 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property pos {
|
2014-09-27 22:15:37 -07:00
|
|
|
get {
|
|
|
|
/*@
|
|
|
|
Get a given gengrid item's position, relative to the whole
|
|
|
|
gengrid's grid area.
|
|
|
|
|
|
|
|
This returns the "logical" position of the item within the
|
|
|
|
gengrid. For example, @c (0, 1) would stand for first row,
|
|
|
|
second column.
|
|
|
|
|
|
|
|
@ingroup Gengrid
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
values {
|
2015-05-18 08:16:08 -07:00
|
|
|
x: uint; /*@ Pointer to variable to store the item's <b>row number</b>. */
|
|
|
|
y: uint; /*@ Pointer to variable to store the item's <b>column number</b>. */
|
2014-09-27 22:15:37 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property select_mode {
|
2014-09-27 22:15:37 -07:00
|
|
|
get {
|
|
|
|
/*@
|
|
|
|
Get the gengrid item's select mode.
|
|
|
|
|
2015-02-05 22:15:44 -08:00
|
|
|
(If getting mode fails, it returns ELM_OBJECT_SELECT_MODE_MAX)
|
2014-09-27 22:15:37 -07:00
|
|
|
|
|
|
|
@see elm_gengrid_item_select_mode_set()
|
|
|
|
|
|
|
|
@ingroup Gengrid
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
set {
|
|
|
|
/*@
|
|
|
|
Set the gengrid item's select mode.
|
|
|
|
|
|
|
|
elm_gengrid_select_mode_set() changes item's select mode.
|
|
|
|
- ELM_OBJECT_SELECT_MODE_DEFAULT : The item will only call their selection func and
|
|
|
|
callback when first becoming selected. Any further clicks will
|
|
|
|
do nothing, unless you set always select mode.
|
|
|
|
- ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected,
|
|
|
|
every click will make the selected callbacks be called.
|
|
|
|
- ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select the item
|
|
|
|
entirely and they will neither appear selected nor call selected
|
|
|
|
callback functions.
|
|
|
|
- ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY : This will apply no-finger-size rule
|
|
|
|
with ELM_OBJECT_SELECT_MODE_NONE. No-finger-size rule makes an item can be
|
|
|
|
smaller than lower limit. Clickable objects should be bigger than
|
|
|
|
human touch point device (your finger) for some touch or
|
|
|
|
small screen devices. So it is enabled, the item can be shrink than
|
|
|
|
predefined finger-size value. And the item will be updated.
|
|
|
|
|
|
|
|
@see elm_gengrid_item_select_mode_get()
|
|
|
|
|
|
|
|
@ingroup Gengrid
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
values {
|
2015-05-20 04:15:49 -07:00
|
|
|
mode: Elm.Object.Select_Mode(Elm.Object.Select_Mode.max); /*@ The selected mode */
|
2014-09-27 22:15:37 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/* init { FIXME
|
|
|
|
params {
|
|
|
|
Evas_Smart_Cb func;
|
|
|
|
const(void)* data;
|
|
|
|
}
|
|
|
|
}*/
|
|
|
|
show {
|
|
|
|
/*@
|
|
|
|
Show the portion of a gengrid's internal grid containing a given
|
|
|
|
item, @b immediately.
|
|
|
|
|
|
|
|
This causes gengrid to @b redraw its viewport's contents to the
|
|
|
|
region containing the given @p item item, if it is not fully
|
|
|
|
visible.
|
|
|
|
|
|
|
|
@see elm_gengrid_item_bring_in()
|
|
|
|
|
|
|
|
@ingroup Gengrid
|
|
|
|
*/
|
|
|
|
params {
|
2015-05-18 08:16:08 -07:00
|
|
|
@in type: Elm_Gengrid_Item_Scrollto_Type; /*@ Where to position the item in the viewport. */
|
2014-09-27 22:15:37 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
bring_in {
|
|
|
|
/*@
|
|
|
|
Animatedly bring in, to the visible area of a gengrid, a given
|
|
|
|
item on it.
|
|
|
|
|
|
|
|
This causes gengrid to jump to the given @p item and show
|
|
|
|
it (by scrolling), if it is not fully visible. This will use
|
|
|
|
animation to do so and take a period of time to complete.
|
|
|
|
|
|
|
|
@see elm_gengrid_item_show()
|
|
|
|
|
|
|
|
@ingroup Gengrid
|
|
|
|
*/
|
|
|
|
params {
|
2015-05-18 08:16:08 -07:00
|
|
|
@in type: Elm_Gengrid_Item_Scrollto_Type; /*@ Where to position the item in the viewport. */
|
2014-09-27 22:15:37 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
update {
|
|
|
|
/*@
|
|
|
|
Update the contents of a given gengrid item
|
|
|
|
|
|
|
|
This updates an item by calling all the item class functions
|
|
|
|
again to get the contents, texts and states. Use this when the
|
|
|
|
original item data has changed and you want the changes to be
|
|
|
|
reflected.
|
|
|
|
|
|
|
|
@ingroup Gengrid
|
|
|
|
*/
|
|
|
|
}
|
gengrid: add item cache in gengrid for efficient realize/unrealize operation.
Summary:
gengrid realize/unrealize items each smart calculation if their posiiton is updated.
This concept will be occurred useless view object creation and deletion.
So instead of delete items in unrealize function, push item cache into cache list,
and pop item cache from cache list in realize function to reuse item view object
more efficiently.
the cache concept is already implemented in genlist widget and this patch is improved
item cache of genlist cache.
@feature
```
NOTICE: This patch is written under the D2561 Patch which add elm_gengrid_item_fields_update.
So it must submitted after D2561.
```
Test Plan:
I've tested below three cases,
1. tested ith this patch in elementary_test and checked all gengrid features are working properly.
2. tested with changing CACHE_MAX to another value which is set 40 in default
and checked all gengrid features are working properly.
3. tested with set it->item->nocache true, and checked cache is never generated
and checked all gengrid features are working properly.
Reviewers: raster, Hermet, seoz, jaehwan, singh.amitesh
Subscribers: eagleeye, singh.amitesh, Jaehyun
Differential Revision: https://phab.enlightenment.org/D2641
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-06-25 07:28:07 -07:00
|
|
|
fields_update {
|
|
|
|
/*@
|
|
|
|
Update the part of an item
|
|
|
|
|
|
|
|
This updates an item's part by calling item's fetching functions again
|
|
|
|
to get the contents, texts and states. Use this when the original
|
|
|
|
item data has changed and the changes are desired to be reflected.
|
|
|
|
Second parts argument is used for globbing to match '*', '?', and '.'
|
|
|
|
It can be used at updating multi fields.
|
|
|
|
|
|
|
|
Use elm_gengrid_realized_items_update() to update an item's all
|
|
|
|
property.
|
|
|
|
|
|
|
|
@see elm_gengrid_iitem_update()
|
|
|
|
|
|
|
|
@ingroup Gengrid
|
|
|
|
@since 1.15
|
|
|
|
*/
|
|
|
|
params {
|
|
|
|
@in parts: const (char) *; /*@ The name of item's part */
|
|
|
|
@in itf: Elm_Gengrid_Item_Field_Type; /*@ The type of item's part type */
|
|
|
|
}
|
|
|
|
}
|
2014-09-27 22:15:37 -07:00
|
|
|
item_class_update {
|
|
|
|
/*@
|
|
|
|
Update the item class of a gengrid item.
|
|
|
|
|
|
|
|
This sets another class of the item, changing the way that it is
|
|
|
|
displayed. After changing the item class, elm_gengrid_item_update() is
|
|
|
|
called on the item @p it.
|
|
|
|
|
|
|
|
@ingroup Gengrid
|
|
|
|
*/
|
|
|
|
params {
|
2015-05-18 08:16:08 -07:00
|
|
|
@in itc: const (Elm_Gengrid_Item_Class) *; /*@ The gengrid item class describing the function pointers and the item style. */
|
2014-09-27 22:15:37 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
implements {
|
|
|
|
Eo.Base.constructor;
|
2015-04-22 04:33:10 -07:00
|
|
|
Elm.Widget_Item.del_pre;
|
|
|
|
Elm.Widget_Item.disable;
|
|
|
|
Elm.Widget_Item.signal_emit;
|
|
|
|
Elm.Widget_Item.focus.set;
|
|
|
|
Elm.Widget_Item.focus.get;
|
|
|
|
Elm.Widget_Item.part_text.get;
|
|
|
|
Elm.Widget_Item.part_content.get;
|
|
|
|
Elm.Widget_Item.tooltip_text_set;
|
|
|
|
Elm.Widget_Item.tooltip_style.get;
|
|
|
|
Elm.Widget_Item.tooltip_style.set;
|
|
|
|
Elm.Widget_Item.tooltip_window_mode.get;
|
|
|
|
Elm.Widget_Item.tooltip_window_mode.set;
|
|
|
|
Elm.Widget_Item.tooltip_content_cb_set;
|
|
|
|
Elm.Widget_Item.tooltip_unset;
|
|
|
|
Elm.Widget_Item.cursor.set;
|
|
|
|
Elm.Widget_Item.cursor_unset;
|
2014-10-03 07:14:37 -07:00
|
|
|
Elm_Interface_Atspi_Accessible.name.get;
|
|
|
|
Elm_Interface_Atspi_Accessible.state_set.get;
|
|
|
|
Elm_Interface_Atspi_Accessible.children.get;
|
2014-09-27 22:15:37 -07:00
|
|
|
}
|
|
|
|
}
|