summaryrefslogtreecommitdiff
path: root/src/xpm/doc/README
blob: 0807f5a9ed4afff16f8a257322234b359fc60c05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
** Copyright 1990-92 GROUPE BULL -- See license conditions in file COPYRIGHT **

				XPM Version 3

WHAT IS XPM?
============

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.

HOW TO GET XPM?
===============

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 (18.30.0.238) contrib	 (Boston, USA)
    avahi.inria.fr     (192.5.60.47) pub	 (Sophia Antipolis, France)


DOCUMENTATION:
=============

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
servers.

INSTALLATION:
============

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.

WITH IMAKE:

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

		make depend
		make

	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.

WITHOUT IMAKE:

	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)

SXPM:
====

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 -plaid -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 -plaid -o output' to get an output file using the
XpmWriteFileFromPixmap function.

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

Then you should try 'sxpm plaid.xpm' to use the XpmReadFileToPixmap function,
and 'cat plaid_mask.xpm|sxpm' 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 -nod -plaid -o foo' and 
'sxpm -nod plaid.xpm -o bar'.

To end look at plaid_ext.xpm and try "sxpm -nod plaid_ext.xpm -v" to see how
extensions are handled.

Of course, other combinations are allowed and should be tried. Thus, 'sxpm
plaid.xpm -o 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.

CONVERTERS:
==========

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.

KNOWN BUG:
=========

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

DISCUSSION:
==========

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:
==========

  Copyright 1990-92 GROUPE BULL --
  See license 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) 93.65.77.71		(VOICE PHONE)

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