From: <enl...@li...> - 2002-11-24 23:20:40
|
Enlightenment CVS committal Author : gilbertt Project : misc Module : feh Dir : misc/feh/src Modified Files: feh.h keyevents.c menu.c options.c Log Message: Sun Nov 24 22:47:43 GMT 2002 Tom Gilbert <to...@li...> * Patch from Daniel Ashbrook <an...@cc...> to bind a key (v) to switching between window and fullscreen mode =================================================================== RCS file: /cvsroot/enlightenment/misc/feh/src/feh.h,v retrieving revision 1.120 retrieving revision 1.121 diff -u -3 -r1.120 -r1.121 --- feh.h 21 Oct 2002 01:17:31 -0000 1.120 +++ feh.h 24 Nov 2002 23:20:37 -0000 1.121 @@ -52,6 +52,8 @@ #include <stdarg.h> #include <signal.h> #include <sys/wait.h> +#include <math.h> + #include <Imlib2.h> #include <giblib/giblib.h> @@ -66,6 +68,10 @@ #define SLIDESHOW_RELOAD_MAX 4096 +#ifndef TRUE +#define FALSE 0 +#define TRUE !FALSE +#endif #ifndef __GNUC__ # define __attribute__(x) =================================================================== RCS file: /cvsroot/enlightenment/misc/feh/src/keyevents.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -3 -r1.42 -r1.43 --- keyevents.c 11 Sep 2002 18:46:37 -0000 1.42 +++ keyevents.c 24 Nov 2002 23:20:38 -0000 1.43 @@ -37,6 +37,7 @@ KeySym keysym; XKeyEvent *kev; winwidget winwid = NULL; + int curr_screen = 0; D_ENTER(4); @@ -201,7 +202,52 @@ case '<': feh_edit_inplace_orient(winwid, 3); break; - case '=': + case 'v': + case 'V': +#ifdef HAVE_LIBXINERAMA + if (opt.xinerama && xinerama_screens) { + int i, rect[4]; + + /* FIXME: this doesn't do what it should; XGetGeometry always + * returns x,y == 0,0. I think that's due to the hints being passed + * (or more specifically, a missing hint) to X in winwidget_create + */ + winwidget_get_geometry(winwid, rect); + /* printf("window: (%d, %d)\n", rect[0], rect[1]); + printf("found %d screens.\n", num_xinerama_screens); */ + for (i = 0; i < num_xinerama_screens; i++) { + xinerama_screen = 0; + /* printf("%d: [%d, %d, %d, %d] (%d, %d)\n", + i, + xinerama_screens[i].x_org, xinerama_screens[i].y_org, + xinerama_screens[i].width, xinerama_screens[i].height, + rect[0], rect[1]);*/ + if (XY_IN_RECT(rect[0], rect[1], + xinerama_screens[i].x_org, xinerama_screens[i].y_org, + xinerama_screens[i].width, xinerama_screens[i].height)) { + curr_screen = xinerama_screen = i; + break; + } + } + } +#endif /* HAVE_LIBXINERAMA */ + winwid->full_screen = !winwid->full_screen; + winwidget_destroy_xwin(winwid); + winwidget_create_window(winwid, winwid->im_w, winwid->im_h); + winwidget_render_image(winwid, 1, 1); + winwidget_show(winwid); +#ifdef HAVE_LIBXINERAMA + /* if we have xinerama and we're using it, then full screen the window + * on the head that the window was active on */ + if (winwid->full_screen == TRUE && + opt.xinerama && xinerama_screens) { + xinerama_screen = curr_screen; + winwidget_move(winwid, + xinerama_screens[curr_screen].x_org, + xinerama_screens[curr_screen].y_org); + } +#endif /* HAVE_LIBXINERAMA */ + case '=': case '+': if (opt.reload < SLIDESHOW_RELOAD_MAX) opt.reload++; =================================================================== RCS file: /cvsroot/enlightenment/misc/feh/src/menu.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -3 -r1.53 -r1.54 --- menu.c 21 Oct 2002 02:53:43 -0000 1.53 +++ menu.c 24 Nov 2002 23:20:38 -0000 1.54 @@ -29,7 +29,6 @@ #include "winwidget.h" #include "filelist.h" #include "options.h" -#include <math.h> Window menu_cover = 0; feh_menu *menu_root = NULL; =================================================================== RCS file: /cvsroot/enlightenment/misc/feh/src/options.c,v retrieving revision 1.144 retrieving revision 1.145 diff -u -3 -r1.144 -r1.145 --- options.c 21 Oct 2002 02:53:43 -0000 1.144 +++ options.c 24 Nov 2002 23:20:38 -0000 1.145 @@ -988,6 +988,7 @@ " p, P, <BACKSPACE>, <LEFT> Goto previous slide\n" " n, N, <SPACE>, <RIGHT> Goto next slide\n" " r, R Reload image (good for webcams)\n" + " v, V Toggle fullscreen\n" " w, W Size window to current image dimensions\n" " h, H Pause the slideshow (only useful when using\n" " s, S Save current image to unique filename\n" |