earlybrowserreborn - Rev 1

Subversion Repositories:
** Copyright 1990,91 GROUPE BULL -- See licence conditions in file COPYRIGHT **

                                XPM Version 3


XPM (X PixMap) is a format for storing/retrieving X pixmaps to/from files.

Here is provided a library containing a set of four functions, similar to the
X bitmap functions as defined in the Xlib: XpmCreatePixmapFromData,
XpmCreateDataFromPixmap, XpmReadFileToPixmap and XpmWriteFileFromPixmap for
respectively including, storing, reading and writing this format, plus four
other: XpmCreateImageFromData, XpmCreateDataFromImage, XpmReadFileToImage and
XpmWriteFileFromImage for working with images instead of pixmaps.

This new version provides a C includable format, defaults for different types
of display: monochrome/color/grayscale, hotspot coordinates and symbol names
for colors for overriding default colors when creating the pixmap. It provides
a mechanism for storing information while reading a file which is re-used
while writing. This way comments, default colors and symbol names aren't lost.
It also handles "transparent pixels" by returning a shape mask in addition to
the created pixmap.

See the XPM Manual for more details.


New xpm updates are announced on the comp.windows.x newsgroup, and on the
"xpm-talk" list. All new "official" xpm releases can be found by ftp on:

    export.lcs.mit.edu ( contrib     (Boston, USA)
    avahi.inria.fr     ( pub         (Sophia Antipolis, France)

You can also retrieve xpm on uunet by e-mail from Richard M. Goldstein:


Old users might read the CHANGES file for a history of changes interesting
the user.

Read the docs (xpm.tex is the manual in LaTeX form). The documentation is in
LaTeX format (IMPORTANT: see the Makefile to know how to print it. The LaTeX
source should work with most dvi2ps or dvips programs. I use myself Tomas
Rokicki's dvips v5.0 that you can get by anonymous ftp on
labrea.stanford.edu).  We can mail you a PostScript version of the
documentation if you are not able to print it, or you can grab one on the ftp


To obtain the XPM library, first uncompress and untar the compressed tar file
in an approriate directory.

Then you can either compile xpm via "imake" or in a stand-alone way.


        The Imakefile is provided. You should know how to use imake to build 
        the XPM Makefile, by executing "xmkmf" then do:

                make depend

        which will build the XPM library and sxpm application. 
        Then do:

                make install
                make install.man

        which will install the library and the sxpm man page.

        If it fails, you may edit the Imakefile to add compilation flags to
        suit your machine.


        To compile xpm, in the xpm directory you just created, do:

                make -f Makefile.noXtree

        Then to install it, do:

                make -f Makefile.noXtree install

NOTE:   if you compile  with gcc, use "gcc -traditional", otherwise you will
        have compilation warnings (but the code will work Ok)


In addition to the library the sxpm tool is provided to show XPM file and
convert them from XPM2 to XPM version 3. If you have previously done 'make' or
'make all' you should have it yet, otherwise just do:

                      make sxpm

This application shows you most of the features of XPM and its source can be
used to quickly see how to use the provided functions

By executing 'sxpm' without any option you will get the usage.

Executing 'sxpm -plaid' will show a demo of the XpmCreatePixmapFromData
function. The pixmap is created from the static variable plaid defined in the
sxpm.c file. Sxpm will end when you press the key Q in the created window.

Executing 'sxpm -s lines_in_mix blue' will show the feature of overriding
color symbols giving a colorname, and executing 'sxpm -p lines_in_mix 1' will
show overriding giving pixel value.

Then you should try 'sxpm -out output' to get an output file using the
XpmWriteFileFromPixmap function.

You can now try 'sxpm -stdout -nod -rgb /usr/lib/X11/rgb.txt' to directly get
the pixmap printed out on the standard output with colornames instead of rgb

Then you should try 'sxpm -in plaid.xpm' to use the XpmReadFileToPixmap function,
and 'sxpm -in plaid_mask.xpm' to see how "transparent pixels" are handled.

The XpmCreatePixmapFromData function is on purpose called without any Xpminfo 
pointer to show the utility of this one. Indeed, compare the color section of
the two files foo and bar obtained from 'sxpm -out foo' and 
'sxpm -in plaid -o bar'.

Of course, other combinations are allowed and should be tried. Thus,
'sxpm -in plaid.xpm -out output -nod' will show you how to convert a file from
XPM2 to a XPM version 3 using sxpm.

See the manual page for more detail.


In the converters directory you can find different converters about XPM.
There is a perl script xpm1to3.pl to convert XPM1 format file to XPM version
3. And there are files to build the converters ppmtoxpm and xpmtoppm; to get
instructions about how to build them you should read the corresponding
ppm.README file.


If two symbols get the same color pixel when reading a pixmap, one will be
lost when writting it out.


There is a mailing list to discuss about XPM which is xpm-talk@sophia.inria.fr.
Any request to subscribe should be sent to xpm-talk-request@sophia.inria.fr.


  Copyright 1990,91 GROUPE BULL --
  See licence conditions in the COPYRIGHT file of the XPM distribution

Please mail any bug reports or modifications done, comments, suggestions,
requests for updates or patches to port on another machine to:

lehors@sophia.inria.fr          (INTERNET)

33 (FRANCE)         (VOICE PHONE)

Arnaud Le Hors                  (SURFACE MAIL)
Bull c/o Inria BP. 109
2004, Route des lucioles
Sophia Antipolis
06561 Valbonne Cedex