Enlightenment CVS committal

Author  : rephorm
Project : e17
Module  : libs/esmart

Dir     : e17/libs/esmart/src/lib/esmart_container


Modified Files:
        Esmart_Container.h esmart_container.c 


Log Message:


rename _scroll_percent -> scroll_percent_set
add _scroll_percent_get

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/esmart/src/lib/esmart_container/Esmart_Container.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- Esmart_Container.h  8 Jan 2005 15:48:03 -0000       1.5
+++ Esmart_Container.h  9 Jan 2005 02:36:00 -0000       1.6
@@ -97,10 +97,11 @@
 void esmart_container_scroll_stop(Evas_Object *container);
 void esmart_container_scroll(Evas_Object *container, int val);
 
-void esmart_container_scroll_offset_set(Evas_Object *container, int val);
-int  esmart_container_scroll_offset_get(Evas_Object *container);
-void esmart_container_scroll_percent(Evas_Object *container, double percent);
-void esmart_container_scroll_to(Evas_Object *container, Evas_Object *element);
+void   esmart_container_scroll_offset_set(Evas_Object *container, int val);
+int    esmart_container_scroll_offset_get(Evas_Object *container);
+void   esmart_container_scroll_percent_set(Evas_Object *container, double 
percent);
+double esmart_container_scroll_percent_get(Evas_Object *container);
+void   esmart_container_scroll_to(Evas_Object *container, Evas_Object 
*element);
 
 /* callbacks */
 void esmart_container_callback_order_change_set(Evas_Object *obj, 
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/esmart/src/lib/esmart_container/esmart_container.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- esmart_container.c  8 Jan 2005 20:04:08 -0000       1.7
+++ esmart_container.c  9 Jan 2005 02:36:00 -0000       1.8
@@ -322,7 +322,7 @@
 }
 
 void
-esmart_container_scroll_percent(Evas_Object *container, double percent)
+esmart_container_scroll_percent_set(Evas_Object *container, double percent)
 {
   Container *cont;
   double length, size;
@@ -337,6 +337,23 @@
     esmart_container_scroll_offset_set(container, -percent * (length - size));
 }
 
+double
+esmart_container_scroll_percent_get(Evas_Object *container)
+{
+  Container *cont;
+  double length, size, offset;
+
+  cont = _container_fetch(container);
+  if (!cont) return;
+
+
+  length = esmart_container_elements_length_get(container);
+  size = cont->direction ? cont->h : cont->w;
+
+  if (length < size) return 0.0;
+  else return (double)(cont->scroll.offset) / (size - length);
+}
+
 void
 esmart_container_scroll_to(Evas_Object *container, Evas_Object *element)
 {




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to