2011-04-22 06:20:06 -07:00
|
|
|
#include <assert.h>
|
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"
|
2011-10-06 22:56:07 -07:00
|
|
|
#include "els_scroller.h"
|
2011-12-29 22:49:28 -08:00
|
|
|
#include "elm_gen_common.h"
|
2009-02-09 03:23:59 -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
|
|
|
|
2011-10-21 15:55:45 -07:00
|
|
|
#define ELM_GEN_SETUP(wd) \
|
|
|
|
(wd)->calc_cb = (Ecore_Cb)_calc_job; \
|
|
|
|
(wd)->clear_cb = (Ecore_Cb)_clear_cb; \
|
|
|
|
(wd)->sizing_cb = (Ecore_Cb)_sizing_eval
|
|
|
|
|
|
|
|
#define ELM_GEN_ITEM_SETUP(it) \
|
|
|
|
(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
|
|
|
|
|
2010-12-07 11:18:14 -08:00
|
|
|
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
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it;
|
2011-10-20 15:23:29 -07:00
|
|
|
Item_Block *block;
|
|
|
|
Eina_List *items;
|
2011-10-21 01:52:03 -07:00
|
|
|
Evas_Coord w, h, minw, minh;
|
|
|
|
Elm_Gen_Item *group_item;
|
2011-10-20 15:23:29 -07:00
|
|
|
Elm_Genlist_Item_Flags flags;
|
2011-12-14 08:36:09 -08:00
|
|
|
Eina_List *mode_texts, *mode_contents, *mode_states, *mode_content_objs;
|
2012-02-22 23:39:10 -08:00
|
|
|
Eina_List *edit_texts, *edit_contents, *edit_states, *edit_content_objs;
|
2011-10-20 15:23:29 -07:00
|
|
|
Ecore_Timer *swipe_timer;
|
|
|
|
Evas_Coord scrl_x, scrl_y, old_scrl_y;
|
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *rel;
|
2011-10-20 15:23:29 -07:00
|
|
|
Evas_Object *mode_view;
|
|
|
|
int expanded_depth;
|
|
|
|
int order_num_in;
|
|
|
|
|
|
|
|
Eina_Bool before : 1;
|
|
|
|
|
|
|
|
Eina_Bool want_realize : 1;
|
|
|
|
Eina_Bool expanded : 1;
|
|
|
|
Eina_Bool mincalcd : 1;
|
|
|
|
Eina_Bool queued : 1;
|
|
|
|
Eina_Bool showme : 1;
|
|
|
|
Eina_Bool updateme : 1;
|
|
|
|
Eina_Bool nocache : 1;
|
|
|
|
Eina_Bool stacking_even : 1;
|
|
|
|
Eina_Bool nostacking : 1;
|
|
|
|
Eina_Bool move_effect_enabled : 1;
|
2012-02-22 23:39:10 -08:00
|
|
|
Eina_Bool edit_mode_item_realized : 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;
|
2010-12-07 11:18:14 -08:00
|
|
|
int count;
|
|
|
|
int num;
|
2011-06-01 20:10:11 -07:00
|
|
|
int reorder_offset;
|
2009-02-11 03:49:43 -08:00
|
|
|
Widget_Data *wd;
|
2010-12-07 11:18:14 -08:00
|
|
|
Eina_List *items;
|
|
|
|
Evas_Coord x, y, w, h, minw, minh;
|
2011-12-26 06:30:21 -08:00
|
|
|
int position;
|
|
|
|
int item_position_stamp;
|
|
|
|
|
|
|
|
Eina_Bool position_update : 1;
|
2010-12-07 11:18:14 -08:00
|
|
|
Eina_Bool want_unrealize : 1;
|
|
|
|
Eina_Bool realized : 1;
|
|
|
|
Eina_Bool changed : 1;
|
|
|
|
Eina_Bool updateme : 1;
|
|
|
|
Eina_Bool showme : 1;
|
|
|
|
Eina_Bool must_recalc : 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
|
2011-10-21 01:52:03 -07:00
|
|
|
Eina_Bool tree : 1; // it->group
|
2010-12-07 11:18:14 -08:00
|
|
|
Eina_Bool compress : 1; // it->wd->compress
|
|
|
|
|
|
|
|
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
|
2010-11-05 23:02:22 -07:00
|
|
|
};
|
|
|
|
|
2010-03-08 22:15:39 -08:00
|
|
|
static const char *widtype = NULL;
|
2010-12-07 11:18:14 -08:00
|
|
|
static void _item_cache_zero(Widget_Data *wd);
|
|
|
|
static void _del_hook(Evas_Object *obj);
|
2011-03-22 00:54:24 -07:00
|
|
|
static void _mirrored_set(Evas_Object *obj,
|
|
|
|
Eina_Bool rtl);
|
2010-12-07 11:18:14 -08:00
|
|
|
static void _theme_hook(Evas_Object *obj);
|
2011-03-22 00:54:24 -07:00
|
|
|
static void _show_region_hook(void *data,
|
|
|
|
Evas_Object *obj);
|
2010-12-07 11:18:14 -08:00
|
|
|
static void _sizing_eval(Evas_Object *obj);
|
2011-10-21 01:52:03 -07:00
|
|
|
static void _item_realize(Elm_Gen_Item *it,
|
2011-12-25 21:15:21 -08:00
|
|
|
int in,
|
|
|
|
Eina_Bool calc);
|
2011-10-21 01:52:03 -07:00
|
|
|
static void _item_unrealize_cb(Elm_Gen_Item *it);
|
2010-12-07 11:18:14 -08:00
|
|
|
static void _item_block_unrealize(Item_Block *itb);
|
|
|
|
static void _calc_job(void *data);
|
|
|
|
static void _on_focus_hook(void *data,
|
|
|
|
Evas_Object *obj);
|
2010-10-05 12:09:55 -07:00
|
|
|
static Eina_Bool _item_multi_select_up(Widget_Data *wd);
|
|
|
|
static Eina_Bool _item_multi_select_down(Widget_Data *wd);
|
|
|
|
static Eina_Bool _item_single_select_up(Widget_Data *wd);
|
|
|
|
static Eina_Bool _item_single_select_down(Widget_Data *wd);
|
2010-12-07 11:18:14 -08:00
|
|
|
static Eina_Bool _event_hook(Evas_Object *obj,
|
|
|
|
Evas_Object *src,
|
|
|
|
Evas_Callback_Type type,
|
|
|
|
void *event_info);
|
2011-04-06 17:58:29 -07:00
|
|
|
static void _signal_emit_hook(Evas_Object *obj,
|
2011-12-25 21:15:21 -08:00
|
|
|
const char *emission,
|
|
|
|
const char *source);
|
2010-10-27 07:38:54 -07:00
|
|
|
static Eina_Bool _deselect_all_items(Widget_Data *wd);
|
2010-12-07 11:18:14 -08:00
|
|
|
static void _pan_calculate(Evas_Object *obj);
|
2011-09-22 05:39:49 -07:00
|
|
|
static void _pan_max_get(Evas_Object *obj,
|
|
|
|
Evas_Coord *x,
|
|
|
|
Evas_Coord *y);
|
2011-10-21 01:52:03 -07:00
|
|
|
static void _item_position(Elm_Gen_Item *it,
|
2011-12-25 21:15:21 -08:00
|
|
|
Evas_Object *obj,
|
|
|
|
Evas_Coord it_x,
|
|
|
|
Evas_Coord it_y);
|
2011-10-21 01:52:03 -07:00
|
|
|
static void _mode_item_realize(Elm_Gen_Item *it);
|
|
|
|
static void _mode_item_unrealize(Elm_Gen_Item *it);
|
|
|
|
static void _item_mode_set(Elm_Gen_Item *it);
|
2011-04-21 04:47:36 -07:00
|
|
|
static void _item_mode_unset(Widget_Data *wd);
|
2012-02-22 23:39:10 -08:00
|
|
|
static void _edit_mode_item_position(Elm_Gen_Item *it, int itx, int ity);
|
|
|
|
static void _edit_mode_item_realize(Elm_Gen_Item *it, Eina_Bool effect_on);
|
|
|
|
static void _edit_mode_item_unrealize(Elm_Gen_Item *it);
|
2011-06-01 20:10:11 -07:00
|
|
|
static void _group_items_recalc(void *data);
|
2011-10-21 01:52:03 -07:00
|
|
|
static void _item_move_after(Elm_Gen_Item *it,
|
|
|
|
Elm_Gen_Item *after);
|
|
|
|
static void _item_move_before(Elm_Gen_Item *it,
|
|
|
|
Elm_Gen_Item *before);
|
2011-06-14 02:18:54 -07:00
|
|
|
static void _item_auto_scroll(Widget_Data *wd);
|
2011-12-25 21:15:21 -08:00
|
|
|
static void _elm_genlist_clear(Evas_Object *obj,
|
|
|
|
Eina_Bool standby);
|
2011-12-23 20:20:18 -08:00
|
|
|
static void _pan_child_size_get(Evas_Object *obj,
|
|
|
|
Evas_Coord *w,
|
|
|
|
Evas_Coord *h);
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2010-03-09 22:46:28 -08:00
|
|
|
static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_VERSION;
|
2009-02-11 03:49:43 -08: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";
|
2011-12-26 06:30:21 -08:00
|
|
|
static const char SIG_INDEX_UPDATE[] = "index,update";
|
2011-05-06 17:30:39 -07:00
|
|
|
|
|
|
|
static const Evas_Smart_Cb_Description _signals[] = {
|
|
|
|
{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, ""},
|
2011-05-06 17:30:39 -07:00
|
|
|
{NULL, NULL}
|
|
|
|
};
|
|
|
|
|
2012-01-23 05:26:45 -08:00
|
|
|
/* TEMPORARY */
|
|
|
|
#undef ELM_CHECK_WIDTYPE
|
|
|
|
#define ELM_CHECK_WIDTYPE(obj, widtype) \
|
|
|
|
if ((!obj) || (!elm_genlist_type_check((obj), __func__))) return
|
|
|
|
#undef ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN
|
|
|
|
#define ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, ...) \
|
|
|
|
ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *)it, __VA_ARGS__); \
|
|
|
|
ELM_CHECK_WIDTYPE(WIDGET((it)), widtype) __VA_ARGS__;
|
|
|
|
|
|
|
|
static const char *_gengrid = NULL;
|
|
|
|
static const char *_genlist = NULL;
|
|
|
|
|
|
|
|
/* THIS FUNCTION IS HACKY AND TEMPORARY!!! */
|
|
|
|
Eina_Bool
|
|
|
|
elm_genlist_type_check(const Evas_Object *obj,
|
|
|
|
const char *func)
|
|
|
|
{
|
|
|
|
const char *provided, *expected = "(unknown)";
|
|
|
|
static int abort_on_warn = -1;
|
|
|
|
provided = elm_widget_type_get(obj);
|
|
|
|
if (!_genlist) _genlist = eina_stringshare_add("genlist");
|
|
|
|
if (!_gengrid) _gengrid = eina_stringshare_add("gengrid");
|
|
|
|
if (EINA_LIKELY(provided == _genlist) || EINA_LIKELY(provided == _gengrid))
|
|
|
|
return EINA_TRUE;
|
|
|
|
if ((!provided) || (!provided[0]))
|
|
|
|
{
|
|
|
|
provided = evas_object_type_get(obj);
|
|
|
|
if ((!provided) || (!provided[0]))
|
|
|
|
provided = "(unknown)";
|
|
|
|
}
|
|
|
|
ERR("Passing Object: %p in function: %s, of type: '%s' when expecting type: '%s'", obj, func, provided, expected);
|
|
|
|
if (abort_on_warn == -1)
|
|
|
|
{
|
|
|
|
if (getenv("ELM_ERROR_ABORT")) abort_on_warn = 1;
|
|
|
|
else abort_on_warn = 0;
|
|
|
|
}
|
|
|
|
if (abort_on_warn == 1) abort();
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2010-10-01 12:03:12 -07:00
|
|
|
static Eina_Bool
|
2010-12-07 11:18:14 -08:00
|
|
|
_event_hook(Evas_Object *obj,
|
2011-04-01 09:33:58 -07:00
|
|
|
Evas_Object *src __UNUSED__,
|
2010-12-07 11:18:14 -08:00
|
|
|
Evas_Callback_Type type,
|
|
|
|
void *event_info)
|
2010-10-01 12:03:12 -07:00
|
|
|
{
|
|
|
|
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
|
|
|
Evas_Event_Key_Down *ev = event_info;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2011-09-22 05:39:49 -07:00
|
|
|
Evas_Coord pan_max_x = 0, pan_max_y = 0;
|
2010-10-01 12:03:12 -07:00
|
|
|
if (!wd) return EINA_FALSE;
|
2010-10-27 07:38:57 -07:00
|
|
|
if (!wd->items) return EINA_FALSE;
|
2010-10-01 12:03:12 -07:00
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
|
|
|
if (elm_widget_disabled_get(obj)) return EINA_FALSE;
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Object_Item *it = NULL;
|
2010-10-01 12:03:12 -07:00
|
|
|
Evas_Coord x = 0;
|
|
|
|
Evas_Coord y = 0;
|
|
|
|
Evas_Coord step_x = 0;
|
|
|
|
Evas_Coord step_y = 0;
|
|
|
|
Evas_Coord v_w = 0;
|
|
|
|
Evas_Coord v_h = 0;
|
|
|
|
Evas_Coord page_x = 0;
|
|
|
|
Evas_Coord page_y = 0;
|
|
|
|
|
|
|
|
elm_smart_scroller_child_pos_get(wd->scr, &x, &y);
|
|
|
|
elm_smart_scroller_step_size_get(wd->scr, &step_x, &step_y);
|
|
|
|
elm_smart_scroller_page_size_get(wd->scr, &page_x, &page_y);
|
|
|
|
elm_smart_scroller_child_viewport_size_get(wd->scr, &v_w, &v_h);
|
|
|
|
|
2010-10-22 14:41:22 -07:00
|
|
|
if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left")))
|
2010-10-01 12:03:12 -07:00
|
|
|
{
|
|
|
|
x -= step_x;
|
|
|
|
}
|
2011-10-20 14:49:54 -07:00
|
|
|
else if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right")))
|
2010-10-01 12:03:12 -07:00
|
|
|
{
|
|
|
|
x += step_x;
|
|
|
|
}
|
2010-12-07 11:18:14 -08:00
|
|
|
else if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up")))
|
2010-10-01 12:03:12 -07:00
|
|
|
{
|
2010-10-22 14:41:22 -07:00
|
|
|
if (((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
|
2010-12-07 11:18:14 -08:00
|
|
|
(_item_multi_select_up(wd)))
|
2010-10-22 14:41:22 -07:00
|
|
|
|| (_item_single_select_up(wd)))
|
2010-10-05 12:09:55 -07:00
|
|
|
{
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
y -= step_y;
|
2010-10-01 12:03:12 -07:00
|
|
|
}
|
2010-10-22 14:41:22 -07:00
|
|
|
else if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down")))
|
2010-10-01 12:03:12 -07:00
|
|
|
{
|
2010-10-22 14:41:22 -07:00
|
|
|
if (((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
|
2010-12-07 11:18:14 -08:00
|
|
|
(_item_multi_select_down(wd)))
|
2010-10-22 14:41:22 -07:00
|
|
|
|| (_item_single_select_down(wd)))
|
2010-10-05 12:09:55 -07:00
|
|
|
{
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
y += step_y;
|
2010-10-01 12:03:12 -07:00
|
|
|
}
|
2011-10-20 14:49:54 -07:00
|
|
|
else if ((!strcmp(ev->keyname, "Home")) || (!strcmp(ev->keyname, "KP_Home")))
|
2010-10-01 12:03:12 -07:00
|
|
|
{
|
2011-11-29 16:59:19 -08:00
|
|
|
it = elm_genlist_first_item_get(obj);
|
2010-10-01 12:03:12 -07:00
|
|
|
elm_genlist_item_bring_in(it);
|
2012-02-25 03:53:35 -08:00
|
|
|
elm_genlist_item_selected_set(it, EINA_TRUE);
|
2010-10-01 12:03:12 -07:00
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
2011-10-20 14:49:54 -07:00
|
|
|
else if ((!strcmp(ev->keyname, "End")) || (!strcmp(ev->keyname, "KP_End")))
|
2010-10-01 12:03:12 -07:00
|
|
|
{
|
2011-11-29 16:59:19 -08:00
|
|
|
it = elm_genlist_last_item_get(obj);
|
2010-10-01 12:03:12 -07:00
|
|
|
elm_genlist_item_bring_in(it);
|
2012-02-25 03:53:35 -08:00
|
|
|
elm_genlist_item_selected_set(it, EINA_TRUE);
|
2010-10-01 12:03:12 -07:00
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
2011-10-20 14:49:54 -07:00
|
|
|
else if ((!strcmp(ev->keyname, "Prior")) || (!strcmp(ev->keyname, "KP_Prior")))
|
2010-10-01 12:03:12 -07:00
|
|
|
{
|
|
|
|
if (page_y < 0)
|
|
|
|
y -= -(page_y * v_h) / 100;
|
|
|
|
else
|
|
|
|
y -= page_y;
|
|
|
|
}
|
2011-10-20 14:49:54 -07:00
|
|
|
else if ((!strcmp(ev->keyname, "Next")) || (!strcmp(ev->keyname, "KP_Next")))
|
2010-10-01 12:03:12 -07:00
|
|
|
{
|
|
|
|
if (page_y < 0)
|
|
|
|
y += -(page_y * v_h) / 100;
|
|
|
|
else
|
|
|
|
y += page_y;
|
|
|
|
}
|
2011-10-20 14:49:54 -07:00
|
|
|
else if (!strcmp(ev->keyname, "Escape"))
|
|
|
|
{
|
|
|
|
if (!_deselect_all_items(wd)) return EINA_FALSE;
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
2011-06-01 22:40:30 -07:00
|
|
|
else if (((!strcmp(ev->keyname, "Return")) ||
|
2011-12-22 22:54:47 -08:00
|
|
|
(!strcmp(ev->keyname, "KP_Enter")) ||
|
|
|
|
(!strcmp(ev->keyname, "space")))
|
|
|
|
&& (!wd->multi) && (wd->selected))
|
2010-10-05 12:10:11 -07:00
|
|
|
{
|
2011-04-22 02:56:22 -07:00
|
|
|
it = elm_genlist_selected_item_get(obj);
|
2010-10-05 12:10:11 -07:00
|
|
|
elm_genlist_item_expanded_set(it,
|
|
|
|
!elm_genlist_item_expanded_get(it));
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it);
|
2010-10-05 12:10:11 -07:00
|
|
|
}
|
2010-10-01 12:03:12 -07:00
|
|
|
else return EINA_FALSE;
|
|
|
|
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
2011-09-22 05:39:49 -07:00
|
|
|
_pan_max_get(wd->pan_smart, &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;
|
2010-10-01 12:03:12 -07:00
|
|
|
elm_smart_scroller_child_pos_set(wd->scr, x, y);
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2010-10-27 07:38:54 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_deselect_all_items(Widget_Data *wd)
|
|
|
|
{
|
|
|
|
if (!wd->selected) return EINA_FALSE;
|
2011-06-01 22:40:30 -07:00
|
|
|
while (wd->selected)
|
2011-11-29 16:59:19 -08:00
|
|
|
elm_genlist_item_selected_set(wd->selected->data, EINA_FALSE);
|
2010-10-27 07:38:54 -07:00
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2010-10-05 12:09:55 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_item_multi_select_up(Widget_Data *wd)
|
|
|
|
{
|
|
|
|
if (!wd->selected) return EINA_FALSE;
|
|
|
|
if (!wd->multi) return EINA_FALSE;
|
|
|
|
|
2012-02-22 23:39:10 -08:00
|
|
|
Elm_Object_Item *prev = elm_genlist_item_prev_get(wd->last_selected_item);
|
2010-10-05 12:09:55 -07:00
|
|
|
if (!prev) return EINA_TRUE;
|
|
|
|
|
2011-11-29 16:59:19 -08:00
|
|
|
if (elm_genlist_item_selected_get(prev))
|
2010-10-05 12:09:55 -07:00
|
|
|
{
|
2012-01-30 02:39:32 -08:00
|
|
|
elm_genlist_item_selected_set(wd->last_selected_item, EINA_FALSE);
|
|
|
|
wd->last_selected_item = prev;
|
|
|
|
elm_genlist_item_show(wd->last_selected_item);
|
2010-10-05 12:09:55 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-11-29 16:59:19 -08:00
|
|
|
elm_genlist_item_selected_set(prev, EINA_TRUE);
|
2010-10-05 12:09:55 -07:00
|
|
|
elm_genlist_item_show(prev);
|
|
|
|
}
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_item_multi_select_down(Widget_Data *wd)
|
|
|
|
{
|
|
|
|
if (!wd->selected) return EINA_FALSE;
|
|
|
|
if (!wd->multi) return EINA_FALSE;
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Object_Item *next;
|
2012-01-30 02:39:32 -08:00
|
|
|
next = elm_genlist_item_next_get(wd->last_selected_item);
|
2010-10-05 12:09:55 -07:00
|
|
|
if (!next) return EINA_TRUE;
|
|
|
|
|
2011-11-29 16:59:19 -08:00
|
|
|
if (elm_genlist_item_selected_get(next))
|
2010-10-05 12:09:55 -07:00
|
|
|
{
|
2012-01-30 02:39:32 -08:00
|
|
|
elm_genlist_item_selected_set(wd->last_selected_item, EINA_FALSE);
|
|
|
|
wd->last_selected_item = next;
|
|
|
|
elm_genlist_item_show(wd->last_selected_item);
|
2010-10-05 12:09:55 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-11-29 16:59:19 -08:00
|
|
|
elm_genlist_item_selected_set(next, EINA_TRUE);
|
2010-10-05 12:09:55 -07:00
|
|
|
elm_genlist_item_show(next);
|
|
|
|
}
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_item_single_select_up(Widget_Data *wd)
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *prev;
|
2010-10-27 07:38:57 -07:00
|
|
|
if (!wd->selected)
|
|
|
|
{
|
2011-10-21 15:55:45 -07:00
|
|
|
prev = ELM_GEN_ITEM_FROM_INLIST(wd->items->last);
|
2011-12-02 05:43:02 -08:00
|
|
|
while ((prev) && (prev->generation < wd->generation))
|
2011-10-21 15:55:45 -07:00
|
|
|
prev = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev);
|
2010-10-27 07:38:57 -07:00
|
|
|
}
|
2012-01-30 02:39:32 -08:00
|
|
|
else prev = (Elm_Gen_Item *) elm_genlist_item_prev_get(wd->last_selected_item);
|
2010-10-27 07:38:57 -07:00
|
|
|
|
2010-10-05 12:09:55 -07:00
|
|
|
if (!prev) return EINA_FALSE;
|
|
|
|
|
2010-10-27 07:38:54 -07:00
|
|
|
_deselect_all_items(wd);
|
2010-10-05 12:09:55 -07:00
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_selected_set((Elm_Object_Item *) prev, EINA_TRUE);
|
|
|
|
elm_genlist_item_show((Elm_Object_Item *) prev);
|
2010-10-05 12:09:55 -07:00
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_item_single_select_down(Widget_Data *wd)
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *next;
|
2010-10-27 07:38:57 -07:00
|
|
|
if (!wd->selected)
|
|
|
|
{
|
2011-10-21 15:55:45 -07:00
|
|
|
next = ELM_GEN_ITEM_FROM_INLIST(wd->items);
|
2011-12-02 05:43:02 -08:00
|
|
|
while ((next) && (next->generation < wd->generation))
|
2011-10-21 15:55:45 -07:00
|
|
|
next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next);
|
2010-10-27 07:38:57 -07:00
|
|
|
}
|
2012-01-30 02:39:32 -08:00
|
|
|
else next = (Elm_Gen_Item *) elm_genlist_item_next_get(wd->last_selected_item);
|
2010-10-27 07:38:57 -07:00
|
|
|
|
2010-10-05 12:09:55 -07:00
|
|
|
if (!next) return EINA_FALSE;
|
|
|
|
|
2010-10-27 07:38:54 -07:00
|
|
|
_deselect_all_items(wd);
|
2010-10-05 12:09:55 -07:00
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_selected_set((Elm_Object_Item *) next, EINA_TRUE);
|
|
|
|
elm_genlist_item_show((Elm_Object_Item *) next);
|
2010-10-05 12:09:55 -07:00
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2010-10-01 12:03:12 -07:00
|
|
|
static void
|
2011-04-01 09:33:58 -07:00
|
|
|
_on_focus_hook(void *data __UNUSED__,
|
2010-12-07 11:18:14 -08:00
|
|
|
Evas_Object *obj)
|
2010-10-01 12:03:12 -07:00
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
if (elm_widget_focus_get(obj))
|
|
|
|
{
|
2011-06-14 22:30:23 -07:00
|
|
|
elm_object_signal_emit(wd->obj, "elm,action,focus", "elm");
|
2010-10-01 12:03:12 -07:00
|
|
|
evas_object_focus_set(wd->obj, EINA_TRUE);
|
2010-10-22 14:41:22 -07:00
|
|
|
if ((wd->selected) && (!wd->last_selected_item))
|
2010-10-05 12:09:55 -07:00
|
|
|
wd->last_selected_item = eina_list_data_get(wd->selected);
|
2010-10-01 12:03:12 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-06-14 22:30:23 -07:00
|
|
|
elm_object_signal_emit(wd->obj, "elm,action,unfocus", "elm");
|
2010-10-01 12:03:12 -07:00
|
|
|
evas_object_focus_set(wd->obj, EINA_FALSE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-02-09 03:23:59 -08:00
|
|
|
static void
|
|
|
|
_del_hook(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2010-03-09 06:42:41 -08:00
|
|
|
if (!wd) return;
|
2010-11-05 23:02:22 -07:00
|
|
|
_item_cache_zero(wd);
|
2009-09-11 06:43:02 -07:00
|
|
|
if (wd->calc_job) ecore_job_del(wd->calc_job);
|
2009-09-13 19:53:03 -07:00
|
|
|
if (wd->update_job) ecore_job_del(wd->update_job);
|
2011-04-27 03:17:26 -07:00
|
|
|
if (wd->queue_idle_enterer) ecore_idle_enterer_del(wd->queue_idle_enterer);
|
2010-11-20 00:43:43 -08:00
|
|
|
if (wd->must_recalc_idler) ecore_idler_del(wd->must_recalc_idler);
|
2011-01-08 07:12:15 -08:00
|
|
|
if (wd->multi_timer) ecore_timer_del(wd->multi_timer);
|
2011-04-21 04:47:36 -07:00
|
|
|
if (wd->mode_type) eina_stringshare_del(wd->mode_type);
|
|
|
|
if (wd->scr_hold_timer) ecore_timer_del(wd->scr_hold_timer);
|
2009-02-09 03:23:59 -08:00
|
|
|
free(wd);
|
|
|
|
}
|
|
|
|
|
2009-11-13 14:22:05 -08:00
|
|
|
static void
|
|
|
|
_del_pre_hook(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2010-03-09 06:42:41 -08:00
|
|
|
if (!wd) return;
|
2012-02-22 23:39:10 -08:00
|
|
|
if (wd->edit_mode) elm_genlist_edit_mode_set(wd->obj, EINA_FALSE);
|
2011-11-29 16:59:19 -08:00
|
|
|
elm_genlist_clear(obj);
|
2009-11-13 14:22:05 -08:00
|
|
|
evas_object_del(wd->pan_smart);
|
|
|
|
wd->pan_smart = NULL;
|
|
|
|
}
|
|
|
|
|
2011-02-08 04:08:28 -08:00
|
|
|
static void
|
2011-03-22 00:54:24 -07:00
|
|
|
_mirrored_set(Evas_Object *obj,
|
|
|
|
Eina_Bool rtl)
|
2011-02-08 04:08:28 -08:00
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
_item_cache_zero(wd);
|
|
|
|
elm_smart_scroller_mirrored_set(wd->scr, rtl);
|
|
|
|
}
|
|
|
|
|
2009-02-09 03:23:59 -08:00
|
|
|
static void
|
|
|
|
_theme_hook(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2009-02-25 08:22:29 -08:00
|
|
|
Item_Block *itb;
|
2010-03-09 06:42:41 -08:00
|
|
|
if (!wd) return;
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(wd->obj));
|
2010-11-05 23:02:22 -07:00
|
|
|
_item_cache_zero(wd);
|
2011-02-09 08:14:02 -08:00
|
|
|
_elm_widget_mirrored_reload(obj);
|
2011-02-08 04:08:28 -08:00
|
|
|
_mirrored_set(obj, elm_widget_mirrored_get(obj));
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_smart_scroller_object_theme_set(obj, wd->scr, "genlist", "base",
|
|
|
|
elm_widget_style_get(obj));
|
2011-04-19 06:40:25 -07:00
|
|
|
edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
|
2010-10-24 16:48:35 -07:00
|
|
|
wd->item_width = wd->item_height = 0;
|
2011-03-29 02:28:09 -07:00
|
|
|
wd->group_item_width = wd->group_item_height = 0;
|
2010-10-24 16:48:35 -07:00
|
|
|
wd->minw = wd->minh = wd->realminw = 0;
|
2009-02-25 08:22:29 -08:00
|
|
|
EINA_INLIST_FOREACH(wd->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;
|
2010-10-15 04:51:15 -07:00
|
|
|
|
2011-03-22 00:54:24 -07:00
|
|
|
if (itb->realized) _item_block_unrealize(itb);
|
|
|
|
EINA_LIST_FOREACH(itb->items, l, it)
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->mincalcd = EINA_FALSE;
|
2009-02-25 08:22:29 -08:00
|
|
|
|
2011-03-22 00:54:24 -07:00
|
|
|
itb->changed = EINA_TRUE;
|
|
|
|
}
|
2009-02-18 05:13:10 -08:00
|
|
|
if (wd->calc_job) ecore_job_del(wd->calc_job);
|
|
|
|
wd->calc_job = ecore_job_add(_calc_job, wd);
|
2009-02-09 03:23:59 -08:00
|
|
|
_sizing_eval(obj);
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(wd->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(wd->obj));
|
2009-02-09 03:23:59 -08:00
|
|
|
}
|
|
|
|
|
2011-02-13 02:28:55 -08:00
|
|
|
static void
|
2011-03-22 00:54:24 -07:00
|
|
|
_show_region_hook(void *data,
|
|
|
|
Evas_Object *obj)
|
2011-02-13 02:28:55 -08:00
|
|
|
{
|
2009-02-09 03:23:59 -08:00
|
|
|
Widget_Data *wd = elm_widget_data_get(data);
|
|
|
|
Evas_Coord x, y, w, h;
|
2010-03-09 06:42:41 -08:00
|
|
|
if (!wd) return;
|
2009-02-09 03:23:59 -08:00
|
|
|
elm_widget_show_region_get(obj, &x, &y, &w, &h);
|
2011-02-13 02:28:55 -08:00
|
|
|
//x & y are screen coordinates, Add with pan coordinates
|
|
|
|
x += wd->pan_x;
|
|
|
|
y += wd->pan_y;
|
2009-02-09 03:23:59 -08:00
|
|
|
elm_smart_scroller_child_region_show(wd->scr, x, y, w, h);
|
2011-02-13 02:28:55 -08:00
|
|
|
}
|
2009-02-09 03:23:59 -08:00
|
|
|
|
2011-10-19 07:17:14 -07:00
|
|
|
static void
|
|
|
|
_translate_hook(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
evas_object_smart_callback_call(obj, "language,changed", NULL);
|
|
|
|
}
|
|
|
|
|
2009-02-09 03:23:59 -08:00
|
|
|
static void
|
|
|
|
_sizing_eval(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2009-03-12 22:50:38 -07:00
|
|
|
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
2010-03-09 06:42:41 -08:00
|
|
|
if (!wd) return;
|
2009-03-12 22:50:38 -07:00
|
|
|
evas_object_size_hint_min_get(wd->scr, &minw, &minh);
|
|
|
|
evas_object_size_hint_max_get(wd->scr, &maxw, &maxh);
|
|
|
|
minh = -1;
|
2010-11-20 00:43:43 -08:00
|
|
|
if (wd->height_for_width)
|
|
|
|
{
|
2010-12-07 11:18:14 -08:00
|
|
|
Evas_Coord vw, vh;
|
|
|
|
|
|
|
|
elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh);
|
|
|
|
if ((vw != 0) && (vw != wd->prev_viewport_w))
|
|
|
|
{
|
|
|
|
Item_Block *itb;
|
|
|
|
|
|
|
|
wd->prev_viewport_w = vw;
|
|
|
|
EINA_INLIST_FOREACH(wd->blocks, itb)
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
|
|
|
itb->must_recalc = EINA_TRUE;
|
|
|
|
}
|
2010-12-07 11:18:14 -08:00
|
|
|
if (wd->calc_job) ecore_job_del(wd->calc_job);
|
|
|
|
wd->calc_job = ecore_job_add(_calc_job, wd);
|
|
|
|
}
|
2010-11-20 00:43:43 -08:00
|
|
|
}
|
2010-09-28 01:46:08 -07:00
|
|
|
if (wd->mode == ELM_LIST_LIMIT)
|
2010-05-07 06:21:45 -07:00
|
|
|
{
|
2011-11-28 16:06:55 -08:00
|
|
|
Evas_Coord vmw, vmh;
|
2010-10-15 04:51:15 -07:00
|
|
|
|
2010-09-28 01:46:08 -07:00
|
|
|
minw = wd->realminw;
|
2010-05-07 06:21:45 -07:00
|
|
|
maxw = -1;
|
2012-02-22 23:39:10 -08:00
|
|
|
elm_smart_scroller_child_viewport_size_get(wd->scr, &vmw, &vmh);
|
2010-09-28 01:46:08 -07:00
|
|
|
edje_object_size_min_calc
|
2011-04-01 09:33:58 -07:00
|
|
|
(elm_smart_scroller_edje_object_get(wd->scr), &vmw, &vmh);
|
2010-05-07 06:21:45 -07:00
|
|
|
minw = vmw + minw;
|
|
|
|
}
|
2010-09-28 01:46:08 -07:00
|
|
|
else
|
|
|
|
{
|
2010-12-07 11:18:14 -08:00
|
|
|
Evas_Coord vmw, vmh;
|
2010-10-15 04:51:15 -07:00
|
|
|
|
2010-09-28 01:46:08 -07:00
|
|
|
edje_object_size_min_calc
|
2011-04-01 09:33:58 -07:00
|
|
|
(elm_smart_scroller_edje_object_get(wd->scr), &vmw, &vmh);
|
2010-09-28 01:46:08 -07:00
|
|
|
minw = vmw;
|
|
|
|
minh = vmh;
|
|
|
|
}
|
2009-03-12 22:50:38 -07:00
|
|
|
evas_object_size_hint_min_set(obj, minw, minh);
|
|
|
|
evas_object_size_hint_max_set(obj, maxw, maxh);
|
2009-02-09 03:23:59 -08:00
|
|
|
}
|
|
|
|
|
2011-04-06 07:46:39 -07:00
|
|
|
static void
|
2011-04-06 17:58:29 -07:00
|
|
|
_signal_emit_hook(Evas_Object *obj,
|
|
|
|
const char *emission,
|
|
|
|
const char *source)
|
2011-04-06 07:46:39 -07:00
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr),
|
|
|
|
emission, source);
|
|
|
|
}
|
|
|
|
|
2009-02-16 23:50:35 -08:00
|
|
|
static void
|
2011-10-21 01:52:03 -07:00
|
|
|
_item_highlight(Elm_Gen_Item *it)
|
2009-02-16 23:50:35 -08:00
|
|
|
{
|
2009-05-12 03:16:49 -07:00
|
|
|
const char *selectraise;
|
2012-01-26 23:36:36 -08:00
|
|
|
if ((it->wd->no_select) || (it->generation < it->wd->generation) ||
|
|
|
|
(it->highlighted) || elm_widget_item_disabled_get(it) ||
|
|
|
|
(it->display_only) || (it->item->mode_view))
|
2011-04-21 04:47:36 -07:00
|
|
|
return;
|
2011-10-20 18:08:01 -07:00
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
|
2012-02-22 23:39:10 -08:00
|
|
|
if (it->edit_obj) edje_object_signal_emit(it->edit_obj, "elm,state,selected", "elm");
|
2011-10-20 18:08:01 -07:00
|
|
|
selectraise = edje_object_data_get(VIEW(it), "selectraise");
|
2009-05-12 03:16:49 -07:00
|
|
|
if ((selectraise) && (!strcmp(selectraise, "on")))
|
2011-01-05 21:13:11 -08:00
|
|
|
{
|
2012-02-22 23:39:10 -08:00
|
|
|
if (it->edit_obj) evas_object_raise(it->edit_obj);
|
|
|
|
else evas_object_raise(VIEW(it));
|
2011-10-21 01:52:03 -07:00
|
|
|
if ((it->item->group_item) && (it->item->group_item->realized))
|
|
|
|
evas_object_raise(it->item->VIEW(group_item));
|
2011-01-05 21:13:11 -08:00
|
|
|
}
|
2011-03-10 11:59:10 -08:00
|
|
|
it->highlighted = EINA_TRUE;
|
2009-02-16 23:50:35 -08:00
|
|
|
}
|
|
|
|
|
2011-05-24 04:41:00 -07:00
|
|
|
static void
|
2011-10-21 01:52:03 -07:00
|
|
|
_item_unhighlight(Elm_Gen_Item *it)
|
2011-05-24 04:41:00 -07:00
|
|
|
{
|
2011-12-02 05:43:02 -08:00
|
|
|
if ((it->generation < it->wd->generation) || (!it->highlighted)) return;
|
2011-10-20 18:08:01 -07:00
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm");
|
2012-02-22 23:39:10 -08:00
|
|
|
if (it->edit_obj) edje_object_signal_emit(it->edit_obj, "elm,state,unselected", "elm");
|
2011-10-21 01:52:03 -07:00
|
|
|
if (!it->item->nostacking)
|
2011-05-24 04:41:00 -07:00
|
|
|
{
|
2012-02-22 23:39:10 -08:00
|
|
|
if ((it->item->order_num_in & 0x1) ^ it->item->stacking_even)
|
|
|
|
{
|
|
|
|
if (it->edit_obj) evas_object_lower(it->edit_obj);
|
|
|
|
else evas_object_lower(VIEW(it));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (it->edit_obj) evas_object_raise(it->edit_obj);
|
|
|
|
else evas_object_raise(VIEW(it));
|
|
|
|
}
|
2011-05-24 04:41:00 -07:00
|
|
|
}
|
|
|
|
it->highlighted = EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2011-12-26 06:30:21 -08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-03-02 00:47:40 -08:00
|
|
|
static void
|
2011-10-21 01:52:03 -07:00
|
|
|
_item_block_del(Elm_Gen_Item *it)
|
2010-03-02 00:47:40 -08:00
|
|
|
{
|
|
|
|
Eina_Inlist *il;
|
2011-10-21 01:52:03 -07:00
|
|
|
Item_Block *itb = it->item->block;
|
2010-03-02 00:47:40 -08:00
|
|
|
|
|
|
|
itb->items = eina_list_remove(itb->items, it);
|
|
|
|
itb->count--;
|
|
|
|
itb->changed = EINA_TRUE;
|
|
|
|
if (it->wd->calc_job) ecore_job_del(it->wd->calc_job);
|
|
|
|
it->wd->calc_job = ecore_job_add(_calc_job, it->wd);
|
|
|
|
if (itb->count < 1)
|
|
|
|
{
|
2010-10-15 04:51:15 -07:00
|
|
|
il = EINA_INLIST_GET(itb);
|
|
|
|
Item_Block *itbn = (Item_Block *)(il->next);
|
|
|
|
if (it->parent)
|
2011-10-21 01:52:03 -07:00
|
|
|
it->parent->item->items = eina_list_remove(it->parent->item->items, it);
|
2010-10-15 04:51:15 -07:00
|
|
|
else
|
2011-12-26 06:30:21 -08:00
|
|
|
{
|
|
|
|
_item_block_position_update(il->next, itb->position);
|
|
|
|
it->wd->blocks = eina_inlist_remove(it->wd->blocks, il);
|
|
|
|
}
|
2010-10-15 04:51:15 -07:00
|
|
|
free(itb);
|
|
|
|
if (itbn) itbn->changed = EINA_TRUE;
|
2010-03-02 00:47:40 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-06-01 20:10:11 -07:00
|
|
|
if (itb->count < itb->wd->max_items_per_block/2)
|
2010-10-15 04:51:15 -07:00
|
|
|
{
|
|
|
|
il = EINA_INLIST_GET(itb);
|
|
|
|
Item_Block *itbp = (Item_Block *)(il->prev);
|
|
|
|
Item_Block *itbn = (Item_Block *)(il->next);
|
2011-06-01 20:10:11 -07:00
|
|
|
if ((itbp) && ((itbp->count + itb->count) < itb->wd->max_items_per_block + itb->wd->max_items_per_block/2))
|
2010-10-15 04:51:15 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it2;
|
2010-10-15 04:51:15 -07:00
|
|
|
|
|
|
|
EINA_LIST_FREE(itb->items, it2)
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
it2->item->block = itbp;
|
2010-10-15 04:51:15 -07:00
|
|
|
itbp->items = eina_list_append(itbp->items, it2);
|
|
|
|
itbp->count++;
|
|
|
|
itbp->changed = EINA_TRUE;
|
|
|
|
}
|
2011-12-26 06:30:21 -08:00
|
|
|
_item_block_position_update(EINA_INLIST_GET(itb)->next,
|
|
|
|
itb->position);
|
2010-12-07 11:18:14 -08:00
|
|
|
it->wd->blocks = eina_inlist_remove(it->wd->blocks,
|
|
|
|
EINA_INLIST_GET(itb));
|
2010-10-15 04:51:15 -07:00
|
|
|
free(itb);
|
|
|
|
}
|
2011-06-01 20:10:11 -07:00
|
|
|
else if ((itbn) && ((itbn->count + itb->count) < itb->wd->max_items_per_block + itb->wd->max_items_per_block/2))
|
2010-10-15 04:51:15 -07:00
|
|
|
{
|
|
|
|
while (itb->items)
|
|
|
|
{
|
|
|
|
Eina_List *last = eina_list_last(itb->items);
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it2 = last->data;
|
2010-10-15 04:51:15 -07:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
it2->item->block = itbn;
|
2010-10-15 04:51:15 -07:00
|
|
|
itb->items = eina_list_remove_list(itb->items, last);
|
|
|
|
itbn->items = eina_list_prepend(itbn->items, it2);
|
|
|
|
itbn->count++;
|
|
|
|
itbn->changed = EINA_TRUE;
|
|
|
|
}
|
2011-12-26 06:30:21 -08:00
|
|
|
_item_block_position_update(EINA_INLIST_GET(itb)->next,
|
|
|
|
itb->position);
|
2010-10-15 04:51:15 -07:00
|
|
|
it->wd->blocks =
|
2011-04-01 09:33:58 -07:00
|
|
|
eina_inlist_remove(it->wd->blocks, EINA_INLIST_GET(itb));
|
2010-10-15 04:51:15 -07:00
|
|
|
free(itb);
|
|
|
|
}
|
|
|
|
}
|
2010-03-02 00:47:40 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-10-21 01:52:03 -07:00
|
|
|
_item_del(Elm_Gen_Item *it)
|
2010-03-02 00:47:40 -08:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Evas_Object *obj = WIDGET(it);
|
2011-05-29 19:31:21 -07:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(obj));
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_subitems_clear((Elm_Object_Item *) it);
|
2010-03-02 00:47:40 -08:00
|
|
|
if (it->wd->show_item == it) it->wd->show_item = NULL;
|
2011-11-30 09:31:01 -08:00
|
|
|
if (it->realized) _elm_genlist_item_unrealize(it, EINA_FALSE);
|
2012-02-22 23:39:10 -08:00
|
|
|
if (it->item->edit_mode_item_realized) _edit_mode_item_unrealize(it);
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->block) _item_block_del(it);
|
|
|
|
if (it->item->queued)
|
2010-03-02 00:47:40 -08:00
|
|
|
it->wd->queue = eina_list_remove(it->wd->queue, it);
|
2010-11-24 23:07:39 -08:00
|
|
|
if (it->wd->anchor_item == it)
|
|
|
|
{
|
2011-10-21 15:55:45 -07:00
|
|
|
it->wd->anchor_item = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
|
2010-11-24 23:07:39 -08:00
|
|
|
if (!it->wd->anchor_item)
|
2011-10-21 15:55:45 -07:00
|
|
|
it->wd->anchor_item = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
|
2010-11-24 23:07:39 -08:00
|
|
|
}
|
2012-02-26 22:21:36 -08:00
|
|
|
if (it->wd->expanded_item == it) it->wd->expanded_item = NULL;
|
2010-03-02 00:47:40 -08:00
|
|
|
if (it->parent)
|
2011-10-21 01:52:03 -07:00
|
|
|
it->parent->item->items = eina_list_remove(it->parent->item->items, it);
|
|
|
|
if (it->item->swipe_timer) ecore_timer_del(it->item->swipe_timer);
|
2011-11-30 09:31:01 -08:00
|
|
|
_elm_genlist_item_del_serious(it);
|
2012-02-20 00:26:17 -08:00
|
|
|
elm_genlist_item_class_unref((Elm_Genlist_Item_Class *)it->itc);
|
2011-10-21 01:52:03 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(obj));
|
2010-03-02 00:47:40 -08:00
|
|
|
}
|
|
|
|
|
2009-02-16 23:50:35 -08:00
|
|
|
static void
|
2011-10-21 15:55:45 -07:00
|
|
|
_clear_cb(Widget_Data *wd)
|
2009-02-16 23:50:35 -08:00
|
|
|
{
|
2011-10-21 15:55:45 -07:00
|
|
|
wd->anchor_item = NULL;
|
|
|
|
while (wd->blocks)
|
|
|
|
{
|
|
|
|
Item_Block *itb = (Item_Block *)(wd->blocks);
|
2011-08-24 14:03:37 -07:00
|
|
|
|
2011-10-21 15:55:45 -07:00
|
|
|
wd->blocks = eina_inlist_remove(wd->blocks, wd->blocks);
|
|
|
|
if (itb->items) eina_list_free(itb->items);
|
|
|
|
free(itb);
|
|
|
|
}
|
|
|
|
if (wd->queue_idle_enterer)
|
2009-04-23 01:51:07 -07:00
|
|
|
{
|
2011-10-21 15:55:45 -07:00
|
|
|
ecore_idle_enterer_del(wd->queue_idle_enterer);
|
|
|
|
wd->queue_idle_enterer = NULL;
|
2009-04-23 01:51:07 -07:00
|
|
|
}
|
2011-10-21 15:55:45 -07:00
|
|
|
if (wd->must_recalc_idler)
|
|
|
|
{
|
|
|
|
ecore_idler_del(wd->must_recalc_idler);
|
|
|
|
wd->must_recalc_idler = NULL;
|
2011-08-24 14:03:37 -07:00
|
|
|
}
|
2011-10-21 15:55:45 -07:00
|
|
|
if (wd->queue) wd->queue = eina_list_free(wd->queue);
|
|
|
|
if (wd->reorder_move_animator)
|
2010-03-02 00:47:40 -08:00
|
|
|
{
|
2011-10-21 15:55:45 -07:00
|
|
|
ecore_animator_del(wd->reorder_move_animator);
|
|
|
|
wd->reorder_move_animator = NULL;
|
2010-03-02 00:47:40 -08:00
|
|
|
}
|
2011-10-21 15:55:45 -07:00
|
|
|
wd->show_item = NULL;
|
|
|
|
wd->reorder_old_pan_y = 0;
|
2009-02-16 23:50:35 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-10-21 01:52:03 -07:00
|
|
|
_item_unselect(Elm_Gen_Item *it)
|
2009-02-16 23:50:35 -08:00
|
|
|
{
|
2011-12-02 05:43:02 -08:00
|
|
|
if ((it->generation < it->wd->generation) || (!it->selected)) return;
|
2011-05-24 04:41:00 -07:00
|
|
|
it->selected = EINA_FALSE;
|
|
|
|
it->wd->selected = eina_list_remove(it->wd->selected, it);
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_UNSELECTED, it);
|
2009-05-12 03:16:49 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-12-07 11:18:14 -08:00
|
|
|
_mouse_move(void *data,
|
2011-04-01 09:33:58 -07:00
|
|
|
Evas *evas __UNUSED__,
|
2010-12-07 11:18:14 -08:00
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info)
|
2009-05-12 03:16:49 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it = data;
|
2009-05-12 03:16:49 -07:00
|
|
|
Evas_Event_Mouse_Move *ev = event_info;
|
2009-09-07 23:20:32 -07:00
|
|
|
Evas_Coord minw = 0, minh = 0, x, y, dx, dy, adx, ady;
|
2011-06-01 20:10:11 -07:00
|
|
|
Evas_Coord ox, oy, ow, oh, it_scrl_y, y_pos;
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2009-05-12 03:16:49 -07:00
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
|
|
|
|
{
|
2010-10-15 04:51:15 -07:00
|
|
|
if (!it->wd->on_hold)
|
|
|
|
{
|
|
|
|
it->wd->on_hold = EINA_TRUE;
|
2010-08-05 11:17:05 -07:00
|
|
|
if (!it->wd->wasselected)
|
2011-05-24 04:41:00 -07:00
|
|
|
{
|
|
|
|
_item_unhighlight(it);
|
|
|
|
_item_unselect(it);
|
|
|
|
}
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
2009-05-12 03:16:49 -07:00
|
|
|
}
|
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
|
|
|
if (it->wd->multitouched)
|
|
|
|
{
|
|
|
|
it->wd->cur_x = ev->cur.canvas.x;
|
|
|
|
it->wd->cur_y = ev->cur.canvas.y;
|
|
|
|
return;
|
|
|
|
}
|
2010-02-25 22:30:17 -08:00
|
|
|
if ((it->dragging) && (it->down))
|
2010-01-18 22:54:27 -08:00
|
|
|
{
|
2010-10-15 04:24:46 -07:00
|
|
|
if (it->wd->movements == SWIPE_MOVES) it->wd->swipe = EINA_TRUE;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
it->wd->history[it->wd->movements].x = ev->cur.canvas.x;
|
|
|
|
it->wd->history[it->wd->movements].y = ev->cur.canvas.y;
|
2010-12-07 11:18:14 -08:00
|
|
|
if (abs((it->wd->history[it->wd->movements].x -
|
|
|
|
it->wd->history[0].x)) > 40)
|
2010-10-15 04:24:46 -07:00
|
|
|
it->wd->swipe = EINA_TRUE;
|
|
|
|
else
|
|
|
|
it->wd->movements++;
|
|
|
|
}
|
2010-01-18 22:54:27 -08:00
|
|
|
if (it->long_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
|
|
|
}
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_DRAG, it);
|
2010-01-18 22:54:27 -08:00
|
|
|
return;
|
|
|
|
}
|
2010-12-07 11:18:14 -08:00
|
|
|
if ((!it->down) /* || (it->wd->on_hold)*/ || (it->wd->longpressed))
|
2009-09-07 23:22:11 -07:00
|
|
|
{
|
2010-01-18 22:54:27 -08:00
|
|
|
if (it->long_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
|
|
|
}
|
2011-06-01 20:10:11 -07:00
|
|
|
if ((it->wd->reorder_mode) && (it->wd->reorder_it))
|
|
|
|
{
|
|
|
|
evas_object_geometry_get(it->wd->pan_smart, &ox, &oy, &ow, &oh);
|
|
|
|
it_scrl_y = ev->cur.canvas.y - it->wd->reorder_it->dy;
|
|
|
|
|
|
|
|
if (!it->wd->reorder_start_y)
|
2011-10-21 01:52:03 -07:00
|
|
|
it->wd->reorder_start_y = it->item->block->y + it->y;
|
2011-06-01 20:10:11 -07:00
|
|
|
|
2011-09-05 05:14:20 -07:00
|
|
|
if (it_scrl_y < oy)
|
|
|
|
y_pos = oy;
|
2011-10-21 01:52:03 -07:00
|
|
|
else if (it_scrl_y + it->wd->reorder_it->item->h > oy + oh)
|
|
|
|
y_pos = oy + oh - it->wd->reorder_it->item->h;
|
2011-09-05 05:14:20 -07:00
|
|
|
else
|
|
|
|
y_pos = it_scrl_y;
|
2011-06-01 20:10:11 -07:00
|
|
|
|
2012-02-22 23:39:10 -08:00
|
|
|
if (it->edit_obj)
|
|
|
|
_item_position(it, it->edit_obj, it->item->scrl_x, y_pos);
|
|
|
|
else
|
2011-10-21 01:52:03 -07:00
|
|
|
_item_position(it, VIEW(it), it->item->scrl_x, y_pos);
|
2011-06-01 20:10:11 -07:00
|
|
|
|
|
|
|
if (it->wd->calc_job) ecore_job_del(it->wd->calc_job);
|
|
|
|
it->wd->calc_job = ecore_job_add(_calc_job, it->wd);
|
|
|
|
}
|
2009-09-07 23:22:11 -07:00
|
|
|
return;
|
|
|
|
}
|
2010-02-04 00:06:41 -08:00
|
|
|
if (!it->display_only)
|
|
|
|
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
2009-09-07 23:20:32 -07:00
|
|
|
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))
|
|
|
|
{
|
2010-12-20 09:03:12 -08:00
|
|
|
it->dragging = EINA_TRUE;
|
2009-09-07 23:20:32 -07:00
|
|
|
if (it->long_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
|
|
|
}
|
|
|
|
if (!it->wd->wasselected)
|
2011-05-24 04:41:00 -07:00
|
|
|
{
|
|
|
|
_item_unhighlight(it);
|
|
|
|
_item_unselect(it);
|
|
|
|
}
|
2009-09-07 23:20:32 -07:00
|
|
|
if (dy < 0)
|
|
|
|
{
|
|
|
|
if (ady > adx)
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it),
|
2011-05-06 17:30:39 -07:00
|
|
|
SIG_DRAG_START_UP, it);
|
2009-09-07 23:20:32 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (dx < 0)
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it),
|
2011-05-06 17:30:39 -07:00
|
|
|
SIG_DRAG_START_LEFT, it);
|
2009-09-07 23:20:32 -07:00
|
|
|
else
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it),
|
2011-05-06 17:30:39 -07:00
|
|
|
SIG_DRAG_START_RIGHT, it);
|
2009-09-07 23:20:32 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (ady > adx)
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it),
|
2011-05-06 17:30:39 -07:00
|
|
|
SIG_DRAG_START_DOWN, it);
|
2009-09-07 23:20:32 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (dx < 0)
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it),
|
2011-05-06 17:30:39 -07:00
|
|
|
SIG_DRAG_START_LEFT, it);
|
2009-09-07 23:20:32 -07:00
|
|
|
else
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it),
|
2011-05-06 17:30:39 -07:00
|
|
|
SIG_DRAG_START_RIGHT, it);
|
2009-09-07 23:20:32 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-05-12 03:16:49 -07:00
|
|
|
}
|
|
|
|
|
2010-06-25 02:58:14 -07:00
|
|
|
static Eina_Bool
|
2009-09-01 03:42:52 -07:00
|
|
|
_long_press(void *data)
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it = data, *it_tmp;
|
2011-06-01 20:10:11 -07:00
|
|
|
Eina_List *list, *l;
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2009-09-01 03:42:52 -07:00
|
|
|
it->long_timer = NULL;
|
2012-01-26 23:36:36 -08:00
|
|
|
if (elm_widget_item_disabled_get(it) || (it->dragging) || (it->display_only))
|
2010-12-07 11:18:14 -08:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2009-09-01 03:42:52 -07:00
|
|
|
it->wd->longpressed = EINA_TRUE;
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_LONGPRESSED, it);
|
2011-10-23 20:40:54 -07:00
|
|
|
if ((it->wd->reorder_mode) && (!it->group))
|
2011-06-01 20:10:11 -07:00
|
|
|
{
|
|
|
|
it->wd->reorder_it = it;
|
|
|
|
it->wd->reorder_start_y = 0;
|
2012-02-22 23:39:10 -08:00
|
|
|
if (it->edit_obj)
|
|
|
|
evas_object_raise(it->edit_obj);
|
|
|
|
else
|
|
|
|
evas_object_raise(VIEW(it));
|
2011-06-01 20:10:11 -07:00
|
|
|
|
|
|
|
elm_smart_scroller_hold_set(it->wd->scr, EINA_TRUE);
|
2011-09-05 05:16:36 -07:00
|
|
|
elm_smart_scroller_bounce_allow_set(it->wd->scr, EINA_FALSE, EINA_FALSE);
|
2011-06-01 20:10:11 -07:00
|
|
|
|
|
|
|
list = elm_genlist_realized_items_get(it->wd->obj);
|
|
|
|
EINA_LIST_FOREACH(list, l, it_tmp)
|
|
|
|
{
|
|
|
|
if (it != it_tmp) _item_unselect(it_tmp);
|
|
|
|
}
|
2012-01-19 21:18:31 -08:00
|
|
|
if (elm_genlist_item_expanded_get((Elm_Object_Item *) it))
|
2011-06-01 20:10:11 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_expanded_set((Elm_Object_Item *) it, EINA_FALSE);
|
2011-06-01 20:10:11 -07:00
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
2012-02-22 23:39:10 -08:00
|
|
|
|
|
|
|
if (!it->wd->edit_mode)
|
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,reorder,enabled", "elm");
|
2011-06-01 20:10:11 -07:00
|
|
|
}
|
2010-06-25 02:58:14 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
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
|
2011-10-21 01:52:03 -07:00
|
|
|
_swipe(Elm_Gen_Item *it)
|
2010-10-15 04:24:46 -07:00
|
|
|
{
|
|
|
|
int i, sum = 0;
|
|
|
|
|
|
|
|
if (!it) return;
|
2012-01-26 23:36:36 -08:00
|
|
|
if ((it->display_only) || elm_widget_item_disabled_get(it)) return;
|
2010-10-15 04:24:46 -07:00
|
|
|
it->wd->swipe = EINA_FALSE;
|
|
|
|
for (i = 0; i < it->wd->movements; i++)
|
|
|
|
{
|
|
|
|
sum += it->wd->history[i].x;
|
|
|
|
if (abs(it->wd->history[0].y - it->wd->history[i].y) > 10) return;
|
|
|
|
}
|
|
|
|
|
|
|
|
sum /= it->wd->movements;
|
|
|
|
if (abs(sum - it->wd->history[0].x) <= 10) return;
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_SWIPE, it);
|
2010-10-15 04:24:46 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_swipe_cancel(void *data)
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it = data;
|
2010-10-15 04:24:46 -07:00
|
|
|
|
|
|
|
if (!it) return ECORE_CALLBACK_CANCEL;
|
|
|
|
it->wd->swipe = EINA_FALSE;
|
|
|
|
it->wd->movements = 0;
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
|
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 Eina_Bool
|
|
|
|
_multi_cancel(void *data)
|
|
|
|
{
|
2011-01-12 04:58:26 -08:00
|
|
|
Widget_Data *wd = data;
|
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
|
|
|
|
2011-01-12 04:58:26 -08:00
|
|
|
if (!wd) return ECORE_CALLBACK_CANCEL;
|
|
|
|
wd->multi_timeout = EINA_TRUE;
|
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
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_multi_touch_gesture_eval(void *data)
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it = data;
|
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
|
|
|
|
|
|
|
it->wd->multitouched = EINA_FALSE;
|
|
|
|
if (it->wd->multi_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->wd->multi_timer);
|
|
|
|
it->wd->multi_timer = NULL;
|
|
|
|
}
|
|
|
|
if (it->wd->multi_timeout)
|
|
|
|
{
|
2011-03-22 00:54:24 -07:00
|
|
|
it->wd->multi_timeout = EINA_FALSE;
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
Evas_Coord minw = 0, minh = 0;
|
|
|
|
Evas_Coord off_x, off_y, off_mx, off_my;
|
|
|
|
|
|
|
|
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
|
|
|
off_x = abs(it->wd->cur_x - it->wd->prev_x);
|
|
|
|
off_y = abs(it->wd->cur_y - it->wd->prev_y);
|
|
|
|
off_mx = abs(it->wd->cur_mx - it->wd->prev_mx);
|
|
|
|
off_my = abs(it->wd->cur_my - it->wd->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 ((it->wd->cur_x > it->wd->prev_x) && (it->wd->cur_mx > it->wd->prev_mx))
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it),
|
2011-05-06 17:30:39 -07:00
|
|
|
SIG_MULTI_SWIPE_RIGHT, 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 if ((it->wd->cur_x < it->wd->prev_x) && (it->wd->cur_mx < it->wd->prev_mx))
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it),
|
2011-05-06 17:30:39 -07:00
|
|
|
SIG_MULTI_SWIPE_LEFT, 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 if (abs(it->wd->cur_x - it->wd->cur_mx) > abs(it->wd->prev_x - it->wd->prev_mx))
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it),
|
2011-05-06 17:30:39 -07:00
|
|
|
SIG_MULTI_PINCH_OUT, 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
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it),
|
2011-05-06 17:30:39 -07:00
|
|
|
SIG_MULTI_PINCH_IN, 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
|
|
|
|
{
|
|
|
|
if ((it->wd->cur_y > it->wd->prev_y) && (it->wd->cur_my > it->wd->prev_my))
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it),
|
2011-05-06 17:30:39 -07:00
|
|
|
SIG_MULTI_SWIPE_DOWN, 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 if ((it->wd->cur_y < it->wd->prev_y) && (it->wd->cur_my < it->wd->prev_my))
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it),
|
2011-05-06 17:30:39 -07:00
|
|
|
SIG_MULTI_SWIPE_UP, 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 if (abs(it->wd->cur_y - it->wd->cur_my) > abs(it->wd->prev_y - it->wd->prev_my))
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it),
|
2011-05-06 17:30:39 -07:00
|
|
|
SIG_MULTI_PINCH_OUT, 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
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it),
|
2011-05-06 17:30:39 -07:00
|
|
|
SIG_MULTI_PINCH_IN, 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
|
|
|
}
|
|
|
|
}
|
2011-03-22 00:54:24 -07:00
|
|
|
it->wd->multi_timeout = EINA_FALSE;
|
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
|
2011-04-01 09:33:58 -07:00
|
|
|
_multi_down(void *data,
|
|
|
|
Evas *evas __UNUSED__,
|
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
|
|
|
Evas_Object *obj __UNUSED__,
|
2011-04-01 09:33:58 -07:00
|
|
|
void *event_info)
|
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
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it = data;
|
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
|
|
|
Evas_Event_Multi_Down *ev = event_info;
|
|
|
|
|
|
|
|
if ((it->wd->multi_device != 0) || (it->wd->multitouched) || (it->wd->multi_timeout)) return;
|
|
|
|
it->wd->multi_device = ev->device;
|
|
|
|
it->wd->multi_down = EINA_TRUE;
|
|
|
|
it->wd->multitouched = EINA_TRUE;
|
|
|
|
it->wd->prev_mx = ev->canvas.x;
|
|
|
|
it->wd->prev_my = ev->canvas.y;
|
2011-05-24 04:41:00 -07:00
|
|
|
if (!it->wd->wasselected)
|
|
|
|
{
|
|
|
|
_item_unhighlight(it);
|
|
|
|
_item_unselect(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
|
|
|
it->wd->wasselected = EINA_FALSE;
|
|
|
|
it->wd->longpressed = EINA_FALSE;
|
|
|
|
if (it->long_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
|
|
|
}
|
|
|
|
if (it->dragging)
|
|
|
|
{
|
|
|
|
it->dragging = EINA_FALSE;
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_DRAG_STOP, 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
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->swipe_timer)
|
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
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
ecore_timer_del(it->item->swipe_timer);
|
|
|
|
it->item->swipe_timer = 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
|
|
|
}
|
|
|
|
if (it->wd->on_hold)
|
|
|
|
{
|
|
|
|
it->wd->swipe = EINA_FALSE;
|
|
|
|
it->wd->movements = 0;
|
|
|
|
it->wd->on_hold = EINA_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-04-01 09:33:58 -07:00
|
|
|
_multi_up(void *data,
|
|
|
|
Evas *evas __UNUSED__,
|
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
|
|
|
Evas_Object *obj __UNUSED__,
|
2011-04-01 09:33:58 -07:00
|
|
|
void *event_info)
|
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
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it = data;
|
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
|
|
|
Evas_Event_Multi_Up *ev = event_info;
|
|
|
|
|
|
|
|
if (it->wd->multi_device != ev->device) return;
|
|
|
|
it->wd->multi_device = 0;
|
|
|
|
it->wd->multi_down = EINA_FALSE;
|
|
|
|
if (it->wd->mouse_down) return;
|
|
|
|
_multi_touch_gesture_eval(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-04-01 09:33:58 -07:00
|
|
|
_multi_move(void *data,
|
|
|
|
Evas *evas __UNUSED__,
|
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
|
|
|
Evas_Object *obj __UNUSED__,
|
2011-04-01 09:33:58 -07:00
|
|
|
void *event_info)
|
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
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it = data;
|
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
|
|
|
Evas_Event_Multi_Move *ev = event_info;
|
|
|
|
|
|
|
|
if (it->wd->multi_device != ev->device) return;
|
|
|
|
it->wd->cur_mx = ev->cur.canvas.x;
|
|
|
|
it->wd->cur_my = ev->cur.canvas.y;
|
|
|
|
}
|
|
|
|
|
2009-05-12 03:16:49 -07:00
|
|
|
static void
|
2010-12-07 11:18:14 -08:00
|
|
|
_mouse_down(void *data,
|
2011-04-01 09:33:58 -07:00
|
|
|
Evas *evas __UNUSED__,
|
2010-12-07 11:18:14 -08:00
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info)
|
2009-05-12 03:16:49 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it = data;
|
2009-05-12 03:16:49 -07:00
|
|
|
Evas_Event_Mouse_Down *ev = event_info;
|
2009-09-07 23:20:32 -07:00
|
|
|
Evas_Coord x, y;
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2009-09-01 03:42:52 -07:00
|
|
|
if (ev->button != 1) return;
|
2010-11-08 22:07:07 -08:00
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
|
2010-12-07 11:18:14 -08:00
|
|
|
{
|
|
|
|
it->wd->on_hold = EINA_TRUE;
|
|
|
|
}
|
2010-07-27 16:36:27 -07:00
|
|
|
|
2010-12-20 09:03:12 -08:00
|
|
|
it->down = EINA_TRUE;
|
|
|
|
it->dragging = EINA_FALSE;
|
2009-09-07 23:20:32 -07:00
|
|
|
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
|
|
|
|
it->dx = ev->canvas.x - x;
|
|
|
|
it->dy = ev->canvas.y - y;
|
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
|
|
|
it->wd->mouse_down = EINA_TRUE;
|
|
|
|
if (!it->wd->multitouched)
|
|
|
|
{
|
|
|
|
it->wd->prev_x = ev->canvas.x;
|
|
|
|
it->wd->prev_y = ev->canvas.y;
|
|
|
|
it->wd->multi_timeout = EINA_FALSE;
|
|
|
|
if (it->wd->multi_timer) ecore_timer_del(it->wd->multi_timer);
|
2011-01-12 04:58:26 -08:00
|
|
|
it->wd->multi_timer = ecore_timer_add(1, _multi_cancel, it->wd);
|
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
|
|
|
}
|
2010-02-25 22:30:17 -08:00
|
|
|
it->wd->longpressed = EINA_FALSE;
|
2009-06-17 08:35:19 -07:00
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) it->wd->on_hold = EINA_TRUE;
|
|
|
|
else it->wd->on_hold = EINA_FALSE;
|
2010-11-08 22:07:07 -08:00
|
|
|
if (it->wd->on_hold) return;
|
2009-09-01 03:42:52 -07:00
|
|
|
it->wd->wasselected = it->selected;
|
2011-03-10 11:59:10 -08:00
|
|
|
_item_highlight(it);
|
2009-05-12 03:16:49 -07:00
|
|
|
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
|
2012-01-26 23:36:36 -08:00
|
|
|
if ((!elm_widget_item_disabled_get(it)) && (!it->display_only))
|
2011-07-25 18:49:24 -07:00
|
|
|
{
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED_DOUBLE, it);
|
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it);
|
2011-07-25 18:49:24 -07:00
|
|
|
}
|
2009-09-01 03:42:52 -07:00
|
|
|
if (it->long_timer) ecore_timer_del(it->long_timer);
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->swipe_timer) ecore_timer_del(it->item->swipe_timer);
|
|
|
|
it->item->swipe_timer = ecore_timer_add(0.4, _swipe_cancel, it);
|
2010-03-29 22:42:56 -07:00
|
|
|
if (it->realized)
|
2010-12-07 11:18:14 -08:00
|
|
|
it->long_timer = ecore_timer_add(it->wd->longpress_timeout, _long_press,
|
|
|
|
it);
|
2010-03-29 22:42:56 -07:00
|
|
|
else
|
|
|
|
it->long_timer = NULL;
|
2010-10-15 04:24:46 -07:00
|
|
|
it->wd->swipe = EINA_FALSE;
|
|
|
|
it->wd->movements = 0;
|
2009-02-16 23:50:35 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-04-01 09:33:58 -07:00
|
|
|
_mouse_up(void *data,
|
|
|
|
Evas *evas __UNUSED__,
|
2010-12-07 11:18:14 -08:00
|
|
|
Evas_Object *obj __UNUSED__,
|
2011-04-01 09:33:58 -07:00
|
|
|
void *event_info)
|
2009-02-16 23:50:35 -08:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it = data;
|
2009-02-16 23:50:35 -08:00
|
|
|
Evas_Event_Mouse_Up *ev = event_info;
|
2010-06-05 06:12:45 -07:00
|
|
|
Eina_Bool dragged = EINA_FALSE;
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2009-09-01 03:42:52 -07:00
|
|
|
if (ev->button != 1) return;
|
2010-12-20 09:03:12 -08:00
|
|
|
it->down = EINA_FALSE;
|
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
|
|
|
it->wd->mouse_down = EINA_FALSE;
|
|
|
|
if (it->wd->multitouched)
|
|
|
|
{
|
2011-05-24 20:01:51 -07:00
|
|
|
if ((!it->wd->multi) && (!it->selected) && (it->highlighted)) _item_unhighlight(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
|
|
|
if (it->wd->multi_down) return;
|
|
|
|
_multi_touch_gesture_eval(data);
|
|
|
|
return;
|
|
|
|
}
|
2009-06-17 08:35:19 -07:00
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) it->wd->on_hold = EINA_TRUE;
|
|
|
|
else it->wd->on_hold = EINA_FALSE;
|
2009-09-01 03:42:52 -07:00
|
|
|
if (it->long_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
|
|
|
}
|
2009-09-07 23:20:32 -07:00
|
|
|
if (it->dragging)
|
|
|
|
{
|
2010-12-20 09:03:12 -08:00
|
|
|
it->dragging = EINA_FALSE;
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_DRAG_STOP, it);
|
2009-09-07 23:35:14 -07:00
|
|
|
dragged = 1;
|
2009-09-07 23:20:32 -07:00
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->swipe_timer)
|
2010-10-15 04:24:46 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
ecore_timer_del(it->item->swipe_timer);
|
|
|
|
it->item->swipe_timer = NULL;
|
2010-10-15 04:24:46 -07:00
|
|
|
}
|
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
|
|
|
if (it->wd->multi_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->wd->multi_timer);
|
|
|
|
it->wd->multi_timer = NULL;
|
|
|
|
it->wd->multi_timeout = EINA_FALSE;
|
|
|
|
}
|
2009-02-16 23:50:35 -08:00
|
|
|
if (it->wd->on_hold)
|
|
|
|
{
|
2010-10-15 04:24:46 -07:00
|
|
|
if (it->wd->swipe) _swipe(data);
|
2010-03-24 01:54:59 -07:00
|
|
|
it->wd->longpressed = EINA_FALSE;
|
2010-10-15 04:51:15 -07:00
|
|
|
it->wd->on_hold = EINA_FALSE;
|
|
|
|
return;
|
2009-02-16 23:50:35 -08:00
|
|
|
}
|
2011-06-01 20:10:11 -07:00
|
|
|
if ((it->wd->reorder_mode) && (it->wd->reorder_it))
|
|
|
|
{
|
|
|
|
Evas_Coord it_scrl_y = ev->canvas.y - it->wd->reorder_it->dy;
|
|
|
|
|
2011-09-05 05:16:36 -07:00
|
|
|
if (it->wd->reorder_rel && (it->wd->reorder_it->parent == it->wd->reorder_rel->parent))
|
2011-06-01 20:10:11 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it_scrl_y <= it->wd->reorder_rel->item->scrl_y)
|
2011-09-05 05:16:36 -07:00
|
|
|
_item_move_before(it->wd->reorder_it, it->wd->reorder_rel);
|
2011-06-01 20:10:11 -07:00
|
|
|
else
|
2011-09-05 05:16:36 -07:00
|
|
|
_item_move_after(it->wd->reorder_it, it->wd->reorder_rel);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (it->wd->calc_job) ecore_job_del(it->wd->calc_job);
|
|
|
|
it->wd->calc_job = ecore_job_add(_calc_job, it->wd);
|
2011-06-01 20:10:11 -07:00
|
|
|
}
|
2011-10-20 18:08:01 -07:00
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,reorder,disabled", "elm");
|
2011-06-01 20:10:11 -07:00
|
|
|
it->wd->reorder_it = it->wd->reorder_rel = NULL;
|
|
|
|
elm_smart_scroller_hold_set(it->wd->scr, EINA_FALSE);
|
2011-10-21 16:51:26 -07:00
|
|
|
elm_smart_scroller_bounce_allow_set(it->wd->scr, it->wd->h_bounce, it->wd->v_bounce);
|
2011-06-01 20:10:11 -07:00
|
|
|
}
|
2009-09-01 03:42:52 -07:00
|
|
|
if (it->wd->longpressed)
|
|
|
|
{
|
|
|
|
it->wd->longpressed = EINA_FALSE;
|
|
|
|
if (!it->wd->wasselected)
|
2011-05-24 04:41:00 -07:00
|
|
|
{
|
|
|
|
_item_unhighlight(it);
|
|
|
|
_item_unselect(it);
|
|
|
|
}
|
2010-12-20 09:03:12 -08:00
|
|
|
it->wd->wasselected = EINA_FALSE;
|
2009-09-01 03:42:52 -07:00
|
|
|
return;
|
|
|
|
}
|
2010-03-26 21:17:01 -07:00
|
|
|
if (dragged)
|
|
|
|
{
|
|
|
|
if (it->want_unrealize)
|
|
|
|
{
|
2011-11-30 09:31:01 -08:00
|
|
|
_elm_genlist_item_unrealize(it, EINA_FALSE);
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->block->want_unrealize)
|
|
|
|
_item_block_unrealize(it->item->block);
|
2010-03-26 21:17:01 -07:00
|
|
|
}
|
|
|
|
}
|
2012-01-26 23:36:36 -08:00
|
|
|
if (elm_widget_item_disabled_get(it) || (dragged) || (it->display_only))
|
|
|
|
return;
|
2010-11-08 22:07:07 -08:00
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
|
2009-02-16 23:50:35 -08:00
|
|
|
if (it->wd->multi)
|
|
|
|
{
|
2010-10-15 04:51:15 -07:00
|
|
|
if (!it->selected)
|
|
|
|
{
|
2011-03-10 11:59:10 -08:00
|
|
|
_item_highlight(it);
|
2011-10-21 15:55:45 -07:00
|
|
|
it->sel_cb(it);
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
2011-05-24 04:41:00 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
_item_unhighlight(it);
|
|
|
|
_item_unselect(it);
|
|
|
|
}
|
2009-02-16 23:50:35 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-10-15 04:51:15 -07:00
|
|
|
if (!it->selected)
|
|
|
|
{
|
|
|
|
Widget_Data *wd = it->wd;
|
2010-03-09 06:42:41 -08:00
|
|
|
if (wd)
|
|
|
|
{
|
2011-05-24 04:41:00 -07:00
|
|
|
while (wd->selected)
|
|
|
|
{
|
|
|
|
_item_unhighlight(wd->selected->data);
|
|
|
|
_item_unselect(wd->selected->data);
|
|
|
|
}
|
2010-03-09 06:42:41 -08:00
|
|
|
}
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const Eina_List *l, *l_next;
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it2;
|
2010-10-15 04:51:15 -07:00
|
|
|
|
|
|
|
EINA_LIST_FOREACH_SAFE(it->wd->selected, l, l_next, it2)
|
2011-12-05 17:23:55 -08:00
|
|
|
if (it2 != it)
|
2011-05-24 04:41:00 -07:00
|
|
|
{
|
|
|
|
_item_unhighlight(it2);
|
|
|
|
_item_unselect(it2);
|
|
|
|
}
|
2011-03-10 11:59:10 -08:00
|
|
|
//_item_highlight(it);
|
2010-10-15 04:51:15 -07:00
|
|
|
//_item_select(it);
|
|
|
|
}
|
2011-03-10 11:59:10 -08:00
|
|
|
_item_highlight(it);
|
2011-10-21 15:55:45 -07:00
|
|
|
it->sel_cb(it);
|
2009-02-16 23:50:35 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-03-12 22:50:38 -07:00
|
|
|
static void
|
2011-04-01 09:33:58 -07:00
|
|
|
_signal_expand_toggle(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
2009-03-12 22:50:38 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it = data;
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->expanded)
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_CONTRACT_REQUEST, it);
|
2009-03-12 22:50:38 -07:00
|
|
|
else
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_EXPAND_REQUEST, it);
|
2009-03-12 22:50:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-04-01 09:33:58 -07:00
|
|
|
_signal_expand(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
2009-03-12 22:50:38 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it = data;
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
if (!it->item->expanded)
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_EXPAND_REQUEST, it);
|
2009-03-12 22:50:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-04-01 09:33:58 -07:00
|
|
|
_signal_contract(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
2009-03-12 22:50:38 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it = data;
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->expanded)
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_CONTRACT_REQUEST, it);
|
2009-03-12 22:50:38 -07:00
|
|
|
}
|
|
|
|
|
2011-04-21 04:47:36 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_scr_hold_timer_cb(void *data)
|
|
|
|
{
|
|
|
|
if (!data) return ECORE_CALLBACK_CANCEL;
|
|
|
|
Widget_Data *wd = data;
|
|
|
|
elm_smart_scroller_hold_set(wd->scr, EINA_FALSE);
|
|
|
|
wd->scr_hold_timer = NULL;
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_mode_finished_signal_cb(void *data,
|
|
|
|
Evas_Object *obj,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
|
|
|
{
|
|
|
|
if (!data) return;
|
|
|
|
if (!obj) return;
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it = data;
|
2011-12-02 05:43:02 -08:00
|
|
|
if ((it->generation < it->wd->generation) || (!it->realized) || (!it->item->mode_view)) return;
|
2011-04-21 04:47:36 -07:00
|
|
|
char buf[1024];
|
2011-06-01 06:15:08 -07:00
|
|
|
Evas *te = evas_object_evas_get(obj);
|
2011-05-29 19:31:21 -07:00
|
|
|
|
2011-06-01 06:15:08 -07:00
|
|
|
evas_event_freeze(te);
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->nocache = EINA_FALSE;
|
2011-04-21 04:47:36 -07:00
|
|
|
_mode_item_unrealize(it);
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->group_item)
|
|
|
|
evas_object_raise(it->item->VIEW(group_item));
|
2011-04-21 04:47:36 -07:00
|
|
|
snprintf(buf, sizeof(buf), "elm,state,%s,passive,finished", it->wd->mode_type);
|
|
|
|
edje_object_signal_callback_del_full(obj, buf, "elm", _mode_finished_signal_cb, it);
|
2011-06-01 06:15:08 -07:00
|
|
|
evas_event_thaw(te);
|
|
|
|
evas_event_thaw_eval(te);
|
2011-04-21 04:47:36 -07:00
|
|
|
}
|
|
|
|
|
2010-11-05 23:02:22 -07:00
|
|
|
static void
|
|
|
|
_item_cache_clean(Widget_Data *wd)
|
|
|
|
{
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(wd->obj));
|
2010-12-07 11:18:14 -08:00
|
|
|
while ((wd->item_cache) && (wd->item_cache_count > wd->item_cache_max))
|
|
|
|
{
|
|
|
|
Item_Cache *itc;
|
|
|
|
|
|
|
|
itc = EINA_INLIST_CONTAINER_GET(wd->item_cache->last, Item_Cache);
|
|
|
|
wd->item_cache = eina_inlist_remove(wd->item_cache,
|
|
|
|
wd->item_cache->last);
|
|
|
|
wd->item_cache_count--;
|
|
|
|
if (itc->spacer) evas_object_del(itc->spacer);
|
|
|
|
if (itc->base_view) evas_object_del(itc->base_view);
|
|
|
|
if (itc->item_style) eina_stringshare_del(itc->item_style);
|
|
|
|
free(itc);
|
|
|
|
}
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(wd->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(wd->obj));
|
2010-11-05 23:02:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_cache_zero(Widget_Data *wd)
|
|
|
|
{
|
2010-12-07 11:18:14 -08:00
|
|
|
int pmax = wd->item_cache_max;
|
|
|
|
wd->item_cache_max = 0;
|
|
|
|
_item_cache_clean(wd);
|
|
|
|
wd->item_cache_max = pmax;
|
2010-11-05 23:02:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-10-21 01:52:03 -07:00
|
|
|
_item_cache_add(Elm_Gen_Item *it)
|
2010-11-05 23:02:22 -07:00
|
|
|
{
|
2010-12-07 11:18:14 -08:00
|
|
|
Item_Cache *itc;
|
|
|
|
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(it->wd->obj));
|
2010-12-07 11:18:14 -08:00
|
|
|
if (it->wd->item_cache_max <= 0)
|
|
|
|
{
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_del(VIEW(it));
|
|
|
|
VIEW(it) = NULL;
|
2010-12-07 11:18:14 -08:00
|
|
|
evas_object_del(it->spacer);
|
|
|
|
it->spacer = NULL;
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(it->wd->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(it->wd->obj));
|
2010-12-07 11:18:14 -08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
it->wd->item_cache_count++;
|
|
|
|
itc = calloc(1, sizeof(Item_Cache));
|
2012-02-22 23:39:10 -08:00
|
|
|
if (!itc)
|
|
|
|
{
|
|
|
|
evas_event_thaw(evas_object_evas_get(it->wd->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(it->wd->obj));
|
|
|
|
return;
|
|
|
|
}
|
2010-12-07 11:18:14 -08:00
|
|
|
it->wd->item_cache = eina_inlist_prepend(it->wd->item_cache,
|
|
|
|
EINA_INLIST_GET(itc));
|
|
|
|
itc->spacer = it->spacer;
|
|
|
|
it->spacer = NULL;
|
2011-10-20 18:08:01 -07:00
|
|
|
itc->base_view = VIEW(it);
|
|
|
|
VIEW(it) = NULL;
|
2012-02-22 23:39:10 -08:00
|
|
|
edje_object_signal_emit(itc->base_view, "elm,state,unselected", "elm");
|
2010-12-07 11:18:14 -08:00
|
|
|
evas_object_hide(itc->base_view);
|
|
|
|
evas_object_move(itc->base_view, -9999, -9999);
|
|
|
|
itc->item_style = eina_stringshare_add(it->itc->item_style);
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->flags & ELM_GENLIST_ITEM_SUBITEMS) itc->tree = 1;
|
2010-12-07 11:18:14 -08:00
|
|
|
itc->compress = (it->wd->compress);
|
|
|
|
itc->selected = it->selected;
|
2012-01-26 23:36:36 -08:00
|
|
|
itc->disabled = elm_widget_item_disabled_get(it);
|
2011-10-21 01:52:03 -07:00
|
|
|
itc->expanded = it->item->expanded;
|
2010-12-07 11:18:14 -08:00
|
|
|
if (it->long_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->swipe_timer)
|
2010-12-07 11:18:14 -08:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
ecore_timer_del(it->item->swipe_timer);
|
|
|
|
it->item->swipe_timer = NULL;
|
2010-12-07 11:18:14 -08:00
|
|
|
}
|
|
|
|
// FIXME: other callbacks?
|
|
|
|
edje_object_signal_callback_del_full(itc->base_view,
|
|
|
|
"elm,action,expand,toggle",
|
|
|
|
"elm", _signal_expand_toggle, it);
|
|
|
|
edje_object_signal_callback_del_full(itc->base_view, "elm,action,expand",
|
|
|
|
"elm",
|
|
|
|
_signal_expand, it);
|
|
|
|
edje_object_signal_callback_del_full(itc->base_view, "elm,action,contract",
|
|
|
|
"elm", _signal_contract, it);
|
|
|
|
evas_object_event_callback_del_full(itc->base_view, EVAS_CALLBACK_MOUSE_DOWN,
|
|
|
|
_mouse_down, it);
|
|
|
|
evas_object_event_callback_del_full(itc->base_view, EVAS_CALLBACK_MOUSE_UP,
|
|
|
|
_mouse_up, it);
|
|
|
|
evas_object_event_callback_del_full(itc->base_view, EVAS_CALLBACK_MOUSE_MOVE,
|
|
|
|
_mouse_move, 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
|
|
|
evas_object_event_callback_del_full(itc->base_view, EVAS_CALLBACK_MULTI_DOWN,
|
|
|
|
_multi_down, it);
|
|
|
|
evas_object_event_callback_del_full(itc->base_view, EVAS_CALLBACK_MULTI_UP,
|
|
|
|
_multi_up, it);
|
|
|
|
evas_object_event_callback_del_full(itc->base_view, EVAS_CALLBACK_MULTI_MOVE,
|
|
|
|
_multi_move, it);
|
2010-12-07 11:18:14 -08:00
|
|
|
_item_cache_clean(it->wd);
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(it->wd->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(it->wd->obj));
|
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
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->flags & ELM_GENLIST_ITEM_SUBITEMS) tree = 1;
|
2010-12-07 11:18:14 -08:00
|
|
|
EINA_INLIST_FOREACH(it->wd->item_cache, itc)
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
|
|
|
if ((itc->selected) || (itc->disabled) || (itc->expanded))
|
|
|
|
continue;
|
|
|
|
if ((itc->tree == tree) &&
|
|
|
|
(itc->compress == it->wd->compress) &&
|
|
|
|
(!strcmp(it->itc->item_style, itc->item_style)))
|
|
|
|
{
|
|
|
|
it->wd->item_cache = eina_inlist_remove(it->wd->item_cache,
|
|
|
|
EINA_INLIST_GET(itc));
|
|
|
|
it->wd->item_cache_count--;
|
|
|
|
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
|
|
|
|
_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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-22 02:56:22 -07:00
|
|
|
static void
|
2011-10-21 01:52:03 -07:00
|
|
|
_elm_genlist_item_odd_even_update(Elm_Gen_Item *it)
|
2011-04-22 02:56:22 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
if (!it->item->nostacking)
|
2011-04-22 02:56:22 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
if ((it->item->order_num_in & 0x1) ^ it->item->stacking_even)
|
2012-02-22 23:39:10 -08:00
|
|
|
{
|
|
|
|
if (it->edit_obj) evas_object_lower(it->edit_obj);
|
|
|
|
else evas_object_lower(VIEW(it));
|
|
|
|
}
|
2011-04-22 05:22:57 -07:00
|
|
|
else
|
2012-02-22 23:39:10 -08:00
|
|
|
{
|
|
|
|
if (it->edit_obj) evas_object_raise(it->edit_obj);
|
|
|
|
else evas_object_raise(VIEW(it));
|
|
|
|
}
|
2011-04-22 02:56:22 -07:00
|
|
|
}
|
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->order_num_in & 0x1)
|
2012-02-22 23:39:10 -08:00
|
|
|
{
|
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,odd", "elm");
|
|
|
|
if (it->edit_obj) edje_object_signal_emit(it->edit_obj, "elm,state,odd", "elm");
|
|
|
|
}
|
2011-04-22 02:56:22 -07:00
|
|
|
else
|
2012-02-22 23:39:10 -08:00
|
|
|
{
|
|
|
|
edje_object_signal_emit(VIEW(it), "elm,state,even", "elm");
|
|
|
|
if (it->edit_obj) edje_object_signal_emit(it->edit_obj, "elm,state,even", "elm");
|
|
|
|
}
|
2011-04-22 02:56:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-10-21 01:52:03 -07:00
|
|
|
_elm_genlist_item_state_update(Elm_Gen_Item *it, Item_Cache *itc)
|
2011-04-22 02:56:22 -07:00
|
|
|
{
|
2011-04-22 05:22:57 -07:00
|
|
|
if (itc)
|
|
|
|
{
|
|
|
|
if (it->selected != itc->selected)
|
|
|
|
{
|
|
|
|
if (it->selected)
|
2011-10-20 18:08:01 -07:00
|
|
|
edje_object_signal_emit(VIEW(it),
|
2011-04-22 05:22:57 -07:00
|
|
|
"elm,state,selected", "elm");
|
2012-02-22 23:39:10 -08:00
|
|
|
|
|
|
|
if (it->edit_obj)
|
|
|
|
edje_object_signal_emit(it->edit_obj,
|
|
|
|
"elm,state,selected", "elm");
|
2011-04-22 05:22:57 -07:00
|
|
|
}
|
2012-01-26 23:36:36 -08:00
|
|
|
if (elm_widget_item_disabled_get(it) != itc->disabled)
|
2011-04-22 05:22:57 -07:00
|
|
|
{
|
2012-01-26 23:36:36 -08:00
|
|
|
if (elm_widget_item_disabled_get(it))
|
2011-10-20 18:08:01 -07:00
|
|
|
edje_object_signal_emit(VIEW(it),
|
2011-04-22 05:22:57 -07:00
|
|
|
"elm,state,disabled", "elm");
|
2012-02-22 23:39:10 -08:00
|
|
|
if (it->edit_obj)
|
|
|
|
edje_object_signal_emit(it->edit_obj,
|
|
|
|
"elm,state,disabled", "elm");
|
2011-04-22 05:22:57 -07:00
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->expanded != itc->expanded)
|
2011-04-22 05:22:57 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->expanded)
|
2011-10-20 18:08:01 -07:00
|
|
|
edje_object_signal_emit(VIEW(it),
|
2011-04-22 05:22:57 -07:00
|
|
|
"elm,state,expanded", "elm");
|
2012-02-22 23:39:10 -08:00
|
|
|
if (it->edit_obj)
|
|
|
|
edje_object_signal_emit(it->edit_obj,
|
|
|
|
"elm,state,expanded", "elm");
|
2011-04-22 05:22:57 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (it->selected)
|
2012-02-22 23:39:10 -08:00
|
|
|
{
|
|
|
|
edje_object_signal_emit(VIEW(it),
|
|
|
|
"elm,state,selected", "elm");
|
|
|
|
if (it->edit_obj)
|
|
|
|
edje_object_signal_emit(it->edit_obj,
|
|
|
|
"elm,state,selected", "elm");
|
|
|
|
}
|
|
|
|
|
2012-01-26 23:36:36 -08:00
|
|
|
if (elm_widget_item_disabled_get(it))
|
2012-02-22 23:39:10 -08:00
|
|
|
{
|
|
|
|
edje_object_signal_emit(VIEW(it),
|
|
|
|
"elm,state,disabled", "elm");
|
|
|
|
if (it->edit_obj)
|
|
|
|
edje_object_signal_emit(it->edit_obj,
|
|
|
|
"elm,state,disabled", "elm");
|
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->expanded)
|
2012-02-22 23:39:10 -08:00
|
|
|
{
|
|
|
|
edje_object_signal_emit(VIEW(it),
|
|
|
|
"elm,state,expanded", "elm");
|
|
|
|
if (it->edit_obj)
|
|
|
|
edje_object_signal_emit(it->edit_obj,
|
|
|
|
"elm,state,expanded", "elm");
|
|
|
|
}
|
2011-04-22 05:22:57 -07:00
|
|
|
}
|
2011-04-22 02:56:22 -07:00
|
|
|
}
|
|
|
|
|
2010-11-05 23:02:22 -07:00
|
|
|
static void
|
|
|
|
_item_cache_free(Item_Cache *itc)
|
|
|
|
{
|
2010-12-07 11:18:14 -08:00
|
|
|
if (itc->spacer) evas_object_del(itc->spacer);
|
|
|
|
if (itc->base_view) evas_object_del(itc->base_view);
|
|
|
|
if (itc->item_style) eina_stringshare_del(itc->item_style);
|
|
|
|
free(itc);
|
2010-11-05 23:02:22 -07:00
|
|
|
}
|
|
|
|
|
2011-04-22 02:56:49 -07:00
|
|
|
static void
|
2011-12-15 07:24:17 -08:00
|
|
|
_item_text_realize(Elm_Gen_Item *it,
|
2011-04-22 05:22:57 -07:00
|
|
|
Evas_Object *target,
|
2011-11-29 06:03:14 -08:00
|
|
|
Eina_List **source,
|
|
|
|
const char *parts)
|
2011-04-22 02:56:49 -07:00
|
|
|
{
|
2011-11-30 22:15:08 -08:00
|
|
|
if (it->itc->func.text_get)
|
2011-04-22 02:56:49 -07:00
|
|
|
{
|
|
|
|
const Eina_List *l;
|
|
|
|
const char *key;
|
|
|
|
|
2011-12-14 08:36:09 -08:00
|
|
|
*source = elm_widget_stringlist_get(edje_object_data_get(target, "texts"));
|
2011-04-22 06:20:06 -07:00
|
|
|
EINA_LIST_FOREACH(*source, l, key)
|
2011-04-22 02:56:49 -07:00
|
|
|
{
|
2011-11-29 06:03:14 -08:00
|
|
|
if (parts && fnmatch(parts, key, FNM_PERIOD))
|
|
|
|
continue;
|
|
|
|
|
2011-11-30 22:15:08 -08:00
|
|
|
char *s = it->itc->func.text_get
|
2011-10-20 18:08:01 -07:00
|
|
|
((void *)it->base.data, WIDGET(it), key);
|
2011-04-22 02:56:49 -07:00
|
|
|
|
|
|
|
if (s)
|
|
|
|
{
|
|
|
|
edje_object_part_text_set(target, key, s);
|
|
|
|
free(s);
|
|
|
|
}
|
2011-04-22 05:22:57 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
edje_object_part_text_set(target, key, "");
|
|
|
|
}
|
2011-04-22 02:56:49 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-11-29 06:03:14 -08:00
|
|
|
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)
|
|
|
|
{
|
|
|
|
const Eina_List *l;
|
|
|
|
const char *key;
|
|
|
|
Evas_Object *ic = NULL;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(*source, l, key)
|
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2011-04-22 02:56:49 -07:00
|
|
|
static Eina_List *
|
2011-10-23 19:10:35 -07:00
|
|
|
_item_content_realize(Elm_Gen_Item *it,
|
2011-04-22 05:22:57 -07:00
|
|
|
Evas_Object *target,
|
2011-11-29 06:03:14 -08:00
|
|
|
Eina_List **source,
|
|
|
|
const char *parts)
|
2011-04-22 02:56:49 -07:00
|
|
|
{
|
|
|
|
Eina_List *res = NULL;
|
|
|
|
|
2011-10-23 19:10:35 -07:00
|
|
|
if (it->itc->func.content_get)
|
2011-04-22 02:56:49 -07:00
|
|
|
{
|
|
|
|
const Eina_List *l;
|
|
|
|
const char *key;
|
2011-10-23 19:10:35 -07:00
|
|
|
Evas_Object *ic = NULL;
|
2011-04-22 02:56:49 -07:00
|
|
|
|
2011-10-23 19:27:04 -07:00
|
|
|
*source = elm_widget_stringlist_get(edje_object_data_get(target, "contents"));
|
2011-11-29 06:03:14 -08:00
|
|
|
|
|
|
|
if (parts && (eina_list_count(*source) != eina_list_count(it->content_objs)))
|
|
|
|
res = it->content_objs;
|
|
|
|
|
2011-04-22 06:20:06 -07:00
|
|
|
EINA_LIST_FOREACH(*source, l, key)
|
2011-04-22 02:56:49 -07:00
|
|
|
{
|
2011-11-29 06:03:14 -08:00
|
|
|
if (parts && fnmatch(parts, key, FNM_PERIOD))
|
|
|
|
continue;
|
|
|
|
|
2011-10-23 19:10:35 -07:00
|
|
|
if (it->itc->func.content_get)
|
|
|
|
ic = it->itc->func.content_get
|
|
|
|
((void *)it->base.data, WIDGET(it), key);
|
2011-04-22 02:56:49 -07:00
|
|
|
if (ic)
|
|
|
|
{
|
2011-04-22 05:22:57 -07:00
|
|
|
res = eina_list_append(res, ic);
|
2011-04-22 06:20:06 -07:00
|
|
|
edje_object_part_swallow(target, key, ic);
|
2011-04-22 02:56:49 -07:00
|
|
|
evas_object_show(ic);
|
2011-10-20 18:08:01 -07:00
|
|
|
elm_widget_sub_object_add(WIDGET(it), ic);
|
2012-01-26 23:36:36 -08:00
|
|
|
if (elm_widget_item_disabled_get(it))
|
2011-05-05 19:07:00 -07:00
|
|
|
elm_widget_disabled_set(ic, EINA_TRUE);
|
2011-04-22 02:56:49 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-10-21 01:52:03 -07:00
|
|
|
_item_state_realize(Elm_Gen_Item *it,
|
2011-04-22 05:22:57 -07:00
|
|
|
Evas_Object *target,
|
2011-11-29 06:03:14 -08:00
|
|
|
Eina_List **source,
|
|
|
|
const char *parts)
|
2011-04-22 02:56:49 -07:00
|
|
|
{
|
|
|
|
if (it->itc->func.state_get)
|
|
|
|
{
|
|
|
|
const Eina_List *l;
|
|
|
|
const char *key;
|
2011-04-22 05:22:57 -07:00
|
|
|
char buf[4096];
|
2011-04-22 02:56:49 -07:00
|
|
|
|
2011-04-22 06:20:06 -07:00
|
|
|
*source = elm_widget_stringlist_get(edje_object_data_get(target, "states"));
|
|
|
|
EINA_LIST_FOREACH(*source, l, key)
|
2011-04-22 02:56:49 -07:00
|
|
|
{
|
2011-11-29 06:03:14 -08:00
|
|
|
if (parts && fnmatch(parts, key, FNM_PERIOD))
|
|
|
|
continue;
|
|
|
|
|
2011-04-22 02:56:49 -07:00
|
|
|
Eina_Bool on = it->itc->func.state_get
|
2011-10-20 18:08:01 -07:00
|
|
|
((void *)it->base.data, WIDGET(it), key);
|
2011-04-22 02:56:49 -07:00
|
|
|
|
|
|
|
if (on)
|
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "elm,state,%s,active", key);
|
|
|
|
edje_object_signal_emit(target, buf, "elm");
|
|
|
|
}
|
2011-04-22 05:22:57 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "elm,state,%s,passive", key);
|
|
|
|
edje_object_signal_emit(target, buf, "elm");
|
|
|
|
}
|
2011-04-22 02:56:49 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-02-11 03:49:43 -08:00
|
|
|
static void
|
2011-10-21 01:52:03 -07:00
|
|
|
_item_realize(Elm_Gen_Item *it,
|
2011-03-22 00:54:24 -07:00
|
|
|
int in,
|
|
|
|
Eina_Bool calc)
|
2009-02-11 03:49:43 -08:00
|
|
|
{
|
2009-03-14 11:03:19 -07:00
|
|
|
const char *treesize;
|
2009-02-12 05:39:43 -08:00
|
|
|
char buf[1024];
|
2011-12-05 17:37:53 -08:00
|
|
|
int tsize = 20;
|
2011-01-31 02:33:22 -08:00
|
|
|
Item_Cache *itc = NULL;
|
2010-12-07 11:18:14 -08:00
|
|
|
|
2011-12-02 05:43:02 -08:00
|
|
|
if (it->generation < it->wd->generation) return;
|
2011-06-08 09:56:50 -07:00
|
|
|
//evas_event_freeze(evas_object_evas_get(it->wd->obj));
|
2011-04-22 02:56:22 -07:00
|
|
|
if (it->realized)
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->order_num_in != in)
|
2011-04-22 05:22:57 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->order_num_in = in;
|
2011-04-22 05:22:57 -07:00
|
|
|
_elm_genlist_item_odd_even_update(it);
|
|
|
|
_elm_genlist_item_state_update(it, NULL);
|
2011-12-26 06:30:21 -08:00
|
|
|
_elm_genlist_item_index_update(it);
|
2011-04-22 05:22:57 -07:00
|
|
|
}
|
2011-06-08 09:56:50 -07:00
|
|
|
//evas_event_thaw(evas_object_evas_get(it->wd->obj));
|
|
|
|
//evas_event_thaw_eval(evas_object_evas_get(it->wd->obj));
|
2011-04-22 05:22:57 -07:00
|
|
|
return;
|
2011-04-22 02:56:22 -07:00
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->order_num_in = in;
|
2010-11-05 23:02:22 -07:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->nocache)
|
|
|
|
it->item->nocache = EINA_FALSE;
|
2011-01-31 02:33:22 -08:00
|
|
|
else
|
2011-03-22 00:54:24 -07:00
|
|
|
itc = _item_cache_find(it);
|
2010-11-05 23:02:22 -07:00
|
|
|
if (itc)
|
|
|
|
{
|
2011-10-20 18:08:01 -07:00
|
|
|
VIEW(it) = itc->base_view;
|
2010-11-05 23:02:22 -07:00
|
|
|
itc->base_view = NULL;
|
|
|
|
it->spacer = itc->spacer;
|
|
|
|
itc->spacer = NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-04-22 02:56:22 -07:00
|
|
|
const char *stacking_even;
|
2011-04-22 05:22:57 -07:00
|
|
|
const char *stacking;
|
2011-04-22 02:56:22 -07:00
|
|
|
|
2011-10-20 18:08:01 -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)) *
|
2010-12-07 11:18:14 -08:00
|
|
|
_elm_config->scale);
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_member_add(VIEW(it), it->wd->pan_smart);
|
|
|
|
elm_widget_sub_object_add(WIDGET(it), VIEW(it));
|
2010-12-07 11:18:14 -08:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->flags & ELM_GENLIST_ITEM_SUBITEMS)
|
2010-12-07 11:18:14 -08:00
|
|
|
strncpy(buf, "tree", sizeof(buf));
|
2011-10-20 20:23:42 -07:00
|
|
|
else strncpy(buf, "item", sizeof(buf));
|
2010-12-07 11:18:14 -08:00
|
|
|
if (it->wd->compress)
|
|
|
|
strncat(buf, "_compress", sizeof(buf) - strlen(buf));
|
|
|
|
|
|
|
|
strncat(buf, "/", sizeof(buf) - strlen(buf));
|
|
|
|
strncat(buf, it->itc->item_style, sizeof(buf) - strlen(buf));
|
|
|
|
|
2011-10-20 18:08:01 -07:00
|
|
|
_elm_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
|
|
|
|
2011-10-20 18:08:01 -07:00
|
|
|
edje_object_mirrored_set(VIEW(it),
|
|
|
|
elm_widget_mirrored_get(WIDGET(it)));
|
2010-12-07 11:18:14 -08:00
|
|
|
it->spacer =
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_rectangle_add(evas_object_evas_get(WIDGET(it)));
|
2010-12-07 11:18:14 -08:00
|
|
|
evas_object_color_set(it->spacer, 0, 0, 0, 0);
|
2011-10-20 18:08:01 -07:00
|
|
|
elm_widget_sub_object_add(WIDGET(it), it->spacer);
|
2010-11-05 23:02:22 -07:00
|
|
|
}
|
2011-04-22 02:56:22 -07:00
|
|
|
|
|
|
|
_elm_genlist_item_odd_even_update(it);
|
|
|
|
|
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);
|
2009-09-23 15:56:47 -07:00
|
|
|
evas_object_size_hint_min_set(it->spacer,
|
2011-12-05 17:37:53 -08:00
|
|
|
(it->item->expanded_depth * tsize) * _elm_config->scale, 1);
|
2011-10-20 18:08:01 -07:00
|
|
|
edje_object_part_swallow(VIEW(it), "elm.swallow.pad", it->spacer);
|
2009-02-12 05:39:43 -08:00
|
|
|
if (!calc)
|
|
|
|
{
|
2011-10-20 18:08:01 -07:00
|
|
|
edje_object_signal_callback_add(VIEW(it),
|
2010-12-07 11:18:14 -08:00
|
|
|
"elm,action,expand,toggle",
|
2009-09-04 08:39:30 -07:00
|
|
|
"elm", _signal_expand_toggle, it);
|
2011-10-20 18:08:01 -07:00
|
|
|
edje_object_signal_callback_add(VIEW(it), "elm,action,expand",
|
2010-12-07 11:18:14 -08:00
|
|
|
"elm", _signal_expand, it);
|
2011-10-20 18:08:01 -07:00
|
|
|
edje_object_signal_callback_add(VIEW(it), "elm,action,contract",
|
2009-09-04 08:39:30 -07:00
|
|
|
"elm", _signal_contract, it);
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOUSE_DOWN,
|
2010-10-15 04:51:15 -07:00
|
|
|
_mouse_down, it);
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOUSE_UP,
|
2010-10-15 04:51:15 -07:00
|
|
|
_mouse_up, it);
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOUSE_MOVE,
|
2010-10-15 04:51:15 -07:00
|
|
|
_mouse_move, it);
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MULTI_DOWN,
|
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
|
|
|
_multi_down, it);
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MULTI_UP,
|
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
|
|
|
_multi_up, it);
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MULTI_MOVE,
|
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
|
|
|
_multi_move, it);
|
2011-04-22 02:56:22 -07:00
|
|
|
|
2012-02-22 23:39:10 -08:00
|
|
|
if ((it->wd->edit_mode) && (!it->edit_obj) &&
|
|
|
|
(it->item->flags != ELM_GENLIST_ITEM_GROUP) && (it->itc->edit_item_style))
|
|
|
|
_edit_mode_item_realize(it, EINA_FALSE);
|
|
|
|
|
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
|
|
|
|
2011-06-03 18:52:08 -07:00
|
|
|
if ((calc) && (it->wd->homogeneous) &&
|
|
|
|
((it->wd->item_width) ||
|
|
|
|
((it->wd->item_width) && (it->wd->group_item_width))))
|
2009-02-11 03:49:43 -08:00
|
|
|
{
|
2010-10-15 04:51:15 -07:00
|
|
|
/* homogenous genlist shortcut */
|
2011-10-21 01:52:03 -07:00
|
|
|
if (!it->item->mincalcd)
|
2011-03-29 05:43:03 -07:00
|
|
|
{
|
2011-10-23 20:40:54 -07:00
|
|
|
if (it->group)
|
2011-03-29 05:43:03 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->w = it->item->minw = it->wd->group_item_width;
|
|
|
|
it->item->h = it->item->minh = it->wd->group_item_height;
|
2011-03-29 05:43:03 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->w = it->item->minw = it->wd->item_width;
|
|
|
|
it->item->h = it->item->minh = it->wd->item_height;
|
2011-03-29 05:43:03 -07:00
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->mincalcd = EINA_TRUE;
|
2011-03-29 05:43:03 -07:00
|
|
|
}
|
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
|
|
|
{
|
2011-04-26 19:42:50 -07:00
|
|
|
/* FIXME: If you see that assert, please notify us and we
|
2011-04-22 05:22:57 -07:00
|
|
|
will clean our mess */
|
2011-10-23 19:10:35 -07:00
|
|
|
assert(eina_list_count(it->content_objs) == 0);
|
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);
|
2011-11-29 06:03:14 -08:00
|
|
|
it->content_objs = _item_content_realize(it, VIEW(it), &it->contents, NULL);
|
|
|
|
_item_state_realize(it, VIEW(it), &it->states, NULL);
|
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
|
|
|
|
2010-02-04 00:06:41 -08:00
|
|
|
if (!it->display_only)
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
2010-11-20 00:43:43 -08:00
|
|
|
if (it->wd->height_for_width) mw = it->wd->prev_viewport_w;
|
2011-10-20 18:08:01 -07:00
|
|
|
edje_object_size_min_restricted_calc(VIEW(it), &mw, &mh, mw,
|
2010-12-07 11:18:14 -08:00
|
|
|
mh);
|
2010-02-04 00:06:41 -08:00
|
|
|
if (!it->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
|
|
|
|
2011-10-23 20:40:54 -07:00
|
|
|
if ((!it->wd->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
|
|
|
{
|
|
|
|
it->wd->group_item_width = mw;
|
|
|
|
it->wd->group_item_height = mh;
|
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
else if ((!it->wd->item_width) && (it->item->flags == ELM_GENLIST_ITEM_NONE))
|
2010-10-15 04:51:15 -07:00
|
|
|
{
|
|
|
|
it->wd->item_width = mw;
|
|
|
|
it->wd->item_height = mh;
|
|
|
|
}
|
|
|
|
}
|
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)
|
|
|
|
{
|
2010-10-15 04:51:15 -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);
|
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-08 09:56:50 -07:00
|
|
|
//evas_event_thaw(evas_object_evas_get(it->wd->obj));
|
|
|
|
//evas_event_thaw_eval(evas_object_evas_get(it->wd->obj));
|
2011-06-03 18:52:08 -07:00
|
|
|
if (!calc)
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_REALIZED, it);
|
2012-02-22 23:39:10 -08:00
|
|
|
|
|
|
|
if ((!calc) && (it->wd->edit_mode) && (it->item->flags != ELM_GENLIST_ITEM_GROUP))
|
|
|
|
{
|
|
|
|
if (it->itc->edit_item_style)
|
|
|
|
{
|
|
|
|
if (!it->edit_obj) _edit_mode_item_realize(it, EINA_FALSE);
|
|
|
|
edje_object_message_signal_process(it->edit_obj);
|
|
|
|
}
|
|
|
|
}
|
2011-10-20 18:08:01 -07:00
|
|
|
edje_object_message_signal_process(VIEW(it));
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-10-21 01:52:03 -07:00
|
|
|
_item_unrealize_cb(Elm_Gen_Item *it)
|
2009-02-11 03:49:43 -08:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->nocache)
|
2011-01-31 02:33:22 -08:00
|
|
|
{
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_del(VIEW(it));
|
|
|
|
VIEW(it) = NULL;
|
2011-01-31 02:33:22 -08:00
|
|
|
evas_object_del(it->spacer);
|
|
|
|
it->spacer = NULL;
|
|
|
|
}
|
|
|
|
else
|
2011-02-08 04:08:28 -08:00
|
|
|
{
|
2011-10-20 18:08:01 -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))
|
2011-06-03 18:52:08 -07:00
|
|
|
* _elm_config->scale);
|
2011-02-08 04:08:28 -08:00
|
|
|
_item_cache_add(it);
|
|
|
|
}
|
2009-02-25 12:18:38 -08:00
|
|
|
|
2011-04-21 04:47:36 -07:00
|
|
|
_mode_item_unrealize(it);
|
2009-02-12 05:39:43 -08:00
|
|
|
it->states = NULL;
|
2009-06-17 08:35:19 -07:00
|
|
|
it->realized = EINA_FALSE;
|
2010-03-26 21:17:01 -07:00
|
|
|
it->want_unrealize = EINA_FALSE;
|
2012-02-22 23:39:10 -08:00
|
|
|
if (it->wd->edit_mode) _edit_mode_item_unrealize(it);
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
|
|
|
|
2011-03-18 07:29:48 -07:00
|
|
|
static Eina_Bool
|
2010-12-07 11:18:14 -08:00
|
|
|
_item_block_recalc(Item_Block *itb,
|
|
|
|
int in,
|
2011-06-08 03:58:00 -07:00
|
|
|
Eina_Bool qadd)
|
2009-02-11 03:49:43 -08:00
|
|
|
{
|
2009-02-25 11:50:45 -08:00
|
|
|
const Eina_List *l;
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it;
|
2009-02-11 03:49:43 -08:00
|
|
|
Evas_Coord minw = 0, minh = 0;
|
2010-12-20 09:03:12 -08:00
|
|
|
Eina_Bool showme = EINA_FALSE, changed = EINA_FALSE;
|
2009-02-17 20:18:25 -08:00
|
|
|
Evas_Coord y = 0;
|
2009-02-25 11:50:45 -08:00
|
|
|
|
2011-06-08 09:56:50 -07:00
|
|
|
//evas_event_freeze(evas_object_evas_get(itb->wd->obj));
|
2010-01-23 01:07:20 -08:00
|
|
|
itb->num = in;
|
2009-02-25 11:50:45 -08:00
|
|
|
EINA_LIST_FOREACH(itb->items, l, it)
|
2009-02-11 03:49:43 -08:00
|
|
|
{
|
2011-12-02 05:43:02 -08:00
|
|
|
if (it->generation < it->wd->generation) continue;
|
2011-10-21 01:52:03 -07:00
|
|
|
showme |= it->item->showme;
|
2010-10-15 04:51:15 -07:00
|
|
|
if (!itb->realized)
|
|
|
|
{
|
2010-01-23 01:07:20 -08:00
|
|
|
if (qadd)
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
if (!it->item->mincalcd) changed = EINA_TRUE;
|
2010-01-23 01:07:20 -08:00
|
|
|
if (changed)
|
|
|
|
{
|
2011-03-18 08:02:49 -07:00
|
|
|
_item_realize(it, in, EINA_TRUE);
|
2011-11-30 09:31:01 -08:00
|
|
|
_elm_genlist_item_unrealize(it, EINA_TRUE);
|
2010-01-23 01:07:20 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-03-18 08:02:49 -07:00
|
|
|
_item_realize(it, in, EINA_TRUE);
|
2011-11-30 09:31:01 -08:00
|
|
|
_elm_genlist_item_unrealize(it, EINA_TRUE);
|
2010-01-23 01:07:20 -08:00
|
|
|
}
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
|
|
|
else
|
2011-03-18 08:02:49 -07:00
|
|
|
_item_realize(it, in, EINA_FALSE);
|
2011-10-21 01:52:03 -07:00
|
|
|
minh += it->item->minh;
|
|
|
|
if (minw < it->item->minw) minw = it->item->minw;
|
2010-10-15 04:51:15 -07:00
|
|
|
in++;
|
|
|
|
it->x = 0;
|
|
|
|
it->y = y;
|
2011-10-21 01:52:03 -07:00
|
|
|
y += it->item->h;
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
|
|
|
itb->minw = minw;
|
|
|
|
itb->minh = minh;
|
2009-06-17 08:35:19 -07:00
|
|
|
itb->changed = EINA_FALSE;
|
2011-12-26 06:30:21 -08:00
|
|
|
itb->position_update = EINA_FALSE;
|
2011-06-08 09:56:50 -07:00
|
|
|
//evas_event_thaw(evas_object_evas_get(itb->wd->obj));
|
|
|
|
//evas_event_thaw_eval(evas_object_evas_get(itb->wd->obj));
|
2009-02-17 06:39:08 -08:00
|
|
|
return showme;
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-06-08 03:48:20 -07:00
|
|
|
_item_block_realize(Item_Block *itb)
|
2009-02-11 03:49:43 -08:00
|
|
|
{
|
|
|
|
if (itb->realized) return;
|
2009-06-17 08:35:19 -07:00
|
|
|
itb->realized = EINA_TRUE;
|
2010-03-26 21:17:01 -07:00
|
|
|
itb->want_unrealize = EINA_FALSE;
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_block_unrealize(Item_Block *itb)
|
|
|
|
{
|
2009-02-25 11:50:45 -08:00
|
|
|
const Eina_List *l;
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it;
|
2010-12-20 09:03:12 -08:00
|
|
|
Eina_Bool dragging = EINA_FALSE;
|
2009-02-25 11:50:45 -08:00
|
|
|
|
2009-02-11 03:49:43 -08:00
|
|
|
if (!itb->realized) return;
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(itb->wd->obj));
|
2009-02-25 11:50:45 -08:00
|
|
|
EINA_LIST_FOREACH(itb->items, l, it)
|
2009-10-07 07:02:55 -07:00
|
|
|
{
|
2011-12-25 21:32:40 -08:00
|
|
|
if (itb->must_recalc || !it->group)
|
2009-10-07 07:02:55 -07:00
|
|
|
{
|
2011-01-05 21:13:11 -08:00
|
|
|
if (it->dragging)
|
|
|
|
{
|
|
|
|
dragging = EINA_TRUE;
|
|
|
|
it->want_unrealize = EINA_TRUE;
|
|
|
|
}
|
|
|
|
else
|
2011-11-30 09:31:01 -08:00
|
|
|
_elm_genlist_item_unrealize(it, EINA_FALSE);
|
2009-10-07 07:02:55 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!dragging)
|
2010-03-26 21:17:01 -07:00
|
|
|
{
|
|
|
|
itb->realized = EINA_FALSE;
|
|
|
|
itb->want_unrealize = EINA_TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
itb->want_unrealize = EINA_FALSE;
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(itb->wd->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(itb->wd->obj));
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
|
|
|
|
2011-06-01 20:10:11 -07:00
|
|
|
static int
|
2011-10-21 01:52:03 -07:00
|
|
|
_get_space_for_reorder_item(Elm_Gen_Item *it)
|
2011-06-01 20:10:11 -07:00
|
|
|
{
|
|
|
|
Evas_Coord rox, roy, row, roh, oy, oh;
|
|
|
|
Eina_Bool top = EINA_FALSE;
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *reorder_it = it->wd->reorder_it;
|
2011-06-01 20:10:11 -07:00
|
|
|
if (!reorder_it) return 0;
|
2011-06-01 21:24:58 -07:00
|
|
|
|
2011-06-01 20:10:11 -07:00
|
|
|
evas_object_geometry_get(it->wd->pan_smart, NULL, &oy, NULL, &oh);
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_geometry_get(it->wd->VIEW(reorder_it), &rox, &roy, &row, &roh);
|
2011-06-01 21:24:58 -07:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
if ((it->wd->reorder_start_y < it->item->block->y) &&
|
|
|
|
(roy - oy + (roh / 2) >= it->item->block->y - it->wd->pan_y))
|
2011-06-01 20:10:11 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->block->reorder_offset = it->wd->reorder_it->item->h * -1;
|
|
|
|
if (it->item->block->count == 1)
|
2011-09-05 05:14:20 -07:00
|
|
|
it->wd->reorder_rel = it;
|
2011-06-01 20:10:11 -07:00
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
else if ((it->wd->reorder_start_y >= it->item->block->y) &&
|
|
|
|
(roy - oy + (roh / 2) <= it->item->block->y - it->wd->pan_y))
|
2011-06-01 20:10:11 -07:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->block->reorder_offset = it->wd->reorder_it->item->h;
|
2011-06-01 20:10:11 -07:00
|
|
|
}
|
|
|
|
else
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->block->reorder_offset = 0;
|
2011-06-01 21:24:58 -07:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->scrl_y += it->item->block->reorder_offset;
|
2011-06-01 21:24:58 -07:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
top = (ELM_RECTS_INTERSECT(it->item->scrl_x, it->item->scrl_y, it->item->w, it->item->h,
|
2011-06-01 20:10:11 -07:00
|
|
|
rox, roy + (roh / 2), row, 1));
|
|
|
|
if (top)
|
|
|
|
{
|
|
|
|
it->wd->reorder_rel = it;
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->scrl_y += it->wd->reorder_it->item->h;
|
|
|
|
return it->wd->reorder_it->item->h;
|
2011-06-01 20:10:11 -07:00
|
|
|
}
|
|
|
|
else
|
2011-06-23 02:51:03 -07:00
|
|
|
return 0;
|
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
|
|
|
{
|
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;
|
2011-06-08 03:58:00 -07:00
|
|
|
double t;
|
2011-10-21 01:52:03 -07:00
|
|
|
int y, dy = it->item->h / 10 * _elm_config->scale, diff;
|
2011-06-01 21:24:58 -07:00
|
|
|
|
2011-06-01 20:10:11 -07:00
|
|
|
t = ((0.0 > (t = ecore_loop_time_get()-it->wd->start_time)) ? 0.0 : t);
|
2011-06-01 21:24:58 -07:00
|
|
|
|
2011-06-08 03:58:00 -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
|
|
|
|
|
|
|
if (it->edit_obj)
|
|
|
|
_item_position(it, it->edit_obj, it->item->scrl_x, it->item->old_scrl_y);
|
|
|
|
else
|
|
|
|
_item_position(it, VIEW(it), it->item->scrl_x, it->item->old_scrl_y);
|
2011-06-01 20:10:11 -07:00
|
|
|
_group_items_recalc(it->wd);
|
2011-06-01 21:24:58 -07:00
|
|
|
|
2011-06-01 20:10:11 -07:00
|
|
|
if ((it->wd->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;
|
2011-06-03 18:52:08 -07:00
|
|
|
it->wd->reorder_move_animator = NULL;
|
2011-06-01 20:10:11 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
|
2011-04-21 04:47:36 -07:00
|
|
|
static void
|
2011-10-21 01:52:03 -07:00
|
|
|
_item_position(Elm_Gen_Item *it,
|
2011-06-03 18:52:08 -07:00
|
|
|
Evas_Object *view,
|
|
|
|
Evas_Coord it_x,
|
|
|
|
Evas_Coord it_y)
|
2011-04-21 04:47:36 -07:00
|
|
|
{
|
|
|
|
if (!it) return;
|
|
|
|
if (!view) return;
|
|
|
|
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(it->wd->obj));
|
2011-10-21 01:52:03 -07:00
|
|
|
evas_object_resize(view, it->item->w, it->item->h);
|
2011-06-01 20:10:11 -07:00
|
|
|
evas_object_move(view, it_x, it_y);
|
2011-04-21 04:47:36 -07:00
|
|
|
evas_object_show(view);
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(it->wd->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(it->wd->obj));
|
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,
|
|
|
|
int in)
|
2009-02-11 03:49:43 -08:00
|
|
|
{
|
2009-02-25 11:50:45 -08:00
|
|
|
const Eina_List *l;
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it;
|
|
|
|
Elm_Gen_Item *git;
|
2010-01-16 04:35:31 -08:00
|
|
|
Evas_Coord y = 0, ox, oy, ow, oh, cvx, cvy, cvw, cvh;
|
2011-11-29 00:54:19 -08:00
|
|
|
Eina_Bool vis = EINA_FALSE;
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(itb->wd->obj));
|
2009-05-11 06:10:19 -07:00
|
|
|
evas_object_geometry_get(itb->wd->pan_smart, &ox, &oy, &ow, &oh);
|
2010-12-07 11:18:14 -08:00
|
|
|
evas_output_viewport_get(evas_object_evas_get(itb->wd->obj), &cvx, &cvy,
|
|
|
|
&cvw, &cvh);
|
2009-02-25 11:50:45 -08:00
|
|
|
EINA_LIST_FOREACH(itb->items, l, it)
|
2009-02-11 03:49:43 -08:00
|
|
|
{
|
2011-12-02 05:43:02 -08:00
|
|
|
if (it->generation < it->wd->generation) continue;
|
2011-06-01 20:10:11 -07:00
|
|
|
else if (it->wd->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;
|
|
|
|
it->item->scrl_x = itb->x + it->x - it->wd->pan_x + ox;
|
|
|
|
it->item->scrl_y = itb->y + it->y - it->wd->pan_y + oy;
|
2011-01-05 21:13:11 -08:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
vis = (ELM_RECTS_INTERSECT(it->item->scrl_x, it->item->scrl_y, it->item->w, it->item->h,
|
2011-01-31 00:30:11 -08:00
|
|
|
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
|
|
|
{
|
2011-01-05 21:13:11 -08:00
|
|
|
if (vis)
|
|
|
|
{
|
2011-06-01 20:10:11 -07:00
|
|
|
if (it->wd->reorder_mode)
|
2011-09-05 05:14:20 -07:00
|
|
|
y += _get_space_for_reorder_item(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;
|
|
|
|
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;
|
|
|
|
git->item->want_realize = EINA_TRUE;
|
2011-01-05 21:13:11 -08:00
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
if ((it->wd->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;
|
2011-06-03 18:52:08 -07:00
|
|
|
it->wd->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-02-22 23:39:10 -08:00
|
|
|
if ((it->wd->edit_mode) && (it->itc->edit_item_style))
|
|
|
|
_edit_mode_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
|
|
|
{
|
|
|
|
if (it->item->mode_view)
|
|
|
|
_item_position(it, it->item->mode_view,
|
|
|
|
it->item->scrl_x,
|
|
|
|
it->item->scrl_y);
|
|
|
|
else
|
|
|
|
_item_position(it, VIEW(it), it->item->scrl_x,
|
|
|
|
it->item->scrl_y);
|
|
|
|
}
|
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
|
|
|
|
{
|
2011-11-30 09:31:01 -08:00
|
|
|
if (!it->dragging) _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
|
|
|
}
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(itb->wd->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(itb->wd->obj));
|
2011-01-05 21:13:11 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_group_items_recalc(void *data)
|
|
|
|
{
|
|
|
|
Widget_Data *wd = data;
|
|
|
|
Eina_List *l;
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *git;
|
2011-01-05 21:13:11 -08:00
|
|
|
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(wd->obj));
|
2011-01-05 21:13:11 -08:00
|
|
|
EINA_LIST_FOREACH(wd->group_items, l, git)
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
if (git->item->want_realize)
|
2011-01-05 21:13:11 -08:00
|
|
|
{
|
|
|
|
if (!git->realized)
|
2011-03-22 00:54:24 -07:00
|
|
|
_item_realize(git, 0, EINA_FALSE);
|
2011-10-21 01:52:03 -07:00
|
|
|
evas_object_resize(VIEW(git), wd->minw, git->item->h);
|
|
|
|
evas_object_move(VIEW(git), git->item->scrl_x, git->item->scrl_y);
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_show(VIEW(git));
|
|
|
|
evas_object_raise(VIEW(git));
|
2011-01-05 21:13:11 -08:00
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
else if (!git->item->want_realize && git->realized)
|
2011-01-05 21:13:11 -08:00
|
|
|
{
|
2011-03-18 07:29:48 -07:00
|
|
|
if (!git->dragging)
|
2011-11-30 09:31:01 -08:00
|
|
|
_elm_genlist_item_unrealize(git, EINA_FALSE);
|
2011-01-05 21:13:11 -08:00
|
|
|
}
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(wd->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(wd->obj));
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
|
|
|
|
2010-11-20 00:43:43 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_must_recalc_idler(void *data)
|
|
|
|
{
|
2010-12-07 11:18:14 -08:00
|
|
|
Widget_Data *wd = data;
|
|
|
|
if (wd->calc_job) ecore_job_del(wd->calc_job);
|
|
|
|
wd->calc_job = ecore_job_add(_calc_job, wd);
|
|
|
|
wd->must_recalc_idler = NULL;
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2010-11-20 00:43:43 -08:00
|
|
|
}
|
|
|
|
|
2011-12-23 20:20:18 -08:00
|
|
|
static void
|
|
|
|
_scroll_item(Widget_Data *wd)
|
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Gen_Item *it = NULL;
|
2011-12-23 20:20:18 -08:00
|
|
|
Evas_Coord gith = 0;
|
|
|
|
Evas_Coord ow, oh, dx = 0, dy = 0, dw = 0, dh = 0;
|
|
|
|
|
|
|
|
evas_object_geometry_get(wd->pan_smart, NULL, NULL, &ow, &oh);
|
|
|
|
it = wd->show_item;
|
|
|
|
dx = it->x + it->item->block->x;
|
|
|
|
dy = it->y + it->item->block->y;
|
|
|
|
dw = it->item->block->w;
|
|
|
|
dh = oh;
|
|
|
|
switch (wd->scrollto_type)
|
|
|
|
{
|
|
|
|
case ELM_GENLIST_ITEM_SCROLLTO_TOP:
|
|
|
|
if (it->item->group_item) gith = it->item->group_item->item->h;
|
|
|
|
dy -= gith;
|
|
|
|
break;
|
|
|
|
case ELM_GENLIST_ITEM_SCROLLTO_MIDDLE:
|
|
|
|
dy += (it->item->h / 2 - oh / 2);
|
|
|
|
break;
|
|
|
|
case ELM_GENLIST_ITEM_SCROLLTO_IN:
|
|
|
|
default:
|
|
|
|
if ((wd->expanded_item) &&
|
|
|
|
((wd->show_item->y + wd->show_item->item->block->y + wd->show_item->item->h)
|
|
|
|
- (wd->expanded_item->y + wd->expanded_item->item->block->y) > oh))
|
|
|
|
{
|
|
|
|
it = wd->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;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((it->item->group_item) && (wd->pan_y > (it->y + it->item->block->y)))
|
|
|
|
gith = it->item->group_item->item->h;
|
|
|
|
dy -= gith;
|
|
|
|
dh = it->item->h;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (wd->bring_in)
|
|
|
|
elm_smart_scroller_region_bring_in(wd->scr, dx, dy, dw, dh);
|
|
|
|
else
|
|
|
|
elm_smart_scroller_child_region_show(wd->scr, dx, dy, dw, dh);
|
|
|
|
|
|
|
|
it->item->showme = EINA_FALSE;
|
|
|
|
wd->show_item = NULL;
|
|
|
|
wd->auto_scroll_enabled = EINA_FALSE;
|
|
|
|
wd->check_scroll = EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2009-02-10 03:57:47 -08:00
|
|
|
static void
|
2009-02-12 05:39:43 -08:00
|
|
|
_calc_job(void *data)
|
2009-02-10 03:57:47 -08:00
|
|
|
{
|
2009-02-12 05:39:43 -08:00
|
|
|
Widget_Data *wd = data;
|
2011-06-03 18:52:08 -07:00
|
|
|
Item_Block *itb, *chb = NULL;
|
2012-02-13 00:50:18 -08:00
|
|
|
Evas_Coord minw = -1, minh = 0, y = 0, ow, dy = 0, vw;
|
2011-12-23 20:20:18 -08:00
|
|
|
Evas_Coord pan_w = 0, pan_h = 0;
|
2011-06-03 18:52:08 -07:00
|
|
|
int in = 0;
|
2011-09-27 22:56:28 -07:00
|
|
|
Eina_Bool minw_change = EINA_FALSE;
|
2010-11-20 00:43:43 -08:00
|
|
|
Eina_Bool did_must_recalc = EINA_FALSE;
|
2010-03-09 06:42:41 -08:00
|
|
|
if (!wd) return;
|
2010-10-07 12:57:20 -07:00
|
|
|
|
|
|
|
evas_object_geometry_get(wd->pan_smart, NULL, NULL, &ow, &wd->h);
|
2012-02-13 00:50:18 -08:00
|
|
|
elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, NULL);
|
|
|
|
|
2010-10-07 12:57:20 -07:00
|
|
|
if (wd->w != ow)
|
2011-05-24 03:51:26 -07:00
|
|
|
wd->w = ow;
|
2010-10-07 12:57:20 -07:00
|
|
|
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(wd->obj));
|
2009-02-25 08:22:29 -08:00
|
|
|
EINA_INLIST_FOREACH(wd->blocks, itb)
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
|
|
|
Eina_Bool showme = EINA_FALSE;
|
|
|
|
|
|
|
|
itb->num = in;
|
|
|
|
showme = itb->showme;
|
|
|
|
itb->showme = EINA_FALSE;
|
|
|
|
if (chb)
|
|
|
|
{
|
|
|
|
if (itb->realized) _item_block_unrealize(itb);
|
|
|
|
}
|
2011-09-27 22:56:28 -07:00
|
|
|
if ((itb->changed) || ((itb->must_recalc) && (!did_must_recalc)))
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
2011-09-27 22:56:28 -07:00
|
|
|
if (itb->must_recalc)
|
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
|
|
|
EINA_LIST_FOREACH(itb->items, l, it)
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->mincalcd) it->item->mincalcd = EINA_FALSE;
|
2011-03-22 00:54:24 -07:00
|
|
|
itb->changed = EINA_TRUE;
|
|
|
|
if (itb->must_recalc) did_must_recalc = EINA_TRUE;
|
2011-12-25 21:32:40 -08:00
|
|
|
if (itb->realized) _item_block_unrealize(itb);
|
2011-03-22 00:54:24 -07:00
|
|
|
itb->must_recalc = EINA_FALSE;
|
|
|
|
}
|
2011-06-08 03:58:00 -07:00
|
|
|
showme = _item_block_recalc(itb, in, EINA_FALSE);
|
2011-03-22 00:54:24 -07:00
|
|
|
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;
|
2011-06-03 18:52:08 -07:00
|
|
|
minw_change = EINA_TRUE;
|
2011-03-22 00:54:24 -07:00
|
|
|
}
|
2012-02-13 00:50:18 -08:00
|
|
|
if (minw > vw)
|
|
|
|
{
|
|
|
|
minw = vw;
|
|
|
|
minw_change = EINA_TRUE;
|
|
|
|
}
|
2011-03-22 00:54:24 -07:00
|
|
|
itb->w = minw;
|
|
|
|
itb->h = itb->minh;
|
|
|
|
y += itb->h;
|
|
|
|
in += itb->count;
|
2011-10-21 01:52:03 -07:00
|
|
|
if ((showme) && (wd->show_item) && (!wd->show_item->item->queued))
|
2011-12-23 20:20:18 -08:00
|
|
|
wd->check_scroll = EINA_TRUE;
|
2011-03-22 00:54:24 -07:00
|
|
|
}
|
2009-02-17 20:18:25 -08:00
|
|
|
if (minw_change)
|
|
|
|
{
|
2010-10-15 04:51:15 -07:00
|
|
|
EINA_INLIST_FOREACH(wd->blocks, itb)
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
|
|
|
itb->minw = minw;
|
|
|
|
itb->w = itb->minw;
|
|
|
|
}
|
2009-02-17 20:18:25 -08:00
|
|
|
}
|
2009-02-25 08:22:29 -08:00
|
|
|
if ((chb) && (EINA_INLIST_GET(chb)->next))
|
2009-02-17 20:18:25 -08:00
|
|
|
{
|
2010-10-15 04:51:15 -07:00
|
|
|
EINA_INLIST_FOREACH(EINA_INLIST_GET(chb)->next, itb)
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
|
|
|
if (itb->realized) _item_block_unrealize(itb);
|
|
|
|
}
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
2010-09-28 01:46:08 -07:00
|
|
|
wd->realminw = minw;
|
2010-10-07 12:57:20 -07:00
|
|
|
if (minw < wd->w) minw = wd->w;
|
2009-02-12 05:39:43 -08:00
|
|
|
if ((minw != wd->minw) || (minh != wd->minh))
|
2009-02-11 03:49:43 -08:00
|
|
|
{
|
2010-10-15 04:51:15 -07:00
|
|
|
wd->minw = minw;
|
|
|
|
wd->minh = minh;
|
|
|
|
evas_object_smart_callback_call(wd->pan_smart, "changed", NULL);
|
|
|
|
_sizing_eval(wd->obj);
|
2011-10-21 01:52:03 -07:00
|
|
|
if ((wd->anchor_item) && (wd->anchor_item->item->block) && (!wd->auto_scroll_enabled))
|
2010-11-20 00:43:43 -08:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it;
|
2010-12-07 11:18:14 -08:00
|
|
|
Evas_Coord it_y;
|
|
|
|
|
|
|
|
it = wd->anchor_item;
|
|
|
|
it_y = wd->anchor_y;
|
|
|
|
elm_smart_scroller_child_pos_set(wd->scr, wd->pan_x,
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->block->y + it->y + it_y);
|
2010-12-07 11:18:14 -08:00
|
|
|
wd->anchor_item = it;
|
|
|
|
wd->anchor_y = it_y;
|
2010-11-20 00:43:43 -08:00
|
|
|
}
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
2010-12-07 11:18:14 -08:00
|
|
|
if (did_must_recalc)
|
|
|
|
{
|
|
|
|
if (!wd->must_recalc_idler)
|
|
|
|
wd->must_recalc_idler = ecore_idler_add(_must_recalc_idler, wd);
|
|
|
|
}
|
2011-12-23 20:20:18 -08:00
|
|
|
if (wd->check_scroll)
|
|
|
|
{
|
|
|
|
_pan_child_size_get(wd->pan_smart, &pan_w, &pan_h);
|
|
|
|
if (EINA_INLIST_GET(wd->show_item) == wd->items->last)
|
|
|
|
wd->scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_IN;
|
|
|
|
switch (wd->scrollto_type)
|
|
|
|
{
|
|
|
|
case ELM_GENLIST_ITEM_SCROLLTO_TOP:
|
|
|
|
dy = wd->h;
|
|
|
|
break;
|
|
|
|
case ELM_GENLIST_ITEM_SCROLLTO_MIDDLE:
|
|
|
|
dy = wd->h / 2;
|
|
|
|
break;
|
|
|
|
case ELM_GENLIST_ITEM_SCROLLTO_IN:
|
|
|
|
default:
|
|
|
|
dy = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if ((pan_w > (wd->show_item->x + wd->show_item->item->block->x)) &&
|
|
|
|
(pan_h > (wd->show_item->y + wd->show_item->item->block->y + dy)))
|
|
|
|
{
|
|
|
|
_scroll_item(wd);
|
|
|
|
}
|
|
|
|
}
|
2009-02-12 05:39:43 -08:00
|
|
|
wd->calc_job = NULL;
|
|
|
|
evas_object_smart_changed(wd->pan_smart);
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(wd->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(wd->obj));
|
2009-02-12 05:39:43 -08:00
|
|
|
}
|
|
|
|
|
2009-09-13 19:53:03 -07:00
|
|
|
static void
|
|
|
|
_update_job(void *data)
|
|
|
|
{
|
|
|
|
Widget_Data *wd = data;
|
2010-03-09 06:42:41 -08:00
|
|
|
Eina_List *l2;
|
2009-09-13 19:53:03 -07:00
|
|
|
Item_Block *itb;
|
2011-06-03 18:52:08 -07:00
|
|
|
int num, num0;
|
|
|
|
Eina_Bool position = EINA_FALSE, recalc = EINA_FALSE;
|
2010-03-09 06:42:41 -08:00
|
|
|
if (!wd) return;
|
2009-09-13 19:53:03 -07:00
|
|
|
wd->update_job = NULL;
|
|
|
|
num = 0;
|
2011-05-29 19:31:21 -07:00
|
|
|
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(wd->obj));
|
2009-09-13 19:53:03 -07:00
|
|
|
EINA_INLIST_FOREACH(wd->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;
|
2011-03-22 00:54:24 -07:00
|
|
|
EINA_LIST_FOREACH(itb->items, l2, it)
|
|
|
|
{
|
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)
|
|
|
|
{
|
2010-10-15 04:51:15 -07:00
|
|
|
if (wd->calc_job) ecore_job_del(wd->calc_job);
|
|
|
|
wd->calc_job = ecore_job_add(_calc_job, wd);
|
2009-09-13 19:53:03 -07:00
|
|
|
}
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(wd->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(wd->obj));
|
2009-09-13 19:53:03 -07:00
|
|
|
}
|
|
|
|
|
2009-02-12 05:39:43 -08:00
|
|
|
static void
|
2010-12-07 11:18:14 -08:00
|
|
|
_pan_set(Evas_Object *obj,
|
|
|
|
Evas_Coord x,
|
|
|
|
Evas_Coord y)
|
2009-02-12 05:39:43 -08:00
|
|
|
{
|
2010-12-07 11:18:14 -08:00
|
|
|
Pan *sd = evas_object_smart_data_get(obj);
|
|
|
|
Item_Block *itb;
|
|
|
|
|
2011-08-25 07:22:26 -07:00
|
|
|
if (!sd) return;
|
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
|
|
|
// Evas_Coord ow, oh;
|
|
|
|
// evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
|
|
|
|
// ow = sd->wd->minw - ow;
|
|
|
|
// if (ow < 0) ow = 0;
|
|
|
|
// oh = sd->wd->minh - oh;
|
|
|
|
// if (oh < 0) oh = 0;
|
|
|
|
// if (x < 0) x = 0;
|
|
|
|
// if (y < 0) y = 0;
|
|
|
|
// if (x > ow) x = ow;
|
|
|
|
// if (y > oh) y = oh;
|
2010-12-07 11:18:14 -08:00
|
|
|
if ((x == sd->wd->pan_x) && (y == sd->wd->pan_y)) return;
|
|
|
|
sd->wd->pan_x = x;
|
|
|
|
sd->wd->pan_y = y;
|
|
|
|
|
|
|
|
EINA_INLIST_FOREACH(sd->wd->blocks, itb)
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
|
|
|
if ((itb->y + itb->h) > y)
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it;
|
2011-03-22 00:54:24 -07:00
|
|
|
Eina_List *l2;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(itb->items, l2, it)
|
|
|
|
{
|
|
|
|
if ((itb->y + it->y) >= y)
|
|
|
|
{
|
|
|
|
sd->wd->anchor_item = it;
|
|
|
|
sd->wd->anchor_y = -(itb->y + it->y - y);
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-11-20 00:43:43 -08:00
|
|
|
done:
|
2011-06-03 18:52:08 -07:00
|
|
|
if (!sd->wd->reorder_move_animator) evas_object_smart_changed(obj);
|
2009-02-12 05:39:43 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-12-07 11:18:14 -08:00
|
|
|
_pan_get(Evas_Object *obj,
|
|
|
|
Evas_Coord *x,
|
|
|
|
Evas_Coord *y)
|
2009-02-12 05:39:43 -08:00
|
|
|
{
|
|
|
|
Pan *sd = evas_object_smart_data_get(obj);
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2011-08-25 07:22:26 -07:00
|
|
|
if (!sd) return;
|
2009-02-12 05:39:43 -08:00
|
|
|
if (x) *x = sd->wd->pan_x;
|
|
|
|
if (y) *y = sd->wd->pan_y;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-12-07 11:18:14 -08:00
|
|
|
_pan_max_get(Evas_Object *obj,
|
|
|
|
Evas_Coord *x,
|
|
|
|
Evas_Coord *y)
|
2009-07-06 23:46:51 -07:00
|
|
|
{
|
2009-02-12 05:39:43 -08:00
|
|
|
Pan *sd = evas_object_smart_data_get(obj);
|
|
|
|
Evas_Coord ow, oh;
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2011-08-25 07:22:26 -07:00
|
|
|
if (!sd) return;
|
2009-02-12 05:39:43 -08:00
|
|
|
evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
|
|
|
|
ow = sd->wd->minw - ow;
|
|
|
|
if (ow < 0) ow = 0;
|
|
|
|
oh = sd->wd->minh - oh;
|
|
|
|
if (oh < 0) oh = 0;
|
2009-07-06 23:46:51 -07:00
|
|
|
if (x) *x = ow;
|
|
|
|
if (y) *y = oh;
|
2009-02-12 05:39:43 -08:00
|
|
|
}
|
|
|
|
|
2010-11-23 12:20:41 -08:00
|
|
|
static void
|
2010-12-07 11:18:14 -08:00
|
|
|
_pan_min_get(Evas_Object *obj __UNUSED__,
|
2011-04-01 09:33:58 -07:00
|
|
|
Evas_Coord *x,
|
|
|
|
Evas_Coord *y)
|
2010-11-23 12:20:41 -08:00
|
|
|
{
|
|
|
|
if (x) *x = 0;
|
|
|
|
if (y) *y = 0;
|
|
|
|
}
|
|
|
|
|
2009-02-12 05:39:43 -08:00
|
|
|
static void
|
2010-12-07 11:18:14 -08:00
|
|
|
_pan_child_size_get(Evas_Object *obj,
|
|
|
|
Evas_Coord *w,
|
|
|
|
Evas_Coord *h)
|
2009-02-12 05:39:43 -08:00
|
|
|
{
|
|
|
|
Pan *sd = evas_object_smart_data_get(obj);
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2011-08-25 07:22:26 -07:00
|
|
|
if (!sd) return;
|
2009-02-12 05:39:43 -08:00
|
|
|
if (w) *w = sd->wd->minw;
|
|
|
|
if (h) *h = sd->wd->minh;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_pan_add(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Pan *sd;
|
|
|
|
Evas_Object_Smart_Clipped_Data *cd;
|
|
|
|
|
|
|
|
_pan_sc.add(obj);
|
|
|
|
cd = evas_object_smart_data_get(obj);
|
2009-10-13 10:11:00 -07:00
|
|
|
sd = ELM_NEW(Pan);
|
2009-02-12 05:39:43 -08:00
|
|
|
if (!sd) return;
|
|
|
|
sd->__clipped_data = *cd;
|
|
|
|
free(cd);
|
|
|
|
evas_object_smart_data_set(obj, sd);
|
|
|
|
}
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2009-02-12 05:39:43 -08:00
|
|
|
static void
|
|
|
|
_pan_del(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Pan *sd = evas_object_smart_data_get(obj);
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2009-02-12 05:39:43 -08:00
|
|
|
if (!sd) return;
|
2010-11-20 00:43:43 -08:00
|
|
|
if (sd->resize_job)
|
|
|
|
{
|
2010-12-07 11:18:14 -08:00
|
|
|
ecore_job_del(sd->resize_job);
|
|
|
|
sd->resize_job = NULL;
|
2010-11-20 00:43:43 -08:00
|
|
|
}
|
2009-02-12 05:39:43 -08:00
|
|
|
_pan_sc.del(obj);
|
|
|
|
}
|
|
|
|
|
2010-11-20 00:43:43 -08:00
|
|
|
static void
|
|
|
|
_pan_resize_job(void *data)
|
|
|
|
{
|
2010-12-07 11:18:14 -08:00
|
|
|
Pan *sd = data;
|
2011-08-25 07:22:26 -07:00
|
|
|
if (!sd) return;
|
2010-12-07 11:18:14 -08:00
|
|
|
_sizing_eval(sd->wd->obj);
|
|
|
|
sd->resize_job = NULL;
|
2010-11-20 00:43:43 -08:00
|
|
|
}
|
|
|
|
|
2009-02-12 05:39:43 -08:00
|
|
|
static void
|
2010-12-07 11:18:14 -08:00
|
|
|
_pan_resize(Evas_Object *obj,
|
|
|
|
Evas_Coord w,
|
|
|
|
Evas_Coord h)
|
2009-02-12 05:39:43 -08:00
|
|
|
{
|
|
|
|
Pan *sd = evas_object_smart_data_get(obj);
|
|
|
|
Evas_Coord ow, oh;
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2011-08-25 07:22:26 -07:00
|
|
|
if (!sd) return;
|
2009-02-12 05:39:43 -08:00
|
|
|
evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
|
|
|
|
if ((ow == w) && (oh == h)) return;
|
2010-11-20 00:43:43 -08:00
|
|
|
if ((sd->wd->height_for_width) && (ow != w))
|
2010-12-07 11:18:14 -08:00
|
|
|
{
|
2011-10-10 02:45:43 -07:00
|
|
|
/* fix me later */
|
2010-12-07 11:18:14 -08:00
|
|
|
if (sd->resize_job) ecore_job_del(sd->resize_job);
|
|
|
|
sd->resize_job = ecore_job_add(_pan_resize_job, sd);
|
|
|
|
}
|
2011-12-12 20:15:10 -08:00
|
|
|
sd->wd->pan_changed = EINA_TRUE;
|
2011-10-10 02:45:43 -07:00
|
|
|
evas_object_smart_changed(obj);
|
|
|
|
if (sd->wd->calc_job) ecore_job_del(sd->wd->calc_job);
|
|
|
|
sd->wd->calc_job = NULL;
|
|
|
|
/* OLD
|
2009-02-12 05:39:43 -08:00
|
|
|
if (sd->wd->calc_job) ecore_job_del(sd->wd->calc_job);
|
|
|
|
sd->wd->calc_job = ecore_job_add(_calc_job, sd->wd);
|
2011-10-10 02:45:43 -07:00
|
|
|
*/
|
2009-02-12 05:39:43 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_pan_calculate(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Pan *sd = evas_object_smart_data_get(obj);
|
2009-02-25 08:22:29 -08:00
|
|
|
Item_Block *itb;
|
2010-01-16 04:35:31 -08:00
|
|
|
Evas_Coord ox, oy, ow, oh, cvx, cvy, cvw, cvh;
|
2009-09-26 11:24:06 -07:00
|
|
|
int in = 0;
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *git;
|
2011-01-05 21:13:11 -08:00
|
|
|
Eina_List *l;
|
2009-02-12 05:39:43 -08:00
|
|
|
|
2011-08-25 07:22:26 -07:00
|
|
|
if (!sd) return;
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(obj));
|
2011-10-21 01:52:03 -07:00
|
|
|
|
2011-12-12 20:15:10 -08:00
|
|
|
if (sd->wd->pan_changed)
|
2011-10-10 02:45:43 -07:00
|
|
|
{
|
|
|
|
_calc_job(sd->wd);
|
2011-12-12 20:15:10 -08:00
|
|
|
sd->wd->pan_changed = EINA_FALSE;
|
2011-10-10 02:45:43 -07:00
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
|
2010-01-16 04:35:31 -08:00
|
|
|
evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
|
|
|
|
evas_output_viewport_get(evas_object_evas_get(obj), &cvx, &cvy, &cvw, &cvh);
|
2011-01-05 21:13:11 -08:00
|
|
|
EINA_LIST_FOREACH(sd->wd->group_items, l, git)
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
git->item->want_realize = EINA_FALSE;
|
2011-01-05 21:13:11 -08:00
|
|
|
}
|
2009-02-25 08:22:29 -08:00
|
|
|
EINA_INLIST_FOREACH(sd->wd->blocks, itb)
|
2011-03-22 00:54:24 -07:00
|
|
|
{
|
|
|
|
itb->w = sd->wd->minw;
|
|
|
|
if (ELM_RECTS_INTERSECT(itb->x - sd->wd->pan_x + ox,
|
|
|
|
itb->y - sd->wd->pan_y + oy,
|
|
|
|
itb->w, itb->h,
|
|
|
|
cvx, cvy, cvw, cvh))
|
|
|
|
{
|
|
|
|
if ((!itb->realized) || (itb->changed))
|
2011-06-08 03:48:20 -07:00
|
|
|
_item_block_realize(itb);
|
2011-03-22 00:54:24 -07:00
|
|
|
_item_block_position(itb, in);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (itb->realized) _item_block_unrealize(itb);
|
|
|
|
}
|
|
|
|
in += itb->count;
|
|
|
|
}
|
2011-06-01 20:10:11 -07:00
|
|
|
if ((!sd->wd->reorder_it) || (sd->wd->reorder_pan_move))
|
|
|
|
_group_items_recalc(sd->wd);
|
|
|
|
if ((sd->wd->reorder_mode) && (sd->wd->reorder_it))
|
|
|
|
{
|
2011-09-23 01:32:32 -07:00
|
|
|
if (sd->wd->pan_y != sd->wd->reorder_old_pan_y)
|
2011-06-01 20:10:11 -07:00
|
|
|
sd->wd->reorder_pan_move = EINA_TRUE;
|
|
|
|
else sd->wd->reorder_pan_move = EINA_FALSE;
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_raise(sd->wd->VIEW(reorder_it));
|
2011-09-23 01:32:32 -07:00
|
|
|
sd->wd->reorder_old_pan_y = sd->wd->pan_y;
|
2011-06-01 20:10:11 -07:00
|
|
|
sd->wd->start_time = ecore_loop_time_get();
|
|
|
|
}
|
2011-06-14 02:18:54 -07:00
|
|
|
_item_auto_scroll(sd->wd);
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(obj));
|
2009-02-10 03:57:47 -08:00
|
|
|
}
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2010-01-24 19:53:36 -08:00
|
|
|
static void
|
2010-12-07 11:18:14 -08:00
|
|
|
_pan_move(Evas_Object *obj,
|
2011-04-01 09:33:58 -07:00
|
|
|
Evas_Coord x __UNUSED__,
|
|
|
|
Evas_Coord y __UNUSED__)
|
2010-01-24 19:53:36 -08:00
|
|
|
{
|
|
|
|
Pan *sd = evas_object_smart_data_get(obj);
|
|
|
|
|
2011-08-25 07:22:26 -07:00
|
|
|
if (!sd) return;
|
2011-12-12 20:15:10 -08:00
|
|
|
|
|
|
|
sd->wd->pan_changed = EINA_TRUE;
|
|
|
|
evas_object_smart_changed(obj);
|
2010-01-24 19:53:36 -08:00
|
|
|
if (sd->wd->calc_job) ecore_job_del(sd->wd->calc_job);
|
2011-12-12 20:15:10 -08:00
|
|
|
sd->wd->calc_job = NULL;
|
2010-01-24 19:53:36 -08:00
|
|
|
}
|
|
|
|
|
2009-09-07 23:20:32 -07:00
|
|
|
static void
|
2011-04-01 09:33:58 -07:00
|
|
|
_hold_on(void *data __UNUSED__,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info __UNUSED__)
|
2009-09-07 23:20:32 -07:00
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
elm_smart_scroller_hold_set(wd->scr, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-04-01 09:33:58 -07:00
|
|
|
_hold_off(void *data __UNUSED__,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info __UNUSED__)
|
2009-09-07 23:20:32 -07:00
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
elm_smart_scroller_hold_set(wd->scr, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-04-01 09:33:58 -07:00
|
|
|
_freeze_on(void *data __UNUSED__,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info __UNUSED__)
|
2009-09-07 23:20:32 -07:00
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
elm_smart_scroller_freeze_set(wd->scr, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-04-01 09:33:58 -07:00
|
|
|
_freeze_off(void *data __UNUSED__,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info __UNUSED__)
|
2009-09-07 23:20:32 -07:00
|
|
|
{
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
elm_smart_scroller_freeze_set(wd->scr, 0);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
_scr_anim_start(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
|
|
|
{
|
|
|
|
evas_object_smart_callback_call(data, SIG_SCROLL_ANIM_START, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_scr_anim_stop(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
|
|
|
{
|
|
|
|
evas_object_smart_callback_call(data, SIG_SCROLL_ANIM_STOP, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_scr_drag_start(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
|
|
|
{
|
|
|
|
evas_object_smart_callback_call(data, SIG_SCROLL_DRAG_START, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_scr_drag_stop(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
|
|
|
{
|
|
|
|
evas_object_smart_callback_call(data, SIG_SCROLL_DRAG_STOP, 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
|
2011-10-20 09:42:42 -07:00
|
|
|
_edge_left(void *data,
|
|
|
|
Evas_Object *scr __UNUSED__,
|
|
|
|
void *event_info __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
|
|
|
{
|
|
|
|
Evas_Object *obj = data;
|
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
|
2011-10-20 09:42:42 -07:00
|
|
|
_edge_right(void *data,
|
|
|
|
Evas_Object *scr __UNUSED__,
|
|
|
|
void *event_info __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
|
|
|
{
|
|
|
|
Evas_Object *obj = data;
|
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
|
2011-10-20 09:42:42 -07:00
|
|
|
_edge_top(void *data,
|
|
|
|
Evas_Object *scr __UNUSED__,
|
|
|
|
void *event_info __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
|
|
|
{
|
|
|
|
Evas_Object *obj = data;
|
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
|
2011-10-20 09:42:42 -07:00
|
|
|
_edge_bottom(void *data,
|
|
|
|
Evas_Object *scr __UNUSED__,
|
|
|
|
void *event_info __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
|
|
|
{
|
|
|
|
Evas_Object *obj = data;
|
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
|
2011-10-21 01:52:03 -07:00
|
|
|
_mode_item_realize(Elm_Gen_Item *it)
|
2011-04-21 04:47:36 -07:00
|
|
|
{
|
|
|
|
char buf[1024];
|
|
|
|
|
2011-12-02 05:43:02 -08:00
|
|
|
if ((it->item->mode_view) || (it->generation < it->wd->generation)) return;
|
2011-10-21 01:52:03 -07:00
|
|
|
|
|
|
|
evas_event_freeze(evas_object_evas_get(it->wd->obj));
|
|
|
|
it->item->mode_view = edje_object_add(evas_object_evas_get(WIDGET(it)));
|
|
|
|
edje_object_scale_set(it->item->mode_view,
|
|
|
|
elm_widget_scale_get(WIDGET(it)) *
|
|
|
|
_elm_config->scale);
|
|
|
|
evas_object_smart_member_add(it->item->mode_view, it->wd->pan_smart);
|
|
|
|
elm_widget_sub_object_add(WIDGET(it), it->item->mode_view);
|
|
|
|
|
2011-10-20 20:31:26 -07:00
|
|
|
strncpy(buf, "item", sizeof(buf));
|
|
|
|
if (it->wd->compress)
|
|
|
|
strncat(buf, "_compress", sizeof(buf) - strlen(buf));
|
|
|
|
|
2011-10-21 01:52:03 -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-02-22 19:15:40 -08:00
|
|
|
strncat(buf, it->itc->mode_item_style, sizeof(buf) - strlen(buf));
|
2011-10-20 20:31:26 -07:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
_elm_theme_object_set(WIDGET(it), it->item->mode_view, "genlist", buf,
|
2011-10-20 20:31:26 -07:00
|
|
|
elm_widget_style_get(WIDGET(it)));
|
2011-10-21 01:52:03 -07:00
|
|
|
edje_object_mirrored_set(it->item->mode_view,
|
2011-10-20 18:08:01 -07:00
|
|
|
elm_widget_mirrored_get(WIDGET(it)));
|
2011-04-21 04:47:36 -07:00
|
|
|
|
|
|
|
/* signal callback add */
|
2011-10-21 01:52:03 -07:00
|
|
|
evas_object_event_callback_add(it->item->mode_view, EVAS_CALLBACK_MOUSE_DOWN,
|
2011-04-21 04:47:36 -07:00
|
|
|
_mouse_down, it);
|
2011-10-21 01:52:03 -07:00
|
|
|
evas_object_event_callback_add(it->item->mode_view, EVAS_CALLBACK_MOUSE_UP,
|
2011-04-21 04:47:36 -07:00
|
|
|
_mouse_up, it);
|
2011-10-21 01:52:03 -07:00
|
|
|
evas_object_event_callback_add(it->item->mode_view, EVAS_CALLBACK_MOUSE_MOVE,
|
2011-04-21 04:47:36 -07:00
|
|
|
_mouse_move, it);
|
|
|
|
|
2011-11-30 22:15:08 -08:00
|
|
|
/* text_get, content_get, state_get */
|
2011-04-22 02:56:49 -07:00
|
|
|
/* FIXME: If you see that assert, please notify us and we
|
|
|
|
will clean our mess */
|
2011-10-23 19:10:35 -07:00
|
|
|
assert(eina_list_count(it->item->mode_content_objs) == 0);
|
2011-04-21 04:47:36 -07:00
|
|
|
|
2011-12-15 07:24:17 -08:00
|
|
|
_item_text_realize(it, it->item->mode_view, &it->item->mode_texts, NULL);
|
2011-11-29 06:03:14 -08:00
|
|
|
it->item->mode_content_objs =
|
|
|
|
_item_content_realize(it, it->item->mode_view,
|
|
|
|
&it->item->mode_contents, NULL);
|
|
|
|
_item_state_realize(it, it->item->mode_view, &it->item->mode_states, NULL);
|
2011-04-21 04:47:36 -07:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
edje_object_part_swallow(it->item->mode_view,
|
|
|
|
edje_object_data_get(it->item->mode_view, "mode_part"),
|
2011-10-20 18:08:01 -07:00
|
|
|
VIEW(it));
|
2011-04-21 04:47:36 -07:00
|
|
|
|
|
|
|
it->want_unrealize = EINA_FALSE;
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(it->wd->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(it->wd->obj));
|
2011-04-21 04:47:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-10-21 01:52:03 -07:00
|
|
|
_mode_item_unrealize(Elm_Gen_Item *it)
|
2011-04-21 04:47:36 -07:00
|
|
|
{
|
|
|
|
Widget_Data *wd = it->wd;
|
2011-10-23 19:10:35 -07:00
|
|
|
Evas_Object *content;
|
2011-10-21 01:52:03 -07:00
|
|
|
if (!it->item->mode_view) return;
|
2011-04-21 04:47:36 -07:00
|
|
|
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(it->wd->obj));
|
2011-12-14 08:36:09 -08:00
|
|
|
elm_widget_stringlist_free(it->item->mode_texts);
|
|
|
|
it->item->mode_texts = NULL;
|
2011-10-23 19:10:35 -07:00
|
|
|
elm_widget_stringlist_free(it->item->mode_contents);
|
|
|
|
it->item->mode_contents = NULL;
|
2011-10-21 01:52:03 -07:00
|
|
|
elm_widget_stringlist_free(it->item->mode_states);
|
2011-04-21 04:47:36 -07:00
|
|
|
|
2011-10-23 19:10:35 -07:00
|
|
|
EINA_LIST_FREE(it->item->mode_content_objs, content)
|
|
|
|
evas_object_del(content);
|
2011-04-21 04:47:36 -07:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
edje_object_part_unswallow(it->item->mode_view, VIEW(it));
|
2011-10-20 18:08:01 -07:00
|
|
|
evas_object_smart_member_add(VIEW(it), wd->pan_smart);
|
2011-10-21 01:52:03 -07:00
|
|
|
evas_object_del(it->item->mode_view);
|
|
|
|
it->item->mode_view = NULL;
|
2011-04-21 04:47:36 -07:00
|
|
|
|
|
|
|
if (wd->mode_item == it)
|
|
|
|
wd->mode_item = NULL;
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(it->wd->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(it->wd->obj));
|
2011-04-21 04:47:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-10-21 01:52:03 -07:00
|
|
|
_item_mode_set(Elm_Gen_Item *it)
|
2011-04-21 04:47:36 -07:00
|
|
|
{
|
|
|
|
if (!it) return;
|
|
|
|
Widget_Data *wd = it->wd;
|
|
|
|
if (!wd) return;
|
|
|
|
char buf[1024];
|
|
|
|
|
|
|
|
wd->mode_item = it;
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->nocache = EINA_TRUE;
|
2011-04-21 04:47:36 -07:00
|
|
|
|
|
|
|
if (wd->scr_hold_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(wd->scr_hold_timer);
|
|
|
|
wd->scr_hold_timer = NULL;
|
|
|
|
}
|
|
|
|
elm_smart_scroller_hold_set(wd->scr, EINA_TRUE);
|
|
|
|
wd->scr_hold_timer = ecore_timer_add(0.1, _scr_hold_timer_cb, wd);
|
|
|
|
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_freeze(evas_object_evas_get(it->wd->obj));
|
2011-04-21 04:47:36 -07:00
|
|
|
_mode_item_realize(it);
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->group_item)
|
|
|
|
evas_object_raise(it->item->VIEW(group_item));
|
|
|
|
_item_position(it, it->item->mode_view, it->item->scrl_x, it->item->scrl_y);
|
2011-05-27 03:30:56 -07:00
|
|
|
evas_event_thaw(evas_object_evas_get(it->wd->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(it->wd->obj));
|
2011-04-21 04:47:36 -07:00
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "elm,state,%s,active", wd->mode_type);
|
2011-10-21 01:52:03 -07:00
|
|
|
edje_object_signal_emit(it->item->mode_view, buf, "elm");
|
2011-04-21 04:47:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_mode_unset(Widget_Data *wd)
|
|
|
|
{
|
|
|
|
if (!wd) return;
|
|
|
|
if (!wd->mode_item) return;
|
|
|
|
char buf[1024], buf2[1024];
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it;
|
2011-04-21 04:47:36 -07:00
|
|
|
|
|
|
|
it = wd->mode_item;
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->nocache = EINA_TRUE;
|
2011-04-21 04:47:36 -07:00
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "elm,state,%s,passive", wd->mode_type);
|
|
|
|
snprintf(buf2, sizeof(buf2), "elm,state,%s,passive,finished", wd->mode_type);
|
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
edje_object_signal_emit(it->item->mode_view, buf, "elm");
|
|
|
|
edje_object_signal_callback_add(it->item->mode_view, buf2, "elm", _mode_finished_signal_cb, it);
|
2011-04-21 04:47:36 -07:00
|
|
|
|
|
|
|
wd->mode_item = NULL;
|
|
|
|
}
|
|
|
|
|
2012-02-22 23:39:10 -08:00
|
|
|
static void
|
|
|
|
_edit_mode_item_position(Elm_Gen_Item *it, int itx, int ity)
|
|
|
|
{
|
|
|
|
if ((!it) || (!it->wd->edit_mode)) return;
|
|
|
|
evas_object_resize(it->edit_obj, it->item->w, it->item->h);
|
|
|
|
evas_object_move(it->edit_obj, itx, ity);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_edit_mode_item_realize(Elm_Gen_Item *it, Eina_Bool effect_on)
|
|
|
|
{
|
|
|
|
char buf[1024];
|
|
|
|
const char *stacking_even;
|
|
|
|
const char *stacking;
|
|
|
|
|
|
|
|
if ((!it) || (it->item->edit_mode_item_realized) ||
|
|
|
|
(it->generation < it->wd->generation))
|
|
|
|
return;
|
|
|
|
|
|
|
|
it->edit_obj = edje_object_add(evas_object_evas_get(WIDGET(it)));
|
|
|
|
edje_object_scale_set(it->edit_obj, elm_widget_scale_get(WIDGET(it)) *
|
|
|
|
_elm_config->scale);
|
|
|
|
evas_object_smart_member_add(it->edit_obj, it->wd->pan_smart);
|
|
|
|
elm_widget_sub_object_add(WIDGET(it), it->edit_obj);
|
|
|
|
|
|
|
|
if (it->item->flags & ELM_GENLIST_ITEM_SUBITEMS)
|
|
|
|
strncpy(buf, "tree", sizeof(buf));
|
|
|
|
else strncpy(buf, "item", sizeof(buf));
|
|
|
|
if (it->wd->compress)
|
|
|
|
strncat(buf, "_compress", sizeof(buf) - strlen(buf));
|
|
|
|
|
|
|
|
strncat(buf, "/", sizeof(buf) - strlen(buf));
|
|
|
|
strncat(buf, it->itc->edit_item_style, sizeof(buf) - strlen(buf));
|
|
|
|
|
|
|
|
_elm_theme_object_set(WIDGET(it), it->edit_obj, "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->edit_obj,
|
|
|
|
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->edit_obj, "elm,state,edit,enabled,effect", "elm");
|
|
|
|
else edje_object_signal_emit(it->edit_obj, "elm,state,edit,enabled", "elm");
|
|
|
|
|
|
|
|
evas_object_event_callback_add(it->edit_obj, EVAS_CALLBACK_MOUSE_DOWN,
|
|
|
|
_mouse_down, it);
|
|
|
|
evas_object_event_callback_add(it->edit_obj, EVAS_CALLBACK_MOUSE_UP,
|
|
|
|
_mouse_up, it);
|
|
|
|
evas_object_event_callback_add(it->edit_obj, EVAS_CALLBACK_MOUSE_MOVE,
|
|
|
|
_mouse_move, it);
|
|
|
|
evas_object_event_callback_add(it->edit_obj, EVAS_CALLBACK_MULTI_DOWN,
|
|
|
|
_multi_down, it);
|
|
|
|
evas_object_event_callback_add(it->edit_obj, EVAS_CALLBACK_MULTI_UP,
|
|
|
|
_multi_up, it);
|
|
|
|
evas_object_event_callback_add(it->edit_obj, EVAS_CALLBACK_MULTI_MOVE,
|
|
|
|
_multi_move, it);
|
|
|
|
|
|
|
|
_item_text_realize(it, it->edit_obj, &it->item->edit_texts, NULL);
|
|
|
|
it->item->edit_content_objs =
|
|
|
|
_item_content_realize(it, it->edit_obj, &it->item->edit_contents, NULL);
|
|
|
|
_item_state_realize(it, it->edit_obj, &it->item->edit_states, NULL);
|
|
|
|
edje_object_part_swallow(it->edit_obj, "elm.swallow.edit.content", VIEW(it));
|
|
|
|
|
|
|
|
_edit_mode_item_position(it, it->item->scrl_x, it->item->scrl_y);
|
|
|
|
evas_object_show(it->edit_obj);
|
|
|
|
|
|
|
|
it->item->edit_mode_item_realized = EINA_TRUE;
|
|
|
|
it->want_unrealize = EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_edit_mode_item_unrealize(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
Evas_Object *icon;
|
|
|
|
if ((!it) || (!it->item->edit_mode_item_realized)) return;
|
|
|
|
|
|
|
|
edje_object_part_unswallow(it->edit_obj, VIEW(it));
|
|
|
|
evas_object_smart_member_add(VIEW(it), it->wd->pan_smart);
|
|
|
|
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->edit_obj);
|
|
|
|
it->edit_obj = NULL;
|
|
|
|
elm_widget_stringlist_free(it->item->edit_texts);
|
|
|
|
it->item->edit_texts = NULL;
|
|
|
|
elm_widget_stringlist_free(it->item->edit_contents);
|
|
|
|
it->item->edit_contents = NULL;
|
|
|
|
elm_widget_stringlist_free(it->item->edit_states);
|
|
|
|
it->item->edit_states = NULL;
|
|
|
|
EINA_LIST_FREE(it->item->edit_content_objs, icon)
|
|
|
|
evas_object_del(icon);
|
|
|
|
edje_object_message_signal_process(it->edit_obj);
|
|
|
|
|
|
|
|
evas_object_event_callback_del_full(it->edit_obj, EVAS_CALLBACK_MOUSE_DOWN,
|
|
|
|
_mouse_down, it);
|
|
|
|
evas_object_event_callback_del_full(it->edit_obj, EVAS_CALLBACK_MOUSE_UP,
|
|
|
|
_mouse_up, it);
|
|
|
|
evas_object_event_callback_del_full(it->edit_obj, EVAS_CALLBACK_MOUSE_MOVE,
|
|
|
|
_mouse_move, it);
|
|
|
|
evas_object_event_callback_del_full(it->edit_obj, EVAS_CALLBACK_MULTI_DOWN,
|
|
|
|
_multi_down, it);
|
|
|
|
evas_object_event_callback_del_full(it->edit_obj, EVAS_CALLBACK_MULTI_UP,
|
|
|
|
_multi_up, it);
|
|
|
|
evas_object_event_callback_del_full(it->edit_obj, EVAS_CALLBACK_MULTI_MOVE,
|
|
|
|
_multi_move, it);
|
|
|
|
it->item->edit_mode_item_realized = EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2011-06-14 02:18:54 -07:00
|
|
|
static void
|
|
|
|
_item_auto_scroll(Widget_Data *wd)
|
|
|
|
{
|
|
|
|
if (!wd) return;
|
2011-12-23 20:20:18 -08:00
|
|
|
Elm_Gen_Item *tmp_item = NULL;
|
2011-06-14 02:18:54 -07:00
|
|
|
|
|
|
|
if ((wd->expanded_item) && (wd->auto_scroll_enabled))
|
|
|
|
{
|
2011-12-23 20:20:18 -08:00
|
|
|
tmp_item = eina_list_data_get(eina_list_last(wd->expanded_item->item->items));
|
|
|
|
if (!tmp_item) return;
|
|
|
|
wd->show_item = tmp_item;
|
|
|
|
wd->bring_in = EINA_TRUE;
|
|
|
|
wd->scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_IN;
|
|
|
|
if ((wd->show_item->item->queued) || (!wd->show_item->item->mincalcd))
|
2011-06-14 02:18:54 -07:00
|
|
|
{
|
2011-12-23 20:20:18 -08:00
|
|
|
wd->show_item->item->showme = EINA_TRUE;
|
|
|
|
wd->auto_scroll_enabled = EINA_FALSE;
|
2011-06-14 02:18:54 -07:00
|
|
|
}
|
2011-12-23 20:20:18 -08:00
|
|
|
else
|
|
|
|
_scroll_item(wd);
|
2011-06-14 02:18:54 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-02-09 03:23:59 -08:00
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_genlist_add(Evas_Object *parent)
|
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
|
|
|
Evas *e;
|
|
|
|
Widget_Data *wd;
|
2009-03-12 22:50:38 -07:00
|
|
|
Evas_Coord minw, minh;
|
2009-02-10 03:57:47 -08:00
|
|
|
static Evas_Smart *smart = NULL;
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2010-09-14 20:11:30 -07:00
|
|
|
if (!smart)
|
|
|
|
{
|
2010-10-15 04:51:15 -07:00
|
|
|
static Evas_Smart_Class sc;
|
2010-09-14 20:11:30 -07:00
|
|
|
|
2010-10-15 04:51:15 -07:00
|
|
|
evas_object_smart_clipped_smart_set(&_pan_sc);
|
|
|
|
sc = _pan_sc;
|
|
|
|
sc.name = "elm_genlist_pan";
|
|
|
|
sc.version = EVAS_SMART_CLASS_VERSION;
|
|
|
|
sc.add = _pan_add;
|
|
|
|
sc.del = _pan_del;
|
|
|
|
sc.resize = _pan_resize;
|
|
|
|
sc.move = _pan_move;
|
|
|
|
sc.calculate = _pan_calculate;
|
|
|
|
if (!(smart = evas_smart_class_new(&sc))) return NULL;
|
2010-09-14 20:11:30 -07:00
|
|
|
}
|
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
|
|
|
|
2011-03-31 23:08:02 -07:00
|
|
|
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
|
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
|
|
|
|
2010-03-08 22:15:39 -08:00
|
|
|
ELM_SET_WIDTYPE(widtype, "genlist");
|
2011-10-21 15:55:45 -07:00
|
|
|
ELM_GEN_SETUP(wd);
|
2009-05-13 05:21:52 -07:00
|
|
|
elm_widget_type_set(obj, "genlist");
|
|
|
|
elm_widget_sub_object_add(parent, obj);
|
2010-10-01 12:03:12 -07:00
|
|
|
elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
|
2011-04-06 07:46:39 -07:00
|
|
|
elm_widget_signal_emit_hook_set(obj, _signal_emit_hook);
|
2009-02-09 03:23:59 -08:00
|
|
|
elm_widget_data_set(obj, wd);
|
|
|
|
elm_widget_del_hook_set(obj, _del_hook);
|
2009-11-13 14:22:05 -08:00
|
|
|
elm_widget_del_pre_hook_set(obj, _del_pre_hook);
|
2009-02-09 03:23:59 -08:00
|
|
|
elm_widget_theme_hook_set(obj, _theme_hook);
|
2010-09-29 05:22:30 -07:00
|
|
|
elm_widget_can_focus_set(obj, EINA_TRUE);
|
2010-10-01 12:03:12 -07:00
|
|
|
elm_widget_event_hook_set(obj, _event_hook);
|
2011-02-13 02:28:55 -08:00
|
|
|
elm_widget_on_show_region_hook_set(obj, _show_region_hook, obj);
|
2011-10-19 07:17:14 -07:00
|
|
|
elm_widget_translate_hook_set(obj, _translate_hook);
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2011-12-02 05:43:02 -08:00
|
|
|
wd->generation = 1;
|
2009-02-09 03:23:59 -08:00
|
|
|
wd->scr = elm_smart_scroller_add(e);
|
2010-05-07 06:24:29 -07:00
|
|
|
elm_smart_scroller_widget_set(wd->scr, obj);
|
2010-11-22 07:24:58 -08:00
|
|
|
elm_smart_scroller_object_theme_set(obj, wd->scr, "genlist", "base",
|
|
|
|
elm_widget_style_get(obj));
|
2010-10-21 12:57:43 -07:00
|
|
|
elm_smart_scroller_bounce_allow_set(wd->scr, EINA_FALSE,
|
|
|
|
_elm_config->thumbscroll_bounce_enable);
|
2010-11-22 07:24:58 -08:00
|
|
|
elm_widget_resize_object_set(obj, wd->scr);
|
2009-07-06 23:46:51 -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
|
|
|
evas_object_smart_callback_add(wd->scr, "animate,start", _scr_anim_start, obj);
|
|
|
|
evas_object_smart_callback_add(wd->scr, "animate,stop", _scr_anim_stop, obj);
|
|
|
|
evas_object_smart_callback_add(wd->scr, "drag,start", _scr_drag_start, obj);
|
|
|
|
evas_object_smart_callback_add(wd->scr, "drag,stop", _scr_drag_stop, obj);
|
2011-10-20 09:42:42 -07:00
|
|
|
evas_object_smart_callback_add(wd->scr, "edge,left", _edge_left, obj);
|
|
|
|
evas_object_smart_callback_add(wd->scr, "edge,right", _edge_right, obj);
|
|
|
|
evas_object_smart_callback_add(wd->scr, "edge,top", _edge_top, obj);
|
|
|
|
evas_object_smart_callback_add(wd->scr, "edge,bottom", _edge_bottom, obj);
|
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
|
|
|
|
2009-02-12 05:39:43 -08:00
|
|
|
wd->obj = obj;
|
2009-03-12 22:50:38 -07:00
|
|
|
wd->mode = ELM_LIST_SCROLL;
|
2010-11-17 09:15:28 -08:00
|
|
|
wd->max_items_per_block = MAX_ITEMS_PER_BLOCK;
|
2010-11-05 23:02:22 -07:00
|
|
|
wd->item_cache_max = wd->max_items_per_block * 2;
|
2010-12-06 21:04:45 -08:00
|
|
|
wd->longpress_timeout = _elm_config->longpress_timeout;
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2009-09-07 23:20:32 -07:00
|
|
|
evas_object_smart_callback_add(obj, "scroll-hold-on", _hold_on, obj);
|
|
|
|
evas_object_smart_callback_add(obj, "scroll-hold-off", _hold_off, obj);
|
|
|
|
evas_object_smart_callback_add(obj, "scroll-freeze-on", _freeze_on, obj);
|
|
|
|
evas_object_smart_callback_add(obj, "scroll-freeze-off", _freeze_off, obj);
|
2009-09-23 15:56:47 -07:00
|
|
|
|
2010-09-14 20:11:30 -07:00
|
|
|
wd->pan_smart = evas_object_smart_add(e, smart);
|
|
|
|
wd->pan = evas_object_smart_data_get(wd->pan_smart);
|
|
|
|
wd->pan->wd = wd;
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2009-02-10 03:57:47 -08:00
|
|
|
elm_smart_scroller_extern_pan_set(wd->scr, wd->pan_smart,
|
2010-11-23 12:20:41 -08:00
|
|
|
_pan_set, _pan_get, _pan_max_get,
|
|
|
|
_pan_min_get, _pan_child_size_get);
|
2009-02-10 03:57:47 -08:00
|
|
|
|
2009-09-23 15:56:47 -07:00
|
|
|
edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr),
|
2009-09-04 08:39:30 -07:00
|
|
|
&minw, &minh);
|
2009-02-09 03:23:59 -08:00
|
|
|
evas_object_size_hint_min_set(obj, minw, minh);
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2011-05-06 17:30:39 -07:00
|
|
|
evas_object_smart_callbacks_descriptions_set(obj, _signals);
|
|
|
|
|
2011-02-08 04:08:28 -08:00
|
|
|
_mirrored_set(obj, elm_widget_mirrored_get(obj));
|
2009-02-09 03:23:59 -08:00
|
|
|
_sizing_eval(obj);
|
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
2011-11-30 09:13:57 -08:00
|
|
|
void
|
|
|
|
_item_select(Elm_Gen_Item *it)
|
|
|
|
{
|
2011-12-02 05:43:02 -08:00
|
|
|
if ((it->wd->no_select) || (it->generation < it->wd->generation) || (it->mode_set)) return;
|
2011-11-30 09:13:57 -08:00
|
|
|
if (!it->selected)
|
|
|
|
{
|
|
|
|
it->selected = EINA_TRUE;
|
|
|
|
it->wd->selected = eina_list_append(it->wd->selected, it);
|
|
|
|
}
|
|
|
|
else if (!it->wd->always_select) return;
|
|
|
|
|
|
|
|
evas_object_ref(WIDGET(it));
|
|
|
|
it->walking++;
|
|
|
|
it->wd->walking++;
|
|
|
|
if (it->func.func) it->func.func((void *)it->func.data, WIDGET(it), it);
|
2011-12-02 05:43:02 -08:00
|
|
|
if (it->generation == it->wd->generation)
|
2011-11-30 09:13:57 -08:00
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, it);
|
|
|
|
it->walking--;
|
|
|
|
it->wd->walking--;
|
|
|
|
evas_object_unref(WIDGET(it));
|
|
|
|
if ((it->wd->clear_me) && (!it->wd->walking))
|
2011-12-02 05:43:02 -08:00
|
|
|
_elm_genlist_clear(WIDGET(it), EINA_TRUE);
|
2011-11-30 09:13:57 -08:00
|
|
|
else
|
|
|
|
{
|
2011-12-02 05:43:02 -08:00
|
|
|
if ((!it->walking) && (it->generation < it->wd->generation))
|
2011-11-30 09:13:57 -08:00
|
|
|
{
|
2012-01-27 03:59:22 -08:00
|
|
|
if (!it->relcount)
|
|
|
|
{
|
|
|
|
it->del_cb(it);
|
|
|
|
elm_widget_item_free(it);
|
|
|
|
}
|
2011-11-30 09:13:57 -08:00
|
|
|
}
|
|
|
|
else
|
2012-01-30 02:39:32 -08:00
|
|
|
it->wd->last_selected_item = (Elm_Object_Item *) it;
|
2011-11-30 09:13:57 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
|
|
|
_item_content_get_hook(Elm_Gen_Item *it, const char *part)
|
|
|
|
{
|
|
|
|
return edje_object_part_swallow_get(VIEW(it), part);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_content_set_hook(Elm_Gen_Item *it, const char *part, Evas_Object *content)
|
|
|
|
{
|
2012-02-07 08:33:22 -08:00
|
|
|
if (content && part)
|
|
|
|
{
|
|
|
|
it->content_objs = eina_list_append(it->content_objs, content);
|
|
|
|
edje_object_part_swallow(VIEW(it), part, content);
|
|
|
|
}
|
2011-11-30 09:13:57 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
|
|
|
_item_content_unset_hook(Elm_Gen_Item *it, const char *part)
|
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
|
|
|
obj = edje_object_part_swallow_get(VIEW(it), part);
|
|
|
|
if (!obj) return NULL;
|
2012-02-07 08:33:22 -08:00
|
|
|
it->content_objs = eina_list_remove(it->content_objs, obj);
|
2011-11-30 09:13:57 -08:00
|
|
|
edje_object_part_unswallow(VIEW(it), obj);
|
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char *
|
2011-12-15 07:24:17 -08:00
|
|
|
_item_text_hook(Elm_Gen_Item *it, const char *part)
|
2011-11-30 09:13:57 -08:00
|
|
|
{
|
2011-11-30 22:15:08 -08:00
|
|
|
if (!it->itc->func.text_get) return NULL;
|
2011-11-30 09:13:57 -08:00
|
|
|
return edje_object_part_text_get(VIEW(it), part);
|
|
|
|
}
|
|
|
|
|
2012-01-26 23:36:36 -08:00
|
|
|
static void
|
|
|
|
_item_disable_hook(Elm_Object_Item *it)
|
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *obj;
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
|
|
|
|
if (_it->generation < _it->wd->generation) return;
|
|
|
|
|
|
|
|
if (_it->selected)
|
|
|
|
elm_genlist_item_selected_set(it, EINA_FALSE);
|
|
|
|
|
|
|
|
if (_it->realized)
|
|
|
|
{
|
|
|
|
if (elm_widget_item_disabled_get(it))
|
2012-02-22 23:39:10 -08:00
|
|
|
{
|
|
|
|
edje_object_signal_emit(VIEW(_it), "elm,state,disabled", "elm");
|
|
|
|
if (_it->edit_obj)
|
|
|
|
edje_object_signal_emit(_it->edit_obj, "elm,state,disabled", "elm");
|
|
|
|
}
|
2012-01-26 23:36:36 -08:00
|
|
|
else
|
2012-02-22 23:39:10 -08:00
|
|
|
{
|
|
|
|
edje_object_signal_emit(VIEW(_it), "elm,state,enabled", "elm");
|
|
|
|
if (_it->edit_obj)
|
|
|
|
edje_object_signal_emit(_it->edit_obj, "elm,state,enabled", "elm");
|
|
|
|
}
|
2012-01-26 23:36:36 -08:00
|
|
|
EINA_LIST_FOREACH(_it->content_objs, l, obj)
|
|
|
|
elm_widget_disabled_set(obj, elm_widget_item_disabled_get(_it));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-01-27 03:59:22 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_item_del_pre_hook(Elm_Object_Item *it)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
|
|
|
|
if ((_it->relcount > 0) || (_it->walking > 0))
|
|
|
|
{
|
|
|
|
elm_genlist_item_subitems_clear(it);
|
|
|
|
if (_it->wd->show_item == _it) _it->wd->show_item = NULL;
|
|
|
|
_elm_genlist_item_del_notserious(_it);
|
|
|
|
if (_it->item->block)
|
|
|
|
{
|
|
|
|
if (_it->realized) _elm_genlist_item_unrealize(_it, EINA_FALSE);
|
|
|
|
_it->item->block->changed = EINA_TRUE;
|
|
|
|
if (_it->wd->calc_job) ecore_job_del(_it->wd->calc_job);
|
|
|
|
_it->wd->calc_job = ecore_job_add(_calc_job, _it->wd);
|
|
|
|
}
|
|
|
|
if (_it->parent)
|
|
|
|
{
|
|
|
|
_it->parent->item->items =
|
|
|
|
eina_list_remove(_it->parent->item->items, it);
|
|
|
|
_it->parent = NULL;
|
|
|
|
}
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
_item_del(_it);
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2011-11-30 09:13:57 -08:00
|
|
|
Elm_Gen_Item *
|
|
|
|
_elm_genlist_item_new(Widget_Data *wd,
|
|
|
|
const Elm_Gen_Item_Class *itc,
|
|
|
|
const void *data,
|
|
|
|
Elm_Gen_Item *parent,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
|
|
|
{
|
|
|
|
Elm_Gen_Item *it;
|
|
|
|
|
|
|
|
it = elm_widget_item_new(wd->obj, Elm_Gen_Item);
|
|
|
|
if (!it) return NULL;
|
|
|
|
it->wd = wd;
|
2011-12-02 05:43:02 -08:00
|
|
|
it->generation = wd->generation;
|
2011-11-30 09:13:57 -08:00
|
|
|
it->itc = itc;
|
2012-02-20 00:26:17 -08:00
|
|
|
elm_genlist_item_class_ref((Elm_Genlist_Item_Class *)itc);
|
2011-11-30 09:13:57 -08:00
|
|
|
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_content_set_hook_set(it, _item_content_set_hook);
|
|
|
|
elm_widget_item_content_unset_hook_set(it, _item_content_unset_hook);
|
2012-01-26 23:36:36 -08:00
|
|
|
elm_widget_item_disable_hook_set(it, _item_disable_hook);
|
2012-01-27 03:59:22 -08:00
|
|
|
elm_widget_item_del_pre_hook_set(it, _item_del_pre_hook);
|
2011-11-30 09:13:57 -08:00
|
|
|
/* TEMPORARY */
|
|
|
|
it->sel_cb = (Ecore_Cb)_item_select;
|
|
|
|
|
2011-12-15 07:24:17 -08:00
|
|
|
elm_widget_item_text_get_hook_set(it, _item_text_hook);
|
2011-11-30 09:13:57 -08:00
|
|
|
return it;
|
|
|
|
}
|
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
static Elm_Gen_Item *
|
2010-12-07 11:18:14 -08:00
|
|
|
_item_new(Widget_Data *wd,
|
|
|
|
const Elm_Genlist_Item_Class *itc,
|
|
|
|
const void *data,
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *parent,
|
2010-12-07 11:18:14 -08:00
|
|
|
Elm_Genlist_Item_Flags flags,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
2009-02-10 03:57:47 -08:00
|
|
|
{
|
2011-12-05 17:37:53 -08:00
|
|
|
Elm_Gen_Item *it, *it2;
|
|
|
|
int depth = 0;
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2011-11-30 09:13:57 -08:00
|
|
|
it = _elm_genlist_item_new(wd, itc, data, parent, func, func_data);
|
2009-02-10 03:57:47 -08:00
|
|
|
if (!it) return NULL;
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item = ELM_NEW(Elm_Gen_Item_Type);
|
|
|
|
it->item->flags = flags;
|
|
|
|
if (flags & ELM_GENLIST_ITEM_GROUP) it->group++;
|
|
|
|
it->item->expanded_depth = 0;
|
2011-10-21 15:55:45 -07:00
|
|
|
ELM_GEN_ITEM_SETUP(it);
|
2011-08-01 23:50:34 -07:00
|
|
|
if (it->parent)
|
|
|
|
{
|
2011-10-21 01:52:03 -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;
|
2011-08-01 23:50:34 -07:00
|
|
|
}
|
2011-12-05 17:37:53 -08:00
|
|
|
for (it2 = it, depth = 0; it2->parent; it2 = it2->parent)
|
|
|
|
{
|
|
|
|
if (!it2->parent->group) depth += 1;
|
|
|
|
}
|
|
|
|
it->item->expanded_depth = depth;
|
2012-02-21 15:59:25 -08:00
|
|
|
wd->item_count++;
|
2009-02-10 03:57:47 -08:00
|
|
|
return it;
|
|
|
|
}
|
|
|
|
|
2011-12-05 08:43:29 -08:00
|
|
|
static Item_Block *
|
|
|
|
_item_block_new(Widget_Data *wd, Eina_Bool prepend)
|
|
|
|
{
|
|
|
|
Item_Block *itb;
|
|
|
|
|
|
|
|
itb = calloc(1, sizeof(Item_Block));
|
|
|
|
if (!itb) return NULL;
|
|
|
|
itb->wd = wd;
|
|
|
|
if (prepend)
|
2011-12-26 06:30:21 -08:00
|
|
|
{
|
|
|
|
wd->blocks = eina_inlist_prepend(wd->blocks, EINA_INLIST_GET(itb));
|
|
|
|
_item_block_position_update(wd->blocks, 0);
|
|
|
|
}
|
2011-12-05 08:43:29 -08:00
|
|
|
else
|
2011-12-26 06:30:21 -08:00
|
|
|
{
|
|
|
|
wd->blocks = eina_inlist_append(wd->blocks, EINA_INLIST_GET(itb));
|
|
|
|
itb->position_update = EINA_TRUE;
|
|
|
|
if (wd->blocks != EINA_INLIST_GET(itb))
|
|
|
|
{
|
|
|
|
itb->position = ((Item_Block *) (EINA_INLIST_GET(itb)->prev))->position + 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
itb->position = 0;
|
|
|
|
}
|
|
|
|
}
|
2011-12-05 08:43:29 -08:00
|
|
|
return itb;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_item_block_add(Widget_Data *wd,
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it)
|
2009-02-11 03:49:43 -08:00
|
|
|
{
|
2009-02-24 05:08:21 -08:00
|
|
|
Item_Block *itb = NULL;
|
2009-02-18 04:41:45 -08:00
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
if (!it->item->rel)
|
2009-02-11 03:49:43 -08:00
|
|
|
{
|
2010-10-15 04:51:15 -07:00
|
|
|
newblock:
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->rel)
|
2010-10-15 04:51:15 -07:00
|
|
|
{
|
|
|
|
itb = calloc(1, sizeof(Item_Block));
|
2011-12-05 08:43:29 -08:00
|
|
|
if (!itb) return EINA_FALSE;
|
2010-10-15 04:51:15 -07:00
|
|
|
itb->wd = wd;
|
2011-10-21 01:52:03 -07:00
|
|
|
if (!it->item->rel->item->block)
|
2010-10-15 04:51:15 -07:00
|
|
|
{
|
2010-12-07 11:18:14 -08:00
|
|
|
wd->blocks =
|
2011-04-01 09:33:58 -07:00
|
|
|
eina_inlist_append(wd->blocks, EINA_INLIST_GET(itb));
|
2010-10-15 04:51:15 -07:00
|
|
|
itb->items = eina_list_append(itb->items, it);
|
2011-12-26 06:30:21 -08:00
|
|
|
itb->position_update = EINA_TRUE;
|
|
|
|
it->position = eina_list_count(itb->items);
|
|
|
|
it->position_update = EINA_TRUE;
|
|
|
|
|
|
|
|
if (wd->blocks != EINA_INLIST_GET(itb))
|
|
|
|
{
|
|
|
|
itb->position = ((Item_Block *) (EINA_INLIST_GET(itb)->prev))->position + 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
itb->position = 0;
|
|
|
|
}
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-12-26 06:30:21 -08:00
|
|
|
Eina_List *tmp;
|
|
|
|
|
|
|
|
tmp = eina_list_data_find_list(itb->items, it->item->rel);
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->before)
|
2010-10-15 04:51:15 -07:00
|
|
|
{
|
2010-12-07 11:18:14 -08:00
|
|
|
wd->blocks = eina_inlist_prepend_relative
|
2011-04-01 09:33:58 -07:00
|
|
|
(wd->blocks, EINA_INLIST_GET(itb),
|
2011-10-21 01:52:03 -07:00
|
|
|
EINA_INLIST_GET(it->item->rel->item->block));
|
2010-12-07 11:18:14 -08:00
|
|
|
itb->items =
|
2011-12-26 06:30:21 -08:00
|
|
|
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);
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-12-07 11:18:14 -08:00
|
|
|
wd->blocks = eina_inlist_append_relative
|
2011-04-01 09:33:58 -07:00
|
|
|
(wd->blocks, EINA_INLIST_GET(itb),
|
2011-10-21 01:52:03 -07:00
|
|
|
EINA_INLIST_GET(it->item->rel->item->block));
|
2010-12-07 11:18:14 -08:00
|
|
|
itb->items =
|
2011-12-26 06:30:21 -08:00
|
|
|
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);
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->before)
|
2010-10-15 04:51:15 -07:00
|
|
|
{
|
|
|
|
if (wd->blocks)
|
|
|
|
{
|
|
|
|
itb = (Item_Block *)(wd->blocks);
|
|
|
|
if (itb->count >= wd->max_items_per_block)
|
|
|
|
{
|
2011-12-05 08:43:29 -08:00
|
|
|
itb = _item_block_new(wd, EINA_TRUE);
|
|
|
|
if (!itb) return EINA_FALSE;
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-12-05 08:43:29 -08:00
|
|
|
itb = _item_block_new(wd, EINA_TRUE);
|
|
|
|
if (!itb) return EINA_FALSE;
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
|
|
|
itb->items = eina_list_prepend(itb->items, it);
|
2011-12-26 06:30:21 -08:00
|
|
|
|
|
|
|
_item_position_update(itb->items, 0);
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (wd->blocks)
|
|
|
|
{
|
|
|
|
itb = (Item_Block *)(wd->blocks->last);
|
|
|
|
if (itb->count >= wd->max_items_per_block)
|
|
|
|
{
|
2011-12-05 08:43:29 -08:00
|
|
|
itb = _item_block_new(wd, EINA_FALSE);
|
|
|
|
if (!itb) return EINA_FALSE;
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-12-05 08:43:29 -08:00
|
|
|
itb = _item_block_new(wd, EINA_FALSE);
|
|
|
|
if (!itb) return EINA_FALSE;
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
|
|
|
itb->items = eina_list_append(itb->items, it);
|
2011-12-26 06:30:21 -08:00
|
|
|
it->position = eina_list_count(itb->items);
|
2010-10-15 04:51:15 -07:00
|
|
|
}
|
|
|
|
}
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-12-26 06:30:21 -08:00
|
|
|
Eina_List *tmp;
|
|
|
|
|
2011-12-05 08:43:29 -08:00
|
|
|
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.
|
2011-12-05 17:23:55 -08:00
|
|
|
This lead to issue where we depend on an item that is not yet created. As a quick
|
2011-12-05 08:43:29 -08:00
|
|
|
work around, we reschedule the calc of the item and stop reordering the list to
|
|
|
|
prevent any nasty issue to show up here.
|
|
|
|
*/
|
|
|
|
wd->queue = eina_list_append(wd->queue, it);
|
2011-12-05 17:23:55 -08:00
|
|
|
wd->requeued = EINA_TRUE;
|
2011-12-05 08:43:29 -08:00
|
|
|
it->item->queued = EINA_TRUE;
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
itb = it->item->rel->item->block;
|
2010-10-15 04:51:15 -07:00
|
|
|
if (!itb) goto newblock;
|
2011-12-26 06:30:21 -08:00
|
|
|
tmp = eina_list_data_find_list(itb->items, it->item->rel);
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->before)
|
2011-12-26 06:30:21 -08:00
|
|
|
{
|
|
|
|
itb->items = eina_list_prepend_relative_list(itb->items, it, tmp);
|
|
|
|
_item_position_update(eina_list_prev(tmp), it->item->rel->position);
|
|
|
|
}
|
2010-10-15 04:51:15 -07:00
|
|
|
else
|
2011-12-26 06:30:21 -08:00
|
|
|
{
|
|
|
|
itb->items = eina_list_append_relative_list(itb->items, it, tmp);
|
|
|
|
_item_position_update(eina_list_next(tmp), it->item->rel->position + 1);
|
|
|
|
}
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
|
|
|
itb->count++;
|
2009-06-17 08:35:19 -07:00
|
|
|
itb->changed = EINA_TRUE;
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->block = itb;
|
2009-02-12 05:39:43 -08:00
|
|
|
if (itb->wd->calc_job) ecore_job_del(itb->wd->calc_job);
|
|
|
|
itb->wd->calc_job = ecore_job_add(_calc_job, itb->wd);
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->rel)
|
2009-02-18 20:37:06 -08:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->rel->relcount--;
|
2011-12-02 05:43:02 -08:00
|
|
|
if ((it->item->rel->generation < it->wd->generation) && (!it->item->rel->relcount))
|
2012-01-27 03:59:22 -08:00
|
|
|
{
|
|
|
|
_item_del(it->item->rel);
|
|
|
|
elm_widget_item_free(it->item->rel);
|
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->rel = NULL;
|
2009-02-18 20:37:06 -08:00
|
|
|
}
|
2010-01-23 01:07:20 -08:00
|
|
|
if (itb->count > itb->wd->max_items_per_block)
|
2009-09-22 22:48:59 -07:00
|
|
|
{
|
|
|
|
Item_Block *itb2;
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it2;
|
2011-12-05 08:43:29 -08:00
|
|
|
int newc;
|
|
|
|
Eina_Bool done = EINA_FALSE;
|
2009-09-23 15:56:47 -07:00
|
|
|
|
2009-09-22 22:48:59 -07:00
|
|
|
newc = itb->count / 2;
|
2011-12-05 08:43:29 -08:00
|
|
|
|
|
|
|
if (EINA_INLIST_GET(itb)->prev)
|
2009-09-22 22:48:59 -07:00
|
|
|
{
|
2011-12-05 08:43:29 -08:00
|
|
|
Item_Block *itbp = (Item_Block *)(EINA_INLIST_GET(itb)->prev);
|
2009-09-23 15:56:47 -07:00
|
|
|
|
2011-12-05 08:43:29 -08:00
|
|
|
if (itbp->count + newc < wd->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--;
|
2009-09-23 15:56:47 -07:00
|
|
|
|
2011-12-05 08:43:29 -08:00
|
|
|
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 < wd->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->wd = wd;
|
|
|
|
wd->blocks =
|
|
|
|
eina_inlist_append_relative(wd->blocks, EINA_INLIST_GET(itb2),
|
|
|
|
EINA_INLIST_GET(itb));
|
|
|
|
itb2->changed = EINA_TRUE;
|
|
|
|
while ((itb->count > newc) && (itb->items))
|
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
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++;
|
|
|
|
}
|
2009-09-22 22:48:59 -07:00
|
|
|
}
|
|
|
|
}
|
2011-12-05 08:43:29 -08:00
|
|
|
|
|
|
|
return EINA_TRUE;
|
2009-02-12 05:39:43 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2011-05-23 05:19:42 -07:00
|
|
|
_queue_process(Widget_Data *wd)
|
2009-02-12 05:39:43 -08:00
|
|
|
{
|
2010-12-20 09:03:12 -08:00
|
|
|
int n;
|
|
|
|
Eina_Bool showme = EINA_FALSE;
|
2010-01-23 01:07:20 -08:00
|
|
|
double t0, t;
|
2009-02-18 20:37:06 -08:00
|
|
|
|
2011-12-05 08:43:29 -08:00
|
|
|
t0 = ecore_loop_time_get();
|
2011-06-08 09:56:50 -07:00
|
|
|
//evas_event_freeze(evas_object_evas_get(wd->obj));
|
2010-01-23 01:07:20 -08:00
|
|
|
for (n = 0; (wd->queue) && (n < 128); n++)
|
2009-02-12 05:39:43 -08:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *it;
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2011-12-05 08:43:29 -08:00
|
|
|
it = eina_list_data_get(wd->queue);
|
2010-10-15 04:51:15 -07:00
|
|
|
wd->queue = eina_list_remove_list(wd->queue, wd->queue);
|
2011-10-21 01:52:03 -07:00
|
|
|
it->item->queued = EINA_FALSE;
|
2011-12-05 08:43:29 -08:00
|
|
|
if (!_item_block_add(wd, it)) continue;
|
2011-11-05 23:11:57 -07:00
|
|
|
if (!wd->blocks)
|
2011-11-18 01:12:27 -08:00
|
|
|
_item_block_realize(it->item->block);
|
2010-01-22 04:02:39 -08:00
|
|
|
t = ecore_time_get();
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->block->changed)
|
2010-01-23 01:07:20 -08:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
showme = _item_block_recalc(it->item->block, it->item->block->num, EINA_TRUE);
|
|
|
|
it->item->block->changed = 0;
|
2011-12-26 06:30:21 -08:00
|
|
|
if (wd->pan_changed)
|
2011-12-12 20:15:10 -08:00
|
|
|
{
|
|
|
|
if (wd->calc_job) ecore_job_del(wd->calc_job);
|
|
|
|
wd->calc_job = NULL;
|
|
|
|
_calc_job(wd);
|
|
|
|
wd->pan_changed = EINA_FALSE;
|
|
|
|
}
|
2010-01-23 01:07:20 -08:00
|
|
|
}
|
2011-10-21 01:52:03 -07:00
|
|
|
if (showme) it->item->block->showme = EINA_TRUE;
|
2011-12-26 06:30:21 -08:00
|
|
|
/* same as eina_inlist_count > 1 */
|
|
|
|
if (wd->blocks && wd->blocks->next)
|
2010-02-04 22:14:50 -08:00
|
|
|
{
|
|
|
|
if ((t - t0) > (ecore_animator_frametime_get())) break;
|
|
|
|
}
|
2010-01-23 01:07:20 -08:00
|
|
|
}
|
2011-06-08 09:56:50 -07:00
|
|
|
//evas_event_thaw(evas_object_evas_get(wd->obj));
|
|
|
|
//evas_event_thaw_eval(evas_object_evas_get(wd->obj));
|
2010-03-28 19:27:26 -07:00
|
|
|
return n;
|
|
|
|
}
|
|
|
|
|
2010-06-25 02:58:14 -07:00
|
|
|
static Eina_Bool
|
2011-04-27 03:17:26 -07:00
|
|
|
_idle_process(void *data, Eina_Bool *wakeup)
|
2010-03-28 19:27:26 -07:00
|
|
|
{
|
|
|
|
Widget_Data *wd = data;
|
2010-10-15 04:51:15 -07:00
|
|
|
|
2010-12-07 11:18:14 -08:00
|
|
|
//xxx
|
|
|
|
//static double q_start = 0.0;
|
|
|
|
//if (q_start == 0.0) q_start = ecore_time_get();
|
|
|
|
//xxx
|
2011-05-23 05:19:42 -07:00
|
|
|
if (_queue_process(wd) > 0) *wakeup = EINA_TRUE;
|
2009-02-12 05:39:43 -08:00
|
|
|
if (!wd->queue)
|
|
|
|
{
|
2010-12-07 11:18:14 -08:00
|
|
|
//xxx
|
|
|
|
//printf("PROCESS TIME: %3.3f\n", ecore_time_get() - q_start);
|
|
|
|
//xxx
|
2011-03-29 18:35:15 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2009-02-12 05:39:43 -08:00
|
|
|
}
|
2010-06-25 02:58:14 -07:00
|
|
|
return ECORE_CALLBACK_RENEW;
|
2009-02-12 05:39:43 -08:00
|
|
|
}
|
|
|
|
|
2011-04-27 03:17:26 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_item_idle_enterer(void *data)
|
|
|
|
{
|
|
|
|
Widget_Data *wd = data;
|
|
|
|
Eina_Bool wakeup = EINA_FALSE;
|
|
|
|
Eina_Bool ok = _idle_process(data, &wakeup);
|
2011-05-07 01:37:47 -07:00
|
|
|
|
2011-04-27 03:17:26 -07:00
|
|
|
if (wakeup)
|
|
|
|
{
|
|
|
|
// wake up mainloop
|
|
|
|
if (wd->calc_job) ecore_job_del(wd->calc_job);
|
|
|
|
wd->calc_job = ecore_job_add(_calc_job, wd);
|
|
|
|
}
|
2011-05-07 01:37:47 -07:00
|
|
|
if (ok == ECORE_CALLBACK_CANCEL) wd->queue_idle_enterer = NULL;
|
2011-04-27 03:17:26 -07:00
|
|
|
return ok;
|
|
|
|
}
|
|
|
|
|
2009-02-12 05:39:43 -08:00
|
|
|
static void
|
2011-12-02 08:17:10 -08:00
|
|
|
_item_queue(Widget_Data *wd,
|
|
|
|
Elm_Gen_Item *it,
|
|
|
|
Eina_Compare_Cb cb)
|
2009-02-12 05:39:43 -08:00
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
if (it->item->queued) return;
|
|
|
|
it->item->queued = EINA_TRUE;
|
2011-12-05 17:23:55 -08:00
|
|
|
if (cb && !wd->requeued)
|
2011-12-02 08:17:10 -08:00
|
|
|
wd->queue = eina_list_sorted_insert(wd->queue, cb, it);
|
|
|
|
else
|
|
|
|
wd->queue = eina_list_append(wd->queue, it);
|
2011-06-01 06:13:56 -07:00
|
|
|
// 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(wd->obj));
|
2010-03-24 03:00:50 -07:00
|
|
|
while ((wd->queue) && ((!wd->blocks) || (!wd->blocks->next)))
|
|
|
|
{
|
2011-04-27 03:17:26 -07:00
|
|
|
if (wd->queue_idle_enterer)
|
2010-03-24 03:00:50 -07:00
|
|
|
{
|
2011-04-27 03:17:26 -07:00
|
|
|
ecore_idle_enterer_del(wd->queue_idle_enterer);
|
|
|
|
wd->queue_idle_enterer = NULL;
|
2010-03-24 03:00:50 -07:00
|
|
|
}
|
2011-05-23 05:19:42 -07:00
|
|
|
_queue_process(wd);
|
2010-03-24 03:00:50 -07:00
|
|
|
}
|
2011-06-01 06:13:56 -07:00
|
|
|
// evas_event_thaw(evas_object_evas_get(wd->obj));
|
|
|
|
// evas_event_thaw_eval(evas_object_evas_get(wd->obj));
|
2011-05-07 01:37:47 -07:00
|
|
|
if (!wd->queue_idle_enterer)
|
2011-06-08 03:58:00 -07:00
|
|
|
wd->queue_idle_enterer = ecore_idle_enterer_add(_item_idle_enterer, wd);
|
2009-02-11 03:49:43 -08:00
|
|
|
}
|
|
|
|
|
2011-06-25 16:20:22 -07:00
|
|
|
static int
|
|
|
|
_elm_genlist_item_compare_data(const void *data, const void *data1)
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
const Elm_Gen_Item *it = data;
|
|
|
|
const Elm_Gen_Item *item1 = data1;
|
2011-06-25 16:20:22 -07:00
|
|
|
|
2011-12-05 17:19:12 -08:00
|
|
|
return it->wd->item_compare_data_cb(it->base.data, item1->base.data);
|
2011-06-25 16:20:22 -07:00
|
|
|
}
|
|
|
|
|
2011-05-25 07:58:39 -07:00
|
|
|
static int
|
|
|
|
_elm_genlist_item_compare(const void *data, const void *data1)
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
const Elm_Gen_Item *it, *item1;
|
2011-10-21 15:55:45 -07:00
|
|
|
it = ELM_GEN_ITEM_FROM_INLIST(data);
|
|
|
|
item1 = ELM_GEN_ITEM_FROM_INLIST(data1);
|
2011-12-05 17:19:12 -08:00
|
|
|
return it->wd->item_compare_cb(it, item1);
|
2011-05-25 07:58:39 -07:00
|
|
|
}
|
|
|
|
|
2011-07-28 09:43:15 -07:00
|
|
|
static int
|
|
|
|
_elm_genlist_item_list_compare(const void *data, const void *data1)
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
const Elm_Gen_Item *it = data;
|
|
|
|
const Elm_Gen_Item *item1 = data1;
|
2011-12-05 17:19:12 -08:00
|
|
|
return it->wd->item_compare_cb(it, item1);
|
2011-07-28 09:43:15 -07:00
|
|
|
}
|
|
|
|
|
2011-06-01 20:10:11 -07:00
|
|
|
static void
|
2011-10-21 01:52:03 -07:00
|
|
|
_item_move_after(Elm_Gen_Item *it, Elm_Gen_Item *after)
|
2011-06-01 20:10:11 -07:00
|
|
|
{
|
|
|
|
if (!it) return;
|
|
|
|
if (!after) return;
|
|
|
|
|
|
|
|
it->wd->items = eina_inlist_remove(it->wd->items, EINA_INLIST_GET(it));
|
|
|
|
_item_block_del(it);
|
|
|
|
|
|
|
|
it->wd->items = eina_inlist_append_relative(it->wd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(after));
|
2011-10-21 01:52:03 -07:00
|
|
|
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;
|
2011-12-02 08:17:10 -08:00
|
|
|
_item_queue(it->wd, it, NULL);
|
2011-06-01 20:10:11 -07:00
|
|
|
|
2011-10-20 18:49:15 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_MOVED, it);
|
2011-06-01 20:10:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-10-21 01:52:03 -07:00
|
|
|
_item_move_before(Elm_Gen_Item *it, Elm_Gen_Item *before)
|
2011-06-01 20:10:11 -07:00
|
|
|
{
|
|
|
|
if (!it) return;
|
|
|
|
if (!before) return;
|
|
|
|
|
|
|
|
it->wd->items = eina_inlist_remove(it->wd->items, EINA_INLIST_GET(it));
|
|
|
|
_item_block_del(it);
|
|
|
|
it->wd->items = eina_inlist_prepend_relative(it->wd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(before));
|
2011-10-21 01:52:03 -07:00
|
|
|
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;
|
2011-12-02 08:17:10 -08:00
|
|
|
_item_queue(it->wd, it, NULL);
|
2011-06-01 20:10:11 -07:00
|
|
|
|
2011-10-20 18:49:15 -07:00
|
|
|
evas_object_smart_callback_call(WIDGET(it), SIG_MOVED, it);
|
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
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) 0;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return 0;
|
|
|
|
return wd->item_count;
|
|
|
|
}
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
EAPI Elm_Object_Item *
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_genlist_item_append(Evas_Object *obj,
|
|
|
|
const Elm_Genlist_Item_Class *itc,
|
|
|
|
const void *data,
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Object_Item *parent,
|
2010-12-07 11:18:14 -08:00
|
|
|
Elm_Genlist_Item_Flags flags,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
2009-02-09 03:23:59 -08:00
|
|
|
{
|
2010-03-09 06:42:41 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
2009-02-09 03:23:59 -08:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2011-02-13 05:16:59 -08:00
|
|
|
if (!wd) return NULL;
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, flags,
|
|
|
|
func, func_data);
|
2009-02-10 03:57:47 -08:00
|
|
|
if (!it) return NULL;
|
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)
|
2011-03-18 07:29:48 -07:00
|
|
|
wd->group_items = eina_list_append(wd->group_items, it);
|
2010-10-15 04:51:15 -07:00
|
|
|
wd->items = eina_inlist_append(wd->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);
|
2010-10-15 04:51:15 -07:00
|
|
|
if (ll) it2 = ll->data;
|
2011-10-21 01:52:03 -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;
|
2010-12-07 11:18:14 -08:00
|
|
|
wd->items =
|
2011-06-23 02:51:03 -07:00
|
|
|
eina_inlist_append_relative(wd->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;
|
2011-12-02 08:17:10 -08:00
|
|
|
_item_queue(wd, it, NULL);
|
2012-01-19 21:18:31 -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 *
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_genlist_item_prepend(Evas_Object *obj,
|
|
|
|
const Elm_Genlist_Item_Class *itc,
|
|
|
|
const void *data,
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Object_Item *parent,
|
2010-12-07 11:18:14 -08:00
|
|
|
Elm_Genlist_Item_Flags flags,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
2009-02-10 03:57:47 -08:00
|
|
|
{
|
2010-03-09 06:42:41 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
2009-02-18 04:41:45 -08:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2011-02-13 05:16:59 -08:00
|
|
|
if (!wd) return NULL;
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, flags,
|
|
|
|
func, func_data);
|
2009-02-18 04:41:45 -08:00
|
|
|
if (!it) return NULL;
|
|
|
|
if (!it->parent)
|
2011-01-04 21:59:30 -08:00
|
|
|
{
|
2011-10-23 20:40:54 -07:00
|
|
|
if (it->group)
|
2011-03-22 00:54:24 -07:00
|
|
|
wd->group_items = eina_list_prepend(wd->group_items, it);
|
2011-01-04 21:59:30 -08:00
|
|
|
wd->items = eina_inlist_prepend(wd->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;
|
2011-01-04 21:59:30 -08:00
|
|
|
if (ll) it2 = ll->data;
|
2011-10-21 01:52:03 -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;
|
|
|
|
wd->items =
|
2011-04-01 09:33:58 -07:00
|
|
|
eina_inlist_prepend_relative(wd->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;
|
2011-12-02 08:17:10 -08:00
|
|
|
_item_queue(wd, it, NULL);
|
2012-01-19 21:18:31 -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 *
|
2011-08-01 23:59:45 -07:00
|
|
|
elm_genlist_item_insert_after(Evas_Object *obj,
|
|
|
|
const Elm_Genlist_Item_Class *itc,
|
|
|
|
const void *data,
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Object_Item *parent,
|
|
|
|
Elm_Object_Item *after,
|
2011-08-01 23:59:45 -07:00
|
|
|
Elm_Genlist_Item_Flags flags,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(after, NULL);
|
2011-08-01 23:59:45 -07:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Gen_Item *_after = (Elm_Gen_Item *) after;
|
2011-08-01 23:59:45 -07:00
|
|
|
if (!wd) return NULL;
|
|
|
|
/* 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(wd->items, NULL);
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, flags,
|
|
|
|
func, func_data);
|
2011-11-28 16:06:55 -08:00
|
|
|
if (!it) return NULL;
|
2011-08-01 23:59:45 -07:00
|
|
|
if (!it->parent)
|
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
if ((it->group) && (_after->group))
|
2011-08-26 04:32:26 -07:00
|
|
|
wd->group_items = eina_list_append_relative(wd->group_items, it,
|
2012-01-19 21:18:31 -08:00
|
|
|
_after);
|
2011-08-01 23:59:45 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
it->parent->item->items =
|
|
|
|
eina_list_append_relative(it->parent->item->items, it, _after);
|
2011-08-01 23:59:45 -07:00
|
|
|
}
|
2011-08-26 04:32:26 -07:00
|
|
|
wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it),
|
2012-01-19 21:18:31 -08:00
|
|
|
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;
|
2011-12-02 08:17:10 -08:00
|
|
|
_item_queue(wd, it, NULL);
|
2012-01-19 21:18:31 -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 *
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_genlist_item_insert_before(Evas_Object *obj,
|
|
|
|
const Elm_Genlist_Item_Class *itc,
|
|
|
|
const void *data,
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Object_Item *parent,
|
|
|
|
Elm_Object_Item *before,
|
2010-12-07 11:18:14 -08:00
|
|
|
Elm_Genlist_Item_Flags flags,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
2009-02-10 03:57:47 -08:00
|
|
|
{
|
2010-03-09 06:42:41 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(before, NULL);
|
2009-02-18 04:41:45 -08:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Gen_Item *_before = (Elm_Gen_Item *) before;
|
2011-02-13 05:16:59 -08:00
|
|
|
if (!wd) return NULL;
|
2011-08-01 23:54:10 -07:00
|
|
|
/* 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(wd->items, NULL);
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, flags,
|
|
|
|
func, func_data);
|
2011-11-28 16:06:55 -08:00
|
|
|
if (!it) return NULL;
|
2011-08-01 23:50:34 -07:00
|
|
|
if (!it->parent)
|
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
if (it->group && _before->group)
|
2011-08-01 23:50:34 -07:00
|
|
|
wd->group_items = eina_list_prepend_relative(wd->group_items, it,
|
2012-01-19 21:18:31 -08:00
|
|
|
_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 =
|
|
|
|
eina_list_prepend_relative(it->parent->item->items, it, _before);
|
2009-02-18 04:41:45 -08:00
|
|
|
}
|
2011-01-04 22:03:43 -08:00
|
|
|
wd->items = eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it),
|
2012-01-19 21:18:31 -08:00
|
|
|
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;
|
2011-12-02 08:17:10 -08:00
|
|
|
_item_queue(wd, it, NULL);
|
2012-01-19 21:18:31 -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 *
|
2011-06-25 16:20:22 -07:00
|
|
|
elm_genlist_item_direct_sorted_insert(Evas_Object *obj,
|
|
|
|
const Elm_Genlist_Item_Class *itc,
|
|
|
|
const void *data,
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Object_Item *parent,
|
2011-06-25 16:20:22 -07:00
|
|
|
Elm_Genlist_Item_Flags flags,
|
|
|
|
Eina_Compare_Cb comp,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
2011-05-25 07:58:39 -07:00
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return NULL;
|
2011-10-21 01:52:03 -07:00
|
|
|
Elm_Gen_Item *rel = NULL;
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Gen_Item *it = _item_new(wd, itc, data, (Elm_Gen_Item *) parent, flags,
|
|
|
|
func, func_data);
|
2011-05-25 07:58:39 -07:00
|
|
|
if (!it) return NULL;
|
|
|
|
|
2011-12-05 17:19:12 -08:00
|
|
|
wd->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;
|
|
|
|
|
2011-10-21 01:52:03 -07:00
|
|
|
l = eina_list_search_sorted_near_list(it->parent->item->items,
|
2011-07-28 09:43:15 -07:00
|
|
|
_elm_genlist_item_list_compare, it,
|
|
|
|
&cmp_result);
|
|
|
|
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
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
it->parent->item->items = eina_list_prepend_relative_list(it->parent->item->items, it, l);
|
2011-07-28 09:43:15 -07:00
|
|
|
wd->items = eina_inlist_prepend_relative(wd->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)
|
|
|
|
{
|
2011-10-21 01:52:03 -07:00
|
|
|
it->parent->item->items = eina_list_append_relative_list(it->parent->item->items, it, l);
|
2011-07-28 09:43:15 -07:00
|
|
|
wd->items = eina_inlist_append_relative(wd->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
|
|
|
{
|
2011-09-05 13:31:51 -07:00
|
|
|
if (!wd->state)
|
|
|
|
{
|
|
|
|
wd->state = eina_inlist_sorted_state_new();
|
2011-11-04 13:34:41 -07:00
|
|
|
eina_inlist_sorted_state_init(wd->state, wd->items);
|
2011-12-05 17:23:55 -08:00
|
|
|
wd->requeued = EINA_FALSE;
|
2011-09-05 13:31:51 -07:00
|
|
|
}
|
|
|
|
|
2011-10-23 20:40:54 -07:00
|
|
|
if (it->group)
|
2011-07-28 09:43:15 -07:00
|
|
|
wd->group_items = eina_list_append(wd->group_items, it);
|
|
|
|
|
2011-09-05 13:31:51 -07:00
|
|
|
wd->items = eina_inlist_sorted_state_insert(wd->items, EINA_INLIST_GET(it),
|
|
|
|
_elm_genlist_item_compare, wd->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
|
|
|
|
2011-12-05 08:43:29 -08:00
|
|
|
_item_queue(wd, it, _elm_genlist_item_list_compare);
|
2011-05-25 07:58:39 -07:00
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
return (Elm_Object_Item *) it;
|
2011-05-25 07:58:39 -07:00
|
|
|
}
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
EAPI Elm_Object_Item *
|
2011-06-25 16:20:22 -07:00
|
|
|
elm_genlist_item_sorted_insert(Evas_Object *obj,
|
|
|
|
const Elm_Genlist_Item_Class *itc,
|
|
|
|
const void *data,
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Object_Item *parent,
|
2011-06-25 16:20:22 -07:00
|
|
|
Elm_Genlist_Item_Flags flags,
|
|
|
|
Eina_Compare_Cb comp,
|
|
|
|
Evas_Smart_Cb func,
|
|
|
|
const void *func_data)
|
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
2011-12-05 17:19:12 -08:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
wd->item_compare_data_cb = comp;
|
2011-06-25 16:20:22 -07:00
|
|
|
return elm_genlist_item_direct_sorted_insert(obj, itc, data, parent, flags,
|
2012-01-19 21:18:31 -08:00
|
|
|
_elm_genlist_item_compare_data,
|
|
|
|
func, func_data);
|
2011-06-25 16:20:22 -07:00
|
|
|
}
|
|
|
|
|
2011-12-02 05:43:02 -08:00
|
|
|
static void
|
|
|
|
_elm_genlist_clear(Evas_Object *obj, Eina_Bool standby)
|
2009-02-17 20:27:49 -08:00
|
|
|
{
|
2011-12-02 05:43:02 -08:00
|
|
|
Eina_Inlist *next, *l;
|
|
|
|
|
2011-11-30 09:13:57 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
|
2011-12-02 05:43:02 -08:00
|
|
|
if (!standby) wd->generation++;
|
|
|
|
|
2011-11-30 09:13:57 -08:00
|
|
|
if (wd->state)
|
|
|
|
{
|
|
|
|
eina_inlist_sorted_state_free(wd->state);
|
|
|
|
wd->state = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (wd->walking > 0)
|
|
|
|
{
|
|
|
|
wd->clear_me = 1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
evas_event_freeze(evas_object_evas_get(wd->obj));
|
2011-12-02 05:43:02 -08:00
|
|
|
for (l = wd->items, next = l ? l->next : NULL;
|
|
|
|
l;
|
|
|
|
l = next, next = next ? next->next : NULL)
|
2011-11-30 09:13:57 -08:00
|
|
|
{
|
2011-12-02 05:43:02 -08:00
|
|
|
Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(l);
|
|
|
|
|
|
|
|
if (it->generation < wd->generation)
|
|
|
|
{
|
2011-12-02 08:00:41 -08:00
|
|
|
Elm_Gen_Item *itn = NULL;
|
|
|
|
|
|
|
|
if (next) itn = ELM_GEN_ITEM_FROM_INLIST(next);
|
|
|
|
if (itn) itn->walking++; /* prevent early death of subitem */
|
2011-12-02 05:43:02 -08:00
|
|
|
it->del_cb(it);
|
2012-01-27 03:59:22 -08:00
|
|
|
elm_widget_item_free(it);
|
2011-12-02 08:00:41 -08:00
|
|
|
if (itn) itn->walking--;
|
2011-12-02 05:43:02 -08:00
|
|
|
}
|
2011-11-30 09:13:57 -08:00
|
|
|
}
|
|
|
|
wd->clear_me = 0;
|
2011-12-12 20:15:10 -08:00
|
|
|
wd->pan_changed = EINA_TRUE;
|
2011-11-30 09:13:57 -08:00
|
|
|
if (wd->calc_job)
|
|
|
|
{
|
|
|
|
ecore_job_del(wd->calc_job);
|
|
|
|
wd->calc_job = NULL;
|
|
|
|
}
|
|
|
|
if (wd->selected) wd->selected = eina_list_free(wd->selected);
|
|
|
|
if (wd->clear_cb) wd->clear_cb(wd);
|
|
|
|
wd->pan_x = 0;
|
|
|
|
wd->pan_y = 0;
|
|
|
|
wd->minw = 0;
|
|
|
|
wd->minh = 0;
|
|
|
|
if (wd->pan_smart)
|
|
|
|
{
|
|
|
|
evas_object_size_hint_min_set(wd->pan_smart, wd->minw, wd->minh);
|
|
|
|
evas_object_smart_callback_call(wd->pan_smart, "changed", NULL);
|
|
|
|
}
|
|
|
|
if (wd->sizing_cb) wd->sizing_cb(wd->obj);
|
|
|
|
elm_smart_scroller_child_region_show(wd->scr, 0, 0, 0, 0);
|
|
|
|
evas_event_thaw(evas_object_evas_get(wd->obj));
|
|
|
|
evas_event_thaw_eval(evas_object_evas_get(wd->obj));
|
2009-02-17 20:27:49 -08:00
|
|
|
}
|
2009-02-10 03:57:47 -08:00
|
|
|
|
2011-12-02 05:43:02 -08:00
|
|
|
EAPI void
|
|
|
|
elm_genlist_clear(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
_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,
|
|
|
|
Eina_Bool multi)
|
2009-02-10 03:57:47 -08:00
|
|
|
{
|
2010-03-08 22:15:39 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
2009-02-16 23:50:35 -08:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2010-03-09 06:42:41 -08:00
|
|
|
if (!wd) return;
|
2009-02-16 23:50:35 -08:00
|
|
|
wd->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)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return EINA_FALSE;
|
|
|
|
return wd->multi;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
2010-03-09 06:42:41 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
2009-02-16 23:50:35 -08:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2010-03-09 06:42:41 -08:00
|
|
|
if (!wd) return NULL;
|
2009-02-16 23:50:35 -08:00
|
|
|
if (wd->selected) return wd->selected->data;
|
|
|
|
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
|
|
|
{
|
2010-03-09 06:42:41 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
2009-02-16 23:50:35 -08:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2010-03-09 06:42:41 -08:00
|
|
|
if (!wd) return NULL;
|
2009-02-16 23:50:35 -08:00
|
|
|
return wd->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)
|
|
|
|
{
|
2010-03-09 06:42:41 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
2010-01-24 21:54:31 -08:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
Eina_List *list = NULL;
|
|
|
|
Item_Block *itb;
|
2010-06-05 06:12:45 -07:00
|
|
|
Eina_Bool done = EINA_FALSE;
|
2010-03-09 06:42:41 -08:00
|
|
|
if (!wd) return NULL;
|
2010-01-24 21:54:31 -08:00
|
|
|
EINA_INLIST_FOREACH(wd->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
|
|
|
|
|
|
|
done = 1;
|
|
|
|
EINA_LIST_FOREACH(itb->items, l, it)
|
|
|
|
{
|
|
|
|
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,
|
|
|
|
Evas_Coord x,
|
|
|
|
Evas_Coord y,
|
|
|
|
int *posret)
|
2009-09-22 20:22:07 -07:00
|
|
|
{
|
2010-03-09 06:42:41 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
2009-09-22 20:22:07 -07:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
Evas_Coord ox, oy, ow, oh;
|
|
|
|
Item_Block *itb;
|
|
|
|
Evas_Coord lasty;
|
2010-03-09 06:42:41 -08:00
|
|
|
if (!wd) return NULL;
|
2009-09-22 20:22:07 -07:00
|
|
|
evas_object_geometry_get(wd->pan_smart, &ox, &oy, &ow, &oh);
|
|
|
|
lasty = oy;
|
|
|
|
EINA_INLIST_FOREACH(wd->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
|
|
|
|
|
|
|
if (!ELM_RECTS_INTERSECT(ox + itb->x - itb->wd->pan_x,
|
|
|
|
oy + itb->y - itb->wd->pan_y,
|
|
|
|
itb->w, itb->h, x, y, 1, 1))
|
|
|
|
continue;
|
|
|
|
EINA_LIST_FOREACH(itb->items, l, it)
|
|
|
|
{
|
|
|
|
Evas_Coord itx, ity;
|
|
|
|
|
|
|
|
itx = ox + itb->x + it->x - itb->wd->pan_x;
|
|
|
|
ity = oy + itb->y + it->y - itb->wd->pan_y;
|
2011-10-21 01:52:03 -07:00
|
|
|
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-01-19 21:18:31 -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;
|
|
|
|
}
|
|
|
|
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
|
|
|
{
|
2011-11-30 09:13:57 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return NULL;
|
|
|
|
if (!wd->items) return NULL;
|
|
|
|
Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(wd->items);
|
2011-12-02 05:43:02 -08:00
|
|
|
while ((it) && (it->generation < wd->generation))
|
2011-11-30 09:13:57 -08:00
|
|
|
it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
|
2012-01-19 21:18:31 -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
|
|
|
{
|
2011-11-30 09:13:57 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return NULL;
|
|
|
|
if (!wd->items) return NULL;
|
|
|
|
Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(wd->items->last);
|
2011-12-02 05:43:02 -08:00
|
|
|
while ((it) && (it->generation < wd->generation))
|
2011-11-30 09:13:57 -08:00
|
|
|
it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
|
2012-01-19 21:18:31 -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 *
|
|
|
|
elm_genlist_item_next_get(const Elm_Object_Item *it)
|
2009-02-16 23:50:35 -08:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
while (_it)
|
2011-11-30 09:13:57 -08:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
_it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(_it)->next);
|
|
|
|
if ((_it) && (_it->generation == _it->wd->generation)) break;
|
2011-11-30 09:13:57 -08:00
|
|
|
}
|
2012-01-19 21:18:31 -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 *
|
|
|
|
elm_genlist_item_prev_get(const Elm_Object_Item *it)
|
2009-02-16 23:50:35 -08:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
while (_it)
|
2011-11-30 09:13:57 -08:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
_it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(_it)->prev);
|
|
|
|
if ((_it) && (_it->generation == _it->wd->generation)) break;
|
2011-11-30 09:13:57 -08:00
|
|
|
}
|
2012-01-19 21:18:31 -08:00
|
|
|
return (Elm_Object_Item *) _it;
|
2009-02-10 03:57:47 -08:00
|
|
|
}
|
|
|
|
|
2009-03-12 22:50:38 -07:00
|
|
|
EAPI Evas_Object *
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_genlist_get(const Elm_Object_Item *it)
|
2009-03-12 22:50:38 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
return elm_object_item_widget_get(it);
|
2009-03-12 22:50:38 -07: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-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_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-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_subitems_clear(Elm_Object_Item *it)
|
2009-03-12 22:50:38 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
2009-03-12 22:50:38 -07:00
|
|
|
Eina_List *tl = NULL, *l;
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Gen_Item *_it;
|
|
|
|
Elm_Object_Item *it2;
|
|
|
|
_it = (Elm_Gen_Item *) it;
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
EINA_LIST_FOREACH(_it->item->items, l, it2)
|
2011-04-01 09:33:58 -07:00
|
|
|
tl = eina_list_append(tl, it2);
|
2009-03-12 22:50:38 -07:00
|
|
|
EINA_LIST_FREE(tl, it2)
|
2012-01-27 03:59:22 -08:00
|
|
|
elm_object_item_del(it2);
|
2009-03-12 22:50:38 -07:00
|
|
|
}
|
|
|
|
|
2009-02-10 03:57:47 -08:00
|
|
|
EAPI void
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_selected_set(Elm_Object_Item *it,
|
|
|
|
Eina_Bool selected)
|
2009-02-10 03:57:47 -08:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
Widget_Data *wd = _it->wd;
|
2011-11-30 09:13:57 -08:00
|
|
|
if (!wd) return;
|
2012-01-26 23:36:36 -08:00
|
|
|
if ((_it->generation < wd->generation) || elm_widget_item_disabled_get(_it))
|
|
|
|
return;
|
2011-11-30 09:13:57 -08:00
|
|
|
selected = !!selected;
|
2012-01-19 21:18:31 -08:00
|
|
|
if (_it->selected == selected) return;
|
2011-11-30 09:13:57 -08:00
|
|
|
|
|
|
|
if (selected)
|
|
|
|
{
|
|
|
|
if (!wd->multi)
|
|
|
|
{
|
|
|
|
while (wd->selected)
|
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
if (_it->unhighlight_cb) _it->unhighlight_cb(wd->selected->data);
|
|
|
|
_it->unsel_cb(wd->selected->data);
|
2011-11-30 09:13:57 -08:00
|
|
|
}
|
|
|
|
}
|
2012-01-19 21:18:31 -08:00
|
|
|
_it->highlight_cb(_it);
|
|
|
|
_item_select(_it);
|
2011-11-30 09:13:57 -08:00
|
|
|
return;
|
|
|
|
}
|
2012-01-19 21:18:31 -08: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-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
|
|
|
|
return ((Elm_Gen_Item *) it)->selected;
|
2009-02-17 20:51:22 -08:00
|
|
|
}
|
|
|
|
|
2009-02-10 03:57:47 -08:00
|
|
|
EAPI void
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_expanded_set(Elm_Object_Item *it,
|
2010-12-07 11:18:14 -08:00
|
|
|
Eina_Bool expanded)
|
2009-02-10 03:57:47 -08:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
if (_it->item->expanded == expanded) return;
|
|
|
|
_it->item->expanded = expanded;
|
|
|
|
_it->wd->expanded_item = _it;
|
|
|
|
if (_it->item->expanded)
|
2009-03-12 22:50:38 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
if (_it->realized)
|
|
|
|
edje_object_signal_emit(VIEW(_it), "elm,state,expanded", "elm");
|
|
|
|
evas_object_smart_callback_call(WIDGET(_it), SIG_EXPANDED, _it);
|
|
|
|
_it->wd->auto_scroll_enabled = EINA_TRUE;
|
2009-03-12 22:50:38 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
if (_it->realized)
|
|
|
|
edje_object_signal_emit(VIEW(_it), "elm,state,contracted", "elm");
|
|
|
|
evas_object_smart_callback_call(WIDGET(_it), SIG_CONTRACTED, _it);
|
|
|
|
_it->wd->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-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
|
|
|
|
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-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, 0);
|
|
|
|
return ((Elm_Gen_Item *) it)->item->expanded_depth;
|
2010-10-06 23:45:36 -07:00
|
|
|
}
|
|
|
|
|
2009-02-10 03:57:47 -08:00
|
|
|
EAPI void
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_disabled_set(Elm_Object_Item *it,
|
2010-12-07 11:18:14 -08:00
|
|
|
Eina_Bool disabled)
|
2009-02-10 03:57:47 -08:00
|
|
|
{
|
2012-01-26 23:36:36 -08:00
|
|
|
elm_object_item_disabled_set(it, disabled);
|
2009-02-17 20:51:22 -08:00
|
|
|
}
|
|
|
|
|
2009-06-17 08:35:19 -07:00
|
|
|
EAPI Eina_Bool
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_disabled_get(const Elm_Object_Item *it)
|
2009-02-17 20:51:22 -08:00
|
|
|
{
|
2012-01-26 23:36:36 -08:00
|
|
|
return elm_object_item_disabled_get(it);
|
2009-02-10 03:57:47 -08:00
|
|
|
}
|
|
|
|
|
2010-02-04 00:06:41 -08:00
|
|
|
EAPI void
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_display_only_set(Elm_Object_Item *it,
|
2010-12-07 11:18:14 -08:00
|
|
|
Eina_Bool display_only)
|
2010-02-04 00:06:41 -08:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
display_only = !!display_only;
|
|
|
|
if (_it->display_only == display_only) return;
|
|
|
|
if (_it->generation < _it->wd->generation) return;
|
|
|
|
_it->display_only = display_only;
|
|
|
|
_it->item->mincalcd = EINA_FALSE;
|
|
|
|
_it->item->updateme = EINA_TRUE;
|
|
|
|
if (_it->item->block) _it->item->block->updateme = EINA_TRUE;
|
|
|
|
if (_it->wd->update_job) ecore_job_del(_it->wd->update_job);
|
|
|
|
_it->wd->update_job = ecore_job_add(_update_job, _it->wd);
|
2010-02-04 00:06:41 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_display_only_get(const Elm_Object_Item *it)
|
2010-02-04 00:06:41 -08:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
if (_it->generation < _it->wd->generation) return EINA_FALSE;
|
|
|
|
return _it->display_only;
|
2010-02-04 00:06:41 -08:00
|
|
|
}
|
|
|
|
|
2009-02-10 03:57:47 -08:00
|
|
|
EAPI void
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_show(Elm_Object_Item *it)
|
2009-02-10 03:57:47 -08:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
2011-01-05 21:13:11 -08:00
|
|
|
Evas_Coord gith = 0;
|
2012-01-19 21:18:31 -08:00
|
|
|
if (_it->generation < _it->wd->generation) return;
|
|
|
|
if ((_it->item->queued) || (!_it->item->mincalcd))
|
2009-02-17 06:39:08 -08:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
_it->wd->show_item = _it;
|
|
|
|
_it->wd->bring_in = EINA_FALSE;
|
|
|
|
_it->wd->scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_IN;
|
|
|
|
_it->item->showme = EINA_TRUE;
|
2010-10-15 04:51:15 -07:00
|
|
|
return;
|
2009-02-17 06:39:08 -08:00
|
|
|
}
|
2012-01-19 21:18:31 -08:00
|
|
|
if (_it->wd->show_item)
|
2009-02-17 06:39:08 -08:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
_it->wd->show_item->item->showme = EINA_FALSE;
|
|
|
|
_it->wd->show_item = NULL;
|
2009-02-17 06:39:08 -08:00
|
|
|
}
|
2012-01-19 21:18:31 -08:00
|
|
|
if ((_it->item->group_item) &&
|
|
|
|
(_it->wd->pan_y > (_it->y + _it->item->block->y)))
|
|
|
|
gith = _it->item->group_item->item->h;
|
|
|
|
elm_smart_scroller_child_region_show(_it->wd->scr,
|
|
|
|
_it->x + _it->item->block->x,
|
|
|
|
_it->y + _it->item->block->y - gith,
|
|
|
|
_it->item->block->w, _it->item->h);
|
2009-02-10 03:57:47 -08:00
|
|
|
}
|
|
|
|
|
2011-11-25 12:27:27 -08:00
|
|
|
EAPI void
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_promote(Elm_Object_Item *it)
|
2011-11-25 12:27:27 -08:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
if (_it->generation < _it->wd->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-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_demote(Elm_Object_Item *it)
|
2011-11-25 12:27:27 -08:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
if (_it->generation < _it->wd->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-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_bring_in(Elm_Object_Item *it)
|
2009-09-10 02:25:11 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
2011-03-18 07:29:48 -07:00
|
|
|
Evas_Coord gith = 0;
|
2012-01-19 21:18:31 -08:00
|
|
|
if (_it->generation < _it->wd->generation) return;
|
|
|
|
if ((_it->item->queued) || (!_it->item->mincalcd))
|
2009-09-10 02:25:11 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
_it->wd->show_item = _it;
|
|
|
|
_it->wd->bring_in = EINA_TRUE;
|
|
|
|
_it->wd->scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_IN;
|
|
|
|
_it->item->showme = EINA_TRUE;
|
2010-10-15 04:51:15 -07:00
|
|
|
return;
|
2009-09-10 02:25:11 -07:00
|
|
|
}
|
2012-01-19 21:18:31 -08:00
|
|
|
if (_it->wd->show_item)
|
2009-09-10 02:25:11 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
_it->wd->show_item->item->showme = EINA_FALSE;
|
|
|
|
_it->wd->show_item = NULL;
|
2009-09-10 02:25:11 -07:00
|
|
|
}
|
2012-01-19 21:18:31 -08:00
|
|
|
if ((_it->item->group_item) &&
|
|
|
|
(_it->wd->pan_y > (_it->y + _it->item->block->y)))
|
|
|
|
gith = _it->item->group_item->item->h;
|
|
|
|
elm_smart_scroller_region_bring_in(_it->wd->scr,
|
|
|
|
_it->x + _it->item->block->x,
|
|
|
|
_it->y + _it->item->block->y - gith,
|
|
|
|
_it->item->block->w, _it->item->h);
|
2009-09-10 02:25:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_top_show(Elm_Object_Item *it)
|
2009-09-10 02:25:11 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
2009-09-10 02:25:11 -07:00
|
|
|
Evas_Coord ow, oh;
|
2011-01-05 21:13:11 -08:00
|
|
|
Evas_Coord gith = 0;
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
if (_it->generation < _it->wd->generation) return;
|
|
|
|
if ((_it->item->queued) || (!_it->item->mincalcd))
|
2009-09-10 02:25:11 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
_it->wd->show_item = _it;
|
|
|
|
_it->wd->bring_in = EINA_FALSE;
|
|
|
|
_it->wd->scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_TOP;
|
|
|
|
_it->item->showme = EINA_TRUE;
|
2010-10-15 04:51:15 -07:00
|
|
|
return;
|
2009-09-10 02:25:11 -07:00
|
|
|
}
|
2012-01-19 21:18:31 -08:00
|
|
|
if (_it->wd->show_item)
|
2009-09-10 02:25:11 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
_it->wd->show_item->item->showme = EINA_FALSE;
|
|
|
|
_it->wd->show_item = NULL;
|
2009-09-10 02:25:11 -07:00
|
|
|
}
|
2012-01-19 21:18:31 -08:00
|
|
|
evas_object_geometry_get(_it->wd->pan_smart, NULL, NULL, &ow, &oh);
|
|
|
|
if (_it->item->group_item) gith = _it->item->group_item->item->h;
|
|
|
|
elm_smart_scroller_child_region_show(_it->wd->scr,
|
|
|
|
_it->x + _it->item->block->x,
|
|
|
|
_it->y + _it->item->block->y - gith,
|
|
|
|
_it->item->block->w, oh);
|
2009-09-10 02:25:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_top_bring_in(Elm_Object_Item *it)
|
2009-09-10 02:25:11 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
2009-09-10 02:25:11 -07:00
|
|
|
Evas_Coord ow, oh;
|
2011-01-05 21:13:11 -08:00
|
|
|
Evas_Coord gith = 0;
|
2009-09-26 11:24:06 -07:00
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
if (_it->generation < _it->wd->generation) return;
|
|
|
|
if ((_it->item->queued) || (!_it->item->mincalcd))
|
2009-09-10 02:25:11 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
_it->wd->show_item = _it;
|
|
|
|
_it->wd->bring_in = EINA_TRUE;
|
|
|
|
_it->wd->scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_TOP;
|
|
|
|
_it->item->showme = EINA_TRUE;
|
2010-10-15 04:51:15 -07:00
|
|
|
return;
|
2009-09-10 02:25:11 -07:00
|
|
|
}
|
2012-01-19 21:18:31 -08:00
|
|
|
if (_it->wd->show_item)
|
2009-09-10 02:25:11 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
_it->wd->show_item->item->showme = EINA_FALSE;
|
|
|
|
_it->wd->show_item = NULL;
|
2009-09-10 02:25:11 -07:00
|
|
|
}
|
2012-01-19 21:18:31 -08:00
|
|
|
evas_object_geometry_get(_it->wd->pan_smart, NULL, NULL, &ow, &oh);
|
|
|
|
if (_it->item->group_item) gith = _it->item->group_item->item->h;
|
|
|
|
elm_smart_scroller_region_bring_in(_it->wd->scr,
|
|
|
|
_it->x + _it->item->block->x,
|
|
|
|
_it->y + _it->item->block->y - gith,
|
|
|
|
_it->item->block->w, oh);
|
2009-09-10 02:25:11 -07:00
|
|
|
}
|
|
|
|
|
2009-10-14 14:57:46 -07:00
|
|
|
EAPI void
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_middle_show(Elm_Object_Item *it)
|
2009-10-14 14:57:46 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
2009-10-14 14:57:46 -07:00
|
|
|
Evas_Coord ow, oh;
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
if (_it->generation < _it->wd->generation) return;
|
|
|
|
if ((_it->item->queued) || (!_it->item->mincalcd))
|
2009-10-14 14:57:46 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
_it->wd->show_item = _it;
|
|
|
|
_it->wd->bring_in = EINA_FALSE;
|
|
|
|
_it->wd->scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_MIDDLE;
|
|
|
|
_it->item->showme = EINA_TRUE;
|
2010-10-15 04:51:15 -07:00
|
|
|
return;
|
2009-10-14 14:57:46 -07:00
|
|
|
}
|
2012-01-19 21:18:31 -08:00
|
|
|
if (_it->wd->show_item)
|
2009-10-14 14:57:46 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
_it->wd->show_item->item->showme = EINA_FALSE;
|
|
|
|
_it->wd->show_item = NULL;
|
2009-10-14 14:57:46 -07:00
|
|
|
}
|
2012-01-19 21:18:31 -08:00
|
|
|
evas_object_geometry_get(_it->wd->pan_smart, NULL, NULL, &ow, &oh);
|
|
|
|
elm_smart_scroller_child_region_show(_it->wd->scr,
|
|
|
|
_it->x + _it->item->block->x,
|
|
|
|
_it->y + _it->item->block->y - oh / 2 +
|
|
|
|
_it->item->h / 2, _it->item->block->w,
|
|
|
|
oh);
|
2009-10-14 14:57:46 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_middle_bring_in(Elm_Object_Item *it)
|
2009-10-14 14:57:46 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
2009-10-14 14:57:46 -07:00
|
|
|
Evas_Coord ow, oh;
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
if (_it->generation < _it->wd->generation) return;
|
|
|
|
if ((_it->item->queued) || (!_it->item->mincalcd))
|
2009-10-14 14:57:46 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
_it->wd->show_item = _it;
|
|
|
|
_it->wd->bring_in = EINA_TRUE;
|
|
|
|
_it->wd->scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_MIDDLE;
|
|
|
|
_it->item->showme = EINA_TRUE;
|
2010-10-15 04:51:15 -07:00
|
|
|
return;
|
2009-10-14 14:57:46 -07:00
|
|
|
}
|
2012-01-19 21:18:31 -08:00
|
|
|
if (_it->wd->show_item)
|
2009-10-14 14:57:46 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
_it->wd->show_item->item->showme = EINA_FALSE;
|
|
|
|
_it->wd->show_item = NULL;
|
2009-10-14 14:57:46 -07:00
|
|
|
}
|
2012-01-19 21:18:31 -08:00
|
|
|
evas_object_geometry_get(_it->wd->pan_smart, NULL, NULL, &ow, &oh);
|
|
|
|
elm_smart_scroller_region_bring_in(_it->wd->scr,
|
|
|
|
_it->x + _it->item->block->x,
|
|
|
|
_it->y + _it->item->block->y - oh / 2 +
|
|
|
|
_it->item->h / 2, _it->item->block->w,
|
|
|
|
oh);
|
2009-10-14 14:57:46 -07:00
|
|
|
}
|
|
|
|
|
2009-02-10 03:57:47 -08:00
|
|
|
EAPI void
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_del(Elm_Object_Item *it)
|
2009-02-10 03:57:47 -08:00
|
|
|
{
|
2012-01-27 03:59:22 -08:00
|
|
|
elm_object_item_del(it);
|
2009-02-10 03:57:47 -08:00
|
|
|
}
|
|
|
|
|
2009-08-15 11:20:28 -07:00
|
|
|
EAPI void
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_data_set(Elm_Object_Item *it,
|
2010-12-07 11:18:14 -08:00
|
|
|
const void *data)
|
2009-08-15 11:20:28 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_object_item_data_set(it, (void *) data);
|
2009-02-14 18:53:56 -08:00
|
|
|
}
|
|
|
|
|
2010-09-17 09:34:11 -07:00
|
|
|
EAPI void *
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_data_get(const Elm_Object_Item *it)
|
2010-04-06 07:01:04 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
return elm_object_item_data_get(it);
|
2010-04-06 07:01:04 -07:00
|
|
|
}
|
|
|
|
|
2010-11-06 00:05:00 -07:00
|
|
|
EAPI void
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_icons_orphan(Elm_Object_Item *it)
|
2010-11-06 00:05:00 -07:00
|
|
|
{
|
2011-10-23 19:10:35 -07:00
|
|
|
elm_genlist_item_contents_orphan(it);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_contents_orphan(Elm_Object_Item *it)
|
2011-10-23 19:10:35 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
|
2011-10-23 19:10:35 -07:00
|
|
|
Evas_Object *content;
|
2012-01-19 21:18:31 -08:00
|
|
|
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);
|
2010-11-06 00:05:00 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-09-07 19:09:13 -07:00
|
|
|
EAPI const Evas_Object *
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_object_get(const Elm_Object_Item *it)
|
2009-09-07 19:09:13 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
|
2011-10-20 18:08:01 -07:00
|
|
|
return VIEW(it);
|
2009-09-07 19:09:13 -07:00
|
|
|
}
|
|
|
|
|
2009-02-14 18:53:56 -08:00
|
|
|
EAPI void
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_update(Elm_Object_Item *it)
|
2009-02-14 18:53:56 -08:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
|
|
|
|
if (!_it->item->block) return;
|
|
|
|
if (_it->generation < _it->wd->generation) return;
|
|
|
|
_it->item->mincalcd = EINA_FALSE;
|
|
|
|
_it->item->updateme = EINA_TRUE;
|
|
|
|
_it->item->block->updateme = EINA_TRUE;
|
|
|
|
if (_it->wd->update_job) ecore_job_del(_it->wd->update_job);
|
|
|
|
_it->wd->update_job = ecore_job_add(_update_job, _it->wd);
|
2009-03-12 22:50:38 -07:00
|
|
|
}
|
|
|
|
|
2011-11-29 06:03:14 -08:00
|
|
|
EAPI void
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_fields_update(Elm_Object_Item *it,
|
2011-11-29 06:03:14 -08:00
|
|
|
const char *parts,
|
|
|
|
Elm_Genlist_Item_Field_Flags itf)
|
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
|
|
|
|
if (!_it->item->block) return;
|
|
|
|
if (_it->generation < _it->wd->generation) return;
|
2011-11-29 06:03:14 -08:00
|
|
|
|
|
|
|
if ((!itf) || (itf & ELM_GENLIST_ITEM_FIELD_LABEL))
|
2012-02-22 23:39:10 -08:00
|
|
|
_item_text_realize(_it, VIEW(_it), &_it->texts, parts);
|
2011-11-29 06:03:14 -08:00
|
|
|
if ((!itf) || (itf & ELM_GENLIST_ITEM_FIELD_CONTENT))
|
|
|
|
{
|
2012-02-22 23:39:10 -08:00
|
|
|
_it->content_objs = _item_content_unrealize(_it, VIEW(_it),
|
2012-01-19 21:18:31 -08:00
|
|
|
&_it->contents, parts);
|
2012-02-22 23:39:10 -08:00
|
|
|
_it->content_objs = _item_content_realize(_it, VIEW(_it),
|
2012-01-19 21:18:31 -08:00
|
|
|
&_it->contents, parts);
|
2011-11-29 06:03:14 -08:00
|
|
|
}
|
|
|
|
if ((!itf) || (itf & ELM_GENLIST_ITEM_FIELD_STATE))
|
2012-02-22 23:39:10 -08: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-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_item_class_update(Elm_Object_Item *it,
|
2010-12-07 11:18:14 -08:00
|
|
|
const Elm_Genlist_Item_Class *itc)
|
2010-11-17 09:15:28 -08:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
|
|
|
|
if (!_it->item->block) return;
|
2010-12-03 06:08:33 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(itc);
|
2012-01-19 21:18:31 -08:00
|
|
|
if (_it->generation < _it->wd->generation) return;
|
|
|
|
_it->itc = itc;
|
|
|
|
_it->item->nocache = EINA_TRUE;
|
2010-11-17 09:15:28 -08:00
|
|
|
elm_genlist_item_update(it);
|
|
|
|
}
|
|
|
|
|
2011-06-25 16:20:22 -07:00
|
|
|
EAPI const Elm_Genlist_Item_Class *
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_item_class_get(const Elm_Object_Item *it)
|
2011-06-25 16:20:22 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
if (_it->generation < _it->wd->generation) return NULL;
|
|
|
|
return _it->itc;
|
2011-06-25 16:20:22 -07:00
|
|
|
}
|
|
|
|
|
2010-09-27 11:18:37 -07:00
|
|
|
static Evas_Object *
|
2010-12-07 11:18:14 -08:00
|
|
|
_elm_genlist_item_label_create(void *data,
|
2011-07-26 02:38:23 -07:00
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
Evas_Object *tooltip,
|
2011-10-20 14:41:24 -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);
|
2010-09-27 11:18:37 -07:00
|
|
|
if (!label)
|
|
|
|
return NULL;
|
|
|
|
elm_object_style_set(label, "tooltip");
|
2011-06-28 23:41:31 -07:00
|
|
|
elm_object_text_set(label, data);
|
2010-09-27 11:18:37 -07:00
|
|
|
return label;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-04-01 09:33:58 -07:00
|
|
|
_elm_genlist_item_label_del_cb(void *data,
|
2010-12-07 11:18:14 -08:00
|
|
|
Evas_Object *obj __UNUSED__,
|
2011-04-01 09:33:58 -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,
|
|
|
|
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-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
2010-09-27 11:18:37 -07:00
|
|
|
text = eina_stringshare_add(text);
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_genlist_item_tooltip_content_cb_set(it, _elm_genlist_item_label_create,
|
2010-12-07 11:18:14 -08:00
|
|
|
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-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_tooltip_content_cb_set(Elm_Object_Item *it,
|
2010-12-07 11:18:14 -08:00
|
|
|
Elm_Tooltip_Item_Content_Cb func,
|
|
|
|
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-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_GOTO(it, error);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
2010-09-27 11:18:37 -07:00
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
if ((_it->tooltip.content_cb == func) && (_it->tooltip.data == data))
|
2010-09-27 11:18:37 -07:00
|
|
|
return;
|
|
|
|
|
2012-01-19 21:18:31 -08: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-01-19 21:18:31 -08: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-01-19 21:18:31 -08:00
|
|
|
if (VIEW(_it))
|
2010-09-27 11:18:37 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08: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-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_tooltip_unset(Elm_Object_Item *it)
|
|
|
|
{
|
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
|
|
|
|
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)
|
2011-10-20 14:41:24 -07:00
|
|
|
elm_genlist_item_tooltip_style_set(it, 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-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_tooltip_style_set(Elm_Object_Item *it,
|
2010-12-07 11:18:14 -08:00
|
|
|
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-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
|
|
|
|
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-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_tooltip_window_mode_set(Elm_Object_Item *it,
|
|
|
|
Eina_Bool disable)
|
2011-07-26 02:38:23 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
|
|
|
|
_it->tooltip.free_size = disable;
|
|
|
|
if (VIEW(_it)) return elm_widget_item_tooltip_window_mode_set(_it, disable);
|
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-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_cursor_set(Elm_Object_Item *it,
|
2010-12-07 11:18:14 -08:00
|
|
|
const char *cursor)
|
2010-09-17 11:24:10 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
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-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_cursor_unset(Elm_Object_Item *it)
|
2010-09-17 11:24:10 -07:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
|
|
|
|
if (!_it->mouse_cursor) return;
|
2010-09-27 11:18:37 -07:00
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
if (VIEW(_it)) elm_widget_item_cursor_unset(_it);
|
2010-09-27 11:18:37 -07:00
|
|
|
|
2012-01-19 21:18:31 -08: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-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_cursor_style_set(Elm_Object_Item *it,
|
2010-12-07 11:18:14 -08: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,
|
|
|
|
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-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_index_get(Elm_Object_Item *it)
|
2011-12-26 06:30:21 -08:00
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, -1);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
|
|
|
|
if (_it->item->block)
|
|
|
|
return _it->position + _it->item->block->position;
|
2011-12-26 06:30:21 -08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2009-03-12 22:50:38 -07:00
|
|
|
EAPI void
|
2012-01-24 07:15:43 -08: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
|
|
|
{
|
2010-03-08 22:15:39 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
2009-03-12 22:50:38 -07:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2010-03-09 06:42:41 -08:00
|
|
|
if (!wd) return;
|
2009-03-12 22:50:38 -07:00
|
|
|
if (wd->mode == mode) return;
|
|
|
|
wd->mode = mode;
|
2010-05-07 06:21:45 -07:00
|
|
|
_sizing_eval(obj);
|
2009-02-14 18:53:56 -08:00
|
|
|
}
|
2009-04-23 01:51:07 -07:00
|
|
|
|
2012-01-24 07:15:43 -08:00
|
|
|
EAPI void
|
|
|
|
elm_genlist_horizontal_set(Evas_Object *obj,
|
|
|
|
Elm_List_Mode mode)
|
|
|
|
{
|
|
|
|
elm_genlist_mode_set(obj, mode);
|
|
|
|
}
|
|
|
|
|
2011-08-04 18:21:56 -07:00
|
|
|
EAPI void
|
|
|
|
elm_genlist_horizontal_mode_set(Evas_Object *obj,
|
|
|
|
Elm_List_Mode mode)
|
|
|
|
{
|
2012-01-24 07:15:43 -08:00
|
|
|
elm_genlist_mode_set(obj, mode);
|
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
|
|
|
{
|
2010-04-07 14:30:54 -07:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) ELM_LIST_LAST;
|
2010-04-06 07:01:04 -07:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2010-04-07 14:30:54 -07:00
|
|
|
if (!wd) return ELM_LIST_LAST;
|
2010-04-06 07:01:04 -07:00
|
|
|
return wd->mode;
|
|
|
|
}
|
|
|
|
|
2012-01-24 07:15:43 -08:00
|
|
|
EAPI Elm_List_Mode
|
|
|
|
elm_genlist_horizontal_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
return elm_genlist_mode_get(obj);
|
|
|
|
}
|
|
|
|
|
2011-08-04 18:21:56 -07:00
|
|
|
EAPI Elm_List_Mode
|
|
|
|
elm_genlist_horizontal_mode_get(const Evas_Object *obj)
|
|
|
|
{
|
2012-01-24 07:15:43 -08:00
|
|
|
return elm_genlist_mode_get(obj);
|
2011-08-04 18:21:56 -07:00
|
|
|
}
|
|
|
|
|
2009-04-23 01:51:07 -07:00
|
|
|
EAPI void
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_genlist_always_select_mode_set(Evas_Object *obj,
|
|
|
|
Eina_Bool always_select)
|
2009-04-23 01:51:07 -07:00
|
|
|
{
|
2011-11-30 09:13:57 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
wd->always_select = always_select;
|
2009-04-23 01:51:07 -07:00
|
|
|
}
|
|
|
|
|
2010-04-06 07:01:04 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_genlist_always_select_mode_get(const Evas_Object *obj)
|
|
|
|
{
|
2011-11-30 09:13:57 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return EINA_FALSE;
|
|
|
|
return wd->always_select;
|
2010-04-06 07:01:04 -07:00
|
|
|
}
|
|
|
|
|
2009-04-23 01:51:07 -07:00
|
|
|
EAPI void
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_genlist_no_select_mode_set(Evas_Object *obj,
|
|
|
|
Eina_Bool no_select)
|
2009-04-23 01:51:07 -07:00
|
|
|
{
|
2011-11-30 09:13:57 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
wd->no_select = no_select;
|
2009-04-23 01:51:07 -07:00
|
|
|
}
|
2009-11-17 19:09:04 -08:00
|
|
|
|
2010-04-06 07:01:04 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_genlist_no_select_mode_get(const Evas_Object *obj)
|
|
|
|
{
|
2011-11-30 09:13:57 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return EINA_FALSE;
|
|
|
|
return wd->no_select;
|
2010-04-06 07:01:04 -07:00
|
|
|
}
|
|
|
|
|
2009-11-17 19:09:04 -08:00
|
|
|
EAPI void
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_genlist_compress_mode_set(Evas_Object *obj,
|
|
|
|
Eina_Bool compress)
|
2009-11-17 19:09:04 -08:00
|
|
|
{
|
2010-03-08 22:15:39 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
2009-11-17 19:09:04 -08:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2010-03-09 06:42:41 -08:00
|
|
|
if (!wd) return;
|
2009-11-17 19:09:04 -08:00
|
|
|
wd->compress = compress;
|
2011-05-12 23:10:13 -07:00
|
|
|
if (!compress) elm_genlist_homogeneous_set(obj, EINA_FALSE);
|
2009-11-17 19:09:04 -08:00
|
|
|
}
|
2009-12-11 00:12:58 -08:00
|
|
|
|
2010-04-06 07:01:04 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_genlist_compress_mode_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return EINA_FALSE;
|
|
|
|
return wd->compress;
|
|
|
|
}
|
|
|
|
|
2010-10-07 12:57:20 -07:00
|
|
|
EAPI void
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_genlist_height_for_width_mode_set(Evas_Object *obj,
|
|
|
|
Eina_Bool height_for_width)
|
2010-10-07 12:57:20 -07:00
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
wd->height_for_width = !!height_for_width;
|
|
|
|
if (wd->height_for_width)
|
|
|
|
{
|
|
|
|
elm_genlist_homogeneous_set(obj, EINA_FALSE);
|
|
|
|
elm_genlist_compress_mode_set(obj, EINA_TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_genlist_height_for_width_mode_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return EINA_FALSE;
|
|
|
|
return wd->height_for_width;
|
|
|
|
}
|
|
|
|
|
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,
|
|
|
|
Eina_Bool h_bounce,
|
|
|
|
Eina_Bool v_bounce)
|
2009-12-11 00:12:58 -08:00
|
|
|
{
|
2011-11-30 09:13:57 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
elm_smart_scroller_bounce_allow_set(wd->scr, h_bounce, v_bounce);
|
|
|
|
wd->h_bounce = h_bounce;
|
|
|
|
wd->v_bounce = 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,
|
|
|
|
Eina_Bool *h_bounce,
|
|
|
|
Eina_Bool *v_bounce)
|
2010-04-06 07:01:04 -07:00
|
|
|
{
|
2011-11-30 09:13:57 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
if (h_bounce) *h_bounce = wd->h_bounce;
|
|
|
|
if (v_bounce) *v_bounce = wd->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,
|
|
|
|
Eina_Bool homogeneous)
|
2010-01-23 01:07:20 -08:00
|
|
|
{
|
2010-03-08 22:15:39 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
2010-01-23 01:07:20 -08:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2010-03-09 06:42:41 -08:00
|
|
|
if (!wd) return;
|
2010-04-06 07:01:04 -07:00
|
|
|
if (homogeneous) elm_genlist_compress_mode_set(obj, EINA_TRUE);
|
2010-01-23 01:07:20 -08:00
|
|
|
wd->homogeneous = homogeneous;
|
|
|
|
}
|
|
|
|
|
2010-04-06 07:01:04 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_genlist_homogeneous_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return EINA_FALSE;
|
|
|
|
return wd->homogeneous;
|
|
|
|
}
|
|
|
|
|
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,
|
|
|
|
int n)
|
2010-01-23 01:07:20 -08:00
|
|
|
{
|
2010-03-08 22:15:39 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
2010-01-23 01:07:20 -08:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2010-03-09 06:42:41 -08:00
|
|
|
if (!wd) return;
|
2010-01-23 01:07:20 -08:00
|
|
|
wd->max_items_per_block = n;
|
2010-11-05 23:02:22 -07:00
|
|
|
wd->item_cache_max = wd->max_items_per_block * 2;
|
|
|
|
_item_cache_clean(wd);
|
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)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) 0;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return 0;
|
|
|
|
return wd->max_items_per_block;
|
|
|
|
}
|
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,
|
|
|
|
double timeout)
|
2010-07-27 16:36:27 -07:00
|
|
|
{
|
2010-07-27 20:29:48 -07:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
2010-07-27 16:36:27 -07:00
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2010-07-27 20:29:48 -07:00
|
|
|
if (!wd) return;
|
2010-07-27 16:36:27 -07:00
|
|
|
wd->longpress_timeout = timeout;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI double
|
|
|
|
elm_genlist_longpress_timeout_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) 0;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return 0;
|
|
|
|
return wd->longpress_timeout;
|
|
|
|
}
|
2010-11-22 07:24:58 -08:00
|
|
|
|
|
|
|
EAPI void
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_genlist_scroller_policy_set(Evas_Object *obj,
|
|
|
|
Elm_Scroller_Policy policy_h,
|
|
|
|
Elm_Scroller_Policy policy_v)
|
2010-11-22 07:24:58 -08:00
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2011-08-29 09:30:14 -07:00
|
|
|
if ((!wd) || (!wd->scr)) return;
|
2010-11-22 07:24:58 -08:00
|
|
|
if ((policy_h >= ELM_SCROLLER_POLICY_LAST) ||
|
|
|
|
(policy_v >= ELM_SCROLLER_POLICY_LAST))
|
|
|
|
return;
|
2011-08-29 09:30:14 -07:00
|
|
|
elm_smart_scroller_policy_set(wd->scr, policy_h, policy_v);
|
2010-11-22 07:24:58 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_genlist_scroller_policy_get(const Evas_Object *obj,
|
|
|
|
Elm_Scroller_Policy *policy_h,
|
|
|
|
Elm_Scroller_Policy *policy_v)
|
2010-11-22 07:24:58 -08:00
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
Elm_Smart_Scroller_Policy s_policy_h, s_policy_v;
|
|
|
|
if ((!wd) || (!wd->scr)) return;
|
|
|
|
elm_smart_scroller_policy_get(wd->scr, &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
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
|
|
|
|
Eina_List *list, *l;
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Object_Item *it;
|
2011-04-06 21:35:08 -07:00
|
|
|
|
|
|
|
list = elm_genlist_realized_items_get(obj);
|
|
|
|
EINA_LIST_FOREACH(list, l, it)
|
|
|
|
elm_genlist_item_update(it);
|
|
|
|
}
|
2011-04-21 04:47:36 -07:00
|
|
|
|
|
|
|
EAPI void
|
2012-01-19 21:18:31 -08:00
|
|
|
elm_genlist_item_mode_set(Elm_Object_Item *it,
|
2011-04-21 04:47:36 -07:00
|
|
|
const char *mode_type,
|
|
|
|
Eina_Bool mode_set)
|
|
|
|
{
|
2012-01-19 21:18:31 -08:00
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
|
|
|
|
Widget_Data *wd = _it->wd;
|
2011-04-21 04:47:36 -07:00
|
|
|
Eina_List *l;
|
2012-01-19 21:18:31 -08:00
|
|
|
Elm_Object_Item *it2;
|
2011-04-21 04:47:36 -07:00
|
|
|
|
|
|
|
if (!wd) return;
|
|
|
|
if (!mode_type) return;
|
2012-01-26 23:36:36 -08:00
|
|
|
if ((_it->generation < _it->wd->generation) ||
|
|
|
|
elm_widget_item_disabled_get(_it)) return;
|
2012-02-22 23:39:10 -08:00
|
|
|
if (wd->edit_mode) return;
|
2011-04-21 04:47:36 -07:00
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
if ((wd->mode_item == _it) &&
|
2011-04-21 04:47:36 -07:00
|
|
|
(!strcmp(mode_type, wd->mode_type)) &&
|
|
|
|
(mode_set))
|
|
|
|
return;
|
2012-02-22 19:15:40 -08:00
|
|
|
if (!_it->itc->mode_item_style) return;
|
2012-01-19 21:18:31 -08:00
|
|
|
_it->mode_set = mode_set;
|
2011-04-21 04:47:36 -07:00
|
|
|
|
|
|
|
if (wd->multi)
|
|
|
|
{
|
|
|
|
EINA_LIST_FOREACH(wd->selected, l, it2)
|
2012-01-19 21:18:31 -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
|
|
|
|
{
|
|
|
|
it2 = elm_genlist_selected_item_get(wd->obj);
|
2012-01-19 21:18:31 -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
|
|
|
}
|
|
|
|
|
|
|
|
if (((wd->mode_type) && (strcmp(mode_type, wd->mode_type))) ||
|
|
|
|
(mode_set) ||
|
2012-01-19 21:18:31 -08:00
|
|
|
((_it == wd->mode_item) && (!mode_set)))
|
2011-04-21 04:47:36 -07:00
|
|
|
_item_mode_unset(wd);
|
|
|
|
|
|
|
|
eina_stringshare_replace(&wd->mode_type, mode_type);
|
2012-01-19 21:18:31 -08:00
|
|
|
if (mode_set) _item_mode_set(_it);
|
2011-04-21 04:47:36 -07:00
|
|
|
}
|
|
|
|
|
2011-10-20 20:31:26 -07:00
|
|
|
EAPI const char *
|
|
|
|
elm_genlist_mode_item_style_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return NULL;
|
2012-02-22 19:15:40 -08:00
|
|
|
return wd->mode_item->itc->mode_item_style;
|
2011-10-20 20:31:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_genlist_mode_item_style_set(Evas_Object *obj, const char *style)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
2012-02-22 19:15:40 -08:00
|
|
|
if ((style == wd->mode_item->itc->mode_item_style) ||
|
|
|
|
(style && wd->mode_item->itc->mode_item_style &&
|
|
|
|
(!strcmp(style, wd->mode_item->itc->mode_item_style))))
|
2011-10-20 20:31:26 -07:00
|
|
|
return;
|
2012-02-22 19:15:40 -08:00
|
|
|
eina_stringshare_replace((const char**)&wd->mode_item->itc->mode_item_style, style);
|
2011-10-20 20:31:26 -07:00
|
|
|
elm_genlist_realized_items_update(obj);
|
|
|
|
}
|
|
|
|
|
2011-04-21 04:47:36 -07:00
|
|
|
EAPI const char *
|
2012-01-24 07:15:43 -08:00
|
|
|
elm_genlist_mode_type_get(const Evas_Object *obj)
|
2011-04-21 04:47:36 -07:00
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return NULL;
|
|
|
|
return wd->mode_type;
|
|
|
|
}
|
|
|
|
|
2012-01-19 21:18:31 -08:00
|
|
|
EAPI const Elm_Object_Item *
|
2011-04-21 04:47:36 -07:00
|
|
|
elm_genlist_mode_item_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return NULL;
|
2012-01-19 21:18:31 -08:00
|
|
|
return (Elm_Object_Item *) wd->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
|
|
|
|
elm_genlist_edit_mode_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return EINA_FALSE;
|
|
|
|
|
|
|
|
return wd->edit_mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_genlist_edit_mode_set(Evas_Object *obj, Eina_Bool edit_mode)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Eina_List *list, *l;
|
|
|
|
Elm_Gen_Item *it;
|
|
|
|
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
if (wd->edit_mode == edit_mode) return;
|
|
|
|
|
|
|
|
wd->edit_mode = !!edit_mode;
|
|
|
|
list = elm_genlist_realized_items_get(obj);
|
|
|
|
if (!wd->edit_mode)
|
|
|
|
{
|
|
|
|
EINA_LIST_FOREACH(list, l, it)
|
|
|
|
{
|
|
|
|
if (it->item->flags != ELM_GENLIST_ITEM_GROUP)
|
|
|
|
_edit_mode_item_unrealize(it);
|
|
|
|
}
|
|
|
|
_item_cache_zero(wd);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
EINA_LIST_FOREACH(list, l, it)
|
|
|
|
{
|
|
|
|
if (it->item->flags != ELM_GENLIST_ITEM_GROUP)
|
|
|
|
{
|
|
|
|
if (it->selected) _item_unselect(it);
|
|
|
|
if (it->itc->edit_item_style)
|
|
|
|
_edit_mode_item_realize(it, EINA_TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (wd->calc_job) ecore_job_del(wd->calc_job);
|
|
|
|
wd->calc_job = ecore_job_add(_calc_job, wd);
|
|
|
|
}
|
|
|
|
|
2011-06-01 20:10:11 -07:00
|
|
|
EAPI void
|
|
|
|
elm_genlist_reorder_mode_set(Evas_Object *obj,
|
|
|
|
Eina_Bool reorder_mode)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
wd->reorder_mode = reorder_mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_genlist_reorder_mode_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return EINA_FALSE;
|
|
|
|
return wd->reorder_mode;
|
|
|
|
}
|
2011-11-30 08:03:03 -08:00
|
|
|
|
2012-02-13 18:51:40 -08:00
|
|
|
EAPI Elm_Genlist_Item_Flags
|
|
|
|
elm_genlist_item_flags_get(const Elm_Object_Item *it)
|
|
|
|
{
|
|
|
|
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, ELM_GENLIST_ITEM_MAX);
|
|
|
|
Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
|
|
|
|
return _it->item->flags;
|
|
|
|
}
|
|
|
|
|
2012-02-20 00:26:17 -08:00
|
|
|
EAPI Elm_Genlist_Item_Class *
|
|
|
|
elm_genlist_item_class_new(void)
|
|
|
|
{
|
|
|
|
Elm_Genlist_Item_Class *itc;
|
|
|
|
|
|
|
|
itc = calloc(1, sizeof(Elm_Genlist_Item_Class));
|
|
|
|
if (!itc)
|
|
|
|
return NULL;
|
|
|
|
itc->version = ELM_GENLIST_ITEM_CLASS_VERSION;
|
|
|
|
itc->refcount = 1;
|
|
|
|
itc->delete_me = EINA_FALSE;
|
|
|
|
|
|
|
|
return itc;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_genlist_item_class_free(Elm_Genlist_Item_Class *itc)
|
|
|
|
{
|
|
|
|
if (itc && (itc->version == ELM_GENLIST_ITEM_CLASS_VERSION))
|
|
|
|
{
|
|
|
|
if (!itc->delete_me) itc->delete_me = EINA_TRUE;
|
|
|
|
if (itc->refcount > 0) elm_genlist_item_class_unref(itc);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
itc->version = 0;
|
|
|
|
free(itc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_genlist_item_class_ref(Elm_Genlist_Item_Class *itc)
|
|
|
|
{
|
|
|
|
if (itc && (itc->version == ELM_GENLIST_ITEM_CLASS_VERSION))
|
|
|
|
{
|
|
|
|
itc->refcount++;
|
|
|
|
if (itc->refcount == 0) itc->refcount--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_genlist_item_class_unref(Elm_Genlist_Item_Class *itc)
|
|
|
|
{
|
|
|
|
if (itc && (itc->version == ELM_GENLIST_ITEM_CLASS_VERSION))
|
|
|
|
{
|
|
|
|
if (itc->refcount > 0) itc->refcount--;
|
|
|
|
if (itc->delete_me && (!itc->refcount))
|
|
|
|
elm_genlist_item_class_free(itc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-11-30 09:13:57 -08:00
|
|
|
/* for gengrid as of now */
|
2011-11-30 08:03:03 -08:00
|
|
|
void
|
2011-11-30 09:13:57 -08:00
|
|
|
_elm_genlist_page_relative_set(Evas_Object *obj,
|
|
|
|
double h_pagerel,
|
|
|
|
double v_pagerel)
|
2011-11-30 08:03:03 -08:00
|
|
|
{
|
2011-11-30 09:13:57 -08:00
|
|
|
Evas_Coord pagesize_h;
|
|
|
|
Evas_Coord pagesize_v;
|
|
|
|
|
2011-11-30 08:03:03 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
|
2011-11-30 09:13:57 -08:00
|
|
|
elm_smart_scroller_paging_get(wd->scr, NULL, NULL, &pagesize_h, &pagesize_v);
|
|
|
|
elm_smart_scroller_paging_set(wd->scr, h_pagerel, v_pagerel, pagesize_h,
|
|
|
|
pagesize_v);
|
2011-11-30 08:03:03 -08:00
|
|
|
}
|
|
|
|
|
2011-11-30 09:13:57 -08:00
|
|
|
/* for gengrid as of now */
|
2011-11-30 08:03:03 -08:00
|
|
|
void
|
2011-11-30 09:13:57 -08:00
|
|
|
_elm_genlist_page_relative_get(const Evas_Object *obj,
|
|
|
|
double *h_pagerel,
|
|
|
|
double *v_pagerel)
|
2011-11-30 08:03:03 -08:00
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
2011-11-30 09:13:57 -08:00
|
|
|
|
|
|
|
elm_smart_scroller_paging_get(wd->scr, h_pagerel, v_pagerel, NULL, NULL);
|
2011-11-30 08:03:03 -08:00
|
|
|
}
|
|
|
|
|
2011-11-30 09:13:57 -08:00
|
|
|
/* for gengrid as of now */
|
2011-11-30 08:03:03 -08:00
|
|
|
void
|
2011-11-30 09:13:57 -08:00
|
|
|
_elm_genlist_page_size_set(Evas_Object *obj,
|
|
|
|
Evas_Coord h_pagesize,
|
|
|
|
Evas_Coord v_pagesize)
|
2011-11-30 08:03:03 -08:00
|
|
|
{
|
2011-11-30 09:13:57 -08:00
|
|
|
double pagerel_h;
|
|
|
|
double pagerel_v;
|
2011-11-30 08:03:03 -08:00
|
|
|
|
2011-11-30 09:13:57 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
elm_smart_scroller_paging_get(wd->scr, &pagerel_h, &pagerel_v, NULL, NULL);
|
|
|
|
elm_smart_scroller_paging_set(wd->scr, pagerel_h, pagerel_v, h_pagesize,
|
|
|
|
v_pagesize);
|
2011-11-30 08:03:03 -08:00
|
|
|
}
|
|
|
|
|
2011-11-30 09:13:57 -08:00
|
|
|
/* for gengrid as of now */
|
2011-11-30 08:03:03 -08:00
|
|
|
void
|
2011-11-30 09:13:57 -08:00
|
|
|
_elm_genlist_current_page_get(const Evas_Object *obj,
|
|
|
|
int *h_pagenumber,
|
|
|
|
int *v_pagenumber)
|
2011-11-30 08:03:03 -08:00
|
|
|
{
|
2011-11-30 09:13:57 -08:00
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
2011-11-30 08:03:03 -08:00
|
|
|
if (!wd) return;
|
2011-11-30 09:13:57 -08:00
|
|
|
if (wd->scr)
|
|
|
|
elm_smart_scroller_current_page_get(wd->scr, h_pagenumber, v_pagenumber);
|
|
|
|
}
|
2011-11-30 08:03:03 -08:00
|
|
|
|
2011-11-30 09:13:57 -08:00
|
|
|
/* for gengrid as of now */
|
|
|
|
void
|
|
|
|
_elm_genlist_last_page_get(const Evas_Object *obj,
|
|
|
|
int *h_pagenumber,
|
|
|
|
int *v_pagenumber)
|
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
|
|
|
if (wd->scr)
|
|
|
|
elm_smart_scroller_last_page_get(wd->scr, h_pagenumber, v_pagenumber);
|
2011-11-30 08:03:03 -08:00
|
|
|
}
|
|
|
|
|
2011-11-30 09:13:57 -08:00
|
|
|
/* for gengrid as of now */
|
2011-11-30 08:03:03 -08:00
|
|
|
void
|
2011-11-30 09:13:57 -08:00
|
|
|
_elm_genlist_page_show(const Evas_Object *obj,
|
|
|
|
int h_pagenumber,
|
|
|
|
int v_pagenumber)
|
2011-11-30 08:03:03 -08:00
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
2011-11-30 09:13:57 -08:00
|
|
|
if (wd->scr)
|
|
|
|
elm_smart_scroller_page_show(wd->scr, h_pagenumber, v_pagenumber);
|
2011-11-30 08:03:03 -08:00
|
|
|
}
|
|
|
|
|
2011-11-30 09:13:57 -08:00
|
|
|
/* for gengrid as of now */
|
2011-11-30 08:03:03 -08:00
|
|
|
void
|
2011-11-30 09:13:57 -08:00
|
|
|
_elm_genlist_page_bring_in(const Evas_Object *obj,
|
|
|
|
int h_pagenumber,
|
|
|
|
int v_pagenumber)
|
2011-11-30 08:03:03 -08:00
|
|
|
{
|
|
|
|
ELM_CHECK_WIDTYPE(obj, widtype);
|
|
|
|
Widget_Data *wd = elm_widget_data_get(obj);
|
|
|
|
if (!wd) return;
|
2011-11-30 09:13:57 -08:00
|
|
|
if (wd->scr)
|
|
|
|
elm_smart_scroller_page_bring_in(wd->scr, h_pagenumber, v_pagenumber);
|
2011-11-30 08:03:03 -08:00
|
|
|
}
|
|
|
|
|
2011-11-30 09:31:01 -08:00
|
|
|
void
|
|
|
|
_elm_genlist_item_unrealize(Elm_Gen_Item *it,
|
|
|
|
Eina_Bool calc)
|
|
|
|
{
|
|
|
|
Evas_Object *content;
|
|
|
|
|
|
|
|
if (!it->realized) return;
|
|
|
|
if (it->wd->reorder_it == it) return;
|
2012-02-22 23:39:10 -08:00
|
|
|
|
2011-11-30 09:31:01 -08: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)
|
|
|
|
{
|
|
|
|
ecore_timer_del(it->long_timer);
|
|
|
|
it->long_timer = NULL;
|
|
|
|
}
|
|
|
|
|
2011-12-14 08:36:09 -08:00
|
|
|
elm_widget_stringlist_free(it->texts);
|
|
|
|
it->texts = NULL;
|
2011-11-30 09:31:01 -08:00
|
|
|
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);
|
|
|
|
|
|
|
|
it->unrealize_cb(it);
|
|
|
|
|
|
|
|
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)));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_elm_genlist_item_del_notserious(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
elm_widget_item_pre_notify_del(it);
|
2011-12-02 05:43:02 -08:00
|
|
|
it->generation = it->wd->generation - 1; /* This means that the item is deleted */
|
2011-11-30 09:31:01 -08:00
|
|
|
if (it->selected) it->wd->selected = eina_list_remove(it->wd->selected, it);
|
|
|
|
|
|
|
|
if (it->itc->func.del)
|
|
|
|
it->itc->func.del((void *)it->base.data, WIDGET(it));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_elm_genlist_item_del_serious(Elm_Gen_Item *it)
|
|
|
|
{
|
|
|
|
_elm_genlist_item_del_notserious(it);
|
|
|
|
it->wd->items = eina_inlist_remove(it->wd->items, EINA_INLIST_GET(it));
|
|
|
|
if (it->tooltip.del_cb)
|
|
|
|
it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it);
|
|
|
|
it->wd->walking -= it->walking;
|
|
|
|
if (it->long_timer) ecore_timer_del(it->long_timer);
|
|
|
|
if (it->group)
|
|
|
|
it->wd->group_items = eina_list_remove(it->wd->group_items, it);
|
|
|
|
|
2012-01-14 14:28:45 -08:00
|
|
|
if (it->wd->state)
|
|
|
|
{
|
|
|
|
eina_inlist_sorted_state_free(it->wd->state);
|
|
|
|
it->wd->state = NULL;
|
|
|
|
}
|
2011-11-30 09:31:01 -08:00
|
|
|
if (it->wd->calc_job) ecore_job_del(it->wd->calc_job);
|
|
|
|
it->wd->calc_job = ecore_job_add(it->wd->calc_cb, it->wd);
|
|
|
|
free(it->item);
|
2012-01-26 02:01:48 -08:00
|
|
|
|
2011-11-30 09:31:01 -08:00
|
|
|
it->item = NULL;
|
2012-01-30 02:39:32 -08:00
|
|
|
if (it->wd->last_selected_item == (Elm_Object_Item *) it)
|
2012-01-26 02:01:48 -08:00
|
|
|
it->wd->last_selected_item = NULL;
|
2012-02-21 15:59:25 -08:00
|
|
|
it->wd->item_count--;
|
2011-11-30 09:31:01 -08:00
|
|
|
}
|