Enlightenment CVS committal Author : monkeyiq Project : misc Module : feh
Dir : misc/feh/src Modified Files: sixdof.c Log Message: zooming and rotating now too! =================================================================== RCS file: /cvs/e/misc/feh/src/sixdof.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- sixdof.c 22 Apr 2008 13:21:36 -0000 1.1 +++ sixdof.c 22 Apr 2008 13:50:33 -0000 1.2 @@ -24,6 +24,63 @@ } } +void slideshow_zoom_in() +{ + winwidget w = winwidget_get_first_window_of_type( WIN_TYPE_SLIDESHOW ); + if( w ) + { + w->zoom = w->zoom * 1.05; + w->im_x = (w->w - (w->zoom*w->im_w)) / 2; + w->im_y = (w->h - (w->zoom*w->im_h)) / 2; + winwidget_render_image(w, 0, 0); + } +} + +void slideshow_zoom_out() +{ + winwidget w = winwidget_get_first_window_of_type( WIN_TYPE_SLIDESHOW ); + if( w ) + { + w->zoom = w->zoom * 0.95; + w->im_x = (w->w - (w->zoom*w->im_w)) / 2; + w->im_y = (w->h - (w->zoom*w->im_h)) / 2; + winwidget_render_image(w, 0, 0); + } +} + + +void slideshow_rotate_clockwise() +{ + winwidget w = winwidget_get_first_window_of_type( WIN_TYPE_SLIDESHOW ); + if( w ) + { + gib_imlib_image_orientate( w->im, 1 ); + int t = w->im_h; + w->im_h = w->im_w; + w->im_w = t; + w->im_x = (w->w - (w->zoom*w->im_w)) / 2; + w->im_y = (w->h - (w->zoom*w->im_h)) / 2; + winwidget_render_image(w, 0, 0); + } +} + +void slideshow_rotate_anticlockwise() +{ + winwidget w = winwidget_get_first_window_of_type( WIN_TYPE_SLIDESHOW ); + if( w ) + { + gib_imlib_image_orientate( w->im, 3 ); + int t = w->im_h; + w->im_h = w->im_w; + w->im_w = t; + w->im_x = (w->w - (w->zoom*w->im_w)) / 2; + w->im_y = (w->h - (w->zoom*w->im_h)) / 2; + winwidget_render_image(w, 0, 0); + } +} + + + void sixdof_init( Display* disp ) { sdof = libsixdof_init("feh" ); @@ -31,7 +88,10 @@ libsixdof_registerTrivialCallableFunction( sdof, "slideshow-next", "", &slideshow_next ); libsixdof_registerTrivialCallableFunction( sdof, "slideshow-prev", "", &slideshow_prev ); - + libsixdof_registerTrivialCallableFunction( sdof, "zoom-in", "", &slideshow_zoom_in ); + libsixdof_registerTrivialCallableFunction( sdof, "zoom-out", "", &slideshow_zoom_out ); + libsixdof_registerTrivialCallableFunction( sdof, "rotate-clockwise","", &slideshow_rotate_clockwise ); + libsixdof_registerTrivialCallableFunction( sdof, "rotate-anticlockwise","", &slideshow_rotate_anticlockwise ); } ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs