elm: Reverted wrong commits. This was committed by mistake :( So
authorseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 12 Dec 2011 23:57:57 +0000 (23:57 +0000)
committerseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 12 Dec 2011 23:57:57 +0000 (23:57 +0000)
shame...;

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@66123 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_genlist.c
src/lib/els_scroller.c

index 6f9e953..75b25fa 100644 (file)
@@ -5,7 +5,6 @@
 #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
@@ -138,7 +137,6 @@ static void      _item_auto_scroll(Widget_Data *wd);
 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";
@@ -2156,7 +2154,6 @@ _item_position(Elm_Gen_Item *it,
    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));
@@ -2221,7 +2218,6 @@ _item_block_position(Item_Block *itb,
                          }
                        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);
@@ -2288,29 +2284,6 @@ _must_recalc_idler(void *data)
 }
 
 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;
@@ -2319,8 +2292,6 @@ _calc_job(void *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);
@@ -2368,25 +2339,27 @@ _calc_job(void *data)
         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)
      {
@@ -2524,7 +2497,6 @@ _pan_set(Evas_Object *obj,
    //   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;
 
index 5c329be..327698c 100644 (file)
@@ -367,7 +367,6 @@ elm_smart_scroller_bounce_animator_disabled_set(Evas_Object *obj, Eina_Bool disa
 
         if (sd->scrollto.y.animator)
           {
-//fprintf(stderr, "%s %d\n", __func__, __LINE__);
              ecore_animator_del(sd->scrollto.y.animator);
              sd->scrollto.y.animator = NULL;
           }
@@ -540,7 +539,6 @@ _smart_scrollto_y_animator(void *data)
    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;
@@ -554,12 +552,10 @@ _smart_scrollto_y_animator(void *data)
         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);
 
@@ -584,13 +580,11 @@ _smart_scrollto_y(Smart_Data *sd, double t_in, Evas_Coord pos_y)
    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);
@@ -973,8 +967,6 @@ bounce_eval(Smart_Data *sd)
                {
                   if (sd->scrollto.y.animator)
                     {
-
-//fprintf(stderr, "%s %d\n", __func__, __LINE__);
                        ecore_animator_del(sd->scrollto.y.animator);
                        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;
      }
 
-//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");
@@ -1117,7 +1107,6 @@ _elm_smart_scroller_child_region_show_internal(Evas_Object *obj, Evas_Coord *_x,
      }
    if (sd->scrollto.y.animator)
      {
-//fprintf(stderr, "%s %d\n", __func__, __LINE__);
         ecore_animator_del(sd->scrollto.y.animator);
         sd->scrollto.y.animator = NULL;
      }
@@ -1481,11 +1470,9 @@ _elm_smart_scroller_wanted_region_set(Evas_Object *obj)
    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;
 
@@ -1617,7 +1604,6 @@ _smart_pan_pan_changed_hook(void *data, Evas_Object *obj __UNUSED__, void *event
      }
    if (sd->scrollto.y.animator)
      {
-//fprintf(stderr, "%s %d\n", __func__, __LINE__);
         ecore_animator_del(sd->scrollto.y.animator);
         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)
      {
-//fprintf(stderr, "%s %d\n", __func__, __LINE__);
         ecore_animator_del(sd->scrollto.y.animator);
         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)
           {
-//fprintf(stderr, "%s %d\n", __func__, __LINE__);
              ecore_animator_del(sd->scrollto.y.animator);
              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);
    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");