
             A patched version of xv for use with simv


xv is much faster in starting and traditionally i prefer it over 
ImageMagick display. Also it has no configuration modes where it
leaves undestroyed shared memory segments when killed externally.
(ImageMagick nevertheless deserves praise for the immensly valuable
 program convert.)

Unfortunately, xv has the habit to pop up Alert windows with messages
about file problems and to wait for a few seconds before resuming
operation. While this is helpful for dialog situations, for a simv
viewer it is quite annoying.
I changed the xv source to redirect these messages to stderr without
any waiting.

Since xv may not be distributed after alterations, i am restricted to
describing those changes. So you need to get the xv source
(e.g.  http://www.trilon.com/xv/downloads.html) and change it yourself.
After applying the changes, compile xv as usual.

I called my patched version xv.simv , placed it in /usr/local/bin  and
finally wrote additional lines into simv's startup file   $HOME/.simv_rc :


# use the patched version of xv as imager viewer
-viewer_cmd:/usr/local/bin/xv.simv

# since xv cannot read all types of JPEG, apply convert if necessary
-repair_icv:on



-------------------------------------------------------------------------------

                     General idea of the change

If the macro UNGEFUMMELT is defined then the original sourcecode is
in effect. Else the xv window functions and the sleep() call are
replaced by text messages to stderr and eventually a short beep.
That beep is triggered by the existence of a file $HOME/.xv.gefummelt.beep.

In xvmisc.c :

#ifdef UNGEFUMMELT
    OpenAlert(st);
    sleep(3);
    CloseAlert();
#else /* ! UNGEFUMMELT */
... new code : see below at diff output ...

In xvinfo.c :

#ifdef UNGEFUMMELT
    OpenAlert(istrs[stnum]);
    sleep(3);
    CloseAlert();
#else /* ! UNGEFUMMELT */
... new code : see below at diff output ...

-------------------------------------------------------------------------------

The original xv distribution is installed in xv-3.10a while my patched
version is in xv-3.10a.gefummelt .

-------------------------------------------------------------------------------
$ diff xv-3.10a/xvmisc.c xv-3.10a.gefummelt/xvmisc.c

474a475,476
> 
> #ifdef UNGEFUMMELT
477a480,487
> #else /* ! UNGEFUMMELT */
>     fprintf(stderr,
>        "\n************************************************************\n");
>     fprintf(stderr,"xv notice : %s\n",st);
>     fprintf(stderr,
>             "************************************************************\n\n");
> #endif /* ! UNGEFUMMELT */
> 

-------------------------------------------------------------------------------
$ diff xv-3.10a/xvinfo.c xv-3.10a.gefummelt/xvinfo.c

14a15,18
> #ifndef UNGEFUMMELT
> #include <sys/stat.h>
> #endif
> 
24d27
< 
266a270,271
> 
> #ifdef UNGEFUMMELT
269a275,293
> #else /* ! UNGEFUMMELT */
>     {
>       struct stat stbuf;
>       char *home,adr[4096];
> 
>       home= getenv("HOME");
>       if(home!=NULL) {
>         sprintf(adr,"%s/%s",home,".xv.gefummelt.beep");
>         if(stat(adr,&stbuf)!=-1)
>           fprintf(stderr, "\007");
>       }
>     }
>     fprintf(stderr,
>         "\n************************************************************\n");
>     fprintf(stderr,"xv notice : %s\n",istrs[stnum]);
>     fprintf(stderr,
>             "************************************************************\n\n");
> #endif /* ! UNGEFUMMELT */
> 

-------------------------------------------------------------------------------

