Enlightenment CVS committal
Author : rephorm
Project : e17
Module : proto
Dir : e17/proto/esmart/test
Modified Files:
esmart_main.c
Log Message:
The test program now takes any image files passed to it on the cmd line, creates
thumbnails out of them, and lays them out in a horizontal container.
click in the white space at the bottom of the container to scroll (left half goes
left, right half goes right).
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/esmart/test/esmart_main.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- esmart_main.c 14 Sep 2003 00:30:39 -0000 1.1
+++ esmart_main.c 14 Sep 2003 21:45:59 -0000 1.2
@@ -1,3 +1,15 @@
+/*
+ * esmart_main.c
+ *
+ * a test program for the thumbnail and container smart objects.
+ * usage: esmart_test file1 [file2] [file3] ...
+ *
+ * esmart_test creates thumbnails out of all valid image files given
+ * as arguments, and puts them into a horizontal container.
+ * click on the white background to scroll the contents.
+ */
+
+
#include <stdio.h>
#include <Ecore.h>
#include <Ecore_Evas.h>
@@ -31,6 +43,32 @@
return(0);
}
+static int
+bg_down_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
+{
+ Evas_Event_Mouse_Down *event = event_info;
+ Evas_Object *cont = data;
+ double x, w;
+
+ evas_object_geometry_get(obj, &x, NULL, &w, NULL);
+ if (event->canvas.x < x + w/2)
+ e_container_scroll_start(cont, -1);
+ else
+ e_container_scroll_start(cont, 1);
+
+
+}
+
+static int
+bg_up_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
+{
+ Evas_Event_Mouse_Up *event = event_info;
+ Evas_Object *cont = data;
+
+ printf("up!\n");
+ e_container_scroll_stop(cont);
+}
+
int
main(int argc, char *argv[])
{
@@ -71,7 +109,10 @@
e_container_fill_policy_set(cont,
CONTAINER_FILL_POLICY_FILL_Y |
CONTAINER_FILL_POLICY_KEEP_ASPECT);
-
+
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, bg_down_cb, cont);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, bg_up_cb, cont);
+
while(--argc)
{
if((o = e_thumb_new(ecore_evas_get(ee), argv[argc])))
-------------------------------------------------------
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