#include "elm_priv.h"
#include "els_scroller.h"
#include "elm_genlist.h"
-#include "els_pan.h"
#define MAX_ITEMS_PER_BLOCK 32
#define REORDER_EFFECT_TIME 0.5
static void _elm_genlist_clear(Evas_Object *obj, Eina_Bool standby);
static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_VERSION;
-static void _pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h);
static const char SIG_ACTIVATED[] = "activated";
static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
evas_event_freeze(evas_object_evas_get(it->wd->obj));
evas_object_resize(view, it->item->w, it->item->h);
evas_object_move(view, it_x, it_y);
-//fprintf(stderr, "it: %p, x %d y %d\n", view, it_x, it_y);
evas_object_show(view);
evas_event_thaw(evas_object_evas_get(it->wd->obj));
evas_event_thaw_eval(evas_object_evas_get(it->wd->obj));
}
if (!it->item->move_effect_enabled)
{
-//fprintf(stderr, "it %p itb->y %d it->y %d pan_y %d oy %d\n", it, itb->y, it->y, it->wd->pan_y, oy);
if (it->item->mode_view)
_item_position(it, it->item->mode_view, it->item->scrl_x,
it->item->scrl_y);
}
static void
-_scroll_item(Widget_Data *wd)
-{
- wd->show_item->item->showme = EINA_FALSE;
- if (wd->bring_in)
- elm_smart_scroller_region_bring_in(wd->scr,
- wd->show_item->x +
- wd->show_item->item->block->x,
- wd->show_item->y +
- wd->show_item->item->block->y,
- wd->show_item->item->block->w,
- wd->show_item->item->h);
- else
- elm_smart_scroller_child_region_show(wd->scr,
- wd->show_item->x +
- wd->show_item->item->block->x,
- wd->show_item->y +
- wd->show_item->item->block->y,
- wd->show_item->item->block->w,
- wd->show_item->item->h);
- wd->show_item = NULL;
-}
-
-static void
_calc_job(void *data)
{
Widget_Data *wd = data;
int in = 0;
Eina_Bool minw_change = EINA_FALSE;
Eina_Bool did_must_recalc = EINA_FALSE;
- Evas_Coord pan_w = 0, pan_h = 0;
- static Eina_Bool check_scroll = EINA_FALSE;
if (!wd) return;
evas_object_geometry_get(wd->pan_smart, NULL, NULL, &ow, &wd->h);
itb->h = itb->minh;
y += itb->h;
in += itb->count;
-
if ((showme) && (wd->show_item) && (!wd->show_item->item->queued))
- check_scroll = EINA_TRUE;
- if (check_scroll)
{
- _pan_child_size_get(wd->pan_smart, &pan_w, &pan_h);
- if (ELM_RECTS_INTERSECT(
- 0, 0, pan_w, pan_h,
- wd->show_item->x + wd->show_item->item->block->x,
- wd->show_item->y + wd->show_item->item->block->y,
- wd->show_item->item->block->w,
- wd->show_item->item->h
- ))
- {
- _scroll_item(wd);
- check_scroll = EINA_FALSE;
- }
+ wd->show_item->item->showme = EINA_FALSE;
+ if (wd->bring_in)
+ elm_smart_scroller_region_bring_in(wd->scr,
+ wd->show_item->x +
+ wd->show_item->item->block->x,
+ wd->show_item->y +
+ wd->show_item->item->block->y,
+ wd->show_item->item->block->w,
+ wd->show_item->item->h);
+ else
+ elm_smart_scroller_child_region_show(wd->scr,
+ wd->show_item->x +
+ wd->show_item->item->block->x,
+ wd->show_item->y +
+ wd->show_item->item->block->y,
+ wd->show_item->item->block->w,
+ wd->show_item->item->h);
+ wd->show_item = NULL;
}
-//fprintf(stderr, "bring in %d %d %d %d : pan child %d %d\n", wd->show_item->x + wd->show_item->item->block->x, wd->show_item->y + wd->show_item->item->block->y, wd->show_item->item->block->w, wd->show_item->item->h, pan_w, pan_h);
}
if (minw_change)
{
// if (x > ow) x = ow;
// if (y > oh) y = oh;
if ((x == sd->wd->pan_x) && (y == sd->wd->pan_y)) return;
-//fprintf(stderr, "pan_y %d\n", y);
sd->wd->pan_x = x;
sd->wd->pan_y = y;
if (sd->scrollto.y.animator)
{
-//fprintf(stderr, "%s %d\n", __func__, __LINE__);
ecore_animator_del(sd->scrollto.y.animator);
sd->scrollto.y.animator = NULL;
}
Evas_Coord px, py;
double t, tt;
-//fprintf(stderr, "%s %d\n", __func__, __LINE__);
t = ecore_loop_time_get();
tt = (t - sd->scrollto.y.t_start) / (sd->scrollto.y.t_end - sd->scrollto.y.t_start);
tt = 1.0 - tt;
elm_smart_scroller_child_pos_set(sd->smart_obj, px, py);
_update_wanted_coordinates(sd, px, py);
sd->scrollto.y.animator = NULL;
-fprintf(stderr, "%s %d x %d y %d\n", __func__, __LINE__, px, py);
if ((!sd->scrollto.x.animator) && (!sd->down.bounce_x_animator))
_smart_anim_stop(sd->smart_obj);
return ECORE_CALLBACK_CANCEL;
}
-fprintf(stderr, "%s %d x %d y %d\n", __func__, __LINE__, px, py);
elm_smart_scroller_child_pos_set(sd->smart_obj, px, py);
_update_wanted_coordinates(sd, px, py);
t = ecore_loop_time_get();
sd->pan_func.get(sd->pan_obj, &px, &py);
sd->scrollto.y.start = py;
-fprintf(stderr, "%s %d y.end %d\n", __func__, __LINE__, pos_y);
sd->scrollto.y.end = pos_y;
sd->scrollto.y.t_start = t;
sd->scrollto.y.t_end = t + t_in;
if (!sd->scrollto.y.animator)
{
-//fprintf(stderr, "%s %d\n", __func__, __LINE__);
sd->scrollto.y.animator = ecore_animator_add(_smart_scrollto_y_animator, sd);
if (!sd->scrollto.x.animator)
_smart_anim_start(sd->smart_obj);
{
if (sd->scrollto.y.animator)
{
-
-//fprintf(stderr, "%s %d\n", __func__, __LINE__);
ecore_animator_del(sd->scrollto.y.animator);
sd->scrollto.y.animator = NULL;
}
if (y - miny > my) y = my + miny;
}
-//fprintf(stderr, "x %d y %d\n", x, y);
- if ((px == x) && (py == y)) return;
sd->pan_func.set(sd->pan_obj, x, y);
if ((px != x) || (py != y))
edje_object_signal_emit(sd->edje_obj, "elm,action,scroll", "elm");
}
if (sd->scrollto.y.animator)
{
-//fprintf(stderr, "%s %d\n", __func__, __LINE__);
ecore_animator_del(sd->scrollto.y.animator);
sd->scrollto.y.animator = NULL;
}
INTERNAL_ENTRY;
Evas_Coord ww, wh, wx = sd->wx;
-//fprintf(stderr, "%s %d animator : %p\n", __func__, __LINE__, sd->scrollto.y.animator);
if (sd->down.now || sd->down.momentum_animator ||
sd->down.bounce_x_animator || sd->down.bounce_y_animator ||
- sd->down.hold_animator || sd->down.onhold_animator ||
- sd->scrollto.x.animator || sd->scrollto.y.animator) return;
+ sd->down.hold_animator || sd->down.onhold_animator) return;
sd->child.resized = EINA_FALSE;
}
if (sd->scrollto.y.animator)
{
-//fprintf(stderr, "%s %d\n", __func__, __LINE__);
ecore_animator_del(sd->scrollto.y.animator);
sd->scrollto.y.animator = NULL;
}
}
if (sd->scrollto.y.animator)
{
-//fprintf(stderr, "%s %d\n", __func__, __LINE__);
ecore_animator_del(sd->scrollto.y.animator);
sd->scrollto.y.animator = NULL;
}
}
if (sd->scrollto.y.animator)
{
-//fprintf(stderr, "%s %d\n", __func__, __LINE__);
ecore_animator_del(sd->scrollto.y.animator);
sd->scrollto.y.animator = NULL;
}
edje_object_part_drag_value_get(sd->edje_obj, "elm.dragable.hbar", &vx, NULL);
sd->pan_func.max_get(sd->pan_obj, &mx, &my);
sd->pan_func.min_get(sd->pan_obj, &minx, &miny);
- x = round(vx * (double)mx + minx);
- y = round(vy * (double)my + miny);
+ x = vx * (double)mx + minx;
+ y = vy * (double)my + miny;
sd->pan_func.get(sd->pan_obj, &px, &py);
-fprintf(stderr, "y %d vy %f my %d miny %d\n", y, vy, my, miny);
sd->pan_func.set(sd->pan_obj, x, y);
if ((px != x) || (py != y))
edje_object_signal_emit(sd->edje_obj, "elm,action,scroll", "elm");