diff -up xzgv-0.9/Makefile.foo xzgv-0.9/Makefile --- xzgv-0.9/Makefile.foo 2007-09-09 20:12:48.000000000 +0200 +++ xzgv-0.9/Makefile 2009-01-10 15:20:11.000000000 +0100 @@ -42,9 +42,9 @@ doc/xzgv.1: doc/xzgv.texi doc/makeman.aw # 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.gz +info: doc/xzgv.info.gz -doc/xzgv.gz: doc/xzgv.texi +doc/xzgv.info.gz: doc/xzgv.texi cd doc && $(MAKE) info clean: @@ -52,6 +52,11 @@ 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 diff -up xzgv-0.9/doc/Makefile.foo xzgv-0.9/doc/Makefile --- xzgv-0.9/doc/Makefile.foo 2007-09-09 20:27:58.000000000 +0200 +++ xzgv-0.9/doc/Makefile 2009-01-10 15:20:11.000000000 +0100 @@ -10,12 +10,12 @@ include ../config.mk all: info man -info: xzgv.gz +info: xzgv.info.gz dvi: xzgv.dvi -xzgv.gz: xzgv.texi - makeinfo xzgv.texi - gzip -f xzgv +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. :-) @@ -38,16 +38,20 @@ installdirs: install: installdirs install xzgv.1 $(MANDIR) - install xzgv.gz $(INFODIR) - install-info --infodir=$(INFODIR) xzgv.gz + 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 + 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.dvi + +realclean: clean + $(RM) xzgv.1 xzgv.info.gz + diff -up xzgv-0.9/doc/xzgv.texi.foo xzgv-0.9/doc/xzgv.texi --- xzgv-0.9/doc/xzgv.texi.foo 2007-09-09 20:27:28.000000000 +0200 +++ xzgv-0.9/doc/xzgv.texi 2009-01-10 15:20:11.000000000 +0100 @@ -1,6 +1,6 @@ \input texinfo @c -*-texinfo-*- @c %**start of header -@setfilename xzgv +@setfilename xzgv.info @settitle The xzgv manual @setchapternewpage odd @c %**end of header @@ -47,6 +47,7 @@ The xzgv manual, for version @value{VERS @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 @@ -74,12 +75,13 @@ approved by the Free Software Foundation @title xzgv @subtitle A picture viewer for X, with thumbnail-based file selector @subtitle version @value{VERSION} -@author Russell Marks +@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 @@ -149,8 +151,7 @@ The thumbnails used (thumbnails being sm 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. (Details of file formats supported are given -elsewhere. @xref{Supported File Formats}.) +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 @@ -192,17 +193,11 @@ xzgv. xzgv can do a lot more; read on to @c first, direct (or direct-ish :-)) xzgv contributions: xzgv was primarily written by Russell Marks, also the author of this -manual. +manual. It is maintained by Reuben Thomas. Costa Sapuntzakis contributed code for much faster JPEG thumbnail generation (to zgv, which I adapted for xzgv). -@c this isn't really `direct', but I think it belongs here. -@code{install-info} is a (very) slightly modified version of the -original (which is part of the @code{texinfo} package). This program is -used during installation. I think it was mostly written by Karl Berry, -but it's not terribly clear. - 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. @@ -213,28 +208,12 @@ was written by Noah Friedman. (This is a @c now libraries etc.: Huge thanks go to the many people responsible for GTK+, without which -xzgv would almost certainly not have happened. Thanks also to the -Rasterman (Carsten Haiztler) for Imlib, without which xzgv would most -likely have been a complete pain to write. (But no thanks for Electric -Eyes, which was nearly nice enough for me not to bother with xzgv at -all! :-)) - -This program is based in part on the work of the Independent JPEG -Group. (I don't think I actually need this line any more, but I like -giving these guys a credit, it's a neat library. :-)) - -xzgv uses (or rather it does if @code{INTERP_MMX} was defined when -compiling, and if it's running on an MMX-capable CPU) MMX instructions -for interpolation, with the help of libmmx, by Hank Dietz and Randy -Fisher. +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. -``The Graphics Interchange Format(c) is the Copyright property of -CompuServe Incorporated. GIF(sm) is a Service Mark property of -CompuServe Incorporated.'' - - @node Invoking xzgv, A Note on Notation, Acknowledgements, Top @comment node-name, next, previous, up @chapter Invoking xzgv @@ -300,11 +279,6 @@ Here's what the options do: Automatically hide selector when a picture is selected, allowing the viewer to use the whole window. -@c I would never have defaulted to the fast/sloppy method if given -@c a choice, but Imlib1 did it without my knowing, such that when -@c I started reading JPEGs natively, I `had' to do it this way -@c around to avoid apparently gratuitous slowdown. :-( -@c @vindex careful-jpeg @item --careful-jpeg Enable libjpeg `fancy upsampling'. xzgv defaults to using the faster @@ -322,10 +296,9 @@ override.) @vindex dither-hicol @item --dither-hicol -Use dithering in 15/16-bit, whatever Imlib's default setting is. +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 if Imlib normally has -it enabled. +also use @code{--dither-hicol=off} to disable this. @vindex exif-orient @item --exif-orient @@ -503,10 +476,7 @@ If started with @code{xzgv @var{files}}, 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. (By -the way, running like this also makes it possible to view files without -the usual extensions such as @file{.gif}, etc. @xref{File Type -Identification}.) +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 @@ -830,13 +800,13 @@ move around the list, but it reads them 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 Imlib +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 -Imlib was able to allocate a large number of colours; however, it gives +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 Imlib to draw the thumbnail pixmaps, or by dithering them `by +using gdk to draw the thumbnail pixmaps, or by dithering them `by hand' to suit the colours available). @item @@ -2548,14 +2518,13 @@ and see. (No keyboard shortcut --- see a @cindex pictures, file formats used by Picture files are stored in a variety of different forms, or `file -formats'. xzgv, via Imlib, supports many. +formats'. xzgv, via gdk, supports many. @menu * File Type Identification:: How xzgv identifies the type of a file. -* Supported File Formats:: The file formats that xzgv supports. @end menu -@node File Type Identification, Supported File Formats, File Formats, File Formats +@node File Type Identification, , File Formats, File Formats @comment node-name, next, previous, up @section File Type Identification @@ -2564,120 +2533,13 @@ formats'. xzgv, via Imlib, supports many @cindex picture format, identification of @cindex file format, identification of -The format a file is in is identified in two different ways. The file -selector picks filenames to display based on the `extension' --- for -instance, if a filename ends in @file{.jpg} or @file{.jpeg}, xzgv assumes -it is a JPEG. This way of working is not always right, but it's much -faster than the alternative (reading part of every single file) and is -usually sufficient. - -The file-reading code relies on Imlib 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 format supported by Imlib (such as JPEG), the format will be -figured out and the file loaded even though the `extension' is absent. - -One extension to this is xzgv's built-in support for my relatively -obscure `mrf' format. :-) Since there's probably not much interest in -supporting this in Imlib, and it's really quite a simple format, it's -not unreasonable for xzgv to support this directly. But xzgv acts as if -Imlib supported mrf, so this distinction can be largely ignored. - -In fact, xzgv is gradually moving towards reading several of the more -popular formats natively, as part of an attempt to avoid being tied to a -single image rendering/loading backend; at the time of writing, GIF, -JPEG, PNG, and TIFF are also read in this way. - - -@node Supported File Formats, , File Type Identification, File Formats -@comment node-name, next, previous, up -@section Supported File Formats - -@cindex supported file formats -@cindex file formats, supported -@cindex types of picture supported -@cindex GIF -@cindex JPEG -@cindex PNG -@cindex PBM -@cindex PGM -@cindex PPM -@cindex PNM -@cindex TGA -@cindex Targa -@cindex PCX -@cindex mrf -@cindex PRF -@cindex XBM -@cindex bitmaps, X -@cindex XPM -@cindex pixmaps, X -@cindex TIFF -@cindex TIM -@cindex XWD - -xzgv supports the following file formats: - -@itemize @bullet -@item -GIF. - -@item -JPEG. - -@item -PNG. - -@item -PBM/PGM/PPM, collectively known as `PNM'. This is a nice simple format -used by pbmplus and netpbm. - -@item -BMP. - -@item -TGA (Targa). - -@item -PCX. - -@item -mrf. Mrf files can be converted to/from PBM with mrftopbm/pbmtomrf, and -the format is documented in the @cite{mrf(5)} man page. - -@item -PRF. PRF is an extension of mrf, similarly converted with -prftopnm/pnmtoprf, and documented in the @cite{prf(5)} man page. - -@item -XBM (X bitmap files). - -@item -XPM. - -@item -TIFF. - -@item -TIM. This is an image format used (on the Sony PlayStation) by some -games (e.g. Wipeout) for storing 2D images. - -@item -XWD (X window dumps, as produced by xwd). - -@c [XXX xzgv doesn't support these as files yet (will need yet more -@c Imlib-bypassing code, sigh), and doesn't treat them as their own -@c thumbnails] -@c Xv format thumbnail files. Normally you won't want to view these other -@c than in the file selector, but xzgv lets you view them as normal picture -@c files if you want. Note that in the file selector, thumbnail files are -@c indistinguishable from the files they represent (other than the -@c @file{.xvpics} in the directory's filename) --- they have the same -@c filenames, and thumbnails are their own thumbnails. :-) - -@end itemize - +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 @@ -3037,8 +2899,8 @@ hiding/showing selector or resizing from I kludged it :-)). @item -When scaling up and imlib is dithering, you end up with a crappy-looking -picture if you drag the picture around slowly (since each exposed bit is +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). @@ -3060,10 +2922,10 @@ window-splitting bit, but I'm not sure. across scrollbar sliders and the paned window splitter handle. @item -It doesn't apply any tranparency mask returned by imlib. 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. +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 @@ -3089,13 +2951,7 @@ nature, see xzgv''. :-) @itemize @minus @item Thumbnails are given an accurate width/height `IMGINFO' comment, but are -always claimed to be "RGB", as Imlib doesn't provide any way to find out -what type they are. - -@item -xzgv should have an option to treat all files as images, since it -currently applies a zgv-like file extension filter. This is a bit -inflexible, given that Imlib supports `all' formats. +always claimed to be "RGB". @item xzgv @emph{doesn't} duplicate zgv's behaviour of generating thumbnails @@ -3115,9 +2971,6 @@ suboptimal, but as an incompatibility wi @itemize @minus @item -GIF89a extension blocks are ignored. - -@item Only the first image of a multiple-image GIF is used. (These days, multiple-image GIFs are usually animations.) @end itemize @@ -3148,11 +3001,8 @@ Here are some details you should include The version of xzgv you are running. @code{xzgv --version} reports this. @item -The versions of GTK+ and Imlib you are using. @code{xzgv --version-gtk} -reports the GTK+ version being used by xzgv, but Imlib is a little more -tricky --- @code{imlib-config --version} should work if you have a full -Imlib installation, but failing that, try @code{ls -l -/usr/lib/libImlib*} or @code{ls -l /usr/X11R6/lib/libImlib*}. +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 8-bit (256 @@ -3162,7 +3012,7 @@ depth you're running in, try @code{xdpyi @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 in Imlib? Even +Only when in 8-bit modes? Only when dithering is enabled? Even `irrelevant' details can sometimes be useful. @item @@ -3173,7 +3023,7 @@ the patch using @code{diff -c} or (prefe @end itemize So, if you think you've found a bug in xzgv, report it by emailing me at -@email{rus@@svgalib.org}. +@email{rrt@@sc3d.org}. @node Reporting Documentation Bugs, , Reporting Bugs, Bugs and Restrictions diff -up xzgv-0.9/src/Makefile.foo xzgv-0.9/src/Makefile --- xzgv-0.9/src/Makefile.foo 2007-08-14 00:39:16.000000000 +0200 +++ xzgv-0.9/src/Makefile 2009-01-10 15:20:11.000000000 +0100 @@ -39,6 +39,7 @@ clean: $(RM) *~ *.o xzgv $(RM) rcfile_opt.h rcfile_var.h rcfile_short.h +realclean: clean # dependancies backend.o: backend.c backend.h diff -up xzgv-0.9/src/help.c.foo xzgv-0.9/src/help.c --- xzgv-0.9/src/help.c.foo 2007-09-09 02:45:46.000000000 +0200 +++ xzgv-0.9/src/help.c 2009-01-10 15:20:11.000000000 +0100 @@ -46,7 +46,8 @@ gtk_window_set_modal(GTK_WINDOW(about_wi label=gtk_label_new("xzgv " XZGV_VER " - picture viewer for X with file selector\n" "Copyright (C) 1999-2005 Russell Marks\n" - "Homepage - http://rus.members.beeb.net/xzgv.html"); + "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); diff -up xzgv-0.9/src/main.c.foo xzgv-0.9/src/main.c --- xzgv-0.9/src/main.c.foo 2007-09-09 02:36:21.000000000 +0200 +++ xzgv-0.9/src/main.c 2009-01-10 15:20:36.000000000 +0100 @@ -38,7 +38,8 @@ #include #include #include /* needed for iconify stuff */ -#include /* ditto */ +#include /* http://bugs.debian.org/457252 */ +#include /* needed for iconify stuff */ #include "backend.h" #include "resizepic.h" @@ -105,7 +106,7 @@ guint tn_id; /* `thumbnail' id for sta GtkWidget *mainwin; -gint xvpic_pal[256]; /* palette for thumbnails */ +guint8 xvpic_pal[256][3]; /* palette for thumbnails */ /* image & rendered pixmap for currently-loaded image */ xzgv_image *theimage=NULL; @@ -1704,6 +1705,9 @@ void xy_scaling_double(int do_x,int do_y static int in_routine=0; int xtmp=xscaling,ytmp=yscaling,oldxsc=xscaling,oldysc=yscaling; +/* if there's no image, don't do anything */ +if (!theimage) return; + /* if recursed, don't bother */ if(in_routine) return; in_routine=1; @@ -1752,6 +1756,9 @@ void xy_scaling_add(int do_x,int do_y) static int in_routine=0; int xtmp=xscaling,ytmp=yscaling,oldxsc=xscaling,oldysc=yscaling; +/* if there's no image, don't do anything */ +if (!theimage) return; + /* if recursed, don't bother */ if(in_routine) return; in_routine=1; @@ -1800,6 +1807,9 @@ void xy_scaling_halve(int do_x,int do_y) static int in_routine=0; int xtmp=xscaling,ytmp=yscaling,oldxsc=xscaling,oldysc=yscaling; +/* if there's no image, don't do anything */ +if (!theimage) return; + /* if recursed, don't bother */ if(in_routine) return; in_routine=1; @@ -1851,6 +1861,9 @@ void xy_scaling_sub(int do_x,int do_y) static int in_routine=0; int xtmp=xscaling,ytmp=yscaling,oldxsc=xscaling,oldysc=yscaling; +/* if there's no image, don't do anything */ +if (!theimage) return; + /* if recursed, don't bother */ if(in_routine) return; in_routine=1; @@ -2101,6 +2114,7 @@ listen_to_toggles=1; void cb_flip(void) { +if (!theimage) return; RECURSE_PROTECT_START; backend_flip_vert(theimage); orient_current_state=orient_state_flip[orient_current_state]; @@ -2111,6 +2125,7 @@ RECURSE_PROTECT_END; void cb_mirror(void) { +if (!theimage) return; RECURSE_PROTECT_START; backend_flip_horiz(theimage); orient_current_state=orient_state_mirror[orient_current_state]; @@ -2121,6 +2136,7 @@ RECURSE_PROTECT_END; void cb_rot_cw(void) { +if (!theimage) return; RECURSE_PROTECT_START; /* swap x and y scaling, since the effect if we don't do that * is of the image mysteriously changing. :-) @@ -2135,6 +2151,7 @@ RECURSE_PROTECT_END; void cb_rot_acw(void) { +if (!theimage) return; RECURSE_PROTECT_START; backend_rotate_acw(theimage); orient_current_state=orient_state_rot_acw[orient_current_state]; @@ -2146,6 +2163,7 @@ RECURSE_PROTECT_END; void cb_normal_orient(void) { +if (!theimage) return; RECURSE_PROTECT_START; if(orient_current_state!=0) { @@ -2514,113 +2532,93 @@ return(1); */ void find_xvpic_cols(void) { -GdkColor col; -int r,g,b; -int n; - -for(n=0,r=0;r<8;r++) - for(g=0;g<8;g++) /* colours are 3:3:2 */ - for(b=0;b<4;b++,n++) - { - col.red=r*0xffff/7; col.green=g*0xffff/7; col.blue=b*0xffff/3; - backend_get_closest_colour(&col); - xvpic_pal[n]=col.pixel; - } + int r,g,b; + int n; + + for(n=0,r=0;r<8;r++) { + for(g=0;g<8;g++) {/* colours are 3:3:2 */ + for(b=0;b<4;b++,n++) { + xvpic_pal[n][0]=r*0xff/7; + xvpic_pal[n][1]=g*0xff/7; + xvpic_pal[n][2]=b*0xff/3; + } + } + } } GdkPixmap *xvpic2pixmap(unsigned char *xvpic,int w,int h,GdkPixmap **smallp) { GdkPixmap *pixmap,*small_pixmap; -GdkImage *image; +guint8 *buffer; unsigned char *ptr=xvpic; int x,y; int small_w,small_h; if(w==0 || h==0) return(NULL); -/* we allocate pixmap and image, draw into image, copy to pixmap, - * and ditch the image. - */ - -if((image=gdk_image_new(GDK_IMAGE_FASTEST,backend_get_visual(),w,h))==NULL) - return(NULL); - -if((pixmap=gdk_pixmap_new(mainwin->window,w,h, - gdk_visual_get_best_depth()))==NULL) - { - gdk_image_destroy(image); - return(NULL); - } - -for(y=0;ystyle->white_gc,image,0,0,0,0,w,h); -gdk_flush(); +if (NULL == (pixmap=gdk_pixmap_new(mainwin->window,w,h, -1))) { + return(NULL); +} -/* reuse image to draw scaled-down version for thin rows */ small_w=w/ROW_HEIGHT_DIV; small_h=h/ROW_HEIGHT_DIV; if(small_w==0) small_w=1; if(small_h==0) small_h=1; -if((small_pixmap=gdk_pixmap_new(mainwin->window,small_w,small_h, - gdk_visual_get_best_depth()))==NULL) - { - gdk_pixmap_unref(pixmap); - gdk_image_destroy(image); - return(NULL); +if((small_pixmap=gdk_pixmap_new(mainwin->window,small_w,small_h,-1))==NULL) +{ + gdk_pixmap_unref(pixmap); + return(NULL); +} + +buffer = malloc (w * h * sizeof (guint8) * 3); + +if (NULL == buffer) { + /* malloc failed */ + gdk_pixmap_unref(pixmap); + gdk_pixmap_unref(small_pixmap); + return NULL; +} + + +for(y=0;ystyle->white_gc,0,0,w,h, + GDK_RGB_DITHER_NORMAL, + (guchar*)buffer, w * 3); +gdk_flush(); -gdk_draw_image(small_pixmap,clist->style->white_gc,image, - 0,0,0,0,small_w,small_h); +/* reuse image to draw scaled-down version for thin rows */ -gdk_image_destroy(image); -*smallp=small_pixmap; -return(pixmap); +for(y=0;ystyle->white_gc,0,0,small_w, small_h, + GDK_RGB_DITHER_NORMAL, + (guchar*)buffer, small_w * 3); -int is_picture(char *filename) -{ -int l=strlen(filename); +*smallp=small_pixmap; -if(l<=4) return(0); +if (NULL != buffer) { + free (buffer); +} -/* at time of writing, imlib1 supports PPM/PGM/TIFF/PNG/XPM/JPEG - * natively, and uses ImageMagick's `convert' for others. - * But we have our own GIF/PNG/mrf readers. - */ -if((!strcasecmp(filename+l-4,".gif")) || - (!strcasecmp(filename+l-4,".jpg")) || - (!strcasecmp(filename+l-5,".jpeg")) || - (!strcasecmp(filename+l-4,".png")) || - (!strcasecmp(filename+l-4,".mrf")) || - (!strcasecmp(filename+l-4,".xbm")) || - (!strcasecmp(filename+l-5,".icon")) || /* presumably an XBM */ - (!strcasecmp(filename+l-4,".xpm")) || - (!strcasecmp(filename+l-4,".pbm")) || - (!strcasecmp(filename+l-4,".pgm")) || - (!strcasecmp(filename+l-4,".ppm")) || - (!strcasecmp(filename+l-4,".bmp")) || - (!strcasecmp(filename+l-4,".tga")) || - (!strcasecmp(filename+l-4,".pcx")) || - (!strcasecmp(filename+l-4,".tif")) || - (!strcasecmp(filename+l-5,".tiff")) || - (!strcasecmp(filename+l-4,".prf")) || - (!strcasecmp(filename+l-4,".tim")) || - (!strcasecmp(filename+l-4,".xwd"))) - return(1); -else - return(0); +return(pixmap); } @@ -2993,9 +2991,6 @@ while((dent=readdir(dirfile))!=NULL) } isdir=S_ISDIR(sbuf.st_mode); - if(!isdir && !is_picture(dent->d_name)) - continue; - if(clist_add_new_row(dent->d_name,&sbuf)) numrows++; } @@ -3687,7 +3682,11 @@ static GtkItemFactoryEntry viewer_menu_i }; +gtk_widget_push_visual(gdk_rgb_get_visual()); +gtk_widget_push_colormap(gdk_rgb_get_cmap()); mainwin=gtk_window_new(GTK_WINDOW_TOPLEVEL); +gtk_widget_pop_visual(); +gtk_widget_pop_colormap(); GTK_WIDGET_UNSET_FLAGS(mainwin,GTK_CAN_FOCUS); gtk_signal_connect(GTK_OBJECT(mainwin),"destroy", GTK_SIGNAL_FUNC(cb_quit),NULL);