2011-11-29 06:03:14 -08:00
|
|
|
#include <fnmatch.h>
|
2009-02-09 03:23:59 -08:00
|
|
|
#include <Elementary.h>
|
2010-09-27 11:18:37 -07:00
|
|
|
#include <Elementary_Cursor.h>
|
2009-02-09 03:23:59 -08:00
|
|
|
#include "elm_priv.h"
|
2012-07-16 14:56:30 -07:00
|
|
|
#include "elm_interface_scrollable.h"
|
|
|
|
#include "elm_widget_layout.h"
|
2011-12-29 22:49:28 -08:00
|
|
|
#include "elm_gen_common.h"
|
2009-02-09 03:23:59 -08:00
|
|
|
|
2012-03-05 21:02:36 -08:00
|
|
|
// internally allocated
|
2012-07-16 14:56:30 -07:00
|
|
|
#define CLASS_ALLOCATED 0x3a70f11f
|
2012-03-05 21:02:36 -08:00
|
|
|
|
2010-11-17 09:15:28 -08:00
|
|
|
#define MAX_ITEMS_PER_BLOCK 32
|
2011-06-01 20:10:11 -07:00
|
|
|
#define REORDER_EFFECT_TIME 0.5
|
2010-10-15 04:24:46 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static const char GENLIST_SMART_NAME[] = "elm_genlist";
|
|
|
|
static const char GENLIST_PAN_SMART_NAME[] = "elm_genlist_pan";
|
|
|
|
|
|
|
|
#define ERR_ABORT(_msg) \
|
|
|
|
ERR(_msg); \
|
|
|
|
if (getenv("ELM_ERROR_ABORT")) abort();
|
|
|
|
|
|
|
|
#define ELM_GENLIST_CHECK_ITC_VER(itc) \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
if (!itc) \
|
|
|
|
{ \
|
|
|
|
ERR("Genlist_Item_Class(itc) is NULL"); \
|
|
|
|
return; \
|
|
|
|
} \
|
|
|
|
if ((itc->version != ELM_GENLIST_ITEM_CLASS_VERSION) && \
|
|
|
|
(itc->version != CLASS_ALLOCATED)) \
|
|
|
|
{ \
|
|
|
|
ERR("Genlist_Item_Class version mismatched! current =" \
|
|
|
|
" (%d), required = (%d) or (%d)", itc->version, \
|
|
|
|
ELM_GENLIST_ITEM_CLASS_VERSION, CLASS_ALLOCATED); \
|
|
|
|
return; \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
while (0)
|
|
|
|
|
|
|
|
#define ELM_GENLIST_DATA_GET(o, sd) \
|
|
|
|
Elm_Genlist_Smart_Data * sd = evas_object_smart_data_get(o)
|
|
|
|
|
|
|
|
#define ELM_GENLIST_PAN_DATA_GET(o, sd) \
|
|
|
|
Elm_Genlist_Pan_Smart_Data * sd = evas_object_smart_data_get(o)
|
|
|
|
|
|
|
|
#define ELM_GENLIST_DATA_GET_OR_RETURN(o, ptr) \
|
|
|
|
ELM_GENLIST_DATA_GET(o, ptr); \
|
|
|
|
if (!ptr) \
|
|
|
|
{ \
|
|
|
|
CRITICAL("No widget data for object %p (%s)", \
|
|
|
|
o, evas_object_type_get(o)); \
|
|
|
|
return; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define ELM_GENLIST_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
|
|
|
|
ELM_GENLIST_DATA_GET(o, ptr); \
|
|
|
|
if (!ptr) \
|
|
|
|
{ \
|
|
|
|
CRITICAL("No widget data for object %p (%s)", \
|
|
|
|
o, evas_object_type_get(o)); \
|
|
|
|
return val; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define ELM_GENLIST_CHECK(obj) \
|
|
|
|
if (!obj || !elm_widget_type_check((obj), GENLIST_SMART_NAME, __func__)) \
|
|
|
|
return
|
|
|
|
|
|
|
|
#define ELM_GENLIST_ITEM_CHECK(it) \
|
|
|
|
ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *)it, ); \
|
|
|
|
ELM_GENLIST_CHECK(it->base.widget);
|
|
|
|
|
|
|
|
#define ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, ...) \
|
|
|
|
ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *)it, __VA_ARGS__); \
|
|
|
|
ELM_GENLIST_CHECK(it->base.widget) __VA_ARGS__;
|
|
|
|
|
|
|
|
#define ELM_GENLIST_ITEM_CHECK_OR_GOTO(it, label) \
|
|
|
|
ELM_WIDGET_ITEM_CHECK_OR_GOTO((Elm_Widget_Item *)it, label); \
|
|
|
|
if (!it->base.widget || !elm_widget_type_check \
|
|
|
|
((it->base.widget), GENLIST_SMART_NAME, __func__)) goto label;
|
|
|
|
|
|
|
|
#define GL_IT(_it) (_it->item)
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
ELM_GENLIST_TREE_EFFECT_NONE = 0,
|
|
|
|
ELM_GENLIST_TREE_EFFECT_EXPAND = 1,
|
|
|
|
ELM_GENLIST_TREE_EFFECT_CONTRACT = 2
|
|
|
|
} Elm_Genlist_Item_Move_Effect_Mode;
|
|
|
|
|
|
|
|
static const Evas_Smart_Interface *_smart_interfaces[] =
|
|
|
|
{
|
|
|
|
(Evas_Smart_Interface *)&ELM_SCROLLABLE_IFACE, NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _Elm_Genlist_Smart_Data Elm_Genlist_Smart_Data;
|
|
|
|
struct _Elm_Genlist_Smart_Data
|
|
|
|
{
|
|
|
|
Elm_Layout_Smart_Data base; /* base widget smart data as
|
|
|
|
* first member obligatory, as
|
|
|
|
* we're inheriting from it */
|
|
|
|
|
|
|
|
const Elm_Scrollable_Smart_Interface *s_iface;
|
|
|
|
|
|
|
|
Eina_Inlist_Sorted_State *state;
|
|
|
|
Evas_Object *hit_rect;
|
|
|
|
Evas_Object *pan_obj;
|
|
|
|
|
|
|
|
Eina_List *selected; /* a list of
|
|
|
|
* selected
|
|
|
|
* items */
|
|
|
|
Eina_List *group_items; /* a list of
|
|
|
|
* groups index
|
|
|
|
* items */
|
|
|
|
Eina_Inlist *items; /* an inlist of all items */
|
|
|
|
Elm_Gen_Item *reorder_it; /* item currently
|
|
|
|
* being
|
|
|
|
* repositioned */
|
|
|
|
Elm_Object_Item *last_selected_item;
|
|
|
|
Ecore_Job *calc_job;
|
|
|
|
int walking;
|
|
|
|
int item_width, item_height;
|
|
|
|
int group_item_width, group_item_height;
|
|
|
|
int minw, minh;
|
|
|
|
unsigned int item_count;
|
|
|
|
Evas_Coord pan_x, pan_y;
|
|
|
|
Elm_Object_Select_Mode select_mode;
|
|
|
|
|
|
|
|
Eina_Inlist *blocks; /* an inlist of all
|
|
|
|
* blocks. a block
|
|
|
|
* consists of a
|
|
|
|
* certain number of
|
|
|
|
* items. maximum
|
|
|
|
* number of items in
|
|
|
|
* a block is
|
|
|
|
* 'max_items_per_block'. */
|
|
|
|
Evas_Coord reorder_old_pan_y, w, h, realminw,
|
|
|
|
prev_viewport_w;
|
|
|
|
Ecore_Job *update_job;
|
|
|
|
Ecore_Idle_Enterer *queue_idle_enterer;
|
|
|
|
Ecore_Idler *must_recalc_idler;
|
|
|
|
Eina_List *queue;
|
|
|
|
Elm_Gen_Item *show_item, *anchor_item, *mode_item,
|
|
|
|
*reorder_rel, *expanded_item;
|
|
|
|
Eina_Inlist *item_cache; /* an inlist of
|
|
|
|
* edje object it
|
|
|
|
* cache. */
|
|
|
|
Evas_Coord anchor_y;
|
|
|
|
Evas_Coord reorder_start_y; /* reorder
|
|
|
|
* it's
|
|
|
|
* initial y
|
|
|
|
* coordinate
|
|
|
|
* in the
|
|
|
|
* pan. */
|
|
|
|
Elm_List_Mode mode;
|
|
|
|
Ecore_Timer *multi_timer, *scr_hold_timer;
|
|
|
|
Ecore_Animator *reorder_move_animator;
|
|
|
|
const char *decorate_it_type;
|
|
|
|
double start_time;
|
|
|
|
Evas_Coord prev_x, prev_y, prev_mx, prev_my;
|
|
|
|
Evas_Coord cur_x, cur_y, cur_mx, cur_my;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
Evas_Coord x, y;
|
|
|
|
} history[SWIPE_MOVES];
|
|
|
|
|
|
|
|
int multi_device;
|
|
|
|
int item_cache_count;
|
|
|
|
int item_cache_max; /* maximum
|
|
|
|
* number of
|
|
|
|
* cached
|
|
|
|
* items */
|
|
|
|
int movements;
|
|
|
|
|
|
|
|
/* maximum number of items per block */
|
|
|
|
int max_items_per_block;
|
|
|
|
|
|
|
|
/* longpress timeout. this value comes from _elm_config by
|
|
|
|
* default. this can be changed by
|
|
|
|
* elm_genlist_longpress_timeout_set() */
|
|
|
|
double longpress_timeout;
|
|
|
|
/* a generation of genlist. when genlist is cleared, this value
|
|
|
|
* will be increased and a new generation will start */
|
|
|
|
int generation;
|
|
|
|
Eina_Compare_Cb item_compare_cb;
|
|
|
|
Eina_Compare_Cb item_compare_data_cb;
|
|
|
|
|
|
|
|
/* a scrollto type which remembers where to scroll ex) in, top,
|
|
|
|
* middle */
|
|
|
|
Elm_Genlist_Item_Scrollto_Type scroll_to_type;
|
|
|
|
Evas_Object *alpha_bg; /* not to receive
|
|
|
|
* event when tree
|
|
|
|
* effect is not
|
|
|
|
* finished */
|
|
|
|
Eina_List *move_items; /* items move for
|
|
|
|
* tree effect */
|
|
|
|
Elm_Gen_Item *expanded_next_item;
|
|
|
|
Ecore_Animator *tree_effect_animator;
|
|
|
|
Elm_Genlist_Item_Move_Effect_Mode move_effect_mode;
|
|
|
|
|
|
|
|
Eina_Bool tree_effect_enabled : 1;
|
|
|
|
Eina_Bool auto_scroll_enabled : 1;
|
|
|
|
Eina_Bool decorate_all_mode : 1;
|
|
|
|
Eina_Bool height_for_width : 1;
|
|
|
|
Eina_Bool reorder_pan_move : 1;
|
|
|
|
Eina_Bool multi_timeout : 1;
|
|
|
|
Eina_Bool multi_touched : 1;
|
|
|
|
Eina_Bool reorder_mode : 1; /* a flag
|
|
|
|
* for
|
|
|
|
* reorder
|
|
|
|
* mode
|
|
|
|
* enable/disable */
|
|
|
|
/* this flag means genlist is supposed to be scrolled. if this flag
|
|
|
|
* is set to EINA_TRUE, genlist checks whether it's ok to scroll
|
|
|
|
* genlist now or not. */
|
|
|
|
Eina_Bool check_scroll : 1;
|
|
|
|
Eina_Bool pan_changed : 1;
|
|
|
|
Eina_Bool wasselected : 1;
|
|
|
|
Eina_Bool homogeneous : 1;
|
|
|
|
Eina_Bool longpressed : 1;
|
|
|
|
/* a flag for items can be highlighted or not. by default this flag
|
|
|
|
* is true. */
|
|
|
|
Eina_Bool mouse_down : 1;
|
|
|
|
Eina_Bool multi_down : 1;
|
|
|
|
Eina_Bool on_sub_del : 1;
|
|
|
|
|
|
|
|
Eina_Bool highlight : 1;
|
|
|
|
/* a flag whether genlist is marked as to be cleared or not. if
|
|
|
|
* this flag is true, genlist clear was already deferred. */
|
|
|
|
Eina_Bool clear_me : 1;
|
|
|
|
Eina_Bool h_bounce : 1;
|
|
|
|
Eina_Bool v_bounce : 1;
|
|
|
|
Eina_Bool bring_in : 1; /* a flag to
|
|
|
|
* describe the
|
|
|
|
* scroll
|
|
|
|
* animation. (show,
|
|
|
|
* bring in) */
|
|
|
|
|
|
|
|
/* this is set to EINA_TRUE when the item is re-queued. this
|
|
|
|
* happens when the item is un-queued but the rel item is still in
|
|
|
|
* the queue. this item will be processed later. */
|
|
|
|
Eina_Bool requeued : 1;
|
|
|
|
Eina_Bool on_hold : 1;
|
|
|
|
Eina_Bool multi : 1; /* a flag for item
|
|
|
|
* multi
|
|
|
|
* selection */
|
|
|
|
|
|
|
|
Eina_Bool swipe : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _Item_Block Item_Block;
|
|
|
|
typedef struct _Item_Cache Item_Cache;
|
2009-02-09 03:23:59 -08:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
struct Elm_Gen_Item_Type
|
2011-10-20 15:23:29 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it;
|
|
|
|
|
|
|
|
Elm_Genlist_Smart_Data *wsd;
|
|
|
|
|
|
|
|
Item_Block *block;
|
|
|
|
Eina_List *items;
|
|
|
|
Evas_Coord w, h, minw, minh;
|
|
|
|
Elm_Gen_Item *group_item;
|
|
|
|
Elm_Genlist_Item_Type type;
|
|
|
|
Eina_List *deco_it_texts, *deco_it_contents,
|
|
|
|
*deco_it_states, *deco_it_content_objs;
|
|
|
|
Eina_List *deco_all_texts, *deco_all_contents,
|
|
|
|
*deco_all_states, *deco_all_content_objs;
|
|
|
|
Eina_List *flip_contents, *flip_content_objs;
|
|
|
|
Ecore_Timer *swipe_timer;
|
|
|
|
Evas_Coord scrl_x, scrl_y, old_scrl_y;
|
|
|
|
|
|
|
|
Elm_Gen_Item *rel;
|
|
|
|
Evas_Object *deco_it_view;
|
|
|
|
int expanded_depth;
|
|
|
|
int order_num_in;
|
|
|
|
|
|
|
|
Eina_Bool decorate_all_item_realized : 1;
|
|
|
|
Eina_Bool tree_effect_finished : 1; /* tree effect */
|
|
|
|
Eina_Bool move_effect_enabled : 1;
|
|
|
|
Eina_Bool tree_effect_hide_me : 1; /* item hide for
|
|
|
|
* tree effect */
|
|
|
|
|
|
|
|
Eina_Bool stacking_even : 1;
|
|
|
|
Eina_Bool want_realize : 1;
|
|
|
|
Eina_Bool nocache_once : 1; /* do not use cache for
|
|
|
|
* this item only once */
|
|
|
|
Eina_Bool nostacking : 1;
|
|
|
|
Eina_Bool expanded : 1;
|
|
|
|
Eina_Bool mincalcd : 1;
|
|
|
|
Eina_Bool updateme : 1;
|
|
|
|
Eina_Bool nocache : 1; /* do not use cache for this item */
|
|
|
|
Eina_Bool queued : 1;
|
|
|
|
Eina_Bool before : 1;
|
|
|
|
Eina_Bool show_me : 1;
|
2011-10-20 15:23:29 -07:00
|
|
|
};
|
|
|
|
|
2009-02-10 03:57:47 -08:00
|
|
|
struct _Item_Block
|
|
|
|
{
|
2009-02-25 08:22:29 -08:00
|
|
|
EINA_INLIST;
|
2012-07-16 14:56:30 -07:00
|
|
|
|
|
|
|
int count;
|
|
|
|
int num;
|
|
|
|
int reorder_offset;
|
|
|
|
Elm_Genlist_Smart_Data *sd;
|
|
|
|
Eina_List *items;
|
|
|
|
Evas_Coord x, y, w, h, minw, minh;
|
|
|
|
int position;
|
|
|
|
int item_position_stamp;
|
|
|
|
|
|
|
|
Eina_Bool position_update : 1;
|
|
|
|
Eina_Bool want_unrealize : 1;
|
|
|
|
Eina_Bool must_recalc : 1;
|
|
|
|
Eina_Bool realized : 1;
|
|
|
|
Eina_Bool updateme : 1;
|
|
|
|
Eina_Bool changed : 1;
|
|
|
|
Eina_Bool show_me : 1;
|
2009-02-10 03:57:47 -08:00
|
|
|
};
|
|
|
|
|
2010-11-05 23:02:22 -07:00
|
|
|
struct _Item_Cache
|
|
|
|
{
|
2010-12-07 11:18:14 -08:00
|
|
|
EINA_INLIST;
|
|
|
|
|
|
|
|
Evas_Object *base_view, *spacer;
|
|
|
|
|
|
|
|
const char *item_style; // it->itc->item_style
|
|
|
|
|
|
|
|
Eina_Bool selected : 1; // it->selected
|
|
|
|
Eina_Bool disabled : 1; // it->disabled
|
2011-10-21 01:52:03 -07:00
|
|
|
Eina_Bool expanded : 1; // it->item->expanded
|
2012-07-16 14:56:30 -07:00
|
|
|
Eina_Bool tree : 1; // it->group
|
2010-11-05 23:02:22 -07:00
|
|
|
};
|
|
|
|
|
2011-07-25 18:49:24 -07:00
|
|
|
static const char SIG_ACTIVATED[] = "activated";
|
2011-05-06 17:30:39 -07:00
|
|
|
static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
|
|
|
|
static const char SIG_SELECTED[] = "selected";
|
|
|
|
static const char SIG_UNSELECTED[] = "unselected";
|
|
|
|
static const char SIG_EXPANDED[] = "expanded";
|
|
|
|
static const char SIG_CONTRACTED[] = "contracted";
|
|
|
|
static const char SIG_EXPAND_REQUEST[] = "expand,request";
|
|
|
|
static const char SIG_CONTRACT_REQUEST[] = "contract,request";
|
|
|
|
static const char SIG_REALIZED[] = "realized";
|
|
|
|
static const char SIG_UNREALIZED[] = "unrealized";
|
|
|
|
static const char SIG_DRAG_START_UP[] = "drag,start,up";
|
|
|
|
static const char SIG_DRAG_START_DOWN[] = "drag,start,down";
|
|
|
|
static const char SIG_DRAG_START_LEFT[] = "drag,start,left";
|
|
|
|
static const char SIG_DRAG_START_RIGHT[] = "drag,start,right";
|
|
|
|
static const char SIG_DRAG_STOP[] = "drag,stop";
|
|
|
|
static const char SIG_DRAG[] = "drag";
|
|
|
|
static const char SIG_LONGPRESSED[] = "longpressed";
|
elm genlist: Added "scroll,anim,start", "scroll,anim,stop",
"scroll,drag,start", "scroll,drag,stop" smart callbacks to genlist.
elm gengrid: Added "scroll,anim,start", "scroll,anim,stop" smart
callbacks to genlist.
SVN revision: 62710
2011-08-22 21:02:26 -07:00
|
|
|
static const char SIG_SCROLL_ANIM_START[] = "scroll,anim,start";
|
|
|
|
static const char SIG_SCROLL_ANIM_STOP[] = "scroll,anim,stop";
|
|
|
|
static const char SIG_SCROLL_DRAG_START[] = "scroll,drag,start";
|
|
|
|
static const char SIG_SCROLL_DRAG_STOP[] = "scroll,drag,stop";
|
2011-10-20 09:42:42 -07:00
|
|
|
static const char SIG_EDGE_TOP[] = "edge,top";
|
|
|
|
static const char SIG_EDGE_BOTTOM[] = "edge,bottom";
|
|
|
|
static const char SIG_EDGE_LEFT[] = "edge,left";
|
|
|
|
static const char SIG_EDGE_RIGHT[] = "edge,right";
|
2011-05-06 17:30:39 -07:00
|
|
|
static const char SIG_MULTI_SWIPE_LEFT[] = "multi,swipe,left";
|
|
|
|
static const char SIG_MULTI_SWIPE_RIGHT[] = "multi,swipe,right";
|
|
|
|
static const char SIG_MULTI_SWIPE_UP[] = "multi,swipe,up";
|
|
|
|
static const char SIG_MULTI_SWIPE_DOWN[] = "multi,swipe,down";
|
|
|
|
static const char SIG_MULTI_PINCH_OUT[] = "multi,pinch,out";
|
|
|
|
static const char SIG_MULTI_PINCH_IN[] = "multi,pinch,in";
|
|
|
|
static const char SIG_SWIPE[] = "swipe";
|
2011-10-20 18:49:15 -07:00
|
|
|
static const char SIG_MOVED[] = "moved";
|
2012-03-21 04:50:33 -07:00
|
|
|
static const char SIG_MOVED_AFTER[] = "moved,after";
|
|
|
|
static const char SIG_MOVED_BEFORE[] = "moved,before";
|
2011-12-26 06:30:21 -08:00
|
|
|
static const char SIG_INDEX_UPDATE[] = "index,update";
|
2012-03-07 04:15:36 -08:00
|
|
|
static const char SIG_TREE_EFFECT_FINISHED [] = "tree,effect,finished";
|
2011-05-06 17:30:39 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
2011-05-06 17:30:39 -07:00
|
|
|
{SIG_CLICKED_DOUBLE, ""},
|
2011-07-25 18:49:24 -07:00
|
|
|
{SIG_ACTIVATED, ""},
|
2011-05-06 17:30:39 -07:00
|
|
|
{SIG_SELECTED, ""},
|
|
|
|
{SIG_UNSELECTED, ""},
|
|
|
|
{SIG_EXPANDED, ""},
|
|
|
|
{SIG_CONTRACTED, ""},
|
|
|
|
{SIG_EXPAND_REQUEST, ""},
|
|
|
|
{SIG_CONTRACT_REQUEST, ""},
|
|
|
|
{SIG_REALIZED, ""},
|
|
|
|
{SIG_UNREALIZED, ""},
|
|
|
|
{SIG_DRAG_START_UP, ""},
|
|
|
|
{SIG_DRAG_START_DOWN, ""},
|
|
|
|
{SIG_DRAG_START_LEFT, ""},
|
|
|
|
{SIG_DRAG_START_RIGHT, ""},
|
|
|
|
{SIG_DRAG_STOP, ""},
|
|
|
|
{SIG_DRAG, ""},
|
|
|
|
{SIG_LONGPRESSED, ""},
|
elm genlist: Added "scroll,anim,start", "scroll,anim,stop",
"scroll,drag,start", "scroll,drag,stop" smart callbacks to genlist.
elm gengrid: Added "scroll,anim,start", "scroll,anim,stop" smart
callbacks to genlist.
SVN revision: 62710
2011-08-22 21:02:26 -07:00
|
|
|
{SIG_SCROLL_ANIM_START, ""},
|
|
|
|
{SIG_SCROLL_ANIM_STOP, ""},
|
|
|
|
{SIG_SCROLL_DRAG_START, ""},
|
|
|
|
{SIG_SCROLL_DRAG_STOP, ""},
|
2011-10-20 09:42:42 -07:00
|
|
|
{SIG_EDGE_TOP, ""},
|
|
|
|
{SIG_EDGE_BOTTOM, ""},
|
|
|
|
{SIG_EDGE_LEFT, ""},
|
|
|
|
{SIG_EDGE_RIGHT, ""},
|
2011-05-06 17:30:39 -07:00
|
|
|
{SIG_MULTI_SWIPE_LEFT, ""},
|
|
|
|
{SIG_MULTI_SWIPE_RIGHT, ""},
|
|
|
|
{SIG_MULTI_SWIPE_UP, ""},
|
|
|
|
{SIG_MULTI_SWIPE_DOWN, ""},
|
|
|
|
{SIG_MULTI_PINCH_OUT, ""},
|
|
|
|
{SIG_MULTI_PINCH_IN, ""},
|
|
|
|
{SIG_SWIPE, ""},
|
2011-10-20 18:49:15 -07:00
|
|
|
{SIG_MOVED, ""},
|
2012-03-21 04:50:33 -07:00
|
|
|
{SIG_MOVED_AFTER, ""},
|
|
|
|
{SIG_MOVED_BEFORE, ""},
|
2012-03-07 04:15:36 -08:00
|
|
|
{SIG_TREE_EFFECT_FINISHED, ""},
|
2011-05-06 17:30:39 -07:00
|
|
|
{NULL, NULL}
|
|
|
|
};
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EVAS_SMART_SUBCLASS_IFACE_NEW
|
|
|
|
(GENLIST_SMART_NAME, _elm_genlist, Elm_Layout_Smart_Class,
|
|
|
|
Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks,
|
|
|
|
_smart_interfaces);
|
2012-01-23 05:26:45 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_INTERNAL_SMART_SUBCLASS_NEW
|
|
|
|
(GENLIST_PAN_SMART_NAME, _elm_genlist_pan, Elm_Pan_Smart_Class,
|
|
|
|
Elm_Pan_Smart_Class, elm_pan_smart_class_get, NULL);
|
2012-01-23 05:26:45 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
typedef struct _Elm_Genlist_Pan_Smart_Data Elm_Genlist_Pan_Smart_Data;
|
|
|
|
struct _Elm_Genlist_Pan_Smart_Data
|
2012-01-23 05:26:45 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Pan_Smart_Data base;
|
|
|
|
Elm_Genlist_Smart_Data *wsd;
|
|
|
|
Ecore_Job *resize_job;
|
|
|
|
};
|
2012-01-23 05:26:45 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void _calc_job(void *);
|
|
|
|
static Eina_Bool _item_block_recalc(Item_Block *, int, Eina_Bool);
|
|
|
|
static void _item_mouse_callbacks_add(Elm_Gen_Item *, Evas_Object *);
|
|
|
|
static void _item_mouse_callbacks_del(Elm_Gen_Item *, Evas_Object *);
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_genlist_pan_smart_pos_set(Evas_Object *obj,
|
|
|
|
Evas_Coord x,
|
|
|
|
Evas_Coord y)
|
2010-10-01 12:03:12 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Item_Block *itb;
|
2010-10-01 12:03:12 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_PAN_DATA_GET(obj, psd);
|
2010-10-01 12:03:12 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((x == psd->wsd->pan_x) && (y == psd->wsd->pan_y)) return;
|
|
|
|
psd->wsd->pan_x = x;
|
|
|
|
psd->wsd->pan_y = y;
|
2010-10-01 12:03:12 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EINA_INLIST_FOREACH (psd->wsd->blocks, itb)
|
2010-10-01 12:03:12 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((itb->y + itb->h) > y)
|
2010-10-05 12:09:55 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it;
|
|
|
|
Eina_List *l2;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH (itb->items, l2, it)
|
|
|
|
{
|
|
|
|
if ((itb->y + it->y) >= y)
|
|
|
|
{
|
|
|
|
psd->wsd->anchor_item = it;
|
|
|
|
psd->wsd->anchor_y = -(itb->y + it->y - y);
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
}
|
2010-10-05 12:09:55 -07:00
|
|
|
}
|
2010-10-01 12:03:12 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
done:
|
|
|
|
if (!psd->wsd->reorder_move_animator) evas_object_smart_changed(obj);
|
2010-10-01 12:03:12 -07:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_elm_genlist_pan_smart_pos_get(const Evas_Object *obj,
|
|
|
|
Evas_Coord *x,
|
|
|
|
Evas_Coord *y)
|
2010-10-27 07:38:54 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_PAN_DATA_GET(obj, psd);
|
2010-10-27 07:38:54 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (x) *x = psd->wsd->pan_x;
|
|
|
|
if (y) *y = psd->wsd->pan_y;
|
2010-10-27 07:38:54 -07:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_elm_genlist_pan_smart_pos_max_get(const Evas_Object *obj,
|
|
|
|
Evas_Coord *x,
|
|
|
|
Evas_Coord *y)
|
2010-10-05 12:09:55 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Evas_Coord ow, oh;
|
2010-10-05 12:09:55 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_PAN_DATA_GET(obj, psd);
|
2010-10-05 12:09:55 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
|
|
|
|
ow = psd->wsd->minw - ow;
|
|
|
|
if (ow < 0) ow = 0;
|
|
|
|
oh = psd->wsd->minh - oh;
|
|
|
|
if (oh < 0) oh = 0;
|
|
|
|
if (x) *x = ow;
|
|
|
|
if (y) *y = oh;
|
2010-10-05 12:09:55 -07:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_elm_genlist_pan_smart_pos_min_get(const Evas_Object *obj __UNUSED__,
|
|
|
|
Evas_Coord *x,
|
|
|
|
Evas_Coord *y)
|
2010-10-05 12:09:55 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (x) *x = 0;
|
|
|
|
if (y) *y = 0;
|
2010-10-05 12:09:55 -07:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_elm_genlist_pan_smart_content_size_get(const Evas_Object *obj,
|
|
|
|
Evas_Coord *w,
|
|
|
|
Evas_Coord *h)
|
2010-10-05 12:09:55 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_PAN_DATA_GET(obj, psd);
|
2010-10-05 12:09:55 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (w) *w = psd->wsd->minw;
|
|
|
|
if (h) *h = psd->wsd->minh;
|
2010-10-05 12:09:55 -07:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_elm_genlist_pan_smart_add(Evas_Object *obj)
|
2010-10-05 12:09:55 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
/* here just to allocate our extended data */
|
|
|
|
EVAS_SMART_DATA_ALLOC(obj, Elm_Genlist_Pan_Smart_Data);
|
2010-10-05 12:09:55 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_PAN_CLASS(_elm_genlist_pan_parent_sc)->base.add(obj);
|
2010-10-05 12:09:55 -07:00
|
|
|
}
|
|
|
|
|
2010-10-01 12:03:12 -07:00
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_elm_genlist_pan_smart_del(Evas_Object *obj)
|
2010-10-01 12:03:12 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_PAN_DATA_GET(obj, psd);
|
|
|
|
|
|
|
|
if (psd->resize_job)
|
2010-10-01 12:03:12 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ecore_job_del(psd->resize_job);
|
|
|
|
psd->resize_job = NULL;
|
2010-10-01 12:03:12 -07:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
_elm_genlist_pan_parent_sc->base.del(obj);
|
2009-02-09 03:23:59 -08:00
|
|
|
}
|
|
|
|
|
2009-11-13 14:22:05 -08:00
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_elm_genlist_pan_smart_move(Evas_Object *obj,
|
|
|
|
Evas_Coord x __UNUSED__,
|
|
|
|
Evas_Coord y __UNUSED__)
|
2009-11-13 14:22:05 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_PAN_DATA_GET(obj, psd);
|
2009-11-13 14:22:05 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
psd->wsd->pan_changed = EINA_TRUE;
|
|
|
|
evas_object_smart_changed(obj);
|
|
|
|
if (psd->wsd->calc_job) ecore_job_del(psd->wsd->calc_job);
|
|
|
|
psd->wsd->calc_job = NULL;
|
2011-02-08 04:08:28 -08:00
|
|
|
}
|
|
|
|
|
2009-02-09 03:23:59 -08:00
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_elm_genlist_pan_smart_resize_job(void *data)
|
2009-02-09 03:23:59 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Genlist_Pan_Smart_Data *psd = data;
|
2010-10-15 04:51:15 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_layout_sizing_eval(ELM_WIDGET_DATA(psd->wsd)->obj);
|
|
|
|
psd->resize_job = NULL;
|
2009-02-09 03:23:59 -08:00
|
|
|
}
|
|
|
|
|
2011-02-13 02:28:55 -08:00
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_elm_genlist_pan_smart_resize(Evas_Object *obj,
|
|
|
|
Evas_Coord w,
|
|
|
|
Evas_Coord h)
|
2011-02-13 02:28:55 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Evas_Coord ow, oh;
|
2009-02-09 03:23:59 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_PAN_DATA_GET(obj, psd);
|
|
|
|
|
|
|
|
evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
|
|
|
|
if ((ow == w) && (oh == h)) return;
|
|
|
|
if ((psd->wsd->mode == ELM_LIST_COMPRESS) && (ow != w))
|
|
|
|
{
|
|
|
|
/* fix me later */
|
|
|
|
if (psd->resize_job) ecore_job_del(psd->resize_job);
|
|
|
|
psd->resize_job =
|
|
|
|
ecore_job_add(_elm_genlist_pan_smart_resize_job, psd);
|
|
|
|
}
|
|
|
|
psd->wsd->pan_changed = EINA_TRUE;
|
|
|
|
evas_object_smart_changed(obj);
|
|
|
|
if (psd->wsd->calc_job) ecore_job_del(psd->wsd->calc_job);
|
|
|
|
psd->wsd->calc_job = NULL;
|
2011-10-19 07:17:14 -07:00
|
|
|
}
|
|
|
|
|
2009-02-09 03:23:59 -08:00
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_scroll(Elm_Genlist_Smart_Data *sd)
|
2009-02-09 03:23:59 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Evas_Coord gith = 0;
|
|
|
|
Elm_Gen_Item *it = NULL;
|
|
|
|
Evas_Coord ow, oh, dx = 0, dy = 0, dw = 0, dh = 0;
|
2012-03-15 04:18:17 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!sd->show_item) return;
|
2012-03-15 04:18:17 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_object_geometry_get(sd->pan_obj, NULL, NULL, &ow, &oh);
|
|
|
|
it = sd->show_item;
|
|
|
|
dx = it->x + it->item->block->x;
|
|
|
|
dy = it->y + it->item->block->y;
|
|
|
|
dw = it->item->block->w;
|
|
|
|
dh = oh;
|
2012-03-15 04:18:17 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
switch (sd->scroll_to_type)
|
2010-11-20 00:43:43 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
case ELM_GENLIST_ITEM_SCROLLTO_TOP:
|
|
|
|
if (it->item->group_item) gith = it->item->group_item->item->h;
|
|
|
|
dy -= gith;
|
|
|
|
break;
|
2010-12-07 11:18:14 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
case ELM_GENLIST_ITEM_SCROLLTO_MIDDLE:
|
|
|
|
dy += ((it->item->h / 2) - (oh / 2));
|
|
|
|
break;
|
2010-12-07 11:18:14 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
case ELM_GENLIST_ITEM_SCROLLTO_IN:
|
|
|
|
default:
|
|
|
|
if ((sd->expanded_item) &&
|
|
|
|
((sd->show_item->y + sd->show_item->item->block->y
|
|
|
|
+ sd->show_item->item->h) -
|
|
|
|
(sd->expanded_item->y + sd->expanded_item->item->block->y) > oh))
|
|
|
|
{
|
|
|
|
it = sd->expanded_item;
|
|
|
|
if (it->item->group_item) gith = it->item->group_item->item->h;
|
|
|
|
dx = it->x + it->item->block->x;
|
|
|
|
dy = it->y + it->item->block->y - gith;
|
|
|
|
dw = it->item->block->w;
|
2010-12-07 11:18:14 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((it->item->group_item) &&
|
|
|
|
(sd->pan_y > (it->y + it->item->block->y)))
|
|
|
|
gith = it->item->group_item->item->h;
|
|
|
|
dy -= gith;
|
|
|
|
dh = it->item->h;
|
|
|
|
}
|
|
|
|
break;
|
2010-05-07 06:21:45 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->bring_in)
|
|
|
|
sd->s_iface->region_bring_in(ELM_WIDGET_DATA(sd)->obj, dx, dy, dw, dh);
|
2010-09-28 01:46:08 -07:00
|
|
|
else
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->s_iface->content_region_show
|
|
|
|
(ELM_WIDGET_DATA(sd)->obj, dx, dy, dw, dh);
|
2012-03-15 04:18:17 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
it->item->show_me = EINA_FALSE;
|
|
|
|
sd->show_item = NULL;
|
|
|
|
sd->auto_scroll_enabled = EINA_FALSE;
|
|
|
|
sd->check_scroll = EINA_FALSE;
|
2009-02-09 03:23:59 -08:00
|
|
|
}
|
|
|
|
|
2011-04-06 07:46:39 -07:00
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_elm_genlist_item_unrealize(Elm_Gen_Item *it,
|
|
|
|
Eina_Bool calc)
|
2011-04-06 07:46:39 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Evas_Object *content;
|
2011-04-06 07:46:39 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!it->realized) return;
|
|
|
|
if (GL_IT(it)->wsd->reorder_it == it) return;
|
2009-02-16 23:50:35 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(WIDGET(it)));
|
|
|
|
if (!calc)
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_UNREALIZED, it);
|
|
|
|
if (it->long_timer)
|
2011-05-24 04:41:00 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
2011-05-24 04:41:00 -07:00
|
|
|
}
|
2011-12-26 06:30:21 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_widget_stringlist_free(it->texts);
|
|
|
|
it->texts = NULL;
|
|
|
|
elm_widget_stringlist_free(it->contents);
|
|
|
|
it->contents = NULL;
|
|
|
|
elm_widget_stringlist_free(it->states);
|
|
|
|
it->states = NULL;
|
|
|
|
EINA_LIST_FREE (it->content_objs, content)
|
|
|
|
evas_object_del(content);
|
2011-12-26 06:30:21 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
it->unrealize_cb(it);
|
2011-12-26 06:30:21 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
it->realized = EINA_FALSE;
|
|
|
|
it->want_unrealize = EINA_FALSE;
|
|
|
|
evas_event_thaw(evas_object_evas_get(WIDGET(it)));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(WIDGET(it)));
|
2011-12-26 06:30:21 -08:00
|
|
|
}
|
|
|
|
|
2012-05-29 02:04:16 -07:00
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_block_unrealize(Item_Block *itb)
|
2012-05-29 02:04:16 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it;
|
|
|
|
const Eina_List *l;
|
|
|
|
Eina_Bool dragging = EINA_FALSE;
|
2012-05-29 02:04:16 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!itb->realized) return;
|
|
|
|
evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(itb->sd)->obj));
|
2010-03-02 00:47:40 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EINA_LIST_FOREACH (itb->items, l, it)
|
2010-03-02 00:47:40 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (itb->must_recalc || !it->group)
|
2010-10-15 04:51:15 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->dragging)
|
2010-10-15 04:51:15 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
dragging = EINA_TRUE;
|
|
|
|
it->want_unrealize = EINA_TRUE;
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
else
|
|
|
|
_elm_genlist_item_unrealize(it, EINA_FALSE);
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
2010-03-02 00:47:40 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!dragging)
|
2012-05-09 23:30:49 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
itb->realized = EINA_FALSE;
|
|
|
|
itb->want_unrealize = EINA_TRUE;
|
2012-05-09 23:30:49 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
else
|
|
|
|
itb->want_unrealize = EINA_FALSE;
|
|
|
|
evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(itb->sd)->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(itb->sd)->obj));
|
2010-03-02 00:47:40 -08:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_must_recalc_idler(void *data)
|
2012-03-07 04:15:36 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Genlist_Smart_Data *sd = data;
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->calc_job) ecore_job_del(sd->calc_job);
|
|
|
|
sd->calc_job = ecore_job_add(_calc_job, sd);
|
|
|
|
sd->must_recalc_idler = NULL;
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2012-03-07 04:15:36 -08:00
|
|
|
}
|
|
|
|
|
2010-03-02 00:47:40 -08:00
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_calc_job(void *data)
|
2010-03-02 00:47:40 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
int in = 0;
|
|
|
|
Item_Block *itb, *chb = NULL;
|
|
|
|
Evas_Coord pan_w = 0, pan_h = 0;
|
|
|
|
Elm_Genlist_Smart_Data *sd = data;
|
|
|
|
Eina_Bool minw_change = EINA_FALSE;
|
|
|
|
Eina_Bool did_must_recalc = EINA_FALSE;
|
|
|
|
Evas_Coord minw = -1, minh = 0, y = 0, ow, dy = 0, vw;
|
2011-05-29 19:31:21 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_object_geometry_get(sd->pan_obj, NULL, NULL, &ow, &sd->h);
|
|
|
|
sd->s_iface->content_viewport_size_get(ELM_WIDGET_DATA(sd)->obj, &vw, NULL);
|
|
|
|
|
|
|
|
if (sd->w != ow)
|
|
|
|
sd->w = ow;
|
|
|
|
|
|
|
|
evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
|
|
|
EINA_INLIST_FOREACH (sd->blocks, itb)
|
2010-11-24 23:07:39 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Eina_Bool show_me = EINA_FALSE;
|
|
|
|
|
|
|
|
itb->num = in;
|
|
|
|
show_me = itb->show_me;
|
|
|
|
itb->show_me = EINA_FALSE;
|
|
|
|
if (chb)
|
|
|
|
{
|
|
|
|
if (itb->realized) _item_block_unrealize(itb);
|
|
|
|
}
|
|
|
|
if ((itb->changed) || ((itb->must_recalc) && (!did_must_recalc)))
|
|
|
|
{
|
|
|
|
if (itb->must_recalc)
|
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
Elm_Gen_Item *it;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH (itb->items, l, it)
|
|
|
|
if (it->item->mincalcd) it->item->mincalcd = EINA_FALSE;
|
|
|
|
itb->changed = EINA_TRUE;
|
|
|
|
if (itb->must_recalc) did_must_recalc = EINA_TRUE;
|
|
|
|
if (itb->realized) _item_block_unrealize(itb);
|
|
|
|
itb->must_recalc = EINA_FALSE;
|
|
|
|
}
|
|
|
|
show_me = _item_block_recalc(itb, in, EINA_FALSE);
|
|
|
|
chb = itb;
|
|
|
|
}
|
|
|
|
itb->y = y;
|
|
|
|
itb->x = 0;
|
|
|
|
minh += itb->minh;
|
|
|
|
if (minw == -1) minw = itb->minw;
|
|
|
|
else if ((!itb->must_recalc) && (minw < itb->minw))
|
|
|
|
{
|
|
|
|
minw = itb->minw;
|
|
|
|
minw_change = EINA_TRUE;
|
|
|
|
}
|
|
|
|
if (minw > vw)
|
|
|
|
{
|
|
|
|
minw = vw;
|
|
|
|
minw_change = EINA_TRUE;
|
|
|
|
}
|
|
|
|
itb->w = minw;
|
|
|
|
itb->h = itb->minh;
|
|
|
|
y += itb->h;
|
|
|
|
in += itb->count;
|
|
|
|
if ((show_me) && (sd->show_item) && (!sd->show_item->item->queued))
|
|
|
|
sd->check_scroll = EINA_TRUE;
|
2010-11-24 23:07:39 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
if (minw_change)
|
2012-04-20 03:50:42 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
EINA_INLIST_FOREACH (sd->blocks, itb)
|
2012-04-20 03:50:42 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
itb->minw = minw;
|
|
|
|
itb->w = itb->minw;
|
2012-04-20 03:50:42 -07:00
|
|
|
}
|
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((chb) && (EINA_INLIST_GET(chb)->next))
|
2012-03-30 02:22:49 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
EINA_INLIST_FOREACH (EINA_INLIST_GET(chb)->next, itb)
|
|
|
|
{
|
|
|
|
if (itb->realized) _item_block_unrealize(itb);
|
|
|
|
}
|
2012-03-30 02:22:49 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->realminw = minw;
|
|
|
|
if (minw < sd->w) minw = sd->w;
|
|
|
|
if ((minw != sd->minw) || (minh != sd->minh))
|
2009-04-23 01:51:07 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->minw = minw;
|
|
|
|
sd->minh = minh;
|
|
|
|
evas_object_smart_callback_call(sd->pan_obj, "changed", NULL);
|
|
|
|
elm_layout_sizing_eval(ELM_WIDGET_DATA(sd)->obj);
|
|
|
|
if ((sd->anchor_item) && (sd->anchor_item->item->block)
|
|
|
|
&& (!sd->auto_scroll_enabled))
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it;
|
|
|
|
Evas_Coord it_y;
|
|
|
|
|
|
|
|
it = sd->anchor_item;
|
|
|
|
it_y = sd->anchor_y;
|
|
|
|
sd->s_iface->content_pos_set
|
|
|
|
(ELM_WIDGET_DATA(sd)->obj, sd->pan_x, it->item->block->y
|
|
|
|
+ it->y + it_y);
|
|
|
|
sd->anchor_item = it;
|
|
|
|
sd->anchor_y = it_y;
|
|
|
|
}
|
2009-04-23 01:51:07 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
if (did_must_recalc)
|
2011-10-21 15:55:45 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!sd->must_recalc_idler)
|
|
|
|
sd->must_recalc_idler = ecore_idler_add(_must_recalc_idler, sd);
|
2011-08-24 14:03:37 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->check_scroll)
|
2010-03-02 00:47:40 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
_elm_genlist_pan_smart_content_size_get(sd->pan_obj, &pan_w, &pan_h);
|
|
|
|
if (EINA_INLIST_GET(sd->show_item) == sd->items->last)
|
|
|
|
sd->scroll_to_type = ELM_GENLIST_ITEM_SCROLLTO_IN;
|
|
|
|
|
|
|
|
switch (sd->scroll_to_type)
|
|
|
|
{
|
|
|
|
case ELM_GENLIST_ITEM_SCROLLTO_TOP:
|
|
|
|
dy = sd->h;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_GENLIST_ITEM_SCROLLTO_MIDDLE:
|
|
|
|
dy = sd->h / 2;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_GENLIST_ITEM_SCROLLTO_IN:
|
|
|
|
default:
|
|
|
|
dy = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if ((sd->show_item) && (sd->show_item->item->block))
|
|
|
|
{
|
|
|
|
if ((pan_w > (sd->show_item->x + sd->show_item->item->block->x))
|
|
|
|
&& (pan_h > (sd->show_item->y + sd->show_item->item->block->y
|
|
|
|
+ dy)))
|
|
|
|
{
|
|
|
|
_item_scroll(sd);
|
|
|
|
}
|
|
|
|
}
|
2010-03-02 00:47:40 -08:00
|
|
|
}
|
2009-02-16 23:50:35 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->calc_job = NULL;
|
|
|
|
evas_object_smart_changed(sd->pan_obj);
|
|
|
|
evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
2009-05-12 03:16:49 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_elm_genlist_smart_sizing_eval(Evas_Object *obj)
|
2009-05-12 03:16:49 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
|
|
|
Evas_Coord vmw = 0, vmh = 0;
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
/* parent class' early call */
|
|
|
|
if (!sd->s_iface) return;
|
|
|
|
|
|
|
|
if (sd->on_sub_del) return;;
|
|
|
|
|
|
|
|
evas_object_size_hint_min_get(obj, &minw, NULL);
|
|
|
|
evas_object_size_hint_max_get(obj, &maxw, &maxh);
|
|
|
|
|
|
|
|
edje_object_size_min_calc(ELM_WIDGET_DATA(sd)->resize_obj, &vmw, &vmh);
|
|
|
|
|
|
|
|
if (sd->mode == ELM_LIST_COMPRESS)
|
2009-05-12 03:16:49 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Evas_Coord vw, vh;
|
|
|
|
|
|
|
|
sd->s_iface->content_viewport_size_get(obj, &vw, &vh);
|
|
|
|
if ((vw != 0) && (vw != sd->prev_viewport_w))
|
2010-10-15 04:51:15 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Item_Block *itb;
|
|
|
|
|
|
|
|
sd->prev_viewport_w = vw;
|
|
|
|
|
|
|
|
EINA_INLIST_FOREACH (sd->blocks, itb)
|
2011-05-24 04:41:00 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
itb->must_recalc = EINA_TRUE;
|
2011-05-24 04:41:00 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->calc_job) ecore_job_del(sd->calc_job);
|
|
|
|
sd->calc_job = ecore_job_add(_calc_job, sd);
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
minw = vmw;
|
|
|
|
minh = vmh;
|
|
|
|
}
|
|
|
|
else if (sd->mode == ELM_LIST_LIMIT)
|
From: Jeonghyun Yun <jh0506.yun@samsung.com>
Subject: [E-devel] [Patch] elm_genlist multi-touch smart callbacks
added
I added 6 multi-touch smart callbacks in elm_genlist, please refer to
below.
"multi,sweep,left" - Genlist has been multi-touch swept left.
"multi,sweep,right" - Genlist has been multi-touch swept right.
"multi,sweep,top" - Genlist has been multi-touch swept top.
"multi,sweep,bottom" - Genlist has been multi-touch swept bottom.
"multi,pinch,out" - Genlist has been multi-touch pinched out.
"multi,pinch,in" - Genlist has been multi-touch pinched in.
I think these smart callbacks are very useful for elm_genlist
multi-touch
effect.
If this patch have any issue, please let me know.
SVN revision: 55878
2011-01-05 02:28:23 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
maxw = -1;
|
|
|
|
minw = vmw + sd->realminw;
|
From: Jeonghyun Yun <jh0506.yun@samsung.com>
Subject: [E-devel] [Patch] elm_genlist multi-touch smart callbacks
added
I added 6 multi-touch smart callbacks in elm_genlist, please refer to
below.
"multi,sweep,left" - Genlist has been multi-touch swept left.
"multi,sweep,right" - Genlist has been multi-touch swept right.
"multi,sweep,top" - Genlist has been multi-touch swept top.
"multi,sweep,bottom" - Genlist has been multi-touch swept bottom.
"multi,pinch,out" - Genlist has been multi-touch pinched out.
"multi,pinch,in" - Genlist has been multi-touch pinched in.
I think these smart callbacks are very useful for elm_genlist
multi-touch
effect.
If this patch have any issue, please let me know.
SVN revision: 55878
2011-01-05 02:28:23 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
else
|
2010-01-18 22:54:27 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
minw = vmw;
|
|
|
|
minh = vmh;
|
2010-01-18 22:54:27 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
|
|
|
|
evas_object_size_hint_min_set(obj, minw, minh);
|
|
|
|
evas_object_size_hint_max_set(obj, maxw, maxh);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_contract_emit(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it2;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,contract_flip", "");
|
|
|
|
it->item->tree_effect_finished = EINA_FALSE;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH (it->item->items, l, it2)
|
|
|
|
if (it2) _item_contract_emit(it2);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
_item_tree_effect_before(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it2;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH (it->item->items, l, it2)
|
2009-09-07 23:22:11 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it2->parent && (it == it2->parent))
|
2010-01-18 22:54:27 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!it2->realized)
|
|
|
|
it2->item->tree_effect_hide_me = EINA_TRUE;
|
|
|
|
if (GL_IT(it)->wsd->move_effect_mode ==
|
|
|
|
ELM_GENLIST_TREE_EFFECT_EXPAND)
|
|
|
|
edje_object_signal_emit(VIEW(it2), "elm,state,hide", "");
|
|
|
|
else if (GL_IT(it)->wsd->move_effect_mode ==
|
|
|
|
ELM_GENLIST_TREE_EFFECT_CONTRACT)
|
|
|
|
_item_contract_emit(it2);
|
2010-01-18 22:54:27 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
}
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
2011-06-01 20:10:11 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_item_position(Elm_Gen_Item *it,
|
|
|
|
Evas_Object *view,
|
|
|
|
Evas_Coord it_x,
|
|
|
|
Evas_Coord it_y)
|
|
|
|
{
|
|
|
|
if (!it) return;
|
|
|
|
if (!view) return;
|
2011-06-01 20:10:11 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_event_freeze
|
|
|
|
(evas_object_evas_get(ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj));
|
|
|
|
evas_object_resize(view, it->item->w, it->item->h);
|
|
|
|
evas_object_move(view, it_x, it_y);
|
|
|
|
evas_object_show(view);
|
|
|
|
evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj));
|
|
|
|
evas_event_thaw_eval
|
|
|
|
(evas_object_evas_get(ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj));
|
|
|
|
}
|
2011-06-01 20:10:11 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_item_tree_effect(Elm_Genlist_Smart_Data *sd,
|
|
|
|
int y)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it = NULL, *expanded_next_it;
|
2011-06-01 20:10:11 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
expanded_next_it = sd->expanded_next_item;
|
|
|
|
|
|
|
|
if (sd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_EXPAND)
|
2009-09-07 23:20:32 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
it = (Elm_Gen_Item *)elm_genlist_item_prev_get
|
|
|
|
((Elm_Object_Item *)expanded_next_it);
|
|
|
|
while (it)
|
2009-09-07 23:20:32 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->item->expanded_depth <=
|
|
|
|
expanded_next_it->item->expanded_depth) break;
|
|
|
|
if (it->item->scrl_y &&
|
|
|
|
(it->item->scrl_y <= expanded_next_it->item->old_scrl_y + y)
|
|
|
|
&& (it->item->expanded_depth >
|
|
|
|
expanded_next_it->item->expanded_depth))
|
2009-09-07 23:20:32 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!it->item->tree_effect_finished)
|
|
|
|
{
|
|
|
|
edje_object_signal_emit(VIEW(it), "flip_item", "");
|
|
|
|
_item_position
|
|
|
|
(it, VIEW(it), it->item->scrl_x, it->item->scrl_y);
|
|
|
|
it->item->tree_effect_finished = EINA_TRUE;
|
|
|
|
}
|
2009-09-07 23:20:32 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
it = (Elm_Gen_Item *)elm_genlist_item_prev_get
|
|
|
|
((Elm_Object_Item *)it);
|
2009-09-07 23:20:32 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
}
|
|
|
|
else if (sd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_CONTRACT)
|
|
|
|
{
|
|
|
|
it = (Elm_Gen_Item *)elm_genlist_item_prev_get
|
|
|
|
((Elm_Object_Item *)expanded_next_it);
|
|
|
|
while (it)
|
2009-09-07 23:20:32 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((it->item->scrl_y > expanded_next_it->item->old_scrl_y + y) &&
|
|
|
|
(it->item->expanded_depth >
|
|
|
|
expanded_next_it->item->expanded_depth))
|
2009-09-07 23:20:32 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!it->item->tree_effect_finished)
|
|
|
|
{
|
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,hide", "");
|
|
|
|
it->item->tree_effect_finished = EINA_TRUE;
|
|
|
|
}
|
2009-09-07 23:20:32 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
else
|
|
|
|
break;
|
|
|
|
it = (Elm_Gen_Item *)elm_genlist_item_prev_get
|
|
|
|
((Elm_Object_Item *)it);
|
2009-09-07 23:20:32 -07:00
|
|
|
}
|
|
|
|
}
|
2009-05-12 03:16:49 -07:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_item_sub_items_clear(Elm_Gen_Item *it)
|
2009-09-01 03:42:52 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Eina_List *tl = NULL, *l;
|
|
|
|
Elm_Object_Item *it2;
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
|
2011-06-01 20:10:11 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EINA_LIST_FOREACH (it->item->items, l, it2)
|
|
|
|
tl = eina_list_append(tl, it2);
|
|
|
|
EINA_LIST_FREE (tl, it2)
|
|
|
|
elm_object_item_del(it2);
|
|
|
|
}
|
2011-06-01 20:10:11 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_item_auto_scroll(Elm_Genlist_Smart_Data *sd)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *tmp_item = NULL;
|
|
|
|
|
|
|
|
if ((sd->expanded_item) && (sd->auto_scroll_enabled))
|
|
|
|
{
|
|
|
|
tmp_item = eina_list_data_get
|
|
|
|
(eina_list_last(sd->expanded_item->item->items));
|
|
|
|
if (!tmp_item) return;
|
|
|
|
sd->show_item = tmp_item;
|
|
|
|
sd->bring_in = EINA_TRUE;
|
|
|
|
sd->scroll_to_type = ELM_GENLIST_ITEM_SCROLLTO_IN;
|
|
|
|
if ((sd->show_item->item->queued) || (!sd->show_item->item->mincalcd))
|
2011-06-01 20:10:11 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->show_item->item->show_me = EINA_TRUE;
|
|
|
|
sd->auto_scroll_enabled = EINA_FALSE;
|
2011-06-01 20:10:11 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
else
|
|
|
|
_item_scroll(sd);
|
2011-06-01 20:10:11 -07:00
|
|
|
}
|
2009-09-23 15:56:47 -07:00
|
|
|
}
|
2009-09-01 03:42:52 -07:00
|
|
|
|
2010-10-15 04:24:46 -07:00
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_tree_effect_finish(Elm_Genlist_Smart_Data *sd)
|
2010-10-15 04:24:46 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = NULL;
|
|
|
|
const Eina_List *l;
|
2010-10-15 04:24:46 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->tree_effect_animator)
|
2010-10-15 04:24:46 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_CONTRACT)
|
|
|
|
_item_sub_items_clear(sd->expanded_item);
|
2010-10-15 04:24:46 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EINA_LIST_FOREACH (sd->expanded_item->item->items, l, it)
|
|
|
|
{
|
|
|
|
it->item->tree_effect_finished = EINA_TRUE;
|
|
|
|
it->item->old_scrl_y = it->item->scrl_y;
|
|
|
|
if (GL_IT(it)->wsd->move_effect_mode ==
|
|
|
|
ELM_GENLIST_TREE_EFFECT_EXPAND)
|
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,show", "");
|
|
|
|
}
|
|
|
|
}
|
2010-10-15 04:24:46 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_auto_scroll(sd);
|
|
|
|
evas_object_lower(sd->alpha_bg);
|
|
|
|
evas_object_hide(sd->alpha_bg);
|
|
|
|
sd->move_effect_mode = ELM_GENLIST_TREE_EFFECT_NONE;
|
|
|
|
if (sd->move_items) sd->move_items = eina_list_free(sd->move_items);
|
2010-10-15 04:24:46 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_object_smart_callback_call(sd->pan_obj, "changed", NULL);
|
|
|
|
evas_object_smart_callback_call
|
|
|
|
(ELM_WIDGET_DATA(sd)->obj, SIG_TREE_EFFECT_FINISHED, NULL);
|
|
|
|
evas_object_smart_changed(sd->pan_obj);
|
From: Jeonghyun Yun <jh0506.yun@samsung.com>
Subject: [E-devel] [Patch] elm_genlist multi-touch smart callbacks
added
I added 6 multi-touch smart callbacks in elm_genlist, please refer to
below.
"multi,sweep,left" - Genlist has been multi-touch swept left.
"multi,sweep,right" - Genlist has been multi-touch swept right.
"multi,sweep,top" - Genlist has been multi-touch swept top.
"multi,sweep,bottom" - Genlist has been multi-touch swept bottom.
"multi,pinch,out" - Genlist has been multi-touch pinched out.
"multi,pinch,in" - Genlist has been multi-touch pinched in.
I think these smart callbacks are very useful for elm_genlist
multi-touch
effect.
If this patch have any issue, please let me know.
SVN revision: 55878
2011-01-05 02:28:23 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->tree_effect_animator = NULL;
|
From: Jeonghyun Yun <jh0506.yun@samsung.com>
Subject: [E-devel] [Patch] elm_genlist multi-touch smart callbacks
added
I added 6 multi-touch smart callbacks in elm_genlist, please refer to
below.
"multi,sweep,left" - Genlist has been multi-touch swept left.
"multi,sweep,right" - Genlist has been multi-touch swept right.
"multi,sweep,top" - Genlist has been multi-touch swept top.
"multi,sweep,bottom" - Genlist has been multi-touch swept bottom.
"multi,pinch,out" - Genlist has been multi-touch pinched out.
"multi,pinch,in" - Genlist has been multi-touch pinched in.
I think these smart callbacks are very useful for elm_genlist
multi-touch
effect.
If this patch have any issue, please let me know.
SVN revision: 55878
2011-01-05 02:28:23 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_elm_genlist_item_odd_even_update(Elm_Gen_Item *it)
|
From: Jeonghyun Yun <jh0506.yun@samsung.com>
Subject: [E-devel] [Patch] elm_genlist multi-touch smart callbacks
added
I added 6 multi-touch smart callbacks in elm_genlist, please refer to
below.
"multi,sweep,left" - Genlist has been multi-touch swept left.
"multi,sweep,right" - Genlist has been multi-touch swept right.
"multi,sweep,top" - Genlist has been multi-touch swept top.
"multi,sweep,bottom" - Genlist has been multi-touch swept bottom.
"multi,pinch,out" - Genlist has been multi-touch pinched out.
"multi,pinch,in" - Genlist has been multi-touch pinched in.
I think these smart callbacks are very useful for elm_genlist
multi-touch
effect.
If this patch have any issue, please let me know.
SVN revision: 55878
2011-01-05 02:28:23 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!it->item->nostacking)
|
From: Jeonghyun Yun <jh0506.yun@samsung.com>
Subject: [E-devel] [Patch] elm_genlist multi-touch smart callbacks
added
I added 6 multi-touch smart callbacks in elm_genlist, please refer to
below.
"multi,sweep,left" - Genlist has been multi-touch swept left.
"multi,sweep,right" - Genlist has been multi-touch swept right.
"multi,sweep,top" - Genlist has been multi-touch swept top.
"multi,sweep,bottom" - Genlist has been multi-touch swept bottom.
"multi,pinch,out" - Genlist has been multi-touch pinched out.
"multi,pinch,in" - Genlist has been multi-touch pinched in.
I think these smart callbacks are very useful for elm_genlist
multi-touch
effect.
If this patch have any issue, please let me know.
SVN revision: 55878
2011-01-05 02:28:23 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((it->item->order_num_in & 0x1) ^ it->item->stacking_even)
|
From: Jeonghyun Yun <jh0506.yun@samsung.com>
Subject: [E-devel] [Patch] elm_genlist multi-touch smart callbacks
added
I added 6 multi-touch smart callbacks in elm_genlist, please refer to
below.
"multi,sweep,left" - Genlist has been multi-touch swept left.
"multi,sweep,right" - Genlist has been multi-touch swept right.
"multi,sweep,top" - Genlist has been multi-touch swept top.
"multi,sweep,bottom" - Genlist has been multi-touch swept bottom.
"multi,pinch,out" - Genlist has been multi-touch pinched out.
"multi,pinch,in" - Genlist has been multi-touch pinched in.
I think these smart callbacks are very useful for elm_genlist
multi-touch
effect.
If this patch have any issue, please let me know.
SVN revision: 55878
2011-01-05 02:28:23 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->deco_all_view) evas_object_lower(it->deco_all_view);
|
|
|
|
else evas_object_lower(VIEW(it));
|
From: Jeonghyun Yun <jh0506.yun@samsung.com>
Subject: [E-devel] [Patch] elm_genlist multi-touch smart callbacks
added
I added 6 multi-touch smart callbacks in elm_genlist, please refer to
below.
"multi,sweep,left" - Genlist has been multi-touch swept left.
"multi,sweep,right" - Genlist has been multi-touch swept right.
"multi,sweep,top" - Genlist has been multi-touch swept top.
"multi,sweep,bottom" - Genlist has been multi-touch swept bottom.
"multi,pinch,out" - Genlist has been multi-touch pinched out.
"multi,pinch,in" - Genlist has been multi-touch pinched in.
I think these smart callbacks are very useful for elm_genlist
multi-touch
effect.
If this patch have any issue, please let me know.
SVN revision: 55878
2011-01-05 02:28:23 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->deco_all_view) evas_object_raise(it->deco_all_view);
|
|
|
|
else evas_object_raise(VIEW(it));
|
From: Jeonghyun Yun <jh0506.yun@samsung.com>
Subject: [E-devel] [Patch] elm_genlist multi-touch smart callbacks
added
I added 6 multi-touch smart callbacks in elm_genlist, please refer to
below.
"multi,sweep,left" - Genlist has been multi-touch swept left.
"multi,sweep,right" - Genlist has been multi-touch swept right.
"multi,sweep,top" - Genlist has been multi-touch swept top.
"multi,sweep,bottom" - Genlist has been multi-touch swept bottom.
"multi,pinch,out" - Genlist has been multi-touch pinched out.
"multi,pinch,in" - Genlist has been multi-touch pinched in.
I think these smart callbacks are very useful for elm_genlist
multi-touch
effect.
If this patch have any issue, please let me know.
SVN revision: 55878
2011-01-05 02:28:23 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->item->order_num_in & 0x1)
|
From: Jeonghyun Yun <jh0506.yun@samsung.com>
Subject: [E-devel] [Patch] elm_genlist multi-touch smart callbacks
added
I added 6 multi-touch smart callbacks in elm_genlist, please refer to
below.
"multi,sweep,left" - Genlist has been multi-touch swept left.
"multi,sweep,right" - Genlist has been multi-touch swept right.
"multi,sweep,top" - Genlist has been multi-touch swept top.
"multi,sweep,bottom" - Genlist has been multi-touch swept bottom.
"multi,pinch,out" - Genlist has been multi-touch pinched out.
"multi,pinch,in" - Genlist has been multi-touch pinched in.
I think these smart callbacks are very useful for elm_genlist
multi-touch
effect.
If this patch have any issue, please let me know.
SVN revision: 55878
2011-01-05 02:28:23 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,odd", "elm");
|
|
|
|
if (it->deco_all_view)
|
|
|
|
edje_object_signal_emit(it->deco_all_view, "elm,state,odd", "elm");
|
From: Jeonghyun Yun <jh0506.yun@samsung.com>
Subject: [E-devel] [Patch] elm_genlist multi-touch smart callbacks
added
I added 6 multi-touch smart callbacks in elm_genlist, please refer to
below.
"multi,sweep,left" - Genlist has been multi-touch swept left.
"multi,sweep,right" - Genlist has been multi-touch swept right.
"multi,sweep,top" - Genlist has been multi-touch swept top.
"multi,sweep,bottom" - Genlist has been multi-touch swept bottom.
"multi,pinch,out" - Genlist has been multi-touch pinched out.
"multi,pinch,in" - Genlist has been multi-touch pinched in.
I think these smart callbacks are very useful for elm_genlist
multi-touch
effect.
If this patch have any issue, please let me know.
SVN revision: 55878
2011-01-05 02:28:23 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
else
|
From: Jeonghyun Yun <jh0506.yun@samsung.com>
Subject: [E-devel] [Patch] elm_genlist multi-touch smart callbacks
added
I added 6 multi-touch smart callbacks in elm_genlist, please refer to
below.
"multi,sweep,left" - Genlist has been multi-touch swept left.
"multi,sweep,right" - Genlist has been multi-touch swept right.
"multi,sweep,top" - Genlist has been multi-touch swept top.
"multi,sweep,bottom" - Genlist has been multi-touch swept bottom.
"multi,pinch,out" - Genlist has been multi-touch pinched out.
"multi,pinch,in" - Genlist has been multi-touch pinched in.
I think these smart callbacks are very useful for elm_genlist
multi-touch
effect.
If this patch have any issue, please let me know.
SVN revision: 55878
2011-01-05 02:28:23 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,even", "elm");
|
|
|
|
if (it->deco_all_view)
|
|
|
|
edje_object_signal_emit(it->deco_all_view, "elm,state,even", "elm");
|
From: Jeonghyun Yun <jh0506.yun@samsung.com>
Subject: [E-devel] [Patch] elm_genlist multi-touch smart callbacks
added
I added 6 multi-touch smart callbacks in elm_genlist, please refer to
below.
"multi,sweep,left" - Genlist has been multi-touch swept left.
"multi,sweep,right" - Genlist has been multi-touch swept right.
"multi,sweep,top" - Genlist has been multi-touch swept top.
"multi,sweep,bottom" - Genlist has been multi-touch swept bottom.
"multi,pinch,out" - Genlist has been multi-touch pinched out.
"multi,pinch,in" - Genlist has been multi-touch pinched in.
I think these smart callbacks are very useful for elm_genlist
multi-touch
effect.
If this patch have any issue, please let me know.
SVN revision: 55878
2011-01-05 02:28:23 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_order_update(const Eina_Inlist *l,
|
|
|
|
int start)
|
From: Jeonghyun Yun <jh0506.yun@samsung.com>
Subject: [E-devel] [Patch] elm_genlist multi-touch smart callbacks
added
I added 6 multi-touch smart callbacks in elm_genlist, please refer to
below.
"multi,sweep,left" - Genlist has been multi-touch swept left.
"multi,sweep,right" - Genlist has been multi-touch swept right.
"multi,sweep,top" - Genlist has been multi-touch swept top.
"multi,sweep,bottom" - Genlist has been multi-touch swept bottom.
"multi,pinch,out" - Genlist has been multi-touch pinched out.
"multi,pinch,in" - Genlist has been multi-touch pinched in.
I think these smart callbacks are very useful for elm_genlist
multi-touch
effect.
If this patch have any issue, please let me know.
SVN revision: 55878
2011-01-05 02:28:23 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it, *it2;
|
From: Jeonghyun Yun <jh0506.yun@samsung.com>
Subject: [E-devel] [Patch] elm_genlist multi-touch smart callbacks
added
I added 6 multi-touch smart callbacks in elm_genlist, please refer to
below.
"multi,sweep,left" - Genlist has been multi-touch swept left.
"multi,sweep,right" - Genlist has been multi-touch swept right.
"multi,sweep,top" - Genlist has been multi-touch swept top.
"multi,sweep,bottom" - Genlist has been multi-touch swept bottom.
"multi,pinch,out" - Genlist has been multi-touch pinched out.
"multi,pinch,in" - Genlist has been multi-touch pinched in.
I think these smart callbacks are very useful for elm_genlist
multi-touch
effect.
If this patch have any issue, please let me know.
SVN revision: 55878
2011-01-05 02:28:23 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
for (it = ELM_GEN_ITEM_FROM_INLIST(l); l; l = l->next,
|
|
|
|
it = ELM_GEN_ITEM_FROM_INLIST(l))
|
|
|
|
{
|
|
|
|
it->item->order_num_in = start++;
|
|
|
|
_elm_genlist_item_odd_even_update(it);
|
|
|
|
it2 = ELM_GEN_ITEM_FROM_INLIST(l->next);
|
|
|
|
if (it2 && (it->item->order_num_in != it2->item->order_num_in))
|
|
|
|
return;
|
|
|
|
}
|
From: Jeonghyun Yun <jh0506.yun@samsung.com>
Subject: [E-devel] [Patch] elm_genlist multi-touch smart callbacks
added
I added 6 multi-touch smart callbacks in elm_genlist, please refer to
below.
"multi,sweep,left" - Genlist has been multi-touch swept left.
"multi,sweep,right" - Genlist has been multi-touch swept right.
"multi,sweep,top" - Genlist has been multi-touch swept top.
"multi,sweep,bottom" - Genlist has been multi-touch swept bottom.
"multi,pinch,out" - Genlist has been multi-touch pinched out.
"multi,pinch,in" - Genlist has been multi-touch pinched in.
I think these smart callbacks are very useful for elm_genlist
multi-touch
effect.
If this patch have any issue, please let me know.
SVN revision: 55878
2011-01-05 02:28:23 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_elm_genlist_item_state_update(Elm_Gen_Item *it,
|
|
|
|
Item_Cache *itc)
|
From: Jeonghyun Yun <jh0506.yun@samsung.com>
Subject: [E-devel] [Patch] elm_genlist multi-touch smart callbacks
added
I added 6 multi-touch smart callbacks in elm_genlist, please refer to
below.
"multi,sweep,left" - Genlist has been multi-touch swept left.
"multi,sweep,right" - Genlist has been multi-touch swept right.
"multi,sweep,top" - Genlist has been multi-touch swept top.
"multi,sweep,bottom" - Genlist has been multi-touch swept bottom.
"multi,pinch,out" - Genlist has been multi-touch pinched out.
"multi,pinch,in" - Genlist has been multi-touch pinched in.
I think these smart callbacks are very useful for elm_genlist
multi-touch
effect.
If this patch have any issue, please let me know.
SVN revision: 55878
2011-01-05 02:28:23 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (itc)
|
2011-06-01 20:10:11 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->selected != itc->selected)
|
2011-09-05 05:16:36 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->selected)
|
|
|
|
{
|
|
|
|
edje_object_signal_emit
|
|
|
|
(VIEW(it), "elm,state,selected", "elm");
|
|
|
|
if (it->deco_all_view)
|
|
|
|
edje_object_signal_emit
|
|
|
|
(it->deco_all_view, "elm,state,selected", "elm");
|
|
|
|
}
|
2011-06-01 20:10:11 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
if (elm_widget_item_disabled_get(it) != itc->disabled)
|
2011-05-24 04:41:00 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (elm_widget_item_disabled_get(it))
|
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
|
|
|
|
if (it->deco_all_view)
|
|
|
|
edje_object_signal_emit
|
|
|
|
(it->deco_all_view, "elm,state,disabled", "elm");
|
2011-05-24 04:41:00 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->item->expanded != itc->expanded)
|
2010-03-26 21:17:01 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->item->expanded)
|
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,expanded", "elm");
|
|
|
|
if (it->deco_all_view)
|
|
|
|
edje_object_signal_emit
|
|
|
|
(it->deco_all_view, "elm,state,expanded", "elm");
|
2010-03-26 21:17:01 -07:00
|
|
|
}
|
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
else
|
2009-02-16 23:50:35 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->selected)
|
2011-05-24 04:41:00 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
|
|
|
|
if (it->deco_all_view)
|
|
|
|
edje_object_signal_emit
|
|
|
|
(it->deco_all_view, "elm,state,selected", "elm");
|
2011-05-24 04:41:00 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
if (elm_widget_item_disabled_get(it))
|
2010-10-15 04:51:15 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
|
|
|
|
if (it->deco_all_view)
|
|
|
|
edje_object_signal_emit
|
|
|
|
(it->deco_all_view, "elm,state,disabled", "elm");
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->item->expanded)
|
2010-10-15 04:51:15 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,expanded", "elm");
|
|
|
|
if (it->deco_all_view)
|
|
|
|
edje_object_signal_emit
|
|
|
|
(it->deco_all_view, "elm,state,expanded", "elm");
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
2009-02-16 23:50:35 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-20 00:58:42 -07:00
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_elm_genlist_item_index_update(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
if (it->position_update || it->item->block->position_update)
|
|
|
|
{
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_INDEX_UPDATE, it);
|
|
|
|
it->position_update = EINA_FALSE;
|
|
|
|
}
|
2012-03-20 00:58:42 -07:00
|
|
|
}
|
|
|
|
|
2009-03-12 22:50:38 -07:00
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_text_realize(Elm_Gen_Item *it,
|
|
|
|
Evas_Object *target,
|
|
|
|
Eina_List **source,
|
|
|
|
const char *parts)
|
2009-03-12 22:50:38 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->itc->func.text_get)
|
|
|
|
{
|
|
|
|
const Eina_List *l;
|
|
|
|
const char *key;
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!(*source))
|
|
|
|
*source = elm_widget_stringlist_get
|
|
|
|
(edje_object_data_get(target, "texts"));
|
|
|
|
EINA_LIST_FOREACH (*source, l, key)
|
|
|
|
{
|
|
|
|
if (parts && fnmatch(parts, key, FNM_PERIOD))
|
|
|
|
continue;
|
2009-03-12 22:50:38 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
char *s = it->itc->func.text_get
|
|
|
|
((void *)it->base.data, WIDGET(it), key);
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (s)
|
|
|
|
{
|
|
|
|
edje_object_part_text_escaped_set(target, key, s);
|
|
|
|
free(s);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
edje_object_part_text_set(target, key, "");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-03-12 22:50:38 -07:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static Eina_List *
|
|
|
|
_item_mode_content_realize(Elm_Gen_Item *it,
|
|
|
|
Evas_Object *target,
|
|
|
|
Eina_List **source,
|
|
|
|
const char *parts,
|
|
|
|
Eina_List **contents_list)
|
2009-03-12 22:50:38 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Eina_List *res = *contents_list;
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->itc->func.content_get)
|
|
|
|
{
|
|
|
|
const Eina_List *l;
|
|
|
|
const char *key;
|
|
|
|
Evas_Object *ic;
|
2009-03-12 22:50:38 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EINA_LIST_FOREACH (*source, l, key)
|
|
|
|
{
|
|
|
|
if (parts && fnmatch(parts, key, FNM_PERIOD))
|
|
|
|
continue;
|
2011-04-21 04:47:36 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ic = it->itc->func.content_get
|
|
|
|
((void *)it->base.data, WIDGET(it), key);
|
2011-05-29 19:31:21 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (ic)
|
|
|
|
{
|
|
|
|
res = eina_list_append(res, ic);
|
|
|
|
edje_object_part_swallow(target, key, ic);
|
|
|
|
evas_object_show(ic);
|
|
|
|
elm_widget_sub_object_add(WIDGET(it), ic);
|
|
|
|
if (elm_widget_item_disabled_get(it))
|
|
|
|
elm_widget_disabled_set(ic, EINA_TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return res;
|
2011-04-21 04:47:36 -07:00
|
|
|
}
|
|
|
|
|
2010-11-05 23:02:22 -07:00
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_state_realize(Elm_Gen_Item *it,
|
|
|
|
Evas_Object *target,
|
|
|
|
Eina_List **source,
|
|
|
|
const char *parts)
|
2010-11-05 23:02:22 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->itc->func.state_get)
|
2010-12-07 11:18:14 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
const Eina_List *l;
|
|
|
|
const char *key;
|
|
|
|
char buf[4096];
|
2010-12-07 11:18:14 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!(*source))
|
|
|
|
*source = elm_widget_stringlist_get
|
|
|
|
(edje_object_data_get(target, "states"));
|
|
|
|
EINA_LIST_FOREACH (*source, l, key)
|
|
|
|
{
|
|
|
|
if (parts && fnmatch(parts, key, FNM_PERIOD))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
Eina_Bool on = it->itc->func.state_get
|
|
|
|
((void *)it->base.data, WIDGET(it), key);
|
|
|
|
|
|
|
|
if (on)
|
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "elm,state,%s,active", key);
|
|
|
|
edje_object_signal_emit(target, buf, "elm");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "elm,state,%s,passive", key);
|
|
|
|
edje_object_signal_emit(target, buf, "elm");
|
|
|
|
}
|
|
|
|
}
|
2010-12-07 11:18:14 -08:00
|
|
|
}
|
2010-11-05 23:02:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_decorate_all_item_position(Elm_Gen_Item *it,
|
|
|
|
int itx,
|
|
|
|
int ity)
|
2010-11-05 23:02:22 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((!it) || (!GL_IT(it)->wsd->decorate_all_mode)) return;
|
|
|
|
evas_object_resize(it->deco_all_view, it->item->w, it->item->h);
|
|
|
|
evas_object_move(it->deco_all_view, itx, ity);
|
2010-11-05 23:02:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_decorate_all_item_realize(Elm_Gen_Item *it,
|
|
|
|
Eina_Bool effect_on)
|
2010-11-05 23:02:22 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
char buf[1024];
|
|
|
|
const char *stacking;
|
|
|
|
const char *stacking_even;
|
2010-12-07 11:18:14 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((!it) || (it->item->decorate_all_item_realized) ||
|
|
|
|
(it->generation < GL_IT(it)->wsd->generation))
|
|
|
|
return;
|
2010-12-07 11:18:14 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
it->deco_all_view = edje_object_add(evas_object_evas_get(WIDGET(it)));
|
|
|
|
edje_object_scale_set(it->deco_all_view, elm_widget_scale_get(WIDGET(it)) *
|
|
|
|
elm_config_scale_get());
|
|
|
|
evas_object_smart_member_add(it->deco_all_view, GL_IT(it)->wsd->pan_obj);
|
|
|
|
elm_widget_sub_object_add(WIDGET(it), it->deco_all_view);
|
|
|
|
|
|
|
|
if (it->item->type & ELM_GENLIST_ITEM_TREE)
|
|
|
|
strncpy(buf, "tree", sizeof(buf));
|
|
|
|
else strncpy(buf, "item", sizeof(buf));
|
|
|
|
if (GL_IT(it)->wsd->mode == ELM_LIST_COMPRESS)
|
|
|
|
strncat(buf, "_compress", sizeof(buf) - strlen(buf));
|
|
|
|
|
|
|
|
strncat(buf, "/", sizeof(buf) - strlen(buf));
|
|
|
|
strncat(buf, it->itc->decorate_all_item_style, sizeof(buf) - strlen(buf));
|
|
|
|
|
|
|
|
elm_widget_theme_object_set(WIDGET(it), it->deco_all_view, "genlist", buf,
|
|
|
|
elm_widget_style_get(WIDGET(it)));
|
|
|
|
|
|
|
|
stacking_even = edje_object_data_get(VIEW(it), "stacking_even");
|
|
|
|
if (!stacking_even) stacking_even = "above";
|
|
|
|
it->item->stacking_even = !!strcmp("above", stacking_even);
|
|
|
|
|
|
|
|
stacking = edje_object_data_get(VIEW(it), "stacking");
|
|
|
|
if (!stacking) stacking = "yes";
|
|
|
|
it->item->nostacking = !!strcmp("yes", stacking);
|
|
|
|
|
|
|
|
edje_object_mirrored_set
|
|
|
|
(it->deco_all_view, elm_widget_mirrored_get(WIDGET(it)));
|
|
|
|
|
|
|
|
_elm_genlist_item_odd_even_update(it);
|
|
|
|
_elm_genlist_item_state_update(it, NULL);
|
|
|
|
|
|
|
|
if (effect_on)
|
|
|
|
edje_object_signal_emit
|
|
|
|
(it->deco_all_view, "elm,state,decorate,enabled,effect", "elm");
|
|
|
|
else
|
|
|
|
edje_object_signal_emit
|
|
|
|
(it->deco_all_view, "elm,state,decorate,enabled", "elm");
|
|
|
|
|
|
|
|
_item_mouse_callbacks_del(it, VIEW(it));
|
|
|
|
_item_mouse_callbacks_add(it, it->deco_all_view);
|
|
|
|
|
|
|
|
_item_text_realize(it, it->deco_all_view, &it->item->deco_all_texts, NULL);
|
|
|
|
if (it->flipped)
|
|
|
|
edje_object_signal_emit
|
|
|
|
(it->deco_all_view, "elm,state,flip,enabled", "elm");
|
|
|
|
if (!it->item->deco_all_contents)
|
|
|
|
it->item->deco_all_contents = elm_widget_stringlist_get
|
|
|
|
(edje_object_data_get(it->deco_all_view, "contents"));
|
|
|
|
it->item->deco_all_content_objs =
|
|
|
|
_item_mode_content_realize(it, it->deco_all_view,
|
|
|
|
&it->item->deco_all_contents, NULL,
|
|
|
|
&it->item->deco_all_content_objs);
|
|
|
|
_item_state_realize
|
|
|
|
(it, it->deco_all_view, &it->item->deco_all_states, NULL);
|
|
|
|
edje_object_part_swallow
|
|
|
|
(it->deco_all_view, "elm.swallow.decorate.content", VIEW(it));
|
|
|
|
|
|
|
|
_decorate_all_item_position(it, it->item->scrl_x, it->item->scrl_y);
|
|
|
|
evas_object_show(it->deco_all_view);
|
|
|
|
|
|
|
|
if (it->selected)
|
|
|
|
edje_object_signal_emit(it->deco_all_view, "elm,state,selected", "elm");
|
|
|
|
|
|
|
|
it->item->decorate_all_item_realized = EINA_TRUE;
|
|
|
|
it->want_unrealize = EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_cache_free(Item_Cache *itc)
|
|
|
|
{
|
|
|
|
if (itc->spacer) evas_object_del(itc->spacer);
|
|
|
|
if (itc->base_view) evas_object_del(itc->base_view);
|
|
|
|
eina_stringshare_del(itc->item_style);
|
|
|
|
free(itc);
|
2010-11-05 23:02:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Item_Cache *
|
2011-10-21 01:52:03 -07:00
|
|
|
_item_cache_find(Elm_Gen_Item *it)
|
2010-11-05 23:02:22 -07:00
|
|
|
{
|
2010-12-07 11:18:14 -08:00
|
|
|
Item_Cache *itc;
|
2011-04-22 02:56:22 -07:00
|
|
|
Eina_Bool tree = 0;
|
2010-12-07 11:18:14 -08:00
|
|
|
|
2012-03-07 04:57:13 -08:00
|
|
|
if (it->item->type & ELM_GENLIST_ITEM_TREE) tree = 1;
|
2012-07-16 14:56:30 -07:00
|
|
|
EINA_INLIST_FOREACH (GL_IT(it)->wsd->item_cache, itc)
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
|
|
|
if ((itc->selected) || (itc->disabled) || (itc->expanded))
|
|
|
|
continue;
|
2012-07-16 14:56:30 -07:00
|
|
|
|
2011-03-22 00:54:24 -07:00
|
|
|
if ((itc->tree == tree) &&
|
2012-03-01 17:20:50 -08:00
|
|
|
(((!it->itc->item_style) && (!itc->item_style)) ||
|
elm genlist: Added elm_genlist_item_flip_get/set APIs. Patch by
Hyoyoung Chang <hyoyoung@gmail.com>
On Wed, Feb 29, 2012 at 9:17 PM, Hyoyoung Chang <hyoyoung@gmail.com>
wrote:
> Dear all.
>
> I made a patch to introduce new genlist item mode.
> Two public apis are added.
> +EAPI void elm_genlist_item_flip_set(Elm_Object_Item *it, Eina_Bool
flip);
> +EAPI Eina_Bool elm_genlist_item_flip_get(Elm_Object_Item *it);
>
> It provides on-the-flying item change. It works like that a new item
> added on existed item.
> In elementary test, you can test it.
> It's useful at adding widgets or show buttons in genlist item.
>
> Thanks.
On Mon, Mar 5, 2012 at 5:56 PM, Hyoyoung Chang <hyoyoung@gmail.com>
wrote:
> Hello, I modifed fliP_set api to use ecore_job.
> It resolved version of mouse_{move, up} bugs.
>
SVN revision: 68727
2012-03-05 07:03:12 -08:00
|
|
|
(it->itc->item_style && itc->item_style &&
|
2012-07-16 14:56:30 -07:00
|
|
|
(!strcmp(it->itc->item_style, itc->item_style)))))
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
GL_IT(it)->wsd->item_cache =
|
|
|
|
eina_inlist_remove
|
|
|
|
(GL_IT(it)->wsd->item_cache, EINA_INLIST_GET(itc));
|
|
|
|
GL_IT(it)->wsd->item_cache_count--;
|
|
|
|
|
2011-03-22 00:54:24 -07:00
|
|
|
return itc;
|
|
|
|
}
|
|
|
|
}
|
2010-12-07 11:18:14 -08:00
|
|
|
return NULL;
|
2010-11-05 23:02:22 -07:00
|
|
|
}
|
|
|
|
|
2011-12-26 06:30:21 -08:00
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_expand_toggle_signal_cb(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
2011-12-26 06:30:21 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = data;
|
|
|
|
|
|
|
|
if (it->item->expanded)
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_CONTRACT_REQUEST, it);
|
|
|
|
else
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_EXPAND_REQUEST, it);
|
2011-12-26 06:30:21 -08:00
|
|
|
}
|
|
|
|
|
2011-04-22 02:56:22 -07:00
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_expand_signal_cb(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
2011-04-22 02:56:22 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = data;
|
2011-04-22 02:56:22 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!it->item->expanded)
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_EXPAND_REQUEST, it);
|
2011-04-22 02:56:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_contract_signal_cb(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
2011-04-22 02:56:22 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = data;
|
|
|
|
|
|
|
|
if (it->item->expanded)
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_CONTRACT_REQUEST, it);
|
2011-04-22 02:56:22 -07:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static Eina_List *
|
|
|
|
_item_content_realize(Elm_Gen_Item *it,
|
|
|
|
Evas_Object *target,
|
|
|
|
Eina_List **source,
|
|
|
|
const char *parts)
|
2012-04-06 00:10:20 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Eina_List *res = it->content_objs;
|
2012-04-06 00:10:20 -07:00
|
|
|
|
|
|
|
if (it->itc->func.content_get)
|
|
|
|
{
|
|
|
|
const Eina_List *l;
|
|
|
|
const char *key;
|
2012-07-16 14:56:30 -07:00
|
|
|
Evas_Object *ic = NULL;
|
|
|
|
|
|
|
|
if (!(*source))
|
|
|
|
*source = elm_widget_stringlist_get
|
|
|
|
(edje_object_data_get(target, "contents"));
|
2012-04-06 00:10:20 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EINA_LIST_FOREACH (*source, l, key)
|
2012-04-06 00:10:20 -07:00
|
|
|
{
|
|
|
|
if (parts && fnmatch(parts, key, FNM_PERIOD))
|
|
|
|
continue;
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->itc->func.content_get)
|
|
|
|
ic = it->itc->func.content_get
|
|
|
|
((void *)it->base.data, WIDGET(it), key);
|
2012-04-06 00:10:20 -07:00
|
|
|
if (ic)
|
|
|
|
{
|
|
|
|
res = eina_list_append(res, ic);
|
|
|
|
edje_object_part_swallow(target, key, ic);
|
|
|
|
evas_object_show(ic);
|
|
|
|
elm_widget_sub_object_add(WIDGET(it), ic);
|
2012-05-30 01:09:09 -07:00
|
|
|
if (elm_widget_item_disabled_get(it))
|
|
|
|
elm_widget_disabled_set(ic, EINA_TRUE);
|
2012-04-06 00:10:20 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_item_realize(Elm_Gen_Item *it,
|
|
|
|
int in,
|
|
|
|
Eina_Bool calc)
|
2012-04-06 00:10:20 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Item_Cache *itc = NULL;
|
|
|
|
const char *treesize;
|
|
|
|
char buf[1024];
|
|
|
|
int tsize = 20;
|
2012-04-06 00:10:20 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->generation < GL_IT(it)->wsd->generation) return;
|
|
|
|
if (it->realized)
|
2012-04-06 00:10:20 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->item->order_num_in != in)
|
2012-04-06 00:10:20 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_order_update(EINA_INLIST_GET(it), in);
|
|
|
|
_elm_genlist_item_state_update(it, NULL);
|
|
|
|
_elm_genlist_item_index_update(it);
|
2012-04-06 00:10:20 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
return;
|
2012-04-06 00:10:20 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
it->item->order_num_in = in;
|
2012-04-06 00:10:20 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->item->nocache_once)
|
|
|
|
it->item->nocache_once = EINA_FALSE;
|
|
|
|
else if (!it->item->nocache)
|
|
|
|
itc = _item_cache_find(it);
|
|
|
|
if (itc && (!GL_IT(it)->wsd->tree_effect_enabled))
|
2011-04-22 02:56:49 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
VIEW(it) = itc->base_view;
|
|
|
|
itc->base_view = NULL;
|
|
|
|
it->spacer = itc->spacer;
|
|
|
|
itc->spacer = NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const char *stacking_even;
|
|
|
|
const char *stacking;
|
2011-04-22 02:56:49 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
VIEW(it) = edje_object_add(evas_object_evas_get(WIDGET(it)));
|
|
|
|
edje_object_scale_set(VIEW(it),
|
|
|
|
elm_widget_scale_get(WIDGET(it)) *
|
|
|
|
elm_config_scale_get());
|
|
|
|
evas_object_smart_member_add(VIEW(it), GL_IT(it)->wsd->pan_obj);
|
|
|
|
elm_widget_sub_object_add(WIDGET(it), VIEW(it));
|
2011-11-29 06:03:14 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->item->type & ELM_GENLIST_ITEM_TREE)
|
|
|
|
snprintf(buf, sizeof(buf), "tree%s/%s",
|
|
|
|
GL_IT(it)->wsd->mode == ELM_LIST_COMPRESS ? "_compress" :
|
|
|
|
"", it->itc->item_style ? : "default");
|
|
|
|
else
|
|
|
|
snprintf(buf, sizeof(buf), "item%s/%s",
|
|
|
|
GL_IT(it)->wsd->mode == ELM_LIST_COMPRESS ? "_compress" :
|
|
|
|
"", it->itc->item_style ? : "default");
|
2011-04-22 02:56:49 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_widget_theme_object_set
|
|
|
|
(WIDGET(it), VIEW(it), "genlist", buf,
|
|
|
|
elm_widget_style_get(WIDGET(it)));
|
2011-04-22 02:56:22 -07:00
|
|
|
|
2011-10-20 18:08:01 -07:00
|
|
|
stacking_even = edje_object_data_get(VIEW(it), "stacking_even");
|
2011-04-22 05:22:57 -07:00
|
|
|
if (!stacking_even) stacking_even = "above";
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->stacking_even = !!strcmp("above", stacking_even);
|
2011-04-22 02:56:22 -07:00
|
|
|
|
2011-10-20 18:08:01 -07:00
|
|
|
stacking = edje_object_data_get(VIEW(it), "stacking");
|
2011-04-22 05:22:57 -07:00
|
|
|
if (!stacking) stacking = "yes";
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->nostacking = !!strcmp("yes", stacking);
|
2011-04-22 02:56:22 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
edje_object_mirrored_set
|
|
|
|
(VIEW(it), elm_widget_mirrored_get(WIDGET(it)));
|
2010-11-05 23:02:22 -07:00
|
|
|
}
|
2011-04-22 02:56:22 -07:00
|
|
|
|
2012-05-30 02:14:45 -07:00
|
|
|
_item_order_update(EINA_INLIST_GET(it), in);
|
2011-04-22 02:56:22 -07:00
|
|
|
|
2011-10-20 18:08:01 -07:00
|
|
|
treesize = edje_object_data_get(VIEW(it), "treesize");
|
2009-03-14 11:03:19 -07:00
|
|
|
if (treesize) tsize = atoi(treesize);
|
2012-03-19 22:44:18 -07:00
|
|
|
if (!it->spacer && treesize)
|
|
|
|
{
|
|
|
|
it->spacer =
|
|
|
|
evas_object_rectangle_add(evas_object_evas_get(WIDGET(it)));
|
|
|
|
evas_object_color_set(it->spacer, 0, 0, 0, 0);
|
|
|
|
elm_widget_sub_object_add(WIDGET(it), it->spacer);
|
|
|
|
}
|
|
|
|
if (it->spacer)
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_object_size_hint_min_set
|
|
|
|
(it->spacer, (it->item->expanded_depth * tsize) *
|
|
|
|
elm_config_scale_get(), 1);
|
2012-03-19 22:44:18 -07:00
|
|
|
edje_object_part_swallow(VIEW(it), "elm.swallow.pad", it->spacer);
|
|
|
|
}
|
2009-02-12 05:39:43 -08:00
|
|
|
if (!calc)
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
edje_object_signal_callback_add
|
|
|
|
(VIEW(it), "elm,action,expand,toggle", "elm",
|
|
|
|
_expand_toggle_signal_cb, it);
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(VIEW(it), "elm,action,expand", "elm", _expand_signal_cb, it);
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(VIEW(it), "elm,action,contract", "elm", _contract_signal_cb, it);
|
2012-03-20 00:58:42 -07:00
|
|
|
_item_mouse_callbacks_add(it, VIEW(it));
|
2011-04-22 02:56:22 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((GL_IT(it)->wsd->decorate_all_mode) && (!it->deco_all_view) &&
|
2012-06-21 01:36:21 -07:00
|
|
|
(it->item->type != ELM_GENLIST_ITEM_GROUP) &&
|
2012-06-18 02:54:00 -07:00
|
|
|
(it->itc->decorate_all_item_style))
|
2012-04-03 02:56:49 -07:00
|
|
|
_decorate_all_item_realize(it, EINA_FALSE);
|
2012-02-22 23:39:10 -08:00
|
|
|
|
2011-04-22 05:22:57 -07:00
|
|
|
_elm_genlist_item_state_update(it, itc);
|
2011-12-26 06:30:21 -08:00
|
|
|
_elm_genlist_item_index_update(it);
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2012-06-26 20:23:52 -07:00
|
|
|
/* homogenous genlist shortcut */
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((calc) && (GL_IT(it)->wsd->homogeneous) && (!it->item->mincalcd) &&
|
|
|
|
((it->group && GL_IT(it)->wsd->group_item_width) ||
|
|
|
|
(!it->group && GL_IT(it)->wsd->item_width)))
|
2009-02-11 03:49:43 -08:00
|
|
|
{
|
2012-06-26 20:23:52 -07:00
|
|
|
if (it->group)
|
2011-03-29 05:43:03 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
it->item->w = it->item->minw = GL_IT(it)->wsd->group_item_width;
|
|
|
|
it->item->h = it->item->minh = GL_IT(it)->wsd->group_item_height;
|
2011-03-29 05:43:03 -07:00
|
|
|
}
|
2012-06-26 20:23:52 -07:00
|
|
|
else
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
it->item->w = it->item->minw = GL_IT(it)->wsd->item_width;
|
|
|
|
it->item->h = it->item->minh = GL_IT(it)->wsd->item_height;
|
2012-06-26 20:23:52 -07:00
|
|
|
}
|
|
|
|
it->item->mincalcd = EINA_TRUE;
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
2010-01-23 01:07:20 -08:00
|
|
|
else
|
2009-02-14 18:53:56 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (eina_list_count(it->content_objs) != 0)
|
|
|
|
ERR_ABORT("If you see this error, please notify us and we"
|
|
|
|
"will fix it");
|
2010-10-15 04:51:15 -07:00
|
|
|
|
2011-12-15 07:24:17 -08:00
|
|
|
_item_text_realize(it, VIEW(it), &it->texts, NULL);
|
2012-07-16 14:56:30 -07:00
|
|
|
it->content_objs =
|
|
|
|
_item_content_realize(it, VIEW(it), &it->contents, NULL);
|
2011-11-29 06:03:14 -08:00
|
|
|
_item_state_realize(it, VIEW(it), &it->states, NULL);
|
elm genlist: Added elm_genlist_item_flip_get/set APIs. Patch by
Hyoyoung Chang <hyoyoung@gmail.com>
On Wed, Feb 29, 2012 at 9:17 PM, Hyoyoung Chang <hyoyoung@gmail.com>
wrote:
> Dear all.
>
> I made a patch to introduce new genlist item mode.
> Two public apis are added.
> +EAPI void elm_genlist_item_flip_set(Elm_Object_Item *it, Eina_Bool
flip);
> +EAPI Eina_Bool elm_genlist_item_flip_get(Elm_Object_Item *it);
>
> It provides on-the-flying item change. It works like that a new item
> added on existed item.
> In elementary test, you can test it.
> It's useful at adding widgets or show buttons in genlist item.
>
> Thanks.
On Mon, Mar 5, 2012 at 5:56 PM, Hyoyoung Chang <hyoyoung@gmail.com>
wrote:
> Hello, I modifed fliP_set api to use ecore_job.
> It resolved version of mouse_{move, up} bugs.
>
SVN revision: 68727
2012-03-05 07:03:12 -08:00
|
|
|
if (it->flipped)
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
edje_object_signal_emit
|
|
|
|
(VIEW(it), "elm,state,flip,enabled", "elm");
|
2012-04-06 00:10:29 -07:00
|
|
|
if (!(it->item->flip_contents))
|
2012-07-16 14:56:30 -07:00
|
|
|
it->item->flip_contents = elm_widget_stringlist_get
|
|
|
|
(edje_object_data_get(VIEW(it), "flips"));
|
|
|
|
it->item->flip_content_objs = _item_mode_content_realize
|
|
|
|
(it, VIEW(it), &it->item->flip_contents, NULL,
|
|
|
|
&it->item->flip_content_objs);
|
elm genlist: Added elm_genlist_item_flip_get/set APIs. Patch by
Hyoyoung Chang <hyoyoung@gmail.com>
On Wed, Feb 29, 2012 at 9:17 PM, Hyoyoung Chang <hyoyoung@gmail.com>
wrote:
> Dear all.
>
> I made a patch to introduce new genlist item mode.
> Two public apis are added.
> +EAPI void elm_genlist_item_flip_set(Elm_Object_Item *it, Eina_Bool
flip);
> +EAPI Eina_Bool elm_genlist_item_flip_get(Elm_Object_Item *it);
>
> It provides on-the-flying item change. It works like that a new item
> added on existed item.
> In elementary test, you can test it.
> It's useful at adding widgets or show buttons in genlist item.
>
> Thanks.
On Mon, Mar 5, 2012 at 5:56 PM, Hyoyoung Chang <hyoyoung@gmail.com>
wrote:
> Hello, I modifed fliP_set api to use ecore_job.
> It resolved version of mouse_{move, up} bugs.
>
SVN revision: 68727
2012-03-05 07:03:12 -08:00
|
|
|
}
|
2010-10-15 04:51:15 -07:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
if (!it->item->mincalcd)
|
2010-10-15 04:51:15 -07:00
|
|
|
{
|
|
|
|
Evas_Coord mw = -1, mh = -1;
|
2010-10-07 12:57:20 -07:00
|
|
|
|
2012-03-07 08:22:58 -08:00
|
|
|
if (it->select_mode != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY)
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
2012-07-16 14:56:30 -07:00
|
|
|
if (GL_IT(it)->wsd->mode == ELM_LIST_COMPRESS)
|
|
|
|
mw = GL_IT(it)->wsd->prev_viewport_w;
|
|
|
|
edje_object_size_min_restricted_calc(VIEW(it), &mw, &mh, mw, mh);
|
2012-03-07 08:22:58 -08:00
|
|
|
if (it->select_mode != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY)
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->w = it->item->minw = mw;
|
|
|
|
it->item->h = it->item->minh = mh;
|
|
|
|
it->item->mincalcd = EINA_TRUE;
|
2010-01-23 01:07:20 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((!GL_IT(it)->wsd->group_item_width) && (it->group))
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
GL_IT(it)->wsd->group_item_width = mw;
|
|
|
|
GL_IT(it)->wsd->group_item_height = mh;
|
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
else if ((!GL_IT(it)->wsd->item_width) &&
|
|
|
|
(it->item->type == ELM_GENLIST_ITEM_NONE))
|
2010-10-15 04:51:15 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
GL_IT(it)->wsd->item_width = mw;
|
|
|
|
GL_IT(it)->wsd->item_height = mh;
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
|
|
|
}
|
2011-10-20 18:08:01 -07:00
|
|
|
if (!calc) evas_object_show(VIEW(it));
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
2010-09-27 11:18:37 -07:00
|
|
|
|
|
|
|
if (it->tooltip.content_cb)
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_widget_item_tooltip_content_cb_set
|
|
|
|
(it, it->tooltip.content_cb, it->tooltip.data, NULL);
|
2010-10-15 04:51:15 -07:00
|
|
|
elm_widget_item_tooltip_style_set(it, it->tooltip.style);
|
2011-12-05 09:14:07 -08:00
|
|
|
elm_widget_item_tooltip_window_mode_set(it, it->tooltip.free_size);
|
2010-09-27 11:18:37 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
if (it->mouse_cursor)
|
|
|
|
elm_widget_item_cursor_set(it, it->mouse_cursor);
|
|
|
|
|
2009-06-17 08:35:19 -07:00
|
|
|
it->realized = EINA_TRUE;
|
2010-03-26 21:17:01 -07:00
|
|
|
it->want_unrealize = EINA_FALSE;
|
2010-11-05 23:02:22 -07:00
|
|
|
|
|
|
|
if (itc) _item_cache_free(itc);
|
2011-06-03 18:52:08 -07:00
|
|
|
if (!calc)
|
2012-03-23 00:47:03 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->item->tree_effect_hide_me)
|
2012-03-23 00:47:03 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (GL_IT(it)->wsd->move_effect_mode
|
|
|
|
!= ELM_GENLIST_TREE_EFFECT_NONE)
|
2012-03-23 00:47:03 -07:00
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,hide", "");
|
2012-07-16 14:56:30 -07:00
|
|
|
it->item->tree_effect_hide_me = EINA_FALSE;
|
2012-03-23 00:47:03 -07:00
|
|
|
}
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_REALIZED, it);
|
|
|
|
}
|
2012-02-22 23:39:10 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((!calc) && (GL_IT(it)->wsd->decorate_all_mode) &&
|
|
|
|
(it->item->type != ELM_GENLIST_ITEM_GROUP))
|
2012-02-22 23:39:10 -08:00
|
|
|
{
|
2012-03-09 04:00:28 -08:00
|
|
|
if (it->itc->decorate_all_item_style)
|
2012-02-22 23:39:10 -08:00
|
|
|
{
|
2012-06-18 02:54:00 -07:00
|
|
|
if (!it->deco_all_view)
|
|
|
|
_decorate_all_item_realize(it, EINA_FALSE);
|
2012-04-06 00:10:26 -07:00
|
|
|
edje_object_message_signal_process(it->deco_all_view);
|
2012-02-22 23:39:10 -08:00
|
|
|
}
|
|
|
|
}
|
2011-10-20 18:08:01 -07:00
|
|
|
edje_object_message_signal_process(VIEW(it));
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_tree_effect_animator_cb(void *data)
|
2009-02-11 03:49:43 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
int in = 0;
|
|
|
|
const Eina_List *l;
|
|
|
|
int y = 0, dy = 0, dh = 0;
|
|
|
|
double effect_duration = 0.3, t;
|
|
|
|
Elm_Genlist_Smart_Data *sd = data;
|
|
|
|
Eina_Bool end = EINA_FALSE, vis = EINA_TRUE;
|
|
|
|
Evas_Coord ox, oy, ow, oh, cvx, cvy, cvw, cvh;
|
|
|
|
Elm_Gen_Item *it = NULL, *it2, *expanded_next_it;
|
2012-04-20 01:44:48 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
t = ((0.0 > (t = ecore_time_get() - sd->start_time)) ? 0.0 : t);
|
|
|
|
evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh);
|
|
|
|
evas_output_viewport_get
|
|
|
|
(evas_object_evas_get(sd->pan_obj), &cvx, &cvy, &cvw, &cvh);
|
|
|
|
if (t > effect_duration) end = EINA_TRUE;
|
|
|
|
|
|
|
|
// Below while statement is needed, when the genlist is resized.
|
|
|
|
it2 = sd->expanded_item;
|
|
|
|
while (it2 && vis)
|
2011-02-08 04:08:28 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_object_move(VIEW(it2), it2->item->scrl_x, it2->item->scrl_y);
|
|
|
|
vis = (ELM_RECTS_INTERSECT(it2->item->scrl_x, it2->item->scrl_y,
|
|
|
|
it2->item->w, it2->item->h, cvx, cvy, cvw,
|
|
|
|
cvh));
|
|
|
|
it2 =
|
|
|
|
(Elm_Gen_Item *)elm_genlist_item_prev_get((Elm_Object_Item *)it2);
|
2011-02-08 04:08:28 -08:00
|
|
|
}
|
2009-02-25 12:18:38 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->expanded_next_item)
|
2009-02-11 03:49:43 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
expanded_next_it = sd->expanded_next_item;
|
|
|
|
|
|
|
|
/* move items */
|
|
|
|
EINA_LIST_FOREACH (sd->move_items, l, it)
|
2010-10-15 04:51:15 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_EXPAND)
|
2010-01-23 01:07:20 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
expanded_next_it->item->old_scrl_y =
|
|
|
|
sd->expanded_item->item->old_scrl_y
|
|
|
|
+ sd->expanded_item->item->h;
|
|
|
|
if (expanded_next_it->item->scrl_y <=
|
|
|
|
expanded_next_it->item->old_scrl_y) /* did not
|
|
|
|
* calculate
|
|
|
|
* next item
|
|
|
|
* position */
|
|
|
|
expanded_next_it->item->scrl_y = cvy + cvh;
|
|
|
|
|
|
|
|
dy = ((expanded_next_it->item->scrl_y >= (cvy + cvh)) ?
|
|
|
|
cvy + cvh : expanded_next_it->item->scrl_y) -
|
|
|
|
expanded_next_it->item->old_scrl_y;
|
2010-01-23 01:07:20 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
else if (sd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_CONTRACT)
|
2010-01-23 01:07:20 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (expanded_next_it->item->scrl_y >
|
|
|
|
expanded_next_it->item->old_scrl_y) /* did not
|
|
|
|
* calculate
|
|
|
|
* next item
|
|
|
|
* position */
|
|
|
|
expanded_next_it->item->old_scrl_y = cvy + cvh;
|
|
|
|
|
|
|
|
if (expanded_next_it->item->old_scrl_y > (cvy + cvh))
|
2012-05-15 22:28:40 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
dy = (sd->expanded_item->item->scrl_y +
|
|
|
|
sd->expanded_item->item->h) - cvy + cvh;
|
|
|
|
expanded_next_it->item->old_scrl_y = cvy + cvh;
|
2012-05-15 22:28:40 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
dy = (sd->expanded_item->item->scrl_y +
|
|
|
|
sd->expanded_item->item->h) -
|
|
|
|
expanded_next_it->item->old_scrl_y;
|
2012-05-15 22:28:40 -07:00
|
|
|
}
|
2010-01-23 01:07:20 -08:00
|
|
|
}
|
2009-02-11 03:49:43 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (t <= effect_duration)
|
|
|
|
{
|
|
|
|
y = ((1 - (1 - (t / effect_duration)) *
|
|
|
|
(1 - (t / effect_duration))) * dy);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
end = EINA_TRUE;
|
|
|
|
y = dy;
|
|
|
|
}
|
2009-02-11 03:49:43 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!it->realized && !it->item->queued)
|
|
|
|
_item_realize(it, in, 0);
|
|
|
|
in++;
|
2009-02-25 11:50:45 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it != expanded_next_it)
|
2011-01-05 21:13:11 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
it->item->old_scrl_y =
|
|
|
|
expanded_next_it->item->old_scrl_y +
|
|
|
|
expanded_next_it->item->h + dh;
|
|
|
|
|
|
|
|
dh += it->item->h;
|
2011-01-05 21:13:11 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
|
|
|
|
if ((it->item->old_scrl_y + y) < (cvy + cvh))
|
|
|
|
_item_position(it, VIEW(it), it->item->scrl_x,
|
|
|
|
it->item->old_scrl_y + y);
|
2009-10-07 07:02:55 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
/* tree effect */
|
|
|
|
_item_tree_effect(sd, y);
|
2010-03-26 21:17:01 -07:00
|
|
|
}
|
|
|
|
else
|
2012-07-16 14:56:30 -07:00
|
|
|
{
|
|
|
|
int expanded_item_num = 0;
|
|
|
|
int num = 0;
|
2009-02-11 03:49:43 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->expanded_item)
|
|
|
|
it = (Elm_Gen_Item *)elm_genlist_item_next_get
|
|
|
|
((Elm_Object_Item *)sd->expanded_item);
|
2011-06-01 21:24:58 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
it2 = it;
|
|
|
|
while (it2)
|
|
|
|
{
|
|
|
|
expanded_item_num++;
|
|
|
|
it2 = (Elm_Gen_Item *)elm_genlist_item_next_get
|
|
|
|
((Elm_Object_Item *)it2);
|
|
|
|
}
|
2011-06-01 21:24:58 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
while (it)
|
|
|
|
{
|
|
|
|
num++;
|
|
|
|
if (sd->expanded_item->item->expanded_depth >=
|
|
|
|
it->item->expanded_depth) break;
|
|
|
|
if (sd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_EXPAND)
|
|
|
|
{
|
|
|
|
if (!it->item->tree_effect_finished)
|
|
|
|
{
|
|
|
|
if (t >= (((num - 1) * effect_duration) /
|
|
|
|
expanded_item_num))
|
|
|
|
{
|
|
|
|
edje_object_signal_emit(VIEW(it), "flip_item", "");
|
|
|
|
_item_position(it, VIEW(it), it->item->scrl_x,
|
|
|
|
it->item->scrl_y);
|
|
|
|
it->item->tree_effect_finished = EINA_TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
it = (Elm_Gen_Item *)elm_genlist_item_next_get
|
|
|
|
((Elm_Object_Item *)it);
|
|
|
|
}
|
2011-06-01 20:10:11 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
|
|
|
|
if (end)
|
2011-06-01 20:10:11 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_tree_effect_finish(sd);
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2011-06-01 20:10:11 -07:00
|
|
|
}
|
2011-06-01 21:24:58 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
2011-06-01 21:24:58 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_group_items_recalc(void *data)
|
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
Elm_Gen_Item *git;
|
|
|
|
Elm_Genlist_Smart_Data *sd = data;
|
|
|
|
|
|
|
|
evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
|
|
|
EINA_LIST_FOREACH (sd->group_items, l, git)
|
2011-06-01 20:10:11 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (git->item->want_realize)
|
|
|
|
{
|
|
|
|
if (!git->realized) _item_realize(git, 0, EINA_FALSE);
|
|
|
|
evas_object_resize(VIEW(git), sd->minw, git->item->h);
|
|
|
|
evas_object_move(VIEW(git), git->item->scrl_x, git->item->scrl_y);
|
|
|
|
evas_object_show(VIEW(git));
|
|
|
|
evas_object_raise(VIEW(git));
|
|
|
|
}
|
|
|
|
else if (!git->item->want_realize && git->realized)
|
|
|
|
{
|
|
|
|
if (!git->dragging)
|
|
|
|
_elm_genlist_item_unrealize(git, EINA_FALSE);
|
|
|
|
}
|
2011-06-01 20:10:11 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
2011-06-01 20:10:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
2011-06-03 18:52:08 -07:00
|
|
|
_reorder_move_animator_cb(void *data)
|
2011-06-01 20:10:11 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
double t;
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it = data;
|
2011-06-01 20:10:11 -07:00
|
|
|
Eina_Bool down = EINA_FALSE;
|
2012-07-16 14:56:30 -07:00
|
|
|
int y, dy = it->item->h / 10 * elm_config_scale_get(), diff;
|
2011-06-01 21:24:58 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
t = ((0.0 > (t = ecore_loop_time_get()
|
|
|
|
- GL_IT(it)->wsd->start_time)) ? 0.0 : t);
|
2011-06-01 21:24:58 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (t <= REORDER_EFFECT_TIME)
|
|
|
|
y = (1 * sin((t / REORDER_EFFECT_TIME) * (M_PI / 2)) * dy);
|
2011-06-01 20:10:11 -07:00
|
|
|
else y = dy;
|
2011-06-01 21:24:58 -07:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
diff = abs(it->item->old_scrl_y - it->item->scrl_y);
|
|
|
|
if (diff > it->item->h) y = diff / 2;
|
2011-06-01 21:24:58 -07:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->old_scrl_y < it->item->scrl_y)
|
2011-06-01 20:10:11 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->old_scrl_y += y;
|
2011-06-01 20:10:11 -07:00
|
|
|
down = EINA_TRUE;
|
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
else if (it->item->old_scrl_y > it->item->scrl_y)
|
2011-06-01 20:10:11 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->old_scrl_y -= y;
|
2011-06-01 20:10:11 -07:00
|
|
|
down = EINA_FALSE;
|
|
|
|
}
|
2012-02-22 23:39:10 -08:00
|
|
|
|
2012-04-06 00:10:26 -07:00
|
|
|
if (it->deco_all_view)
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_position
|
|
|
|
(it, it->deco_all_view, it->item->scrl_x, it->item->old_scrl_y);
|
2012-02-22 23:39:10 -08:00
|
|
|
else
|
|
|
|
_item_position(it, VIEW(it), it->item->scrl_x, it->item->old_scrl_y);
|
2012-07-16 14:56:30 -07:00
|
|
|
_group_items_recalc(GL_IT(it)->wsd);
|
2011-06-01 21:24:58 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((GL_IT(it)->wsd->reorder_pan_move) ||
|
2011-10-21 01:52:03 -07:00
|
|
|
(down && it->item->old_scrl_y >= it->item->scrl_y) ||
|
|
|
|
(!down && it->item->old_scrl_y <= it->item->scrl_y))
|
2011-06-01 20:10:11 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->old_scrl_y = it->item->scrl_y;
|
|
|
|
it->item->move_effect_enabled = EINA_FALSE;
|
2012-07-16 14:56:30 -07:00
|
|
|
GL_IT(it)->wsd->reorder_move_animator = NULL;
|
2011-06-01 20:10:11 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
|
2011-06-01 20:10:11 -07:00
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static int
|
|
|
|
_reorder_item_space_get(Elm_Gen_Item *it)
|
2011-04-21 04:47:36 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *reorder_it = GL_IT(it)->wsd->reorder_it;
|
|
|
|
Evas_Coord rox, roy, row, roh, oy, oh;
|
|
|
|
Eina_Bool top = EINA_FALSE;
|
2011-04-21 04:47:36 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!reorder_it) return 0;
|
|
|
|
|
|
|
|
evas_object_geometry_get(GL_IT(it)->wsd->pan_obj, NULL, &oy, NULL, &oh);
|
|
|
|
evas_object_geometry_get
|
|
|
|
(GL_IT(it)->wsd->VIEW(reorder_it), &rox, &roy, &row, &roh);
|
|
|
|
|
|
|
|
if ((GL_IT(it)->wsd->reorder_start_y < it->item->block->y) &&
|
|
|
|
(roy - oy + (roh / 2) >= it->item->block->y - GL_IT(it)->wsd->pan_y))
|
|
|
|
{
|
|
|
|
it->item->block->reorder_offset =
|
|
|
|
GL_IT(it)->wsd->reorder_it->item->h * -1;
|
|
|
|
if (it->item->block->count == 1)
|
|
|
|
GL_IT(it)->wsd->reorder_rel = it;
|
|
|
|
}
|
|
|
|
else if ((GL_IT(it)->wsd->reorder_start_y >= it->item->block->y) &&
|
|
|
|
(roy - oy + (roh / 2) <= it->item->block->y -
|
|
|
|
GL_IT(it)->wsd->pan_y))
|
|
|
|
{
|
|
|
|
it->item->block->reorder_offset = GL_IT(it)->wsd->reorder_it->item->h;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
it->item->block->reorder_offset = 0;
|
|
|
|
|
|
|
|
it->item->scrl_y += it->item->block->reorder_offset;
|
|
|
|
|
|
|
|
top = (ELM_RECTS_INTERSECT
|
|
|
|
(it->item->scrl_x, it->item->scrl_y, it->item->w, it->item->h,
|
|
|
|
rox, roy + (roh / 2), row, 1));
|
|
|
|
if (top)
|
|
|
|
{
|
|
|
|
GL_IT(it)->wsd->reorder_rel = it;
|
|
|
|
it->item->scrl_y += GL_IT(it)->wsd->reorder_it->item->h;
|
|
|
|
return GL_IT(it)->wsd->reorder_it->item->h;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return 0;
|
2011-04-21 04:47:36 -07:00
|
|
|
}
|
|
|
|
|
2009-02-11 03:49:43 -08:00
|
|
|
static void
|
2010-12-07 11:18:14 -08:00
|
|
|
_item_block_position(Item_Block *itb,
|
2012-07-16 14:56:30 -07:00
|
|
|
int in)
|
2009-02-11 03:49:43 -08:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it;
|
|
|
|
Elm_Gen_Item *git;
|
2012-07-16 14:56:30 -07:00
|
|
|
const Eina_List *l;
|
2011-11-29 00:54:19 -08:00
|
|
|
Eina_Bool vis = EINA_FALSE;
|
2012-07-16 14:56:30 -07:00
|
|
|
Evas_Coord y = 0, ox, oy, ow, oh, cvx, cvy, cvw, cvh;
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(itb->sd)->obj));
|
|
|
|
evas_object_geometry_get(itb->sd->pan_obj, &ox, &oy, &ow, &oh);
|
|
|
|
evas_output_viewport_get
|
|
|
|
(evas_object_evas_get(ELM_WIDGET_DATA(itb->sd)->obj),
|
|
|
|
&cvx, &cvy, &cvw, &cvh);
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH (itb->items, l, it)
|
2009-02-11 03:49:43 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->generation < GL_IT(it)->wsd->generation) continue;
|
|
|
|
else if (GL_IT(it)->wsd->reorder_it == it)
|
|
|
|
continue;
|
|
|
|
|
2010-10-15 04:51:15 -07:00
|
|
|
it->x = 0;
|
|
|
|
it->y = y;
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->w = itb->w;
|
2012-07-16 14:56:30 -07:00
|
|
|
it->item->scrl_x = itb->x + it->x - GL_IT(it)->wsd->pan_x + ox;
|
|
|
|
it->item->scrl_y = itb->y + it->y - GL_IT(it)->wsd->pan_y + oy;
|
2011-01-05 21:13:11 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
vis = (ELM_RECTS_INTERSECT
|
|
|
|
(it->item->scrl_x, it->item->scrl_y, it->item->w, it->item->h,
|
|
|
|
cvx, cvy, cvw, cvh));
|
2011-10-23 20:40:54 -07:00
|
|
|
if (!it->group)
|
2010-10-15 04:51:15 -07:00
|
|
|
{
|
2011-01-05 21:13:11 -08:00
|
|
|
if ((itb->realized) && (!it->realized))
|
2010-10-15 04:51:15 -07:00
|
|
|
{
|
2011-03-18 08:02:49 -07:00
|
|
|
if (vis) _item_realize(it, in, EINA_FALSE);
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
2011-01-05 21:13:11 -08:00
|
|
|
if (it->realized)
|
2009-10-07 07:02:55 -07:00
|
|
|
{
|
2012-03-05 17:10:46 -08:00
|
|
|
if (vis || it->dragging)
|
2011-01-05 21:13:11 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (GL_IT(it)->wsd->reorder_mode)
|
|
|
|
y += _reorder_item_space_get(it);
|
2011-10-21 01:52:03 -07:00
|
|
|
git = it->item->group_item;
|
2011-01-05 21:13:11 -08:00
|
|
|
if (git)
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
if (git->item->scrl_y < oy)
|
|
|
|
git->item->scrl_y = oy;
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((git->item->scrl_y + git->item->h) >
|
|
|
|
(it->item->scrl_y + it->item->h))
|
|
|
|
git->item->scrl_y = (it->item->scrl_y +
|
|
|
|
it->item->h) - git->item->h;
|
2012-06-17 10:20:23 -07:00
|
|
|
git->item->scrl_x = it->item->scrl_x;
|
2011-10-21 01:52:03 -07:00
|
|
|
git->item->want_realize = EINA_TRUE;
|
2011-01-05 21:13:11 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((GL_IT(it)->wsd->reorder_it) &&
|
|
|
|
(it->item->old_scrl_y != it->item->scrl_y))
|
2011-06-01 20:10:11 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
if (!it->item->move_effect_enabled)
|
2011-06-01 20:10:11 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->move_effect_enabled = EINA_TRUE;
|
2012-07-16 14:56:30 -07:00
|
|
|
GL_IT(it)->wsd->reorder_move_animator =
|
|
|
|
ecore_animator_add(
|
|
|
|
_reorder_move_animator_cb, it);
|
2011-06-01 20:10:11 -07:00
|
|
|
}
|
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
if (!it->item->move_effect_enabled)
|
2011-06-08 19:54:04 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((GL_IT(it)->wsd->decorate_all_mode) &&
|
|
|
|
(it->itc->decorate_all_item_style))
|
|
|
|
_decorate_all_item_position
|
|
|
|
(it, it->item->scrl_x, it->item->scrl_y);
|
2011-08-03 00:16:20 -07:00
|
|
|
else
|
2012-02-22 23:39:10 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!GL_IT(it)->wsd->tree_effect_enabled ||
|
|
|
|
(GL_IT(it)->wsd->move_effect_mode ==
|
|
|
|
ELM_GENLIST_TREE_EFFECT_NONE) ||
|
|
|
|
((GL_IT(it)->wsd->move_effect_mode !=
|
|
|
|
ELM_GENLIST_TREE_EFFECT_NONE) &&
|
|
|
|
(it->item->old_scrl_y ==
|
|
|
|
it->item->scrl_y)))
|
2012-03-23 00:47:03 -07:00
|
|
|
{
|
2012-04-03 02:56:44 -07:00
|
|
|
if (it->item->deco_it_view)
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_position
|
|
|
|
(it, it->item->deco_it_view,
|
|
|
|
it->item->scrl_x,
|
|
|
|
it->item->scrl_y);
|
2012-03-23 00:47:03 -07:00
|
|
|
else
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_position
|
|
|
|
(it, VIEW(it), it->item->scrl_x,
|
|
|
|
it->item->scrl_y);
|
2012-03-23 00:47:03 -07:00
|
|
|
}
|
2012-02-22 23:39:10 -08:00
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->old_scrl_y = it->item->scrl_y;
|
2011-06-08 19:54:04 -07:00
|
|
|
}
|
2011-01-05 21:13:11 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!GL_IT(it)->wsd->tree_effect_animator)
|
2012-03-07 04:15:36 -08:00
|
|
|
_elm_genlist_item_unrealize(it, EINA_FALSE);
|
2011-01-05 21:13:11 -08:00
|
|
|
}
|
2009-10-07 07:02:55 -07:00
|
|
|
}
|
2011-01-05 21:13:11 -08:00
|
|
|
in++;
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
2011-01-31 00:30:11 -08:00
|
|
|
else
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
if (vis) it->item->want_realize = EINA_TRUE;
|
2011-01-31 00:30:11 -08:00
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
y += it->item->h;
|
2011-01-05 21:13:11 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(itb->sd)->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(itb->sd)->obj));
|
2011-01-05 21:13:11 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_block_realize(Item_Block *itb)
|
2011-01-05 21:13:11 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (itb->realized) return;
|
|
|
|
|
|
|
|
itb->realized = EINA_TRUE;
|
|
|
|
itb->want_unrealize = EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_genlist_pan_smart_calculate(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Evas_Coord ox, oy, ow, oh, cvx, cvy, cvw, cvh;
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *git;
|
2012-07-16 14:56:30 -07:00
|
|
|
Item_Block *itb;
|
|
|
|
Eina_List *l;
|
|
|
|
int in = 0;
|
2011-01-05 21:13:11 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_PAN_DATA_GET(obj, psd);
|
|
|
|
|
|
|
|
evas_event_freeze(evas_object_evas_get(obj));
|
|
|
|
|
|
|
|
if (psd->wsd->pan_changed)
|
2011-01-05 21:13:11 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
_calc_job(psd->wsd);
|
|
|
|
psd->wsd->pan_changed = EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
|
|
|
|
evas_output_viewport_get(evas_object_evas_get(obj), &cvx, &cvy, &cvw, &cvh);
|
|
|
|
EINA_LIST_FOREACH (psd->wsd->group_items, l, git)
|
|
|
|
{
|
|
|
|
git->item->want_realize = EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (psd->wsd->tree_effect_enabled &&
|
|
|
|
(psd->wsd->move_effect_mode != ELM_GENLIST_TREE_EFFECT_NONE))
|
|
|
|
{
|
|
|
|
if (!psd->wsd->tree_effect_animator)
|
2011-01-05 21:13:11 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_tree_effect_before(psd->wsd->expanded_item);
|
|
|
|
evas_object_raise(psd->wsd->alpha_bg);
|
|
|
|
evas_object_show(psd->wsd->alpha_bg);
|
|
|
|
psd->wsd->start_time = ecore_time_get();
|
|
|
|
psd->wsd->tree_effect_animator =
|
|
|
|
ecore_animator_add(_tree_effect_animator_cb, psd->wsd);
|
2011-01-05 21:13:11 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EINA_INLIST_FOREACH (psd->wsd->blocks, itb)
|
|
|
|
{
|
|
|
|
itb->w = psd->wsd->minw;
|
|
|
|
if (ELM_RECTS_INTERSECT(itb->x - psd->wsd->pan_x + ox,
|
|
|
|
itb->y - psd->wsd->pan_y + oy,
|
|
|
|
itb->w, itb->h,
|
|
|
|
cvx, cvy, cvw, cvh))
|
2011-01-05 21:13:11 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((!itb->realized) || (itb->changed))
|
|
|
|
_item_block_realize(itb);
|
|
|
|
_item_block_position(itb, in);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (itb->realized) _item_block_unrealize(itb);
|
2011-01-05 21:13:11 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
in += itb->count;
|
|
|
|
}
|
|
|
|
if ((!psd->wsd->reorder_it) || (psd->wsd->reorder_pan_move))
|
|
|
|
_group_items_recalc(psd->wsd);
|
|
|
|
if ((psd->wsd->reorder_mode) && (psd->wsd->reorder_it))
|
|
|
|
{
|
|
|
|
if (psd->wsd->pan_y != psd->wsd->reorder_old_pan_y)
|
|
|
|
psd->wsd->reorder_pan_move = EINA_TRUE;
|
|
|
|
else psd->wsd->reorder_pan_move = EINA_FALSE;
|
|
|
|
|
|
|
|
evas_object_raise(psd->wsd->VIEW(reorder_it));
|
|
|
|
psd->wsd->reorder_old_pan_y = psd->wsd->pan_y;
|
|
|
|
psd->wsd->start_time = ecore_loop_time_get();
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
|
|
|
|
if (!psd->wsd->tree_effect_enabled ||
|
|
|
|
(psd->wsd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_NONE))
|
|
|
|
_item_auto_scroll(psd->wsd);
|
|
|
|
|
|
|
|
evas_event_thaw(evas_object_evas_get(obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(obj));
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_elm_genlist_pan_smart_set_user(Elm_Pan_Smart_Class *sc)
|
2010-11-20 00:43:43 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_PAN_CLASS(sc)->base.add = _elm_genlist_pan_smart_add;
|
|
|
|
ELM_PAN_CLASS(sc)->base.del = _elm_genlist_pan_smart_del;
|
|
|
|
ELM_PAN_CLASS(sc)->base.move = _elm_genlist_pan_smart_move;
|
|
|
|
ELM_PAN_CLASS(sc)->base.resize = _elm_genlist_pan_smart_resize;
|
|
|
|
ELM_PAN_CLASS(sc)->base.calculate = _elm_genlist_pan_smart_calculate;
|
|
|
|
|
|
|
|
ELM_PAN_CLASS(sc)->pos_set = _elm_genlist_pan_smart_pos_set;
|
|
|
|
ELM_PAN_CLASS(sc)->pos_get = _elm_genlist_pan_smart_pos_get;
|
|
|
|
ELM_PAN_CLASS(sc)->pos_max_get = _elm_genlist_pan_smart_pos_max_get;
|
|
|
|
ELM_PAN_CLASS(sc)->pos_min_get = _elm_genlist_pan_smart_pos_min_get;
|
|
|
|
ELM_PAN_CLASS(sc)->content_size_get =
|
|
|
|
_elm_genlist_pan_smart_content_size_get;
|
2010-11-20 00:43:43 -08:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_item_multi_select_up(Elm_Genlist_Smart_Data *sd)
|
2011-12-23 20:20:18 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Object_Item *prev;
|
2011-12-23 20:20:18 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!sd->selected) return EINA_FALSE;
|
|
|
|
if (!sd->multi) return EINA_FALSE;
|
|
|
|
|
|
|
|
prev = elm_genlist_item_prev_get(sd->last_selected_item);
|
|
|
|
if (!prev) return EINA_TRUE;
|
|
|
|
|
|
|
|
if (elm_genlist_item_selected_get(prev))
|
2011-12-23 20:20:18 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_selected_set(sd->last_selected_item, EINA_FALSE);
|
|
|
|
sd->last_selected_item = prev;
|
|
|
|
elm_genlist_item_show
|
|
|
|
(sd->last_selected_item, ELM_GENLIST_ITEM_SCROLLTO_IN);
|
|
|
|
}
|
2011-12-23 20:20:18 -08:00
|
|
|
else
|
2012-07-16 14:56:30 -07:00
|
|
|
{
|
|
|
|
elm_genlist_item_selected_set(prev, EINA_TRUE);
|
|
|
|
elm_genlist_item_show(prev, ELM_GENLIST_ITEM_SCROLLTO_IN);
|
|
|
|
}
|
|
|
|
return EINA_TRUE;
|
2011-12-23 20:20:18 -08:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_item_multi_select_down(Elm_Genlist_Smart_Data *sd)
|
2009-02-10 03:57:47 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Object_Item *next;
|
2010-10-07 12:57:20 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!sd->selected) return EINA_FALSE;
|
|
|
|
if (!sd->multi) return EINA_FALSE;
|
2012-02-13 00:50:18 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
next = elm_genlist_item_next_get(sd->last_selected_item);
|
|
|
|
if (!next) return EINA_TRUE;
|
2010-10-07 12:57:20 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (elm_genlist_item_selected_get(next))
|
|
|
|
{
|
|
|
|
elm_genlist_item_selected_set(sd->last_selected_item, EINA_FALSE);
|
|
|
|
sd->last_selected_item = next;
|
|
|
|
elm_genlist_item_show
|
|
|
|
(sd->last_selected_item, ELM_GENLIST_ITEM_SCROLLTO_IN);
|
|
|
|
}
|
|
|
|
else
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_selected_set(next, EINA_TRUE);
|
|
|
|
elm_genlist_item_show(next, ELM_GENLIST_ITEM_SCROLLTO_IN);
|
|
|
|
}
|
2011-03-22 00:54:24 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_all_items_deselect(Elm_Genlist_Smart_Data *sd)
|
|
|
|
{
|
|
|
|
if (!sd->selected) return EINA_FALSE;
|
|
|
|
|
|
|
|
while (sd->selected)
|
|
|
|
elm_genlist_item_selected_set(sd->selected->data, EINA_FALSE);
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_item_single_select_up(Elm_Genlist_Smart_Data *sd)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *prev;
|
|
|
|
|
|
|
|
if (!sd->selected)
|
|
|
|
{
|
|
|
|
prev = ELM_GEN_ITEM_FROM_INLIST(sd->items->last);
|
|
|
|
while ((prev) && (prev->generation < sd->generation))
|
|
|
|
prev = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
prev = (Elm_Gen_Item *)elm_genlist_item_prev_get
|
|
|
|
(sd->last_selected_item);
|
|
|
|
|
|
|
|
if (!prev) return EINA_FALSE;
|
|
|
|
|
|
|
|
_all_items_deselect(sd);
|
|
|
|
|
|
|
|
elm_genlist_item_selected_set((Elm_Object_Item *)prev, EINA_TRUE);
|
|
|
|
elm_genlist_item_show((Elm_Object_Item *)prev, ELM_GENLIST_ITEM_SCROLLTO_IN);
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_item_single_select_down(Elm_Genlist_Smart_Data *sd)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *next;
|
|
|
|
|
|
|
|
if (!sd->selected)
|
|
|
|
{
|
|
|
|
next = ELM_GEN_ITEM_FROM_INLIST(sd->items);
|
|
|
|
while ((next) && (next->generation < sd->generation))
|
|
|
|
next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
next = (Elm_Gen_Item *)elm_genlist_item_next_get
|
|
|
|
(sd->last_selected_item);
|
|
|
|
|
|
|
|
if (!next) return EINA_FALSE;
|
|
|
|
|
|
|
|
_all_items_deselect(sd);
|
|
|
|
|
|
|
|
elm_genlist_item_selected_set((Elm_Object_Item *)next, EINA_TRUE);
|
|
|
|
elm_genlist_item_show
|
|
|
|
((Elm_Object_Item *)next, ELM_GENLIST_ITEM_SCROLLTO_IN);
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_elm_genlist_smart_event(Evas_Object *obj,
|
|
|
|
Evas_Object *src __UNUSED__,
|
|
|
|
Evas_Callback_Type type,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
Evas_Coord x = 0;
|
|
|
|
Evas_Coord y = 0;
|
|
|
|
Evas_Coord v_w = 0;
|
|
|
|
Evas_Coord v_h = 0;
|
|
|
|
Evas_Coord step_x = 0;
|
|
|
|
Evas_Coord step_y = 0;
|
|
|
|
Evas_Coord page_x = 0;
|
|
|
|
Evas_Coord page_y = 0;
|
|
|
|
Elm_Object_Item *it = NULL;
|
|
|
|
Evas_Event_Key_Down *ev = event_info;
|
|
|
|
Evas_Coord pan_max_x = 0, pan_max_y = 0;
|
|
|
|
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
|
|
|
if (!sd->items) return EINA_FALSE;
|
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
|
|
|
if (elm_widget_disabled_get(obj)) return EINA_FALSE;
|
|
|
|
|
|
|
|
sd->s_iface->content_pos_get(obj, &x, &y);
|
|
|
|
sd->s_iface->step_size_get(obj, &step_x, &step_y);
|
|
|
|
sd->s_iface->page_size_get(obj, &page_x, &page_y);
|
|
|
|
sd->s_iface->content_viewport_size_get(obj, &v_w, &v_h);
|
|
|
|
|
|
|
|
if ((!strcmp(ev->keyname, "Left")) ||
|
|
|
|
((!strcmp(ev->keyname, "KP_Left")) && (!ev->string)))
|
|
|
|
{
|
|
|
|
x -= step_x;
|
|
|
|
}
|
|
|
|
else if ((!strcmp(ev->keyname, "Right")) ||
|
|
|
|
((!strcmp(ev->keyname, "KP_Right")) && (!ev->string)))
|
|
|
|
{
|
|
|
|
x += step_x;
|
|
|
|
}
|
|
|
|
else if ((!strcmp(ev->keyname, "Up")) ||
|
|
|
|
((!strcmp(ev->keyname, "KP_Up")) && (!ev->string)))
|
|
|
|
{
|
|
|
|
if (((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
|
|
|
|
(_item_multi_select_up(sd)))
|
|
|
|
|| (_item_single_select_up(sd)))
|
|
|
|
{
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
y -= step_y;
|
|
|
|
}
|
|
|
|
else if ((!strcmp(ev->keyname, "Down")) ||
|
|
|
|
((!strcmp(ev->keyname, "KP_Down")) && (!ev->string)))
|
|
|
|
{
|
|
|
|
if (((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
|
|
|
|
(_item_multi_select_down(sd)))
|
|
|
|
|| (_item_single_select_down(sd)))
|
|
|
|
{
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
y += step_y;
|
|
|
|
}
|
|
|
|
else if ((!strcmp(ev->keyname, "Home")) ||
|
|
|
|
((!strcmp(ev->keyname, "KP_Home")) && (!ev->string)))
|
|
|
|
{
|
|
|
|
it = elm_genlist_first_item_get(obj);
|
|
|
|
elm_genlist_item_bring_in(it, ELM_GENLIST_ITEM_SCROLLTO_IN);
|
|
|
|
elm_genlist_item_selected_set(it, EINA_TRUE);
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
else if ((!strcmp(ev->keyname, "End")) ||
|
|
|
|
((!strcmp(ev->keyname, "KP_End")) && (!ev->string)))
|
|
|
|
{
|
|
|
|
it = elm_genlist_last_item_get(obj);
|
|
|
|
elm_genlist_item_bring_in(it, ELM_GENLIST_ITEM_SCROLLTO_IN);
|
|
|
|
elm_genlist_item_selected_set(it, EINA_TRUE);
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
else if ((!strcmp(ev->keyname, "Prior")) ||
|
|
|
|
((!strcmp(ev->keyname, "KP_Prior")) && (!ev->string)))
|
|
|
|
{
|
|
|
|
if (page_y < 0)
|
|
|
|
y -= -(page_y * v_h) / 100;
|
|
|
|
else
|
|
|
|
y -= page_y;
|
|
|
|
}
|
|
|
|
else if ((!strcmp(ev->keyname, "Next")) ||
|
|
|
|
((!strcmp(ev->keyname, "KP_Next")) && (!ev->string)))
|
|
|
|
{
|
|
|
|
if (page_y < 0)
|
|
|
|
y += -(page_y * v_h) / 100;
|
|
|
|
else
|
|
|
|
y += page_y;
|
|
|
|
}
|
|
|
|
else if (!strcmp(ev->keyname, "Escape"))
|
|
|
|
{
|
|
|
|
if (!_all_items_deselect(sd)) return EINA_FALSE;
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
else if (((!strcmp(ev->keyname, "Return")) ||
|
|
|
|
(!strcmp(ev->keyname, "KP_Enter")) ||
|
|
|
|
(!strcmp(ev->keyname, "space")))
|
|
|
|
&& (!sd->multi) && (sd->selected))
|
|
|
|
{
|
|
|
|
it = elm_genlist_selected_item_get(obj);
|
|
|
|
elm_genlist_item_expanded_set(it, !elm_genlist_item_expanded_get(it));
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it);
|
|
|
|
}
|
|
|
|
else return EINA_FALSE;
|
|
|
|
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
_elm_genlist_pan_smart_pos_max_get(sd->pan_obj, &pan_max_x, &pan_max_y);
|
|
|
|
if (x < 0) x = 0;
|
|
|
|
if (x > pan_max_x) x = pan_max_x;
|
|
|
|
if (y < 0) y = 0;
|
|
|
|
if (y > pan_max_y) y = pan_max_y;
|
|
|
|
|
|
|
|
sd->s_iface->content_pos_set(obj, x, y);
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_elm_genlist_smart_sub_object_add(Evas_Object *obj,
|
|
|
|
Evas_Object *sobj)
|
|
|
|
{
|
|
|
|
Elm_Widget_Smart_Class *parent_parent;
|
|
|
|
|
|
|
|
parent_parent = (Elm_Widget_Smart_Class *)((Evas_Smart_Class *)
|
|
|
|
_elm_genlist_parent_sc)->parent;
|
|
|
|
|
|
|
|
/* skipping layout's code, which registers size hint changing
|
|
|
|
* callback on sub objects. this is here because items'
|
|
|
|
* content_get() routines may change hints on the objects after
|
|
|
|
* creation, thus issuing TOO MANY sizing_eval()'s here. they are
|
|
|
|
* not needed at here anyway, so let's skip listening to those
|
|
|
|
* hints changes */
|
|
|
|
if (!parent_parent->sub_object_add(obj, sobj))
|
|
|
|
return EINA_FALSE;
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_elm_genlist_smart_sub_object_del(Evas_Object *obj,
|
|
|
|
Evas_Object *sobj)
|
|
|
|
{
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
/* XXX: hack -- also skipping sizing recalculation on
|
|
|
|
* sub-object-del. genlist's crazy code paths (like groups and
|
|
|
|
* such) seem to issue a whole lot of deletions and Evas bitches
|
|
|
|
* about too many recalculations */
|
|
|
|
sd->on_sub_del = EINA_TRUE;
|
|
|
|
|
|
|
|
if (!ELM_WIDGET_CLASS(_elm_genlist_parent_sc)->sub_object_del(obj, sobj))
|
|
|
|
return EINA_FALSE;
|
|
|
|
|
|
|
|
sd->on_sub_del = EINA_FALSE;
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_elm_genlist_smart_on_focus(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if (!ELM_WIDGET_CLASS(_elm_genlist_parent_sc)->on_focus(obj))
|
|
|
|
return EINA_FALSE;
|
|
|
|
|
|
|
|
if (elm_widget_focus_get(obj) && (sd->items) && (sd->selected) &&
|
|
|
|
(!sd->last_selected_item))
|
|
|
|
sd->last_selected_item = eina_list_data_get(sd->selected);
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_cache_clean(Elm_Genlist_Smart_Data *sd)
|
|
|
|
{
|
|
|
|
evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
|
|
|
|
|
|
|
while ((sd->item_cache) && (sd->item_cache_count > sd->item_cache_max))
|
|
|
|
{
|
|
|
|
Item_Cache *itc;
|
|
|
|
|
|
|
|
itc = EINA_INLIST_CONTAINER_GET(sd->item_cache->last, Item_Cache);
|
|
|
|
sd->item_cache = eina_inlist_remove
|
|
|
|
(sd->item_cache, sd->item_cache->last);
|
|
|
|
sd->item_cache_count--;
|
|
|
|
if (itc->spacer) evas_object_del(itc->spacer);
|
|
|
|
if (itc->base_view) evas_object_del(itc->base_view);
|
|
|
|
eina_stringshare_del(itc->item_style);
|
|
|
|
free(itc);
|
|
|
|
}
|
|
|
|
evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_cache_zero(Elm_Genlist_Smart_Data *sd)
|
|
|
|
{
|
|
|
|
int pmax = sd->item_cache_max;
|
|
|
|
|
|
|
|
sd->item_cache_max = 0;
|
|
|
|
_item_cache_clean(sd);
|
|
|
|
sd->item_cache_max = pmax;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_mirrored_set(Evas_Object *obj,
|
|
|
|
Eina_Bool rtl)
|
|
|
|
{
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
_item_cache_zero(sd);
|
|
|
|
sd->s_iface->mirrored_set(obj, rtl);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_elm_genlist_smart_theme(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Item_Block *itb;
|
|
|
|
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if (!ELM_WIDGET_CLASS(_elm_genlist_parent_sc)->theme(obj))
|
|
|
|
return EINA_FALSE;
|
|
|
|
|
|
|
|
evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
|
|
|
_item_cache_zero(sd);
|
|
|
|
_mirrored_set(obj, elm_widget_mirrored_get(obj));
|
|
|
|
|
|
|
|
sd->item_width = sd->item_height = 0;
|
|
|
|
sd->group_item_width = sd->group_item_height = 0;
|
|
|
|
sd->minw = sd->minh = sd->realminw = 0;
|
|
|
|
EINA_INLIST_FOREACH (sd->blocks, itb)
|
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
Elm_Gen_Item *it;
|
|
|
|
|
|
|
|
if (itb->realized) _item_block_unrealize(itb);
|
|
|
|
EINA_LIST_FOREACH (itb->items, l, it)
|
|
|
|
it->item->mincalcd = EINA_FALSE;
|
|
|
|
|
|
|
|
itb->changed = EINA_TRUE;
|
|
|
|
}
|
|
|
|
if (sd->calc_job) ecore_job_del(sd->calc_job);
|
|
|
|
sd->calc_job = ecore_job_add(_calc_job, sd);
|
|
|
|
elm_layout_sizing_eval(obj);
|
|
|
|
evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FIXME: take off later. maybe this show region coords belong in the
|
|
|
|
* interface (new api functions, set/get)? */
|
|
|
|
static void
|
|
|
|
_show_region_hook(void *data,
|
|
|
|
Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Evas_Coord x, y, w, h;
|
|
|
|
|
|
|
|
ELM_GENLIST_DATA_GET(data, sd);
|
|
|
|
|
|
|
|
elm_widget_show_region_get(obj, &x, &y, &w, &h);
|
|
|
|
//x & y are screen coordinates, Add with pan coordinates
|
|
|
|
x += sd->pan_x;
|
|
|
|
y += sd->pan_y;
|
|
|
|
sd->s_iface->content_region_show(obj, x, y, w, h);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_elm_genlist_smart_translate(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
evas_object_smart_callback_call(obj, "language,changed", NULL);
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_highlight(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
const char *selectraise;
|
|
|
|
|
|
|
|
if ((GL_IT(it)->wsd->select_mode == ELM_OBJECT_SELECT_MODE_NONE) ||
|
|
|
|
(!GL_IT(it)->wsd->highlight) ||
|
|
|
|
(it->generation < GL_IT(it)->wsd->generation) ||
|
|
|
|
(it->highlighted) || elm_widget_item_disabled_get(it) ||
|
|
|
|
(it->select_mode == ELM_OBJECT_SELECT_MODE_NONE) ||
|
|
|
|
(it->item->deco_it_view) ||
|
|
|
|
(it->select_mode == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY))
|
|
|
|
return;
|
|
|
|
|
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
|
|
|
|
if (it->deco_all_view)
|
|
|
|
edje_object_signal_emit(it->deco_all_view, "elm,state,selected", "elm");
|
|
|
|
|
|
|
|
selectraise = edje_object_data_get(VIEW(it), "selectraise");
|
|
|
|
if ((selectraise) && (!strcmp(selectraise, "on")))
|
|
|
|
{
|
|
|
|
if (it->deco_all_view) evas_object_raise(it->deco_all_view);
|
|
|
|
else evas_object_raise(VIEW(it));
|
|
|
|
if ((it->item->group_item) && (it->item->group_item->realized))
|
|
|
|
evas_object_raise(it->item->VIEW(group_item));
|
|
|
|
}
|
|
|
|
it->highlighted = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_unhighlight(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
if ((it->generation < GL_IT(it)->wsd->generation) || (!it->highlighted))
|
|
|
|
return;
|
|
|
|
|
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm");
|
|
|
|
if (it->deco_all_view)
|
|
|
|
edje_object_signal_emit
|
|
|
|
(it->deco_all_view, "elm,state,unselected", "elm");
|
|
|
|
|
|
|
|
if (!it->item->nostacking)
|
|
|
|
{
|
|
|
|
if ((it->item->order_num_in & 0x1) ^ it->item->stacking_even)
|
|
|
|
{
|
|
|
|
if (it->deco_all_view) evas_object_lower(it->deco_all_view);
|
|
|
|
else evas_object_lower(VIEW(it));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (it->deco_all_view) evas_object_raise(it->deco_all_view);
|
|
|
|
else evas_object_raise(VIEW(it));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
it->highlighted = EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_block_position_update(Eina_Inlist *list,
|
|
|
|
int idx)
|
|
|
|
{
|
|
|
|
Item_Block *tmp;
|
|
|
|
|
|
|
|
EINA_INLIST_FOREACH (list, tmp)
|
|
|
|
{
|
|
|
|
tmp->position = idx++;
|
|
|
|
tmp->position_update = EINA_TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_position_update(Eina_List *list,
|
|
|
|
int idx)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH (list, l, it)
|
|
|
|
{
|
|
|
|
it->position = idx++;
|
|
|
|
it->position_update = EINA_TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_block_merge(Item_Block *left,
|
|
|
|
Item_Block *right)
|
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
Elm_Gen_Item *it2;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH (right->items, l, it2)
|
|
|
|
{
|
|
|
|
it2->item->block = left;
|
|
|
|
left->count++;
|
|
|
|
left->changed = EINA_TRUE;
|
|
|
|
}
|
|
|
|
left->items = eina_list_merge(left->items, right->items);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_block_del(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
Eina_Inlist *il;
|
|
|
|
Item_Block *itb = it->item->block;
|
|
|
|
Eina_Bool block_changed = EINA_FALSE;
|
|
|
|
|
|
|
|
itb->items = eina_list_remove(itb->items, it);
|
|
|
|
itb->count--;
|
|
|
|
itb->changed = EINA_TRUE;
|
|
|
|
if (GL_IT(it)->wsd->calc_job) ecore_job_del(GL_IT(it)->wsd->calc_job);
|
|
|
|
GL_IT(it)->wsd->calc_job = ecore_job_add(_calc_job, GL_IT(it)->wsd);
|
|
|
|
if (itb->count < 1)
|
|
|
|
{
|
|
|
|
Item_Block *itbn;
|
|
|
|
|
|
|
|
il = EINA_INLIST_GET(itb);
|
|
|
|
itbn = (Item_Block *)(il->next);
|
|
|
|
if (it->parent)
|
|
|
|
it->parent->item->items =
|
|
|
|
eina_list_remove(it->parent->item->items, it);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_item_block_position_update(il->next, itb->position);
|
|
|
|
GL_IT(it)->wsd->blocks =
|
|
|
|
eina_inlist_remove(GL_IT(it)->wsd->blocks, il);
|
|
|
|
}
|
|
|
|
free(itb);
|
|
|
|
if (itbn) itbn->changed = EINA_TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (itb->count < (itb->sd->max_items_per_block / 2))
|
|
|
|
{
|
|
|
|
Item_Block *itbp;
|
|
|
|
Item_Block *itbn;
|
|
|
|
|
|
|
|
il = EINA_INLIST_GET(itb);
|
|
|
|
itbp = (Item_Block *)(il->prev);
|
|
|
|
itbn = (Item_Block *)(il->next);
|
|
|
|
|
|
|
|
/* merge block with previous */
|
|
|
|
if ((itbp) &&
|
|
|
|
((itbp->count + itb->count) <
|
|
|
|
(itb->sd->max_items_per_block +
|
|
|
|
(itb->sd->max_items_per_block / 2))))
|
|
|
|
{
|
|
|
|
_item_block_merge(itbp, itb);
|
|
|
|
_item_block_position_update
|
|
|
|
(EINA_INLIST_GET(itb)->next, itb->position);
|
|
|
|
GL_IT(it)->wsd->blocks = eina_inlist_remove
|
|
|
|
(GL_IT(it)->wsd->blocks, EINA_INLIST_GET(itb));
|
|
|
|
free(itb);
|
|
|
|
block_changed = EINA_TRUE;
|
|
|
|
}
|
|
|
|
/* merge block with next */
|
|
|
|
else if ((itbn) &&
|
|
|
|
((itbn->count + itb->count) <
|
|
|
|
(itb->sd->max_items_per_block +
|
|
|
|
(itb->sd->max_items_per_block / 2))))
|
|
|
|
{
|
|
|
|
_item_block_merge(itb, itbn);
|
|
|
|
_item_block_position_update
|
|
|
|
(EINA_INLIST_GET(itbn)->next, itbn->position);
|
|
|
|
GL_IT(it)->wsd->blocks =
|
|
|
|
eina_inlist_remove(GL_IT(it)->wsd->blocks,
|
|
|
|
EINA_INLIST_GET(itbn));
|
|
|
|
free(itbn);
|
|
|
|
block_changed = EINA_TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (block_changed)
|
|
|
|
{
|
|
|
|
GL_IT(it)->wsd->pan_changed = EINA_TRUE;
|
|
|
|
evas_object_smart_changed(GL_IT(it)->wsd->pan_obj);
|
|
|
|
if (GL_IT(it)->wsd->calc_job) ecore_job_del(GL_IT(it)->wsd->calc_job);
|
|
|
|
GL_IT(it)->wsd->calc_job = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_decorate_all_item_unrealize(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
Evas_Object *icon;
|
|
|
|
|
|
|
|
if ((!it) || (!it->item->decorate_all_item_realized)) return;
|
|
|
|
|
|
|
|
edje_object_part_unswallow(it->deco_all_view, VIEW(it));
|
|
|
|
evas_object_smart_member_add(VIEW(it), GL_IT(it)->wsd->pan_obj);
|
|
|
|
elm_widget_sub_object_add(WIDGET(it), VIEW(it));
|
|
|
|
_elm_genlist_item_odd_even_update(it);
|
|
|
|
_elm_genlist_item_state_update(it, NULL);
|
|
|
|
|
|
|
|
evas_object_del(it->deco_all_view);
|
|
|
|
it->deco_all_view = NULL;
|
|
|
|
elm_widget_stringlist_free(it->item->deco_all_texts);
|
|
|
|
it->item->deco_all_texts = NULL;
|
|
|
|
elm_widget_stringlist_free(it->item->deco_all_contents);
|
|
|
|
it->item->deco_all_contents = NULL;
|
|
|
|
elm_widget_stringlist_free(it->item->deco_all_states);
|
|
|
|
it->item->deco_all_states = NULL;
|
|
|
|
EINA_LIST_FREE (it->item->deco_all_content_objs, icon)
|
|
|
|
evas_object_del(icon);
|
|
|
|
edje_object_message_signal_process(it->deco_all_view);
|
|
|
|
_item_mouse_callbacks_del(it, it->deco_all_view);
|
|
|
|
_item_mouse_callbacks_add(it, VIEW(it));
|
|
|
|
|
|
|
|
it->item->decorate_all_item_realized = EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_genlist_item_del_not_serious(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
elm_widget_item_pre_notify_del(it);
|
|
|
|
it->generation = GL_IT(it)->wsd->generation - 1; /* This means that
|
|
|
|
* the item is
|
|
|
|
* deleted */
|
|
|
|
|
|
|
|
if ((it->relcount > 0) || (it->walking > 0)) return;
|
|
|
|
|
|
|
|
if (it->selected)
|
|
|
|
GL_IT(it)->wsd->selected =
|
|
|
|
eina_list_remove(GL_IT(it)->wsd->selected, it);
|
|
|
|
|
|
|
|
if (it->itc->func.del)
|
|
|
|
it->itc->func.del((void *)it->base.data, WIDGET(it));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_genlist_item_del_serious(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
_elm_genlist_item_del_not_serious(it);
|
|
|
|
|
|
|
|
GL_IT(it)->wsd->items =
|
|
|
|
eina_inlist_remove(GL_IT(it)->wsd->items, EINA_INLIST_GET(it));
|
|
|
|
if (it->tooltip.del_cb)
|
|
|
|
it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it);
|
|
|
|
GL_IT(it)->wsd->walking -= it->walking;
|
|
|
|
if (it->long_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
|
|
|
}
|
|
|
|
if (it->group)
|
|
|
|
GL_IT(it)->wsd->group_items =
|
|
|
|
eina_list_remove(GL_IT(it)->wsd->group_items, it);
|
|
|
|
|
|
|
|
if (GL_IT(it)->wsd->state)
|
|
|
|
{
|
|
|
|
eina_inlist_sorted_state_free(GL_IT(it)->wsd->state);
|
|
|
|
GL_IT(it)->wsd->state = NULL;
|
|
|
|
}
|
|
|
|
if (GL_IT(it)->wsd->calc_job) ecore_job_del(GL_IT(it)->wsd->calc_job);
|
|
|
|
GL_IT(it)->wsd->calc_job =
|
|
|
|
ecore_job_add(_calc_job, GL_IT(it)->wsd);
|
|
|
|
|
|
|
|
if (GL_IT(it)->wsd->last_selected_item == (Elm_Object_Item *)it)
|
|
|
|
GL_IT(it)->wsd->last_selected_item = NULL;
|
|
|
|
GL_IT(it)->wsd->item_count--;
|
|
|
|
|
|
|
|
free(it->item);
|
|
|
|
it->item = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_del(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
Evas_Object *obj = WIDGET(it);
|
|
|
|
Elm_Genlist_Smart_Data *sd = GL_IT(it)->wsd;
|
|
|
|
|
|
|
|
evas_event_freeze(evas_object_evas_get(obj));
|
|
|
|
elm_genlist_item_subitems_clear((Elm_Object_Item *)it);
|
|
|
|
if (sd->show_item == it) sd->show_item = NULL;
|
|
|
|
if (it->realized) _elm_genlist_item_unrealize(it, EINA_FALSE);
|
|
|
|
if (it->item->decorate_all_item_realized) _decorate_all_item_unrealize(it);
|
|
|
|
if (it->item->block) _item_block_del(it);
|
|
|
|
if (it->item->queued)
|
|
|
|
sd->queue = eina_list_remove(sd->queue, it);
|
|
|
|
if (sd->anchor_item == it)
|
|
|
|
{
|
|
|
|
sd->anchor_item = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
|
|
|
|
if (!sd->anchor_item)
|
|
|
|
sd->anchor_item =
|
|
|
|
ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
|
|
|
|
}
|
|
|
|
if (sd->expanded_item == it)
|
|
|
|
{
|
|
|
|
if (sd->tree_effect_animator)
|
|
|
|
{
|
|
|
|
_item_tree_effect_finish(sd);
|
|
|
|
ecore_animator_del(sd->tree_effect_animator);
|
|
|
|
sd->tree_effect_animator = NULL;
|
|
|
|
}
|
|
|
|
sd->expanded_item = NULL;
|
|
|
|
sd->move_effect_mode = ELM_GENLIST_TREE_EFFECT_NONE;
|
|
|
|
}
|
|
|
|
if (sd->expanded_next_item == it) sd->expanded_next_item = NULL;
|
|
|
|
if (sd->move_items) sd->move_items = eina_list_remove(sd->move_items, it);
|
|
|
|
if (it->parent)
|
|
|
|
it->parent->item->items = eina_list_remove(it->parent->item->items, it);
|
|
|
|
if (it->item->swipe_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->item->swipe_timer);
|
|
|
|
it->item->swipe_timer = NULL;
|
|
|
|
}
|
|
|
|
_elm_genlist_item_del_serious(it);
|
|
|
|
elm_genlist_item_class_unref((Elm_Genlist_Item_Class *)it->itc);
|
|
|
|
evas_event_thaw(evas_object_evas_get(obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(obj));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_unselect(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
if ((it->generation < GL_IT(it)->wsd->generation) || (!it->selected))
|
|
|
|
return;
|
|
|
|
|
|
|
|
it->selected = EINA_FALSE;
|
|
|
|
GL_IT(it)->wsd->selected = eina_list_remove(GL_IT(it)->wsd->selected, it);
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_UNSELECTED, it);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_mouse_move_cb(void *data,
|
|
|
|
Evas *evas __UNUSED__,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it = data;
|
|
|
|
Elm_Genlist_Smart_Data *sd;
|
|
|
|
Evas_Event_Mouse_Move *ev = event_info;
|
|
|
|
Evas_Coord ox, oy, ow, oh, it_scrl_y, y_pos;
|
|
|
|
Evas_Coord minw = 0, minh = 0, x, y, dx, dy, adx, ady;
|
|
|
|
|
|
|
|
sd = GL_IT(it)->wsd;
|
|
|
|
|
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
|
|
|
|
{
|
|
|
|
if (!sd->on_hold)
|
|
|
|
{
|
|
|
|
sd->on_hold = EINA_TRUE;
|
|
|
|
if ((!sd->wasselected) && (!it->flipped))
|
|
|
|
{
|
|
|
|
_item_unhighlight(it);
|
|
|
|
_item_unselect(it);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (sd->multi_touched)
|
|
|
|
{
|
|
|
|
sd->cur_x = ev->cur.canvas.x;
|
|
|
|
sd->cur_y = ev->cur.canvas.y;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if ((it->dragging) && (it->down))
|
|
|
|
{
|
|
|
|
if (sd->movements == SWIPE_MOVES)
|
|
|
|
sd->swipe = EINA_TRUE;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sd->history[sd->movements].x = ev->cur.canvas.x;
|
|
|
|
sd->history[sd->movements].y = ev->cur.canvas.y;
|
|
|
|
if (abs((sd->history[sd->movements].x -
|
|
|
|
sd->history[0].x)) > 40)
|
|
|
|
sd->swipe = EINA_TRUE;
|
|
|
|
else
|
|
|
|
sd->movements++;
|
|
|
|
}
|
|
|
|
if (it->long_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
|
|
|
}
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_DRAG, it);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if ((!it->down) || (sd->longpressed))
|
|
|
|
{
|
|
|
|
if (it->long_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
|
|
|
}
|
|
|
|
if ((sd->reorder_mode) && (sd->reorder_it))
|
|
|
|
{
|
|
|
|
evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh);
|
|
|
|
it_scrl_y = ev->cur.canvas.y - sd->reorder_it->dy;
|
|
|
|
|
|
|
|
if (!sd->reorder_start_y)
|
|
|
|
sd->reorder_start_y = it->item->block->y + it->y;
|
|
|
|
|
|
|
|
if (it_scrl_y < oy)
|
|
|
|
y_pos = oy;
|
|
|
|
else if (it_scrl_y + sd->reorder_it->item->h > oy + oh)
|
|
|
|
y_pos = oy + oh - sd->reorder_it->item->h;
|
|
|
|
else
|
|
|
|
y_pos = it_scrl_y;
|
|
|
|
|
|
|
|
if (it->deco_all_view)
|
|
|
|
_item_position(it, it->deco_all_view, it->item->scrl_x, y_pos);
|
|
|
|
else
|
|
|
|
_item_position(it, VIEW(it), it->item->scrl_x, y_pos);
|
|
|
|
|
|
|
|
if (sd->calc_job) ecore_job_del(sd->calc_job);
|
|
|
|
sd->calc_job = ecore_job_add(_calc_job, sd);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (it->select_mode != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY)
|
|
|
|
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
|
|
|
|
|
|
|
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
|
|
|
|
x = ev->cur.canvas.x - x;
|
|
|
|
y = ev->cur.canvas.y - y;
|
|
|
|
dx = x - it->dx;
|
|
|
|
adx = dx;
|
|
|
|
if (adx < 0) adx = -dx;
|
|
|
|
|
|
|
|
dy = y - it->dy;
|
|
|
|
ady = dy;
|
|
|
|
if (ady < 0) ady = -dy;
|
|
|
|
|
|
|
|
minw /= 2;
|
|
|
|
minh /= 2;
|
|
|
|
if ((adx > minw) || (ady > minh))
|
|
|
|
{
|
|
|
|
it->dragging = EINA_TRUE;
|
|
|
|
if (it->long_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
|
|
|
}
|
|
|
|
if (!sd->wasselected)
|
|
|
|
{
|
|
|
|
_item_unhighlight(it);
|
|
|
|
_item_unselect(it);
|
|
|
|
}
|
|
|
|
if (dy < 0)
|
|
|
|
{
|
|
|
|
if (ady > adx)
|
|
|
|
evas_object_smart_callback_call
|
|
|
|
(WIDGET(it), SIG_DRAG_START_UP, it);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (dx < 0)
|
|
|
|
evas_object_smart_callback_call
|
|
|
|
(WIDGET(it), SIG_DRAG_START_LEFT, it);
|
|
|
|
else
|
|
|
|
evas_object_smart_callback_call
|
|
|
|
(WIDGET(it), SIG_DRAG_START_RIGHT, it);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (ady > adx)
|
|
|
|
evas_object_smart_callback_call
|
|
|
|
(WIDGET(it), SIG_DRAG_START_DOWN, it);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (dx < 0)
|
|
|
|
evas_object_smart_callback_call
|
|
|
|
(WIDGET(it), SIG_DRAG_START_LEFT, it);
|
|
|
|
else
|
|
|
|
evas_object_smart_callback_call
|
|
|
|
(WIDGET(it), SIG_DRAG_START_RIGHT, it);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_long_press_cb(void *data)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it = data, *it_tmp;
|
|
|
|
Elm_Genlist_Smart_Data *sd;
|
|
|
|
Eina_List *list, *l;
|
|
|
|
|
|
|
|
sd = GL_IT(it)->wsd;
|
|
|
|
|
|
|
|
it->long_timer = NULL;
|
|
|
|
if (elm_widget_item_disabled_get(it) || (it->dragging) ||
|
|
|
|
(it->select_mode == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY))
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
|
|
|
|
GL_IT(it)->wsd->longpressed = EINA_TRUE;
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_LONGPRESSED, it);
|
|
|
|
if ((GL_IT(it)->wsd->reorder_mode) && (!it->group))
|
|
|
|
{
|
|
|
|
GL_IT(it)->wsd->reorder_it = it;
|
|
|
|
GL_IT(it)->wsd->reorder_start_y = 0;
|
|
|
|
if (it->deco_all_view)
|
|
|
|
evas_object_raise(it->deco_all_view);
|
|
|
|
else
|
|
|
|
evas_object_raise(VIEW(it));
|
|
|
|
|
|
|
|
sd->s_iface->hold_set(ELM_WIDGET_DATA(sd)->obj, EINA_TRUE);
|
|
|
|
sd->s_iface->bounce_allow_set
|
|
|
|
(ELM_WIDGET_DATA(sd)->obj, EINA_FALSE, EINA_FALSE);
|
|
|
|
|
|
|
|
list = elm_genlist_realized_items_get
|
|
|
|
(ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj);
|
|
|
|
EINA_LIST_FOREACH (list, l, it_tmp)
|
|
|
|
{
|
|
|
|
if (it != it_tmp) _item_unselect(it_tmp);
|
|
|
|
}
|
|
|
|
if (elm_genlist_item_expanded_get((Elm_Object_Item *)it))
|
|
|
|
{
|
|
|
|
elm_genlist_item_expanded_set((Elm_Object_Item *)it, EINA_FALSE);
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!GL_IT(it)->wsd->decorate_all_mode)
|
|
|
|
edje_object_signal_emit
|
|
|
|
(VIEW(it), "elm,state,reorder,enabled", "elm");
|
|
|
|
}
|
|
|
|
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_swipe_do(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
int i, sum = 0;
|
|
|
|
|
|
|
|
if (!it) return;
|
|
|
|
if ((it->select_mode == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) ||
|
|
|
|
elm_widget_item_disabled_get(it)) return;
|
|
|
|
|
|
|
|
GL_IT(it)->wsd->swipe = EINA_FALSE;
|
|
|
|
for (i = 0; i < GL_IT(it)->wsd->movements; i++)
|
|
|
|
{
|
|
|
|
sum += GL_IT(it)->wsd->history[i].x;
|
|
|
|
if (abs(GL_IT(it)->wsd->history[0].y -
|
|
|
|
GL_IT(it)->wsd->history[i].y) > 10) return;
|
|
|
|
}
|
|
|
|
|
|
|
|
sum /= GL_IT(it)->wsd->movements;
|
|
|
|
if (abs(sum - GL_IT(it)->wsd->history[0].x) <= 10) return;
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_SWIPE, it);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_swipe_cancel(void *data)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it = data;
|
|
|
|
|
|
|
|
if (!it) return ECORE_CALLBACK_CANCEL;
|
|
|
|
GL_IT(it)->wsd->swipe = EINA_FALSE;
|
|
|
|
GL_IT(it)->wsd->movements = 0;
|
|
|
|
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_multi_cancel(void *data)
|
|
|
|
{
|
|
|
|
Elm_Genlist_Smart_Data *sd = data;
|
|
|
|
|
|
|
|
if (!sd) return ECORE_CALLBACK_CANCEL;
|
|
|
|
sd->multi_timeout = EINA_TRUE;
|
|
|
|
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_multi_touch_gesture_eval(void *data)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it = data;
|
|
|
|
Evas_Coord minw = 0, minh = 0;
|
|
|
|
Evas_Coord off_x, off_y, off_mx, off_my;
|
|
|
|
|
|
|
|
GL_IT(it)->wsd->multi_touched = EINA_FALSE;
|
|
|
|
if (GL_IT(it)->wsd->multi_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(GL_IT(it)->wsd->multi_timer);
|
|
|
|
GL_IT(it)->wsd->multi_timer = NULL;
|
|
|
|
}
|
|
|
|
if (GL_IT(it)->wsd->multi_timeout)
|
|
|
|
{
|
|
|
|
GL_IT(it)->wsd->multi_timeout = EINA_FALSE;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
|
|
|
off_x = abs(GL_IT(it)->wsd->cur_x - GL_IT(it)->wsd->prev_x);
|
|
|
|
off_y = abs(GL_IT(it)->wsd->cur_y - GL_IT(it)->wsd->prev_y);
|
|
|
|
off_mx = abs(GL_IT(it)->wsd->cur_mx - GL_IT(it)->wsd->prev_mx);
|
|
|
|
off_my = abs(GL_IT(it)->wsd->cur_my - GL_IT(it)->wsd->prev_my);
|
|
|
|
|
|
|
|
if (((off_x > minw) || (off_y > minh)) && ((off_mx > minw)
|
|
|
|
|| (off_my > minh)))
|
|
|
|
{
|
|
|
|
if ((off_x + off_mx) > (off_y + off_my))
|
|
|
|
{
|
|
|
|
if ((GL_IT(it)->wsd->cur_x > GL_IT(it)->wsd->prev_x)
|
|
|
|
&& (GL_IT(it)->wsd->cur_mx > GL_IT(it)->wsd->prev_mx))
|
|
|
|
evas_object_smart_callback_call
|
|
|
|
(WIDGET(it), SIG_MULTI_SWIPE_RIGHT, it);
|
|
|
|
else if ((GL_IT(it)->wsd->cur_x < GL_IT(it)->wsd->prev_x)
|
|
|
|
&& (GL_IT(it)->wsd->cur_mx < GL_IT(it)->wsd->prev_mx))
|
|
|
|
evas_object_smart_callback_call
|
|
|
|
(WIDGET(it), SIG_MULTI_SWIPE_LEFT, it);
|
|
|
|
else if (abs(GL_IT(it)->wsd->cur_x - GL_IT(it)->wsd->cur_mx) >
|
|
|
|
abs(GL_IT(it)->wsd->prev_x - GL_IT(it)->wsd->prev_mx))
|
|
|
|
evas_object_smart_callback_call
|
|
|
|
(WIDGET(it), SIG_MULTI_PINCH_OUT, it);
|
|
|
|
else
|
|
|
|
evas_object_smart_callback_call
|
|
|
|
(WIDGET(it), SIG_MULTI_PINCH_IN, it);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((GL_IT(it)->wsd->cur_y > GL_IT(it)->wsd->prev_y)
|
|
|
|
&& (GL_IT(it)->wsd->cur_my > GL_IT(it)->wsd->prev_my))
|
|
|
|
evas_object_smart_callback_call
|
|
|
|
(WIDGET(it), SIG_MULTI_SWIPE_DOWN, it);
|
|
|
|
else if ((GL_IT(it)->wsd->cur_y < GL_IT(it)->wsd->prev_y)
|
|
|
|
&& (GL_IT(it)->wsd->cur_my < GL_IT(it)->wsd->prev_my))
|
|
|
|
evas_object_smart_callback_call
|
|
|
|
(WIDGET(it), SIG_MULTI_SWIPE_UP, it);
|
|
|
|
else if (abs(GL_IT(it)->wsd->cur_y - GL_IT(it)->wsd->cur_my) >
|
|
|
|
abs(GL_IT(it)->wsd->prev_y - GL_IT(it)->wsd->prev_my))
|
|
|
|
evas_object_smart_callback_call
|
|
|
|
(WIDGET(it), SIG_MULTI_PINCH_OUT, it);
|
|
|
|
else
|
|
|
|
evas_object_smart_callback_call
|
|
|
|
(WIDGET(it), SIG_MULTI_PINCH_IN, it);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GL_IT(it)->wsd->multi_timeout = EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_multi_down_cb(void *data,
|
|
|
|
Evas *evas __UNUSED__,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it = data;
|
|
|
|
Evas_Event_Multi_Down *ev = event_info;
|
|
|
|
|
|
|
|
if ((GL_IT(it)->wsd->multi_device != 0) || (GL_IT(it)->wsd->multi_touched)
|
|
|
|
|| (GL_IT(it)->wsd->multi_timeout))
|
|
|
|
return;
|
|
|
|
|
|
|
|
GL_IT(it)->wsd->multi_device = ev->device;
|
|
|
|
GL_IT(it)->wsd->multi_down = EINA_TRUE;
|
|
|
|
GL_IT(it)->wsd->multi_touched = EINA_TRUE;
|
|
|
|
GL_IT(it)->wsd->prev_mx = ev->canvas.x;
|
|
|
|
GL_IT(it)->wsd->prev_my = ev->canvas.y;
|
|
|
|
if (!GL_IT(it)->wsd->wasselected)
|
|
|
|
{
|
|
|
|
_item_unhighlight(it);
|
|
|
|
_item_unselect(it);
|
|
|
|
}
|
|
|
|
GL_IT(it)->wsd->wasselected = EINA_FALSE;
|
|
|
|
GL_IT(it)->wsd->longpressed = EINA_FALSE;
|
|
|
|
if (it->long_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
|
|
|
}
|
|
|
|
if (it->dragging)
|
|
|
|
{
|
|
|
|
it->dragging = EINA_FALSE;
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_DRAG_STOP, it);
|
|
|
|
}
|
|
|
|
if (it->item->swipe_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->item->swipe_timer);
|
|
|
|
it->item->swipe_timer = NULL;
|
|
|
|
}
|
|
|
|
if (GL_IT(it)->wsd->on_hold)
|
|
|
|
{
|
|
|
|
GL_IT(it)->wsd->swipe = EINA_FALSE;
|
|
|
|
GL_IT(it)->wsd->movements = 0;
|
|
|
|
GL_IT(it)->wsd->on_hold = EINA_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_multi_up_cb(void *data,
|
|
|
|
Evas *evas __UNUSED__,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it = data;
|
|
|
|
Evas_Event_Multi_Up *ev = event_info;
|
|
|
|
|
|
|
|
if (GL_IT(it)->wsd->multi_device != ev->device) return;
|
|
|
|
GL_IT(it)->wsd->multi_device = 0;
|
|
|
|
GL_IT(it)->wsd->multi_down = EINA_FALSE;
|
|
|
|
if (GL_IT(it)->wsd->mouse_down) return;
|
|
|
|
_multi_touch_gesture_eval(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_multi_move_cb(void *data,
|
|
|
|
Evas *evas __UNUSED__,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it = data;
|
|
|
|
Evas_Event_Multi_Move *ev = event_info;
|
|
|
|
|
|
|
|
if (GL_IT(it)->wsd->multi_device != ev->device) return;
|
|
|
|
GL_IT(it)->wsd->cur_mx = ev->cur.canvas.x;
|
|
|
|
GL_IT(it)->wsd->cur_my = ev->cur.canvas.y;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_mouse_down_cb(void *data,
|
|
|
|
Evas *evas __UNUSED__,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Down *ev = event_info;
|
|
|
|
Elm_Genlist_Smart_Data *sd;
|
|
|
|
Elm_Gen_Item *it = data;
|
|
|
|
Evas_Coord x, y;
|
|
|
|
|
|
|
|
sd = GL_IT(it)->wsd;
|
|
|
|
|
|
|
|
if (ev->button != 1) return;
|
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
|
|
|
|
{
|
|
|
|
sd->on_hold = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
it->down = EINA_TRUE;
|
|
|
|
it->dragging = EINA_FALSE;
|
|
|
|
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
|
|
|
|
it->dx = ev->canvas.x - x;
|
|
|
|
it->dy = ev->canvas.y - y;
|
|
|
|
sd->mouse_down = EINA_TRUE;
|
|
|
|
if (!sd->multi_touched)
|
|
|
|
{
|
|
|
|
sd->prev_x = ev->canvas.x;
|
|
|
|
sd->prev_y = ev->canvas.y;
|
|
|
|
sd->multi_timeout = EINA_FALSE;
|
|
|
|
if (sd->multi_timer) ecore_timer_del(sd->multi_timer);
|
|
|
|
sd->multi_timer = ecore_timer_add(1, _multi_cancel, sd);
|
|
|
|
}
|
|
|
|
sd->longpressed = EINA_FALSE;
|
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) sd->on_hold = EINA_TRUE;
|
|
|
|
else sd->on_hold = EINA_FALSE;
|
|
|
|
if (sd->on_hold) return;
|
|
|
|
sd->wasselected = it->selected;
|
|
|
|
_item_highlight(it);
|
|
|
|
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
|
|
|
|
if ((!elm_widget_item_disabled_get(it)) &&
|
|
|
|
(it->select_mode != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY))
|
|
|
|
{
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED_DOUBLE, it);
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it);
|
|
|
|
}
|
|
|
|
if (it->item->swipe_timer) ecore_timer_del(it->item->swipe_timer);
|
|
|
|
it->item->swipe_timer = ecore_timer_add(0.4, _swipe_cancel, it);
|
|
|
|
if (it->long_timer) ecore_timer_del(it->long_timer);
|
|
|
|
if (it->realized)
|
|
|
|
it->long_timer = ecore_timer_add
|
|
|
|
(sd->longpress_timeout, _long_press_cb, it);
|
|
|
|
else
|
|
|
|
it->long_timer = NULL;
|
|
|
|
sd->swipe = EINA_FALSE;
|
|
|
|
sd->movements = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Item_Block *
|
|
|
|
_item_block_new(Elm_Genlist_Smart_Data *sd,
|
|
|
|
Eina_Bool prepend)
|
|
|
|
{
|
|
|
|
Item_Block *itb;
|
|
|
|
|
|
|
|
itb = calloc(1, sizeof(Item_Block));
|
|
|
|
if (!itb) return NULL;
|
|
|
|
itb->sd = sd;
|
|
|
|
if (prepend)
|
|
|
|
{
|
|
|
|
sd->blocks = eina_inlist_prepend(sd->blocks, EINA_INLIST_GET(itb));
|
|
|
|
_item_block_position_update(sd->blocks, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sd->blocks = eina_inlist_append(sd->blocks, EINA_INLIST_GET(itb));
|
|
|
|
itb->position_update = EINA_TRUE;
|
|
|
|
if (sd->blocks != EINA_INLIST_GET(itb))
|
|
|
|
{
|
|
|
|
itb->position =
|
|
|
|
((Item_Block *)(EINA_INLIST_GET(itb)->prev))->position + 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
itb->position = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return itb;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_item_block_add(Elm_Genlist_Smart_Data *sd,
|
|
|
|
Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
Item_Block *itb = NULL;
|
|
|
|
|
|
|
|
if (!it->item->rel)
|
|
|
|
{
|
|
|
|
newblock:
|
|
|
|
if (it->item->rel)
|
|
|
|
{
|
|
|
|
itb = calloc(1, sizeof(Item_Block));
|
|
|
|
if (!itb) return EINA_FALSE;
|
|
|
|
itb->sd = sd;
|
|
|
|
if (!it->item->rel->item->block)
|
|
|
|
{
|
|
|
|
sd->blocks =
|
|
|
|
eina_inlist_append(sd->blocks, EINA_INLIST_GET(itb));
|
|
|
|
itb->items = eina_list_append(itb->items, it);
|
|
|
|
itb->position_update = EINA_TRUE;
|
|
|
|
it->position = eina_list_count(itb->items);
|
|
|
|
it->position_update = EINA_TRUE;
|
|
|
|
|
|
|
|
if (sd->blocks != EINA_INLIST_GET(itb))
|
|
|
|
{
|
|
|
|
itb->position =
|
|
|
|
((Item_Block *)
|
|
|
|
(EINA_INLIST_GET(itb)->prev))->position + 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
itb->position = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Eina_List *tmp;
|
|
|
|
|
|
|
|
tmp = eina_list_data_find_list(itb->items, it->item->rel);
|
|
|
|
if (it->item->before)
|
|
|
|
{
|
|
|
|
sd->blocks = eina_inlist_prepend_relative
|
|
|
|
(sd->blocks, EINA_INLIST_GET(itb),
|
|
|
|
EINA_INLIST_GET(it->item->rel->item->block));
|
|
|
|
itb->items =
|
|
|
|
eina_list_prepend_relative_list(itb->items, it, tmp);
|
|
|
|
|
|
|
|
/* Update index from where we prepended */
|
|
|
|
_item_position_update
|
|
|
|
(eina_list_prev(tmp), it->item->rel->position);
|
|
|
|
_item_block_position_update
|
|
|
|
(EINA_INLIST_GET(itb),
|
|
|
|
it->item->rel->item->block->position);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sd->blocks = eina_inlist_append_relative
|
|
|
|
(sd->blocks, EINA_INLIST_GET(itb),
|
|
|
|
EINA_INLIST_GET(it->item->rel->item->block));
|
|
|
|
itb->items =
|
|
|
|
eina_list_append_relative_list(itb->items, it, tmp);
|
|
|
|
|
|
|
|
/* Update block index from where we appended */
|
|
|
|
_item_position_update
|
|
|
|
(eina_list_next(tmp), it->item->rel->position + 1);
|
|
|
|
_item_block_position_update
|
|
|
|
(EINA_INLIST_GET(itb),
|
|
|
|
it->item->rel->item->block->position + 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (it->item->before)
|
|
|
|
{
|
|
|
|
if (sd->blocks)
|
|
|
|
{
|
|
|
|
itb = (Item_Block *)(sd->blocks);
|
|
|
|
if (itb->count >= sd->max_items_per_block)
|
|
|
|
{
|
|
|
|
itb = _item_block_new(sd, EINA_TRUE);
|
|
|
|
if (!itb) return EINA_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
itb = _item_block_new(sd, EINA_TRUE);
|
|
|
|
if (!itb) return EINA_FALSE;
|
|
|
|
}
|
|
|
|
itb->items = eina_list_prepend(itb->items, it);
|
|
|
|
|
|
|
|
_item_position_update(itb->items, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (sd->blocks)
|
|
|
|
{
|
|
|
|
itb = (Item_Block *)(sd->blocks->last);
|
|
|
|
if (itb->count >= sd->max_items_per_block)
|
|
|
|
{
|
|
|
|
itb = _item_block_new(sd, EINA_FALSE);
|
|
|
|
if (!itb) return EINA_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
itb = _item_block_new(sd, EINA_FALSE);
|
|
|
|
if (!itb) return EINA_FALSE;
|
|
|
|
}
|
|
|
|
itb->items = eina_list_append(itb->items, it);
|
|
|
|
it->position = eina_list_count(itb->items);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Eina_List *tmp;
|
|
|
|
|
|
|
|
if (it->item->rel->item->queued)
|
|
|
|
{
|
|
|
|
/* NOTE: for a strange reason eina_list and eina_inlist
|
|
|
|
don't have the same property on sorted insertion
|
|
|
|
order, so the queue is not always ordered like the
|
|
|
|
item list. This lead to issue where we depend on an
|
|
|
|
item that is not yet created. As a quick work around,
|
|
|
|
we reschedule the calc of the item and stop reordering
|
|
|
|
the list to prevent any nasty issue to show up here.
|
|
|
|
*/
|
|
|
|
sd->queue = eina_list_append(sd->queue, it);
|
|
|
|
sd->requeued = EINA_TRUE;
|
|
|
|
it->item->queued = EINA_TRUE;
|
|
|
|
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
itb = it->item->rel->item->block;
|
|
|
|
if (!itb) goto newblock;
|
|
|
|
tmp = eina_list_data_find_list(itb->items, it->item->rel);
|
|
|
|
if (it->item->before)
|
|
|
|
{
|
|
|
|
itb->items = eina_list_prepend_relative_list(itb->items, it, tmp);
|
|
|
|
_item_position_update
|
|
|
|
(eina_list_prev(tmp), it->item->rel->position);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
itb->items = eina_list_append_relative_list(itb->items, it, tmp);
|
|
|
|
_item_position_update
|
|
|
|
(eina_list_next(tmp), it->item->rel->position + 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
itb->count++;
|
|
|
|
itb->changed = EINA_TRUE;
|
|
|
|
it->item->block = itb;
|
|
|
|
if (itb->sd->calc_job) ecore_job_del(itb->sd->calc_job);
|
|
|
|
itb->sd->calc_job = ecore_job_add(_calc_job, itb->sd);
|
|
|
|
if (it->item->rel)
|
|
|
|
{
|
|
|
|
it->item->rel->relcount--;
|
|
|
|
if ((it->item->rel->generation < GL_IT(it)->wsd->generation)
|
|
|
|
&& (!it->item->rel->relcount))
|
|
|
|
{
|
|
|
|
_item_del(it->item->rel);
|
|
|
|
elm_widget_item_free(it->item->rel);
|
|
|
|
}
|
|
|
|
it->item->rel = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (itb->count > itb->sd->max_items_per_block)
|
|
|
|
{
|
|
|
|
int newc;
|
|
|
|
Item_Block *itb2;
|
|
|
|
Elm_Gen_Item *it2;
|
|
|
|
Eina_Bool done = EINA_FALSE;
|
|
|
|
|
|
|
|
newc = itb->count / 2;
|
|
|
|
|
|
|
|
if (EINA_INLIST_GET(itb)->prev)
|
|
|
|
{
|
|
|
|
Item_Block *itbp = (Item_Block *)(EINA_INLIST_GET(itb)->prev);
|
|
|
|
|
|
|
|
if (itbp->count + newc < sd->max_items_per_block / 2)
|
|
|
|
{
|
|
|
|
/* moving items to previous block */
|
|
|
|
while ((itb->count > newc) && (itb->items))
|
|
|
|
{
|
|
|
|
it2 = eina_list_data_get(itb->items);
|
|
|
|
itb->items = eina_list_remove_list
|
|
|
|
(itb->items, itb->items);
|
|
|
|
itb->count--;
|
|
|
|
|
|
|
|
itbp->items = eina_list_append(itbp->items, it2);
|
|
|
|
it2->item->block = itbp;
|
|
|
|
itbp->count++;
|
|
|
|
}
|
|
|
|
|
|
|
|
done = EINA_TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!done && EINA_INLIST_GET(itb)->next)
|
|
|
|
{
|
|
|
|
Item_Block *itbn = (Item_Block *)(EINA_INLIST_GET(itb)->next);
|
|
|
|
|
|
|
|
if (itbn->count + newc < sd->max_items_per_block / 2)
|
|
|
|
{
|
|
|
|
/* moving items to next block */
|
|
|
|
while ((itb->count > newc) && (itb->items))
|
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
l = eina_list_last(itb->items);
|
|
|
|
it2 = eina_list_data_get(l);
|
|
|
|
itb->items = eina_list_remove_list(itb->items, l);
|
|
|
|
itb->count--;
|
|
|
|
|
|
|
|
itbn->items = eina_list_prepend(itbn->items, it2);
|
|
|
|
it2->item->block = itbn;
|
|
|
|
itbn->count++;
|
|
|
|
}
|
|
|
|
|
|
|
|
done = EINA_TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!done)
|
|
|
|
{
|
|
|
|
/* moving items to new block */
|
|
|
|
itb2 = calloc(1, sizeof(Item_Block));
|
|
|
|
if (!itb2) return EINA_FALSE;
|
|
|
|
itb2->sd = sd;
|
|
|
|
sd->blocks =
|
|
|
|
eina_inlist_append_relative(sd->blocks, EINA_INLIST_GET(itb2),
|
|
|
|
EINA_INLIST_GET(itb));
|
|
|
|
itb2->changed = EINA_TRUE;
|
|
|
|
while ((itb->count > newc) && (itb->items))
|
|
|
|
{
|
2011-03-22 00:54:24 -07:00
|
|
|
Eina_List *l;
|
2012-07-16 14:56:30 -07:00
|
|
|
|
|
|
|
l = eina_list_last(itb->items);
|
|
|
|
it2 = l->data;
|
|
|
|
itb->items = eina_list_remove_list(itb->items, l);
|
|
|
|
itb->count--;
|
|
|
|
|
|
|
|
itb2->items = eina_list_prepend(itb2->items, it2);
|
|
|
|
it2->item->block = itb2;
|
|
|
|
itb2->count++;
|
2011-03-22 00:54:24 -07:00
|
|
|
}
|
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
_item_process(Elm_Genlist_Smart_Data *sd,
|
|
|
|
Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
if (!_item_block_add(sd, it)) return 1;
|
|
|
|
if (!sd->blocks)
|
|
|
|
_item_block_realize(it->item->block);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_process_post(Elm_Genlist_Smart_Data *sd,
|
|
|
|
Elm_Gen_Item *it,
|
|
|
|
Eina_Bool qadd)
|
|
|
|
{
|
|
|
|
Eina_Bool show_me = EINA_FALSE;
|
|
|
|
|
|
|
|
if (it->item->block->changed)
|
|
|
|
{
|
|
|
|
show_me = _item_block_recalc
|
|
|
|
(it->item->block, it->item->block->num, qadd);
|
|
|
|
it->item->block->changed = 0;
|
|
|
|
if (sd->pan_changed)
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->calc_job) ecore_job_del(sd->calc_job);
|
|
|
|
sd->calc_job = NULL;
|
|
|
|
_calc_job(sd);
|
|
|
|
sd->pan_changed = EINA_FALSE;
|
2011-03-22 00:54:24 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
}
|
|
|
|
if (show_me) it->item->block->show_me = EINA_TRUE;
|
|
|
|
|
|
|
|
/* when prepending, move the scroller along with the first selected
|
|
|
|
* item to create the illusion that we're watching the selected
|
|
|
|
* item this prevents the selected item being scrolled off the
|
|
|
|
* viewport
|
|
|
|
*/
|
|
|
|
if (sd->selected && it->item->before)
|
|
|
|
{
|
|
|
|
int y, h;
|
|
|
|
Elm_Gen_Item *it2;
|
|
|
|
|
|
|
|
it2 = sd->selected->data;
|
|
|
|
sd->s_iface->content_pos_get(ELM_WIDGET_DATA(sd)->obj, NULL, &y);
|
|
|
|
evas_object_geometry_get(sd->pan_obj, NULL, NULL, NULL, &h);
|
|
|
|
if ((it->y + it->item->block->y > y + h) ||
|
|
|
|
(it->y + it->item->block->y + it->item->h < y))
|
|
|
|
/* offscreen, just update */
|
|
|
|
sd->s_iface->content_region_show
|
|
|
|
(ELM_WIDGET_DATA(sd)->obj, it2->x + it2->item->block->x, y,
|
|
|
|
it2->item->block->w, h);
|
|
|
|
else
|
|
|
|
sd->s_iface->content_region_show
|
|
|
|
(ELM_WIDGET_DATA(sd)->obj, it->x + it->item->block->x,
|
|
|
|
y + it->item->h, it->item->block->w, h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
_queue_process(Elm_Genlist_Smart_Data *sd)
|
|
|
|
{
|
|
|
|
int n;
|
|
|
|
double t0, t;
|
|
|
|
|
|
|
|
t0 = ecore_loop_time_get();
|
|
|
|
for (n = 0; (sd->queue) && (n < 128); n++)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it;
|
|
|
|
|
|
|
|
it = eina_list_data_get(sd->queue);
|
|
|
|
sd->queue = eina_list_remove_list(sd->queue, sd->queue);
|
|
|
|
it->item->queued = EINA_FALSE;
|
|
|
|
if (_item_process(sd, it)) continue;
|
|
|
|
t = ecore_time_get();
|
|
|
|
_item_process_post(sd, it, EINA_TRUE);
|
|
|
|
/* same as eina_inlist_count > 1 */
|
|
|
|
if (sd->blocks && sd->blocks->next)
|
|
|
|
{
|
|
|
|
if ((t - t0) > (ecore_animator_frametime_get())) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return n;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_idle_process(void *data,
|
|
|
|
Eina_Bool *wakeup)
|
|
|
|
{
|
|
|
|
Elm_Genlist_Smart_Data *sd = data;
|
|
|
|
|
|
|
|
if (_queue_process(sd) > 0) *wakeup = EINA_TRUE;
|
|
|
|
if (!sd->queue)
|
|
|
|
{
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_item_idle_enterer(void *data)
|
|
|
|
{
|
|
|
|
Eina_Bool wakeup = EINA_FALSE;
|
|
|
|
Elm_Genlist_Smart_Data *sd = data;
|
|
|
|
Eina_Bool ok = _idle_process(data, &wakeup);
|
|
|
|
|
|
|
|
if (wakeup)
|
|
|
|
{
|
|
|
|
// wake up mainloop
|
|
|
|
if (sd->calc_job) ecore_job_del(sd->calc_job);
|
|
|
|
sd->calc_job = ecore_job_add(_calc_job, sd);
|
|
|
|
}
|
|
|
|
if (ok == ECORE_CALLBACK_CANCEL) sd->queue_idle_enterer = NULL;
|
|
|
|
|
|
|
|
return ok;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_queue(Elm_Genlist_Smart_Data *sd,
|
|
|
|
Elm_Gen_Item *it,
|
|
|
|
Eina_Compare_Cb cb)
|
|
|
|
{
|
|
|
|
if (it->item->queued) return;
|
|
|
|
it->item->queued = EINA_TRUE;
|
|
|
|
if (cb && !sd->requeued)
|
|
|
|
sd->queue = eina_list_sorted_insert(sd->queue, cb, it);
|
|
|
|
else
|
|
|
|
sd->queue = eina_list_append(sd->queue, it);
|
|
|
|
// FIXME: why does a freeze then thaw here cause some genlist
|
|
|
|
// elm_genlist_item_append() to be much much slower?
|
|
|
|
// evas_event_freeze(evas_object_evas_get(sd->obj));
|
|
|
|
while ((sd->queue) && ((!sd->blocks) || (!sd->blocks->next)))
|
|
|
|
{
|
|
|
|
if (sd->queue_idle_enterer)
|
|
|
|
{
|
|
|
|
ecore_idle_enterer_del(sd->queue_idle_enterer);
|
|
|
|
sd->queue_idle_enterer = NULL;
|
|
|
|
}
|
|
|
|
_queue_process(sd);
|
|
|
|
}
|
|
|
|
while ((sd->queue) && (sd->blocks) &&
|
|
|
|
(sd->homogeneous) && (sd->mode == ELM_LIST_COMPRESS))
|
|
|
|
{
|
|
|
|
if (sd->queue_idle_enterer)
|
|
|
|
{
|
|
|
|
ecore_idle_enterer_del(sd->queue_idle_enterer);
|
|
|
|
sd->queue_idle_enterer = NULL;
|
|
|
|
}
|
|
|
|
_queue_process(sd);
|
|
|
|
}
|
|
|
|
|
|
|
|
// evas_event_thaw(evas_object_evas_get(sd->obj));
|
|
|
|
// evas_event_thaw_eval(evas_object_evas_get(sd->obj));
|
|
|
|
if (!sd->queue_idle_enterer)
|
|
|
|
sd->queue_idle_enterer = ecore_idle_enterer_add(_item_idle_enterer, sd);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If the application wants to know the relative item, use
|
|
|
|
* elm_genlist_item_prev_get(it)*/
|
|
|
|
static void
|
|
|
|
_item_move_after(Elm_Gen_Item *it,
|
|
|
|
Elm_Gen_Item *after)
|
|
|
|
{
|
|
|
|
if (!it) return;
|
|
|
|
if (!after) return;
|
|
|
|
|
|
|
|
GL_IT(it)->wsd->items =
|
|
|
|
eina_inlist_remove(GL_IT(it)->wsd->items, EINA_INLIST_GET(it));
|
|
|
|
_item_block_del(it);
|
|
|
|
|
|
|
|
GL_IT(it)->wsd->items = eina_inlist_append_relative
|
|
|
|
(GL_IT(it)->wsd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(after));
|
|
|
|
it->item->rel = after;
|
|
|
|
it->item->rel->relcount++;
|
|
|
|
it->item->before = EINA_FALSE;
|
|
|
|
if (after->item->group_item) it->item->group_item = after->item->group_item;
|
|
|
|
_item_queue(GL_IT(it)->wsd, it, NULL);
|
|
|
|
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_MOVED_AFTER, it);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If the application wants to know the relative item, use
|
|
|
|
* elm_genlist_item_next_get(it)*/
|
|
|
|
static void
|
|
|
|
_item_move_before(Elm_Gen_Item *it,
|
|
|
|
Elm_Gen_Item *before)
|
|
|
|
{
|
|
|
|
if (!it) return;
|
|
|
|
if (!before) return;
|
|
|
|
|
|
|
|
GL_IT(it)->wsd->items =
|
|
|
|
eina_inlist_remove(GL_IT(it)->wsd->items, EINA_INLIST_GET(it));
|
|
|
|
_item_block_del(it);
|
|
|
|
GL_IT(it)->wsd->items = eina_inlist_prepend_relative
|
|
|
|
(GL_IT(it)->wsd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(before));
|
|
|
|
it->item->rel = before;
|
|
|
|
it->item->rel->relcount++;
|
|
|
|
it->item->before = EINA_TRUE;
|
|
|
|
if (before->item->group_item)
|
|
|
|
it->item->group_item = before->item->group_item;
|
|
|
|
_item_queue(GL_IT(it)->wsd, it, NULL);
|
|
|
|
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_MOVED_BEFORE, it);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_mouse_up_cb(void *data,
|
|
|
|
Evas *evas __UNUSED__,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Up *ev = event_info;
|
|
|
|
Eina_Bool dragged = EINA_FALSE;
|
|
|
|
Elm_Genlist_Smart_Data *sd;
|
|
|
|
Elm_Gen_Item *it = data;
|
|
|
|
|
|
|
|
if (ev->button != 1) return;
|
|
|
|
it->down = EINA_FALSE;
|
|
|
|
sd = GL_IT(it)->wsd;
|
|
|
|
|
|
|
|
sd->mouse_down = EINA_FALSE;
|
|
|
|
if (sd->multi_touched)
|
|
|
|
{
|
|
|
|
if ((!sd->multi) && (!it->selected) && (it->highlighted))
|
|
|
|
_item_unhighlight(it);
|
|
|
|
if (sd->multi_down) return;
|
|
|
|
_multi_touch_gesture_eval(data);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
|
|
|
|
sd->on_hold = EINA_TRUE;
|
|
|
|
else sd->on_hold = EINA_FALSE;
|
|
|
|
if (it->long_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
|
|
|
}
|
|
|
|
if (it->dragging)
|
|
|
|
{
|
|
|
|
it->dragging = EINA_FALSE;
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_DRAG_STOP, it);
|
|
|
|
dragged = 1;
|
|
|
|
}
|
|
|
|
if (it->item->swipe_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->item->swipe_timer);
|
|
|
|
it->item->swipe_timer = NULL;
|
|
|
|
}
|
|
|
|
if (sd->multi_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(sd->multi_timer);
|
|
|
|
sd->multi_timer = NULL;
|
|
|
|
sd->multi_timeout = EINA_FALSE;
|
|
|
|
}
|
|
|
|
if (sd->on_hold)
|
|
|
|
{
|
|
|
|
if (sd->swipe) _swipe_do(data);
|
|
|
|
sd->longpressed = EINA_FALSE;
|
|
|
|
sd->on_hold = EINA_FALSE;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if ((sd->reorder_mode) && (sd->reorder_it))
|
|
|
|
{
|
|
|
|
Evas_Coord it_scrl_y = ev->canvas.y - sd->reorder_it->dy;
|
|
|
|
|
|
|
|
if (sd->reorder_rel &&
|
|
|
|
(sd->reorder_it->parent == sd->reorder_rel->parent))
|
|
|
|
{
|
|
|
|
if (it_scrl_y <= sd->reorder_rel->item->scrl_y)
|
|
|
|
_item_move_before(sd->reorder_it, sd->reorder_rel);
|
|
|
|
else
|
|
|
|
_item_move_after(sd->reorder_it, sd->reorder_rel);
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_MOVED, it);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (sd->calc_job) ecore_job_del(sd->calc_job);
|
|
|
|
sd->calc_job = ecore_job_add(_calc_job, sd);
|
|
|
|
}
|
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,reorder,disabled", "elm");
|
|
|
|
sd->reorder_it = sd->reorder_rel = NULL;
|
|
|
|
sd->s_iface->hold_set(ELM_WIDGET_DATA(sd)->obj, EINA_FALSE);
|
|
|
|
sd->s_iface->bounce_allow_set
|
|
|
|
(ELM_WIDGET_DATA(sd)->obj, sd->h_bounce, sd->v_bounce);
|
|
|
|
}
|
|
|
|
if (sd->longpressed)
|
|
|
|
{
|
|
|
|
sd->longpressed = EINA_FALSE;
|
|
|
|
if ((!sd->wasselected) && (!it->flipped))
|
|
|
|
{
|
|
|
|
_item_unhighlight(it);
|
|
|
|
_item_unselect(it);
|
|
|
|
}
|
|
|
|
sd->wasselected = EINA_FALSE;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (dragged)
|
|
|
|
{
|
|
|
|
if (it->want_unrealize)
|
|
|
|
{
|
|
|
|
_elm_genlist_item_unrealize(it, EINA_FALSE);
|
|
|
|
if (it->item->block->want_unrealize)
|
|
|
|
_item_block_unrealize(it->item->block);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (elm_widget_item_disabled_get(it) || (dragged) ||
|
|
|
|
(it->select_mode == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
|
|
|
|
if (sd->multi)
|
|
|
|
{
|
|
|
|
if (!it->selected)
|
|
|
|
{
|
|
|
|
_item_highlight(it);
|
|
|
|
it->sel_cb(it);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_item_unhighlight(it);
|
|
|
|
_item_unselect(it);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!it->selected)
|
|
|
|
{
|
|
|
|
while (sd->selected)
|
|
|
|
{
|
|
|
|
_item_unhighlight(sd->selected->data);
|
|
|
|
_item_unselect(sd->selected->data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const Eina_List *l, *l_next;
|
|
|
|
Elm_Gen_Item *it2;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH_SAFE (sd->selected, l, l_next, it2)
|
|
|
|
if (it2 != it)
|
|
|
|
{
|
|
|
|
_item_unhighlight(it2);
|
|
|
|
_item_unselect(it2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_item_highlight(it);
|
|
|
|
it->sel_cb(it);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_mouse_callbacks_add(Elm_Gen_Item *it,
|
|
|
|
Evas_Object *view)
|
|
|
|
{
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(view, EVAS_CALLBACK_MOUSE_DOWN, _item_mouse_down_cb, it);
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(view, EVAS_CALLBACK_MOUSE_UP, _item_mouse_up_cb, it);
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(view, EVAS_CALLBACK_MOUSE_MOVE, _item_mouse_move_cb, it);
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(view, EVAS_CALLBACK_MULTI_DOWN, _item_multi_down_cb, it);
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(view, EVAS_CALLBACK_MULTI_UP, _item_multi_up_cb, it);
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(view, EVAS_CALLBACK_MULTI_MOVE, _item_multi_move_cb, it);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_mouse_callbacks_del(Elm_Gen_Item *it,
|
|
|
|
Evas_Object *view)
|
|
|
|
{
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(view, EVAS_CALLBACK_MOUSE_DOWN, _item_mouse_down_cb, it);
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(view, EVAS_CALLBACK_MOUSE_UP, _item_mouse_up_cb, it);
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(view, EVAS_CALLBACK_MOUSE_MOVE, _item_mouse_move_cb, it);
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(view, EVAS_CALLBACK_MULTI_DOWN, _item_multi_down_cb, it);
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(view, EVAS_CALLBACK_MULTI_UP, _item_multi_up_cb, it);
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(view, EVAS_CALLBACK_MULTI_MOVE, _item_multi_move_cb, it);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_scroll_hold_timer_cb(void *data)
|
|
|
|
{
|
|
|
|
Elm_Genlist_Smart_Data *sd = data;
|
|
|
|
|
|
|
|
if (!data) return ECORE_CALLBACK_CANCEL;
|
|
|
|
|
|
|
|
sd->s_iface->hold_set(ELM_WIDGET_DATA(sd)->obj, EINA_FALSE);
|
|
|
|
sd->scr_hold_timer = NULL;
|
|
|
|
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_decorate_item_unrealize(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
Elm_Genlist_Smart_Data *sd = GL_IT(it)->wsd;
|
|
|
|
Evas_Object *content, *obj = ELM_WIDGET_DATA(sd)->obj;
|
|
|
|
|
|
|
|
if (!it->item->deco_it_view) return;
|
|
|
|
|
|
|
|
evas_event_freeze(evas_object_evas_get(obj));
|
|
|
|
elm_widget_stringlist_free(it->item->deco_it_texts);
|
|
|
|
it->item->deco_it_texts = NULL;
|
|
|
|
elm_widget_stringlist_free(it->item->deco_it_contents);
|
|
|
|
it->item->deco_it_contents = NULL;
|
|
|
|
elm_widget_stringlist_free(it->item->deco_it_states);
|
|
|
|
|
|
|
|
EINA_LIST_FREE (it->item->deco_it_content_objs, content)
|
|
|
|
evas_object_del(content);
|
|
|
|
|
|
|
|
edje_object_part_unswallow(it->item->deco_it_view, VIEW(it));
|
|
|
|
evas_object_smart_member_add(VIEW(it), sd->pan_obj);
|
|
|
|
evas_object_del(it->item->deco_it_view);
|
|
|
|
it->item->deco_it_view = NULL;
|
|
|
|
|
|
|
|
if (sd->mode_item == it)
|
|
|
|
sd->mode_item = NULL;
|
|
|
|
evas_event_thaw(evas_object_evas_get(obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(obj));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_decorate_item_finished_signal_cb(void *data,
|
|
|
|
Evas_Object *obj,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it = data;
|
|
|
|
char buf[1024];
|
|
|
|
Evas *te;
|
|
|
|
|
|
|
|
if (!data || !obj) return;
|
|
|
|
|
|
|
|
te = evas_object_evas_get(obj);
|
|
|
|
|
|
|
|
if ((it->generation < GL_IT(it)->wsd->generation) || (!it->realized)
|
|
|
|
|| (!it->item->deco_it_view)) return;
|
|
|
|
|
|
|
|
evas_event_freeze(te);
|
|
|
|
it->item->nocache_once = EINA_FALSE;
|
|
|
|
_decorate_item_unrealize(it);
|
|
|
|
if (it->item->group_item)
|
|
|
|
evas_object_raise(it->item->VIEW(group_item));
|
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "elm,state,%s,passive,finished",
|
|
|
|
GL_IT(it)->wsd->decorate_it_type);
|
|
|
|
edje_object_signal_callback_del_full
|
|
|
|
(obj, buf, "elm", _decorate_item_finished_signal_cb, it);
|
|
|
|
evas_event_thaw(te);
|
|
|
|
evas_event_thaw_eval(te);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_cache_add(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
Item_Cache *itc;
|
|
|
|
Evas_Object *obj = ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj;
|
|
|
|
|
|
|
|
evas_event_freeze(evas_object_evas_get(obj));
|
|
|
|
if (GL_IT(it)->wsd->item_cache_max <= 0)
|
|
|
|
{
|
|
|
|
evas_object_del(VIEW(it));
|
|
|
|
VIEW(it) = NULL;
|
|
|
|
if (it->spacer)
|
2012-02-13 00:50:18 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_object_del(it->spacer);
|
|
|
|
it->spacer = NULL;
|
2012-02-13 00:50:18 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(obj));
|
|
|
|
|
|
|
|
return;
|
2011-03-22 00:54:24 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
|
|
|
|
GL_IT(it)->wsd->item_cache_count++;
|
|
|
|
itc = calloc(1, sizeof(Item_Cache));
|
|
|
|
if (!itc)
|
|
|
|
{
|
|
|
|
evas_event_thaw(evas_object_evas_get(obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(obj));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
GL_IT(it)->wsd->item_cache =
|
|
|
|
eina_inlist_prepend(GL_IT(it)->wsd->item_cache, EINA_INLIST_GET(itc));
|
|
|
|
itc->spacer = it->spacer;
|
|
|
|
it->spacer = NULL;
|
|
|
|
itc->base_view = VIEW(it);
|
|
|
|
|
|
|
|
VIEW(it) = NULL;
|
|
|
|
edje_object_signal_emit(itc->base_view, "elm,state,unselected", "elm");
|
|
|
|
evas_object_hide(itc->base_view);
|
|
|
|
evas_object_move(itc->base_view, -9999, -9999);
|
|
|
|
itc->item_style = eina_stringshare_add(it->itc->item_style);
|
|
|
|
if (it->item->type & ELM_GENLIST_ITEM_TREE) itc->tree = 1;
|
|
|
|
itc->selected = it->selected;
|
|
|
|
itc->disabled = elm_widget_item_disabled_get(it);
|
|
|
|
itc->expanded = it->item->expanded;
|
|
|
|
if (it->long_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
|
|
|
}
|
|
|
|
if (it->item->swipe_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->item->swipe_timer);
|
|
|
|
it->item->swipe_timer = NULL;
|
|
|
|
}
|
|
|
|
// FIXME: other callbacks?
|
|
|
|
edje_object_signal_callback_del_full
|
|
|
|
(itc->base_view, "elm,action,expand,toggle", "elm",
|
|
|
|
_expand_toggle_signal_cb, it);
|
|
|
|
edje_object_signal_callback_del_full
|
|
|
|
(itc->base_view, "elm,action,expand", "elm", _expand_signal_cb, it);
|
|
|
|
edje_object_signal_callback_del_full
|
|
|
|
(itc->base_view, "elm,action,contract", "elm", _contract_signal_cb, it);
|
|
|
|
_item_mouse_callbacks_del(it, itc->base_view);
|
|
|
|
_item_cache_clean(GL_IT(it)->wsd);
|
|
|
|
|
|
|
|
evas_event_thaw(evas_object_evas_get(obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(obj));
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_List *
|
|
|
|
_item_mode_content_unrealize(Elm_Gen_Item *it,
|
|
|
|
Evas_Object *target,
|
|
|
|
Eina_List **source,
|
|
|
|
const char *parts,
|
|
|
|
Eina_List **contents_list)
|
|
|
|
{
|
|
|
|
Eina_List *res = *contents_list;
|
|
|
|
|
|
|
|
if (it->itc->func.content_get)
|
2009-02-17 20:18:25 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
const Eina_List *l;
|
|
|
|
const char *key;
|
|
|
|
Evas_Object *ic = NULL;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH (*source, l, key)
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (parts && fnmatch(parts, key, FNM_PERIOD))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
ic = edje_object_part_swallow_get(target, key);
|
|
|
|
if (ic)
|
|
|
|
{
|
|
|
|
res = eina_list_remove(res, ic);
|
|
|
|
edje_object_part_unswallow(target, ic);
|
|
|
|
evas_object_del(ic);
|
|
|
|
}
|
2011-03-22 00:54:24 -07:00
|
|
|
}
|
2009-02-17 20:18:25 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_List *
|
|
|
|
_item_content_unrealize(Elm_Gen_Item *it,
|
|
|
|
Evas_Object *target,
|
|
|
|
Eina_List **source,
|
|
|
|
const char *parts)
|
|
|
|
{
|
|
|
|
Eina_List *res = it->content_objs;
|
|
|
|
|
|
|
|
if (it->itc->func.content_get)
|
2009-02-17 20:18:25 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
const Eina_List *l;
|
|
|
|
const char *key;
|
|
|
|
Evas_Object *ic = NULL;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH (*source, l, key)
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (parts && fnmatch(parts, key, FNM_PERIOD))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
ic = edje_object_part_swallow_get(target, key);
|
|
|
|
if (ic)
|
|
|
|
{
|
|
|
|
res = eina_list_remove(res, ic);
|
|
|
|
edje_object_part_unswallow(target, ic);
|
|
|
|
evas_object_del(ic);
|
|
|
|
}
|
2011-03-22 00:54:24 -07:00
|
|
|
}
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_unrealize_cb(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
Evas_Object *content;
|
|
|
|
elm_widget_stringlist_free(it->item->flip_contents);
|
|
|
|
it->item->flip_contents = NULL;
|
|
|
|
EINA_LIST_FREE (it->item->flip_content_objs, content)
|
|
|
|
evas_object_del(content);
|
|
|
|
|
|
|
|
if (it->item->nocache_once || it->item->nocache)
|
2009-02-11 03:49:43 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_object_del(VIEW(it));
|
|
|
|
VIEW(it) = NULL;
|
|
|
|
if (it->spacer)
|
2010-11-20 00:43:43 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_object_del(it->spacer);
|
|
|
|
it->spacer = NULL;
|
2010-11-20 00:43:43 -08:00
|
|
|
}
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
else
|
2010-12-07 11:18:14 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
edje_object_mirrored_set(VIEW(it),
|
|
|
|
elm_widget_mirrored_get(WIDGET(it)));
|
|
|
|
edje_object_scale_set(VIEW(it),
|
|
|
|
elm_widget_scale_get(WIDGET(it))
|
|
|
|
* elm_config_scale_get());
|
|
|
|
_item_cache_add(it);
|
2010-12-07 11:18:14 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
|
|
|
|
_decorate_item_unrealize(it);
|
|
|
|
it->states = NULL;
|
|
|
|
it->realized = EINA_FALSE;
|
|
|
|
it->want_unrealize = EINA_FALSE;
|
|
|
|
if (GL_IT(it)->wsd->decorate_all_mode) _decorate_all_item_unrealize(it);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_item_block_recalc(Item_Block *itb,
|
|
|
|
int in,
|
|
|
|
Eina_Bool qadd)
|
|
|
|
{
|
|
|
|
const Eina_List *l;
|
|
|
|
Elm_Gen_Item *it;
|
|
|
|
Evas_Coord minw = 0, minh = 0;
|
|
|
|
Eina_Bool show_me = EINA_FALSE, changed = EINA_FALSE;
|
|
|
|
Evas_Coord y = 0;
|
|
|
|
|
|
|
|
itb->num = in;
|
|
|
|
EINA_LIST_FOREACH (itb->items, l, it)
|
2011-12-23 20:20:18 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->generation < GL_IT(it)->wsd->generation) continue;
|
|
|
|
show_me |= it->item->show_me;
|
|
|
|
if (!itb->realized)
|
2011-12-23 20:20:18 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (qadd)
|
|
|
|
{
|
|
|
|
if (!it->item->mincalcd) changed = EINA_TRUE;
|
|
|
|
if (changed)
|
|
|
|
{
|
|
|
|
_item_realize(it, in, EINA_TRUE);
|
|
|
|
_elm_genlist_item_unrealize(it, EINA_TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2012-03-14 21:03:10 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((itb->sd->homogeneous) &&
|
|
|
|
(itb->sd->mode == ELM_LIST_COMPRESS))
|
|
|
|
{
|
|
|
|
if (it->group)
|
|
|
|
{
|
|
|
|
it->item->w = it->item->minw =
|
|
|
|
GL_IT(it)->wsd->group_item_width;
|
|
|
|
it->item->h = it->item->minh =
|
|
|
|
GL_IT(it)->wsd->group_item_height;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
it->item->w = it->item->minw =
|
|
|
|
GL_IT(it)->wsd->item_width;
|
|
|
|
it->item->h = it->item->minh =
|
|
|
|
GL_IT(it)->wsd->item_height;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_item_realize(it, in, EINA_TRUE);
|
|
|
|
_elm_genlist_item_unrealize(it, EINA_TRUE);
|
|
|
|
}
|
2012-03-14 21:03:10 -07:00
|
|
|
}
|
2011-12-23 20:20:18 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!it->item->mincalcd) changed = EINA_TRUE;
|
|
|
|
_item_realize(it, in, EINA_FALSE);
|
|
|
|
}
|
|
|
|
minh += it->item->minh;
|
|
|
|
if (minw < it->item->minw) minw = it->item->minw;
|
|
|
|
in++;
|
|
|
|
it->x = 0;
|
|
|
|
it->y = y;
|
|
|
|
y += it->item->h;
|
2011-12-23 20:20:18 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
if (changed) itb->sd->pan_changed = changed;
|
|
|
|
itb->minw = minw;
|
|
|
|
itb->minh = minh;
|
|
|
|
itb->changed = EINA_FALSE;
|
|
|
|
itb->position_update = EINA_FALSE;
|
|
|
|
|
|
|
|
return show_me;
|
2009-02-12 05:39:43 -08:00
|
|
|
}
|
|
|
|
|
2009-09-13 19:53:03 -07:00
|
|
|
static void
|
|
|
|
_update_job(void *data)
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Eina_Bool position = EINA_FALSE, recalc = EINA_FALSE;
|
|
|
|
Elm_Genlist_Smart_Data *sd = data;
|
2009-09-13 19:53:03 -07:00
|
|
|
Item_Block *itb;
|
2012-07-16 14:56:30 -07:00
|
|
|
Eina_List *l2;
|
2011-06-03 18:52:08 -07:00
|
|
|
int num, num0;
|
2012-07-16 14:56:30 -07:00
|
|
|
|
|
|
|
sd->update_job = NULL;
|
2009-09-13 19:53:03 -07:00
|
|
|
num = 0;
|
2011-05-29 19:31:21 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
|
|
|
EINA_INLIST_FOREACH (sd->blocks, itb)
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
|
|
|
Evas_Coord itminw, itminh;
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it;
|
2011-03-22 00:54:24 -07:00
|
|
|
|
|
|
|
if (!itb->updateme)
|
|
|
|
{
|
|
|
|
num += itb->count;
|
|
|
|
if (position)
|
|
|
|
_item_block_position(itb, num);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
num0 = num;
|
2011-06-03 18:52:08 -07:00
|
|
|
recalc = EINA_FALSE;
|
2012-07-16 14:56:30 -07:00
|
|
|
EINA_LIST_FOREACH (itb->items, l2, it)
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->updateme)
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
itminw = it->item->minw;
|
|
|
|
itminh = it->item->minh;
|
2011-03-22 00:54:24 -07:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->updateme = EINA_FALSE;
|
2011-03-22 00:54:24 -07:00
|
|
|
if (it->realized)
|
|
|
|
{
|
2011-11-30 09:31:01 -08:00
|
|
|
_elm_genlist_item_unrealize(it, EINA_FALSE);
|
2011-03-22 00:54:24 -07:00
|
|
|
_item_realize(it, num, EINA_FALSE);
|
2011-06-03 18:52:08 -07:00
|
|
|
position = EINA_TRUE;
|
2011-03-22 00:54:24 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_item_realize(it, num, EINA_TRUE);
|
2011-11-30 09:31:01 -08:00
|
|
|
_elm_genlist_item_unrealize(it, EINA_TRUE);
|
2011-03-22 00:54:24 -07:00
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
if ((it->item->minw != itminw) || (it->item->minh != itminh))
|
2011-06-03 18:52:08 -07:00
|
|
|
recalc = EINA_TRUE;
|
2011-03-22 00:54:24 -07:00
|
|
|
}
|
|
|
|
num++;
|
|
|
|
}
|
|
|
|
itb->updateme = EINA_FALSE;
|
|
|
|
if (recalc)
|
|
|
|
{
|
2011-06-03 18:52:08 -07:00
|
|
|
position = EINA_TRUE;
|
2011-03-22 00:54:24 -07:00
|
|
|
itb->changed = EINA_TRUE;
|
2011-06-08 03:58:00 -07:00
|
|
|
_item_block_recalc(itb, num0, EINA_FALSE);
|
2011-03-22 00:54:24 -07:00
|
|
|
_item_block_position(itb, num0);
|
|
|
|
}
|
|
|
|
}
|
2009-09-13 19:53:03 -07:00
|
|
|
if (position)
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->calc_job) ecore_job_del(sd->calc_job);
|
|
|
|
sd->calc_job = ecore_job_add(_calc_job, sd);
|
2011-06-01 20:10:11 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
2009-09-07 23:20:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_scroll_animate_start_cb(Evas_Object *obj,
|
|
|
|
void *data __UNUSED__)
|
2009-09-07 23:20:32 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_object_smart_callback_call(obj, SIG_SCROLL_ANIM_START, NULL);
|
2009-09-07 23:20:32 -07:00
|
|
|
}
|
|
|
|
|
elm genlist: Added "scroll,anim,start", "scroll,anim,stop",
"scroll,drag,start", "scroll,drag,stop" smart callbacks to genlist.
elm gengrid: Added "scroll,anim,start", "scroll,anim,stop" smart
callbacks to genlist.
SVN revision: 62710
2011-08-22 21:02:26 -07:00
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_scroll_animate_stop_cb(Evas_Object *obj,
|
|
|
|
void *data __UNUSED__)
|
elm genlist: Added "scroll,anim,start", "scroll,anim,stop",
"scroll,drag,start", "scroll,drag,stop" smart callbacks to genlist.
elm gengrid: Added "scroll,anim,start", "scroll,anim,stop" smart
callbacks to genlist.
SVN revision: 62710
2011-08-22 21:02:26 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_object_smart_callback_call(obj, SIG_SCROLL_ANIM_STOP, NULL);
|
elm genlist: Added "scroll,anim,start", "scroll,anim,stop",
"scroll,drag,start", "scroll,drag,stop" smart callbacks to genlist.
elm gengrid: Added "scroll,anim,start", "scroll,anim,stop" smart
callbacks to genlist.
SVN revision: 62710
2011-08-22 21:02:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_scroll_drag_start_cb(Evas_Object *obj,
|
|
|
|
void *data __UNUSED__)
|
elm genlist: Added "scroll,anim,start", "scroll,anim,stop",
"scroll,drag,start", "scroll,drag,stop" smart callbacks to genlist.
elm gengrid: Added "scroll,anim,start", "scroll,anim,stop" smart
callbacks to genlist.
SVN revision: 62710
2011-08-22 21:02:26 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_object_smart_callback_call(obj, SIG_SCROLL_DRAG_START, NULL);
|
elm genlist: Added "scroll,anim,start", "scroll,anim,stop",
"scroll,drag,start", "scroll,drag,stop" smart callbacks to genlist.
elm gengrid: Added "scroll,anim,start", "scroll,anim,stop" smart
callbacks to genlist.
SVN revision: 62710
2011-08-22 21:02:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_scroll_drag_stop_cb(Evas_Object *obj,
|
|
|
|
void *data __UNUSED__)
|
elm genlist: Added "scroll,anim,start", "scroll,anim,stop",
"scroll,drag,start", "scroll,drag,stop" smart callbacks to genlist.
elm gengrid: Added "scroll,anim,start", "scroll,anim,stop" smart
callbacks to genlist.
SVN revision: 62710
2011-08-22 21:02:26 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_object_smart_callback_call(obj, SIG_SCROLL_DRAG_STOP, NULL);
|
elm genlist: Added "scroll,anim,start", "scroll,anim,stop",
"scroll,drag,start", "scroll,drag,stop" smart callbacks to genlist.
elm gengrid: Added "scroll,anim,start", "scroll,anim,stop" smart
callbacks to genlist.
SVN revision: 62710
2011-08-22 21:02:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_edge_left_cb(Evas_Object *obj,
|
|
|
|
void *data __UNUSED__)
|
elm genlist: Added "scroll,anim,start", "scroll,anim,stop",
"scroll,drag,start", "scroll,drag,stop" smart callbacks to genlist.
elm gengrid: Added "scroll,anim,start", "scroll,anim,stop" smart
callbacks to genlist.
SVN revision: 62710
2011-08-22 21:02:26 -07:00
|
|
|
{
|
2011-10-20 09:42:42 -07:00
|
|
|
evas_object_smart_callback_call(obj, SIG_EDGE_LEFT, NULL);
|
This small patch allows to get a smart callback when the scrollers in an
elm_list or in an elm_genlist fire the edge,{top,bottom,left,right}
signals, backporting them to the list object.
The new smart callbacks called are:
· "scroll,edge,top" - the list is scrolled until the top edge
· "scroll,edge,bottom" - the list is scrolled until the bottom edge
· "scroll,edge,left" - the list is scrolled until the left edge
· "scroll,edge,right" - the list is scrolled until the right edge
SVN revision: 3
SVN revision: 54393
2010-11-09 18:48:59 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_edge_right_cb(Evas_Object *obj,
|
|
|
|
void *data __UNUSED__)
|
This small patch allows to get a smart callback when the scrollers in an
elm_list or in an elm_genlist fire the edge,{top,bottom,left,right}
signals, backporting them to the list object.
The new smart callbacks called are:
· "scroll,edge,top" - the list is scrolled until the top edge
· "scroll,edge,bottom" - the list is scrolled until the bottom edge
· "scroll,edge,left" - the list is scrolled until the left edge
· "scroll,edge,right" - the list is scrolled until the right edge
SVN revision: 3
SVN revision: 54393
2010-11-09 18:48:59 -08:00
|
|
|
{
|
2011-10-20 09:42:42 -07:00
|
|
|
evas_object_smart_callback_call(obj, SIG_EDGE_RIGHT, NULL);
|
This small patch allows to get a smart callback when the scrollers in an
elm_list or in an elm_genlist fire the edge,{top,bottom,left,right}
signals, backporting them to the list object.
The new smart callbacks called are:
· "scroll,edge,top" - the list is scrolled until the top edge
· "scroll,edge,bottom" - the list is scrolled until the bottom edge
· "scroll,edge,left" - the list is scrolled until the left edge
· "scroll,edge,right" - the list is scrolled until the right edge
SVN revision: 3
SVN revision: 54393
2010-11-09 18:48:59 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_edge_top_cb(Evas_Object *obj,
|
|
|
|
void *data __UNUSED__)
|
This small patch allows to get a smart callback when the scrollers in an
elm_list or in an elm_genlist fire the edge,{top,bottom,left,right}
signals, backporting them to the list object.
The new smart callbacks called are:
· "scroll,edge,top" - the list is scrolled until the top edge
· "scroll,edge,bottom" - the list is scrolled until the bottom edge
· "scroll,edge,left" - the list is scrolled until the left edge
· "scroll,edge,right" - the list is scrolled until the right edge
SVN revision: 3
SVN revision: 54393
2010-11-09 18:48:59 -08:00
|
|
|
{
|
2011-10-20 09:42:42 -07:00
|
|
|
evas_object_smart_callback_call(obj, SIG_EDGE_TOP, NULL);
|
This small patch allows to get a smart callback when the scrollers in an
elm_list or in an elm_genlist fire the edge,{top,bottom,left,right}
signals, backporting them to the list object.
The new smart callbacks called are:
· "scroll,edge,top" - the list is scrolled until the top edge
· "scroll,edge,bottom" - the list is scrolled until the bottom edge
· "scroll,edge,left" - the list is scrolled until the left edge
· "scroll,edge,right" - the list is scrolled until the right edge
SVN revision: 3
SVN revision: 54393
2010-11-09 18:48:59 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_edge_bottom_cb(Evas_Object *obj,
|
|
|
|
void *data __UNUSED__)
|
This small patch allows to get a smart callback when the scrollers in an
elm_list or in an elm_genlist fire the edge,{top,bottom,left,right}
signals, backporting them to the list object.
The new smart callbacks called are:
· "scroll,edge,top" - the list is scrolled until the top edge
· "scroll,edge,bottom" - the list is scrolled until the bottom edge
· "scroll,edge,left" - the list is scrolled until the left edge
· "scroll,edge,right" - the list is scrolled until the right edge
SVN revision: 3
SVN revision: 54393
2010-11-09 18:48:59 -08:00
|
|
|
{
|
2011-10-20 09:42:42 -07:00
|
|
|
evas_object_smart_callback_call(obj, SIG_EDGE_BOTTOM, NULL);
|
This small patch allows to get a smart callback when the scrollers in an
elm_list or in an elm_genlist fire the edge,{top,bottom,left,right}
signals, backporting them to the list object.
The new smart callbacks called are:
· "scroll,edge,top" - the list is scrolled until the top edge
· "scroll,edge,bottom" - the list is scrolled until the bottom edge
· "scroll,edge,left" - the list is scrolled until the left edge
· "scroll,edge,right" - the list is scrolled until the right edge
SVN revision: 3
SVN revision: 54393
2010-11-09 18:48:59 -08:00
|
|
|
}
|
|
|
|
|
2011-04-21 04:47:36 -07:00
|
|
|
static void
|
2012-04-03 02:56:53 -07:00
|
|
|
_decorate_item_realize(Elm_Gen_Item *it)
|
2011-04-21 04:47:36 -07:00
|
|
|
{
|
|
|
|
char buf[1024];
|
2012-07-16 14:56:30 -07:00
|
|
|
Evas_Object *obj = ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj;
|
2011-04-21 04:47:36 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((it->item->deco_it_view) || (it->generation <
|
|
|
|
GL_IT(it)->wsd->generation)) return;
|
2011-10-21 01:52:03 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(obj));
|
2012-04-03 02:56:44 -07:00
|
|
|
it->item->deco_it_view = edje_object_add(evas_object_evas_get(WIDGET(it)));
|
2012-07-16 14:56:30 -07:00
|
|
|
edje_object_scale_set
|
|
|
|
(it->item->deco_it_view, elm_widget_scale_get(WIDGET(it)) *
|
|
|
|
elm_config_scale_get());
|
|
|
|
evas_object_smart_member_add
|
|
|
|
(it->item->deco_it_view, GL_IT(it)->wsd->pan_obj);
|
2012-04-03 02:56:44 -07:00
|
|
|
elm_widget_sub_object_add(WIDGET(it), it->item->deco_it_view);
|
2011-10-21 01:52:03 -07:00
|
|
|
|
2011-10-20 20:31:26 -07:00
|
|
|
strncpy(buf, "item", sizeof(buf));
|
2012-07-16 14:56:30 -07:00
|
|
|
if (GL_IT(it)->wsd->mode == ELM_LIST_COMPRESS)
|
2011-10-20 20:31:26 -07:00
|
|
|
strncat(buf, "_compress", sizeof(buf) - strlen(buf));
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->item->order_num_in & 0x1)
|
|
|
|
strncat(buf, "_odd", sizeof(buf) - strlen(buf));
|
2011-10-20 20:31:26 -07:00
|
|
|
strncat(buf, "/", sizeof(buf) - strlen(buf));
|
2012-03-09 04:00:11 -08:00
|
|
|
strncat(buf, it->itc->decorate_item_style, sizeof(buf) - strlen(buf));
|
2011-10-20 20:31:26 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_widget_theme_object_set
|
|
|
|
(WIDGET(it), it->item->deco_it_view, "genlist", buf,
|
|
|
|
elm_widget_style_get(WIDGET(it)));
|
|
|
|
edje_object_mirrored_set
|
|
|
|
(it->item->deco_it_view, elm_widget_mirrored_get(WIDGET(it)));
|
2011-04-21 04:47:36 -07:00
|
|
|
|
|
|
|
/* signal callback add */
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_object_event_callback_add
|
|
|
|
(it->item->deco_it_view, EVAS_CALLBACK_MOUSE_DOWN, _item_mouse_down_cb,
|
|
|
|
it);
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(it->item->deco_it_view, EVAS_CALLBACK_MOUSE_UP, _item_mouse_up_cb, it);
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(it->item->deco_it_view, EVAS_CALLBACK_MOUSE_MOVE, _item_mouse_move_cb,
|
|
|
|
it);
|
|
|
|
|
|
|
|
if (eina_list_count(it->item->deco_it_content_objs) != 0)
|
|
|
|
ERR_ABORT("If you see this error, please notify us and we"
|
|
|
|
"will fix it");
|
2011-04-21 04:47:36 -07:00
|
|
|
|
2012-05-23 21:59:52 -07:00
|
|
|
/* text_get, content_get, state_get */
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_text_realize
|
|
|
|
(it, it->item->deco_it_view, &it->item->deco_it_texts, NULL);
|
2012-04-06 00:10:29 -07:00
|
|
|
if (!it->item->deco_it_contents)
|
|
|
|
it->item->deco_it_contents =
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_widget_stringlist_get
|
|
|
|
(edje_object_data_get(it->item->deco_it_view, "contents"));
|
2012-04-01 19:37:05 -07:00
|
|
|
it->item->deco_it_content_objs =
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_mode_content_realize
|
|
|
|
(it, it->item->deco_it_view, &it->item->deco_it_contents, NULL,
|
|
|
|
&it->item->deco_it_content_objs);
|
|
|
|
_item_state_realize
|
|
|
|
(it, it->item->deco_it_view, &it->item->deco_it_states, NULL);
|
|
|
|
edje_object_part_swallow
|
|
|
|
(it->item->deco_it_view,
|
|
|
|
edje_object_data_get(it->item->deco_it_view, "mode_part"), VIEW(it));
|
2011-04-21 04:47:36 -07:00
|
|
|
|
2012-02-22 23:39:10 -08:00
|
|
|
it->want_unrealize = EINA_FALSE;
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(obj));
|
2012-02-22 23:39:10 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_decorate_item_set(Elm_Gen_Item *it)
|
2012-02-22 23:39:10 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Genlist_Smart_Data *sd;
|
|
|
|
char buf[1024];
|
2012-02-22 23:39:10 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!it) return;
|
2012-02-22 23:39:10 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
sd = GL_IT(it)->wsd;
|
2012-02-22 23:39:10 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->mode_item = it;
|
|
|
|
it->item->nocache_once = EINA_TRUE;
|
2011-06-14 02:18:54 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->scr_hold_timer)
|
2011-06-14 02:18:54 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ecore_timer_del(sd->scr_hold_timer);
|
|
|
|
sd->scr_hold_timer = NULL;
|
2011-06-14 02:18:54 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->s_iface->hold_set(ELM_WIDGET_DATA(sd)->obj, EINA_TRUE);
|
|
|
|
sd->scr_hold_timer = ecore_timer_add(0.1, _scroll_hold_timer_cb, sd);
|
|
|
|
|
|
|
|
evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
|
|
|
_decorate_item_realize(it);
|
|
|
|
if (it->item->group_item)
|
|
|
|
evas_object_raise(it->item->VIEW(group_item));
|
|
|
|
_item_position
|
|
|
|
(it, it->item->deco_it_view, it->item->scrl_x, it->item->scrl_y);
|
|
|
|
evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "elm,state,%s,active", sd->decorate_it_type);
|
|
|
|
edje_object_signal_emit(it->item->deco_it_view, buf, "elm");
|
2011-06-14 02:18:54 -07:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_decorate_item_unset(Elm_Genlist_Smart_Data *sd)
|
2009-02-09 03:23:59 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
char buf[1024], buf2[1024];
|
|
|
|
Elm_Gen_Item *it;
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!sd->mode_item) return;
|
2011-05-06 17:30:39 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
it = sd->mode_item;
|
|
|
|
it->item->nocache_once = EINA_TRUE;
|
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "elm,state,%s,passive", sd->decorate_it_type);
|
|
|
|
snprintf(buf2, sizeof(buf2), "elm,state,%s,passive,finished",
|
|
|
|
sd->decorate_it_type);
|
|
|
|
edje_object_signal_emit(it->item->deco_it_view, buf, "elm");
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(it->item->deco_it_view, buf2, "elm", _decorate_item_finished_signal_cb,
|
|
|
|
it);
|
|
|
|
sd->mode_item = NULL;
|
2009-02-09 03:23:59 -08:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_elm_genlist_smart_add(Evas_Object *obj)
|
2011-11-30 09:13:57 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
EVAS_SMART_DATA_ALLOC(obj, Elm_Genlist_Smart_Data);
|
2012-03-30 00:28:04 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_WIDGET_CLASS(_elm_genlist_parent_sc)->base.add(obj);
|
2011-11-30 09:13:57 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
priv->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj));
|
|
|
|
evas_object_smart_member_add(priv->hit_rect, obj);
|
|
|
|
elm_widget_sub_object_add(obj, priv->hit_rect);
|
|
|
|
|
|
|
|
/* common scroller hit rectangle setup -- it has to take place
|
|
|
|
* AFTER smart_member_add() */
|
|
|
|
evas_object_color_set(priv->hit_rect, 0, 0, 0, 0);
|
|
|
|
evas_object_show(priv->hit_rect);
|
|
|
|
evas_object_repeat_events_set(priv->hit_rect, EINA_TRUE);
|
2011-11-30 09:13:57 -08:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_elm_genlist_smart_del(Evas_Object *obj)
|
2011-11-30 09:13:57 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if (sd->decorate_all_mode)
|
|
|
|
elm_genlist_decorate_mode_set(ELM_WIDGET_DATA(sd)->obj, EINA_FALSE);
|
|
|
|
elm_genlist_clear(obj);
|
|
|
|
evas_object_del(sd->pan_obj);
|
|
|
|
sd->pan_obj = NULL;
|
|
|
|
|
|
|
|
_item_cache_zero(sd);
|
|
|
|
if (sd->calc_job) ecore_job_del(sd->calc_job);
|
|
|
|
if (sd->update_job) ecore_job_del(sd->update_job);
|
|
|
|
if (sd->queue_idle_enterer) ecore_idle_enterer_del(sd->queue_idle_enterer);
|
|
|
|
if (sd->must_recalc_idler) ecore_idler_del(sd->must_recalc_idler);
|
|
|
|
if (sd->multi_timer) ecore_timer_del(sd->multi_timer);
|
|
|
|
if (sd->decorate_it_type) eina_stringshare_del(sd->decorate_it_type);
|
|
|
|
if (sd->scr_hold_timer) ecore_timer_del(sd->scr_hold_timer);
|
|
|
|
if (sd->tree_effect_animator) ecore_animator_del(sd->tree_effect_animator);
|
|
|
|
|
|
|
|
ELM_WIDGET_CLASS(_elm_genlist_parent_sc)->base.del(obj);
|
2011-11-30 09:13:57 -08:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_elm_genlist_smart_move(Evas_Object *obj,
|
|
|
|
Evas_Coord x,
|
|
|
|
Evas_Coord y)
|
2011-11-30 09:13:57 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
ELM_WIDGET_CLASS(_elm_genlist_parent_sc)->base.move(obj, x, y);
|
|
|
|
|
|
|
|
evas_object_move(sd->hit_rect, x, y);
|
2011-11-30 09:13:57 -08:00
|
|
|
}
|
|
|
|
|
2012-01-26 23:36:36 -08:00
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_elm_genlist_smart_resize(Evas_Object *obj,
|
|
|
|
Evas_Coord w,
|
|
|
|
Evas_Coord h)
|
2012-01-26 23:36:36 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
2012-01-26 23:36:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_WIDGET_CLASS(_elm_genlist_parent_sc)->base.resize(obj, w, h);
|
2012-01-26 23:36:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_object_resize(sd->hit_rect, w, h);
|
2012-01-26 23:36:36 -08:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_elm_genlist_smart_member_add(Evas_Object *obj,
|
|
|
|
Evas_Object *member)
|
2012-01-27 03:59:22 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
2012-01-27 03:59:22 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_WIDGET_CLASS(_elm_genlist_parent_sc)->base.member_add(obj, member);
|
|
|
|
|
|
|
|
if (sd->hit_rect)
|
|
|
|
evas_object_raise(sd->hit_rect);
|
2012-01-27 03:59:22 -08:00
|
|
|
}
|
|
|
|
|
2012-03-09 08:27:03 -08:00
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_elm_genlist_smart_set_user(Elm_Layout_Smart_Class *sc)
|
2012-03-09 08:27:03 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_WIDGET_CLASS(sc)->base.add = _elm_genlist_smart_add;
|
|
|
|
ELM_WIDGET_CLASS(sc)->base.del = _elm_genlist_smart_del;
|
|
|
|
ELM_WIDGET_CLASS(sc)->base.move = _elm_genlist_smart_move;
|
|
|
|
ELM_WIDGET_CLASS(sc)->base.resize = _elm_genlist_smart_resize;
|
|
|
|
ELM_WIDGET_CLASS(sc)->base.member_add = _elm_genlist_smart_member_add;
|
|
|
|
|
|
|
|
ELM_WIDGET_CLASS(sc)->sub_object_add = _elm_genlist_smart_sub_object_add;
|
|
|
|
ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_genlist_smart_sub_object_del;
|
|
|
|
ELM_WIDGET_CLASS(sc)->on_focus = _elm_genlist_smart_on_focus;
|
|
|
|
ELM_WIDGET_CLASS(sc)->theme = _elm_genlist_smart_theme;
|
|
|
|
ELM_WIDGET_CLASS(sc)->event = _elm_genlist_smart_event;
|
|
|
|
ELM_WIDGET_CLASS(sc)->translate = _elm_genlist_smart_translate;
|
|
|
|
|
|
|
|
ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_genlist_smart_sizing_eval;
|
2012-03-09 08:27:03 -08:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_genlist_add(Evas_Object *parent)
|
2011-11-30 09:13:57 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Evas *e;
|
|
|
|
Evas_Object *obj;
|
|
|
|
Evas_Coord minw, minh;
|
|
|
|
Elm_Genlist_Pan_Smart_Data *pan_data;
|
2011-11-30 09:13:57 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
2012-03-09 08:27:03 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
e = evas_object_evas_get(parent);
|
|
|
|
if (!e) return NULL;
|
2011-11-30 09:13:57 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
obj = evas_object_smart_add(e, _elm_genlist_smart_class_new());
|
2011-11-30 09:13:57 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!elm_widget_sub_object_add(parent, obj))
|
|
|
|
ERR("could not add %p as sub object of %p", obj, parent);
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
2009-02-10 03:57:47 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_widget_can_focus_set(obj, EINA_TRUE);
|
|
|
|
elm_widget_on_show_region_hook_set(obj, _show_region_hook, obj);
|
2011-12-05 08:43:29 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->generation = 1;
|
2011-12-05 08:43:29 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_layout_theme_set(obj, "genlist", "base", elm_widget_style_get(obj));
|
2009-02-18 04:41:45 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
/* interface's add() routine issued AFTER the object's smart_add() */
|
|
|
|
sd->s_iface = evas_object_smart_interface_get
|
|
|
|
(obj, ELM_SCROLLABLE_IFACE_NAME);
|
2011-12-26 06:30:21 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->s_iface->objects_set
|
|
|
|
(obj, ELM_WIDGET_DATA(sd)->resize_obj, sd->hit_rect);
|
2011-12-26 06:30:21 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->s_iface->bounce_allow_set
|
|
|
|
(obj, EINA_FALSE, _elm_config->thumbscroll_bounce_enable);
|
|
|
|
sd->v_bounce = _elm_config->thumbscroll_bounce_enable;
|
2011-12-26 06:30:21 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->s_iface->animate_start_cb_set(obj, _scroll_animate_start_cb);
|
|
|
|
sd->s_iface->animate_stop_cb_set(obj, _scroll_animate_stop_cb);
|
|
|
|
sd->s_iface->drag_start_cb_set(obj, _scroll_drag_start_cb);
|
|
|
|
sd->s_iface->drag_stop_cb_set(obj, _scroll_drag_stop_cb);
|
|
|
|
sd->s_iface->edge_left_cb_set(obj, _edge_left_cb);
|
|
|
|
sd->s_iface->edge_right_cb_set(obj, _edge_right_cb);
|
|
|
|
sd->s_iface->edge_top_cb_set(obj, _edge_top_cb);
|
|
|
|
sd->s_iface->edge_bottom_cb_set(obj, _edge_bottom_cb);
|
2011-12-26 06:30:21 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->mode = ELM_LIST_SCROLL;
|
|
|
|
sd->max_items_per_block = MAX_ITEMS_PER_BLOCK;
|
|
|
|
sd->item_cache_max = sd->max_items_per_block * 2;
|
|
|
|
sd->longpress_timeout = _elm_config->longpress_timeout;
|
|
|
|
sd->highlight = EINA_TRUE;
|
|
|
|
|
|
|
|
sd->pan_obj = evas_object_smart_add
|
|
|
|
(evas_object_evas_get(obj), _elm_genlist_pan_smart_class_new());
|
|
|
|
pan_data = evas_object_smart_data_get(sd->pan_obj);
|
|
|
|
pan_data->wsd = sd;
|
|
|
|
|
|
|
|
sd->s_iface->extern_pan_set(obj, sd->pan_obj);
|
|
|
|
|
|
|
|
edje_object_size_min_calc(ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh);
|
|
|
|
evas_object_size_hint_min_set(obj, minw, minh);
|
2011-12-26 06:30:21 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
_mirrored_set(obj, elm_widget_mirrored_get(obj));
|
2011-12-26 06:30:21 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_layout_sizing_eval(obj);
|
|
|
|
|
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_clear(Elm_Genlist_Smart_Data *sd)
|
|
|
|
{
|
|
|
|
sd->anchor_item = NULL;
|
|
|
|
if (sd->queue_idle_enterer)
|
|
|
|
{
|
|
|
|
ecore_idle_enterer_del(sd->queue_idle_enterer);
|
|
|
|
sd->queue_idle_enterer = NULL;
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->must_recalc_idler)
|
2009-02-18 20:37:06 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ecore_idler_del(sd->must_recalc_idler);
|
|
|
|
sd->must_recalc_idler = NULL;
|
2009-02-18 20:37:06 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->queue) sd->queue = eina_list_free(sd->queue);
|
|
|
|
if (sd->reorder_move_animator)
|
2009-09-22 22:48:59 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ecore_animator_del(sd->reorder_move_animator);
|
|
|
|
sd->reorder_move_animator = NULL;
|
|
|
|
}
|
|
|
|
sd->show_item = NULL;
|
|
|
|
sd->reorder_old_pan_y = 0;
|
|
|
|
}
|
2009-09-23 15:56:47 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_elm_genlist_clear(Evas_Object *obj,
|
|
|
|
Eina_Bool standby)
|
|
|
|
{
|
|
|
|
Eina_Inlist *next, *l;
|
2011-12-05 08:43:29 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
2009-09-23 15:56:47 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!standby) sd->generation++;
|
2009-09-23 15:56:47 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->state)
|
|
|
|
{
|
|
|
|
eina_inlist_sorted_state_free(sd->state);
|
|
|
|
sd->state = NULL;
|
|
|
|
}
|
2011-12-05 08:43:29 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->walking > 0)
|
|
|
|
{
|
|
|
|
sd->clear_me = EINA_TRUE;
|
|
|
|
return;
|
|
|
|
}
|
2011-12-05 08:43:29 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
|
|
|
for (l = sd->items, next = l ? l->next : NULL;
|
|
|
|
l;
|
|
|
|
l = next, next = next ? next->next : NULL)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(l);
|
|
|
|
|
|
|
|
if (it->generation < sd->generation)
|
2011-12-05 08:43:29 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *itn = NULL;
|
2011-12-05 08:43:29 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (next) itn = ELM_GEN_ITEM_FROM_INLIST(next);
|
|
|
|
if (itn) itn->walking++; /* prevent early death of subitem */
|
|
|
|
it->del_cb(it);
|
|
|
|
elm_widget_item_free(it);
|
|
|
|
if (itn) itn->walking--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sd->clear_me = EINA_FALSE;
|
|
|
|
sd->pan_changed = EINA_TRUE;
|
|
|
|
if (sd->calc_job)
|
|
|
|
{
|
|
|
|
ecore_job_del(sd->calc_job);
|
|
|
|
sd->calc_job = NULL;
|
|
|
|
}
|
|
|
|
if (sd->selected) sd->selected = eina_list_free(sd->selected);
|
|
|
|
_clear(sd);
|
|
|
|
sd->pan_x = 0;
|
|
|
|
sd->pan_y = 0;
|
|
|
|
sd->minw = 0;
|
|
|
|
sd->minh = 0;
|
2011-12-05 08:43:29 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->alpha_bg) evas_object_del(sd->alpha_bg);
|
|
|
|
sd->alpha_bg = NULL;
|
2011-12-05 08:43:29 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->pan_obj)
|
|
|
|
{
|
|
|
|
evas_object_size_hint_min_set(sd->pan_obj, sd->minw, sd->minh);
|
|
|
|
evas_object_smart_callback_call(sd->pan_obj, "changed", NULL);
|
|
|
|
}
|
|
|
|
elm_layout_sizing_eval(ELM_WIDGET_DATA(sd)->obj);
|
|
|
|
sd->s_iface->content_region_show(obj, 0, 0, 0, 0);
|
|
|
|
evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
|
|
|
}
|
2011-12-05 08:43:29 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_item_select(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
Evas_Object *obj = WIDGET(it);
|
2011-12-05 08:43:29 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((it->generation < GL_IT(it)->wsd->generation) ||
|
|
|
|
(it->decorate_it_set) ||
|
|
|
|
(it->select_mode == ELM_OBJECT_SELECT_MODE_NONE) ||
|
|
|
|
(GL_IT(it)->wsd->select_mode == ELM_OBJECT_SELECT_MODE_NONE))
|
|
|
|
return;
|
2011-12-05 08:43:29 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!it->selected)
|
|
|
|
{
|
|
|
|
it->selected = EINA_TRUE;
|
|
|
|
GL_IT(it)->wsd->selected =
|
|
|
|
eina_list_append(GL_IT(it)->wsd->selected, it);
|
|
|
|
}
|
|
|
|
else if (GL_IT(it)->wsd->select_mode != ELM_OBJECT_SELECT_MODE_ALWAYS)
|
|
|
|
return;
|
2011-12-05 08:43:29 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_object_ref(obj);
|
|
|
|
it->walking++;
|
|
|
|
GL_IT(it)->wsd->walking++;
|
|
|
|
if (it->func.func) it->func.func((void *)it->func.data, WIDGET(it), it);
|
|
|
|
if (it->generation == GL_IT(it)->wsd->generation)
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, it);
|
|
|
|
|
|
|
|
it->walking--;
|
|
|
|
GL_IT(it)->wsd->walking--;
|
|
|
|
if ((GL_IT(it)->wsd->clear_me) && (!GL_IT(it)->wsd->walking))
|
|
|
|
_elm_genlist_clear(WIDGET(it), EINA_TRUE);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((!it->walking) && (it->generation < GL_IT(it)->wsd->generation))
|
|
|
|
{
|
|
|
|
if (!it->relcount)
|
|
|
|
{
|
|
|
|
it->del_cb(it);
|
|
|
|
elm_widget_item_free(it);
|
2011-12-05 08:43:29 -08:00
|
|
|
}
|
2009-09-22 22:48:59 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
else
|
|
|
|
GL_IT(it)->wsd->last_selected_item = (Elm_Object_Item *)it;
|
2009-09-22 22:48:59 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_object_unref(obj);
|
|
|
|
}
|
2011-12-05 08:43:29 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static Evas_Object *
|
|
|
|
_item_content_get_hook(Elm_Gen_Item *it,
|
|
|
|
const char *part)
|
|
|
|
{
|
|
|
|
return edje_object_part_swallow_get(VIEW(it), part);
|
2009-02-12 05:39:43 -08:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static const char *
|
|
|
|
_item_text_get_hook(Elm_Gen_Item *it,
|
|
|
|
const char *part)
|
2012-05-15 22:28:40 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!it->itc->func.text_get) return NULL;
|
|
|
|
return edje_object_part_text_get(VIEW(it), part);
|
2012-05-15 22:28:40 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_disable_hook(Elm_Object_Item *item)
|
2012-05-15 22:28:40 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *obj;
|
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
2012-05-23 21:59:52 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->generation < GL_IT(it)->wsd->generation) return;
|
|
|
|
|
|
|
|
if (it->selected)
|
|
|
|
elm_genlist_item_selected_set(item, EINA_FALSE);
|
|
|
|
|
|
|
|
if (it->realized)
|
2012-05-15 22:28:40 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (elm_widget_item_disabled_get(it))
|
2012-05-15 22:28:40 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
|
|
|
|
if (it->deco_all_view)
|
|
|
|
edje_object_signal_emit
|
|
|
|
(it->deco_all_view, "elm,state,disabled", "elm");
|
2012-05-15 22:28:40 -07:00
|
|
|
}
|
2012-05-30 03:44:59 -07:00
|
|
|
else
|
2012-07-16 14:56:30 -07:00
|
|
|
{
|
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,enabled", "elm");
|
|
|
|
if (it->deco_all_view)
|
|
|
|
edje_object_signal_emit
|
|
|
|
(it->deco_all_view, "elm,state,enabled", "elm");
|
|
|
|
}
|
|
|
|
EINA_LIST_FOREACH (it->content_objs, l, obj)
|
|
|
|
elm_widget_disabled_set(obj, elm_widget_item_disabled_get(it));
|
2012-05-29 03:25:55 -07:00
|
|
|
}
|
2012-05-15 22:28:40 -07:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_item_del_pre_hook(Elm_Object_Item *item)
|
2009-02-12 05:39:43 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
2009-02-18 20:37:06 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((it->relcount > 0) || (it->walking > 0))
|
2009-02-12 05:39:43 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_subitems_clear(item);
|
|
|
|
if (GL_IT(it)->wsd->show_item == it)
|
|
|
|
GL_IT(it)->wsd->show_item = NULL;
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
_elm_genlist_item_del_not_serious(it);
|
|
|
|
if (it->item->block)
|
2010-02-04 22:14:50 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->realized) _elm_genlist_item_unrealize(it, EINA_FALSE);
|
|
|
|
it->item->block->changed = EINA_TRUE;
|
|
|
|
if (GL_IT(it)->wsd->calc_job)
|
|
|
|
ecore_job_del(GL_IT(it)->wsd->calc_job);
|
|
|
|
GL_IT(it)->wsd->calc_job =
|
|
|
|
ecore_job_add(_calc_job, GL_IT(it)->wsd);
|
|
|
|
}
|
|
|
|
if (it->parent)
|
|
|
|
{
|
|
|
|
it->parent->item->items =
|
|
|
|
eina_list_remove(it->parent->item->items, it);
|
|
|
|
it->parent = NULL;
|
2010-02-04 22:14:50 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
return EINA_FALSE;
|
2010-01-23 01:07:20 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
|
|
|
|
_item_del(it);
|
|
|
|
return EINA_TRUE;
|
2010-03-28 19:27:26 -07:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static void
|
|
|
|
_item_signal_emit_hook(Elm_Object_Item *it,
|
|
|
|
const char *emission,
|
|
|
|
const char *source)
|
2010-03-28 19:27:26 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
edje_object_signal_emit(VIEW(it), emission, source);
|
2009-02-12 05:39:43 -08:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static Elm_Gen_Item *
|
|
|
|
_elm_genlist_item_new(Elm_Genlist_Smart_Data *sd,
|
|
|
|
const Elm_Gen_Item_Class *itc,
|
|
|
|
const void *data,
|
|
|
|
Elm_Gen_Item *parent,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
2011-04-27 03:17:26 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it;
|
2011-05-07 01:37:47 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!itc) return NULL;
|
|
|
|
|
|
|
|
it = elm_widget_item_new(ELM_WIDGET_DATA(sd)->obj, Elm_Gen_Item);
|
|
|
|
if (!it) return NULL;
|
|
|
|
|
|
|
|
it->generation = sd->generation;
|
|
|
|
it->itc = itc;
|
|
|
|
elm_genlist_item_class_ref((Elm_Genlist_Item_Class *)itc);
|
|
|
|
it->base.data = data;
|
|
|
|
it->parent = parent;
|
|
|
|
it->func.func = func;
|
|
|
|
it->func.data = func_data;
|
|
|
|
elm_widget_item_content_get_hook_set(it, _item_content_get_hook);
|
|
|
|
elm_widget_item_text_get_hook_set(it, _item_text_get_hook);
|
|
|
|
elm_widget_item_disable_hook_set(it, _item_disable_hook);
|
|
|
|
elm_widget_item_del_pre_hook_set(it, _item_del_pre_hook);
|
|
|
|
elm_widget_item_signal_emit_hook_set(it, _item_signal_emit_hook);
|
|
|
|
|
|
|
|
/* TEMPORARY */
|
|
|
|
it->sel_cb = (Ecore_Cb)_item_select;
|
|
|
|
|
|
|
|
return it;
|
2011-04-27 03:17:26 -07:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static Elm_Gen_Item *
|
|
|
|
_item_new(Elm_Genlist_Smart_Data *sd,
|
|
|
|
const Elm_Genlist_Item_Class *itc,
|
|
|
|
const void *data,
|
|
|
|
Elm_Gen_Item *parent,
|
|
|
|
Elm_Genlist_Item_Type type,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
2009-02-12 05:39:43 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it, *it2;
|
|
|
|
int depth = 0;
|
|
|
|
|
|
|
|
it = _elm_genlist_item_new(sd, itc, data, parent, func, func_data);
|
|
|
|
if (!it) return NULL;
|
|
|
|
|
|
|
|
it->item = ELM_NEW(Elm_Gen_Item_Type);
|
|
|
|
it->item->type = type;
|
|
|
|
if (type & ELM_GENLIST_ITEM_GROUP) it->group++;
|
|
|
|
it->item->expanded_depth = 0;
|
|
|
|
it->item->wsd = sd;
|
|
|
|
|
|
|
|
it->del_cb = (Ecore_Cb)_item_del;
|
|
|
|
it->highlight_cb = (Ecore_Cb)_item_highlight;
|
|
|
|
it->unsel_cb = (Ecore_Cb)_item_unselect;
|
|
|
|
it->unhighlight_cb = (Ecore_Cb)_item_unhighlight;
|
|
|
|
it->unrealize_cb = (Ecore_Cb)_item_unrealize_cb;
|
|
|
|
|
|
|
|
if (it->parent)
|
2010-03-24 03:00:50 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->parent->group)
|
|
|
|
it->item->group_item = parent;
|
|
|
|
else if (it->parent->item->group_item)
|
|
|
|
it->item->group_item = it->parent->item->group_item;
|
2010-03-24 03:00:50 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
for (it2 = it, depth = 0; it2->parent; it2 = it2->parent)
|
2012-06-18 02:54:00 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!it2->parent->group) depth += 1;
|
2012-06-18 02:54:00 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
it->item->expanded_depth = depth;
|
|
|
|
sd->item_count++;
|
2012-06-21 01:36:21 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
return it;
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
|
|
|
|
2011-05-25 07:58:39 -07:00
|
|
|
static int
|
2012-07-16 14:56:30 -07:00
|
|
|
_elm_genlist_item_compare(const void *data,
|
|
|
|
const void *data1)
|
2011-05-25 07:58:39 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
const Elm_Gen_Item *it, *item1;
|
2012-07-16 14:56:30 -07:00
|
|
|
|
2011-10-21 15:55:45 -07:00
|
|
|
it = ELM_GEN_ITEM_FROM_INLIST(data);
|
|
|
|
item1 = ELM_GEN_ITEM_FROM_INLIST(data1);
|
2012-07-16 14:56:30 -07:00
|
|
|
return GL_IT(it)->wsd->item_compare_cb(it, item1);
|
2011-05-25 07:58:39 -07:00
|
|
|
}
|
|
|
|
|
2011-07-28 09:43:15 -07:00
|
|
|
static int
|
2012-07-16 14:56:30 -07:00
|
|
|
_elm_genlist_item_list_compare(const void *data,
|
|
|
|
const void *data1)
|
2011-07-28 09:43:15 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
const Elm_Gen_Item *it = data;
|
|
|
|
const Elm_Gen_Item *item1 = data1;
|
2011-06-01 20:10:11 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
return GL_IT(it)->wsd->item_compare_cb(it, item1);
|
2011-06-01 20:10:11 -07:00
|
|
|
}
|
|
|
|
|
2012-02-21 15:59:25 -08:00
|
|
|
EAPI unsigned int
|
2012-02-21 19:22:10 -08:00
|
|
|
elm_genlist_items_count(const Evas_Object *obj)
|
2012-02-21 15:59:25 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj) 0;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
return sd->item_count;
|
2012-02-21 15:59:25 -08:00
|
|
|
}
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
EAPI Elm_Object_Item *
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_append(Evas_Object *obj,
|
2010-12-07 11:18:14 -08:00
|
|
|
const Elm_Genlist_Item_Class *itc,
|
2012-07-16 14:56:30 -07:00
|
|
|
const void *data,
|
|
|
|
Elm_Object_Item *parent,
|
|
|
|
Elm_Genlist_Item_Type type,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it;
|
|
|
|
|
|
|
|
ELM_GENLIST_CHECK(obj) NULL;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
it = _item_new
|
|
|
|
(sd, itc, data, (Elm_Gen_Item *)parent, type, func, func_data);
|
2009-02-10 03:57:47 -08:00
|
|
|
if (!it) return NULL;
|
2012-07-16 14:56:30 -07:00
|
|
|
|
2009-02-12 05:39:43 -08:00
|
|
|
if (!it->parent)
|
2009-03-12 22:50:38 -07:00
|
|
|
{
|
2011-10-23 20:40:54 -07:00
|
|
|
if (it->group)
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->group_items = eina_list_append(sd->group_items, it);
|
|
|
|
sd->items = eina_inlist_append(sd->items, EINA_INLIST_GET(it));
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->rel = NULL;
|
2009-03-12 22:50:38 -07:00
|
|
|
}
|
2009-02-11 03:49:43 -08:00
|
|
|
else
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it2 = NULL;
|
|
|
|
Eina_List *ll = eina_list_last(it->parent->item->items);
|
2012-07-16 14:56:30 -07:00
|
|
|
|
2010-10-15 04:51:15 -07:00
|
|
|
if (ll) it2 = ll->data;
|
2012-07-16 14:56:30 -07:00
|
|
|
it->parent->item->items =
|
|
|
|
eina_list_append(it->parent->item->items, it);
|
2010-10-15 04:51:15 -07:00
|
|
|
if (!it2) it2 = it->parent;
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->items = eina_inlist_append_relative
|
|
|
|
(sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(it2));
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->rel = it2;
|
|
|
|
it->item->rel->relcount++;
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->before = EINA_FALSE;
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_queue(sd, it, NULL);
|
|
|
|
|
2012-03-05 07:14:36 -08:00
|
|
|
return (Elm_Object_Item *)it;
|
2009-02-10 03:57:47 -08:00
|
|
|
}
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
EAPI Elm_Object_Item *
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_prepend(Evas_Object *obj,
|
2010-12-07 11:18:14 -08:00
|
|
|
const Elm_Genlist_Item_Class *itc,
|
2012-07-16 14:56:30 -07:00
|
|
|
const void *data,
|
|
|
|
Elm_Object_Item *parent,
|
|
|
|
Elm_Genlist_Item_Type type,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it;
|
|
|
|
|
|
|
|
ELM_GENLIST_CHECK(obj) NULL;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
it = _item_new
|
|
|
|
(sd, itc, data, (Elm_Gen_Item *)parent, type, func, func_data);
|
2009-02-18 04:41:45 -08:00
|
|
|
if (!it) return NULL;
|
2012-07-16 14:56:30 -07:00
|
|
|
|
2009-02-18 04:41:45 -08:00
|
|
|
if (!it->parent)
|
2011-01-04 21:59:30 -08:00
|
|
|
{
|
2011-10-23 20:40:54 -07:00
|
|
|
if (it->group)
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->group_items = eina_list_prepend(sd->group_items, it);
|
|
|
|
sd->items = eina_inlist_prepend(sd->items, EINA_INLIST_GET(it));
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->rel = NULL;
|
2011-01-04 21:59:30 -08:00
|
|
|
}
|
2009-02-18 04:41:45 -08:00
|
|
|
else
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it2 = NULL;
|
|
|
|
Eina_List *ll = it->parent->item->items;
|
2012-07-16 14:56:30 -07:00
|
|
|
|
2011-01-04 21:59:30 -08:00
|
|
|
if (ll) it2 = ll->data;
|
2012-07-16 14:56:30 -07:00
|
|
|
it->parent->item->items =
|
|
|
|
eina_list_prepend(it->parent->item->items, it);
|
2011-01-04 21:59:30 -08:00
|
|
|
if (!it2) it2 = it->parent;
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->items = eina_inlist_prepend_relative
|
|
|
|
(sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(it2));
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->rel = it2;
|
|
|
|
it->item->rel->relcount++;
|
2009-02-18 04:41:45 -08:00
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->before = EINA_TRUE;
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_queue(sd, it, NULL);
|
|
|
|
|
2012-03-05 07:14:36 -08:00
|
|
|
return (Elm_Object_Item *)it;
|
2009-02-10 03:57:47 -08:00
|
|
|
}
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
EAPI Elm_Object_Item *
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_insert_after(Evas_Object *obj,
|
2011-08-01 23:59:45 -07:00
|
|
|
const Elm_Genlist_Item_Class *itc,
|
2012-07-16 14:56:30 -07:00
|
|
|
const void *data,
|
|
|
|
Elm_Object_Item *parent,
|
|
|
|
Elm_Object_Item *after_it,
|
|
|
|
Elm_Genlist_Item_Type type,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *after = (Elm_Gen_Item *)after_it;
|
|
|
|
Elm_Gen_Item *it;
|
|
|
|
|
|
|
|
ELM_GENLIST_CHECK(obj) NULL;
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(after_it, NULL);
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
/* It makes no sense to insert after in an empty list with after !=
|
|
|
|
* NULL, something really bad is happening in your app. */
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(sd->items, NULL);
|
|
|
|
|
|
|
|
it = _item_new
|
|
|
|
(sd, itc, data, (Elm_Gen_Item *)parent, type, func, func_data);
|
2011-11-28 16:06:55 -08:00
|
|
|
if (!it) return NULL;
|
2012-07-16 14:56:30 -07:00
|
|
|
|
2011-08-01 23:59:45 -07:00
|
|
|
if (!it->parent)
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((it->group) && (after->group))
|
|
|
|
sd->group_items = eina_list_append_relative
|
|
|
|
(sd->group_items, it, after);
|
2011-08-01 23:59:45 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
it->parent->item->items =
|
2012-07-16 14:56:30 -07:00
|
|
|
eina_list_append_relative(it->parent->item->items, it, after);
|
2011-08-01 23:59:45 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->items = eina_inlist_append_relative
|
|
|
|
(sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(after));
|
|
|
|
|
|
|
|
it->item->rel = after;
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->rel->relcount++;
|
|
|
|
it->item->before = EINA_FALSE;
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_queue(sd, it, NULL);
|
|
|
|
|
2012-03-05 07:14:36 -08:00
|
|
|
return (Elm_Object_Item *)it;
|
2011-08-01 23:59:45 -07:00
|
|
|
}
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
EAPI Elm_Object_Item *
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_insert_before(Evas_Object *obj,
|
2010-12-07 11:18:14 -08:00
|
|
|
const Elm_Genlist_Item_Class *itc,
|
2012-07-16 14:56:30 -07:00
|
|
|
const void *data,
|
|
|
|
Elm_Object_Item *parent,
|
|
|
|
Elm_Object_Item *before_it,
|
|
|
|
Elm_Genlist_Item_Type type,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *before = (Elm_Gen_Item *)before_it;
|
|
|
|
Elm_Gen_Item *it;
|
|
|
|
|
|
|
|
ELM_GENLIST_CHECK(obj) NULL;
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(before_it, NULL);
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
/* It makes no sense to insert before in an empty list with before
|
|
|
|
* != NULL, something really bad is happening in your app. */
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(sd->items, NULL);
|
|
|
|
|
|
|
|
it = _item_new
|
|
|
|
(sd, itc, data, (Elm_Gen_Item *)parent, type, func, func_data);
|
2011-11-28 16:06:55 -08:00
|
|
|
if (!it) return NULL;
|
2012-07-16 14:56:30 -07:00
|
|
|
|
2011-08-01 23:50:34 -07:00
|
|
|
if (!it->parent)
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->group && before->group)
|
|
|
|
sd->group_items =
|
|
|
|
eina_list_prepend_relative(sd->group_items, it, before);
|
2011-08-01 23:50:34 -07:00
|
|
|
}
|
|
|
|
else
|
2009-02-18 04:41:45 -08:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
it->parent->item->items =
|
2012-07-16 14:56:30 -07:00
|
|
|
eina_list_prepend_relative(it->parent->item->items, it, before);
|
2009-02-18 04:41:45 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->items = eina_inlist_prepend_relative
|
|
|
|
(sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(before));
|
|
|
|
|
|
|
|
it->item->rel = before;
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->rel->relcount++;
|
|
|
|
it->item->before = EINA_TRUE;
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_queue(sd, it, NULL);
|
|
|
|
|
2012-03-05 07:14:36 -08:00
|
|
|
return (Elm_Object_Item *)it;
|
2009-02-10 03:57:47 -08:00
|
|
|
}
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
EAPI Elm_Object_Item *
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_sorted_insert(Evas_Object *obj,
|
2012-02-27 23:17:00 -08:00
|
|
|
const Elm_Genlist_Item_Class *itc,
|
2012-07-16 14:56:30 -07:00
|
|
|
const void *data,
|
|
|
|
Elm_Object_Item *parent,
|
|
|
|
Elm_Genlist_Item_Type type,
|
|
|
|
Eina_Compare_Cb comp,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *rel = NULL;
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it;
|
|
|
|
|
|
|
|
ELM_GENLIST_CHECK(obj) NULL;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
it = _item_new
|
|
|
|
(sd, itc, data, (Elm_Gen_Item *)parent, type, func, func_data);
|
2011-05-25 07:58:39 -07:00
|
|
|
if (!it) return NULL;
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->item_compare_cb = comp;
|
2011-06-25 16:20:22 -07:00
|
|
|
|
2011-05-25 07:58:39 -07:00
|
|
|
if (it->parent)
|
|
|
|
{
|
2011-07-28 09:43:15 -07:00
|
|
|
Eina_List *l;
|
|
|
|
int cmp_result;
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
l = eina_list_search_sorted_near_list
|
|
|
|
(it->parent->item->items, _elm_genlist_item_list_compare, it,
|
|
|
|
&cmp_result);
|
|
|
|
|
2011-07-28 09:43:15 -07:00
|
|
|
if (l)
|
|
|
|
rel = eina_list_data_get(l);
|
|
|
|
else
|
|
|
|
rel = it->parent;
|
|
|
|
|
2011-07-29 09:07:10 -07:00
|
|
|
if (cmp_result >= 0)
|
2011-07-28 09:43:15 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
it->parent->item->items = eina_list_prepend_relative_list
|
|
|
|
(it->parent->item->items, it, l);
|
|
|
|
sd->items = eina_inlist_prepend_relative
|
|
|
|
(sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(rel));
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->before = EINA_FALSE;
|
2011-07-28 09:43:15 -07:00
|
|
|
}
|
|
|
|
else if (cmp_result < 0)
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
it->parent->item->items = eina_list_append_relative_list
|
|
|
|
(it->parent->item->items, it, l);
|
|
|
|
sd->items = eina_inlist_append_relative
|
|
|
|
(sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(rel));
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->before = EINA_TRUE;
|
2011-07-28 09:43:15 -07:00
|
|
|
}
|
2011-05-25 07:58:39 -07:00
|
|
|
}
|
2011-07-28 09:43:15 -07:00
|
|
|
else
|
2011-05-25 07:58:39 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!sd->state)
|
2011-09-05 13:31:51 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->state = eina_inlist_sorted_state_new();
|
|
|
|
eina_inlist_sorted_state_init(sd->state, sd->items);
|
|
|
|
sd->requeued = EINA_FALSE;
|
2011-09-05 13:31:51 -07:00
|
|
|
}
|
|
|
|
|
2011-10-23 20:40:54 -07:00
|
|
|
if (it->group)
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->group_items = eina_list_append(sd->group_items, it);
|
2011-07-28 09:43:15 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->items = eina_inlist_sorted_state_insert
|
|
|
|
(sd->items, EINA_INLIST_GET(it), _elm_genlist_item_compare,
|
|
|
|
sd->state);
|
2011-07-28 09:43:15 -07:00
|
|
|
|
|
|
|
if (EINA_INLIST_GET(it)->next)
|
|
|
|
{
|
2011-10-21 15:55:45 -07:00
|
|
|
rel = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->before = EINA_TRUE;
|
2011-07-28 09:43:15 -07:00
|
|
|
}
|
|
|
|
else if (EINA_INLIST_GET(it)->prev)
|
|
|
|
{
|
2011-10-21 15:55:45 -07:00
|
|
|
rel = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->before = EINA_FALSE;
|
2011-07-28 09:43:15 -07:00
|
|
|
}
|
2011-05-25 07:58:39 -07:00
|
|
|
}
|
2011-07-28 09:43:15 -07:00
|
|
|
|
|
|
|
if (rel)
|
2011-05-25 07:58:39 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->rel = rel;
|
|
|
|
it->item->rel->relcount++;
|
2011-05-25 07:58:39 -07:00
|
|
|
}
|
2011-07-28 09:43:15 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_queue(sd, it, _elm_genlist_item_list_compare);
|
2011-05-25 07:58:39 -07:00
|
|
|
|
2012-03-05 07:14:36 -08:00
|
|
|
return (Elm_Object_Item *)it;
|
2011-05-25 07:58:39 -07:00
|
|
|
}
|
|
|
|
|
2011-12-02 05:43:02 -08:00
|
|
|
EAPI void
|
|
|
|
elm_genlist_clear(Evas_Object *obj)
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj);
|
|
|
|
|
2011-12-02 05:43:02 -08:00
|
|
|
_elm_genlist_clear(obj, EINA_FALSE);
|
|
|
|
}
|
|
|
|
|
2009-02-10 03:57:47 -08:00
|
|
|
EAPI void
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_genlist_multi_select_set(Evas_Object *obj,
|
2012-07-16 14:56:30 -07:00
|
|
|
Eina_Bool multi)
|
2009-02-10 03:57:47 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj);
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
sd->multi = !!multi;
|
2009-02-10 03:57:47 -08:00
|
|
|
}
|
|
|
|
|
2010-04-06 07:01:04 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_genlist_multi_select_get(const Evas_Object *obj)
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj) EINA_FALSE;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
return sd->multi;
|
2010-04-06 07:01:04 -07:00
|
|
|
}
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
EAPI Elm_Object_Item *
|
2009-02-25 07:54:26 -08:00
|
|
|
elm_genlist_selected_item_get(const Evas_Object *obj)
|
2009-02-10 03:57:47 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj) NULL;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if (sd->selected)
|
|
|
|
return sd->selected->data;
|
|
|
|
|
2009-02-16 23:50:35 -08:00
|
|
|
return NULL;
|
2009-02-10 03:57:47 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI const Eina_List *
|
2009-02-25 07:54:26 -08:00
|
|
|
elm_genlist_selected_items_get(const Evas_Object *obj)
|
2009-02-10 03:57:47 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj) NULL;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
return sd->selected;
|
2009-02-10 03:57:47 -08:00
|
|
|
}
|
|
|
|
|
2010-01-24 21:54:31 -08:00
|
|
|
EAPI Eina_List *
|
|
|
|
elm_genlist_realized_items_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Item_Block *itb;
|
2012-07-16 14:56:30 -07:00
|
|
|
Eina_List *list = NULL;
|
2010-06-05 06:12:45 -07:00
|
|
|
Eina_Bool done = EINA_FALSE;
|
2012-07-16 14:56:30 -07:00
|
|
|
|
|
|
|
ELM_GENLIST_CHECK(obj) NULL;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
EINA_INLIST_FOREACH (sd->blocks, itb)
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
|
|
|
if (itb->realized)
|
|
|
|
{
|
|
|
|
Eina_List *l;
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it;
|
2011-03-22 00:54:24 -07:00
|
|
|
|
2012-02-27 21:26:49 -08:00
|
|
|
done = EINA_TRUE;
|
2012-07-16 14:56:30 -07:00
|
|
|
EINA_LIST_FOREACH (itb->items, l, it)
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
|
|
|
if (it->realized) list = eina_list_append(list, it);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (done) break;
|
|
|
|
}
|
|
|
|
}
|
2010-01-24 21:54:31 -08:00
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
EAPI Elm_Object_Item *
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_genlist_at_xy_item_get(const Evas_Object *obj,
|
2012-07-16 14:56:30 -07:00
|
|
|
Evas_Coord x,
|
|
|
|
Evas_Coord y,
|
|
|
|
int *posret)
|
2009-09-22 20:22:07 -07:00
|
|
|
{
|
|
|
|
Evas_Coord ox, oy, ow, oh;
|
|
|
|
Evas_Coord lasty;
|
2012-07-16 14:56:30 -07:00
|
|
|
Item_Block *itb;
|
|
|
|
|
|
|
|
ELM_GENLIST_CHECK(obj) NULL;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh);
|
2009-09-22 20:22:07 -07:00
|
|
|
lasty = oy;
|
2012-07-16 14:56:30 -07:00
|
|
|
EINA_INLIST_FOREACH (sd->blocks, itb)
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
|
|
|
Eina_List *l;
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it;
|
2011-03-22 00:54:24 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!ELM_RECTS_INTERSECT(ox + itb->x - itb->sd->pan_x,
|
|
|
|
oy + itb->y - itb->sd->pan_y,
|
2011-03-22 00:54:24 -07:00
|
|
|
itb->w, itb->h, x, y, 1, 1))
|
|
|
|
continue;
|
2012-07-16 14:56:30 -07:00
|
|
|
EINA_LIST_FOREACH (itb->items, l, it)
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
|
|
|
Evas_Coord itx, ity;
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
itx = ox + itb->x + it->x - itb->sd->pan_x;
|
|
|
|
ity = oy + itb->y + it->y - itb->sd->pan_y;
|
|
|
|
if (ELM_RECTS_INTERSECT
|
|
|
|
(itx, ity, it->item->w, it->item->h, x, y, 1, 1))
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
|
|
|
if (posret)
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
if (y <= (ity + (it->item->h / 4))) *posret = -1;
|
|
|
|
else if (y >= (ity + it->item->h - (it->item->h / 4)))
|
2011-03-22 00:54:24 -07:00
|
|
|
*posret = 1;
|
|
|
|
else *posret = 0;
|
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
|
2012-03-05 07:14:36 -08:00
|
|
|
return (Elm_Object_Item *)it;
|
2011-03-22 00:54:24 -07:00
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
lasty = ity + it->item->h;
|
2011-03-22 00:54:24 -07:00
|
|
|
}
|
|
|
|
}
|
2009-09-22 20:22:07 -07:00
|
|
|
if (posret)
|
|
|
|
{
|
|
|
|
if (y > lasty) *posret = 1;
|
|
|
|
else *posret = -1;
|
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
|
2009-09-22 20:22:07 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
EAPI Elm_Object_Item *
|
2009-02-25 07:54:26 -08:00
|
|
|
elm_genlist_first_item_get(const Evas_Object *obj)
|
2009-02-10 03:57:47 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it;
|
|
|
|
|
|
|
|
ELM_GENLIST_CHECK(obj) NULL;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if (!sd->items) return NULL;
|
|
|
|
|
|
|
|
it = ELM_GEN_ITEM_FROM_INLIST(sd->items);
|
|
|
|
while ((it) && (it->generation < sd->generation))
|
2011-11-30 09:13:57 -08:00
|
|
|
it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
|
2012-07-16 14:56:30 -07:00
|
|
|
|
2012-03-05 07:14:36 -08:00
|
|
|
return (Elm_Object_Item *)it;
|
2009-02-16 23:50:35 -08:00
|
|
|
}
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
EAPI Elm_Object_Item *
|
2009-02-25 07:54:26 -08:00
|
|
|
elm_genlist_last_item_get(const Evas_Object *obj)
|
2009-02-16 23:50:35 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it;
|
|
|
|
|
|
|
|
ELM_GENLIST_CHECK(obj) NULL;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if (!sd->items) return NULL;
|
|
|
|
|
|
|
|
it = ELM_GEN_ITEM_FROM_INLIST(sd->items->last);
|
|
|
|
while ((it) && (it->generation < sd->generation))
|
2011-11-30 09:13:57 -08:00
|
|
|
it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
|
2012-07-16 14:56:30 -07:00
|
|
|
|
2012-03-05 07:14:36 -08:00
|
|
|
return (Elm_Object_Item *)it;
|
2009-02-16 23:50:35 -08:00
|
|
|
}
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
EAPI Elm_Object_Item *
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_next_get(const Elm_Object_Item *item)
|
2009-02-16 23:50:35 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it;
|
|
|
|
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item, NULL);
|
|
|
|
|
|
|
|
it = (Elm_Gen_Item *)item;
|
|
|
|
while (it)
|
2011-11-30 09:13:57 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
|
|
|
|
if ((it) && (it->generation == GL_IT(it)->wsd->generation)) break;
|
2011-11-30 09:13:57 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
|
|
|
|
return (Elm_Object_Item *)it;
|
2009-02-16 23:50:35 -08:00
|
|
|
}
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
EAPI Elm_Object_Item *
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_prev_get(const Elm_Object_Item *item)
|
2009-02-16 23:50:35 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it;
|
|
|
|
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item, NULL);
|
|
|
|
|
|
|
|
it = (Elm_Gen_Item *)item;
|
|
|
|
while (it)
|
2011-11-30 09:13:57 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
|
|
|
|
if ((it) && (it->generation == GL_IT(it)->wsd->generation)) break;
|
2011-11-30 09:13:57 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
|
|
|
|
return (Elm_Object_Item *)it;
|
2009-02-10 03:57:47 -08:00
|
|
|
}
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
EAPI Elm_Object_Item *
|
|
|
|
elm_genlist_item_parent_get(const Elm_Object_Item *it)
|
2009-03-12 22:50:38 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, NULL);
|
|
|
|
|
|
|
|
return (Elm_Object_Item *)((Elm_Gen_Item *)it)->parent;
|
2009-03-12 22:50:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_subitems_clear(Elm_Object_Item *item)
|
2009-03-12 22:50:38 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item);
|
|
|
|
ELM_GENLIST_DATA_GET(WIDGET(it), sd);
|
|
|
|
|
|
|
|
if (!sd->tree_effect_enabled || !sd->move_effect_mode)
|
|
|
|
_item_sub_items_clear(it);
|
2012-03-07 04:15:36 -08:00
|
|
|
else
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!sd->tree_effect_animator)
|
2012-03-07 04:15:36 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->expanded_item = it;
|
|
|
|
_item_tree_effect_before(it);
|
|
|
|
evas_object_raise(sd->alpha_bg);
|
|
|
|
evas_object_show(sd->alpha_bg);
|
|
|
|
sd->start_time = ecore_time_get();
|
|
|
|
sd->tree_effect_animator =
|
|
|
|
ecore_animator_add(_tree_effect_animator_cb, sd);
|
2012-03-07 04:15:36 -08:00
|
|
|
}
|
|
|
|
else
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_sub_items_clear(it);
|
2012-03-07 04:15:36 -08:00
|
|
|
}
|
2009-03-12 22:50:38 -07:00
|
|
|
}
|
|
|
|
|
2009-02-10 03:57:47 -08:00
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_selected_set(Elm_Object_Item *item,
|
2012-01-19 21:18:31 -08:00
|
|
|
Eina_Bool selected)
|
2009-02-10 03:57:47 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
|
|
|
Elm_Genlist_Smart_Data *sd;
|
|
|
|
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item);
|
|
|
|
|
|
|
|
sd = GL_IT(it)->wsd;
|
|
|
|
if ((it->generation < sd->generation) || elm_widget_item_disabled_get(it))
|
2012-01-26 23:36:36 -08:00
|
|
|
return;
|
2011-11-30 09:13:57 -08:00
|
|
|
selected = !!selected;
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->selected == selected) return;
|
2011-11-30 09:13:57 -08:00
|
|
|
|
|
|
|
if (selected)
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!sd->multi)
|
2011-11-30 09:13:57 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
while (sd->selected)
|
2011-11-30 09:13:57 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->unhighlight_cb)
|
|
|
|
it->unhighlight_cb(sd->selected->data);
|
|
|
|
it->unsel_cb(sd->selected->data);
|
2011-11-30 09:13:57 -08:00
|
|
|
}
|
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
it->highlight_cb(it);
|
|
|
|
_item_select(it);
|
|
|
|
|
2011-11-30 09:13:57 -08:00
|
|
|
return;
|
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->unhighlight_cb) it->unhighlight_cb(it);
|
|
|
|
it->unsel_cb(it);
|
2009-02-10 03:57:47 -08:00
|
|
|
}
|
|
|
|
|
2009-06-17 08:35:19 -07:00
|
|
|
EAPI Eina_Bool
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_selected_get(const Elm_Object_Item *it)
|
2009-02-17 20:51:22 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
|
|
|
|
|
2012-03-05 07:14:36 -08:00
|
|
|
return ((Elm_Gen_Item *)it)->selected;
|
2009-02-17 20:51:22 -08:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static Elm_Gen_Item *
|
2012-03-07 04:15:36 -08:00
|
|
|
_elm_genlist_expanded_next_item_get(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it2;
|
2012-07-16 14:56:30 -07:00
|
|
|
|
2012-03-07 04:15:36 -08:00
|
|
|
if (it->item->expanded)
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
it2 = (Elm_Gen_Item *)elm_genlist_item_next_get((Elm_Object_Item *)it);
|
2012-03-07 04:15:36 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
it2 = (Elm_Gen_Item *)elm_genlist_item_next_get((Elm_Object_Item *)it);
|
2012-03-07 04:15:36 -08:00
|
|
|
while (it2)
|
|
|
|
{
|
|
|
|
if (it->item->expanded_depth >= it2->item->expanded_depth) break;
|
2012-07-16 14:56:30 -07:00
|
|
|
it2 = (Elm_Gen_Item *)
|
|
|
|
elm_genlist_item_next_get((Elm_Object_Item *)it2);
|
2012-03-07 04:15:36 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return it2;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_genlist_move_items_set(Elm_Gen_Item *it)
|
|
|
|
{
|
2012-04-20 07:31:51 -07:00
|
|
|
Eina_List *l, *ll;
|
2012-03-07 04:15:36 -08:00
|
|
|
Elm_Gen_Item *it2 = NULL;
|
|
|
|
Evas_Coord ox, oy, ow, oh, dh = 0;
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
GL_IT(it)->wsd->expanded_next_item =
|
|
|
|
_elm_genlist_expanded_next_item_get(it);
|
2012-03-07 04:15:36 -08:00
|
|
|
|
|
|
|
if (it->item->expanded)
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
GL_IT(it)->wsd->move_items = elm_genlist_realized_items_get
|
|
|
|
(ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj);
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH_SAFE (GL_IT(it)->wsd->move_items, l, ll, it2)
|
2012-03-07 04:15:36 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it2 == GL_IT(it)->wsd->expanded_next_item) break;
|
|
|
|
GL_IT(it)->wsd->move_items =
|
|
|
|
eina_list_remove(GL_IT(it)->wsd->move_items, it2);
|
2012-03-07 04:15:36 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_object_geometry_get(GL_IT(it)->wsd->pan_obj, &ox, &oy, &ow, &oh);
|
|
|
|
it2 = GL_IT(it)->wsd->expanded_next_item;
|
|
|
|
|
2012-03-07 04:15:36 -08:00
|
|
|
while (it2 && (dh < oy + oh))
|
|
|
|
{
|
|
|
|
dh += it2->item->h;
|
2012-07-16 14:56:30 -07:00
|
|
|
GL_IT(it)->wsd->move_items =
|
|
|
|
eina_list_append(GL_IT(it)->wsd->move_items, it2);
|
|
|
|
it2 = (Elm_Gen_Item *)
|
|
|
|
elm_genlist_item_next_get((Elm_Object_Item *)it2);
|
2012-03-07 04:15:36 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
static Evas_Object *
|
|
|
|
_tray_alpha_bg_create(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Evas_Object *bg = NULL;
|
|
|
|
Evas_Coord ox, oy, ow, oh;
|
|
|
|
|
|
|
|
ELM_GENLIST_CHECK(obj) NULL;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh);
|
|
|
|
bg = evas_object_rectangle_add
|
|
|
|
(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
|
|
|
evas_object_color_set(bg, 0, 0, 0, 0);
|
|
|
|
evas_object_resize(bg, ow, oh);
|
|
|
|
evas_object_move(bg, ox, oy);
|
|
|
|
|
|
|
|
return bg;
|
|
|
|
}
|
|
|
|
|
2009-02-10 03:57:47 -08:00
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_expanded_set(Elm_Object_Item *item,
|
|
|
|
Eina_Bool expanded)
|
2009-02-10 03:57:47 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
|
|
|
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item);
|
|
|
|
|
2012-02-27 21:26:49 -08:00
|
|
|
expanded = !!expanded;
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->item->expanded == expanded) return;
|
|
|
|
if (it->item->type != ELM_GENLIST_ITEM_TREE) return;
|
|
|
|
it->item->expanded = expanded;
|
|
|
|
GL_IT(it)->wsd->expanded_item = it;
|
|
|
|
_elm_genlist_move_items_set(it);
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (GL_IT(it)->wsd->tree_effect_enabled && !GL_IT(it)->wsd->alpha_bg)
|
|
|
|
GL_IT(it)->wsd->alpha_bg = _tray_alpha_bg_create(WIDGET(it));
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->item->expanded)
|
2009-03-12 22:50:38 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
GL_IT(it)->wsd->move_effect_mode = ELM_GENLIST_TREE_EFFECT_EXPAND;
|
|
|
|
if (it->realized)
|
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,expanded", "elm");
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_EXPANDED, it);
|
|
|
|
GL_IT(it)->wsd->auto_scroll_enabled = EINA_TRUE;
|
2009-03-12 22:50:38 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
GL_IT(it)->wsd->move_effect_mode = ELM_GENLIST_TREE_EFFECT_CONTRACT;
|
|
|
|
if (it->realized)
|
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,contracted", "elm");
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_CONTRACTED, it);
|
|
|
|
GL_IT(it)->wsd->auto_scroll_enabled = EINA_FALSE;
|
2009-03-12 22:50:38 -07:00
|
|
|
}
|
2009-02-10 03:57:47 -08:00
|
|
|
}
|
|
|
|
|
2009-06-17 08:35:19 -07:00
|
|
|
EAPI Eina_Bool
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_expanded_get(const Elm_Object_Item *it)
|
2009-02-17 20:51:22 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
|
|
|
|
|
2012-03-05 07:14:36 -08:00
|
|
|
return ((Elm_Gen_Item *)it)->item->expanded;
|
2009-02-17 20:51:22 -08:00
|
|
|
}
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2010-10-06 23:45:36 -07:00
|
|
|
EAPI int
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_expanded_depth_get(const Elm_Object_Item *it)
|
2010-10-06 23:45:36 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, 0);
|
|
|
|
|
2012-03-05 07:14:36 -08:00
|
|
|
return ((Elm_Gen_Item *)it)->item->expanded_depth;
|
2010-10-06 23:45:36 -07:00
|
|
|
}
|
|
|
|
|
2012-03-08 02:58:29 -08:00
|
|
|
static Eina_Bool
|
2012-07-16 14:56:30 -07:00
|
|
|
_elm_genlist_item_coordinates_calc(Elm_Object_Item *item,
|
|
|
|
Elm_Genlist_Item_Scrollto_Type type,
|
|
|
|
Eina_Bool bring_in,
|
|
|
|
Evas_Coord *x,
|
|
|
|
Evas_Coord *y,
|
|
|
|
Evas_Coord *w,
|
|
|
|
Evas_Coord *h)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
2011-01-05 21:13:11 -08:00
|
|
|
Evas_Coord gith = 0;
|
2012-07-16 14:56:30 -07:00
|
|
|
|
|
|
|
if (it->generation < GL_IT(it)->wsd->generation) return EINA_FALSE;
|
|
|
|
if (!((GL_IT(it)->wsd->homogeneous) &&
|
|
|
|
(GL_IT(it)->wsd->mode == ELM_LIST_COMPRESS)))
|
2012-05-23 21:44:44 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((it->item->queued) || (!it->item->mincalcd))
|
2012-05-23 21:44:44 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
GL_IT(it)->wsd->show_item = it;
|
|
|
|
GL_IT(it)->wsd->bring_in = bring_in;
|
|
|
|
GL_IT(it)->wsd->scroll_to_type = type;
|
|
|
|
it->item->show_me = EINA_TRUE;
|
2012-05-23 21:44:44 -07:00
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
2009-02-17 06:39:08 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
if (GL_IT(it)->wsd->show_item)
|
2009-02-17 06:39:08 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
GL_IT(it)->wsd->show_item->item->show_me = EINA_FALSE;
|
|
|
|
GL_IT(it)->wsd->show_item = NULL;
|
2009-02-17 06:39:08 -08:00
|
|
|
}
|
2012-03-07 00:29:32 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
evas_object_geometry_get(GL_IT(it)->wsd->pan_obj, NULL, NULL, w, h);
|
2012-03-22 02:34:57 -07:00
|
|
|
switch (type)
|
2012-03-07 00:29:32 -08:00
|
|
|
{
|
2012-03-19 20:19:13 -07:00
|
|
|
case ELM_GENLIST_ITEM_SCROLLTO_IN:
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((it->item->group_item) &&
|
|
|
|
(GL_IT(it)->wsd->pan_y > (it->y + it->item->block->y)))
|
|
|
|
gith = it->item->group_item->item->h;
|
|
|
|
*h = it->item->h;
|
|
|
|
*y = it->y + it->item->block->y - gith;
|
|
|
|
break;
|
|
|
|
|
2012-03-19 20:19:13 -07:00
|
|
|
case ELM_GENLIST_ITEM_SCROLLTO_TOP:
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->item->group_item) gith = it->item->group_item->item->h;
|
|
|
|
*y = it->y + it->item->block->y - gith;
|
|
|
|
break;
|
|
|
|
|
2012-03-19 20:19:13 -07:00
|
|
|
case ELM_GENLIST_ITEM_SCROLLTO_MIDDLE:
|
2012-07-16 14:56:30 -07:00
|
|
|
*y = it->y + it->item->block->y - (*h / 2) + (it->item->h / 2);
|
|
|
|
break;
|
|
|
|
|
2012-03-19 20:19:13 -07:00
|
|
|
default:
|
2012-07-16 14:56:30 -07:00
|
|
|
return EINA_FALSE;
|
2012-03-07 00:29:32 -08:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
*x = it->x + it->item->block->x;
|
|
|
|
*w = it->item->block->w;
|
|
|
|
|
2012-03-07 00:29:32 -08:00
|
|
|
return EINA_TRUE;
|
2009-02-10 03:57:47 -08:00
|
|
|
}
|
|
|
|
|
2011-11-25 12:27:27 -08:00
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_promote(Elm_Object_Item *item)
|
2011-11-25 12:27:27 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
|
|
|
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item);
|
|
|
|
|
|
|
|
if (it->generation < GL_IT(it)->wsd->generation) return;
|
|
|
|
_item_move_before
|
|
|
|
(it, (Elm_Gen_Item *)elm_genlist_first_item_get(WIDGET(it)));
|
2011-11-25 12:27:27 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_demote(Elm_Object_Item *item)
|
2011-11-25 12:27:27 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
|
|
|
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item);
|
|
|
|
if (it->generation < GL_IT(it)->wsd->generation) return;
|
|
|
|
_item_move_after(it, (Elm_Gen_Item *)elm_genlist_last_item_get(WIDGET(it)));
|
2011-11-25 12:27:27 -08:00
|
|
|
}
|
|
|
|
|
2009-09-10 02:25:11 -07:00
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_show(Elm_Object_Item *item,
|
|
|
|
Elm_Genlist_Item_Scrollto_Type type)
|
2009-09-10 02:25:11 -07:00
|
|
|
{
|
2012-03-07 00:29:28 -08:00
|
|
|
Evas_Coord x, y, w, h;
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
2012-03-07 00:29:28 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item);
|
|
|
|
|
|
|
|
if (_elm_genlist_item_coordinates_calc
|
|
|
|
(item, type, EINA_FALSE, &x, &y, &w, &h))
|
|
|
|
GL_IT(it)->wsd->s_iface->content_region_show(WIDGET(item), x, y, w, h);
|
2009-09-10 02:25:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_bring_in(Elm_Object_Item *item,
|
|
|
|
Elm_Genlist_Item_Scrollto_Type type)
|
2009-09-10 02:25:11 -07:00
|
|
|
{
|
2012-03-07 00:29:32 -08:00
|
|
|
Evas_Coord x, y, w, h;
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item);
|
|
|
|
|
|
|
|
if (_elm_genlist_item_coordinates_calc
|
|
|
|
(item, type, EINA_TRUE, &x, &y, &w, &h))
|
|
|
|
GL_IT(it)->wsd->s_iface->region_bring_in(WIDGET(item), x, y, w, h);
|
2009-09-10 02:25:11 -07:00
|
|
|
}
|
|
|
|
|
2012-03-05 17:29:42 -08:00
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_all_contents_unset(Elm_Object_Item *it,
|
|
|
|
Eina_List **l)
|
2011-10-23 19:10:35 -07:00
|
|
|
{
|
|
|
|
Evas_Object *content;
|
2012-07-16 14:56:30 -07:00
|
|
|
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
|
|
|
|
EINA_LIST_FREE (((Elm_Gen_Item *)it)->content_objs, content)
|
2010-11-06 00:05:00 -07:00
|
|
|
{
|
2011-10-23 19:10:35 -07:00
|
|
|
elm_widget_sub_object_del(WIDGET(it), content);
|
|
|
|
evas_object_smart_member_del(content);
|
|
|
|
evas_object_hide(content);
|
2012-03-22 02:34:57 -07:00
|
|
|
if (l) *l = eina_list_append(*l, content);
|
2010-11-06 00:05:00 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-02-14 18:53:56 -08:00
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_update(Elm_Object_Item *item)
|
2009-02-14 18:53:56 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
2012-01-19 21:18:31 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item);
|
|
|
|
|
|
|
|
if (!it->item->block) return;
|
|
|
|
if (it->generation < GL_IT(it)->wsd->generation) return;
|
|
|
|
it->item->mincalcd = EINA_FALSE;
|
|
|
|
it->item->updateme = EINA_TRUE;
|
|
|
|
it->item->block->updateme = EINA_TRUE;
|
|
|
|
if (GL_IT(it)->wsd->update_job) ecore_job_del(GL_IT(it)->wsd->update_job);
|
|
|
|
GL_IT(it)->wsd->update_job = ecore_job_add(_update_job, GL_IT(it)->wsd);
|
2009-03-12 22:50:38 -07:00
|
|
|
}
|
|
|
|
|
2011-11-29 06:03:14 -08:00
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_fields_update(Elm_Object_Item *item,
|
|
|
|
const char *parts,
|
2012-03-05 16:49:28 -08:00
|
|
|
Elm_Genlist_Item_Field_Type itf)
|
2011-11-29 06:03:14 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
|
|
|
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item);
|
2012-01-19 21:18:31 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!it->item->block) return;
|
|
|
|
if (it->generation < GL_IT(it)->wsd->generation) return;
|
2011-11-29 06:03:14 -08:00
|
|
|
|
2012-02-28 22:52:05 -08:00
|
|
|
if ((!itf) || (itf & ELM_GENLIST_ITEM_FIELD_TEXT))
|
2012-06-18 02:54:00 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_text_realize(it, VIEW(it), &it->texts, parts);
|
2012-06-18 02:54:00 -07:00
|
|
|
}
|
2011-11-29 06:03:14 -08:00
|
|
|
if ((!itf) || (itf & ELM_GENLIST_ITEM_FIELD_CONTENT))
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
it->content_objs = _item_content_unrealize(it, VIEW(it),
|
|
|
|
&it->contents, parts);
|
|
|
|
it->content_objs = _item_content_realize(it, VIEW(it),
|
|
|
|
&it->contents, parts);
|
|
|
|
|
|
|
|
if (it->flipped)
|
|
|
|
{
|
|
|
|
it->item->flip_content_objs =
|
|
|
|
_item_mode_content_unrealize(it, VIEW(it),
|
|
|
|
&it->item->flip_contents, parts,
|
|
|
|
&it->item->flip_content_objs);
|
|
|
|
it->item->flip_content_objs =
|
|
|
|
_item_mode_content_realize(it, VIEW(it),
|
|
|
|
&it->item->flip_contents, parts,
|
|
|
|
&it->item->flip_content_objs);
|
|
|
|
}
|
|
|
|
if (it->item->deco_it_view)
|
|
|
|
{
|
|
|
|
it->item->deco_it_content_objs =
|
|
|
|
_item_mode_content_unrealize(it, it->item->deco_it_view,
|
|
|
|
&it->item->deco_it_contents, parts,
|
|
|
|
&it->item->deco_it_content_objs);
|
|
|
|
it->item->deco_it_content_objs =
|
|
|
|
_item_mode_content_realize(it, it->item->deco_it_view,
|
|
|
|
&it->item->deco_it_contents, parts,
|
|
|
|
&it->item->deco_it_content_objs);
|
|
|
|
}
|
|
|
|
if (GL_IT(it)->wsd->decorate_all_mode)
|
|
|
|
{
|
|
|
|
it->item->deco_all_content_objs =
|
|
|
|
_item_mode_content_unrealize
|
|
|
|
(it, it->deco_all_view, &it->item->deco_all_contents, parts,
|
|
|
|
&it->item->deco_all_content_objs);
|
|
|
|
it->item->deco_all_content_objs =
|
|
|
|
_item_mode_content_realize(it, it->deco_all_view,
|
|
|
|
&it->item->deco_all_contents, parts,
|
|
|
|
&it->item->deco_all_content_objs);
|
2012-04-06 00:10:20 -07:00
|
|
|
}
|
2011-11-29 06:03:14 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
|
2011-11-29 06:03:14 -08:00
|
|
|
if ((!itf) || (itf & ELM_GENLIST_ITEM_FIELD_STATE))
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_state_realize(it, VIEW(it), &it->states, parts);
|
2011-11-29 06:03:14 -08:00
|
|
|
}
|
|
|
|
|
2010-11-17 09:15:28 -08:00
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_item_class_update(Elm_Object_Item *item,
|
2010-12-07 11:18:14 -08:00
|
|
|
const Elm_Genlist_Item_Class *itc)
|
2010-11-17 09:15:28 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
2012-01-19 21:18:31 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item);
|
|
|
|
|
|
|
|
if (!it->item->block) return;
|
2010-12-03 06:08:33 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(itc);
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->generation < GL_IT(it)->wsd->generation) return;
|
|
|
|
it->itc = itc;
|
|
|
|
it->item->nocache_once = EINA_TRUE;
|
2012-04-06 00:10:29 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_widget_stringlist_free(it->texts);
|
|
|
|
it->texts = NULL;
|
|
|
|
elm_widget_stringlist_free(it->contents);
|
|
|
|
it->contents = NULL;
|
|
|
|
elm_widget_stringlist_free(it->states);
|
|
|
|
it->states = NULL;
|
2012-04-06 00:10:29 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->flipped)
|
2012-04-06 00:10:29 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_widget_stringlist_free(it->item->flip_contents);
|
|
|
|
it->item->flip_contents = NULL;
|
2012-04-06 00:10:29 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->item->deco_it_view)
|
2012-04-06 00:10:29 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_widget_stringlist_free(it->item->deco_it_texts);
|
|
|
|
it->item->deco_it_texts = NULL;
|
|
|
|
elm_widget_stringlist_free(it->item->deco_it_contents);
|
|
|
|
it->item->deco_it_contents = NULL;
|
2012-04-06 00:10:29 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
if (GL_IT(it)->wsd->decorate_all_mode)
|
2012-04-06 00:10:29 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_widget_stringlist_free(it->item->deco_all_texts);
|
|
|
|
it->item->deco_all_texts = NULL;
|
|
|
|
elm_widget_stringlist_free(it->item->deco_all_contents);
|
|
|
|
it->item->deco_all_contents = NULL;
|
2012-04-06 00:10:29 -07:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_update(item);
|
2010-11-17 09:15:28 -08:00
|
|
|
}
|
|
|
|
|
2011-06-25 16:20:22 -07:00
|
|
|
EAPI const Elm_Genlist_Item_Class *
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_item_class_get(const Elm_Object_Item *item)
|
2011-06-25 16:20:22 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
|
|
|
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item, NULL);
|
|
|
|
if (it->generation < GL_IT(it)->wsd->generation) return NULL;
|
|
|
|
|
|
|
|
return it->itc;
|
2011-06-25 16:20:22 -07:00
|
|
|
}
|
|
|
|
|
2010-09-27 11:18:37 -07:00
|
|
|
static Evas_Object *
|
2012-07-16 14:56:30 -07:00
|
|
|
_elm_genlist_item_label_create(void *data,
|
2011-07-26 02:38:23 -07:00
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
Evas_Object *tooltip,
|
2012-07-16 14:56:30 -07:00
|
|
|
void *it __UNUSED__)
|
2010-09-27 11:18:37 -07:00
|
|
|
{
|
2011-07-26 02:38:23 -07:00
|
|
|
Evas_Object *label = elm_label_add(tooltip);
|
2012-07-16 14:56:30 -07:00
|
|
|
|
2010-09-27 11:18:37 -07:00
|
|
|
if (!label)
|
|
|
|
return NULL;
|
2012-07-16 14:56:30 -07:00
|
|
|
|
2010-09-27 11:18:37 -07:00
|
|
|
elm_object_style_set(label, "tooltip");
|
2011-06-28 23:41:31 -07:00
|
|
|
elm_object_text_set(label, data);
|
2012-07-16 14:56:30 -07:00
|
|
|
|
2010-09-27 11:18:37 -07:00
|
|
|
return label;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_elm_genlist_item_label_del_cb(void *data,
|
2010-12-07 11:18:14 -08:00
|
|
|
Evas_Object *obj __UNUSED__,
|
2012-07-16 14:56:30 -07:00
|
|
|
void *event_info __UNUSED__)
|
2010-09-27 11:18:37 -07:00
|
|
|
{
|
|
|
|
eina_stringshare_del(data);
|
|
|
|
}
|
|
|
|
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
EAPI void
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_tooltip_text_set(Elm_Object_Item *it,
|
2012-07-16 14:56:30 -07:00
|
|
|
const char *text)
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
|
2010-09-27 11:18:37 -07:00
|
|
|
text = eina_stringshare_add(text);
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_tooltip_content_cb_set
|
|
|
|
(it, _elm_genlist_item_label_create, text,
|
|
|
|
_elm_genlist_item_label_del_cb);
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_tooltip_content_cb_set(Elm_Object_Item *item,
|
2010-12-07 11:18:14 -08:00
|
|
|
Elm_Tooltip_Item_Content_Cb func,
|
2012-07-16 14:56:30 -07:00
|
|
|
const void *data,
|
|
|
|
Evas_Smart_Cb del_cb)
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
|
|
|
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_GOTO(item, error);
|
2010-09-27 11:18:37 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((it->tooltip.content_cb == func) && (it->tooltip.data == data))
|
2010-09-27 11:18:37 -07:00
|
|
|
return;
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->tooltip.del_cb)
|
|
|
|
it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it);
|
2010-09-27 11:18:37 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
it->tooltip.content_cb = func;
|
|
|
|
it->tooltip.data = data;
|
|
|
|
it->tooltip.del_cb = del_cb;
|
2010-09-27 11:18:37 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (VIEW(it))
|
2010-09-27 11:18:37 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_widget_item_tooltip_content_cb_set
|
|
|
|
(it, it->tooltip.content_cb, it->tooltip.data, NULL);
|
|
|
|
elm_widget_item_tooltip_style_set(it, it->tooltip.style);
|
|
|
|
elm_widget_item_tooltip_window_mode_set(it, it->tooltip.free_size);
|
2010-09-27 11:18:37 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
2010-12-07 11:18:14 -08:00
|
|
|
error:
|
2010-09-27 11:18:37 -07:00
|
|
|
if (del_cb) del_cb((void *)data, NULL, NULL);
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_tooltip_unset(Elm_Object_Item *item)
|
2012-01-19 21:18:31 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
2012-01-19 21:18:31 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item);
|
2012-01-19 21:18:31 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((VIEW(it)) && (it->tooltip.content_cb))
|
|
|
|
elm_widget_item_tooltip_unset(it);
|
|
|
|
|
|
|
|
if (it->tooltip.del_cb)
|
|
|
|
it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it);
|
|
|
|
it->tooltip.del_cb = NULL;
|
|
|
|
it->tooltip.content_cb = NULL;
|
|
|
|
it->tooltip.data = NULL;
|
|
|
|
it->tooltip.free_size = EINA_FALSE;
|
|
|
|
if (it->tooltip.style)
|
|
|
|
elm_genlist_item_tooltip_style_set(item, NULL);
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_tooltip_style_set(Elm_Object_Item *item,
|
|
|
|
const char *style)
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
|
|
|
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item);
|
2012-01-19 21:18:31 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
eina_stringshare_replace(&it->tooltip.style, style);
|
|
|
|
if (VIEW(it)) elm_widget_item_tooltip_style_set(it, style);
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI const char *
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_tooltip_style_get(const Elm_Object_Item *it)
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
return elm_object_item_tooltip_style_get(it);
|
Tooltips: split owner/eventarea, allow subitems to have indepentent tooltips.
Now owner widget (elm_widget) is just used to listen for theme changes
and create/destroy the tooltip data. The actual mouse events operates
on all Evas_Object and is the one where tooltip data is actually
stored.
The public API is basically the same, just the event_info is now NULL
to avoid confusion.
The internal API introduces elm_object_sub_tooltip_content_cb_set()
and as the first parameter the eventarea. While this may be confusing,
as the second parameter is the actual elementary object, it is the one
that all other calls receive, like elm_object_tooltip_hide() or
elm_object_tooltip_unset(), thus it does make sense to have such order.
Also internal API, elm_widget_item_tooltip_* functions were
added. They are a variation of the widget API to handle its items, as
such the func() gets one more parameter: item, and the del_cb() gets
the item as event_info (that's why the public widget version got
event_info always NULL, to not confuse with this one!)
Widgets with items that makes sense to have tooltips got extra API:
* toolbar
* list
* gengrid
* genlist
SVN revision: 52173
2010-09-12 14:05:13 -07:00
|
|
|
}
|
|
|
|
|
2011-07-26 02:38:23 -07:00
|
|
|
EAPI Eina_Bool
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_tooltip_window_mode_set(Elm_Object_Item *item,
|
|
|
|
Eina_Bool disable)
|
2011-07-26 02:38:23 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
|
|
|
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item, EINA_FALSE);
|
|
|
|
|
|
|
|
it->tooltip.free_size = disable;
|
|
|
|
if (VIEW(it)) return elm_widget_item_tooltip_window_mode_set(it, disable);
|
2012-01-19 21:18:31 -08:00
|
|
|
|
2011-07-27 19:22:37 -07:00
|
|
|
return EINA_TRUE;
|
2011-07-26 02:38:23 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_tooltip_window_mode_get(const Elm_Object_Item *it)
|
2011-07-26 02:38:23 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
return elm_object_tooltip_window_mode_get(VIEW(it));
|
2011-07-26 02:38:23 -07:00
|
|
|
}
|
|
|
|
|
2010-09-17 11:24:10 -07:00
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_cursor_set(Elm_Object_Item *item,
|
|
|
|
const char *cursor)
|
2010-09-17 11:24:10 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
|
|
|
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item);
|
|
|
|
eina_stringshare_replace(&it->mouse_cursor, cursor);
|
|
|
|
if (VIEW(it)) elm_widget_item_cursor_set(it, cursor);
|
2010-09-17 11:24:10 -07:00
|
|
|
}
|
|
|
|
|
2010-11-04 17:46:54 -07:00
|
|
|
EAPI const char *
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_cursor_get(const Elm_Object_Item *it)
|
2010-11-04 17:46:54 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
return elm_widget_item_cursor_get(it);
|
2010-11-04 17:46:54 -07:00
|
|
|
}
|
|
|
|
|
2010-09-17 11:24:10 -07:00
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_cursor_unset(Elm_Object_Item *item)
|
2010-09-17 11:24:10 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
|
|
|
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item);
|
2012-01-19 21:18:31 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!it->mouse_cursor) return;
|
2010-09-27 11:18:37 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (VIEW(it)) elm_widget_item_cursor_unset(it);
|
2010-09-27 11:18:37 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
eina_stringshare_del(it->mouse_cursor);
|
|
|
|
it->mouse_cursor = NULL;
|
2010-09-17 11:24:10 -07:00
|
|
|
}
|
|
|
|
|
2010-09-25 15:01:19 -07:00
|
|
|
EAPI void
|
2012-04-25 06:31:37 -07:00
|
|
|
elm_genlist_item_cursor_style_set(Elm_Object_Item *it,
|
2012-07-16 14:56:30 -07:00
|
|
|
const char *style)
|
2010-09-25 15:01:19 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_widget_item_cursor_style_set(it, style);
|
2010-09-25 15:01:19 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI const char *
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_cursor_style_get(const Elm_Object_Item *it)
|
2010-09-25 15:01:19 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
return elm_widget_item_cursor_style_get(it);
|
2010-09-25 15:01:19 -07:00
|
|
|
}
|
|
|
|
|
2010-09-25 15:03:37 -07:00
|
|
|
EAPI void
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_cursor_engine_only_set(Elm_Object_Item *it,
|
2012-07-16 14:56:30 -07:00
|
|
|
Eina_Bool engine_only)
|
2010-09-25 15:03:37 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_widget_item_cursor_engine_only_set(it, engine_only);
|
2010-09-25 15:03:37 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_cursor_engine_only_get(const Elm_Object_Item *it)
|
2010-09-25 15:03:37 -07:00
|
|
|
{
|
2011-10-20 14:41:24 -07:00
|
|
|
return elm_widget_item_cursor_engine_only_get(it);
|
2010-09-25 15:03:37 -07:00
|
|
|
}
|
|
|
|
|
2011-12-26 06:30:21 -08:00
|
|
|
EAPI int
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_index_get(const Elm_Object_Item *item)
|
2011-12-26 06:30:21 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
2012-01-19 21:18:31 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item, -1);
|
|
|
|
|
|
|
|
if (it->item->block)
|
|
|
|
return it->position + (it->item->block->position *
|
|
|
|
GL_IT(it)->wsd->max_items_per_block);
|
2011-12-26 06:30:21 -08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2009-03-12 22:50:38 -07:00
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_mode_set(Evas_Object *obj,
|
2012-02-24 00:53:01 -08:00
|
|
|
Elm_List_Mode mode)
|
2009-03-12 22:50:38 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj);
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
2009-04-23 01:51:07 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->mode == mode) return;
|
|
|
|
sd->mode = mode;
|
|
|
|
elm_layout_sizing_eval(obj);
|
|
|
|
}
|
2011-08-04 18:21:56 -07:00
|
|
|
|
2010-04-06 07:01:04 -07:00
|
|
|
EAPI Elm_List_Mode
|
2012-01-24 07:15:43 -08:00
|
|
|
elm_genlist_mode_get(const Evas_Object *obj)
|
2010-04-06 07:01:04 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj) ELM_LIST_LAST;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
return sd->mode;
|
2010-04-06 07:01:04 -07:00
|
|
|
}
|
|
|
|
|
2009-12-11 00:12:58 -08:00
|
|
|
EAPI void
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_genlist_bounce_set(Evas_Object *obj,
|
2012-07-16 14:56:30 -07:00
|
|
|
Eina_Bool h_bounce,
|
|
|
|
Eina_Bool v_bounce)
|
2009-12-11 00:12:58 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj);
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
sd->h_bounce = !!h_bounce;
|
|
|
|
sd->v_bounce = !!v_bounce;
|
|
|
|
sd->s_iface->bounce_allow_set(obj, sd->h_bounce, sd->v_bounce);
|
2009-12-11 00:12:58 -08:00
|
|
|
}
|
2010-01-23 01:07:20 -08:00
|
|
|
|
2010-04-06 07:01:04 -07:00
|
|
|
EAPI void
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_genlist_bounce_get(const Evas_Object *obj,
|
2012-07-16 14:56:30 -07:00
|
|
|
Eina_Bool *h_bounce,
|
|
|
|
Eina_Bool *v_bounce)
|
2010-04-06 07:01:04 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj);
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if (h_bounce) *h_bounce = sd->h_bounce;
|
|
|
|
if (v_bounce) *v_bounce = sd->v_bounce;
|
2010-04-06 07:01:04 -07:00
|
|
|
}
|
|
|
|
|
2010-01-23 01:07:20 -08:00
|
|
|
EAPI void
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_genlist_homogeneous_set(Evas_Object *obj,
|
2012-07-16 14:56:30 -07:00
|
|
|
Eina_Bool homogeneous)
|
2010-01-23 01:07:20 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj);
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
sd->homogeneous = !!homogeneous;
|
2010-01-23 01:07:20 -08:00
|
|
|
}
|
|
|
|
|
2010-04-06 07:01:04 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_genlist_homogeneous_get(const Evas_Object *obj)
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj) EINA_FALSE;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
return sd->homogeneous;
|
2010-04-06 07:01:04 -07:00
|
|
|
}
|
|
|
|
|
2010-01-23 01:07:20 -08:00
|
|
|
EAPI void
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_genlist_block_count_set(Evas_Object *obj,
|
2012-07-16 14:56:30 -07:00
|
|
|
int count)
|
2010-01-23 01:07:20 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj);
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
2012-05-29 21:57:29 -07:00
|
|
|
EINA_SAFETY_ON_TRUE_RETURN(count < 1);
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->max_items_per_block = count;
|
|
|
|
sd->item_cache_max = sd->max_items_per_block * 2;
|
|
|
|
_item_cache_clean(sd);
|
2010-01-23 01:07:20 -08:00
|
|
|
}
|
|
|
|
|
2010-04-06 07:01:04 -07:00
|
|
|
EAPI int
|
|
|
|
elm_genlist_block_count_get(const Evas_Object *obj)
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj) 0;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
return sd->max_items_per_block;
|
2010-04-06 07:01:04 -07:00
|
|
|
}
|
2010-07-27 16:36:27 -07:00
|
|
|
|
|
|
|
EAPI void
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_genlist_longpress_timeout_set(Evas_Object *obj,
|
2012-07-16 14:56:30 -07:00
|
|
|
double timeout)
|
2010-07-27 16:36:27 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj);
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
sd->longpress_timeout = timeout;
|
2010-07-27 16:36:27 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI double
|
|
|
|
elm_genlist_longpress_timeout_get(const Evas_Object *obj)
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj) 0;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
return sd->longpress_timeout;
|
2010-07-27 16:36:27 -07:00
|
|
|
}
|
2010-11-22 07:24:58 -08:00
|
|
|
|
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_scroller_policy_set(Evas_Object *obj,
|
2010-12-07 11:18:14 -08:00
|
|
|
Elm_Scroller_Policy policy_h,
|
|
|
|
Elm_Scroller_Policy policy_v)
|
2010-11-22 07:24:58 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj);
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
2010-11-22 07:24:58 -08:00
|
|
|
if ((policy_h >= ELM_SCROLLER_POLICY_LAST) ||
|
|
|
|
(policy_v >= ELM_SCROLLER_POLICY_LAST))
|
|
|
|
return;
|
2012-07-16 14:56:30 -07:00
|
|
|
|
|
|
|
sd->s_iface->policy_set(obj, policy_h, policy_v);
|
2010-11-22 07:24:58 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_scroller_policy_get(const Evas_Object *obj,
|
2010-12-07 11:18:14 -08:00
|
|
|
Elm_Scroller_Policy *policy_h,
|
|
|
|
Elm_Scroller_Policy *policy_v)
|
2010-11-22 07:24:58 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Scroller_Policy s_policy_h, s_policy_v;
|
|
|
|
|
|
|
|
ELM_GENLIST_CHECK(obj);
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
sd->s_iface->policy_get(obj, &s_policy_h, &s_policy_v);
|
2010-12-07 11:18:14 -08:00
|
|
|
if (policy_h) *policy_h = (Elm_Scroller_Policy)s_policy_h;
|
|
|
|
if (policy_v) *policy_v = (Elm_Scroller_Policy)s_policy_v;
|
2010-11-22 07:24:58 -08:00
|
|
|
}
|
2011-03-22 00:54:24 -07:00
|
|
|
|
2011-04-06 21:35:08 -07:00
|
|
|
EAPI void
|
2011-04-07 09:16:01 -07:00
|
|
|
elm_genlist_realized_items_update(Evas_Object *obj)
|
2011-04-06 21:35:08 -07:00
|
|
|
{
|
|
|
|
Eina_List *list, *l;
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Object_Item *it;
|
2011-04-06 21:35:08 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj);
|
|
|
|
|
2011-04-06 21:35:08 -07:00
|
|
|
list = elm_genlist_realized_items_get(obj);
|
2012-07-16 14:56:30 -07:00
|
|
|
EINA_LIST_FOREACH (list, l, it)
|
2011-04-06 21:35:08 -07:00
|
|
|
elm_genlist_item_update(it);
|
|
|
|
}
|
2011-04-21 04:47:36 -07:00
|
|
|
|
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_decorate_mode_set(Elm_Object_Item *item,
|
|
|
|
const char *decorate_it_type,
|
|
|
|
Eina_Bool decorate_it_set)
|
2011-04-21 04:47:36 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
|
|
|
Elm_Genlist_Smart_Data *sd;
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Object_Item *it2;
|
2012-07-16 14:56:30 -07:00
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item);
|
|
|
|
sd = GL_IT(it)->wsd;
|
2011-04-21 04:47:36 -07:00
|
|
|
|
2012-04-03 02:56:53 -07:00
|
|
|
if (!decorate_it_type) return;
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((it->generation < sd->generation) ||
|
|
|
|
elm_widget_item_disabled_get(it)) return;
|
|
|
|
if (sd->decorate_all_mode) return;
|
2011-04-21 04:47:36 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if ((sd->mode_item == it) &&
|
|
|
|
(!strcmp(decorate_it_type, sd->decorate_it_type)) &&
|
2012-04-03 02:56:53 -07:00
|
|
|
(decorate_it_set))
|
2012-07-16 14:56:30 -07:00
|
|
|
return;
|
|
|
|
if (!it->itc->decorate_item_style) return;
|
|
|
|
it->decorate_it_set = decorate_it_set;
|
2011-04-21 04:47:36 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->multi)
|
2011-04-21 04:47:36 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
EINA_LIST_FOREACH (sd->selected, l, it2)
|
2012-03-05 07:14:36 -08:00
|
|
|
if (((Elm_Gen_Item *)it2)->realized)
|
2011-11-29 16:59:19 -08:00
|
|
|
elm_genlist_item_selected_set(it2, EINA_FALSE);
|
2011-04-21 04:47:36 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
it2 = elm_genlist_selected_item_get(ELM_WIDGET_DATA(sd)->obj);
|
2012-03-05 07:14:36 -08:00
|
|
|
if ((it2) && (((Elm_Gen_Item *)it2)->realized))
|
2011-11-29 16:59:19 -08:00
|
|
|
elm_genlist_item_selected_set(it2, EINA_FALSE);
|
2011-04-21 04:47:36 -07:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (((sd->decorate_it_type)
|
|
|
|
&& (strcmp(decorate_it_type, sd->decorate_it_type))) ||
|
|
|
|
(decorate_it_set) || ((it == sd->mode_item) && (!decorate_it_set)))
|
|
|
|
_decorate_item_unset(sd);
|
2011-04-21 04:47:36 -07:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
eina_stringshare_replace(&sd->decorate_it_type, decorate_it_type);
|
|
|
|
if (decorate_it_set) _decorate_item_set(it);
|
2011-04-21 04:47:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI const char *
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_item_decorate_mode_get(const Elm_Object_Item *item)
|
2011-04-21 04:47:36 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *i = (Elm_Gen_Item *)item;
|
|
|
|
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item, NULL);
|
|
|
|
return GL_IT(i)->wsd->decorate_it_type;
|
2011-04-21 04:47:36 -07:00
|
|
|
}
|
|
|
|
|
2012-06-16 03:12:15 -07:00
|
|
|
EAPI Elm_Object_Item *
|
2012-03-07 08:19:25 -08:00
|
|
|
elm_genlist_decorated_item_get(const Evas_Object *obj)
|
2011-04-21 04:47:36 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj) NULL;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
return (Elm_Object_Item *)sd->mode_item;
|
2011-04-21 04:47:36 -07:00
|
|
|
}
|
2011-06-01 20:10:11 -07:00
|
|
|
|
2012-02-22 23:39:10 -08:00
|
|
|
EAPI Eina_Bool
|
2012-03-07 08:56:21 -08:00
|
|
|
elm_genlist_decorate_mode_get(const Evas_Object *obj)
|
2012-02-22 23:39:10 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj) EINA_FALSE;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
2012-02-22 23:39:10 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
return sd->decorate_all_mode;
|
2012-02-22 23:39:10 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_decorate_mode_set(Evas_Object *obj,
|
|
|
|
Eina_Bool decorated)
|
2012-02-22 23:39:10 -08:00
|
|
|
{
|
|
|
|
Elm_Gen_Item *it;
|
2012-07-16 14:56:30 -07:00
|
|
|
Eina_List *list, *l;
|
2012-06-15 00:58:08 -07:00
|
|
|
Elm_Object_Item *deco_it;
|
2012-02-22 23:39:10 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj);
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
2012-03-07 08:56:21 -08:00
|
|
|
decorated = !!decorated;
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->decorate_all_mode == decorated) return;
|
|
|
|
sd->decorate_all_mode = decorated;
|
2012-02-22 23:39:10 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->tree_effect_animator)
|
2012-06-21 03:56:15 -07:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ecore_animator_del(sd->tree_effect_animator);
|
|
|
|
sd->tree_effect_animator = NULL;
|
2012-06-21 03:56:15 -07:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->move_effect_mode = ELM_GENLIST_TREE_EFFECT_NONE;
|
2012-06-21 03:56:15 -07:00
|
|
|
|
2012-02-22 23:39:10 -08:00
|
|
|
list = elm_genlist_realized_items_get(obj);
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!sd->decorate_all_mode)
|
2012-01-14 14:28:45 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
EINA_LIST_FOREACH (list, l, it)
|
|
|
|
{
|
|
|
|
if (it->item->type != ELM_GENLIST_ITEM_GROUP)
|
|
|
|
_decorate_all_item_unrealize(it);
|
|
|
|
}
|
|
|
|
_item_cache_zero(sd);
|
2012-01-14 14:28:45 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// unset decorated item
|
|
|
|
deco_it = (Elm_Object_Item *)elm_genlist_decorated_item_get(obj);
|
|
|
|
if (deco_it)
|
|
|
|
{
|
|
|
|
elm_genlist_item_decorate_mode_set
|
|
|
|
(deco_it, elm_genlist_item_decorate_mode_get
|
|
|
|
(deco_it), EINA_FALSE);
|
|
|
|
_decorate_item_finished_signal_cb(deco_it, obj, NULL, NULL);
|
|
|
|
}
|
2012-01-26 02:01:48 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EINA_LIST_FOREACH (list, l, it)
|
|
|
|
{
|
|
|
|
if (it->item->type != ELM_GENLIST_ITEM_GROUP)
|
|
|
|
{
|
|
|
|
if (it->itc->decorate_all_item_style)
|
|
|
|
_decorate_all_item_realize(it, EINA_TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (sd->calc_job) ecore_job_del(sd->calc_job);
|
|
|
|
sd->calc_job = ecore_job_add(_calc_job, sd);
|
2011-11-30 09:31:01 -08:00
|
|
|
}
|
2012-03-07 04:15:36 -08:00
|
|
|
|
|
|
|
EAPI void
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_reorder_mode_set(Evas_Object *obj,
|
|
|
|
Eina_Bool reorder_mode)
|
2012-03-07 04:15:36 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj);
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
sd->reorder_mode = !!reorder_mode;
|
2012-03-07 04:15:36 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
2012-07-16 14:56:30 -07:00
|
|
|
elm_genlist_reorder_mode_get(const Evas_Object *obj)
|
2012-03-07 04:15:36 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_CHECK(obj) EINA_FALSE;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
return sd->reorder_mode;
|
2012-03-07 04:15:36 -08:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EAPI Elm_Genlist_Item_Type
|
|
|
|
elm_genlist_item_type_get(const Elm_Object_Item *item)
|
2012-03-07 04:15:36 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item, ELM_GENLIST_ITEM_MAX);
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
return it->item->type;
|
2012-03-07 04:15:36 -08:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EAPI Elm_Genlist_Item_Class *
|
|
|
|
elm_genlist_item_class_new(void)
|
2012-03-07 04:15:36 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Genlist_Item_Class *itc;
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
itc = calloc(1, sizeof(Elm_Genlist_Item_Class));
|
|
|
|
if (!itc)
|
|
|
|
return NULL;
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
itc->version = CLASS_ALLOCATED;
|
|
|
|
itc->refcount = 1;
|
|
|
|
itc->delete_me = EINA_FALSE;
|
|
|
|
|
|
|
|
return itc;
|
2012-03-07 04:15:36 -08:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EAPI void
|
|
|
|
elm_genlist_item_class_free(Elm_Genlist_Item_Class *itc)
|
2012-03-07 04:15:36 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (itc && (itc->version == CLASS_ALLOCATED))
|
2012-03-07 04:15:36 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (!itc->delete_me) itc->delete_me = EINA_TRUE;
|
|
|
|
if (itc->refcount > 0) elm_genlist_item_class_unref(itc);
|
|
|
|
else
|
2012-03-07 04:15:36 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
itc->version = 0;
|
|
|
|
free(itc);
|
2012-03-07 04:15:36 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EAPI void
|
|
|
|
elm_genlist_item_class_ref(Elm_Genlist_Item_Class *itc)
|
2012-03-07 04:15:36 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (itc && (itc->version == CLASS_ALLOCATED))
|
2012-03-07 04:15:36 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
itc->refcount++;
|
|
|
|
if (itc->refcount == 0) itc->refcount--;
|
2012-03-07 04:15:36 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_genlist_item_class_unref(Elm_Genlist_Item_Class *itc)
|
|
|
|
{
|
|
|
|
if (itc && (itc->version == CLASS_ALLOCATED))
|
2012-03-07 04:15:36 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (itc->refcount > 0) itc->refcount--;
|
|
|
|
if (itc->delete_me && (!itc->refcount))
|
|
|
|
elm_genlist_item_class_free(itc);
|
2012-03-07 04:15:36 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-07-16 14:56:30 -07:00
|
|
|
_flip_job(void *data)
|
2012-03-07 04:15:36 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)data;
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
_item_unhighlight(it);
|
|
|
|
_item_unselect(it);
|
|
|
|
_elm_genlist_item_unrealize(it, EINA_FALSE);
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
it->flipped = EINA_TRUE;
|
|
|
|
it->item->nocache = EINA_TRUE;
|
|
|
|
if (GL_IT(it)->wsd->calc_job) ecore_job_del(GL_IT(it)->wsd->calc_job);
|
|
|
|
GL_IT(it)->wsd->calc_job = ecore_job_add(_calc_job, GL_IT(it)->wsd);
|
2012-03-07 04:15:36 -08:00
|
|
|
}
|
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EAPI void
|
|
|
|
elm_genlist_item_flip_set(Elm_Object_Item *item,
|
|
|
|
Eina_Bool flip)
|
2012-03-07 04:15:36 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item);
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
flip = !!flip;
|
|
|
|
if (it->flipped == flip) return;
|
|
|
|
|
|
|
|
if (flip)
|
2012-03-07 04:15:36 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
ecore_job_add(_flip_job, it);
|
2012-03-07 04:15:36 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
else
|
2012-03-07 04:15:36 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
it->flipped = flip;
|
|
|
|
_item_cache_zero(GL_IT(it)->wsd);
|
|
|
|
elm_genlist_item_update(item);
|
|
|
|
it->item->nocache = EINA_FALSE;
|
|
|
|
}
|
|
|
|
}
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_genlist_item_flip_get(const Elm_Object_Item *item)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item, EINA_FALSE);
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
return it->flipped;
|
|
|
|
}
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EAPI void
|
|
|
|
elm_genlist_select_mode_set(Evas_Object *obj,
|
|
|
|
Elm_Object_Select_Mode mode)
|
|
|
|
{
|
|
|
|
ELM_GENLIST_CHECK(obj);
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (mode >= ELM_OBJECT_SELECT_MODE_MAX)
|
|
|
|
return;
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
if (sd->select_mode != mode)
|
|
|
|
sd->select_mode = mode;
|
|
|
|
}
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EAPI Elm_Object_Select_Mode
|
|
|
|
elm_genlist_select_mode_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_GENLIST_CHECK(obj) ELM_OBJECT_SELECT_MODE_MAX;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
return sd->select_mode;
|
|
|
|
}
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EAPI void
|
|
|
|
elm_genlist_highlight_mode_set(Evas_Object *obj,
|
|
|
|
Eina_Bool highlight)
|
|
|
|
{
|
|
|
|
ELM_GENLIST_CHECK(obj);
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
sd->highlight = !!highlight;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_genlist_highlight_mode_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_GENLIST_CHECK(obj) EINA_FALSE;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
return sd->highlight;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_genlist_item_select_mode_set(Elm_Object_Item *item,
|
|
|
|
Elm_Object_Select_Mode mode)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
|
|
|
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item);
|
|
|
|
if (!it) return;
|
|
|
|
if (it->generation < GL_IT(it)->wsd->generation) return;
|
|
|
|
if (mode >= ELM_OBJECT_SELECT_MODE_MAX)
|
|
|
|
return;
|
|
|
|
if (it->select_mode != mode)
|
|
|
|
it->select_mode = mode;
|
|
|
|
|
|
|
|
if (it->select_mode == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY)
|
|
|
|
{
|
|
|
|
it->item->mincalcd = EINA_FALSE;
|
|
|
|
it->item->updateme = EINA_TRUE;
|
|
|
|
if (it->item->block) it->item->block->updateme = EINA_TRUE;
|
|
|
|
if (GL_IT(it)->wsd->update_job)
|
|
|
|
ecore_job_del(GL_IT(it)->wsd->update_job);
|
|
|
|
GL_IT(it)->wsd->update_job =
|
|
|
|
ecore_job_add(_update_job, GL_IT(it)->wsd);
|
|
|
|
|
|
|
|
// reset homogeneous item size
|
|
|
|
if (GL_IT(it)->wsd->homogeneous)
|
2012-03-07 04:15:36 -08:00
|
|
|
{
|
2012-07-16 14:56:30 -07:00
|
|
|
if (it->group)
|
|
|
|
GL_IT(it)->wsd->group_item_width =
|
|
|
|
GL_IT(it)->wsd->group_item_height = 0;
|
|
|
|
else
|
|
|
|
GL_IT(it)->wsd->item_width = GL_IT(it)->wsd->item_height = 0;
|
2012-03-07 04:15:36 -08:00
|
|
|
}
|
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
}
|
2012-03-07 04:15:36 -08:00
|
|
|
|
2012-07-16 14:56:30 -07:00
|
|
|
EAPI Elm_Object_Select_Mode
|
|
|
|
elm_genlist_item_select_mode_get(const Elm_Object_Item *item)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it = (Elm_Gen_Item *)item;
|
|
|
|
|
|
|
|
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item, ELM_OBJECT_SELECT_MODE_MAX);
|
|
|
|
|
|
|
|
if (!it) return ELM_OBJECT_SELECT_MODE_MAX;
|
|
|
|
|
|
|
|
return it->select_mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_genlist_tree_effect_enabled_set(Evas_Object *obj,
|
|
|
|
Eina_Bool enabled)
|
|
|
|
{
|
|
|
|
ELM_GENLIST_CHECK(obj);
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
sd->tree_effect_enabled = !!enabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_genlist_tree_effect_enabled_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_GENLIST_CHECK(obj) EINA_FALSE;
|
|
|
|
ELM_GENLIST_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
return sd->tree_effect_enabled;
|
2012-03-07 04:15:36 -08:00
|
|
|
}
|
2012-07-16 14:56:30 -07:00
|
|
|
|