xzgv-0.9.2/0000755000175000017500000000000013152751677011476 5ustar diegodiegoxzgv-0.9.2/ChangeLog0000640000175000017500000015672113152752546013254 0ustar diegodiegoChanges from 2007-08-01 onwards: see SourceForge git repository. 2005-12-21 Russell Marks * src/main.c (do_logo_invert): fixed previous "*ptr++=255-*ptr", which was obviously not too clever. 2005-12-18 Russell Marks * src/help.c (help_about): updated URL. * src/logoconv.c: another missing string.h. * src/resizepic.c: didn't include string.h previously, and should have. 2005-09-21 Russell Marks * src/readjpeg.c (read_jpeg_file): now supports YCCK/CMYK colourspaces, as can be written by e.g. Photoshop. Thanks to Michael Woerdehoff for pointing out the problem. 2004-12-15 Russell Marks * src/readpng.c (read_png_file): bizarrely, I missed the width/height limit on PNG before. :-( Added it now, thanks to Ludwig Nussel for pointing this out. 2004-11-03 Russell Marks * Added width/height limits to all native picture readers. This is a crude (albeit effective) fix for heap overflow bugs - there may yet be more subtle problems, but I can't really fix them until I know they're there. :-) Thanks to Luke Macken for letting me know about the heap overflow problems (in zgv). I suppose I should also thank "infamous41md" for publishing the original advisory/exploit (again for zgv), even if he didn't bother emailing me or anything. 2003-09-16 Russell Marks * Version 0.8. * src/help.c (help_about): now says what the program does. Which is probably rather obvious, but what the heck. :-) * src/main.c (viewer_expose): fixed long-standing bug with interpolation, which could have resulted in segfaults (though it's hard to say if it ever actually did). * src/rcfile.c (usage_help): removed embedded LFs. * src/readjpeg.c (get_exif_orientation): added support for the Exif orientation tag (Exif in this context is a form of JPEG). If you enable the "Use Exif Orientation" option in the viewer (or `exif-orient' config/option), it'll compensate for the (e.g.) digital camera's orientation when viewing, so pictures taken with the camera side-on will display the way you would probably want them to. However, since this differs from how most *other* programs will see the files - which are, after all, carefully constructed to be compatible with JFIF/JPEG files - and has the potential to be extremely confusing if you don't know exactly what's going on, it's not enabled by default. Thanks to Fraser Wright for suggesting this feature. 2003-07-10 Russell Marks * src/readpng.c (read_png_file): don't set background colour to black for mono PNG files, where this may cause problems. This change was ported from zgv; thanks to Morten Bo Johansen for spotting it there. 2003-04-05 Russell Marks * doc/makeman.awk: fixed some bugs which became apparent when run with gawk 3.1. 2003-02-01 Russell Marks * INSTALL: added report of MacOS X compile, from krisa@subtend.net. 2002-08-22 Russell Marks * src/main.c (selector_key_press): added 9/0 as yet another way of doing file untag/tag. These are last-ditch alternatives for keyboards where -/= don't make sense (some non-US/UK keyboards), and where keypad -/+ aren't easily accessible (e.g. laptops). Thanks to Szabó, Balázs for inspiring this one. 2002-07-25 Russell Marks * src/main.c (main): added call to gtk_set_locale() which should hopefully avoid problems when GTK+'s default font is set to something which isn't ASCII-friendly. Thanks to Alexander Pohoyda for this one. 2002-07-09 Russell Marks * src/main.c (cb_hide_selector): stopped selector getting permanently hidden if two middle-button presses were too close together. Thanks to José Luis González González for spotting this. 2002-03-03 Russell Marks * src/readgif.c (outputstring): broken GIFs could overrun a buffer previously - fixed. 2002-01-16 Russell Marks * INSTALL: added IRIX success report. Thanks to Andreas Backhaus. 2002-01-01 Russell Marks * src/readjpeg.c (read_jpeg_file): fixed post-image corruption bug, so it shouldn't segfault now. (!) Now it should ignore any errors which come after we've got an image (based on the idea that since we do *have* an image, we should display it). Thanks to Aaron Brick for spotting this one. 2001-10-24 Russell Marks * INSTALL: added Solaris success report. Thanks to Sven Goldt for that. [And to Steven Bankowitz, who also reported success.] 2001-09-20 Russell Marks * src/rcfile.c (usage_help): fixed typo. 2001-04-10 Russell Marks * Version 0.7. * src/Makefile: whoops, `-lz' was missing. I usually got away with this, but it did break in some cases (perhaps with Imlib 1.9.10?). Thanks to Gabor Z. Papp for pointing this out (albeit, again, somewhat indirectly :-)). * src/mkopts.awk: there isn't any reason I can't just use stdout for error messages, so do that. * src/updatetn.c (cb_update_tn): this'll be fun to explain. :-) Ok... the non-recursive thumbnail update stops thumbnail reading before doing the update (as does the recursive one, but never mind that). Previously, if you pressed `u' soon enough after the thumbnail-read had started, and only files a long way down in a big directory needed new thumbnails, then you could be left with a mostly-blank set of thumbnails onscreen for (say) a few seconds. It now makes sure all thumbnails in the visible portion of the list are read before it starts, rather like recursive update. * src/backend.c: marking image as uncacheable seems to *very* occasionally lead to a segfault (infrequently enough that I've found this hard to track down), apparently due to unearthing a bug in Imlib1's uncacheable-image code which is (I think) never otherwise used. So we don't do that any more. 2001-04-09 Russell Marks * Added support for PRF (ported from zgv), which is basically a kind of extrapolated version of my old mrf format - unlike mrf, PRF supports greyscale and colour. Thanks to Brian Raiter for both devising the format, and writing the reference implementation readprf.c is heavily based on. * src/mkopts.awk: now detects running under an old awk, and complains about it with a pointer to config.mk. 2001-03-01 Russell Marks * src/main.c: toggling all tags is now possible, with Alt-o or Tagging/Toggle All. * src/main.c: you can now move to the next/previous tagged file with `/' and `?' respectively (or equivalent menu options). When used in the viewer, this also views the file. (init_window): moved `Tag then Next' to new viewer `Tagging' menu. * src/main.c: fix for redraw-related position problem. (In 0.6, try going to the end of the selector's list, pressing `v', then pressing `v' again - the row positioning is slightly wrong.) (init_window): added `Open' to selector `File' menu, and rearranged the menu slightly; moved tagging commands to `Tagging' menu. 2001-02-03 Russell Marks * src/main.c (set_title): no longer includes the version number in the window title, as you can get this from both `xzgv --version' and About on either Help menu. * Added help menus. Currently just runs info on the relevant node, but it's better than nothing I s'pose. :-) 2001-01-16 Russell Marks * Added choice of timestamps to use when sorting in time/date order - you can now choose mtime (default), ctime, or atime. You can switch with alt-shift-m/c/a, or from selector menu's Directory/Time & Date Type submenu, or with `sort-timestamp-type' option/config. Thanks for Wolfram Kleff for suggesting this. * src/main.c (viewer_key_press): you can now use shifted cursor keys as an alternative means of paging up/down/left/right in the viewer. (selector_key_press): any `Menu' key you might have can now be used to show the selector/viewer menus, just as right-clicking or pressing F10 does. 2000-12-28 Russell Marks * src/readtiff.c: didn't need to include rcfile.h. (read_tiff_file): previously flipped the image incorrectly. 2000-12-21 Russell Marks * `make install' now uses slightly more friendly Debian-ish permissions (755 for executable, 644 for docs). 2000-12-15 Russell Marks * src/readgif.c (outputstring): copied new non-recursive outputstring() across from zgv. No real advantage in xzgv, but it saves a gratuitous inconsistency at least. :-) Oh, actually, there is an advantage - this version shouldn't be hangable even with badly broken GIFs. 2000-12-14 Russell Marks * src/main.c (cb_selection): made toggles which could possibly affect the image display (in fact, did just about any which do GTK+ stuff) ignore the toggle attempt if currently loading an image. The main problem this fixes is the weirdness that used to happen after toggling zoom while a picture was loading (particularly when unzooming, and loading a `big' picture). 2000-12-13 Russell Marks * src/readgif.c (decompress): inittable() shouldn't have trusted code size to match numcols. It broke on a certain flavour of unusual and suboptimal, but valid, GIF with less than 256 colours (probably generated by a `broken' encoder). Thanks to Lenart Janos, Josip Rodin, and Chris Lawrence for spotting this and/or pushing the bug report to your friendly neighbourhood upstream maintainer. :-) * src/readjpeg.c (read_jpeg_file): sped things up a bit by reading in a slightly less simplistic manner, and by not doing "fancy upsampling" (doing this previously was the main reason why Imlib1's reader was faster). Combined with the change below, this makes native JPEG reading a teeny bit faster than Imlib1's, so it's now done that way for non-thumbnail use too. Also added `careful-jpeg' option/config, in case you want to leave it enabled (seems to be about a 10% slowdown). * src/backend.c (backend_create_image_from_data_destructively): now properly implemented for Imlib1. The way I've done it is slightly evil, but it speeds things up. ;-) * doc/xzgv.texi (File Type Identification): this bit could probably do with a rewrite, but at least it vaguely resembles reality now. :-) * src/readtiff.c: TIFF reader - uses libtiff. This means yet another library dependancy :-/, but enough people seem to use xzgv with TIFFs that it's probably worth doing properly. 2000-12-10 Russell Marks * src/updatetn.c (update_one_tn): now makes sure a page of thumbnails is visible even when doing non-recursive update - previously doing such an update before all thumbnails had been read in would show blank spots during the update (unlike the now-usual xzgv behaviour of loading onscreen thumbnails asap). This only seems to slow it down fractionally (by about 0.5% in a large dir full of small files in thin-rows mode), so I think it's worth it to get the consistency. 2000-11-24 Russell Marks * INSTALL: added more 0.6 success/failure reports - thanks to Joerg Reuter at SuSE. * src/main.c (viewer_key_press): whoops, I broke alt-a/u from viewer when I added ^a/^u - sorted that out. * src/backend.c: added gdk-pixbuf backend (aimed at 0.9.0). gdk-pixbuf doesn't quite provide everything xzgv needs, and seems rather slower than Imlib1 at rendering *despite* avoiding some unnecessary pixmap creation, so I don't see myself recommending use of this any time soon. Anyway, it's there if you want to try it. It doesn't support flip/mirror/rotate, or any brightness/contrast/gamma changes (I suppose I'll get around to these eventually, but expect them to be *slow* as gdk-pixbuf doesn't provide native facilities for this stuff), and doesn't support as many filetypes as Imlib1 (no fallback I suppose), but the rest is there. 2000-11-23 Russell Marks * src/readjpeg.c: adapted readjpegtn.c so it's usable as a normal JPEG reader too. Unfortunately this seems to be slower than Imlib1 at reading JPEGs :-) (probably because creating Imlib's image from the RGB data involves copying it?), so it's still only used for thumbnails. * src/main.c (cb_delete_file): added `delete-single-prompt' option (cmdline and config file) so you can disable the y/n prompt when deleting a file, rather like zgv's `nodelprompt'. Thanks to Martin Bialasinski for suggesting this. 2000-11-21 Russell Marks * doc/xzgv.texi: case of chars in Alt-x and Ctrl-x forms should now be uniformly lowercase. (File Details): now mentions problem with zgv 5.0/5.1 generating incorrect thumbnail width/height details (5.2 is ok). * src/main.c: many keyboard navigation fixes/additions. Selector and viewer now both support ^u/^v/^a/^e as alternatives to page up/down and home/end. j/k in selector were fixed to behave more like cursor up/down do. 2000-11-20 Russell Marks * src/main.c: concerted attempt to nail all the remaining recursion problems. Now everything which even *thinks* of calling render_pixmap() is protected. :-) This isn't perfect though, as the protections are independent (do a mirror and flip at about the same time, and it'll mess up), so I'll need a better fix eventually. (do_gtk_stuff): this is now a LOT smarter about what to do when thumbnails are being loaded - fixes the bug where (while thumbnails were being loaded) holding down space to storm through N images got it very confused indeed. * doc/xzgv.texi (Renaming a File): it's xzgv not zgv. :-) * src/main.c (load_image): X windows are limited to a maximum size of 32767x32767 pixels, and xzgv uses a GTK+ widget based on an X window for its image. That's not the change, this is - previously, my GIF/PNG/mrf file readers failed to notice the problem larger images would cause, leading to a segfault - they now give an error. (cb_selection): now ensures focus is returned to selector when changing dir, making the pastpos action clearer when using the mouse (i.e. if you go down into a dir and then back up, the keyboard cursor will show which dir you just left). Previously, if you'd viewed an image before changing dir with the mouse, focus would have remained on the image. * src/updatetn.c: recursive thumbnail update no longer reads all thumbnails before doing updates - it now only bothers to read visible thumbnails. This makes the `fast-recursive-update' option rather less useful, as it's nearly that fast already. :-) (cb_update_tn_recursive_confirmed): previously didn't do pastpos stuff to save/restore cursor row `around' recursive update - fixed. 2000-11-17 Russell Marks * Now adapts rendering method for big images. When the number of pixels in the image exceeds the value set by image-bigness-threshold (as set in config file or on command-line, defaulting to 2 million pixels), it's drawn piece-by-piece on demand rather than all-at-once. The all-at-once behaviour is worth keeping around for smaller images, as it gives much nicer scrolling - but for big images it's just impractical, hence this feature. * src/main.c: previously, when you scaled down as far as it would go, it would never let you scale down again in the same way, due to breaking an anti-recursion measure. Fixed that. 2000-11-16 Russell Marks * src/backend.c: wrapper for rendering backend. This is now (apart from the Makefile) the only place with any Imlib1 dependence, so this should make it easier (or rather, slightly less than infinitely hard :-)) to switch backends if I decide to do that, or to support multiple backends (choosing backend at compile time). 2000-11-11 Russell Marks * doc/Makefile: replaced ifeq/ifneq with shell equivalent, which turns out to be sufficient (if uglier). This should avoid the need to use GNU make. Thanks to Frank Pohl for spotting this problem. 2000-11-07 Russell Marks * Changed `install -m' invocations to do plain install and change permissions after (with chmod). Thanks to Steven Bankowitz for reminding me of `-m' being a problem on things like Solaris. 2000-10-29 Russell Marks * src/main.c (init_window): as must be traditional by now, I found a bug almost immediately after the release. :-) Quite a minor one, thankfully. Previously you could still toggle thin-rows while running in the `xzgv file(s)' way, which was silly and made things look strange. Harmless, but fixed now. 2000-10-28 Russell Marks * Version 0.6. 2000-10-27 Russell Marks * src/filedetails.c (make_details_win): file details dialog now works fully even when started with `xzgv file(s)' (previously the details from any thumbnail were missing). 2000-10-26 Russell Marks * src/main.c (cb_selection): before, when you used decoupled scaling and then rotated a picture, it messed up when resetting things for the next picture. Fixed that. (It swapping the scalings inappropriately when setting picture orientation to either 0 or the last picture's state.) (reinit_dir): when rescanning the directory (in the control-r sense :-)), the keyboard cursor now tries to stay at the same place in dir list, for consistency with zgv and because it's just nicer. Thanks to Philippe Marzouk for spotting this one. * TODO: made into an outline to keep the less important stuff from crowding out the things I should really be thinking about. 2000-10-25 Russell Marks * doc/makeman.awk: previously, a one-line paragraph with a formatting-type @-command would merge into the start of the next paragraph. * src/readgif.c (outputchr): was previously broken for interlaced GIFs with less than 4 lines; this broke the heap, leading to difficult-to-pin-down segfaults. * INSTALL: generally updated and tidied up. Also added a section reporting how past versions of xzgv (currently 0.5) have been said to react on certain non-Linux/x86 systems. 2000-10-23 Russell Marks * src/copymove.c: now copes with copy/move when started as `xzgv file(s)'. It's not perfect, in that the selector isn't updated (so after a move things can be confusing), but at least it's usable. * Made icon a bit less indistinct. :-) 2000-10-22 Russell Marks * You can now change the sorting order from the command-line with `-o'/`--sort-order' (and from a config file similarly), which takes a name/ext/size/date (or time) arg (though only the first char is required). * src/rcfile.c: if you omitted the arg to an option in a config file, it would segfault. Fixed that, and applied brown paper bag as appropriate. :-) * src/rcfile.c (usage_help): usage help is now strictly sorted in long-option order. (geom_parse): would previously get stuck in an infinite loop if given a bogus geometry arg. 2000-10-17 Russell Marks * Added my own PNG reader (well, libpng interface :-)), ported from zgv. This avoids the Imlib PNG problems (still present in 1.9.8, the latest version I've checked), such that greyscale PNGs are now read correctly, and you no longer have the `now it's purple, now it's not' problem with partly-transparent PNGs. (Though that does still affect, for example, XPMs.) It also seems to be slightly faster, but only very slightly. So note that you now need to have png.h and pngconf.h available when compiling xzgv (you already needed the *library* for Imlib, but now you need the headers too). 2000-10-10 Russell Marks * doc/makeman.awk: ported over zgv change - previously it didn't output a correct NAME line (it used "-" rather than "\-"). 2000-10-07 Russell Marks * Since I've finally switched to using Emacs's c-mode, after getting the indentation configured correctly with no bugs getting in the way (I hope :-)), I've reindented everything (other than getopt* and install-info.c) with it. The changes are minor, obviously - essentially it's just lining things up a bit more nicely, though some long lines in main.c had to be mangled a bit to keep the line length under 80 chars. 2000-09-30 Russell Marks * src/rcfile.c: get_config() previously assumed $HOME was set. 2000-09-25 Russell Marks * src/main.c: added gamma support, but as with brightness/contrast this is only available from the keyboard for now. The basic idea is to ignore the rather unworkable image/screen gamma distinction, and just use a relative gamma with fast shortcuts for common cases. So pressing `1' gives a gamma adjustment of 1.0 (i.e. no adjustment), `2' gives 2.2 (for e.g. viewing linear-gamma files on an average PC monitor), `3' gives 1/2.2 (~0.45, for e.g. viewing 2.2-gamma files on a linear-gamma display), and `4' reverts to any `--gamma' setting (or 1.0 if none was set). You can also use alt-comma and alt-dot for more precise control of gamma adjustment. Note that gamma is deliberately *not* reset by the brightness/contrast resetting keys. 2000-08-26 Russell Marks * doc/xzgv.texi (Invoking xzgv): --zoom-reduce-only line should have been an `itemx' not an `item'. (Rescanning the Directory): rephrased to avoid awkward repetition of `however'. * Changed `$(MAKE) -C foo bar' in Makefiles to the more portable form `cd foo && $(MAKE) bar'. * Unfortunately doc/makeman.awk really does require gawk (some features of gensub are too difficult to do without), so I've changed the Makefiles such that a prebuilt man page will come with the xzgv tgz. This doesn't make the tgz much larger, and seems a tolerable compromise for coping with gawkless systems. 2000-08-24 Russell Marks * src/Makefile: install-info uses getopt_long(), so it needs to link with getopt.o and getopt1.o to avoid problems on non-glibc systems. Thanks to Steven Bankowitz for the feedback on a Solaris build which lead to this fix (and those below). * src/install-info.c: now uses the bundled getopt.h rather than assuming there's one on the system. * config.mk: added AWK line, so you can specify the awk interpreter to use. (A `new' awk is needed, so gawk is the default, but nawk is another possibility.) This setting doesn't yet apply to doc/makeman.awk, which is currently hardcoded to use gawk since it requires a gawk extension. (One to fix later, I suppose. :-)) 2000-08-17 Russell Marks * Version 0.5. 2000-08-15 Russell Marks * logo.c: whoops, still had a zgv header, fixed that. :-) * TODO: checked up on does-this-still-happen bugs - most do still happen. They're not major ones, I s'pose, but it's enough for the next version to be 0.5 rather than the 1.0 I'd been considering. :-/ * src/main.c: made the thumbnail loading's jumping-about behaviour considerably smarter - it should be pretty optimal now (given the requirement that it jump around to show currently-visible stuff, that is). 2000-08-04 Russell Marks * src/libmmx-990416/mmx.h: fixed so it compiles even with optimisation off, though I can't imagine why you'd compile it like that. :-) Thanks to Gabor Z. Papp for pointing this out (albeit somewhat indirectly). 2000-07-25 Russell Marks * src/gotodir.c: previously, jumping from a large dir to a large dir (or even to a small dir, sometimes) could result in the redrawing of the main window being noticeably delayed after the dir-change window being destroyed - fixed that (mostly). 2000-07-24 Russell Marks * src/main.c: massively reduced *apparent* thumbnail load time, by making it jump around to whichever part of the directory you're currently looking at. :-) (It will eventually fill in any gaps, when you stop moving around for long enough.) 2000-07-13 Russell Marks * src/main.c: added preliminary check when reading files from command-line, to get rid of (at least in most cases) the window-open-then-close ugliness you used to get before a `no files' error message. 2000-07-11 Russell Marks * src/main.c: rows have been made 2 pixels taller, to allow room for the outline cursor to go either side of the thumbnail rather than potentially XORing over it. In addition to being a little more aesthetically pleasing :-), this works around what seems to be a GTK+ bug (as of 1.2.7 at least), where scrolling with the cursor keys can leave part of the XOR'd cursor outline stuck on the thumbnail (I suspect the pixmap is being drawn at the wrong time). The extra pixel lines reduce the number of thumbnails visible at once very slightly, which is unfortunate, but I really think it's necessary. 2000-07-10 Russell Marks * src/main.c: fixed recursion problems in scaling. Thanks to Steven Flintham for reminding me of this, and noting how badly it affected decoupled scaling. 2000-07-04 Russell Marks * src/main.c: anti-clockwise rotation previously didn't swap x/y scaling values, so when using decoupled scaling it screwed up. 2000-06-28 Russell Marks * src/main.c: fixed a significant memory leak, though you probably wouldn't have noticed it unless you did a recursive thumbnail update on a fairly well-populated hierarchy. I have a feeling this fix *may* break older GTK+ versions; if changing directory segfaults, you need to upgrade. :-) It's known to work on at least GTK+ >=1.2.6. 2000-06-27 Russell Marks * doc/xzgv.texi: finally got around to documenting decoupled scaling stuff. :-) * doc/xzgv.texi (Viewer Options): listed keyboard shortcut for zoom-reduce-only was wrong. * src/options.src: added short option `-r' for zoom-reduce-only. It's a useful enough option that it's worth having a shortcut. :-) * src/main.c: added mouse shortcut for decoupled scaling. This is quite a tricky one on the UI front, but the basic idea is that you can scale only one axis directly from the mouse, as it were, with ctrl-click and ctrl-right-click. You can change the axis to scale (default is the Y axis) by using the axis toggle on the viewer options menu (or by pressing alt-c). You can change the default by enabling `mouse-scale-x', on the cmdline or in a config file. 2000-06-08 Russell Marks * src/main.c: added decoupled scaling - you can now scale x and y axes of a picture independently. Thanks to Steven Flintham for suggesting this. It's primarily for fixing aspect ratios on pics intended for viewing with non-square pixels. Interpolation isn't supported when the x scale doesn't equal the y scale. 2000-05-11 Russell Marks * config.mk: changed back to using -O2. It seems this doesn't break anything any more. Presumably I'm now avoiding whatever compiler bug was probably responsible for problems before. :^) 2000-05-06 Russell Marks * src/main.c: clicking on the viewer now moves to the next image. Dragging the picture around still works - any mouse movement at all during the click, and the picture gets dragged instead. (If you want/need to disable this for some reason, you can do so with `click-for-next off' in ~/.xzgvrc.) Thanks to Paul E. Johnson for this idea. 2000-05-03 Russell Marks * src/main.c: previously, if you had auto-hide and zoom turned on, then turned off auto-hide, the picture wasn't rezoomed when the selector was shown - fixed that. * src/libmmx-990416/mmx.h: fixed to work with gcc 2.95.x. Had to remove eax from clobber list in mm_support(), and get rid of some spurious colons after instructions. It now compiles (and seems to work ok) with -DINTERP_MMX on at least three different versions of gcc (thanks to Steven Flintham for testing two of them :-)). 2000-04-23 Russell Marks * Updated email address everywhere (except below). 2000-04-14 Russell Marks * config.mk: now easier to install info file/man page in FHS-friendly PREFIX/share (e.g. /usr/share/man/man1). However, the traditional locations are still the default, as I suspect e.g. /usr/local/share/man/man1 is much less widely accepted than /usr/local/man/man1. If you're installing in /usr, though, uncommenting the SHARE_INFIX line may be a good idea. 2000-03-31 Russell Marks * Version 0.4. * README: removed mrf stuff which I suspect no-one cared about in the first place. (Even I was getting tired of it, and I *use* mrf... :-)) 2000-03-14 Russell Marks * doc/xzgv.texi: documented cut/copy/paste in `goto dir' dialog. * doc/xzgv.texi (Moving Around The List): removed link from after "Mouse-happy types can freely skip it" comment, as it wasn't that useful and would have looked odd in a printed copy... :-) * src/main.c: you can now use j/k for down/up in the selector, as vi-like alternatives to the cursor keys. 2000-03-12 Russell Marks * src/main.c: added brightness/contrast, which works in just the same way as in zgv. No mouse equivalent yet though, as I'm having some difficulty thinking of a reasonable way to do it. (I may even end up (ab)using a modal dialog for it, which would be *odd* but may be the least unreasonable approach given the way xzgv works in general.) I'd ended up putting it off for a while to ponder this, but in the end decided to get it done and add the mousey version later. * src/main.c: now avoids a malloc()/free() for each thumbnail read. I doubt it makes much difference to anything though. 2000-03-08 Russell Marks * INSTALL: updated to reflect MMX change, and asked for feedback regarding portability. * config.mk: disabled INTERP_MMX by default, as libmmx doesn't seem to compile under a newer gcc/egcs, and there was no newer libmmx when I last checked, *and* I can't easily try fixing this myself until I'm running 2.95.* or whatever. :-/ 2000-03-07 Russell Marks * doc/xzgv.texi (Invoking xzgv): de-biased bit which mentioned GNOME in passing to mention both GNOME and KDE, as both are equally valid in context. * src/main.c: 15/16-bit dithering can now be toggled with shift-f, by analogy with zgv's `fakecols' toggle. 2000-03-03 Russell Marks * src/main.c: fixed the problem with toggling zoom off and on quickly, where scrollbars were disabled but an unzoomed image was shown instead of a zoomed one. This was due to recursion in toggle_zoom(), which is now avoided. 2000-02-11 Russell Marks * I now actually bother using my email address for changelog entries. :-) * src/main.c: renamed `Exit viewer' menu item to `Exit to Selector', which should make the meaning less ambiguous. * TODO: slightly tidied up and checked/updated. 2000-02-05 Russell Marks * README: looks like I left this on 0.2 for 0.3, whoops :-) * src/main.c: added file rename. The key it's on is heavily suboptimal (^n), but all the good ones were taken. :-) Menu-wise it's ok though - File/Rename file (by analogy with the delete-single-file one). * src/rename.c: created. 2000-02-03 Russell Marks * src/main.c: file magic tests in load_image() supplied 4 bytes to test, but only bothered testing 3. :-) 2000-01-29 Russell Marks * src/updatetn.c: now avoids the nasty `shear' effect you got when updating thumbnails and it needed to scroll the window before updating a thumbnail. 2000-01-14 Russell Marks * Version 0.3. * src/config.mk: changed CFLAGS to use -O instead of -O2 (I actually did this a few days back); Steven has had weird problems with a recent gcc with -O2, but -O works. (I seem to be ok with (according to `gcc --version') egcs 2.91.66, but it's easier to just throttle back than have it screw up. Besides, all this really does is slow down scaling a bit.) * Removed mention of the forfree.at email address, which seems to be b0rken :-(, and replaced with my actual current address. * INSTALL: removed note about needing getopt_long(). * Added getopt.[ch] and getopt1.c from glibc, so things should hopefully still work on a libc which lacks getopt_long(). 2000-01-10 Russell Marks * src/copymove.c: use pastpos to try and stay in similar place in selector when rescanning dir. It isn't perfect - in particular, if the old row no longer exists it goes to row 0 rather than staying at the end - but it's better than *always* going to row 0. 2000-01-09 Russell Marks * src/copymove.c: added copy/move. These work like zgv - copy/move tagged files if any tagged, otherwise copy/move the file the cursor is on. (Being zgv-like also means they stop if they run across an existing file, which can be a little annoying but is probably safest.) * src/gotodir.c: made cb_ok_button() static. 1999-12-19 Russell Marks * src/main.c: you can now use `-k' or `--skip-parent' (or config file entry) to skip the (keyboard) cursor past `..' on the directory xzgv starts on. This can be useful when you want to immediately use space to `page' through a dir. Thanks to Steven Flintham for this idea. 1999-12-14 Russell Marks * src/main.c: the idle_zoom_resize() idle func is now default priority rather than resize priority. This fixes a problem where zoom mode resizes were one resize behind (!) - thanks to Steven Flintham for pointing this out. Unfortunately this makes `opaque resize' a bit slower, but I think this fix is clearly the Right Thing. 1999-12-13 Russell Marks * doc/makeman.awk: fixed spurious blank line output in middle of @item/@itemx pairs when there was a comment line between them. It's a pretty ugly kludge, but I couldn't really see any other fix which wouldn't break something else. :-/ * src/main.c: scaling can now scale the image *down* as well as up. That is, you can make the image smaller more controllably than you can by using zoom mode. I thought I'd add this as, given the way Imlib works, it comes very cheaply indeed. However, it tends to only be useful (i.e. be any advantage over zoom mode) on big images, where you might want to scale down a bit rather than a lot. One thing I should point out - if you've got used to doing e.g. shift-d lots to get back to 1:1, you'll just have to learn about the `n' (= Scaling/Normal) key... :-) * src/main.c: invert-logo now kludges the bottom/rightmost lines of the logo (which are black in the original, and thus turn white) to be a more appropriate grey. A miswart, essentially - it's horrible, but probably the Right Thing in context. :-) 1999-12-10 Russell Marks * AUTHORS: created. Just points at the main docs, I'm sure a duplicate copy would get out of date. :-) 1999-12-09 Russell Marks * src/main.c: various things which implicitly turned off zoom mode (basically scaling and `normal') didn't reenable scrollbars afterwards; fixed that. 1999-12-08 Russell Marks * src/main.c: new `invert-logo' config file option, flips the colours in the logo to look less awful on dark GTK+ themes. :-) The obvious way to `fix' this is to provide some way of disabling the logo, but at the moment it assumes there's always a picture in the viewer window, so this is a bit hairy. (And I think it looks odd with the viewer window empty, which is the reason I bothered with a logo in the first place!) 1999-12-06 Russell Marks * src/main.c: added MMX-aware version of scaling with interpolation code (using a bundled copy of Hank Dietz/Randy Fisher's libmmx). According to my tests, it's `only' about 35% faster, but it feels like more. :-) See config.mk for details. * src/rcfile.c: you can now set the selector's initial/default width with `--selector-width' (or config file setting). It can only be specified in pixels for the time being, but I should add a percentage option at some point. :-) 1999-11-30 Russell Marks * doc/xzgv.texi (Config Variable Types): added `geometry', which was missing, and corrected previous bit which said all config vars were boolean. 1999-11-22 Russell Marks * Version 0.2. * Made install targets use `mkinstalldirs' (from texinfo) to make paths to installation dirs first. Apparently the FHS guarantees little if anything about /usr/local, so this is basically required rather than merely being a good idea. I've left `mkinstalldirs' non-executable (and run /bin/sh on it directly from the Makefiles), as I don't like the idea of having a single executable file in the top-level dir (some people might think it's like a GNU configure script or whatever, and run it :-)). 1999-11-16 Russell Marks * src/main.c: some fixes to avoid unwanted recursion when e.g. space is being held down. There still seem to be problems with this when you're really hammering it though (space held down for a long time in a dir with many small images). 1999-11-13 Russell Marks * src/main.c: now have a reduce-only option for zoom mode, meaning you can have xzgv fit big pictures to the window without having tiny icons etc. balloon up and look horrible. It's not the default, but you can enable it with Alt-r or the viewer options menu's "When Zooming Reduce Only" toggle or `--zoom-reduce-only' or equivalent config file setting. Thanks to Steven Flintham and Robert Braddock for this idea. 1999-11-12 Russell Marks * doc/xzgv.texi (Invoking xzgv): missed out `geom' arg after `-g' previously, fixed that. 1999-11-06 Russell Marks * doc/xzgv.texi (Acknowledgements): added a credit for `install-info', which *seems* to have been largely written by Karl Berry, though it's not terribly clear (e.g. the initial change log entry is by RMS, but it just says "new file" or similar, so I'm assuming he didn't do a great deal :-)). 1999-11-04 Russell Marks * src/main.c: fixed bug where, if you enabled zoom on a picture of nearly the same shape as the viewer window, it left the scrollbars on. 1999-11-03 Russell Marks * src/main.c: you can now set whether to use 15/16-bit dithering or not independent of Imlib's default setting. The option is Options/Dither in 15 & 16-bit (guess who's using item_factory :-)) on the viewer menu, and can also be set by --dither-hicol or equivalent config file setting. 1999-11-01 Russell Marks * src/rcfile.c: added `-g'/`--geometry' option (and config file setting), which lets you set the xzgv window's geometry in the usual X fashion. As an extension, all positions/sizes can be given as percentages of the screen size - for example, the default geometry is `92%x85%'. 1999-10-31 Russell Marks * src/main.c: no longer keeps saying "Reading file..." on statusbar if a file couldn't be read. * src/main.c: error dialogs now use an Ok button a third the width of the window, so they look a bit more like the other dialogs. * src/updatetn.c: made recursive update require confirmation. There's some annoyance value to this, I suppose, but I think it's justified. It really *can* take a long time, after all, and the dialog also explains what `recursive update' actually means; I think this is useful as it's a term some non-programmers are unlikely to be very familiar with. * src/main.c: added file delete (with confirmation), as File/Delete and ctrl-d. I couldn't seem to figure out how to get it bound to Delete (and the hairy and somewhat religious Backspace/Delete mapping area is probably best avoided anyway). I did consider putting it on shift-d like in zgv, but I thought the clash with shift-d as used in the viewer made this potentially a bad idea. (Also, ctrl-d has a `delete' meaning in various other things (e.g. Emacs), while shift-d is probably only used for this by zgv.) * src/confirm.c: generic confirmation (yes/no) dialog. 1999-10-27 Russell Marks * Added recursive thumbnail update. One problem with this is that it reads all existing thumbnails in a dir before updating (like xv, IIRC) to try and avoid having a really ugly selector during the update :-), though you can disable this with `--fast-recursive-update' or an equivalent config file line. * src/updatetn.c: moved thumbnail-update stuff here, and removed extra GTK+ update from makexv332(), which was causing problems (it usually segfaulted if you destroyed the main xzgv window while updating thumbnails). 1999-10-26 Russell Marks * src/main.c: now copes with being started in an unreadable dir, and avoids selecting files/dirs it doesn't have sufficient permissions for. 1999-10-25 Russell Marks * src/main.c: you can now tag an image while viewing (like in zgv) by doing ctrl-space (not like in zgv :-)). Also on viewer menu after next/previous image. * src/resizepic.c: added a similar speedup which should work for any file type - it's not quite as fast as the JPEG approach, which is only really applicable to JPEGs, but it speeds things up a *lot* for non-JPEGs. It does mean that thumbnails for dithered images don't usually look as good as before, but you could probably argue that this makes them more faithful. :-) (Ok, I realise this could be annoying, so this speedup will probably become optional at some point...) * src/readjpegtn.c: custom JPEG loader for thumbnails, makes them as fast to generate as in zgv (well, curiously, it works out faster in xzgv for, uh, `technical reasons' :-)). The code which actually makes things faster was contributed to zgv by Costa Sapuntzakis. 1999-10-24 Russell Marks * doc/xzgv.texi: hacked to reflect recent changes. * src/main.c: you can now `close' a file (clear the viewer, returning to the startup logo). * src/gotodir.c: `go to dir' dialog. (Only text-entry for now (!), but I'll probably extend it at some point.) Changed Sort Order menu items to be `Sort by Name' etc. under new `Directory' menu to accomodate this as Directory/Change (also on G (zgv-like)). Added Directory/Rescan (^R) while I was at it. :-) * src/main.c: error dialog looked weird before, doesn't look as weird now. :-) 1999-10-23 Russell Marks * src/main.c: Esc now exits an error dialog (making it consistent with the other ones). * src/filedetails.c: `file details' dialog - selected by File/Details or (as in zgv) `:'/`;'. Includes width/height from thumbnail, if present. (Thumbnails from versions of zgv before 5.0 didn't include this - you may to delete your old thumbnails and `update' if you find that a problem. Note that thumbnails generated with xzgv/xv/Gimp should be ok.) * src/main.c: right-clicking on the selector to get the menu now also moves the focus row (keyboard cursor) to the file you right-clicked on (and switches focus to the selector). This should give us a way of doing single-file operations (well, those other than viewing) with the mouse, without needing to sacrifice the IMHO very nice single-click-to-view behaviour. 1999-10-20 Russell Marks * Replaced the directory/file-without-thumbnail icons with nicer ones. They're loosely based on gmc's `dir-close.xpm', which I think Tuomas Kuosmanen was responsible for (judging from the change log). Thanks also to Steven Flintham for pointing out that the old icons were pretty crap. :-) 1999-10-19 Russell Marks * Bothered giving it a half-decent logo. :-) Also has a similar icon. * src/main.c: thumbnail updates now make sure any row a thumbnail is being updated for is visible, making the update look more like it does in zgv - as well as making it rather more clear what's going on. :-) (The old position is restored when the update is finished.) 1999-10-03 Russell Marks * src/main.c: made middle-click on the viewer toggle the selector rather than always acting like Exit viewer. Thanks to Steven Flintham for suggesting this. * src/main.c: previously segfaulted on files less than 4 bytes long due to a typo. Um, whoops... :-} 1999-09-30 Russell Marks * src/readgif.c: shouldn't hang on some corrupt GIFs now. This change reflects the one in zgv 5.0, and thanks go to Andy Mortimer for the fix (to zgv, but it (currently) applies to xzgv too). 1999-09-27 Russell Marks * doc/xzgv.texi: corrected a couple of typos. 1999-09-14 Russell Marks * src/main.c: now has tagging - `-' untags, `=' tags, and with Alt (Meta) they untag/tag all. As for the mouse, ctrl-click tags/untags, and there's now a File menu (might become Tagging or similar, haven't really made up my mind) which has items for tag/untag all. No way of tagging from the viewer currently, though, and at the moment nothing at all takes any notice of whether a file is tagged or not. :-) (Also, you can't tell if a file is tagged if it's also selected!) 1999-09-12 Russell Marks * src/main.c: pixmaps for dirs and thumbnailless pics are now shaped, rather than having an ugly white background. * src/main.c: another focus-row bug fixed - when the selector lost focus due to selecting a picture, it didn't undraw the focused row. (This isn't very obvious with the default GTK+ theme, but it really shows up with e.g. Rasterman's `pixmap' one.) This was due to my disabling can-focus *before* changing focus (whoops). * src/main.c: fixed problem where xzgv's moving the focused row `by hand' sometimes messed up the display. 1999-09-08 Russell Marks * doc/makeman.awk: previously the last output line of a paragraph was never escaped, meaning it would most likely be lost if it began with a dot (this mangled the first paragraph of the `Updating Thumbnails' node). 1999-09-02 Russell Marks * doc/xzgv.texi (Updating Thumbnails): fixed fixed double double word word. :-) 1999-08-14 Russell Marks * Version 0.1. * doc/xzgv.texi: cleaned up - mainly a matter of updating a few bits, and removing all the zgv stuff which doesn't yet apply (for as-yet-unimplemented stuff like brightness/contrast, tagging, slideshows... the list goes on :-)). * Various cmdline/config options added, so that all runtime options can now have defaults messed about with. :-) 1999-08-09 Russell Marks * src/main.c: previously render_pixmap() didn't bother checking if theimage was NULL (i.e. if no picture was loaded), which broke e.g. `xzgv --zoom *.jpg'. * Rearranged things to give a more zgv-like directory layout, things were getting a bit confusing with all sorts packed into one dir. * rcfile.c: ok, it was deeply hairy, but I've converted zgv's option-parsing and config-file-reading code and (the hairy part) added long-option support, making long-option names and config file variable names the same, and having stuff only defined once. I thought I'd be able to use some cpp trickery to get this working, but I ended up using an awk script. :-/ 1999-08-08 Russell Marks * main.c: finally have keyboard control over relative window sizes (paned widget). `[' moves splitter left, `]' moves it right, with ctrl+[ and ctrl+] moving in smaller steps. `~' returns selector to default size, as well as unhiding it. * main.c: cursor-key equivalents of the small hjkl movements added; ctrl-cursor moves 10 rather than 100 pixels. * main.c: fixed bug where any viewer exposure after a failed-picture-load caused a segfault. (!) I think the code changes I needed for scaling probably teased this one out, as that works with the imlib image itself, rather than a pixmap rendered by it. 1999-08-05 Russell Marks * doc/xzgv.texi: created, based on zgv's zgv.texi. Pretty scrappy for now, but at least I've started. :-) 1999-08-04 Russell Marks * main.c: thumbnail column now matches maximum possible thumbnail width, making thin rows mode look a *lot* better. * main.c: menus popped up with F10 now appear in more reasonable places (top-left of the subwindow they were popped up from). * main.c: you can now iconify (minimise) the window with ^Z. I also put it on the menu, which might be handy if you're running fullscreen and don't know what a keyboard is. :-) Also moved `hide selector' to the new `window' menu created primarily for minimise. * main.c: rearranged some menu items - in particular, shifted all viewer toggles onto an `options' menu. It looked ugly with the options littering otherwise `normal' menus, and I'm not sure that (e.g.) having zoom on the scaling menu was all that smart to begin with. :-) * main.c: fullscreen option (start with `-f'). Uses the entire screen with no window frame or anything (if your wm recognises the decor hints - I think they're mwm ones, but fvwm handles them, meaning that most wm's around today do :-)). I tried having it as a run-time option, but it was just too evil trying to `switch back' from fullscreen, and I never got it entirely working. 1999-08-02 Russell Marks * main.c: now has the full range of revert stuff from zgv. This has been streamlined a little to make sense in the largely modeless xzgv, so now you only have the revert-orientation option, but it's on the viewer menu so the effect of zgv's saved-orientation stuff isn't too hard to duplicate. * main.c: now supports scaling, interpolation and all. :-) Since keeping a scaled-up image in memory would take up a LOT of room (we're talking hundreds of megs, even gigs - work it out), the scaling has to be done on the fly, so it's a bit slow even on (what I would consider to be) a fast machine. But hey, at least it's there, and nothing's any slower when you're not using it. * main.c: thumbnail update now updates pixmaps in selector directly. This is more efficient than the old behaviour, and has the additional advantage that you can get to see thumbnails even if you don't have permission to write them (though you'd have to do an update every time you revisited the dir!). * main.c: couldn't-load-file errors now go in dialog rather than on stderr. :-) They also result in the selector being shown, useful if you ran xzgv on pics from the command-line. 1999-08-01 Russell Marks * main.c: made thin rows mode considerably more useful by maintaining a separate rescaled thumbnail. This is only rescaled crudely (a take-every-nth-pixel approach), but it works surprisingly well. 1999-07-31 Russell Marks * main.c: selector now has zgv-like goto-next-char on g and '. Like in zgv, there's no indication that it's waiting for a char, so I've made it timeout after two seconds in case of accidental presses and the like. (Strictly speaking it doesn't *wait* for the char; the initial g or ' just sets a flag.) * main.c: F10 now pops up the right-button menu (in both the selector and the viewer). You can now also use Enter (well, actually Return) instead of Space as an alternative way of selecting a pic. * main.c: markedly improved keyboard support in viewer by handling keypresses directly. This is a bit kludgey really, but given that keyboard movement is now quite faithfully zgv-like, I think it's worth it. :-) Had to move hide-selector to shift-z (the idea being it's a bit like zoom but in a different sense) to make room for hjkl; while I was at it, I changed hide to really be a hide/unhide toggle. 1999-07-28 Russell Marks * main.c: bugfix after trying it on my 486 - it wasn't giving GTK+ a chance to run after creating the `Updating Thumbnails' window until after the first file's thumbnail had been checked/updated, leaving the window briefly blank. (Since the first file is almost always `..', it takes very little time to deal with (as dirs don't have thumbnails), so much so that I hadn't noticed this delay at all on cartman.) 1999-07-27 Russell Marks * main.c: now supports loading picture(s) from command-line. Works by faking up a selector `directory' containing them, and hiding the selector. * main.c: can now explicitly hide selector from viewer. Probably more useful than auto-hide mode for most people, I'd have thought; you might find having the selector visible fine generally, but still occasionally need the full window for a big image. * main.c: finally, has create/update thumbnails. Also added `pastpos' stuff from zgv, which remembers where you were when you last left a previously-visited directory. * main.c: viewer now uses pixmap background. This causes some difficulties (which I've mostly managed to work around - er, I hope :-)), but makes scrolling much easier on the eye. Also disabled "Reading thumbnails" messages by default and added option to enable them. 1999-07-25 Russell Marks * main.c: middle button now does `exit viewer', like Esc (and equivalent menu option). Handy when in auto-hide mode. * main.c: added auto-hide mode. Rather nice for those of us running in relatively low resolutions. :-) However, since I reckon you're unlikely to want it if you're running in 800x600 or greater, and since it can be a little confusing, I've resisted the temptation to make it the default. 1999-07-24 Russell Marks * main.c: cleaned up some early kludgey stuff - in particular, removed the long-gone quit button (which until now was merely not shown, ouch :-)). It's still fairly kludgey in parts, but one thing at a time eh... * main.c: fixed `losing' of current selection and focus row (the keyboard cursor) when sort order is changed. Also fixed the focus to match selection in this case, and in the other cases where it was previously a problem (next/prev image, and thin rows toggle). 1999-07-23 Russell Marks * Kludged around apparently-buggy imlib GIF support (in v1.9.5 at least) by adding my own GIF support, via readgif.c and wrapper mentioned below. Hopefully this will only be a temporary kludge until imlib gets fixed. :-) PNGs with few colours also have problems, but that's not so easy to work around, unfortunately. (Rather, it is in theory, but PNG is a much harder format to read; readgif.c is only about 400 lines.) * main.c: now has next/previous image in viewer (on space and b rather than zgv's space and del, as a) del/backspace issues are non-trivial in X and b) I couldn't get del to work :-)). * Added mrf support via readmrf.c and wrapper for gdk_imlib_load_image(). This is probably the only way mrf support would get added, as imlib only seems to support the most popular formats `natively'. * main.c: finally you can change dir once it's started. :-) Also added custom sorting routine (so dirs come first, thank ghod for that), and different sorting orders (as in zgv). * main.c: loads of changes. Fixed memory leak the size of a planet (50 meg X server, anyone? :-)), made image draggable with the mouse, added right-button menus for both selector and viewer, added `thin rows', `status bar' and `zoom' options, and probably lots more I can't remember right now. 1999-07-22 Russell Marks * First, really crap version. (Several more really crap versions to follow. :-)) xzgv-0.9.2/doc/0000750000175000017500000000000013152752606012227 5ustar diegodiegoxzgv-0.9.2/doc/makeman.awk0000640000175000017500000002244213152752546014354 0ustar diegodiego#!/usr/bin/gawk -f # # makeman - make xzgv man page from texinfo file. # Public domain by Russell Marks. # # Requires gawk (it uses `gensub' (gawk only?) and `[:blank:]' (POSIX)). # # Note that this *IS NOT* a general texinfo to man page converter. # It only supports the bare minimum required by xzgv.texi. # It could probably be generalised to cope with most stuff though. # BTW, I'm serious about that "bare minimum" bit - if I use more stuff # in xzgv.texi, this is likely to need fixing to cope with it. :-) BEGIN \ { last_was_blank=1 exit_val=0 print ".\\\" *** Auto-generated by makeman, *edits will be lost*! ***" print ".\\\"" print ".\\\"" } function do_header() { # man page header print ".TH XZGV 1 \"" var_value["UPDATED"] "\" " \ "\"Version " var_value["VERSION"] "\" \"Graphics Software\"" print ".SH NAME" print "xzgv \\- picture viewer for X, with thumbnail-based file selector" print ".\\\"" print ".SH SYNOPSIS" print "xzgv [\\fIoptions\\fR] [\\fIdir\\fR | \\fIfile\\fR ...]" } END \ { print ".SH AUTHOR" print "Russell Marks and others;" print "see the section \\fBACKNOWLEDGEMENTS\\fR for details." print ".PP" print ".SH \"SEE ALSO\"" print ".BR zgv \"(1),\"" print ".BR xv \"(1),\"" print ".BR cjpeg \"(1), \" djpeg \"(1),\"" print ".BR pbm \"(5), \" pgm \"(5), \" ppm \"(5),\"" print ".BR mrf \"(5)\"" # should be last thing exit exit_val } function add_line_to_para(line) { if(para=="") { para=line } else { para=para "\n" line } } # output para, splitting at LFs as we go in order to escape dots. function output_para( lhs) { while(para ~ /\n/) { lhs=gensub(/^([^\n]*)\n.*/, "\\1", "g", para) para=gensub(/^[^\n]*\n(.*)/, "\\1", "g", para) # if it begins with .[^A-Z], escape the dot so troff ignores it. # The assumption is that this catches things like ".xvpics", # while leaving things like ".PP" alone. # The \f. bit is so it catches them after a font-change too # (curiously, dot-commands seem to count even after that!). # We have to allow .br though, which complicates it. :-/ # # We assume no lines start with ' (which isn't handled here). # if(lhs ~ /^(\\f.)?\.[^A-Z]/ && lhs !~ /^\.br/) { # it's such fun escaping a dot in troff :-((( # @-cmds have been dealt with by now, so /^@/ should be unlikely. print ".cc @\n" lhs "\n@cc ." } else print lhs } # XXX ugly duplication here, should restructure so I don't need this # lhs=para if(lhs!="") { if(lhs ~ /^(\\f.)?\.[^A-Z]/ && lhs !~ /^\.br/) { print ".cc @\n" lhs "\n@cc ." } else print lhs } } # first, keep copy of previous line available. { prevline=curline_orig; curline_orig=$0 } /@c(omment)?\>/ \ { sub(/@c.*/,"") if($0=="") { # that's right, this *is* a revolting kludge... :-) # (it's a special-case hack to avoid gaps in @item/@itemx pairs where # there's a comment in-between the two) if(prevline ~ /^@item[^x]/) { last_was_blank=1 } next } } /^\\input texinfo\>/ { next } /^@ifinfo\>/,/^@end ifinfo\>/ \ { next } /^@ignore\>/,/^@end ignore\>/ \ { next } /^@menu\>/,/^@end menu\>/ \ { next } /^@author\>/ { next } /^@bye\>/ { next } /^@example\>/ { in_example++; next } /^@end example\>/ \ { in_example-- last_was_blank=1 add_line_to_para(".PP") next } # section headings # we ignore the `unnumbered' ones, assuming they are indexes. /^@(chapter|section|subsection|subsubsection)\>/ \ { sec_name=gensub(/^@[a-z]*[[:blank:]]*([^[:blank:]]+)/, "\\1", "g") # fix some headings to make them man-page-like sub(/^Overview/,"DESCRIPTION",sec_name) sub(/^Invoking xzgv/,"OPTIONS",sec_name) # chapter/section headings are in caps and are main headings (SH), # subsection/subsubsection aren't, and are subheadings (SS). if(/^@(chapter|section)/) { print ".SH \"" toupper(sec_name) "\"" } else { print ".SS \"" sec_name "\"" } if(sec_name=="DESCRIPTION") { print "(NB: This man page is automagically generated from xzgv's" print "texinfo file, and so may look a bit odd." print "We apologise for the inconvenience. :-))" print ".PP" } next } # various tables /^@v?table\>/ \ { table_lvl++; table_type[table_lvl]=$2 first_item[table_lvl]=1 is_itemize[table_lvl]=0; next } /^@itemize\>/ \ { table_lvl++; table_type[table_lvl]=$2 first_item[table_lvl]=1 is_itemize[table_lvl]=1; next } /^@end (v?table||itemize)\>/ \ { table_lvl-- add_line_to_para(".RE") was_tableend=1 next } /^@itemx?\>/ \ { itemx=/^@itemx\>/ if(!table_lvl) { print "makeman:" NR ": @item outside of @table" >"/dev/stderr" exit_val=1 next } if(is_itemize[table_lvl]) { $0=table_type[table_lvl] "{}" } else { $0=gensub(/^@itemx?[[:blank:]]+(.*)/, \ (first_item[table_lvl]?"":".RE\n") \ table_type[table_lvl] "{\\1}\n.RS", 1) } first_item[table_lvl]=0 # cope with there not being any blank lines between last item's text # and next @item. The regexp checks the last line wasn't an @item. # if(!last_was_blank && prevline !~ /^@itemx?\>/) { was_item=1 } } /^@set\>/ \ { valname=$2 var_value[valname]=$3 i=4 while($(i)!="") { var_value[valname]=var_value[valname] " " $(i) i++ } next } /^@titlepage\>/ \ { # given the way xzgv.texi is laid out, we know VERSION and # UPDATED must be set now. do_header() } # ...but ignore the titlepage stuff apart from that. /^@titlepage\>/,/^@end titlepage\>/ \ { next } # these ones are ignored /^@[ckfv]index\>/ { last_was_blank=1;next } /^@contents\>/ { next } /^@dircategory\>/ { next } /^@direntry\>/ { next } /^@end\>/ { next } /^@node\>/ { next } /^@page\>/ { next } /^@printindex\>/ { next } /^@setchapternewpage\>/ { next } /^@setfilename\>/ { next } /^@settitle\>/ { next } /^@subtitle\>/ { next } /^@title\>/ { next } /^@top\>/ { next } /^@unnumbered\>/ { next } /^@vskip\>/ { next } (/^$/ && !last_was_blank) || was_item || was_tableend \ { # before printing the paragraph, fix attribute-ish stuff (e.g. @samp{foo}). # XXX nasty special-case hack to handle @-cmd within @-cmd :-( # @var{dir|file} -> italic dir|file para=gensub(/@var\{(dir|file)\}/, "\\\\fI\\1\\\\fR", "g", para) # the one footnote used at the time of writing isn't very # important (it's in the File Format Depths node), and I generally # try to avoid footnotes as they're not handled that well in Info, # so we just drop any footnotes. para=gensub(/@footnote\{.*\}/, "", "g", para) # @value while(/@value\{/) { valname=gensub(/.*@value\{([^}]+)\}.*/, "\\1", 1, para) para=gensub(/@value\{([^}]+)\}/, var_value[valname], 1, para) } # @{samp,file,var,cite,emph,indicateurl} -> italic para=gensub(/@(samp|file|var|cite|emph|indicateurl)\{([^}]+)\}/, "\\\\fI\\2\\\\fR", "g", para) # @email{foo@@bar} -> # (this assumes there's an @@ in it!) para=gensub(/@email\{(.*)@@([^}]+)\}/, "<\\1@\\2>", "g", para) # @strong -> bold para=gensub(/@strong\{([^}]+)\}/, "\\\\fB\\1\\\\fR", "g", para) # @{code,kbd} -> bold in quotes para=gensub(/@(code|kbd)\{([^}]+)\}/, "`\\\\fB\\2\\\\fR'", "g", para) # @bullet -> bold `o' # XXX this is crap :-) para=gensub(/@bullet\{([^}]*)\}/, "\\\\fBo\\\\fR \\1", "g", para) # @minus -> bold `-' # XXX also crap... para=gensub(/@minus\{([^}]*)\}/, "\\\\fB\\-\\\\fR \\1", "g", para) # @asis -> normal para=gensub(/@asis\{([^}]*)\}/, "\\1", "g", para) # @dots{} -> ... para=gensub(/@dots\{\}/, "...", "g", para) # hairy hack to support five-arg form of @pxref para=gensub(/@pxref\{([^,]+),([^,]*),([^,]*),([^,]+),([^,]*)\}/, \ "see \\\\fB\\1\\\\fR in the \\\\fI\\4\\\\fR info file", "g", para) # XXX none of @pxref/@xref/@ref uppercase their args yet :-/ # @pxref{foo} -> see FOO (with FOO in bold) para=gensub(/@pxref\{([^}]+)\}/, \ "see \\\\fB\\1\\\\fR", "g", para) # @xref{foo} -> See FOO (with FOO in bold) para=gensub(/@xref\{([^}]+)\}/, \ "See \\\\fB\\1\\\\fR", "g", para) # @ref{foo} -> FOO (with FOO in bold) para=gensub(/@ref\{([^}]+)\}/, \ "\\\\fB\\1\\\\fR", "g", para) # finally, a bit of a kludge - replace "\fBInvoking xzgv\fR" with # "\fBOptions\fR", assuming it's in a @pxref/@xref/@ref. para=gensub(/\\fBInvoking xzgv\\fR/, "\\\\fBOptions\\\\fR", "g", para) # if it still contains { or }, we probably missed something - say so. if(para ~ /[\{\}]/) { print "makeman:" NR ": warning: output paragraph contains a brace" \ >"/dev/stderr" exit_val=1 } output_para() para="" print ".PP" last_was_blank=1 if(was_item) { add_line_to_para($0) } was_item=0 was_tableend=0 next } /^[^@]/ || /^@(file|samp|code|var|cite|emph|strong)/ { last_was_blank=0 } # otherwise... !/^$/ \ { # if there's one we haven't handled, complain (but keep going). # This only checks for start-of-line ones; the {/} check in the # paragraph-output routine should catch any others. if(/^@[a-z]+\>[^\{]/) { print "makeman:" NR ": unhandled texinfo command in this paragraph!" \ >"/dev/stderr" exit_val=1 } add_line_to_para($0) if(in_example) { add_line_to_para(".br") } } xzgv-0.9.2/doc/Makefile0000640000175000017500000000251413152752546013675 0ustar diegodiego# Makefile for xzgv docs # This gets definitions for INFODIR, MANDIR, etc. include ../config.mk all: info man pdf info: xzgv.info.gz pdf: xzgv.pdf xzgv.info.gz: xzgv.texi makeinfo --no-split xzgv.texi gzip -9f xzgv.info # `-c' removes the huge number of associated files created by TeX. # This saves doing a `make clean' from hell. :-) xzgv.pdf: xzgv.texi @echo "=== NB: If you don't want A4 paper, edit config.mk! ===" texi2pdf -c $(USE_A4_DEF) xzgv.texi # This explicitly mentions `gawk' because makeman requires it # (and can't easily be made not to, since it really does need gensub). # To avoid problems on gawkless systems, a prebuilt xzgv.1 is included # in the source tgz. # man: xzgv.1 xzgv.1: xzgv.texi makeman.awk @echo 'Making man page from xzgv.texi...' LANG= gawk -f makeman.awk xzgv.1 installdirs: /bin/sh ../mkinstalldirs $(INFODIR) $(MANDIR) install: installdirs install xzgv.1 $(MANDIR) install -m 644 xzgv.info.gz $(INFODIR) install-info --infodir=$(INFODIR) xzgv.info.gz uninstall: $(RM) $(MANDIR)/xzgv.1 $(RM) $(INFODIR)/xzgv.gz install-info --remove xzgv.info.gz # This *doesn't* remove the Info files, which should stick around to # be included in the distribution. Ditto for the man page, since # building it requires gawk. clean: $(RM) *~ xzgv.pdf realclean: clean $(RM) xzgv.1 xzgv.info.gz xzgv-0.9.2/doc/xzgv.texi0000640000175000017500000031711013152752546014127 0ustar diegodiego\input texinfo @c -*-texinfo-*- @c %**start of header @setfilename xzgv.info @settitle The xzgv manual @setchapternewpage odd @c %**end of header @c To make an Info file from this, do `make info'. @c To make a DVI file from this (usually for printing), do `make dvi'. @set VERSION 0.9 @set UPDATED 9th August 2017 @c XXX could do with a general discussion of the window layout @c (selector on left, viewer on right, splitter (w/`handle') determining @c relative size), to add to `a note on notation' section (which would @c presumably then need renaming). @c Most categories seem to suffer from being too specific, making them @c effectively useless; hopefully this one is at least nicely generic. @c This is `ifinfo' to stop texi2{html,roff} seeing it, as they don't @c handle it. @ifinfo @dircategory Graphics Utilities @direntry * xzgv: (xzgv). A picture viewer for X, with a thumbnail-based file selector. @end direntry @end ifinfo @c Some notes on the use of indexes here: @c - The keystroke index is used for keys, but called the `keyboard @c commands index'. @c - The function index is used for menu items. @c - The variable index is used for config file entries, as that's @c pretty much what they are. @c Texinfo's way of handling copyright messages is, to say the least, @c bloody awful. You have to have the whole lot twice. (I'm not sure I can @c think of a better way, but that's not the point. :-)) @ifinfo The xzgv manual, for version @value{VERSION}, last updated @value{UPDATED}. Copyright 1999-2001 Russell Marks. Copyright 2007 Reuben Thomas. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. @ignore Permission is granted to process this file through TeX and print the results, provided the printed document carries a copying permission notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. @end ifinfo @titlepage @title xzgv @subtitle A picture viewer for X, with thumbnail-based file selector @subtitle version @value{VERSION} @author Russell Marks and Reuben Thomas @c The following two commands start the copyright page. @page @vskip 0pt plus 1filll Copyright @copyright{} 1999-2001 Russell Marks. Copyright @copyright{} 2007 Reuben Thomas. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. @end titlepage @ifinfo @node Top, Overview, (dir), (dir) @top The xzgv manual xzgv is a reasonably full-featured picture viewer for X, with a thumbnail-based file selector. (xzgv uses the GTK+ libraries.) It can read most file formats. This documentation is for xzgv version @value{VERSION}, last updated @value{UPDATED}. @menu * Overview:: A simple look at how to use xzgv. * Acknowledgements:: Who did what. * Invoking xzgv:: Command-line options. * A Note on Notation:: How keys and menu items are shown. * The File Selector:: How to pick files to view, and more. * The Viewer:: What you can do when a picture is onscreen. * File Formats:: Issues related to the way picture files are stored. * Configuring xzgv:: You can change aspects of xzgv's behaviour. * Rationale:: The thinking behind certain things. * Bugs and Restrictions:: Problems with xzgv, and how to report bugs. * Future Changes:: Pending ideas for xzgv features etc. --- Indexes --- * Keyboard Commands Index:: What various keys do in xzgv. * Menu Item Index:: An index of the popup menus. * Configuration Variables Index:: Settings in xzgv's config file(s). * Concept Index:: General index of topics covered. @end menu @end ifinfo @node Overview, Acknowledgements, Top, Top @comment node-name, next, previous, up @chapter Overview @cindex introduction to xzgv @cindex overview xzgv is a picture viewer for X, with a thumbnail-based file selector. The thumbnails used (thumbnails being small `preview' versions of the pictures) are compatible with xv, zgv, and the Gimp. The kinds of pictures xzgv allows to be viewed are raster-format pictures (sometimes called `bitmaps' and/or `pixmaps'); things like GIF files, JPEG files, PNG files, and so on. Most of the time, you will probably want to use xzgv's file selector (@pxref{The File Selector}) to pick which file(s) to view. This is what appears on the left-hand side of the window when you start xzgv as just @code{xzgv} (@pxref{Invoking xzgv}). It displays a list of subdirectories and picture files in the current directory, along with small `thumbnail' versions of the pictures if they exist. (If no thumbnails appear in a given directory, or if they are missing for some files, you can create/update them by pressing @kbd{u}. @xref{Updating Thumbnails}.) When you've picked a file to view, you can view it by clicking on it, or pressing @kbd{Enter}. This reads the picture and displays it in the right-hand part of the window, the viewer (@pxref{The Viewer}). You can then move around the picture (if it is larger than will fit) by dragging it with the mouse, or using the scrollbars, or the cursor keys. You can then select another image with the file selector (though you need to press @kbd{Esc} or @kbd{Tab} first if using the keyboard), or you can quit xzgv by pressing @kbd{q}. While xzgv works much like any other X program, and is certainly mouse-friendly :-), it's also designed to be keyboard-friendly. Everything in xzgv can be done entirely from the keyboard. Much of this keyboard support works like the original zgv (a similar console-based picture viewer for Linux). This overview is, as you might expect, only the very simplest of introductions to what xzgv can do, and describes only a very basic use of xzgv. xzgv can do a lot more; read on to find out what. @node Acknowledgements, Invoking xzgv, Overview, Top @comment node-name, next, previous, up @chapter Acknowledgements @cindex acknowledgements @cindex credits @c first, direct (or direct-ish :-)) xzgv contributions: xzgv was primarily written by Russell Marks, also the author of this manual. It is maintained by Reuben Thomas, who ported it to Gtk+ 2. Costa Sapuntzakis contributed code for much faster JPEG thumbnail generation (to zgv, which I adapted for xzgv). The directory/file icons used were loosely based on gmc's @file{dir-close.xpm}. I think Tuomas Kuosmanen was responsible for that, judging from the change log. @code{mkinstalldirs} is straight from the @code{texinfo} package, and was written by Noah Friedman. (This is also used during installation.) @c now libraries etc.: Huge thanks go to the many people responsible for GTK+, without which xzgv would almost certainly not have happened. (But no thanks for Electric Eyes, which was nearly nice enough for me not to bother with xzgv at all! :-)) @file{getopt*.[ch]} are from the GNU libc. @node Invoking xzgv, A Note on Notation, Acknowledgements, Top @comment node-name, next, previous, up @chapter Invoking xzgv @cindex invoking xzgv @cindex starting xzgv @cindex running xzgv @cindex command-line options @cindex options, command-line @cindex arguments, command-line @c NB: no `command-line args' since you'll see `command-line options' if @c you look for that. @c some for `xzgv file', `xzgv dir' @cindex starting on given directory @cindex directory, starting on given @cindex viewing only one file @cindex file, viewing only one @cindex picture, viewing only one @c for --geometry @cindex geometry, specifying the window @cindex size, changing initial window @cindex dimensions, changing initial window @cindex position, changing initial window @cindex location, changing initial window @c for --selector-width @cindex initial selector size, specifying @cindex default selector size, specifying @cindex size, changing default selector Normally you'd invoke xzgv as plain @code{xzgv} (perhaps via a window manager menu, or GNOME/KDE menu, etc.). However, you can directly specify files to view, or a start directory, on the command-line. In addition, there are various options. (If you're new to xzgv, you should probably skip the rest of this section for now and come back to it later.) The general format of the xzgv command-line goes roughly like this: @example xzgv [@var{options}] [@var{dir} | @var{file} ...] @end example Two types of options are supported --- the traditional Unix single-letter options, and GNU-style long options. Most options can be used in either way, and both forms are listed in the table below. Note that all options are processed after any configuration file(s). Config file settings are just like the long-option names below minus the @code{--} (@pxref{Configuring xzgv}), though a few command-line options are not permitted as config file settings (e.g. @code{help}), and vice versa. Here's what the options do: @table @code @item -a @vindex auto-hide @itemx --auto-hide Automatically hide selector when a picture is selected, allowing the viewer to use the whole window. @vindex careful-jpeg @item --careful-jpeg Enable libjpeg `fancy upsampling'. xzgv defaults to using the faster method; as the libjpeg documentation puts it, ``The visual impact of the sloppier method is often very small.'' @vindex delete-single-prompt @item --delete-single-prompt (Note that this is normally enabled; use @code{--delete-single-prompt=off} to disable it.) If @emph{disabled}, xzgv will immediately delete a file when told to, without prompting for confirmation. (It's @code{single} because deleting multiple files at once will be supported in future, and that will have a separate prompt override.) @vindex dither-hicol @item --dither-hicol Use dithering in 15/16-bit, whatever the default setting is. @xref{Viewer Options}, for a discussion of benefits/drawbacks. You can also use @code{--dither-hicol=off} to disable this. @vindex exif-orient @item --exif-orient In JPEG files, use Exif orientation tags (inserted by e.g. digital cameras) to correct image orientation before display. @xref{Viewer Options}, for details. @vindex fast-recursive-update @item --fast-recursive-update When doing a recursive thumbnail update, don't read existing thumbnails before updating. This is pretty much obsolete as of xzgv 0.7, as the speed increase is now negligible. But, it may still be useful if you want to update a @emph{huge} number of small directories for which few if any updates are needed. @item -f @vindex fullscreen @itemx --fullscreen Run fullscreen, using the entire screen for xzgv's window, without even any window-manager decorations (window frame, title bar, etc.) if possible. @item -g @var{geom} @vindex geometry @itemx --geometry @var{geom} Set the xzgv window's geometry (position and/or size) to @var{geom}. The geometry string should be in the usual X format, with the extension that positions/sizes may have a @code{%} suffix meaning that they are treated as percentages of the screen width/height. The default geometry is @code{92%x85%}. @c not using @var below because it produces lowercase italics in TeX @c output, which is nasty in this context IMHO. For those unfamiliar with the way `geometry' works, here's a brief description of the syntax. It's @code{WxH}, or @code{+X+Y}, or @code{WxH+X+Y}, where @code{W} is width, @code{H} height, @code{X} the x position, and @code{Y} the y position. The first form specifies only the size, the second only the position --- the @code{WxH+X+Y} form specifies both. Now, the @code{+X+Y} bit normally specifies where the top-left of the window is. But you can use @code{-} instead of @code{+} for the x and/or y position, in which case it specifies the gap between the right/bottom of the window and the right/bottom of the screen. (Note, however, that any window frame your window manager adds to the window is disregarded in this calculation, so you may need to experiment somewhat to get the desired position.) You can also use negative numbers with both @code{+} and @code{-} --- so @code{+-50+0} puts the window partly off the left of the screen, and @code{+0--50} puts it partly off the bottom of the screen --- but this is of questionable value. :-) Finally, as mentioned above, xzgv extends this syntax by allowing you to use @code{%} to specify percentages of the screen width/height rather than pixels, e.g. @code{50%x30%-30%-20%}. It also allows you to use real numbers such as @code{12.34}, which can be useful with @code{%}. @item -h @c not config var @itemx --help Display a list of options and a terse description of what the options do. @vindex image-bigness-threshold @item --image-bigness-threshold @var{numpix} Set the boundary @var{numpix} after which images are considered `big', and are no longer rendered all-at-once (which gives much nicer scrolling, but is harder on memory and can be slow for big images) but are instead rendered piece-by-piece. Units are number of pixels in image (i.e. width times height), and the default is 2000000 pixels. @item -i @vindex images-only @itemx --images-only Shows only directories and image file types in the selector, identified by their extensions. @vindex interpolate @item --interpolate Interpolate between the picture's pixels when scaling up (@pxref{Scaling}). This usually looks nicer, but it's rather slow. @vindex mouse-scale-x @item --mouse-scale-x If enabled, control-clicking on the viewer scales only the X axis. (The default is to scale only the Y axis.) @vindex revert-orient @item --revert-orient (Note that this is normally enabled; use @code{--revert-orient=off} to disable it.) If @emph{disabled}, orientation (flip/mirror/rotate) state is retained between pictures (@pxref{Viewer Options}). @vindex revert-scale @item --revert-scale (Note that this is normally enabled; use @code{--revert-scale=off} to disable it.) If @emph{disabled}, scaling is retained between pictures (@pxref{Viewer Options}). @vindex selector-width @item --selector-width Set the default/initial size of the selector in pixels. The normal setting is 200. @item -T @c not config var @itemx --show-tagged Show names of currently-tagged files on exiting xzgv. (They're listed to stdout, one per line.) This can be useful when you want to select multiple files graphically and work on them with something else. @vindex show-thumbnail-messages @item --show-thumbnail-messages Show on the status bar when thumbnails are being read. The status bar must be enabled for these messages to be visible, of course. :-) @item -k @vindex skip-parent @itemx --skip-parent For the first directory shown, skip the cursor past @file{..} (the parent dir). This can be useful when you'd like to immediately use space to `page' through the dir. @item -o @var{order} @vindex sort-order @itemx --sort-order @var{order} Set the initial sorting order used in the selector. Possible settings are @code{name}, @code{ext}, @code{size}, and @code{date} (or @code{time}); only the first char of the setting (@code{n}/@code{e}/@code{s}/@code{d}/@code{t}) need be given. The default is name order. @vindex sort-timestamp-type @item --sort-timestamp-type @var{type} Set the timestamp type to use when using time/date sorting order. Possible settings are `mtime' (default), `ctime', and `atime'; only the first char of the setting (@code{m}/@code{c}/@code{a}) need be given. @vindex statusbar @item --statusbar Show a status bar below the selector; this, for example, says when a picture is being read. @item -t @vindex thin-rows @itemx --thin-rows Use rows a third the normal height in the selector. This can be very useful on lower-resolution screens, or if you're really interested in filenames, not thumbnails. @item -v @c not config var @itemx --version Show version number. @c not config var @item --version-gtk Show version number of GTK+ xzgv is using. @item -z @vindex zoom @itemx --zoom Fit picture to viewer window, whatever its actual size (@pxref{Zoom Mode}). @item -r @vindex zoom-reduce-only @itemx --zoom-reduce-only When in zoom mode, only @emph{reduce} pictures to fit; i.e. make big pictures viewable all-at-once while leaving small picures intact. @item -p @vindex zoom-panorama @itemx --zoom-panorama When in zoom mode, adjust only the most proportional dimension to fit, and allow scrolling on the other dimension; i.e. like a @emph{fit page width} option in PDF readers, but not limited to horizontal adjusting. @end table If started with @code{xzgv @var{files}}, xzgv hides the file selector and treats the file or files as if they were the sole contents of a directory. (It also automatically loads the first file.) As such, you can use the Next Image and Previous Image commands to navigate between the images, or do Exit to Selector and use the selector directly. If started with @code{xzgv @var{start-dir}}, xzgv starts up as usual, but with the selector starting on the directory specified (rather than the current directory). Settings which are either on or off (boolean) are, as you might expect, enabled by using e.g. @code{-z} or @code{--zoom}. However, there's an alternative long-option form for setting these, resembling how they're set in config files --- the syntax is @code{--option=@var{state}}, where @var{state} is @code{on}/@code{y}/@code{yes}/@code{1} to enable the option, or @code{off}/@code{n}/@code{no}/@code{0} to disable it. The most useful thing about this is that it allows you to disable options which were previously enabled, by using e.g. @code{--zoom=off}. (Readers used to the way GNU-style long options work should note that, since this @code{on}/@code{off}/etc. arg is optional, you can't use the @code{--option arg} form in this case; it must be @code{--option=arg} for it to work.) @node A Note on Notation, The File Selector, Invoking xzgv, Top @comment node-name, next, previous, up @chapter A Note on Notation @cindex notation used in this manual @cindex conventions used in this manual @cindex menu item descriptions, format of @cindex format of menu item descriptions @cindex help on this manual's notation Much of this manual is taken up by a description of xzgv's various commands in its file selector and viewer. Most of these are available both from the keyboard, and from popup menus. (A popup menu appears when you press @kbd{F10} or @kbd{Menu}, or right-click on the selector or the viewer; each has its own menu.) So in the manual, you will often see things rather like this: @table @kbd @item key @itemx Selector menu, Menu the item is in, Menu item Description of what the key/menu item does. @end table Sometimes the key given has a @kbd{(Selector)} or @kbd{(Viewer)} suffix; this is because some keypresses in xzgv are specific to the selector or the viewer, and won't work unless the relevant part of xzgv has the keyboard focus. @node The File Selector, The Viewer, A Note on Notation, Top @comment node-name, next, previous, up @chapter The File Selector @c XXX could do with synonyms for `selector' here... @cindex file selector @cindex the file selector @cindex selector Usually, on starting up xzgv, you'll want to use the file selector --- the list of files on the left. (The other subwindow (on the right) is the viewer.) The selector lets you pick files to view (among other things). It lists the subdirectories and picture files in the current directory, along with small `thumbnail' versions of the pictures if they exist. @menu * The Selector Menu:: Right-click on the selector to see its menu. * Exiting xzgv:: Why would you want to? :-) * Thumbnails:: How to create thumbnails, and how they work. * Selector Layout and Resizing:: The file selector lists dirs/files, and can be resized if you find it too large/small. * Moving Around The List:: How to see all of the list, and how to move the keyboard cursor. * Viewing a File:: How to view a single file. * Dialog Boxes:: How xzgv reports errors and asks you things. * Closing a File:: Closing files is unnecessary, but it does clear the viewer subwindow. * File Details:: Showing a file's size, date/time, etc. * Tagging:: You can tag (mark) multiple files, then copy/move them. * Renaming a File:: Renaming a single file or directory. * Deleting a File:: Redirecting a file to the great bit bucket in the sky. * Changing Directory:: As well as the normal dir-by-dir way, you can jump directly to a directory. * Rescanning the Directory:: Updating xzgv's view of a directory's contents. * Changing the Sorting Order:: Files can be sorted by name, `extension', size, and date/time. * File Selector Options:: Some selector-related options can be changed while xzgv is running. @end menu @node The Selector Menu, Exiting xzgv, The File Selector, The File Selector @comment node-name, next, previous, up @section The Selector Menu @cindex selector menu, getting the @cindex menu, getting the selector @cindex getting the selector menu @cindex showing the selector menu @cindex online help @cindex help @cindex menus, help @kindex F10 (Selector) @kindex Menu (Selector) Almost all selector commands are available from the selector's pop-up menu, which appears when you right-click anywhere on the selector. (You can also press @kbd{F10} or @kbd{Menu} to bring up the menu, but as there are keyboard shortcuts for just about everything in xzgv, this isn't often that useful. :-)) Usually, it doesn't matter where on the selector you right-click. However, a few commands on the @samp{File} menu operate on a single file, the one selected by the keyboard cursor. A problem when using the mouse, you might think --- but when you right-click on the selector, as well as popping up the menu, xzgv moves this cursor to the file you right-clicked on (if any). (You can see this by the way a hollow box is drawn around the file.) So to use e.g. @samp{Details} on the @samp{File} menu, you need to right-click @emph{on the file you want details on}. Both the selector and viewer have `Help' menus, most items of which refer you to this manual: @table @kbd @kindex F1 @item F1 @findex Selector menu, Help, Contents @itemx Selector menu, Help, Contents @findex Viewer menu, Help, Contents @itemx Viewer menu, Help, Contents View the manual's overall contents. @findex Selector menu, Help, The File Selector @item Selector menu, Help, The File Selector View the manual's section on the file selector. @findex Viewer menu, Help, The Viewer @item Viewer menu, Help, The Viewer View the manual's section on the viewer. @findex Selector menu, Help, Index @item Selector menu, Help, Index @findex Viewer menu, Help, Index @itemx Viewer menu, Help, Index View the manual's concept index. @findex Selector menu, Help, About @item Selector menu, Help, About @findex Viewer menu, Help, About @itemx Viewer menu, Help, About Give some brief information about xzgv, including the version number and homepage. @end table Currently, the way xzgv lets you read the manual is a bit crude; it runs the @code{info} program (@pxref{Top,,,info-stnd,Standalone info program}) in an @code{xterm}. @node Exiting xzgv, Thumbnails, The Selector Menu, The File Selector @comment node-name, next, previous, up @section Exiting xzgv @cindex exiting xzgv @cindex quitting xzgv @cindex leaving xzgv @cindex xzgv, exiting You can exit xzgv either by using one of two exit keypresses, or by selecting the appropriate option from the selector's popup menu: @table @kbd @kindex q @item q @kindex Ctrl-q @itemx Ctrl-q @findex Selector menu, Exit xzgv @itemx Selector menu, Exit xzgv Quit xzgv. @end table @findex Selector menu, File, Exit (There's also an exit option on the selector's @samp{File} menu (@code{Selector menu, File, Exit}), as `Exit' is generally on any File menu.) @node Thumbnails, Selector Layout and Resizing, Exiting xzgv, The File Selector @comment node-name, next, previous, up @section Thumbnails @cindex thumbnails @cindex picture thumbnails @cindex file thumbnails @cindex xv-compatible thumbnails @cindex Gimp-compatible thumbnails (This section is deliberately early on in the manual, as thumbnails are probably the most important feature of the file selector, so it's best that you know how to create/update them sooner rather than later.) Thumbnails are small versions of the pictures they represent, and are displayed by the file selector if they exist. xzgv uses xv-compatible thumbnails --- if you create thumbnails with xv they will work with xzgv, and vice versa. xzgv's thumbnails are also compatible with the Gimp, and zgv. If no thumbnail exists for a file, a small `document' icon appears instead (similar to the `folder' icon used for directories). @menu * Updating Thumbnails:: How to create or update thumbnails. * Thumbnail Issues:: Thumbnails are read `in the background', and need 256 colours to be shown correctly. @end menu @node Updating Thumbnails, Thumbnail Issues, Thumbnails, Thumbnails @comment node-name, next, previous, up @subsection Updating Thumbnails @cindex updating thumbnails @cindex creating thumbnails @cindex making thumbnails @cindex thumbnails, creating @cindex thumbnails, updating @cindex directory, updating thumbnails in a @cindex recursively, updating thumbnails @cindex tree, updating all thumbnails in a directory While thumbnails can be made relatively quickly, it's by no means an instant process. For this reason, thumbnails have to be created in advance, and are stored as files in their own right in a subdirectory @file{.xvpics}. xzgv never creates/updates thumbnails without you telling it to. So, if you enter a directory where the picture files don't have any thumbnails, or where the thumbnails seem to be out of date, you should press @kbd{u}, or select @samp{Update Thumbnails} from the selector's menu. (Even if the thumbnails can't be written (say, if you don't have permission to write them), the selector will still show the updated thumbnails until you leave the directory.) Alternatively, you can create/update thumbnails for the current directory and all subdirectories by using @kbd{Alt-u} or @samp{Recursive Update}. But be warned that a recursive update can take some time! @table @kbd @kindex u @item u @findex Selector menu, Update Thumbnails @itemx Selector menu, Update Thumbnails Create thumbnails for any files which don't have them, and update thumbnails which are older than the corresponding file. While this is going on, a window appears showing how far through the process xzgv is. While the update is in progress, you can abort it by clicking on the @samp{Cancel} button, or pressing @kbd{Esc} or @kbd{Enter}, or by clicking the delete-window button (if your window manager provides one) on the title bar. xzgv will stop once it has finished the thumbnail it is currently working on (if any). @kindex Alt-u @item Alt-u @findex Selector menu, Recursive Update @itemx Selector menu, Recursive Update Create/update thumbnails for all files in the current directory and all subdirectories. This can take some time, so you are prompted to confirm you really want to do this (@pxref{Dialog Boxes}). Progress is indicated in much the same way as for a normal update, but only for the directory currently being updated --- the overall progress is not indicated, other than by the current dir being (as ever) displayed in the main window's title. You can abort a recursive thumbnail update in the same ways as for a normal update (see above). @c a reference to the next node is pretty dire, but if I say `next @c node', how would that look in a printed copy? :-/ By default, xzgv behaves a little oddly when doing a recursive update, to give some consistency with the normal update. @xref{Thumbnail Issues}, for details. @end table @node Thumbnail Issues, , Updating Thumbnails, Thumbnails @comment node-name, next, previous, up @subsection Thumbnail Issues @c XXX could do with one here which doesn't start "thumbnails" :-) @cindex thumbnails, issues relating to @cindex thumbnails, problems with displaying @cindex recursive update, problem with @cindex tree, problem with updating directory Dealing with thumbnails can be `interesting' at times, and there are a few ways this influences things: @itemize @minus @item xzgv doesn't read the thumbnails in a directory all at once. Instead, it just reads the directory contents, then starts up what is effectively a kind of background task to read in the thumbnails. So xzgv may not be quite as responsive as usual for a short time after entering a directory with many thumbnails (say, a few hundred) --- but on the other hand, at least it @emph{is} responding. :-) @item The `background task' makes a special effort to show thumbnails for the files currently visible in the selector first, no matter how much you move around the list, but it reads them all in eventually. @item The thumbnails used in xzgv require 256 colours to display. This can be a problem if you're running X in 256 colours or less as, even if you're running an 8-bit (256 colour) server, there will almost inevitably be fewer colours available. Currently, xzgv just uses whatever gdk reports as the closest match to each individual colour used in thumbnails. This gives a tolerable result on 8-bit servers, assuming gdk was able to allocate a large number of colours; however, it gives terrible results if it couldn't, or if running on 4-bit or 1-bit servers. Sorry about this --- it should be fixed in future (either by using gdk to draw the thumbnail pixmaps, or by dithering them `by hand' to suit the colours available). @item Finally, when doing a recursive thumbnail update, xzgv (by default) reads existing thumbnails in a directory before updating any. Or rather, it reads thumbnails for those files currently visible in the selector. This can slow things down very slightly, but keeps the `look and feel' consistent with the normal update. (Still, you can disable this with the @code{--fast-recursive-update} command-line option (@pxref{Invoking xzgv}) or equivalent config file entry (@pxref{Configuring xzgv}).) @end itemize @node Selector Layout and Resizing, Moving Around The List, Thumbnails, The File Selector @comment node-name, next, previous, up @section Selector Layout and Resizing @cindex selector layout @cindex layout, selector @cindex file selector, layout of @cindex resizing selector/viewer @cindex size, changing selector/viewer @cindex changing relative sizes of selector/viewer @cindex normal size, returning selector to The file selector is simply a list of subdirectories and filenames, along with any thumbnails that exist for them. The list is normally in asciibetical order (but you can change this; @pxref{Changing the Sorting Order}). Names of directories are shown first, and they are shown in order at the beginning of the list, before all the picture files. Long filenames may not fit in the visible part of the file selector display; if so, there will be a horizontal scrollbar you can use to see the rest of the name(s) (you can use cursor left/right to do this from the keyboard). The list is very often larger than can fit on the screen at once. If this is the case, only part is shown at a time, but you can move around the list using the (vertical) scrollbar, or with cursor up/down and the like. If you find the selector window to be too small vertically, and would like to see more files at once, you can start xzgv fullscreen by using the @samp{-f} option (@pxref{Invoking xzgv}), and/or use `thin rows' mode (@pxref{File Selector Options}). If you find the selector too small (or too big) horizontally, you can change this by moving the splitter line's `handle' (a small square button between the selector and viewer, near the bottom of the window), which changes the relative sizes of the selector and viewer. You can move it by dragging it with the mouse, or with these keys: @table @kbd @kindex [ @item [ Move the window split left. @kindex Ctrl-[ @item Ctrl-[ Move the window split left more slowly. @kindex ] @item ] Move the window split right. @kindex Ctrl-] @item Ctrl-] Move the window split right more slowly. @kindex ~ @item ~ Reset the window split to its default position. @end table You can also set the initial/default size of the selector --- in effect, the position of the window split --- using @code{--selector-width} (@pxref{Invoking xzgv}) or the config file option @code{selector-width}. @node Moving Around The List, Viewing a File, Selector Layout and Resizing, The File Selector @comment node-name, next, previous, up @section Moving Around The List @cindex moving around the file list @cindex file selector, moving around @cindex file selector, cursor movement in @cindex keyboard, moving around the selector via @cindex cursor, file selector @cindex choosing a file @cindex selecting a file @cindex picture, selecting This section is mainly for those of us more inclined to the keyboard side of the force. :-) Mouse-happy types can freely skip it. When the selector has the keyboard focus, the cursor (or in GTK+ jargon, the `focus row') is normally shown as a hollow box around one of the list's rows. This serves the following functions: @itemize @minus @item It selects a file for view commands to operate on. @item It determines which part of the list is shown, as the part of the list shown onscreen always contains the cursor (unless you move around using the mouse). @end itemize There are several commands for moving the cursor. In summary, most `special' keys like the cursors do what you'd imagine they do, but in more detail: @table @kbd @kindex Cursor Up (Selector) @item Cursor Up @kindex k (Selector) @itemx k Move up. @kindex Cursor Down (Selector) @item Cursor Down @kindex j (Selector) @itemx j Move down. @kindex Page Up (Selector) @item Page Up @kindex Ctrl-a (Selector) @itemx Ctrl-u Move the cursor back roughly a page. @kindex Page Down (Selector) @item Page Down @kindex Ctrl-v (Selector) @itemx Ctrl-v Move the cursor forward roughly a page. @kindex Ctrl-Home (Selector) @item Ctrl-Home @kindex Ctrl-a (Selector) @itemx Ctrl-a Move the cursor to the start of the list. @kindex Ctrl-End (Selector) @item Ctrl-End @kindex Ctrl-e (Selector) @itemx Ctrl-e Move the cursor to the end of the list. @kindex g (Selector) @item g @kindex ' (Selector) @itemx ' Move the cursor to the first filename starting with the next key pressed, which would generally be a letter or number. Case is significant; @kbd{a} and @kbd{A} are different. If no key is pressed within 2 seconds, the command is cancelled. If no files start with the specified character, it moves to the first file which starts with a later char (in asciibetical order). If there are none for which this is the case, it moves to the last file --- unless there are no files (just directories), in which case it has no effect. @end table @node Viewing a File, Dialog Boxes, Moving Around The List, The File Selector @comment node-name, next, previous, up @section Viewing a File @cindex viewing a file @cindex file selector, viewing a file from the @cindex picture, viewing a To view a file from the selector, you can click on it, or press @kbd{Enter} after moving the cursor to the relevant file, or right-click on the file and choose `File' then `Open'. @table @kbd @kindex Enter (Selector) @item Enter @itemx Left-click-on-file @itemx Selector menu, File, Open View the chosen picture file, or if a subdirectory is chosen, make that the current directory. @end table @xref{The Viewer}, for details of how the viewer works. @node Dialog Boxes, Closing a File, Viewing a File, The File Selector @comment node-name, next, previous, up @section Dialog Boxes @cindex dialog boxes @cindex messages @cindex errors @cindex directory dialog If xzgv has a serious problem reading a file, it will give an error. Errors are shown in dialogs which appear in the middle of the screen --- they stay there until you click @samp{Ok} (or press @kbd{Enter} or @kbd{Esc}). xzgv also uses similar dialog boxes for other things: @itemize @minus @item Getting confirmation that you want to do something. @kbd{Enter} or @kbd{y} picks `yes'; @kbd{Esc} or @kbd{n} picks no. (Again, you can click on the relevant button with the mouse to do the same.) @item Showing progress when updating a thumbnail. This is a slightly unusual dialog, in that it automatically disappears when the update is complete. However, it does provide a @samp{Cancel} button which you can click to abort the update (pressing @kbd{Enter} or @kbd{Esc} does the same). @item Reading a directory name. Here you should type the directory name then click @samp{Ok} (or press @kbd{Enter}), or click @samp{Cancel} (or press @kbd{Esc}) to abort. The text-input `widget' used allows a certain amount of editing, including these keys: @table @kbd @kindex Cursor Left (Dir dialog) @item Cursor Left @kindex Ctrl-b (Dir dialog) @itemx Ctrl-b Move the cursor left. (A vertical bar shows the cursor position.) @kindex Cursor Right (Dir dialog) @item Cursor Right @kindex Ctrl-f (Dir dialog) @itemx Ctrl-f Move the cursor right. @kindex Home (Dir dialog) @item Home @kindex Ctrl-a (Dir dialog) @itemx Ctrl-a Move the cursor to the start of the line. @kindex End (Dir dialog) @item End @kindex Ctrl-e (Dir dialog) @itemx Ctrl-e Move the cursor to the end of the line. @kindex Backspace (Dir dialog) @item Backspace @kindex Ctrl-h (Dir dialog) @itemx Ctrl-h Delete char to the left of the cursor. (Note that @kbd{Backspace} is (usually) the key above the main @kbd{Enter} key; it is often labelled simply as an arrow.) @kindex Delete (Dir dialog) @item Delete @kindex Ctrl-d (Dir dialog) @itemx Ctrl-d Delete the char the cursor is on. @end table You can also set the X selection (by selecting text with the mouse, or holding @kbd{Shift} while moving the cursor) to allow pasting text into other programs, and you can cut/copy/paste text in the usual ways: @table @kbd @kindex Shift-Delete (Dir dialog) @item Shift-Delete @kindex Ctrl-x (Dir dialog) @itemx Ctrl-x Cut text. @kindex Ctrl-Insert (Dir dialog) @item Ctrl-Insert @kindex Ctrl-c (Dir dialog) @itemx Ctrl-c Copy text. @kindex Shift-Insert (Dir dialog) @item Shift-Insert @kindex Ctrl-v (Dir dialog) @itemx Ctrl-v Paste text. @end table You can paste text from (some) other programs using the latter command, too. @end itemize @node Closing a File, File Details, Dialog Boxes, The File Selector @comment node-name, next, previous, up @section Closing a File @cindex closing a file @cindex file, closing a @cindex clearing the viewer @cindex viewer, clearing the Usually, when you view a file, the viewer subwindow keeps displaying it until you view a different file. However, if you `close' the file, the viewer stops displaying the file and returns to its initial state. @table @kbd @kindex Ctrl-w @item Ctrl-w @findex Selector menu, File, Close @itemx Selector menu, File, Close `Close' the currently-viewed file, clearing the viewer subwindow. @end table @node File Details, Tagging, Closing a File, The File Selector @comment node-name, next, previous, up @section File Details @c This is a bit severe, but there are so many ways of thinking about it... @cindex file details @cindex details on a file, getting @cindex showing file size, date, etc. @cindex size, showing a file's @cindex date, showing a file's time and @cindex time, showing a file's date and @cindex modification date/time, showing a file's @cindex last-modified date/time, showing a file's @cindex dimensions, showing a file's @cindex width/height, showing a file's @cindex height/width, showing a file's @cindex zgv, problem with pre-5.2 versions of The listing the selector gives for a file is pretty sparse --- just the filename and (if the file has one) the accompanying thumbnail. While this does keep things simple, you sometimes want to know how much space a file takes up, when it was last modified, the dimensions of the image, that kind of thing. So, you can show details of a single file using the `file details' command: @table @kbd @c Since colons aren't allowed in index entries, saying `colon' is @c pretty much the best I can do. :-/ @kindex colon (Selector) @item : @kindex ; (Selector) @itemx ; @findex Selector menu, File, Details @itemx Selector menu, File, Details Show various details about the file pointed to by the keyboard cursor. @xref{The Selector Menu}, for how to choose the file details are given for when using the mouse. (Basically, you right-click on the file when popping up the menu.) @end table Most of the details shown come from the OS (by using the @code{stat(2)} system call), and should always be available unless you have limited permissions for the directory the file is in. The file dimensions (width/height), however, come from the file's thumbnail. If it doesn't have one, or if it's unreadable, or if it has one and it's readable but it doesn't mention the original image's width/height, then the @samp{Details from thumbnail} area is greyed out. (In explanation of the latter point --- pre-5.0 versions of zgv did not generate width/height comments in thumbnails, so zgv users in particular may find the width/height details missing. (xzgv has always been ok, though, it's just zgv which had this problem.) Worse yet, versions 5.0 and 5.1 generated them with incorrect sizes for most JPEGs. To fix either problem for a given directory, do @code{rm -fr .xvpics} in that dir from a shell prompt and recreate the thumbnails with zgv 5.2 or later, or xzgv/xv/Gimp.) @node Tagging, Renaming a File, File Details, The File Selector @comment node-name, next, previous, up @section Tagging @cindex tagging @cindex files, tagging @cindex marking files @cindex selecting multiple files @cindex multiple files, selecting @cindex file, selecting more than one The file selector is not restricted to working on one file at a time. You can `tag' as many (or as few) files as you wish, and certain commands described in this section will act on them. Initially, all files are untagged, and the filenames usually appear in black (though this depends on the GTK+ theme you're using). Tagged files appear in red. @c XXX @c (@xref{File Selector Config}, if you'd prefer zgv to use @c different colours.) @menu * Tag and Untag Commands:: Selecting multiple files. * Moving Between Tagged Files:: Finding the files once they're tagged. * Copying/Moving Files:: Simple file management. @end menu @c XXX @c * Slideshows:: How to view them all in turn. @node Tag and Untag Commands, Moving Between Tagged Files, Tagging, Tagging @comment node-name, next, previous, up @subsection Tag and Untag Commands @cindex tag and untag commands @cindex tagging, how to use There are several ways to tag or untag files. The keyboard-based ones which work on individual files (also available on the @samp{Tagging} menu) move the cursor down one row afterwards, to make tagging or untagging multiple files easier. To tag or untag a single file with the mouse, control-click (i.e. hold down the control key and click) on the relevant filename or thumbnail in the selector. It's true that you could use @samp{Tag} and/or @samp{Untag} on the @samp{Tagging} menu (@pxref{The Selector Menu}, for how to choose the file tagged/untagged when doing it this way), but this is usually much less convenient than using control-click. (The menu entries for those are really just for completeness.) There is also a command available in the viewer to tag the currently-viewed file. @xref{Changing Picture}, for details. @table @kbd @kindex = (Selector) @item = @kindex + (Selector) @itemx + @kindex Keypad + (Selector) @itemx Keypad + @kindex 0 (Selector) @itemx 0 @findex Selector menu, Tagging, Tag @itemx Selector menu, Tagging, Tag Tag file. @kindex - (Selector) @item - @kindex Keypad - (Selector) @itemx Keypad - @kindex 9 (Selector) @itemx 9 @findex Selector menu, Tagging, Untag @itemx Selector menu, Tagging, Untag Untag file. @kindex Alt = (Selector) @item Alt = @kindex Alt-Keypad + (Selector) @itemx Alt-Keypad + @kindex Alt-0 (Selector) @itemx Alt-0 @findex Selector menu, Tagging, Tag All @itemx Selector menu, Tagging, Tag All Tag all files. @kindex Alt - (Selector) @item Alt - @kindex Alt-Keypad - (Selector) @itemx Alt-Keypad - @kindex Alt-9 (Selector) @itemx Alt-9 @findex Selector menu, Tagging, Untag All @itemx Selector menu, Tagging, Untag All Untag all files. @kindex Alt-o (Selector) @item Alt-o @findex Selector menu, Tagging, Toggle All @itemx Selector menu, Tagging, Toggle All Toggle all tags. This inverts the tagged state, so that all previously tagged files become untagged, and all previously untagged files become tagged. @end table @c XXX Currently there is no way to toggle a (single) file's tag state from the keyboard. @node Moving Between Tagged Files, Copying/Moving Files, Tag and Untag Commands, Tagging @comment node-name, next, previous, up @subsection Moving Between Tagged Files @cindex files, moving between tagged @cindex tagged files, moving between @cindex next tagged file These commands let you search for (move to) the next or previous tagged file (if any). Note that `next' and `previous' here are relative to the keyboard cursor's position; if you use these from the menu, be careful to right-click on the file you want to start the search from. @table @kbd @kindex / (Selector) @item / @findex Selector menu, Tagging, Next Tagged @itemx Selector menu, Tagging, Next Tagged Move to next tagged file in dir. @kindex ? (Selector) @item ? @findex Selector menu, Tagging, Previous Tagged @itemx Selector menu, Tagging, Previous Tagged Move to previous tagged file in dir. @end table Equivalent commands are also available in the viewer (@pxref{Changing Picture}). @node Copying/Moving Files, , Moving Between Tagged Files, Tagging @comment node-name, next, previous, up @subsection Copying/Moving Files @cindex copying files @cindex moving files @cindex files, copying @cindex files, moving @cindex pictures, copying @c one for us Rush fans... @cindex pictures, moving @c :-) You can copy or move tagged files to a directory you specify. If no files are tagged, xzgv copies/moves the file the cursor is currently on --- unless the cursor is on a subdirectory, in which case it gives an error. @table @kbd @kindex C (Selector) @item C (Shift-c) @findex Selector menu, File, Copy @itemx Selector menu, File, Copy Copy tagged files (or the current file) to a given directory. xzgv asks for the destination directory using a dialog (@pxref{Dialog Boxes}) and copies the files there. If it comes to copy a file but there is an existing file in the dir with the same name, the file is not copied and nor are any of the remaining files. @kindex M (Selector) @item M (Shift-m) @findex Selector menu, File, Move @itemx Selector menu, File, Move Move tagged files (or the current file) similarly. @end table @node Renaming a File, Deleting a File, Tagging, The File Selector @comment node-name, next, previous, up @section Renaming a File @cindex renaming a file @cindex file, renaming a @cindex changing a file's name As well as copying/moving files, you can rename them: @table @kbd @kindex Ctrl-n (Selector) @item Ctrl-n @findex Selector menu, File, Rename file @itemx Selector menu, File, Rename file Rename the current file or directory --- xzgv will refuse to overwrite any existing files/directories. The new name must remain in the current directory. (@xref{Copying/Moving Files}, for how to move a file to a different directory (albeit keeping the same name).) @xref{The Selector Menu}, for how to choose the file renamed when using the mouse. (Basically, you right-click on the file when popping up the menu.) @end table I know @kbd{Ctrl-n} isn't the most mnemonic keypress possible for `rename', but all the good ones were taken. :-/ @node Deleting a File, Changing Directory, Renaming a File, The File Selector @comment node-name, next, previous, up @section Deleting a File @cindex deleting a file @cindex file, deleting a @cindex removing a file Deleting a file is pretty straightforward: @table @kbd @kindex Ctrl-d @item Ctrl-d @findex Selector menu, File, Delete file @itemx Selector menu, File, Delete file Delete the file pointed to by the keyboard cursor (and any accompanying thumbnail). @xref{The Selector Menu}, for how to choose the file deleted when using the mouse. (Basically, you right-click on the file when popping up the menu.) @end table Note that only one file is deleted (hence `Delete file'); there is currently no way to delete all tagged files. @node Changing Directory, Rescanning the Directory, Deleting a File, The File Selector @comment node-name, next, previous, up @section Changing Directory @cindex changing directory @cindex directory, changing @cindex selecting directory @cindex current directory @cindex moving directory @cindex jumping to a directory @cindex go to directory The easiest way to change the current directory in xzgv is usually to click on a directory entry in the file list (or move the cursor to it and press @kbd{Enter}). Selecting the @code{..} entry moves to the parent directory of the current one. There is an alternative though: (Note that the key for this command is shift-@kbd{g}, not @kbd{g}.) @table @kbd @kindex G (Selector) @item G @findex Selector menu, Directory, Change @itemx Selector menu, Directory, Change Go to a specified directory. xzgv asks for the destination directory using a dialog box which you should type the dir's name into (@pxref{Dialog Boxes}), and moves to that directory if it exists. @c XXX haven't got this yet... @c If the directory turns out to be unreadable --- i.e. you do not have @c permission to read it --- zgv resorts to going to your home directory. @c (This is actually a general mechanism in zgv, but this command is the @c most likely trigger of it.) If that in turn is unreadable, zgv gives up @c in disgust and exits. :-) @end table @node Rescanning the Directory, Changing the Sorting Order, Changing Directory, The File Selector @comment node-name, next, previous, up @section Rescanning the Directory @cindex rescanning the directory @cindex refreshing directory contents @cindex directory, rescanning @cindex filenames, rescanning Normally, xzgv reads a directory once (on starting up, or when a new directory is selected). So if the contents of the directory are changed by another program, this is not automatically reflected. You can, however, explicitly tell xzgv to `rescan' the directory (reread the contents), which will update xzgv's notion of what's in it: @table @kbd @kindex Ctrl-r @item Ctrl-r @findex Selector menu, Directory, Rescan @itemx Selector menu, Directory, Rescan Rescan the current directory. @end table @node Changing the Sorting Order, File Selector Options, Rescanning the Directory, The File Selector @comment node-name, next, previous, up @section Changing the Sorting Order @cindex file selector, sorting order of the @cindex changing the file selector sorting order @cindex sorting order, changing the file selector's @cindex order, changing the file selector's sorting @cindex size, showing files in order of @cindex extension, showing files in order of @cindex date order, showing files in Normally, the files are listed in asciibetical order by name. However, you can instead have the file list sorted by size, last-modified date/time, or by `extension' (the file type). (Only the order of files can be altered; directories are always listed first, and always in name order.) @table @kbd @kindex Alt-n @item Alt-n @findex Selector menu, Directory, Sort by Name @itemx Selector menu, Directory, Sort by Name Sort by name. This is the default. @kindex Alt-e @item Alt-e @findex Selector menu, Directory, Sort by Extension @itemx Selector menu, Directory, Sort by Extension Sort by extension. @kindex Alt-s @item Alt-s @findex Selector menu, Directory, Sort by Size @itemx Selector menu, Directory, Sort by Size Sort by size. The biggest files are listed last. @kindex Alt-d @item Alt-d @findex Selector menu, Directory, Sort by Time & Date @itemx Selector menu, Directory, Sort by Time & Date Sort by time/date. The newest files are listed last. @end table You can set the default sort order via the command-line (@pxref{Invoking xzgv}) or a config file (@pxref{Configuring xzgv}). There are three possible timestamps you can use for the `Time & Date' sorting order: @table @kbd @kindex Alt-Shift-m @item Alt-Shift-m @findex Selector menu, Directory, Time & Date Type, Modification Time (mtime) @itemx Selector menu, Directory, Time & Date Type, Modification Time (mtime) Use the last-modified time (`mtime'). This is the default. @kindex Alt-Shift-c @item Alt-Shift-c @findex Selector menu, Directory, Time & Date Type, Attribute Change Time (ctime) @itemx Selector menu, Directory, Time & Date Type, Attribute Change Time (ctime) Use the last-attribute-change time (`ctime'). Note that this is @emph{not} always the time the file was created, which it's sometimes mistaken for; for example, moving a file with @code{mv} will usually change the ctime. @kindex Alt-Shift-a @item Alt-Shift-a @findex Selector menu, Directory, Time & Date Type, Access Time (atime) @itemx Selector menu, Directory, Time & Date Type, Access Time (atime) Use the last-accessed time (`mtime'). The selector order is not automatically updated when xzgv reads files, since this would probably be annoying; do a manual rescan if need be. @end table @node File Selector Options, , Changing the Sorting Order, The File Selector @comment node-name, next, previous, up @section File Selector Options @cindex file selector options @cindex file selector, run-time configuration of @cindex file selector, options in @cindex options in file selector @cindex auto-hide selector, toggling @cindex status bar, toggling @cindex thumbnail display, toggling size of @cindex thin rows mode, toggling Various aspects of the file selector's behaviour can be configured while xzgv is running, by using these toggle commands (which enable the feature if it was previously disabled, and vice versa). These settings can also be altered using command-line options (@pxref{Invoking xzgv}) and/or config file settings (@pxref{Configuring xzgv}). @table @kbd @kindex Alt-a @item Alt-a @findex Selector menu, Options, Auto Hide @itemx Selector menu, Options, Auto Hide Toggle the auto-hiding of the selector when a picture is viewed (off by default). This is handy for small screens/windows, or for old-time zgv users who just dig that groovy modal interface, er, man. :-) @kindex Alt-b @item Alt-b @findex Selector menu, Options, Status Bar @itemx Selector menu, Options, Status Bar Toggle status bar at the bottom of the selector (off by default). This displays messages in certain circumstances --- normally, it just says when a picture is being read. @c XXX no keyboard shortcut yet @findex Selector menu, Options, Thumbnail Msgs @item Selector menu, Options, Thumbnail Msgs Toggle reading-thumbnails messages (default is off), only visible if the status bar is enabled. These messages make it clear when all thumbnails have been read, but having something flash up every time you change directory is generally just annoying. @kindex v @item v @findex Selector menu, Options, Thin Rows @itemx Selector menu, Options, Thin Rows Toggle `thin rows' mode (off by default), in which thumbnails are shown at a third their normal size so that many more files can be shown at once. (The odd keyboard shortcut for this is inherited from zgv's `visual' mode toggle, which had a roughly similar effect.) @kindex Alt-i @item Alt-i @findex Selector menu, Directory, Images Only @itemx Selector menu, Directory, Images Only Toggle the option to show only directories and image files in the selector (off by default). This is handy in directories where images and other file types are intermingled and you want to avoid the 'Couldn't load image' error on those other files. Images are identified by their extensions. @end table @node The Viewer, File Formats, The File Selector, Top @comment node-name, next, previous, up @chapter The Viewer @cindex the viewer @cindex using the viewer @cindex viewer, using the @c also, for menu mention: @cindex viewer menu, getting the @cindex menu, getting the viewer @cindex getting the viewer menu @cindex showing the viewer menu @kindex F10 (Viewer) @kindex Menu (Viewer) Once you've selected a file to view, it's shown in the viewer (the right-hand part of xzgv's window). This section describes what you can do while viewing the picture. Like the selector, the viewer has its own menu --- right-click anywhere on the viewer (or press @kbd{F10} or @kbd{Menu}) to show it --- and a similar help menu (@pxref{The Selector Menu}). @menu * Exiting the Viewer:: If you're using the keyboard, this is required to return keyboard focus to the selector. * Big Pictures:: Scrolling and zoom mode, and hiding the selector to enlarge the viewer. * Scaling:: Making the picture appear larger/smaller. * Mirror and Rotate:: Distorting your sense of reality on a budget. * Changing Picture:: You can change the currently-viewed picture without using the file selector. * Hiding the Selector:: Hiding the selector gives the viewer a bigger share of the window. * Minimizing xzgv:: Hiding the window gives everything else a bigger share of the screen. :-) * Viewer Options:: The way the viewer works can be altered. @end menu @node Exiting the Viewer, Big Pictures, The Viewer, The Viewer @comment node-name, next, previous, up @section Exiting the Viewer @cindex exiting the viewer @cindex quitting the viewer @cindex leaving the viewer @cindex returning to file selector @cindex file selector, returning to When using the mouse to control xzgv, it doesn't matter whether the selector or the viewer has keyboard focus --- mouse operations transcend such petty boundaries. :-) But keyboard control is (of necessity) effectively modal, and so you need to `exit' the viewer in order to have keyboard control over the selector again. You also need to exit the viewer if you've enabled auto-hide mode. Exiting the viewer is simple: @table @kbd @kindex Esc (Viewer) @item Esc @kindex Tab (Viewer) @itemx Tab @findex Viewer menu, Exit to Selector @itemx Viewer menu, Exit to Selector Exit the viewer. This also returns the selector to its former size, if it was previously `hidden'. @end table Another way of exiting the viewer is to middle-click on it, but this mouse-only approach is really only of use when the selector is `hidden'. @node Big Pictures, Scaling, Exiting the Viewer, The Viewer @comment node-name, next, previous, up @section Big Pictures @cindex dealing with big pictures @cindex pictures, big @cindex large pictures @cindex big pictures @cindex small screen/window, coping with a A picture may well be too large to fit entirely in the viewer window. There are two main things which can help you see more of the picture at once: @itemize @minus @item Make the xzgv window larger. You could `maximize' it with your window manager, or you could start xzgv with a larger window using @code{--geometry} or fullscreen mode (@pxref{Invoking xzgv}). The fullscreen mode gives xzgv the maximum window size possible, but needs co-operation from your window manager (and alas, many are not as willing as one might like) --- in some cases you may even find @code{--geometry 100%x100%} to be more effective. @item Hide the selector. To do this, either use auto-hide mode (@pxref{File Selector Options}), or hide the selector explicitly (@pxref{Hiding the Selector}). @end itemize But of course, these are only partial solutions to the problem; there will inevitably always be pictures larger than your screen can show at once. In general, then, there are two ways to see the whole of the picture. @menu * Scrolling:: Moving around the picture. * Zoom Mode:: Fitting the picture to the window. @end menu @node Scrolling, Zoom Mode, Big Pictures, Big Pictures @comment node-name, next, previous, up @subsection Scrolling @cindex scrolling @cindex panning @cindex viewer, scrolling in the @cindex picture, moving around a @cindex viewer, moving around in the @cindex moving around the picture @cindex keyboard, moving in the viewer via Scrolling is the default approach to handling big pictures in xzgv. When the viewer is started up, the top-left of the picture is shown --- you can either drag the picture around with the mouse (i.e. click and hold the button down, then move the mouse around), or use the scrollbars, or use the cursor keys (and others) to move around the rest of the picture: @table @kbd @kindex Cursor Up (Viewer) @item Cursor Up @kindex K (Viewer) @itemx K @kindex k (Viewer) @kindex Ctrl-Cursor Up (Viewer) Move up 100 pixels. @kbd{Ctrl-Cursor Up} and @kbd{k} both move up 10 pixels. @kindex Cursor Down (Viewer) @item Cursor Down @kindex J (Viewer) @itemx J @kindex j (Viewer) @kindex Ctrl-Cursor Down (Viewer) Move down 100 pixels. @kbd{Ctrl-Cursor Down} and @kbd{j} both move down 10 pixels. @kindex Cursor Left (Viewer) @item Cursor Left @kindex H (Viewer) @itemx H @kindex h (Viewer) @kindex Ctrl-Cursor Left (Viewer) Move left 100 pixels. @kbd{Ctrl-Cursor Left} and @kbd{h} both move left 10 pixels. @kindex Cursor Right (Viewer) @item Cursor Right @kindex L (Viewer) @itemx L @kindex l (Viewer) @kindex Ctrl-Cursor Right (Viewer) Move right 100 pixels. @kbd{Ctrl-Cursor Right} and @kbd{l} both move right 10 pixels. @kindex Page Up (Viewer) @item Page Up @kindex Shift-Cursor Up (Viewer) @itemx Shift-Cursor Up @kindex Ctrl-u (Viewer) @itemx Ctrl-u Move up (nearly) the window height. (It moves by 90% of the height.) @kindex Page Down (Viewer) @item Page Down @kindex Shift-Cursor Down (Viewer) @itemx Shift-Cursor Down @kindex Ctrl-v (Viewer) @itemx Ctrl-v Move down (nearly) the window height. @kindex - (Viewer) @item - @kindex Shift-Cursor Left (Viewer) @itemx Shift-Cursor Left Move left (nearly) a window-length. (It moves by 90% of it.) @kindex = (Viewer) @item = @kindex Shift-Cursor Right (Viewer) @itemx Shift-Cursor Right Move right (nearly) a window-length. @kindex Home (Viewer) @item Home @kindex Ctrl-a (Viewer) @itemx Ctrl-a Move to the top-left of the picture. @kindex End (Viewer) @item End @kindex Ctrl-e (Viewer) @itemx Ctrl-e Move to the bottom-right of the picture. @end table @node Zoom Mode, , Scrolling, Big Pictures @comment node-name, next, previous, up @subsection Zoom Mode @cindex zoom mode @cindex fitting picture to window @cindex small window, making picture fit a @cindex small picture, making window fit a @cindex small pictures, not zooming @cindex zooming big but not small pictures @cindex zoom mode, reduce-only in @cindex reduce-only in zoom mode @cindex use panorama view in zoom mode An alternative way of viewing the whole picture, one which lets you see the picture onscreen all at once no matter how big (or small) it is, is zoom mode. Zoom mode's name derives from the idea of `zooming' a small file up to fit the window. But in reality, it is more often used to reduce a large file to fit. Zoom mode is not the default, and has to be enabled. Once enabled, it stays on until you turn it off again (or until you enable scaling, or select @samp{Normal} (@pxref{Scaling})). @table @kbd @kindex z @item z @findex Viewer menu, Options, Zoom (fit to window) @itemx Viewer menu, Options, Zoom (fit to window) Toggle zoom mode. @kindex Alt-r @item Alt-r @findex Viewer menu, Options, When Zooming Reduce Only @itemx Viewer menu, Options, When Zooming Reduce Only When in zoom mode, only @emph{reduce} pictures to fit. This can be useful when going through a lot of unpredictably-sized pictures, as it means that you can see all of a big picture easily without also meaning that tiny little icons assume a scale of Biblical proportions. :-) @kindex Alt-p @item Alt-p @findex Viewer menu, Options, When Zooming Panorama @itemx Viewer menu, Options, When Zooming Panorama When in zoom mode, resize to make the most proportional dimension fit and allow scrolling on the other dimension. This can be useful when viewing iamges that do not adjust nicely to the window size but you want to see them as big as possible while using the most space available. The cause for this function was to better read comics, so you can guess it works like a 'fit page width' option, but is not limited to horizontal adjustment. @end table The way zoom mode reduces a file to fit the window is (relatively) quick but harsh, and may make the picture look a bit ugly. In future there may be a smoothing option like zgv's @samp{vkludge}, but for now I'm afraid the fairly crude resize is all that's available. There is in fact an alternative to zoom mode, as you can scale down an image instead. This is generally only useful for very large images, however; zoom mode tends to be the Right Thing for the most part. @node Scaling, Mirror and Rotate, Big Pictures, The Viewer @comment node-name, next, previous, up @section Scaling @cindex scaling up/down a picture @cindex enlarging a picture @cindex picture, enlarging @cindex reducing a picture @cindex picture, reducing @cindex zooming into a picture @cindex making a picture bigger/smaller @cindex small picture, enlarging a @cindex normal, returning display to @cindex aspect ratio, altering @cindex decoupled scaling @cindex axis-specific scaling @cindex scaling, axis-specific You can scale a picture --- this makes it appear larger (or smaller) onscreen. xzgv acts much as if the scaled picture were the real picture; for example, the cursor keys scroll around in steps of 100 scaled pixels, even if this means moving a fraction of a pixel (or many pixels) in the original picture (and similarly for movement with the mouse). The main limitation of scaling (other than how much it slows things down :-), at least when scaling up) is that you can only scale by integer values, so you can only make each pixel in the image twice as wide/high, or three times as wide/high, or four times, and so on. (It may seem odd saying e.g. `twice as wide/high' rather than `twice the size', but technically `twice the size' would be referring to scaling up the width (and height) by about 1.414@dots{}) Normally, xzgv does no scaling, which could be considered a ratio of 1:1. Scaling up increases that ratio. How it is increased depends on which option/key you use: @table @kbd @kindex d @item d @findex Viewer menu, Scaling, Double Scaling @itemx Viewer menu, Scaling, Double Scaling Increase the ratio by doubling it --- this leads to ratios of 2:1, 4:1, 8:1@dots{} @kindex s @item s @findex Viewer menu, Scaling, Add 1 to Scaling @itemx Viewer menu, Scaling, Add 1 to Scaling Increase the ratio by adding one --- leads to ratios of 2:1, 3:1, 4:1@dots{} @end table There are similar commands to decrease the ratio: @table @kbd @kindex D @item D (Shift-d) @findex Viewer menu, Scaling, Halve Scaling @itemx Viewer menu, Scaling, Halve Scaling Decrease the ratio by halving it. @kindex S @item S (Shift-s) @findex Viewer menu, Scaling, Sub 1 from Scaling @itemx Viewer menu, Scaling, Sub 1 from Scaling Decrease the ratio by subtracting one. @end table Usually the double/halve scalings are more useful. Note that you can also double/halve the scaling by using shift-left-click on the viewer to double, and shift-right-click to halve. This still changes scale `around' the middle of the window though (rather than around the point clicked on, as you might expect), which is a little strange and may possibly be changed in future. When you scale `below' 1:1, the above commands lead to ratios of (e.g.) 1:2, 1:4, 1:8, etc. --- that is, the ratios work the same way, but the other way around. This gives you an increasingly small image. The scaling ratio is never decreased below 1:32. It is also never increased beyond the point where the overall image size would exceed 32767x32767 --- this limit is due to the combination of X's limit on window sizes, and the implementation used by xzgv for scaling. One problem with scaling up, given the way it's currently implemented, is that it's not well-suited to dithered display --- so if you're running on an 8-bit server, dragging the image around slowly when using scaling (especially scaling with interpolation) may result in some nasty, streaky, undithered-looking parts of the picture. :-( You can undo the effect of scaling (up or down) at any time: @table @kbd @kindex n @item n @findex Viewer menu, Scaling, Normal @itemx Viewer menu, Scaling, Normal Resume `normal' display --- disables scaling mode, and also zoom mode. @end table Normally, scaling up works by simply making the pixels into larger and larger squares (in effect), which remain the same colour. However, you can enable a feature called `interpolation' which smoothly graduates the colour change between the top-left corners of each pixel. This is @emph{very} slow, but looks nice. @table @kbd @kindex i @item i @findex Viewer menu, Options, Interpolate when Scaling @itemx Viewer menu, Options, Interpolate when Scaling Toggle interpolation in scaling mode. @end table (If you like the appearance of scaling with interpolation, you may also be interested in a program I wrote called @cite{pnminterp}, which can scale up a PGM or PPM file while applying this effect. These days it's part of the netpbm package.) Scaling down, however, is implemented a bit like a special-case zoom mode, and currently there are no ways of making that look nicer. :-/ xzgv normally `reverts' scaling (returning the scale to 1:1) back to normal when you view a new picture. However, it's possible to disable this behaviour (@pxref{Viewer Options}). There is also support for an alternative form of scaling --- decoupled, or axis-specific, scaling. When you scale in this way, only one axis of the image is scaled at once. For example, you might choose to effectively double the height of an image (with the width left unchanged). Indeed, this sort of scaling is useful for temporarily correcting pictures intended for display using pixels twice as wide or high as normal. @table @kbd @kindex x @item x @findex Viewer menu, Scaling, X Only, Double Scaling @itemx Viewer menu, Scaling, X Only, Double Scaling Increase the (x axis) ratio by doubling it. @kindex X @item X (Shift-x) @findex Viewer menu, Scaling, X Only, Halve Scaling @itemx Viewer menu, Scaling, X Only, Halve Scaling Decrease the (x axis) ratio by halving it. @kindex Alt-x @item Alt-x @findex Viewer menu, Scaling, X Only, Add 1 to Scaling @itemx Viewer menu, Scaling, X Only, Add 1 to Scaling Increase the (x axis) ratio by adding one. @kindex Alt-Shift-x @item Alt-Shift-x @findex Viewer menu, Scaling, X Only, Sub 1 from Scaling @itemx Viewer menu, Scaling, X Only, Sub 1 from Scaling Decrease the (x axis) ratio by subtracting one. @kindex y @item y @findex Viewer menu, Scaling, Y Only, Double Scaling @itemx Viewer menu, Scaling, Y Only, Double Scaling Increase the (y axis) ratio by doubling it. @kindex Y @item Y (Shift-y) @findex Viewer menu, Scaling, Y Only, Halve Scaling @itemx Viewer menu, Scaling, Y Only, Halve Scaling Decrease the (y axis) ratio by halving it. @kindex Alt-y @item Alt-y @findex Viewer menu, Scaling, Y Only, Add 1 to Scaling @itemx Viewer menu, Scaling, Y Only, Add 1 to Scaling Increase the (y axis) ratio by adding one. @kindex Alt-Shift-y @item Alt-Shift-y @findex Viewer menu, Scaling, Y Only, Sub 1 from Scaling @itemx Viewer menu, Scaling, Y Only, Sub 1 from Scaling Decrease the (y axis) ratio by subtracting one. @end table There are also mouse shortcuts for scaling up/down a single axis; control-left-click scales up, and control-right-click scales down. By default this acts on the y axis, but the active axis can be toggled with @kbd{Alt-c}, or by toggling the @kbd{Ctl+Click Scales X Axis} option (@pxref{Viewer Options}). Interpolation is not currently supported in situations where the x scaling does not match the y scaling. @node Mirror and Rotate, Changing Picture, Scaling, The Viewer @comment node-name, next, previous, up @section Mirror and Rotate @cindex mirroring a picture @cindex flipping a picture @cindex rotating a picture @cindex picture, mirroring a @cindex picture, flipping a @cindex picture, rotating a @cindex picture orientation @cindex orientation, picture @cindex restoring picture orientation Sometimes when viewing a picture you will want to flip it horizontally or vertically, or rotate it: @table @kbd @kindex m @item m @findex Viewer menu, Orientation, Mirror (horiz) @itemx Viewer menu, Orientation, Mirror (horiz) `Mirror' the picture (flip it horizontally). @kindex f @item f @findex Viewer menu, Orientation, Flip (vert) @itemx Viewer menu, Orientation, Flip (vert) `Flip' the picture (flip it vertically). @kindex r @item r @findex Viewer menu, Orientation, Rotate Right @itemx Viewer menu, Orientation, Rotate Right Rotate the picture 90 degrees clockwise. @kindex R @item R (Shift-r) @findex Viewer menu, Orientation, Rotate Left @itemx Viewer menu, Orientation, Rotate Left Rotate the picture 90 degrees anti-clockwise. (Any US readers surprised and/or annoyed by my not saying `counter-clockwise' will realise why the menus say rotate right/left. :-)) @kindex N @item N (Shift-n) @findex Viewer menu, Orientation, Normal @itemx Viewer menu, Orientation, Normal Restore the picture orientation to normal. This undoes the effect of any mirrors, flips, and/or rotations. @end table xzgv normally `reverts' the picture orientation (the way the picture has been transformed by mirror/flip/rotate) back to normal when you view a new picture. However, it's possible to disable this (@pxref{Viewer Options}), so that any new pictures are mirrored, flipped, and/or rotated in the same way. @node Changing Picture, Hiding the Selector, Mirror and Rotate, The Viewer @comment node-name, next, previous, up @section Changing Picture @cindex pictures, changing @cindex viewer, changing pictures from the @cindex changing pictures @cindex next picture @cindex previous picture @cindex tagging pictures in the viewer @cindex viewer, tagging pictures in the It's possible to go directly to the previous or next file (or tagged file) in the directory, or to tag a file, without having to pick the file from the file selector by hand. These commands are particularly useful when using xzgv from the keyboard, but there's also a notable mouse shortcut for moving to the next image. @table @kbd @c XXX should have alternative way of getting next image which works @c from both selector and viewer, perhaps? Could use ^p and ^n, @c I s'pose - there's precedent for that in zgv, if nothing else. @kindex Space (Viewer) @item Space @findex Viewer menu, Next Image @itemx Viewer menu, Next Image Move to next file in dir, and view it. You can also click on the picture/viewer to do this. (If you find this interferes with dragging the picture around (though it shouldn't), or just don't like it, it can be disabled (@pxref{Config Variables}).) @kindex b @item b @findex Viewer menu, Previous Image @itemx Viewer menu, Previous Image Move to previous file in dir, and view it. @kindex Ctrl-Space (Viewer) @item Ctrl-Space @findex Viewer menu, Tagging, Tag then Next @itemx Viewer menu, Tagging, Tag then Next Tag current file, then move to next file in dir and view it. @kindex / (Viewer) @item / @findex Viewer menu, Tagging, Next Tagged @itemx Viewer menu, Tagging, Next Tagged Move to next tagged file in dir, and view it. @kindex ? (Viewer) @item ? @findex Viewer menu, Tagging, Previous Tagged @itemx Viewer menu, Tagging, Previous Tagged Move to previous tagged file in dir, and view it. @end table @node Hiding the Selector, Minimizing xzgv, Changing Picture, The Viewer @comment node-name, next, previous, up @section Hiding the Selector When running on small screens, or in a small window, it can get a bit annoying to lose viewer space by having the selector constantly displayed when you don't actually need it. The usual solution to this problem is to enable auto-hide mode. But what if some pictures you're viewing are small and some large? It can sometimes be nearly as annoying having the selector hidden to `make room for' a small picture which didn't need it. So for that reason, or perhaps if you just don't like auto-hide mode :-), you may prefer to leave auto-hide off and explicitly hide the selector when necessary: @table @kbd @kindex Z @item Z (shift-z) @findex Viewer menu, Window, Hide Selector @itemx Viewer menu, Window, Hide Selector Hide the selector. (This is actually a toggle, of sorts; `hide selector' when it's already hidden unhides it.) @end table You can also hide or unhide the selector by middle-clicking on the viewer. @node Minimizing xzgv, Viewer Options, Hiding the Selector, The Viewer @comment node-name, next, previous, up @section Minimizing xzgv @c XXX this is only really here because it's on the viewer's menu. A @c more general place would be better, but it's difficult to see where @c that would be. @c ghod it's painful writing `minimize'. :-/ See main.c's viewer menu @c definition for the rationale behind my not writing `minimise', even @c though that's my preferred -ise/-ize form. Generally it's easy enough to use your window manager to change windows etc., but when running fullscreen this can sometimes be a little problematic. For this reason, xzgv has built-in support for `iconifying' itself: @table @kbd @kindex Ctrl-z @item Ctrl-z @findex Viewer menu, Window, Minimize @itemx Viewer menu, Window, Minimize Minimize the xzgv window. @end table @node Viewer Options, , Minimizing xzgv, The Viewer @comment node-name, next, previous, up @section Viewer Options @cindex viewer options @cindex viewer, run-time configuration of @cindex viewer, options in @cindex options in the viewer @c thesaurus, how to sound like a :-) @cindex fit to window, toggling @cindex zoom, toggling @cindex interpolation when scaling, toggling @cindex scaling with interpolation, toggling @cindex enlarged pictures, toggling interpolation for @cindex revert scaling, toggling @cindex revert orientation, toggling @cindex preserving scaling @cindex preserving orientation @cindex scaling, preserving @cindex orientation, preserving @cindex mirrors, preserving @cindex flips, preserving @cindex rotation, preserving @cindex correcting digital camera pictures @cindex digital camera pictures, correcting @cindex exif orientation support @cindex orientation, exif @cindex dithering in 15/16-bit modes @cindex 15/16-bit modes, toggling dithering in @cindex high-colour modes, toggling dithering in @cindex mouse scaling axis, toggling @cindex scaling axis, toggling mouse @cindex axis, toggling mouse scaling As with the selector, various options can be disabled/enabled which relate to the viewer. These settings can also be altered using command-line options (@pxref{Invoking xzgv}) and/or config file settings (@pxref{Configuring xzgv}). @table @kbd @c no index entries here, it's already been done (in Zoom Mode) @item z @itemx Viewer menu, Options, Zoom (fit to window) Toggle zoom mode, discussed in more detail elsewhere (@pxref{Zoom Mode}). @c same here... @item Alt-r @itemx Viewer menu, Options, When Zooming Reduce Only Toggle reduce-only in zoom mode, also covered elsewhere (@pxref{Zoom Mode}). @c and here... @item Alt-p @itemx Viewer menu, Options, When Zooming Panorama Toggle panorama view in zoom mode, also covered elsewhere (@pxref{Zoom Mode}). @c and here... @item i @itemx Viewer menu, Options, Interpolate when Scaling Toggle interpolation when a picture is being scaled-up. Again, this has already been mentioned (@pxref{Scaling}). @kindex Alt-c @item Alt-c @findex Viewer menu, Options, Ctl+Click Scales X Axis @itemx Viewer menu, Options, Ctl+Click Scales X Axis Toggle the axis scaled when you control-click (or control-right-click) on the image. The default is to scale the y axis. @kindex F @item F (shift-f) @findex Viewer menu, Options, Dither in 15 & 16-bit @itemx Viewer menu, Options, Dither in 15 & 16-bit Toggle dithering in 15/16-bit modes. This increases the apparent colour depth making gradations look much better, but it's slower than undithered rendering, and can (in 16-bit) slightly distort a picture's colour balance. (The @kbd{F} key was chosen for this as the dither toggle is functionally similar to zgv's `fakecols' toggle.) @findex Viewer menu, Options, Revert Scaling For New Pic @item Viewer menu, Options, Revert Scaling For New Pic Normally xzgv returns the scaling back down to 1 (normal) when a new picture is selected. By disabling this, you can retain scaling across picture selection. (There is currently no keyboard shortcut for this fairly-seldom-changed option --- to toggle it from the keyboard, you should use the popup menu (press @kbd{F10}), and select the menu item.) @findex Viewer menu, Options, Revert Orient. For New Pic @item Viewer menu, Options, Revert Orient. For New Pic Similarly, xzgv returns to the picture's true orientation (not mirrored, rotated, etc.) on selecting a new picture. Disabling this option means that any mirrors/flips/rotates applied persist across multiple images. (No keyboard shortcut --- see above.) @findex Viewer menu, Options, Use Exif Orientation @item Viewer menu, Options, Use Exif Orientation Toggle support for Exif orientation. Devices which create JPEG files in the Exif format (e.g. many digital cameras) may add an orientation tag to the file, which says how the camera was being held when the picture was taken. When this tag is present, xzgv can adjust the image to compensate for a camera being held on its side. (This isn't done by default as it misrepresents the true image, which could be confusing if you don't know why it's happening.) Enabling this option may be useful if you take pictures with your camera on its side, but don't want to have to rotate the pictures before being able to view them properly. Of course, for this to work your camera has to be inserting the orientation tag in the first place --- but it can't hurt to try it and see. (No keyboard shortcut --- see above.) @end table @node File Formats, Configuring xzgv, The Viewer, Top @comment node-name, next, previous, up @chapter File Formats @cindex file formats @cindex pictures, file formats used by Picture files are stored in a variety of different forms, or `file formats'. xzgv, via gdk, supports many. @menu * File Type Identification:: How xzgv identifies the type of a file. @end menu @node File Type Identification, , File Formats, File Formats @comment node-name, next, previous, up @section File Type Identification @cindex identifying files @cindex files, identification of @cindex picture format, identification of @cindex file format, identification of The format a file is in is identified by its content. The file-reading code relies on libgdk to determine the file type and read the file correctly; generally this uses the format's `magic number' to determine file type --- e.g. a JPEG/JFIF file starts with the (hex) bytes @code{FF D8}. So if you start xzgv with @samp{xzgv foo}, and foo is in a supported format (such as JPEG), the format will be figured out and the file loaded even though the `extension' is absent. @node Configuring xzgv, Rationale, File Formats, Top @comment node-name, next, previous, up @chapter Configuring xzgv @cindex configuration @cindex customising @cindex changing xzgv's behaviour @cindex defaults, changing @cindex options, setting default @cindex settings, changing Many aspects of the way xzgv works can be modified by using a configuration file. @menu * Config Files:: There are two possible config files. * Config Variable Types:: Most settings are on/off, but not all. * Config Variables:: Most options are identical to the command-line long-options, but here are names, defaults, and descriptions for those which aren't. @end menu @node Config Files, Config Variable Types, Configuring xzgv, Configuring xzgv @comment node-name, next, previous, up @section Config Files @cindex files, config @cindex config files @cindex @file{xzgvrc} @cindex @file{xzgv.conf} @cindex format of config files A configuration file lets you alter aspects of xzgv's behaviour. xzgv supports two possible config files --- a system-wide one, @file{/etc/xzgv.conf}; and one for each user in their home directory, @file{$HOME/.xzgvrc}. Both are optional. If @file{$HOME/.xzgvrc} exists, it is used @emph{instead of} @file{/etc/xzgv.conf}. Before describing the format of config files, it may help to give an example file: @example # Sample xzgv config file # Comment lines begin with `#' and are ignored, # as are blank lines. # make pics fit window zoom on # hog the screen :-) fullscreen on @end example It is a line-based format. Each line (or rather, each line which is not a comment line and is not blank) assigns a value to a single predefined `variable'. xzgv has many such variables it lets you modify in this way. For example, the @samp{fullscreen} option above controls whether or not xzgv tries to use the whole screen for its window. If it is given the value @code{on}/@code{y}/@code{yes}/@code{1} it does; if @code{off}/@code{n}/@code{no}/@code{0}, it doesn't. Most variables are of this yes-or-no `boolean' type. Since the variables set in a config file have a direct effect on how xzgv works, it can be easier to simply call them `settings'. Indeed, such terminology is used on occasion in this documentation. @node Config Variable Types, Config Variables, Config Files, Configuring xzgv @comment node-name, next, previous, up @section Config Variable Types @cindex types, config variable @cindex variable, types of config @cindex config variables types @cindex config files, types in There are various types of variable: @itemize @minus @item Boolean. These are on-or-off, yes-or-no variables. Most of xzgv's config file variables are of this type. @item Integer. These are whole numbers. The meaning of the number depends on what the variable is used for. @item Geometry. This window size-and/or-position specification format is only used for the @code{geometry} setting. @xref{Invoking xzgv}, for a description of how this type works. @end itemize @node Config Variables, , Config Variable Types, Configuring xzgv @comment node-name, next, previous, up @section Config Variables @cindex config variables @cindex variables, config @cindex themes, adjusting for dark GTK+ @cindex GTK+ themes, adjusting for dark @cindex dark GTK+ themes, adjusting for Currently, most configuration variables (settings) in xzgv can also be set by command-line options; indeed, the name of the setting in all such cases is @emph{identical} to that for the long version of the option (e.g. @code{fullscreen}, @code{auto-hide}). As such, they're documented in the section which discusses command-line options and the like (@pxref{Invoking xzgv}). However, there are some settings only available in the config file: @vtable @samp @item click-for-next This is enabled by default, allowing you to click on the viewer to skip to the next image. If disabled, clicking on the viewer does nothing. @end vtable @node Rationale, Bugs and Restrictions, Configuring xzgv, Top @comment node-name, next, previous, up @chapter Rationale @cindex rationale @cindex moaning for fun and profit @c many a true word... :-) Here I (RJM) attempt to explain why I did things the way I did. This is presented in a question-and-answer format of sorts. @menu * Why Yet Another Viewer?:: Because we're here. * Why no image-editing capabilities?:: You're kidding, right? * Why a Texinfo Manual?:: Large man pages are hard to deal with. * Why One-space Sentence Ends?:: Not everyone uses two-space ones. @end menu @node Why Yet Another Viewer?, Why no image-editing capabilities?, Rationale, Rationale @comment node-name, next, previous, up @section Why Yet Another Viewer? @cindex why another viewer? @cindex other viewers, comparison with Previously, this section concentrated on xv; that may have made sense when I originally wrote it, and still makes a certain limited amount of sense for zgv, but for xzgv it was looking increasingly dated. And so here I am writing an update. :-) I originally wrote xzgv as I simply wasn't happy with the viewers for X that I was aware of at the time (mid-1999). At the time of writing (late 2000), other key things about xzgv are becoming apparent, partly through responses I've been getting to it: @itemize @bullet @item It's `fast'. No, it doesn't do any particular operation faster than other viewers as far as I know (well, maybe thumbnail updates :-)); rather, the interface tries not to get in your way. Click on a filename, and the picture appears. No multiplicity of toolbars or windows, it's just there. @item As with zgv, it tries to do one thing well, viewing pictures. It isn't perfect in this regard, I'll admit, but at least it stays well clear of picture editing. @item It's, er, quite a lot like zgv. Some of us old fogies like this. :-) @end itemize I won't pretend xzgv is The Ultimate Viewer For Everyone. Some people will prefer other approaches, or just simply prefer other viewers. (Some people may even still use xv, ghod forbid.) There are a few viewers which you may like to try if you don't think much of xzgv: @itemize @bullet @item gqview. This seems to be well-regarded. I find it a bit gimmicky and kitchen-sink-ish; not quite as `pure' or focused as xzgv, IMHO. I think more people use it than xzgv though. @item xli. I'm not sure if this is maintained these days, but it's not too bad a viewer. No thumbnails or file selector though. (These days I mostly use this for setting the root window pixmap, something I @emph{don't} think belongs in a viewer, but which xli does happen to be quite good at.) @item qiv. If I read between the lines correctly, this is essentially a modern replacement for xli. @item gtksee. I've not tried this, but I think the idea is that it's an ACDSee clone, and there seem to be an awful lot of people who want a clone of that. Which is their problem. :^) @item Electric Eyes. To be honest, I think this has been outclassed by other viewers these days, which shows how far we've come. @end itemize Ah, you say, what of xv? Well, we've @emph{emphatically} reached the point where no-one need use xv any more. Anyone using xv these days really should drop that pile of ill-conceived non-Free crap and use one of the better viewers now available. It's that simple. @node Why no image-editing capabilities?, Why a Texinfo Manual?, Why Yet Another Viewer?, Rationale @comment node-name, next, previous, up @section Why no image-editing capabilities? It's a fscking @emph{viewer}, dammit. If you want xv you know where to find it. (OTOH, if you want a @emph{decent} image editor, use the Gimp.) @node Why a Texinfo Manual?, Why One-space Sentence Ends?, Why no image-editing capabilities?, Rationale @comment node-name, next, previous, up @section Why a Texinfo Manual? @cindex why a texinfo manual? @cindex Texinfo, why xzgv doc. is in @cindex man page, why not just have a For years, I maintained a conventional `man page' for zgv (which xzgv was loosely based on). But over time, I realised just how impossibly confusing the zgv man page had become. So I wanted to rewrite zgv's documentation in a more sensible way, in some other format than a man page. I wanted an established, well-supported format with structure and cross-referencing. I felt this made it a choice between HTML and texinfo. HTML seemed to me to be a moving target like no other, and not as well supported on text-only terminals as Info (and thus texinfo). (This latter point is admittedly not too relevant as far as xzgv is concerned.) When I noticed that a converter existed to convert texinfo to HTML in any case, the case was closed. xzgv's documentation was then based on zgv's --- the documentation is probably more similar than the programs are. :-) Don't get me wrong --- I like man pages. And even with the excellent Texinfo documentation and Emacs' very helpful Texinfo mode, writing texinfo is hardly easy. (Without Texinfo mode's node- and menu-update commands, I personally would find it near-impossible!) But big man pages just aren't that good for reference, and this is made worse by the relative lack of structure. @node Why One-space Sentence Ends?, , Why a Texinfo Manual?, Rationale @comment node-name, next, previous, up @section Why One-space Sentence Ends? @cindex why one-space sentence ends? @cindex Texinfo, problems with @c XXX when printed, is emacs texinfo file's title really "The Emacs @c Editor"? Should check this for the relevant @pxref here. The conventional way to write texinfo is to follow each sentence with two spaces after the dot (or whatever ends the sentence). Many people normally write this way in a non-texinfo context too. But a sizeable proportion of people normally write text with only one space after the dot --- and I'm one of them. The Texinfo documentation gives the impression that two-space @emph{must} be used; it says ``it is important to put two spaces at the end of sentences in Texinfo documents.'' But the only circumstance in which spacing from the texinfo file is preserved at all (in any sense other than `there is a space here') is when the texinfo is converted to Info format. So, in fact, the decision to use two-space depends on how the author wants Info output to appear --- this is a subjective decision which should be @emph{entirely down to the preference of the author}, despite the Texinfo documentation's attempt to make two-space sound like an objective you-must-do-this kind of thing. You might wonder what the problem with using one-space is, then. Well, `makeinfo' has to reformat paragraphs, and whenever it needs to insert space at (what appears to it to be) the end of a sentence, it inserts two spaces. This behaviour cannot be altered, unlike in Emacs (@samp{sentence-end-double-space}; @pxref{Fill Commands,,,emacs,The Emacs Editor}) and GNU fmt (@samp{-u}; @pxref{fmt invocation,,,textutils,GNU Text Utilities}). Also, attempting to `fix' the output Info with sed doesn't work properly because the `tags' used to find nodes quickly are then incorrect. These could of course also be fixed, but this would involve a lot more work than a simple sed invocation. So realistically, anyone who writes texinfo with one-space has to put up with the occasional two-space sentence end being inserted into their text --- worse still, the current `makeinfo' formatting algorithm seems to insert two spaces even after abbreviations (such as `e.g.' and `etc.'), which breaks even two-space texinfo. (This is particularly ironic, by the way, since two-space partisans' main argument in favour of the practice is often the way it makes it possible to tell the difference between abbreviations and the end of a sentence.) One last point may be worth noting; I am not the first person to write texinfo files using one-space. At the time of writing, it is used in the texinfo documentation for BFD, gdbm, GTK/GDK, (Linux) IPC, and viper, and I expect there are instances I'm not aware of. @node Bugs and Restrictions, Future Changes, Rationale, Top @comment node-name, next, previous, up @chapter Bugs and Restrictions @cindex bugs and restrictions All (non-trivial) programs have bugs. Anyone who denies this@dots{} @itemize @minus @item clearly hasn't written too many programs. @item is wrong. ;-) @end itemize It follows that xzgv, like everything else, always has some bugs. Usually these are not too serious, or I'd have fixed them before releasing xzgv. But either way, bugs and other problems with xzgv are noted here. @menu * Known Bugs:: Known bugs in xzgv which have yet to be fixed. * Suboptimal Features:: Aspects of xzgv which aren't exactly ideal, but are at least intentional. * Restrictions:: Limits and similar shortcomings. * Reporting Bugs:: What to do if you spot a problem. * Reporting Documentation Bugs:: Documentation errors are also worth reporting. @end menu @node Known Bugs, Suboptimal Features, Bugs and Restrictions, Bugs and Restrictions @comment node-name, next, previous, up @section Known Bugs @cindex known bugs @cindex bugs, known @itemize @minus @item In zoom mode, it copes with resizing the window as a whole, but @emph{doesn't} when you change the size of the pane (apart from when hiding/showing selector or resizing from keyboard, but that's only 'cos I kludged it :-)). @item When scaling up and dithering, you end up with a crappy-looking picture if you drag the picture around slowly (since each exposed bit is dithered independently, with no regard given to matching up to any previous error-diffusion). @item Scaling up is slow. Not sure if I can do much about this. @item Using an alignment widget to centre the viewer window results in some annoying `bounce' in certain resizing situations etc. @item Thumbnails don't look so great in palette-based (e.g. 8-bit) modes. @item When dragging an image around, if you quickly move the mouse pointer over from the image area to the selector area, the image seems to `jump' a little. I think this may have something to do with the paned window's window-splitting bit, but I'm not sure. Also, it jumps when moving across scrollbar sliders and the paned window splitter handle. @item It doesn't apply any tranparency mask. The practical result of this seems to be purple transparent bits in thumbnails and scaled-up images, and black transparent bits elsewhere. This doesn't affect PNG files, though. @item If a GIF file is corrupted in such a way that the decompressed image has a larger number of pixels in it, the extra pixels will be ignored and no error or warning will be generated. @item If you look up `joe code' in a dictionary, right next to ``see zgv'' it now says ``but for @emph{really} in-depth insight into the joe code nature, see xzgv''. :-) @end itemize @node Suboptimal Features, Restrictions, Known Bugs, Bugs and Restrictions @comment node-name, next, previous, up @section Suboptimal Features @cindex suboptimal features @cindex problematic features @cindex bug, that's a feature not a @itemize @minus @item Thumbnails are given an accurate width/height `IMGINFO' comment, but are always claimed to be "RGB". @item xzgv @emph{doesn't} duplicate zgv's behaviour of generating thumbnails under @file{~/.xvpics/_foo_bar_baz} if it can't generate them in @file{/foo/bar/baz/.xvpics}. I doubt anything else supported it, and it complicated lots of things unnecessarily. This isn't particularly suboptimal, but as an incompatibility with zgv it merits mention. @end itemize @node Restrictions, Reporting Bugs, Suboptimal Features, Bugs and Restrictions @comment node-name, next, previous, up @section Restrictions @cindex restrictions @itemize @minus @item Only the first image of a multiple-image GIF is used. (These days, multiple-image GIFs are usually animations.) @end itemize @node Reporting Bugs, Reporting Documentation Bugs, Restrictions, Bugs and Restrictions @comment node-name, next, previous, up @section Reporting Bugs @cindex reporting bugs @cindex bugs, reporting @cindex problems, reporting @cindex faults, reporting @cindex contacting the author @cindex author, contacting the If you find xzgv does something wrong, which you suspect might be a fault of some sort (a bug) in the program, it is best to report it as I may not be aware of the problem. (But first, check it is not a `known bug'. @xref{Known Bugs}. It is not usually helpful to report a bug I already know about.) It is important to include as much detail in a bug report as you can. Here are some details you should include: @itemize @bullet @item The version of xzgv you are running. @code{xzgv --version} reports this. @item The versions of GTK+ you are using. @code{xzgv --version-gtk} reports the GTK+ version being used by xzgv. @item The bitdepth your X server is running in (common depths are 16-bit, 24-bit, and 32-bit). If you don't know what depth you're running in, try @code{xdpyinfo|grep depth}. @item A description of the bug --- what effects it has, the circumstances it occurs in, and so on. Does it only happen for certain types of file? Only when in 8-bit modes? Only when dithering is enabled? Even `irrelevant' details can sometimes be useful. @item Finally, if you are a programmer and believe you have managed to fix the bug yourself, patches are gratefully accepted. :-) You should generate the patch using @code{diff -c} or (preferably) @code{diff -u}. @end itemize Then, please file a bug report in the SourceForge bug tracker. See @indicateurl{https://sourceforge.net/p/xzgv}. @node Reporting Documentation Bugs, , Reporting Bugs, Bugs and Restrictions @comment node-name, next, previous, up @section Reporting Documentation Bugs @cindex reporting documentation bugs @cindex documentation, reporting bugs in the @cindex bugs, reporting documentation @cindex Texinfo documentation, reporting bugs in the @cindex Info file, reporting bugs in the @cindex manual, reporting bugs in the Bugs in the documentation can sometimes cause as much trouble as bugs in the program; if you notice a problem in the documentation, it's a good idea to report it. For reports of documentation bugs, you should include these details: @itemize @bullet @item The version of xzgv the documentation is for. @item If it is a problem in one specific section of the documentation, specify which part it is (by this I mean the heading it comes under; texinfophiles should read this as `the node name' :-)). @item The format of the documentation you saw the problem in (e.g. info, man page, HTML). @item A description of the problem. @end itemize @xref{Reporting Bugs}, for details of where to send the bug report. @node Future Changes, Keyboard Commands Index, Bugs and Restrictions, Top @comment node-name, next, previous, up @chapter Future Changes @cindex TODO list @cindex future changes @cindex changes, possible future @cindex wish-list If you want to suggest a feature you'd like in xzgv, or a change to an existing feature, contact me; see @xref{Reporting Bugs} for the address. Future changes etc. are listed in the @file{TODO} file. @node Keyboard Commands Index, Menu Item Index, Future Changes, Top @comment node-name, next, previous, up @unnumbered Keyboard Commands Index @cindex index, keyboard commands @printindex ky @node Menu Item Index, Configuration Variables Index, Keyboard Commands Index, Top @comment node-name, next, previous, up @unnumbered Menu Item Index @cindex index, menu item @printindex fn @node Configuration Variables Index, Concept Index, Menu Item Index, Top @comment node-name, next, previous, up @unnumbered Configuration Variables Index @cindex index, configuration variables @printindex vr @node Concept Index, , Configuration Variables Index, Top @comment node-name, next, previous, up @unnumbered Concept Index @cindex recursion joke, ANSI standard @printindex cp @contents @bye xzgv-0.9.2/AUTHORS0000640000175000017500000000015513152752546012537 0ustar diegodiegoRussell Marks and others; see the "Acknowledgements" section in the info file or man page. xzgv-0.9.2/Makefile0000640000175000017500000000325513152752546013133 0ustar diegodiego# top-level Makefile for xzgv # ----------------------------------------- # >>> NB: if you're looking to edit this to # configure xzgv, edit `config.mk' instead. # ----------------------------------------- # The main targets of interest are: # # all the default; make everything except info # info make info (requires texinfo's `makeinfo') # install install everything # uninstall can't imagine what use you could possibly have for this :^) # clean clean up # # tgz make distribution tar.gz # version number, needed for distrib-making stuff below. # VERS=0.9.2 all: src man src: xzgv # We try this the whole time, as the dependancies are a bit # complicated to duplicate here. xzgv: cd src && $(MAKE) xzgv src/install-info: src/install-info.c cd src && $(MAKE) install-info man: doc/xzgv.1 doc/xzgv.1: doc/xzgv.texi doc/makeman.awk cd doc && $(MAKE) xzgv.1 # Like in GNU stuff, info files aren't automatically remade, # as I don't want to assume everyone has texinfo's `makeinfo' handy. info: doc/xzgv.info.gz doc/xzgv.info.gz: doc/xzgv.texi cd doc && $(MAKE) info clean: cd src && $(MAKE) clean cd doc && $(MAKE) clean $(RM) *~ realclean: cd src && $(MAKE) realclean cd doc && $(MAKE) realclean $(RM) *~ install: all cd src && $(MAKE) install cd doc && $(MAKE) install uninstall: cd src && $(MAKE) uninstall cd doc && $(MAKE) uninstall # The stuff below makes the distribution tgz. dist: ../xzgv-$(VERS).tar.gz # Based on the example in ESR's Software Release Practice HOWTO. # ../xzgv-$(VERS).tar.gz: info man realclean $(RM) ../xzgv-$(VERS) @cd ..;ln -s xzgv xzgv-$(VERS) cd ..;tar zchf xzgv-$(VERS).tar.gz --exclude=.svn xzgv-$(VERS) @cd ..;$(RM) xzgv-$(VERS) xzgv-0.9.2/mkinstalldirs0000750000175000017500000000133413152752546014274 0ustar diegodiego#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.10 1996/05/03 07:37:52 friedman Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here xzgv-0.9.2/COPYING0000640000175000017500000004307013152752546012525 0ustar diegodiego GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. xzgv-0.9.2/src/0000750000175000017500000000000013152752612012246 5ustar diegodiegoxzgv-0.9.2/src/rename.c0000640000175000017500000001251513152752546013674 0ustar diegodiego/* xzgv v0.3 - picture viewer for X, with file selector. * Copyright (C) 1999,2000 Russell Marks. See main.c for license details. * * rename.c - file rename dialog. */ #include #include #include #include #include #include #include #include #include "backend.h" #include "main.h" #include "rename.h" static GtkWidget *rename_win; static int current_row; static char *oldname; static void cb_ok_button(GtkWidget *button,GtkWidget *entry) { struct stat sbuf; char *tn_src,*tn_dst; char *dest=g_strdup(gtk_entry_get_text(GTK_ENTRY(entry))); gtk_widget_destroy(rename_win); if(!dest || *dest==0) { free(dest); return; } /* refuse anything with path elements in */ if(strchr(dest,'/')) { free(dest); error_dialog("xzgv error","File must remain in current directory"); return; } /* refuse the renaming if it would blast an existing file */ if(stat(dest,&sbuf)!=-1) { free(dest); error_dialog("xzgv error","File already exists"); return; } if(rename(oldname,dest)==-1) { free(dest); error_dialog("xzgv error","Couldn't rename file!"); return; } /* try renaming any thumbnail, and rename entry when it won't break oldname */ tn_src=tn_dst=NULL; /* ".xvpics/" is 8 chars */ if((tn_src=malloc(8+strlen(oldname)+1))==NULL || (tn_dst=malloc(8+strlen(dest)+1))==NULL) { /* rename entry */ gtk_clist_set_text(GTK_CLIST(clist),current_row,SELECTOR_NAME_COL,dest); if(tn_src) free(tn_src); resort_finish(); return; } strcpy(tn_src,".xvpics/"); strcat(tn_src,oldname); strcpy(tn_dst,".xvpics/"); strcat(tn_dst,dest); rename(tn_src,tn_dst); /* don't much care if it works or not */ /* rename entry */ gtk_clist_set_text(GTK_CLIST(clist),current_row,SELECTOR_NAME_COL,dest); free(tn_dst); free(tn_src); free(dest); resort_finish(); } void cb_rename_file(void) { GtkWidget *vbox; GtkWidget *action_tbl,*ok_button,*cancel_button; GtkWidget *table; GtkWidget *label,*entry; static char buf[1024]; int tbl_row; current_row=GTK_CLIST(clist)->focus_row; if(current_row<0 || current_row>=numrows) return; oldname=NULL; gtk_clist_get_text(GTK_CLIST(clist),current_row,SELECTOR_NAME_COL,&oldname); rename_win=gtk_dialog_new(); gtk_window_set_title(GTK_WINDOW(rename_win),"Rename file"); gtk_window_set_policy(GTK_WINDOW(rename_win),FALSE,TRUE,FALSE); gtk_window_set_position(GTK_WINDOW(rename_win),GTK_WIN_POS_CENTER); /* must be modal */ gtk_window_set_modal(GTK_WINDOW(rename_win),TRUE); /* make a new vbox for the top part so we can get spacing more sane */ vbox=gtk_vbox_new(FALSE,10); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(rename_win)->vbox), vbox,TRUE,TRUE,0); gtk_widget_show(vbox); gtk_container_set_border_width(GTK_CONTAINER(vbox),5); gtk_container_set_border_width( GTK_CONTAINER(GTK_DIALOG(rename_win)->action_area),5); /* add ok/cancel buttons */ action_tbl=gtk_table_new(1,5,TRUE); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(rename_win)->action_area), action_tbl,TRUE,TRUE,0); gtk_widget_show(action_tbl); ok_button=gtk_button_new_with_label("Ok"); gtk_table_attach_defaults(GTK_TABLE(action_tbl),ok_button, 1,2, 0,1); /* we connect the signal later, so we can refer to the text-entry */ gtk_widget_show(ok_button); cancel_button=gtk_button_new_with_label("Cancel"); gtk_table_attach_defaults(GTK_TABLE(action_tbl),cancel_button, 3,4, 0,1); gtk_signal_connect_object(GTK_OBJECT(cancel_button),"clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(rename_win)); gtk_widget_show(cancel_button); table=gtk_table_new(2,3,TRUE); gtk_box_pack_start(GTK_BOX(vbox),table,TRUE,TRUE,0); gtk_table_set_col_spacings(GTK_TABLE(table),20); gtk_table_set_row_spacings(GTK_TABLE(table),8); gtk_container_set_border_width(GTK_CONTAINER(table),8); gtk_widget_show(table); #define DO_TBL_LEFT(table,row,name) \ label=gtk_label_new(name); \ gtk_misc_set_alignment(GTK_MISC(label),1.,0.5); \ gtk_table_attach_defaults(GTK_TABLE(table),label, 0,1, (row),(row)+1); \ gtk_widget_show(label) #define DO_TBL_RIGHT(table,row,name) \ label=gtk_label_new(name); \ gtk_misc_set_alignment(GTK_MISC(label),0.,0.5); \ gtk_table_attach_defaults(GTK_TABLE(table),label, 1,3, (row),(row)+1); \ gtk_widget_show(label) tbl_row=0; DO_TBL_LEFT(table,tbl_row,"Old filename:"); DO_TBL_RIGHT(table,tbl_row,oldname); tbl_row++; DO_TBL_LEFT(table,tbl_row,"New filename:"); entry=gtk_entry_new_with_max_length(sizeof(buf)-1); gtk_entry_set_text(GTK_ENTRY(entry), oldname); gtk_table_attach_defaults(GTK_TABLE(table),entry, 1,3, tbl_row,tbl_row+1); gtk_widget_grab_focus(entry); gtk_widget_show(entry); gtk_signal_connect(GTK_OBJECT(entry),"activate", GTK_SIGNAL_FUNC(cb_ok_button),GTK_OBJECT(entry)); /* finally connect up the ok button */ gtk_signal_connect(GTK_OBJECT(ok_button),"clicked", GTK_SIGNAL_FUNC(cb_ok_button),GTK_OBJECT(entry)); /* esc = cancel */ gtk_widget_add_accelerator(cancel_button,"clicked", mainwin_accel_group, GDK_Escape,0,0); gtk_widget_add_accelerator(ok_button,"clicked", mainwin_accel_group, GDK_Return,0,0); gtk_widget_show(rename_win); /* that's it then; it's modal so we can just leave GTK+ to deal with things. */ } xzgv-0.9.2/src/help.c0000640000175000017500000000667713152752546013371 0ustar diegodiego/* xzgv - picture viewer for X, with file selector. * Copyright (C) 1999-2003 Russell Marks. See main.c for license details. * * help.c - help viewing, and about box. */ #include #include #include #include #include #include #include #include #include #include #include "backend.h" #include "main.h" #include "rcfile.h" /* for XZGV_VER */ #include "help.h" void help_about(void) { GtkWidget *about_win; GtkWidget *vbox,*label,*action_tbl,*button; about_win=gtk_dialog_new(); /* make a new vbox for the top part so we can get spacing more sane */ vbox=gtk_vbox_new(FALSE,10); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(about_win)->vbox), vbox,TRUE,TRUE,0); gtk_widget_show(vbox); gtk_container_set_border_width(GTK_CONTAINER(vbox),5); gtk_container_set_border_width( GTK_CONTAINER(GTK_DIALOG(about_win)->action_area),2); gtk_window_set_title(GTK_WINDOW(about_win),"About xzgv"); gtk_window_set_policy(GTK_WINDOW(about_win),FALSE,TRUE,TRUE); gtk_window_set_position(GTK_WINDOW(about_win),GTK_WIN_POS_CENTER); /* doesn't really need to be modal, but it'd be confusing if it weren't */ gtk_window_set_modal(GTK_WINDOW(about_win),TRUE); label=gtk_label_new("xzgv " XZGV_VER " - picture viewer for X with file selector\n" "Copyright (C) 1999-2005 Russell Marks\n" "Copyright (C) 2007 Reuben Thomas\n" "Homepage - http://sourceforge.net/projects/xzgv"); gtk_box_pack_start(GTK_BOX(vbox),label,TRUE,TRUE,2); gtk_widget_show(label); /* add ok button */ action_tbl=gtk_table_new(1,3,TRUE); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(about_win)->action_area), action_tbl,TRUE,TRUE,0); gtk_widget_show(action_tbl); button=gtk_button_new_with_label("Ok"); gtk_table_attach_defaults(GTK_TABLE(action_tbl),button, 1,2, 0,1); gtk_signal_connect_object(GTK_OBJECT(button),"clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(about_win)); gtk_widget_grab_focus(button); gtk_widget_show(button); /* also allow escs (even from main window!) */ gtk_widget_add_accelerator(button,"clicked",mainwin_accel_group, GDK_Escape,0,0); gtk_widget_show(about_win); } /* currently, this runs info in an xterm on the specified node. * It's better than nothing, but it wouldn't hurt to have something * nicer... :-) * * And don't worry, this *will* be configurable in future (XXX). */ void help_run(char *node) { char *cmd_start="xterm -e info '(xzgv)"; char *cmd_end="' &"; char *buf; if((buf=malloc(strlen(cmd_start)+strlen(node)+strlen(cmd_end)+1))==NULL) { /* if we're *that* low on memory, then error_dialog() will fail too, * so just return. */ return; } strcpy(buf,cmd_start); strcat(buf,node); strcat(buf,cmd_end); /* XXX it turns out the error check is useless, as the `&' leads to * starting another shell which is the one to give any errors. The * one we directly run here is always happy, error or not. :-/ * Looks like I'll need the full fork/exec junk, oh well... */ if(system(buf)!=0) { char *msg="Couldn't run help command:\n"; char *buf2; if((buf2=malloc(strlen(msg)+strlen(buf)+1))==NULL) error_dialog("xzgv error",msg); else { strcpy(buf2,msg); strcat(buf2,buf); error_dialog("xzgv error",buf2); free(buf2); } free(buf); return; } free(buf); } xzgv-0.9.2/src/main.c0000640000175000017500000033117013152752546013352 0ustar diegodiego/* xzgv - picture viewer for X, with file selector. * Copyright (C) 1999-2003 Russell Marks. * Copyright (C) 2007 Reuben Thomas. * * main.c - the guts of the program (selector, viewer, etc.). * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* XXX there's really too much stuff here, much of it could/should * be moved out to other files... */ #include #include #include #include #include /* for pow() */ #include #include #include #include #include #include #include #include /* needed for iconify stuff */ #include #include /* needed for iconify stuff */ #include "backend.h" #include "resizepic.h" #include "rcfile.h" /* needed for config vars */ #include "filedetails.h" #include "gotodir.h" #include "updatetn.h" #include "confirm.h" #include "misc.h" #include "copymove.h" #include "rename.h" #include "help.h" #include "dir_icon.xpm" #include "dir_icon_small.xpm" #include "file_icon.xpm" #include "file_icon_small.xpm" #include "icon-48.xpm" #include "main.h" /* number of thumbnails idle_xvpic_load() attempts to load per call. * 1 is a little on the small side :-), but should keep it tolerably * interactive while loading thumbnails on slower machines (I hope!). */ #define IDLE_XVPIC_NUM_PER_CALL 1 /* row heights - normal and `thin'. I wouldn't mess about with these * unless you have a really good reason to. :-) */ #define ROW_HEIGHT_NORMAL (60+2) #define ROW_HEIGHT_DIV 3 #define ROW_HEIGHT_THIN (20+2) /* GTK+ border width in scrolled window (not counting scrollbars). * very kludgey, but needed for calculating size to zoom to. */ #define SW_BORDER_WIDTH 4 /* maximum no. of `past positions' in dirs to save. * if it runs out of space the oldest entries are lost. */ #define MAX_PASTPOS 256 /* limit on scaling down - entirely arbitrary */ #define SCALING_DOWN_LIMIT (-32) /* for defence against render_pixmap recursive callbacks, etc. * Be sure to do RECURSE_PROTECT_END before *any* possible exit * (but as late as possible, of course). */ #define RECURSE_PROTECT_START static int here=0; if(here) return; here=1 #define RECURSE_PROTECT_END here=0 GtkWidget *drawing_area,*align,*sw_for_pic; GtkWidget *clist,*statusbar,*sw_for_clist; GtkWidget *selector_menu,*viewer_menu; GtkWidget *zoom_widget; /* widget for zoom opt on menu */ GtkWidget *pane; guint sel_id; /* selector id for statusbar messages */ guint tn_id; /* `thumbnail' id for statusbar messages */ GtkWidget *mainwin; guint8 xvpic_pal[256][3]; /* palette for thumbnails */ /* image & rendered pixmap for currently-loaded image */ xzgv_image *theimage=NULL; GdkPixmap *thepixmap=NULL; /* no-thumbnail icon pixmaps */ GdkPixmap *dir_icon,*file_icon; GdkPixmap *dir_icon_small,*file_icon_small; GdkBitmap *dir_icon_mask,*file_icon_mask; GdkBitmap *dir_icon_small_mask,*file_icon_small_mask; /* stuff for the idle-func thumbnail loading */ gint tn_idle_tag=-1; /* tag returned by gtk_idle_add() */ float idle_xvpic_lastadjval; int idle_xvpic_jumped=0; /* true if xvpic load jumped ahead */ int idle_xvpic_blocked=0; /* disables idle_xvpic_load() temporarily */ int idle_xvpic_called=0; /* set when idle_xvpic_load is called */ int numrows=0; /* number of rows in clist */ gint zoom_resize_idle_tag=-1; /* tag for zoom-resize kludge idle func */ int listen_to_toggles=0; /* ignore fix-up toggles initially */ /* (see init_window()) */ int in_nextprev=0; /* needed to protect against recursion */ float orig_x,orig_y; /* for image dragging with mouse */ int ignore_drag=1; /* ignore image drags if true */ int next_on_release=0; /* if true, do next-pic on but1 release */ int current_selection=-1; /* needed for viewer's next/previous file */ guint cb_selection_id; /* id of cb_selection() handler */ int ignore_selector_input=0; /* awkward but necessary, for blocking input */ int hide_saved_pos; /* saved pane-split pos for auto-hide */ int hidden=0; /* selector hidden if true */ int orient_current_state=0; /* current picture orientation state */ int jpeg_exif_orient=0; /* orientation from Exif tag, for some JPEGs */ int cmdline_files=0; /* if true, started as `xzgv file(s)' */ int xscaling=1,yscaling=1; struct pastpos_tag { int dev,inode,row; } pastpos[MAX_PASTPOS]; /* Scary orientation stuff * ----------------------- * * There are eight possible orientations (0 is the original image): * _____ _____ * _______ _______ | a| | b| * |a | |b | | | | | * | 0 | | 1 | | 4 | | 5 | * |______b| |______a| |b____| |a____| * _______ _______ _____ _____ * | b| | a| |b | |a | * | 2 | | 3 | | | | | * |a______| |b______| | 6 | | 7 | * |____a| |____b| * * That gives us these changes in orientation state for each of the * orientation-changing operations (rotate, mirror, flip): * * rot-cw rot-acw mirror flip * 0 to... 4 5 3 2 * 1 to... 5 4 2 3 * 2 to... 7 6 1 0 * 3 to... 6 7 0 1 * 4 to... 1 0 7 6 * 5 to... 0 1 6 7 * 6 to... 2 3 5 4 * 7 to... 3 2 4 5 */ int orient_state_rot_cw[8] ={4,5,7,6,1,0,2,3}; int orient_state_rot_acw[8]={5,4,6,7,0,1,3,2}; int orient_state_mirror[8] ={3,2,1,0,7,6,5,4}; int orient_state_flip[8] ={2,3,0,1,6,7,4,5}; /* required prototypes */ void render_pixmap(int reset_pos); void cb_nextprev_tagged_image(int next,int view); gint idle_xvpic_load(int *entryp); gint pic_win_resized(GtkWidget *widget,GdkEventConfigure *event); void cb_scaling_double(void); void cb_xscaling_double(void); void cb_yscaling_double(void); void cb_scaling_halve(void); void cb_xscaling_halve(void); void cb_yscaling_halve(void); void cb_next_image(void); void cb_tag_then_next(void); void set_title(int include_dir); void set_window_pos_and_size(void); void swap_xyscaling(void) { int tmp=xscaling; xscaling=yscaling; yscaling=tmp; } /* change from one orientation state to another. * (See the comment about this above.) */ void orient_change_state(int from,int to) { /* the basic idea is this: * * - if from and to are equal, return. * - if a single flip/mirror/rot will do it, use that. * - otherwise, try a rotate if we know it's needed (see below). * - then see if a flip/mirror does the trick. * - if not, it must need flip *and* mirror. */ int state=from; if(from==to) return; #define DO_FLIP backend_flip_vert(theimage) #define DO_MIRROR backend_flip_horiz(theimage) #define DO_ROT_CW backend_rotate_cw(theimage), \ swap_xyscaling() /* try a one-step route. */ if(orient_state_flip[state]==to) { DO_FLIP; return; } if(orient_state_mirror[state]==to) { DO_MIRROR; return; } if(orient_state_rot_cw[state]==to) { DO_ROT_CW; return; } /* nope, ok then, things get complicated. * we can get any required rotate out of the way - * if it's switched from portrait to landscape or vice versa, we must * need one. That's if it's gone from 0..3 to 4..7 or 4..7 to 3..0. */ if((from<4 && to>=4) || (from>=4 && to<4)) { DO_ROT_CW; state=orient_state_rot_cw[state]; } /* now try a flip/mirror. */ if(orient_state_flip[state]==to) { DO_FLIP; return; } if(orient_state_mirror[state]==to) { DO_MIRROR; return; } /* no? Well it must need both then. */ DO_FLIP; DO_MIRROR; /* sanity check */ if(orient_state_mirror[orient_state_flip[state]]!=to) fprintf(stderr,"can't happen - orient_change_state(%d,%d) failed!\n", from,to); } /* run GTK+ stuff until events are dealt with. Normally the idle func * to load thumbnails, if running, would take this opportunity to * completely finish loading the thumbnails. So we disable that * temporarily. */ void do_gtk_stuff(void) { idle_xvpic_blocked=1; idle_xvpic_called=0; while(!idle_xvpic_called && gtk_events_pending()) gtk_main_iteration(); idle_xvpic_blocked=0; } /* small wrapper function for backend_create_image_from_file() which * deals with mrf files and other oddities (currently GIF/PNG). * * It also copes with loading JPEGs quickly for thumbnails, hence * the second arg. :-) The original width/height of the image * (which is likely to differ from that of the image returned in the * latter case) is returned in orig[wh]p if non-NULL. */ xzgv_image *load_image(char *file,int for_thumbnail, int *origwp,int *orighp) { xzgv_image *ret; int origw,origh; jpeg_exif_orient=0; ret=backend_create_image_from_file(file); /* use backend's loader */ if((ret != NULL) && use_exif_orient) jpeg_exif_orient=backend_get_orientation_from_file(file); origw=0; origh=0; if(ret) { origw=ret->w; origh=ret->h; } if(origwp) *origwp=origw; if(orighp) *orighp=origh; return(ret); } GtkAccelGroup *mainwin_accel_group; GtkItemFactory *make_menu(char *base,GtkItemFactoryEntry *menu_items, int num_items) { GtkItemFactory *item_factory; mainwin_accel_group=gtk_accel_group_new(); item_factory=gtk_item_factory_new(GTK_TYPE_MENU,base,mainwin_accel_group); /* make menus */ gtk_item_factory_create_items(item_factory,num_items,menu_items,NULL); /* add keys to window */ gtk_window_add_accel_group(GTK_WINDOW(mainwin),mainwin_accel_group); return(item_factory); } gint cb_quit(GtkWidget *widget) { gtk_main_quit(); /* stop e.g. thumbnail update */ mainwin=NULL; return(TRUE); } /* make a row visible if it's partly/fully obscured or `offscreen'. */ void make_visible_if_not(int row) { if(gtk_clist_row_is_visible(GTK_CLIST(clist),row)!=GTK_VISIBILITY_FULL) gtk_clist_moveto(GTK_CLIST(clist),row,0,0.5,0.); } /* moving the cursor while the clist is focused can screw up the display. * Instead, we unfocus the clist (if focused), change rows, then * (if it was previously focused) return focus to clist. */ void set_focus_row(int new_row) { int had_focus=GTK_WIDGET_HAS_FOCUS(clist); if(had_focus) gtk_widget_grab_focus(drawing_area); GTK_CLIST(clist)->focus_row=new_row; if(had_focus) gtk_widget_grab_focus(clist); } /* gets whether a row is tagged or not. * Really just for convenience, and by analogy with set_tagged_state(). :-) */ int get_tagged_state(int row) { struct clist_data_tag *datptr; if(row<0 || row>=numrows) return(0); datptr=gtk_clist_get_row_data(GTK_CLIST(clist),row); return(datptr->tagged); } /* sets whether a row is tagged or not. * tagged=0 to untag, 1 to tag, -1 to toggle. */ void set_tagged_state(int row,int tagged) { /* XXX colour used for tagging should be configurable */ static GdkColor col={0, 0xffff,0,0}; /* red */ static int gotcol=0; struct clist_data_tag *datptr; datptr=gtk_clist_get_row_data(GTK_CLIST(clist),row); if(datptr->isdir) return; if(datptr) { if(tagged==-1) datptr->tagged=!datptr->tagged; else datptr->tagged=tagged; } if(!gotcol) backend_get_closest_colour(&col),gotcol=1; gtk_clist_set_foreground(GTK_CLIST(clist),row,datptr->tagged?&col:NULL); } /* tag_file and untag_file are used when tagging from the keyboard, * or from the tag/untag file menu options. */ void cb_tag_file(void) { int row=GTK_CLIST(clist)->focus_row; if(row<0) return; set_tagged_state(row,1); /* tag */ if(rowfocus_row; if(row<0) return; set_tagged_state(row,0); /* untag */ if(row