Enlightenment CVS committal

Author  : technikolor
Project : misc
Module  : eeh

Dir     : misc/eeh/src


Modified Files:
        eeh.c 


Log Message:
List bounds now handled.  Unloadable images handled.  Added autof00 notice.
===================================================================
RCS file: /cvsroot/enlightenment/misc/eeh/src/eeh.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- eeh.c       30 Mar 2005 10:12:34 -0000      1.1
+++ eeh.c       30 Mar 2005 11:00:27 -0000      1.2
@@ -9,6 +9,7 @@
 #define MAXH 1024
 
        Evas_List   *   file_list;
+       Evas_List   *   file_list_clean;
         Ecore_Evas  *   ee;
         Evas        *   evas;
         Evas_Object *   base_rect;
@@ -25,6 +26,7 @@
        }
 
        x = evas_list_count(file_list); 
+       file_list_clean = file_list;
        //printf("There are %d elements in the list\n", x);
 
         ecore_init();
@@ -70,10 +72,23 @@
                 ecore_main_loop_quit();
        } else if (!strcmp(ev->keyname, "Left")){
                file_list = evas_list_prev(file_list);          
-               show_image(evas_list_data(file_list));
+               if(evas_list_data(file_list)){
+                       show_image(evas_list_data(file_list));
+               } else {
+                       printf("Prev past begining...\n");
+                       file_list = evas_list_last(file_list_clean);
+                       show_image(evas_list_data(file_list));
+               }
        } else if (!strcmp(ev->keyname, "Right")){
                file_list = evas_list_next(file_list);          
                show_image(evas_list_data(file_list));
+               if(evas_list_data(file_list)){
+                        show_image(evas_list_data(file_list));
+                } else {
+                        printf("Hit end...\n");
+                        file_list = file_list_clean;
+                        show_image(evas_list_data(file_list));
+                }
        } else {
                //printf("You hit key: %s\n", ev->keyname);
        }
@@ -90,6 +105,12 @@
 int show_image(char * filename){
 
         evas_object_image_file_set(image, filename, NULL);
+
+       if(evas_object_image_load_error_get(image)){
+               printf("Can't load %s.\n", filename);
+               return;
+       }
+
         evas_object_image_size_get(image, &w, &h);
         printf("%s: Orig Size is %d by %d\n", filename, w, h);
 




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to