forked from enlightenment/efl
elm: Reverted wrong commits. This was committed by mistake :( So
shame...; SVN revision: 66123
This commit is contained in:
parent
feda46e2f1
commit
1dbbe5553c
|
@ -5,7 +5,6 @@
|
||||||
#include "elm_priv.h"
|
#include "elm_priv.h"
|
||||||
#include "els_scroller.h"
|
#include "els_scroller.h"
|
||||||
#include "elm_genlist.h"
|
#include "elm_genlist.h"
|
||||||
#include "els_pan.h"
|
|
||||||
|
|
||||||
#define MAX_ITEMS_PER_BLOCK 32
|
#define MAX_ITEMS_PER_BLOCK 32
|
||||||
#define REORDER_EFFECT_TIME 0.5
|
#define REORDER_EFFECT_TIME 0.5
|
||||||
|
@ -138,7 +137,6 @@ static void _item_auto_scroll(Widget_Data *wd);
|
||||||
static void _elm_genlist_clear(Evas_Object *obj, Eina_Bool standby);
|
static void _elm_genlist_clear(Evas_Object *obj, Eina_Bool standby);
|
||||||
|
|
||||||
static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_VERSION;
|
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_ACTIVATED[] = "activated";
|
||||||
static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
|
static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
|
||||||
|
@ -2156,7 +2154,6 @@ _item_position(Elm_Gen_Item *it,
|
||||||
evas_event_freeze(evas_object_evas_get(it->wd->obj));
|
evas_event_freeze(evas_object_evas_get(it->wd->obj));
|
||||||
evas_object_resize(view, it->item->w, it->item->h);
|
evas_object_resize(view, it->item->w, it->item->h);
|
||||||
evas_object_move(view, it_x, it_y);
|
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_object_show(view);
|
||||||
evas_event_thaw(evas_object_evas_get(it->wd->obj));
|
evas_event_thaw(evas_object_evas_get(it->wd->obj));
|
||||||
evas_event_thaw_eval(evas_object_evas_get(it->wd->obj));
|
evas_event_thaw_eval(evas_object_evas_get(it->wd->obj));
|
||||||
|
@ -2221,7 +2218,6 @@ _item_block_position(Item_Block *itb,
|
||||||
}
|
}
|
||||||
if (!it->item->move_effect_enabled)
|
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)
|
if (it->item->mode_view)
|
||||||
_item_position(it, it->item->mode_view, it->item->scrl_x,
|
_item_position(it, it->item->mode_view, it->item->scrl_x,
|
||||||
it->item->scrl_y);
|
it->item->scrl_y);
|
||||||
|
@ -2287,29 +2283,6 @@ _must_recalc_idler(void *data)
|
||||||
return ECORE_CALLBACK_CANCEL;
|
return ECORE_CALLBACK_CANCEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
static void
|
||||||
_calc_job(void *data)
|
_calc_job(void *data)
|
||||||
{
|
{
|
||||||
|
@ -2319,8 +2292,6 @@ _calc_job(void *data)
|
||||||
int in = 0;
|
int in = 0;
|
||||||
Eina_Bool minw_change = EINA_FALSE;
|
Eina_Bool minw_change = EINA_FALSE;
|
||||||
Eina_Bool did_must_recalc = 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;
|
if (!wd) return;
|
||||||
|
|
||||||
evas_object_geometry_get(wd->pan_smart, NULL, NULL, &ow, &wd->h);
|
evas_object_geometry_get(wd->pan_smart, NULL, NULL, &ow, &wd->h);
|
||||||
|
@ -2368,25 +2339,27 @@ _calc_job(void *data)
|
||||||
itb->h = itb->minh;
|
itb->h = itb->minh;
|
||||||
y += itb->h;
|
y += itb->h;
|
||||||
in += itb->count;
|
in += itb->count;
|
||||||
|
|
||||||
if ((showme) && (wd->show_item) && (!wd->show_item->item->queued))
|
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);
|
wd->show_item->item->showme = EINA_FALSE;
|
||||||
if (ELM_RECTS_INTERSECT(
|
if (wd->bring_in)
|
||||||
0, 0, pan_w, pan_h,
|
elm_smart_scroller_region_bring_in(wd->scr,
|
||||||
wd->show_item->x + wd->show_item->item->block->x,
|
wd->show_item->x +
|
||||||
wd->show_item->y + wd->show_item->item->block->y,
|
wd->show_item->item->block->x,
|
||||||
wd->show_item->item->block->w,
|
wd->show_item->y +
|
||||||
wd->show_item->item->h
|
wd->show_item->item->block->y,
|
||||||
))
|
wd->show_item->item->block->w,
|
||||||
{
|
wd->show_item->item->h);
|
||||||
_scroll_item(wd);
|
else
|
||||||
check_scroll = EINA_FALSE;
|
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 (minw_change)
|
||||||
{
|
{
|
||||||
|
@ -2524,7 +2497,6 @@ _pan_set(Evas_Object *obj,
|
||||||
// if (x > ow) x = ow;
|
// if (x > ow) x = ow;
|
||||||
// if (y > oh) y = oh;
|
// if (y > oh) y = oh;
|
||||||
if ((x == sd->wd->pan_x) && (y == sd->wd->pan_y)) return;
|
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_x = x;
|
||||||
sd->wd->pan_y = y;
|
sd->wd->pan_y = y;
|
||||||
|
|
||||||
|
|
|
@ -367,7 +367,6 @@ elm_smart_scroller_bounce_animator_disabled_set(Evas_Object *obj, Eina_Bool disa
|
||||||
|
|
||||||
if (sd->scrollto.y.animator)
|
if (sd->scrollto.y.animator)
|
||||||
{
|
{
|
||||||
//fprintf(stderr, "%s %d\n", __func__, __LINE__);
|
|
||||||
ecore_animator_del(sd->scrollto.y.animator);
|
ecore_animator_del(sd->scrollto.y.animator);
|
||||||
sd->scrollto.y.animator = NULL;
|
sd->scrollto.y.animator = NULL;
|
||||||
}
|
}
|
||||||
|
@ -540,7 +539,6 @@ _smart_scrollto_y_animator(void *data)
|
||||||
Evas_Coord px, py;
|
Evas_Coord px, py;
|
||||||
double t, tt;
|
double t, tt;
|
||||||
|
|
||||||
//fprintf(stderr, "%s %d\n", __func__, __LINE__);
|
|
||||||
t = ecore_loop_time_get();
|
t = ecore_loop_time_get();
|
||||||
tt = (t - sd->scrollto.y.t_start) / (sd->scrollto.y.t_end - sd->scrollto.y.t_start);
|
tt = (t - sd->scrollto.y.t_start) / (sd->scrollto.y.t_end - sd->scrollto.y.t_start);
|
||||||
tt = 1.0 - tt;
|
tt = 1.0 - tt;
|
||||||
|
@ -554,12 +552,10 @@ _smart_scrollto_y_animator(void *data)
|
||||||
elm_smart_scroller_child_pos_set(sd->smart_obj, px, py);
|
elm_smart_scroller_child_pos_set(sd->smart_obj, px, py);
|
||||||
_update_wanted_coordinates(sd, px, py);
|
_update_wanted_coordinates(sd, px, py);
|
||||||
sd->scrollto.y.animator = NULL;
|
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))
|
if ((!sd->scrollto.x.animator) && (!sd->down.bounce_x_animator))
|
||||||
_smart_anim_stop(sd->smart_obj);
|
_smart_anim_stop(sd->smart_obj);
|
||||||
return ECORE_CALLBACK_CANCEL;
|
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);
|
elm_smart_scroller_child_pos_set(sd->smart_obj, px, py);
|
||||||
_update_wanted_coordinates(sd, px, py);
|
_update_wanted_coordinates(sd, px, py);
|
||||||
|
|
||||||
|
@ -584,13 +580,11 @@ _smart_scrollto_y(Smart_Data *sd, double t_in, Evas_Coord pos_y)
|
||||||
t = ecore_loop_time_get();
|
t = ecore_loop_time_get();
|
||||||
sd->pan_func.get(sd->pan_obj, &px, &py);
|
sd->pan_func.get(sd->pan_obj, &px, &py);
|
||||||
sd->scrollto.y.start = 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.end = pos_y;
|
||||||
sd->scrollto.y.t_start = t;
|
sd->scrollto.y.t_start = t;
|
||||||
sd->scrollto.y.t_end = t + t_in;
|
sd->scrollto.y.t_end = t + t_in;
|
||||||
if (!sd->scrollto.y.animator)
|
if (!sd->scrollto.y.animator)
|
||||||
{
|
{
|
||||||
//fprintf(stderr, "%s %d\n", __func__, __LINE__);
|
|
||||||
sd->scrollto.y.animator = ecore_animator_add(_smart_scrollto_y_animator, sd);
|
sd->scrollto.y.animator = ecore_animator_add(_smart_scrollto_y_animator, sd);
|
||||||
if (!sd->scrollto.x.animator)
|
if (!sd->scrollto.x.animator)
|
||||||
_smart_anim_start(sd->smart_obj);
|
_smart_anim_start(sd->smart_obj);
|
||||||
|
@ -973,8 +967,6 @@ bounce_eval(Smart_Data *sd)
|
||||||
{
|
{
|
||||||
if (sd->scrollto.y.animator)
|
if (sd->scrollto.y.animator)
|
||||||
{
|
{
|
||||||
|
|
||||||
//fprintf(stderr, "%s %d\n", __func__, __LINE__);
|
|
||||||
ecore_animator_del(sd->scrollto.y.animator);
|
ecore_animator_del(sd->scrollto.y.animator);
|
||||||
sd->scrollto.y.animator = NULL;
|
sd->scrollto.y.animator = NULL;
|
||||||
}
|
}
|
||||||
|
@ -1030,8 +1022,6 @@ elm_smart_scroller_child_pos_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
||||||
if (y - miny > my) y = my + miny;
|
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);
|
sd->pan_func.set(sd->pan_obj, x, y);
|
||||||
if ((px != x) || (py != y))
|
if ((px != x) || (py != y))
|
||||||
edje_object_signal_emit(sd->edje_obj, "elm,action,scroll", "elm");
|
edje_object_signal_emit(sd->edje_obj, "elm,action,scroll", "elm");
|
||||||
|
@ -1117,7 +1107,6 @@ _elm_smart_scroller_child_region_show_internal(Evas_Object *obj, Evas_Coord *_x,
|
||||||
}
|
}
|
||||||
if (sd->scrollto.y.animator)
|
if (sd->scrollto.y.animator)
|
||||||
{
|
{
|
||||||
//fprintf(stderr, "%s %d\n", __func__, __LINE__);
|
|
||||||
ecore_animator_del(sd->scrollto.y.animator);
|
ecore_animator_del(sd->scrollto.y.animator);
|
||||||
sd->scrollto.y.animator = NULL;
|
sd->scrollto.y.animator = NULL;
|
||||||
}
|
}
|
||||||
|
@ -1481,11 +1470,9 @@ _elm_smart_scroller_wanted_region_set(Evas_Object *obj)
|
||||||
INTERNAL_ENTRY;
|
INTERNAL_ENTRY;
|
||||||
Evas_Coord ww, wh, wx = sd->wx;
|
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 ||
|
if (sd->down.now || sd->down.momentum_animator ||
|
||||||
sd->down.bounce_x_animator || sd->down.bounce_y_animator ||
|
sd->down.bounce_x_animator || sd->down.bounce_y_animator ||
|
||||||
sd->down.hold_animator || sd->down.onhold_animator ||
|
sd->down.hold_animator || sd->down.onhold_animator) return;
|
||||||
sd->scrollto.x.animator || sd->scrollto.y.animator) return;
|
|
||||||
|
|
||||||
sd->child.resized = EINA_FALSE;
|
sd->child.resized = EINA_FALSE;
|
||||||
|
|
||||||
|
@ -1617,7 +1604,6 @@ _smart_pan_pan_changed_hook(void *data, Evas_Object *obj __UNUSED__, void *event
|
||||||
}
|
}
|
||||||
if (sd->scrollto.y.animator)
|
if (sd->scrollto.y.animator)
|
||||||
{
|
{
|
||||||
//fprintf(stderr, "%s %d\n", __func__, __LINE__);
|
|
||||||
ecore_animator_del(sd->scrollto.y.animator);
|
ecore_animator_del(sd->scrollto.y.animator);
|
||||||
sd->scrollto.y.animator = NULL;
|
sd->scrollto.y.animator = NULL;
|
||||||
}
|
}
|
||||||
|
@ -1686,7 +1672,6 @@ _smart_event_wheel(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
|
||||||
}
|
}
|
||||||
if (sd->scrollto.y.animator)
|
if (sd->scrollto.y.animator)
|
||||||
{
|
{
|
||||||
//fprintf(stderr, "%s %d\n", __func__, __LINE__);
|
|
||||||
ecore_animator_del(sd->scrollto.y.animator);
|
ecore_animator_del(sd->scrollto.y.animator);
|
||||||
sd->scrollto.y.animator = NULL;
|
sd->scrollto.y.animator = NULL;
|
||||||
}
|
}
|
||||||
|
@ -1747,7 +1732,6 @@ _smart_event_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSE
|
||||||
}
|
}
|
||||||
if (sd->scrollto.y.animator)
|
if (sd->scrollto.y.animator)
|
||||||
{
|
{
|
||||||
//fprintf(stderr, "%s %d\n", __func__, __LINE__);
|
|
||||||
ecore_animator_del(sd->scrollto.y.animator);
|
ecore_animator_del(sd->scrollto.y.animator);
|
||||||
sd->scrollto.y.animator = NULL;
|
sd->scrollto.y.animator = NULL;
|
||||||
}
|
}
|
||||||
|
@ -2553,10 +2537,9 @@ _smart_scrollbar_read(Smart_Data *sd)
|
||||||
edje_object_part_drag_value_get(sd->edje_obj, "elm.dragable.hbar", &vx, 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.max_get(sd->pan_obj, &mx, &my);
|
||||||
sd->pan_func.min_get(sd->pan_obj, &minx, &miny);
|
sd->pan_func.min_get(sd->pan_obj, &minx, &miny);
|
||||||
x = round(vx * (double)mx + minx);
|
x = vx * (double)mx + minx;
|
||||||
y = round(vy * (double)my + miny);
|
y = vy * (double)my + miny;
|
||||||
sd->pan_func.get(sd->pan_obj, &px, &py);
|
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);
|
sd->pan_func.set(sd->pan_obj, x, y);
|
||||||
if ((px != x) || (py != y))
|
if ((px != x) || (py != y))
|
||||||
edje_object_signal_emit(sd->edje_obj, "elm,action,scroll", "elm");
|
edje_object_signal_emit(sd->edje_obj, "elm,action,scroll", "elm");
|
||||||
|
|
Loading…
Reference in New Issue