Enlightenment CVS committal

Author  : titansoccer15
Project : e17
Module  : proto

Dir     : e17/proto/ephoto/src


Modified Files:
        ephoto.c 


Log Message:

--view-image /full/path/to/image.png opens ephoto with view image set. ephoto 
/path/to/dir opens ephoto with that root dir. ephoto --slideshow 
/full/path/to/image.png /full/path/to/image.png and so on... opens the ephoto 
slideshow directly.

===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/ephoto/src/ephoto.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- ephoto.c    18 Mar 2006 08:41:40 -0000      1.10
+++ ephoto.c    19 Mar 2006 06:26:21 -0000      1.11
@@ -11,10 +11,11 @@
 
 int audio = 0;
 int wino = 0;
-int mainwin;
+int mainwin = 15;
 int audiolen;
 int slidenum;
 char *audios;
+char argimage[PATH_MAX];
 char tempdb[PATH_MAX];
 char db[PATH_MAX];
 /*****************/
@@ -37,28 +38,38 @@
        /*****************************************/
        /****Get db directory****/
        char *home;
-       if ( argc > 2 && !strcmp(argv[1], "--slideshow") ) {
-               int imageint;
-               for ( imageint = 2; imageint < argc; imageint++ ) {
-                       ecore_dlist_append(m->imagelist, 
strdup(argv[imageint]));
+       int argint = 1;
+       while ( argint < argc ) {       
+               if ( argint < argc && !strcmp(argv[argint], "--slideshow") ) {
+                       int imageint;
+                       imageint = argint;
+                       while ( imageint < argc ) {
+                               imageint++;
+                               ecore_dlist_append(m->imagelist, 
strdup(argv[imageint]));
+                       }
+                       mainwin = 0;
+                       slideshow_cb(NULL, NULL, NULL);
+                       ewl_main();
                }
-               mainwin = 0;
-               slideshow_cb(NULL, NULL, NULL);
-               ewl_main();
+               else if ( argint < argc && !strcmp(argv[argint], 
"--view-image") ) {
+                       int imageint;
+                       imageint = argint;
+                       imageint++;
+                       snprintf(argimage, PATH_MAX, "%s", argv[imageint]);
+                       printf("%s\n", argimage);
+               }
+               argint++;
+       }
+       if ( mainwin == 0 ) {
+               //do nothing
        }
-       else {  
+       else if ( mainwin != 0 ) {      
                if ( argv[1] != NULL && ecore_file_is_dir(argv[1]) ) {
                        home = argv[1];
                }
                else {
                        home = getenv("HOME");
                }       
-               //snprintf(tempdb, PATH_MAX, "%s/ephoto_images", home);
-               //if ( !ecore_file_is_dir(tempdb) ) {
-               //      ecore_file_mkdir(tempdb);
-               //}
-               //snprintf(db, PATH_MAX, "%s", tempdb);
-               /**************************/
                /****Setup the layout****/
                m->win = ewl_window_new();
                ewl_window_title_set(EWL_WINDOW(m->win), "ephoto");
@@ -142,6 +153,9 @@
                ewl_widget_show(m->viewscroll);
 
                m->vimage = ewl_image_new();
+               if ( argimage != NULL ) {
+                       ewl_image_file_set(EWL_IMAGE(m->vimage), argimage, 
NULL);
+               }
                ewl_object_fill_policy_set(EWL_OBJECT(m->vimage), 
EWL_FLAG_FILL_ALL);
                ewl_image_proportional_set(EWL_IMAGE(m->vimage), TRUE);
                ewl_container_child_append(EWL_CONTAINER(m->viewscroll), 
m->vimage);




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to