Enlightenment CVS committal

Author  : rephorm
Project : e17
Module  : proto

Dir     : e17/proto/esmart/src/container


Modified Files:
        container.c container.h 


Log Message:

finished up scrolling.

1) The easy way.
  e_container_scroll_start(container, velocity);

  velocity is positive to go right or down and negative to go left or up. the 
magnitude multiplies the speed of the default scroll. For most cases, 1 or -1 should 
be ok, but this is more flexible.

  this function takes care of setting up a timer for you. the contents exponentially 
ramp up to the desired speed, and then keep going that speed until:

  e_container_scroll_stop(container);

2) the harder (even more flexible) way.
   e_container_scroll_offset_set(container, offset);

   offset is the double value (positive or negative) of the starting point of the 
contents from the left (or top) edge. set up your own timers to actually animate the 
scrolling.

  

  
  

===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/esmart/src/container/container.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- container.c 14 Sep 2003 00:30:38 -0000      1.1
+++ container.c 14 Sep 2003 21:43:15 -0000      1.2
@@ -233,7 +233,7 @@
 }
 
 void
-e_container_scroll_start(Evas_Object *container, int direction)
+e_container_scroll_start(Evas_Object *container, double velocity)
 {
   Container *cont;
   Scroll_Data *data;
@@ -241,7 +241,7 @@
   cont = _container_fetch(container);
 
   data = calloc(1, sizeof(Scroll_Data));
-  data->direction = direction;
+  data->velocity = velocity;
   data->start_time = ecore_time_get();
   data->cont = cont;
  
@@ -713,9 +713,9 @@
   double dt, dx;
   
   dt = ecore_time_get() - sd->start_time;
-  dx = 1 - exp(-dt/2); 
+  dx = 10 * (1 - exp(-dt)); 
 
-  sd->cont->scroll_offset += dx * sd->direction;
+  sd->cont->scroll_offset += dx * sd->velocity;
 
   _container_elements_fix(sd->cont);
   return 1;
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/esmart/src/container/container.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- container.h 14 Sep 2003 00:30:38 -0000      1.1
+++ container.h 14 Sep 2003 21:43:15 -0000      1.2
@@ -91,7 +91,7 @@
 {
   Container *cont;
   double start_time;
-  int direction; 
+  double velocity;
 };
 
 Evas_Object *e_container_new(Evas *evas);
@@ -138,6 +138,10 @@
 void e_container_element_remove(Evas_Object *container, Evas_Object *element);
 
 Evas_List *e_container_elements_get(Evas_Object *container);
+
+/* scrolling */
+void e_container_scroll_start(Evas_Object *container, double velocity);
+void e_container_scroll_stop(Evas_Object *container);
 
 /* callbacks */
 void e_container_callback_order_change_set(Evas_Object *obj, 




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to