Enlightenment CVS committal Author : titansoccer15 Project : e17 Module : proto
Dir : e17/proto/ephoto/src Modified Files: ephoto.c ephoto.h ephoto_presentation.c Log Message: added more command line options- see ephoto --help to view them. =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/ephoto/src/ephoto.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- ephoto.c 20 Mar 2006 06:06:04 -0000 1.14 +++ ephoto.c 21 Mar 2006 02:36:53 -0000 1.15 @@ -17,9 +17,15 @@ int audiolen; int slidenum; int arglength = 0; +int argslideshow = 0; +int argloop = 0; +int argfit = 0; +int argfullscreen = 0; char *audios; char argimage[PATH_MAX]; char argaudio[PATH_MAX]; +char *argheight; +char *argwidth; char tempdb[PATH_MAX]; char db[PATH_MAX]; /*****************/ @@ -86,12 +92,26 @@ imageint++; arglength = atoi(argv[imageint]); } + else if ( argint < argc && !strcmp(argv[argint], "--loop") ) { + argloop = 1; + } + else if ( argint < argc && !strcmp(argv[argint], "--fit-to-audio") ) { + argfit = 1; + } + else if ( argint < argc && !strcmp(argv[argint], "--fullscreen") ) { + argfullscreen = 1; + } else if ( argint < argc && !strcmp(argv[argint], "--help") ) { printf("ephoto /path/to/dir loads /path/to/dir as default directory\n"); printf("ephoto --view-image /full/path/to/image sets /full/path/to/image as the default image in the image viewer tab.\n"); printf("ephoto --slideshow /full/path/to/image /full/path/to/image /full/path/to/image starts the slideshow using the specified images\n"); + printf("ephoto --presentation /full/path/to/image /full/path/to/image /full/path/to/image starts the presentation using the specified images\n"); printf("ephoto --audio /full/path/to/audio sets /full/path/to/audio as default audio for slideshow\n"); printf("ephoto --length length sets the integer length(seconds) as the transition time for slideshow\n"); + printf("ephoto --fullscreen sets the presentation/slideshow window to be fullscreen\n"); + printf("ephoto --win-size integer integer sets the first integer as the width and the second integer as the height of the presentation/slideshow window\n"); + printf("ephoto --loop sets the slideshow to loop\n"); + printf("ephoto --fit-to-audio sets the slideshow to fit audio\n"); mainwin = 0; } argint++; @@ -289,6 +309,9 @@ m->loopcheck = ewl_checkbutton_new(); ewl_button_label_set(EWL_BUTTON(m->loopcheck), "Loop Slideshow"); ewl_container_child_append(EWL_CONTAINER(m->hboxv), m->loopcheck); + if ( argloop != 0 ) { + ewl_checkbutton_checked_set(EWL_CHECKBUTTON(m->loopcheck), TRUE); + } ewl_object_maximum_size_set(EWL_OBJECT(m->loopcheck), 130, 50); ewl_object_size_request(EWL_OBJECT(m->loopcheck), 130, 50); ewl_object_alignment_set(EWL_OBJECT(m->loopcheck), EWL_FLAG_ALIGN_CENTER); =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/ephoto/src/ephoto.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- ephoto.h 18 Mar 2006 08:41:40 -0000 1.7 +++ ephoto.h 21 Mar 2006 02:36:53 -0000 1.8 @@ -127,6 +127,12 @@ extern int audiolen; extern int mainwin; extern int slidenum; +extern int arglength; +extern int argfit; +extern int argfullscreen; +extern int argloop; +extern char *argwidth; +extern char *argheight; extern char *audios; #endif =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/ephoto/src/ephoto_presentation.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- ephoto_presentation.c 18 Mar 2006 08:29:59 -0000 1.10 +++ ephoto_presentation.c 21 Mar 2006 02:36:53 -0000 1.11 @@ -33,8 +33,14 @@ h = atoi(hsize); } if ( mainwin == 0 ) { - w = 800; - h = 600; + if ( argwidth == NULL && argheight == NULL ) { + w = 600; + h = 480; + } + else { + w = atoi(argwidth); + h = atoi(argheight); + } } s->screen = ewl_image_new(); ewl_image_proportional_set(EWL_IMAGE(s->screen), TRUE); @@ -46,13 +52,38 @@ ewl_object_maximum_size_set(EWL_OBJECT(s->screen), w, h); } } - if ( mainwin == 0 ) { + if ( mainwin == 0 && argfullscreen == 0 ) { ewl_object_maximum_size_set(EWL_OBJECT(s->screen), w, h); } ewl_object_fill_policy_set(EWL_OBJECT(s->screen), EWL_FLAG_FILL_SHRINK); ewl_container_child_append(EWL_CONTAINER(s->cell), s->screen); ewl_widget_show(s->screen); + + if ( !picture1 ) { + if ( mainwin == 0 ) { + if ( argloop == 0 ) { + ewl_callback_call(s->wins, EWL_CALLBACK_CLICKED); + } + + if ( argloop == 1 ) { + picture2 = ecore_dlist_goto_first(m->imagelist); + ewl_widget_destroy(s->screen); + s->screen = ewl_image_new(); + ewl_image_proportional_set(EWL_IMAGE(s->screen), TRUE); + ewl_theme_data_str_set(s->screen, "/image/group", "entry"); + ewl_object_fill_policy_set(EWL_OBJECT(s->screen), EWL_FLAG_FILL_SHRINK); + ewl_image_file_set(EWL_IMAGE(s->screen), picture2, NULL); + ewl_object_alignment_set(EWL_OBJECT(s->screen), EWL_FLAG_ALIGN_CENTER); + if ( argfullscreen == 0 ) { + ewl_object_maximum_size_set(EWL_OBJECT(s->screen), w, h); + } + ewl_container_child_append(EWL_CONTAINER(s->cell), s->screen); + ewl_widget_show(s->screen); + } + + } + } if ( mainwin == 1 ) { if (!picture1 && ewl_checkbutton_is_checked(EWL_CHECKBUTTON(m->loopcheck)) == 1 ) { picture2 = ecore_dlist_goto_first(m->imagelist); @@ -202,7 +233,12 @@ } } else { - time = 3; + if ( arglength != 0 ) { + time = arglength; + } + if ( arglength == 0 ) { + time = 3; + } } s->timer = ecore_timer_add(time, _change_picture_cb, NULL); /*******************************************************************/ ------------------------------------------------------- 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