diff options
Diffstat (limited to 'src/xpm/doc')
-rw-r--r-- | src/xpm/doc/CHANGES | 422 | ||||
-rw-r--r-- | src/xpm/doc/COPYRIGHT | 30 | ||||
-rw-r--r-- | src/xpm/doc/FILES | 42 | ||||
-rw-r--r-- | src/xpm/doc/Imakefile | 59 | ||||
-rw-r--r-- | src/xpm/doc/Makefile | 433 | ||||
-rw-r--r-- | src/xpm/doc/Makefile.noXtree | 85 | ||||
-rw-r--r-- | src/xpm/doc/README | 176 | ||||
-rw-r--r-- | src/xpm/doc/colas.sty | 294 | ||||
-rw-r--r-- | src/xpm/doc/name-3.0b-3.0c | 48 | ||||
-rw-r--r-- | src/xpm/doc/name-3.0c-3.0 | 32 | ||||
-rw-r--r-- | src/xpm/doc/plaid.xpm | 34 | ||||
-rw-r--r-- | src/xpm/doc/plaid_mask.xpm | 35 | ||||
-rw-r--r-- | src/xpm/doc/xpm.tex | 849 |
13 files changed, 2539 insertions, 0 deletions
diff --git a/src/xpm/doc/CHANGES b/src/xpm/doc/CHANGES new file mode 100644 index 0000000..22f28a5 --- /dev/null +++ b/src/xpm/doc/CHANGES @@ -0,0 +1,422 @@ +/* Copyright 1990-92 GROUPE BULL -- See license conditions in file COPYRIGHT */ +/**************************************************************************\ +* * +* HISTORY of user-visible changes * +* * +\**************************************************************************/ + +3.2c (92/12/29) + + ENHANCEMENTS: + - parsing optimized for single and double characters color + - patch originally from Martin Brunecky + marbru@build1.auto-trol.com + + BUGS CORRECTED: + - XpmFreeExtensions was calling free on some argument without checking + it was not NULL. + - strdup was not correctly defined for systems which do not provide + it. - Hans-Peter Lichtin <lich@zellweger.ch> + - some bug in XpmCrDataFI.c + - Sven Delmas garfield@avalanche.cs.tu-berlin.de + + NOTE: + - there is still a bug with the creation of the clipmask on display of + depth 2 but I can't find a fix because unfortunately I don't have such + a rendering system and nobody gets the time to investigate for me. + +3.2b (92/10/19) + + ENHANCEMENTS: + - Create XpmReadFileToData and XpmWriteFileFromData + - Dan Greening <dgreen@sti.com> + - added "close colors" support and ability to redefine color values + as pixels at load time, as well as color names + - Jason Patterson <jasonp@fitmail.qut.edu.au> + - errors while parsing or allocating colors now revert to other + visual defaults, creating pixmap/image as expected, and returning + XpmSuccess. The old behaviour of XpmColorError being returned and no + pixmap/image being created can be retained by setting the + exactColors attribute. + - Jason Patterson <jasonp@fitmail.qut.edu.au> + + BUGS CORRECTED: + - SVR4 defines for including <string.h> instead of <strings.h> + - Jason Patterson <jasonp@fitmail.qut.edu.au> + - attributes->extensions and attributes->nextensions fields were not + set correctly when no extensions present in file. + - Simon_Scott Cornish <cornish@ecr.mu.oz.au> + +3.2a (92/08/17) + + ENHANCEMENTS: + - use the mock lisp hashing function instead of the gnu emacs one, + it is faster in some cases and never slower (I've not found any case). + + BUGS CORRECTED: + - function prototypes for ansi compilers. + - some memory initialization bugs (purify is just great for this). + - empty strings in extensions are now correctly handled. + +3.2 (92/07/06) + + NEW FEATURES: + - both format and functions handle extensions data. This allow people + to store additional data related to a pixmap. See documentation for + detail. + - sxpm supports the new option '-c' to use a private colormap. This is + useful when displaying pixmaps using a lot of colors. + - sxpm supports the new option '-v' (verbose) to get possible + extensions print out on standard error. + + ENHANCEMENTS: + - most of the code has been reworked to be improved and thus almost + every function is faster. It takes less than 6 seconds of real time on + a sun4 to display, with sxpm, a 487x635 pixmap using 213 colors, while + it takes 32 seconds with the old library! It takes 18 seconds to + display a 1279x1023 screen dump using 14 colors while xwud takes 10 + seconds. + Of course performance improvements are not always that great, they + depend on the size and number of colors but I'm sure everybody will + appreciate ;-) + I know how to improve it more but this will require changes in the + architecture so this is not for now. Some optimizations have been + contributed by gregor@kafka.saic.com (gregg hanna) and + jnc@csl.biosci.arizona.edu (John N. Calley). + - the Imakefile is modified to let you install sxpm - Rainer Klute + <klute@irb.informatik.uni-dortmund.de> + - xpmP.h declares popen for Sequent platforms - Clinton Jeffery + <cjeffery@cs.arizona.edu> + - XpmWriteFileFromImage/Pixmap rather than truncating the pixmap name + to the first dot changes dots to underscores to get a valid C syntax + name. + + + BUGS CORRECTED: + - there was a bug in the image creation function for some 24 bits + displays. It is fixed. + - allocated color pixels are now freed when an error occurs - + nusser@dec1.wu-wien.ac.at (Stefan Nusser) + + CHANGES TO THE DOC: + - the documentation describes the new XpmExtension structure and how + to use it with read and write functions. + +3.1 (92/02/03) + + ENHANCEMENTS: + - sxpm now have more standard options (mainly suggested by + Rainer Sinkwitz <sinkwitz@ifi.unizh.ch>): + + Usage: sxpm [options...] + Where options are: + + [-d host:display] Display to connect to. + [-g geom] Geometry of window. + [-hints] Set ResizeInc for window. + [-icon filename] Set pixmap for iconWindow. + [-s symbol_name color_name] Overwrite color defaults. + [-p symbol_name pixel_value] Overwrite color defaults. + [-plaid] Read the included plaid pixmap. + [filename] Read from file 'filename', and from + standard input if 'filename' is '-'. + [-o filename] Write to file 'filename', and to standard + output if 'filename' is '-'. + [-nod] Don't display in window. + [-rgb filename] Search color names in the rgb text file + 'filename'. + + if no input is specified sxpm reads from stdandard input. + + + - Xpm functions and Ppm converters now deal with multiword colornames. + patches from Rainer Sinkwitz <sinkwitz@ifi.unizh.ch>. + + +3.0 (91/10/03) + + Functions name and defines have been modified again (sorry for that) + as follows: + + XpmReadPixmapFile XpmReadFileToPixmap + XpmWritePixmapFile XpmWriteFileFromPixmap + + XpmPixmapColorError XpmColorError + XpmPixmapSuccess XpmSuccess + XpmPixmapOpenFailed XpmOpenFailed + XpmPixmapFileInvalid XpmFileInvalid + XpmPixmapNoMemory XpmNoMemory + XpmPixmapColorFailed XpmColorFailed + + To update code using Xpm you can use the included shell script called + rename with the sed commands files name-3.0b-3.0c and name-3.0c-3.0. + Old names still valid though. + + NEW FEATURES: + - four new functions to work with images instead of pixmaps: + + XpmReadFileToImage + XpmWriteFileFromImage + XpmCreateImageFromData + XpmCreateDataFromImage + + ENHANCEMENTS: + Algorithms to create and scan images and pixmaps are based on the + MIT's R5 code, thus they are much cleaner than old ones and should + avoid any problem with any visual (yes, I trust MIT folks :-) + + BUGS CORRECTED: + Imakefile use INCDIR instead of ROOTDIR. + + CHANGES TO THE DOC: + - the documentation presents the four new functions. + +3.0c (91/09/18) + + In answer to request of people functions, types and defines names have + been changed as follows: + + XCreatePixmapFromData XpmCreatePixmapFromData + XCreateDataFromPixmap XpmCreateDataFromPixmap + XReadPixmapFile XpmReadPixmapFile + XWritePixmapFile XpmWritePixmapFile + XFreeXpmAttributes XpmFreeAttributes + + PixmapColorError XpmPixmapColorError + PixmapSuccess XpmPixmapSuccess + PixmapOpenFailed XpmPixmapOpenFailed + PixmapFileInvalid XpmPixmapFileInvalid + PixmapNoMemory XpmPixmapNoMemory + PixmapColorFailed XpmPixmapColorFailed + + ColorSymbol XpmColorSymbol + + Generally speaking every public name begins with 'Xpm' and every + private one with 'xpm'. This should avoid any possible conflict. + + Some files have also be renamed accordingly. + + NEW FEATURES: + - support for VMS and two new options for sxpm: icon and hints (see + manual for details) Richard Hess <rhess%pleione%cimshop@uunet.UU.NET> + - DEFINES in Imakefile and Makefile.noXtree allows you to set the + following: + + ZPIPE for un/compressing piped feature (default is on) + NEED_STRCASECMP for system which doesn't provide one (default + is off) + + - xpmtoppm.c has is own strstr function which is used if NEED_STRSTR + is defined when compiling - Hugues.Leroy@irisa.fr (Hugues Leroy). + + BUGS CORRECTED: + - many bugs have been fixed, especially for ansi compilers - + Doyle C. Davidson (doyle@doyled.b23b.ingr.com) and + Clifford D. Morrison (cdm%bigdaddy%edsr@uunet.UU.NET) + - parser is again a little more improved + +3.0b (91/09/12) + + This is a complete new version with a new API and where files and + structures have been renamed. So this should be taken as a new + starting release. + This release should be quickly followed by the 3.0 because I'm planning + to send it for X11R5 contrib which ends October 5th. + + NEW FEATURES: + - support for transparent color. + - support for hotspot. + - a new function: XCreateDataFromPixmap to create an XPM data from a + pixmap in order to be able to create a new pixmap from this data using + the XCreatePixmapFromData function later on. + - a new structure: XpmAttributes which replace the XpmInfo structure + and which leads to a much simpler API with less arguments. + - arguments such as visual, colormap and depth are optionnal, default + values are taken if omitted. + - parsing and allocating color failures don't simply break anymore. If + another default color can be found it is used and a PixmapColorError + is returned. In case no color can be found then it breaks and returns + PixmapColorFailed. + - for this reason the ErrorStatus codes are redefined as follows: + + null if full success + positive if partial success + negative if failure + + with: + #define PixmapColorError 1 + #define PixmapSuccess 0 + #define PixmapOpenFailed -1 + #define PixmapFileInvalid -2 + #define PixmapNoMemory -3 + #define PixmapColorFailed -4 + + - sxpm prints out a warning when a requested color could not be parsed + or alloc'ed, and an error when none has been found. + - sxpm handles pixmap with transparent color. For this purpose the + plaid_mask.xpm is added to the distribution. + + BUGS CORRECTED: + - I've again improved the memory management. + - the parser is also improved. + - when writting a pixmap to a file the variable name could be + "plaid.xpm" which is not valid in C. Now the extension name is cut off + to give "plaid" as variable name. + - reading multiple words colornames such as "peach puff" where leading + to non readable Xpm files. They are now skipped to have only single + word colorname. Lionel Mallet (mallet@ipvpel.unipv.it). + - parser was triggered by the "/" character inside string. + Doyle C. Davidson (doyle@doyled.b23b.ingr.com). This is corrected. + - sxpm maps the window only if the option "-nod" is not selected. + + CHANGES TO THE DOC: + - the documentation presents the new API and features. + +3.0a (91/04/10) + + This is an alpha version because it supports the new version of XPM, + but the library interface is still the same. Indeed it will change in + future release to get rid of obsolete stuff such as the type argument + of the XWritePixmapFile function. + + ******************************* WARNING ********************************* + The format is not anymore XPM2, it is XPM version 3 which is XPM2 + limited to the C syntax with the key word "XPM" in place of "XPM2 C". + The interface library has not changed yet but the type argument of + XWritePixmapFile and the type member of XpmInfo are not used anymore. + Meanwhile the library which is now called libXpm.a is backward + compatible as XPM2 files can be read. But the XWritePixmapFile + function only writes out XPM version 3 files. + ************************************************************************* + + NEW FEATURES: + - the library doesn't use global variables anymore, thus it should be + able to share it. + - sxpm has been rewritten on top of Xt, it can be used to convert + files from XPM2 to XPM version 3. + - xpm1to2c.perl has been upgraded to the new XPM version and renamed + as xpm1to3.perl + - ppmtoxpm2.c and ppmtoxpm2.1 have been upgraded too and renamed + ppmtoxpm.c and ppmtoxpm.1. In addition the xpmtoppm.c and xpmtoppm.1 + of the pbmplus package have been upgraded too. xpmtoppm can thus + convert XPM version 1 and 3 to a portable pixmap. These files should + replace the original ones which are part of the pbmplus package. See + the ppm.README file for more details. + - the library contains RCS variables which allows you to get revision + numbers with ident (which is part of the RCS package). The Id number + is an internal rcs number for my eyes only. The official one is found + in Version. + + BUGS CORRECTED: + - the memory management has been much improved in order to avoid + memory leaks. + - the XImage building algorythm has been changed to support correctly + different visual depths. There is special code to handle depths 1, 4, + 6, 8, 24, and 32 to build the image and send it in one whack, and + other depths are supported by building the image with XPutPixel which + is slow but sure. + - similar algorithms are used to read pixmaps and write them out. + + CHANGES TO THE DOC: + - the documentation presents the new XPM format. + + +2.8 (90/12/19) + + ******************************* WARNING ********************************* + Since the last release two structures have been modified and have now + bigger sizes, so ANY CODE USING THE libXPM2 NEEDS TO BE RECOMPILED. + ************************************************************************* + + NEW FEATURES: + - the ColorSymbol struct contains the new member 'pixel' which allow + to override default colors by giving a pixel value (in such a case + symbol value must be set to NULL), + - the XpmInfo struct contains the new member 'rgb_fname' in which one + can specify an rgb text file name while writing a pixmap with the + XWritePixmapFile function (otherwise this member should be set to + NULL). This way colorname will be searched and written out if found + instead of the RGB value, + - Imakefile originally provided by stolcke@ICSI.Berkeley.EDU, + - the old Makefile is now distributed as Makefile.noXtree and presents + install targets, + - the demo application is renamed sxpm (Show XPM), creates a window of + the size of the pixmap if no geometry is specified, prints out + messages instead of status when an error occurs, handles the new + option -p for overriding colors by giving a pixel value (not really + useful but is just here to show this new feature), handles the new + option -rgb for specifying an rgb text file, and ends on + keypress as buttonpress, + - defines for SYSV have been provided by Paul Breslaw + <paul@mecazh.uucp>, + - the distribution includes a new directory called converters which + contains xpm1to2 and xpm1to2c perl converters and a ppmtoxpm2 + converter provided by Paul Breslaw who upgraded the original ppmtoxpm + written by Mark W. Snitily <mark@zok.uucp>. + + CHANGES TO THE DOC: + - this file is created and will give old users a quick reference to + changes made from one release to the next one, + - documentation is changed to present the new ColorSymbol structure + and the way to override colors by giving a pixel value, and to present + the new XpmInfo structure and how to use it, + - a man page for sxpm is added to the distrib, + - the README file talks about sxpm and no more demo, and have + reference to the different converters. + +2.7 (90/11/12) + + NEW FEATURES: + - XReadPixmapFile reads from stdin if filename is NULL, + - XWritePixmapFile writes to stdin if filename is NULL, + - the demo application handles the new option -nod for no displaying + the pixmap in a window (useful when used as converter). + + CHANGES TO THE DOC: + - documentation about the new feature. + +2.6 (90/10/29) + + NEW FEATURES: + - from nazgul@alphalpha.com (Kee Hinckley): changes to make the + library usable as C++ code, and on Apollo without any warning. + + BUGS CORRECTED: + - from nazgul@alphalpha.com (Kee Hinckley): the xpm include files was + declaring XWritePixmapFile as taking in arg a Pixmap pointer instead + of a Pixmap. + +2.5 (90/10/17) + + BUGS CORRECTED: + - XWritePixmapFile was not closing the file while ending normaly. + +2.4 (90/09/06) + + NEW FEATURES: + - XReadPixmapFile reads from a piped uncompress if the given filename + ends by .Z or if filename.Z exists, + - XWritePixmapFile writes to a piped compress if the given filename + ends by .Z. + + BUGS CORRECTED: + - demo now deals with window manager. + + CHANGES TO THE DOC: + - documentation about compressed files management. + +2.3 (90/08/30) + + BUGS CORRECTED: + - handle monochrom display correctly, + - comments can be empty. + +2.2 (90/08/27) + + BUGS CORRECTED: + - when reading some invalid free was dumping core on some machine. + +2.1 (90/08/24) + + First distribution of XPM2. + diff --git a/src/xpm/doc/COPYRIGHT b/src/xpm/doc/COPYRIGHT new file mode 100644 index 0000000..951b7c3 --- /dev/null +++ b/src/xpm/doc/COPYRIGHT @@ -0,0 +1,30 @@ +/* + * Copyright 1990-92 GROUPE BULL + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of GROUPE BULL not be used in advertising + * or publicity pertaining to distribution of the software without specific, + * written prior permission. GROUPE BULL makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * GROUPE BULL disclaims all warranties with regard to this software, + * including all implied warranties of merchantability and fitness, + * in no event shall GROUPE BULL be liable for any special, + * indirect or consequential damages or any damages + * whatsoever resulting from loss of use, data or profits, + * whether in an action of contract, negligence or other tortious + * action, arising out of or in connection with the use + * or performance of this software. + * + */ + +Arnaud LE HORS BULL Research FRANCE -- Koala Project + (XPM - X PixMap format version 2 & 3) + Internet: lehors@sophia.inria.fr +Surface Mail: Arnaud LE HORS, INRIA - Sophia Antipolis, + 2004, route des Lucioles, 06565 Valbonne Cedex -- FRANCE + Voice phone: (33) 93.65.77.71, Fax: (33) 93 65 77 66, Telex: 97 00 50 F diff --git a/src/xpm/doc/FILES b/src/xpm/doc/FILES new file mode 100644 index 0000000..1538e04 --- /dev/null +++ b/src/xpm/doc/FILES @@ -0,0 +1,42 @@ +CHANGES +COPYRIGHT +FILES +Imakefile +Makefile +Makefile.noXtree +README +XpmCrDataFP.c +XpmCrPFData.c +XpmRdFToP.c +XpmWrFFrP.c +XpmCrDataFI.c +XpmCrIFData.c +XpmRdFToI.c +XpmWrFFrI.c +XpmRdFToData.c +XpmWrFFrData.c +colas.sty +create.c +data.c +hashtable.c +misc.c +parse.c +plaid.xpm +plaid_mask.xpm +rgb.c +scan.c +sxpm.c +sxpm.man +xpm.h +xpm.tex +xpmP.h +converters +converters/xpm1to3.pl +converters/ppmtoxpm.1 +converters/ppmtoxpm.c +converters/xpmtoppm.1 +converters/xpmtoppm.c +converters/ppm.README +rename +name-3.0b-3.0c +name-3.0c-3.0 diff --git a/src/xpm/doc/Imakefile b/src/xpm/doc/Imakefile new file mode 100644 index 0000000..860aec4 --- /dev/null +++ b/src/xpm/doc/Imakefile @@ -0,0 +1,59 @@ +# Copyright 1990-92 GROUPE BULL -- See licence conditions in file COPYRIGHT +# +# XPM Imakefile - Arnaud LE HORS +# + + +#if (ProjectX < 5) + STD_DEFINES = LibraryDefines + CDEBUGFLAGS = LibraryCDebugFlags +#else +/* R5 needs another .tmpl file to find these #def's. This .tmpl file will */ +/* also set STD_DEFINES and CDEBUGFLAGS properly. */ +#include <Library.tmpl> +#endif + + INCLUDES = -I. + INSTALLFLAGS = $(INSTINCFLAGS) + LINTLIBS = $(LINTXTOLL) $(LINTXLIB) + +#ifdef OsNameDefines +OS_NAME_DEFINES = OsNameDefines +#endif + +## if your system doesn't provide strcasecmp add -DNEED_STRCASECMP +## if your system doesn't provide strdup add -DNEED_STRDUP +## if your system doesn't provide pipe remove -DZPIPE +DEFINES = -DZPIPE + +HEADERS = xpm.h + SRCS1 = data.c create.c misc.c rgb.c scan.c parse.c \ + XpmWrFFrP.c XpmRdFToP.c XpmCrPFData.c XpmCrDataFP.c \ + XpmWrFFrI.c XpmRdFToI.c XpmCrIFData.c XpmCrDataFI.c \ + hashtable.c XpmRdFToData.c XpmWrFFrData.c + SRCS = $(SRCS1) sxpm.c + OBJS1 = data.o create.o misc.o rgb.o scan.o parse.o \ + XpmWrFFrP.o XpmRdFToP.o XpmCrPFData.o XpmCrDataFP.o \ + XpmWrFFrI.o XpmRdFToI.o XpmCrIFData.o XpmCrDataFI.o \ + hashtable.o XpmRdFToData.o XpmWrFFrData.o + OBJS = sxpm.o + +NormalLibraryObjectRule() + +NormalLibraryTarget(Xpm,$(OBJS1)) +LintLibraryTarget(Xpm,$(SRCS1)) +InstallLibrary(Xpm,$(USRLIBDIR)) +InstallLintLibrary(Xpm,$(LINTLIBDIR)) + +InstallMultiple($(HEADERS),$(INCDIR)) +DependTarget() +NormalLintTarget($(SRCS1)) + + + DEPLIBS = libXpm.a $(DEPXTOOLLIB) $(DEPXLIB) +LOCAL_LIBRARIES = libXpm.a $(XTOOLLIB) $(XLIB) + +ComplexProgramTarget(sxpm) + +clean:: + $(RM) sxpmout.xpm diff --git a/src/xpm/doc/Makefile b/src/xpm/doc/Makefile new file mode 100644 index 0000000..4f08519 --- /dev/null +++ b/src/xpm/doc/Makefile @@ -0,0 +1,433 @@ +# Makefile generated by imake - do not edit! +# $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $ +# +# The cpp used on this machine replaces all newlines and multiple tabs and +# spaces in a macro expansion with a single space. Imake tries to compensate +# for this, but is not always successful. +# + +# ------------------------------------------------------------------------- +# Makefile generated from "Imake.tmpl" and </tmp/IIf.a10758> +# $XConsortium: Imake.tmpl,v 1.139 91/09/16 08:52:48 rws Exp $ +# +# Platform-specific parameters may be set in the appropriate <vendor>.cf +# configuration files. Site-specific parameters should be set in the file +# site.def. Full rebuilds are recommended if any parameters are changed. +# +# If your C preprocessor does not define any unique symbols, you will need +# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing +# "make World" the first time). +# + +# ------------------------------------------------------------------------- +# site-specific configuration parameters that need to come before +# the platform-specific parameters - edit site.def to change + +# site: $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $ + +# ------------------------------------------------------------------------- +# platform-specific configuration parameters - edit sun.cf to change + +# platform: $XConsortium: sun.cf,v 1.72.1.1 92/03/18 13:13:37 rws Exp $ + +# operating system: SunOS 4.1.1 + +# $XConsortium: sunLib.rules,v 1.7 91/12/20 11:19:47 rws Exp $ + +# ------------------------------------------------------------------------- +# site-specific configuration parameters that go after +# the platform-specific parameters - edit site.def to change + +# site: $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $ + + TOP = . + CURRENT_DIR = . + + AR = ar clq + BOOTSTRAPCFLAGS = + CC = cc + AS = as + + COMPRESS = compress + CPP = /lib/cpp $(STD_CPP_DEFINES) + PREPROCESSCMD = cc -E $(STD_CPP_DEFINES) + INSTALL = install + LD = ld + LINT = lint + LINTLIBFLAG = -C + LINTOPTS = -axz + LN = ln -s + MV = mv + CP = cp + + RANLIB = ranlib + RANLIBINSTFLAGS = + + RM = rm -f + TROFF = ptroff -t + MSMACROS = -ms + TBL = tbl + EQN = eqn + STD_INCLUDES = + STD_CPP_DEFINES = + STD_DEFINES = + EXTRA_LOAD_FLAGS = + EXTRA_LIBRARIES = + TAGS = ctags + + SHAREDCODEDEF = -DSHAREDCODE + SHLIBDEF = -DSUNSHLIB + + PROTO_DEFINES = + + INSTPGMFLAGS = + + INSTBINFLAGS = -m 0755 + INSTUIDFLAGS = -m 4755 + INSTLIBFLAGS = -m 0644 + INSTINCFLAGS = -m 0444 + INSTMANFLAGS = -m 0444 + INSTDATFLAGS = -m 0444 + INSTKMEMFLAGS = -g kmem -m 2755 + + TOP_INCLUDES = -I$(INCROOT) + + CDEBUGFLAGS = -O + CCOPTIONS = -pipe + + ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES) + ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES) + CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES) + LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES) + + LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES) + + LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -L$(USRLIBDIR) + + LDCOMBINEFLAGS = -X -r + DEPENDFLAGS = + + MACROFILE = sun.cf + RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut + + IMAKE_DEFINES = + + IRULESRC = $(CONFIGDIR) + IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES) + + ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \ + $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \ + $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES) + +# ------------------------------------------------------------------------- +# X Window System Build Parameters +# $XConsortium: Project.tmpl,v 1.138.1.1 92/11/11 09:49:19 rws Exp $ + +# ------------------------------------------------------------------------- +# X Window System make variables; this need to be coordinated with rules + + PATHSEP = / + USRLIBDIR = /usr/lib/X11R5 + BINDIR = /usr/bin/X11R5 + INCROOT = /usr/include/X11R5 + BUILDINCROOT = $(TOP) + BUILDINCDIR = $(BUILDINCROOT)/X11 + BUILDINCTOP = .. + INCDIR = $(INCROOT)/X11 + ADMDIR = /usr/adm + LIBDIR = /usr/lib/X11R5 + CONFIGDIR = $(LIBDIR)/config + LINTLIBDIR = $(USRLIBDIR)/lint + + FONTDIR = $(LIBDIR)/fonts + XINITDIR = $(LIBDIR)/xinit + XDMDIR = $(LIBDIR)/xdm + TWMDIR = $(LIBDIR)/twm + MANPATH = /usr/man + MANSOURCEPATH = $(MANPATH)/man + MANSUFFIX = n + LIBMANSUFFIX = 3 + MANDIR = $(MANSOURCEPATH)$(MANSUFFIX) + LIBMANDIR = $(MANSOURCEPATH)$(LIBMANSUFFIX) + NLSDIR = $(LIBDIR)/nls + PEXAPIDIR = $(LIBDIR)/PEX + XAPPLOADDIR = $(LIBDIR)/app-defaults + FONTCFLAGS = -t + + INSTAPPFLAGS = $(INSTDATFLAGS) + + IMAKE = imake + DEPEND = makedepend + RGB = rgb + + FONTC = bdftopcf + + MKFONTDIR = mkfontdir + MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier + + CONFIGSRC = $(TOP)/config + DOCUTILSRC = $(TOP)/doc/util + CLIENTSRC = $(TOP)/clients + DEMOSRC = $(TOP)/demos + LIBSRC = $(TOP)/lib + FONTSRC = $(TOP)/fonts + INCLUDESRC = $(TOP)/X11 + SERVERSRC = $(TOP)/server + UTILSRC = $(TOP)/util + SCRIPTSRC = $(UTILSRC)/scripts + EXAMPLESRC = $(TOP)/examples + CONTRIBSRC = $(TOP)/../contrib + DOCSRC = $(TOP)/doc + RGBSRC = $(TOP)/rgb + DEPENDSRC = $(UTILSRC)/makedepend + IMAKESRC = $(CONFIGSRC) + XAUTHSRC = $(LIBSRC)/Xau + XLIBSRC = $(LIBSRC)/X + XMUSRC = $(LIBSRC)/Xmu + TOOLKITSRC = $(LIBSRC)/Xt + AWIDGETSRC = $(LIBSRC)/Xaw + OLDXLIBSRC = $(LIBSRC)/oldX + XDMCPLIBSRC = $(LIBSRC)/Xdmcp + BDFTOSNFSRC = $(FONTSRC)/bdftosnf + BDFTOSNFSRC = $(FONTSRC)/clients/bdftosnf + BDFTOPCFSRC = $(FONTSRC)/clients/bdftopcf + MKFONTDIRSRC = $(FONTSRC)/clients/mkfontdir + FSLIBSRC = $(FONTSRC)/lib/fs + FONTSERVERSRC = $(FONTSRC)/server + EXTENSIONSRC = $(TOP)/extensions + XILIBSRC = $(EXTENSIONSRC)/lib/xinput + PEXLIBSRC = $(EXTENSIONSRC)/lib/PEXlib + PHIGSLIBSRC = $(EXTENSIONSRC)/lib/PEX + +# $XConsortium: sunLib.tmpl,v 1.14.1.2 92/11/11 09:55:02 rws Exp $ + +SHLIBLDFLAGS = -assert pure-text +PICFLAGS = -pic + + DEPEXTENSIONLIB = + EXTENSIONLIB = -lXext + + DEPXLIB = $(DEPEXTENSIONLIB) + XLIB = $(EXTENSIONLIB) -lX11 + + DEPXMULIB = $(USRLIBDIR)/libXmu.sa.$(SOXMUREV) + XMULIBONLY = -lXmu + XMULIB = -lXmu + + DEPOLDXLIB = + OLDXLIB = -loldX + + DEPXTOOLLIB = $(USRLIBDIR)/libXt.sa.$(SOXTREV) + XTOOLLIB = -lXt + + DEPXAWLIB = $(USRLIBDIR)/libXaw.sa.$(SOXAWREV) + XAWLIB = -lXaw + + DEPXILIB = + XILIB = -lXi + + DEPPEXLIB = + PEXLIB = -lPEX5 + + SOXLIBREV = 4.10 + SOXTREV = 4.10 + SOXAWREV = 5.0 + SOOLDXREV = 4.10 + SOXMUREV = 4.10 + SOXEXTREV = 4.10 + SOXINPUTREV = 4.10 + SOPEXREV = 1.0 + + DEPXAUTHLIB = $(USRLIBDIR)/libXau.a + XAUTHLIB = -lXau + DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a + XDMCPLIB = -lXdmcp + + DEPPHIGSLIB = $(USRLIBDIR)/libphigs.a + PHIGSLIB = -lphigs + + DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a + XBSDLIB = -lXbsd + + LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln + LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln + LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln + LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln + LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln + LINTXI = $(LINTLIBDIR)/llib-lXi.ln + LINTPEX = $(LINTLIBDIR)/llib-lPEX5.ln + LINTPHIGS = $(LINTLIBDIR)/llib-lphigs.ln + + DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB) + + DEPLIBS1 = $(DEPLIBS) + DEPLIBS2 = $(DEPLIBS) + DEPLIBS3 = $(DEPLIBS) + +# ------------------------------------------------------------------------- +# Imake rules for building libraries, programs, scripts, and data files +# rules: $XConsortium: Imake.rules,v 1.123 91/09/16 20:12:16 rws Exp $ + +# ------------------------------------------------------------------------- +# start of Imakefile + +# Copyright 1990-92 GROUPE BULL -- See licence conditions in file COPYRIGHT +# +# XPM Imakefile - Arnaud LE HORS +# + +# $XConsortium: Library.tmpl,v 1.12 92/03/20 15:05:19 rws Exp $ + + CC = cc + CCOPTIONS = +STD_DEFINES = +CDEBUGFLAGS = -O + + INCLUDES = -I. + INSTALLFLAGS = $(INSTINCFLAGS) + LINTLIBS = $(LINTXTOLL) $(LINTXLIB) + +OS_NAME_DEFINES = + +## if your system doesn't provide strcasecmp add -DNEED_STRCASECMP +## if your system doesn't provide strdup add -DNEED_STRDUP +## if your system doesn't provide pipe remove -DZPIPE +DEFINES = -DZPIPE + +HEADERS = xpm.h + SRCS1 = data.c create.c misc.c rgb.c scan.c parse.c \ + XpmWrFFrP.c XpmRdFToP.c XpmCrPFData.c XpmCrDataFP.c \ + XpmWrFFrI.c XpmRdFToI.c XpmCrIFData.c XpmCrDataFI.c \ + hashtable.c XpmRdFToData.c XpmWrFFrData.c + SRCS = $(SRCS1) sxpm.c + OBJS1 = data.o create.o misc.o rgb.o scan.o parse.o \ + XpmWrFFrP.o XpmRdFToP.o XpmCrPFData.o XpmCrDataFP.o \ + XpmWrFFrI.o XpmRdFToI.o XpmCrIFData.o XpmCrDataFI.o \ + hashtable.o XpmRdFToData.o XpmWrFFrData.o + OBJS = sxpm.o + +.c.o: + $(RM) $@ + $(CC) -c $(CFLAGS) $(_NOOP_) $*.c + +all:: libXpm.a + +libXpm.a: $(OBJS1) + $(RM) $@ + $(AR) $@ $(OBJS1) + $(RANLIB) $@ + +lintlib:: llib-lXpm.ln + +llib-lXpm.ln: $(SRCS1) + $(RM) $@ + $(LINT) $(LINTLIBFLAG)Xpm $(LINTFLAGS) $(SRCS1) + +install:: libXpm.a + @if [ -d $(DESTDIR)$(USRLIBDIR) ]; then set +x; \ + else (set -x; $(MKDIRHIER) $(DESTDIR)$(USRLIBDIR)); fi + $(INSTALL) -c $(INSTLIBFLAGS) libXpm.a $(DESTDIR)$(USRLIBDIR) + $(RANLIB) $(RANLIBINSTFLAGS) $(DESTDIR)$(USRLIBDIR)/libXpm.a + +install.ln:: llib-lXpm.ln + @if [ -d $(DESTDIR)$(LINTLIBDIR) ]; then set +x; \ + else (set -x; $(MKDIRHIER) $(DESTDIR)$(LINTLIBDIR)); fi + $(INSTALL) -c $(INSTLIBFLAGS) llib-lXpm.ln $(DESTDIR)$(LINTLIBDIR) + +install:: $(HEADERS) + @if [ -d $(DESTDIR)$(INCDIR) ]; then set +x; \ + else (set -x; $(MKDIRHIER) $(DESTDIR)$(INCDIR)); fi + @case '${MFLAGS}' in *[i]*) set +e;; esac; \ + for i in $(HEADERS); do \ + (set -x; $(INSTALL) -c $(INSTALLFLAGS) $$i $(DESTDIR)$(INCDIR)); \ + done + +depend:: + $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS) + +lint: + $(LINT) $(LINTFLAGS) $(SRCS1) $(LINTLIBS) +lint1: + $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS) + + DEPLIBS = libXpm.a $(DEPXTOOLLIB) $(DEPXLIB) +LOCAL_LIBRARIES = libXpm.a $(XTOOLLIB) $(XLIB) + + PROGRAM = sxpm + +all:: sxpm + +sxpm: $(OBJS) $(DEPLIBS) + $(RM) $@ + $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) + +saber_sxpm:: $(SRCS) + # load $(ALLDEFINES) $(SRCS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES) + +osaber_sxpm:: $(OBJS) + # load $(ALLDEFINES) $(OBJS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES) + +install:: sxpm + @if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \ + else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi + $(INSTALL) -c $(INSTPGMFLAGS) sxpm $(DESTDIR)$(BINDIR) + +install.man:: sxpm.man + @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \ + else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi + $(INSTALL) -c $(INSTMANFLAGS) sxpm.man $(DESTDIR)$(MANDIR)/sxpm.$(MANSUFFIX) + +depend:: + $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS) + +lint: + $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS) +lint1: + $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS) + +clean:: + $(RM) $(PROGRAM) + +clean:: + $(RM) sxpmout.xpm + +# ------------------------------------------------------------------------- +# common rules for all Makefiles - do not edit + +emptyrule:: + +clean:: + $(RM_CMD) "#"* + +Makefile:: + -@if [ -f Makefile ]; then set -x; \ + $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \ + else exit 0; fi + $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) + +tags:: + $(TAGS) -w *.[ch] + $(TAGS) -xw *.[ch] > TAGS + +saber: + # load $(ALLDEFINES) $(SRCS) + +osaber: + # load $(ALLDEFINES) $(OBJS) + +# ------------------------------------------------------------------------- +# empty rules for directories that do not have SUBDIRS - do not edit + +install:: + @echo "install in $(CURRENT_DIR) done" + +install.man:: + @echo "install.man in $(CURRENT_DIR) done" + +Makefiles:: + +includes:: + +# ------------------------------------------------------------------------- +# dependencies generated by makedepend + diff --git a/src/xpm/doc/Makefile.noXtree b/src/xpm/doc/Makefile.noXtree new file mode 100644 index 0000000..1119883 --- /dev/null +++ b/src/xpm/doc/Makefile.noXtree @@ -0,0 +1,85 @@ +# Copyright 1990-92 GROUPE BULL -- See license conditions in file COPYRIGHT +# +# XPM Makefile - Arnaud LE HORS +# + +AR = ar r +CC = cc +RANLIB = ranlib +RM = rm -f +# on sysV, define this as cp. +INSTALL = install -c + +DVIPS = dvips + +CDEBUGFLAGS= -O + +# if your system doesn't provide strcasecmp add -DNEED_STRCASECMP +# if your system doesn't provide strdup add -DNEED_STRDUP +# if your system doesn't provide pipe remove -DZPIPE +DEFINES = -DZPIPE + +DESTBINDIR=/usr/local/bin/X11 +DESTLIBDIR=/usr/local/lib/X11 +DESTINCLUDEDIR=$(DESTLIBDIR)/xpm-include +MANDIR=/usr/man/manl + +LIBDIRS= -L/usr/lib/X11 -L. +LIBS= -lXpm -lXext -lXt -lX11 +OBJS= data.o create.o misc.o rgb.o scan.o parse.o hashtable.o \ + XpmWrFFrP.o XpmRdFToP.o XpmCrPFData.o XpmCrDataFP.o \ + XpmWrFFrI.o XpmRdFToI.o XpmCrIFData.o XpmCrDataFI.o \ + XpmRdFToData.o XpmWrFFrData.o + +CFLAGS= $(CDEBUGFLAGS) $(DEFINES) + +all: sxpm + +clean: + $(RM) *.o sxpm libXpm.a + +sxpm: libXpm.a sxpm.o + $(CC) $(CFLAGS) sxpm.o $(LIBDIRS) $(LIBS) -o sxpm + +libXpm.a: $(OBJS) + $(AR) libXpm.a $(OBJS) + $(RANLIB) libXpm.a + +install: install.lib install.sxpm install.man + +install.lib: + $(INSTALL) -m 0664 libXpm.a $(DESTLIBDIR) + cd $(DESTLIBDIR); $(RANLIB) libXpm.a + -mkdir $(DESTINCLUDEDIR) + -chmod ugo+rx $(DESTINCLUDEDIR) + $(INSTALL) -m 0444 xpm.h $(DESTINCLUDEDIR) + +install.sxpm: + $(INSTALL) -m 0755 sxpm $(DESTBINDIR) + +install.man: + $(INSTALL) -m 0644 sxpm.man $(MANDIR)/sxpm.l + +doc: xpm.ps + +xpm.ps: xpm.dvi + $(DVIPS) -o xpm.ps xpm + +xpm.dvi: xpm.tex + latex xpm + latex xpm + +print: xpm.ps + lpr xpm.ps + +# Other dependencies. +scan.o: xpmP.h +parse.o: xpmP.h +data.o: xpmP.h +create.o: xpmP.h +free.o: xpmP.h +rgb.o: xpmP.h +XpmWrPixF.o: xpmP.h +XpmRdPixF.o: xpmP.h +XpmCrPFData.o: xpmP.h +sxpm.o: xpm.h diff --git a/src/xpm/doc/README b/src/xpm/doc/README new file mode 100644 index 0000000..0807f5a --- /dev/null +++ b/src/xpm/doc/README @@ -0,0 +1,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 diff --git a/src/xpm/doc/colas.sty b/src/xpm/doc/colas.sty new file mode 100644 index 0000000..799e405 --- /dev/null +++ b/src/xpm/doc/colas.sty @@ -0,0 +1,294 @@ +% my add-on LaTeX macros +% to be used like in: +% \documentstyle[12pt,gwm]{report} + +% postscript inclusion: +\def\texpsfig#1#2#3 +{\vbox{\kern #3pt\hbox{\special{psfile=#1}\kern #2pt}}\typeout{(#1)}} + +% RCS version stripping +\def\RCSRevNum#1Revision: #2 ${#2} +\def\RCSRevVersion#1Version: #2 ${#2} + +\newlength{\colaslength} +\newlength{\colaslengthh} +\newlength{\colasmargin} + +\def\exemplefont{\footnotesize} +\def\usagefont{\large} +\def\usageupspace{\vspace{0.1mm}} +\newcommand{\Description} + {\list{}{\leftmargin 4cm \labelsep 0.1cm \labelwidth 3.9cm}} + +\def\descriptionlabel#1{\bf #1\hspace\labelsep\hfil} +\def\description + {\list{}{\leftmargin 2.4cm \labelsep 0.1cm \labelwidth 2.3cm + \let\makelabel\descriptionlabel}} + +\def\upspace{\vspace{-2mm}} +\def\undertablespace{\vspace{-3mm}} + +\def\Item#1#2{\upspace\pagebreak[1]\section*{\hspace{-7pt} + {\large\tt#1}{\normalsize\sf\quad ---\quad #2}}\vspace{-0.3cm}} + +\def\ITEMa#1#2{ + \Item{#1}{#2}\markright{#1} + \label{#1}} +\def\ITEMb#1#2#3{ + \Item{\vbox{\hbox{#1}\hbox{#2}}}{#3}\markright{#1} + \label{#1} \label{#2}} +\def\ITEMbi#1#2#3{ + \Item{\vbox{\hbox{#1}\hbox{#2}}}{#3}\markright{#1} + \label{#2}} +\def\ITEMc#1#2#3#4{ + \Item{\vbox{\hbox{#1}\hbox{#2}\hbox{#3}}}{#4}\markright{#1} + \label{#1}\label{#2} \label{#3}} +\def\ITEMci#1#2#3#4{ + \Item{\vbox{\hbox{#1}\hbox{#2}\hbox{#3}}}{#4}\markright{#1} + \label{#2}\label{#3}} +\def\ITEMd#1#2#3#4#5{ + \Item{\vbox{\hbox{#1}\hbox{#2}\hbox{#3}\hbox{#4}}}{#5}\markright{#1} + \label{#1}\label{#2}\label{#3}\label{#4}} +\def\ITEMe#1#2#3#4#5#6{ + \Item{ + \vbox{\hbox{#1}\hbox{#2}\hbox{#3}\hbox{#4}\hbox{#5}}}{#6}\markright{#1} + \label{#1}\label{#2}\label{#3}\label{#4}\label{#5}} +\def\ITEMf#1#2#3#4#5#6#7{ + \Item{ + \vbox{\hbox{#1}\hbox{#2}\hbox{#3}\hbox{#4}\hbox{#5}\hbox{#6}}}{#7} + \markright{#1} + \label{#1}\label{#2}\label{#3}\label{#4}\label{#5}\label{#6}} + +\newcommand{\context}[1]{ + Context used: + \begin{center}\begin{tabular}{@{\tt}l@{\hspace{1cm}}@{\rm}p{7cm}} + \multicolumn{1}{c}{\bf Variable}&\multicolumn{1}{c}{\bf used for}\\ + \hline \multicolumn{2}{l}{\undertablespace}\\ + #1 + \end{tabular}\end{center}} + +\newcommand{\contextdim}[2]{ + \setlength{\colaslength}{7cm} + \addtolength{\colaslength}{#1} + Context used: + \begin{center}\begin{tabular}{@{\tt}l@{\hspace{1cm}}@{\rm}p{\colaslength}} + \multicolumn{1}{c}{\bf Variable}&\multicolumn{1}{c}{\bf used for}\\ + \hline \multicolumn{2}{l}{\undertablespace}\\ + #2 + \end{tabular}\end{center}} + +\newcommand{\desctable}[3]{ + \begin{center}\begin{tabular}{@{\bf}l@{\hspace{1cm}}@{\rm}p{7cm}} + \multicolumn{1}{c}{\bf #1}&\multicolumn{1}{c}{\bf #2}\\ + \hline \multicolumn{2}{l}{\undertablespace}\\ + #3 + \end{tabular}\end{center}} + +\newcommand{\desctabledim}[4]{ + \setlength{\colaslength}{7cm} + \addtolength{\colaslength}{#1} + \begin{center}\begin{tabular}{@{\bf}l@{\hspace{1cm}}@{\rm}p{\colaslength}} + \multicolumn{1}{c}{\bf #2}&\multicolumn{1}{c}{\bf #3}\\ + \hline \multicolumn{2}{l}{\undertablespace}\\ + #4 + \end{tabular}\end{center}} + +\newcommand{\exemples}[2]{ + #1{\exemplefont + \begin{center}\begin{tabular}{@{\tt}l@{\hspace{1cm}}@{\rm}p{5cm}} + #2 + \end{tabular}\end{center}}} + +\newcommand{\exemplesdim}[3]{ + \setlength{\colaslength}{5cm} + \addtolength{\colaslength}{#1} + #2{\exemplefont + \begin{center}\begin{tabular}{@{\tt}l@{\hspace{1cm}}@{\rm}p{\colaslength}} + #3 + \end{tabular}\end{center}}} + +\newcommand{\usagetype}[1]{{\sl #1}\vspace{0.2cm}} +\newcommand{\usagetyped}[2]{{\sl #1}\quad{\it (#2)}\vspace{0.2cm}} +\newcommand{\see}[1]{{\tt #1}} +\newcommand{\seep}[1]{{\tt #1}, p~\pageref{#1}} +\newcommand{\seensp}[1]{{\tt #1} (see p~\pageref{#1})} +\newcommand{\seesnp}[1]{(see {\tt #1}, p~\pageref{#1})} +\newcommand{\seeref}[1]{{\tt #1} (see \ref{#1}, p~\pageref{#1})} +\newcommand{\seesp}[1]{(see \ref{#1}, p~\pageref{#1})} + +\def\smalldesc#1#2#3{#1\\} +\newcommand{\bigdesc}[2]{ + \setlength{\colaslength}{300pt} + \settowidth{\colaslengthh}{{\tt #1}} + \addtolength{\colaslength}{-\colaslengthh} + \begin{center}\begin{tabular} + {@{\tt}l@{\hspace{0.5cm}}@{\sf}p{\colaslength}@{\hspace{0.4cm}}@{\bf}r} + \multicolumn{1}{c}{\bf Object}&\multicolumn{1}{c}{\bf Description}&{\bf p}\\ + \hline \multicolumn{3}{l}{\undertablespace}\\ + #2 + \end{tabular}\end{center}} + +\newcommand{\desc}[4]{ + \setlength{\colaslength}{250pt} + \settowidth{\colaslengthh}{{\tt #1}} + \addtolength{\colaslength}{-\colaslengthh} + \begin{center}\begin{tabular} +{@{\tt}l@{\hspace{0.5cm}}@{\sf}p{\colaslength}} + \multicolumn{1}{c}{\bf #2}&\multicolumn{1}{c}{\bf #3}\\ + \hline \multicolumn{2}{l}{\undertablespace}\\ + #4 + \end{tabular}\end{center}} + +\newcommand{\contextdimtt}[2]{ + \setlength{\colaslength}{250pt} + \settowidth{\colaslengthh}{{\tt #1}} + \addtolength{\colaslength}{-\colaslengthh} + Context used: + \begin{center}\begin{tabular}{@{\tt}l@{\hspace{1cm}}@{\rm}p{\colaslength}} + \multicolumn{1}{c}{\bf Variable}&\multicolumn{1}{c}{\bf used for}\\ + \hline \multicolumn{2}{l}{\undertablespace}\\ + #2 + \end{tabular}\end{center}} + +\def\itemtt#1{\item[{\tt #1}]} +\def\itemit#1{\item[{\it #1}]} + + +% SIZE of page +%============= + +\def\fullpage{\if@twoside \oddsidemargin 35pt \evensidemargin -8pt +\marginparsep 10pt \marginparpush 10pt \marginparwidth 10pt +\else \oddsidemargin 0pt \evensidemargin 0pt +\marginparwidth 30pt\fi +\textwidth 450pt \setlength{\colasmargin}{0pt} +\def\colaspm{\hspace{0pt}}\def\colasmm{\hspace{0pt}} +\def\colassmm{\hspace{0pt}}\def\colastitledisp{\hspace{0pt}} +} +\def\mediumpage{\if@twoside \oddsidemargin 75pt \evensidemargin 32pt +\marginparsep 10pt \marginparpush 10pt \marginparwidth 40pt +\else \oddsidemargin 43pt \evensidemargin 63pt +\marginparwidth 30pt\fi +\textwidth 410pt \setlength{\colasmargin}{0pt} +\def\colaspm{\hspace{40pt}}\def\colasmm{\hspace{-40pt}} +\def\colassmm{\hspace{-20pt}}\def\colastitledisp{\hspace{-45pt}} +} +\def\smallpage{\if@twoside \oddsidemargin 135pt \evensidemargin 92pt +\marginparsep 10pt \marginparpush 10pt \marginparwidth 80pt +\else \oddsidemargin 123pt \evensidemargin 123pt +\marginparwidth 30pt \fi +\textwidth 350pt +\setlength{\colasmargin}{100pt} +\def\colaspm{\hspace{100pt}}\def\colasmm{\hspace{-100pt}} +\def\colassmm{\hspace{-60pt}}\def\colastitledisp{\hspace{-75pt}} +} + +\smallpage +\topmargin -30pt \headheight 12pt \headsep 25pt \footheight 12pt \footskip +30pt +\textheight 680pt \columnsep 10pt \columnseprule 0pt +\footnotesep 12pt \skip\footins 6pt plus 2pt minus 2pt +\floatsep 12pt plus 2pt minus 2pt \textfloatsep 20pt plus 2pt minus 4pt +\intextsep 12pt plus 2pt minus 2pt \@maxsep 20pt \dblfloatsep 12pt plus 2pt +minus 2pt \dbltextfloatsep 20pt plus 2pt minus 4pt \@dblmaxsep 20pt +\@fptop 0pt plus 1fil \@fpsep 8pt plus 2fil \@fpbot 0pt plus 1fil +\@dblfptop 0pt plus 1fil \@dblfpsep 8pt plus 2fil \@dblfpbot 0pt plus 1fil + +\parskip 5pt plus 1pt \parindent 0pt \topsep 2pt plus 1pt minus 1pt +\partopsep 0pt plus 1pt minus 1pt \itemsep 2pt plus 1pt minus 1pt + +\reversemarginpar +\@mparswitchfalse + +%% abbrevs + +\def\GWM{\sc Gwm} +\def\WOOL{\sc Wool} + +%% fonts +\def\Huge{\@setsize\Huge{30pt}\xxvpt\@xxvpt} + +%% chapter + +\def\@makechapterhead#1{ \vspace*{1pt} { \parindent 0pt \raggedright + \Huge\bf \colasmm + \ifnum \c@secnumdepth >\m@ne \thechapter \quad \fi + #1\par + \nobreak \vskip 20pt + \colasmm{\vbox{\hbox{\vrule height 5pt width450pt depth -3pt} + \vspace*{-1.1cm} + \hbox{\vrule height 0.0pt width450pt depth 0.4pt}}} + \nobreak \vskip 50pt \nobreak } } + +\def\@makeschapterhead#1{ \vspace*{1pt} { \parindent 0pt \raggedright + \Huge \bf \colasmm #1\par + \nobreak \vskip 80pt } } + +\def\chapter{\clearpage \thispagestyle{pagenum} \global\@topnum\z@ +\@afterindentfalse \secdef\@chapter\@schapter} +\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne + \refstepcounter{chapter} + \typeout{\@chapapp\space\thechapter.} + \addcontentsline{toc}{chapter}{\protect + \numberline{\thechapter}#1}\else + \addcontentsline{toc}{chapter}{#1}\fi + \chaptermark{#1} + \addtocontents{lof}{\protect\addvspace{10pt}} +\addtocontents{lot}{\protect\addvspace{10pt}} \if@twocolumn +\@topnewpage[\@makechapterhead{#2}] + \else \@makechapterhead{#2} + \@afterheading \fi} +\def\@schapter#1{\if@twocolumn \@topnewpage[\@makeschapterhead{#1}] + \else \@makeschapterhead{#1} + \@afterheading\fi} + +%% sections + +\def\section{\@startsection {section}{1}{\z@}{-3.5ex plus -1ex minus + -.2ex}{2.3ex plus .2ex}{\Large\bf\colasmm}} +\def\subsection{\@startsection{subsection}{2}{\z@}{-3.25ex plus -1ex minus + -.2ex}{1.5ex plus .2ex}{\large\bf\colassmm}} +\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-3.25ex plus +-1ex minus -.2ex}{1.5ex plus .2ex}{\normalsize\bf}} +\def\paragraph{\@startsection + {paragraph}{4}{\z@}{3.25ex plus 1ex minus .2ex}{-1em}{\normalsize\bf}} +\def\subparagraph{\@startsection + {subparagraph}{4}{\parindent}{3.25ex plus 1ex minus + .2ex}{-1em}{\normalsize\bf}} + +%% headings + +\if@twoside \def\ps@headings{\def\@oddfoot{} +\def\@evenfoot{}\def\@evenhead{ +\colasmm\makebox[0pt][l]{\vrule height-4pt width450pt depth4.3pt} +\bf\thepage\hfill \sl \leftmark} +\def\@oddhead{ +\colasmm\makebox[0pt][l]{\vrule height-4pt width450pt depth4.3pt} +\sl \rightmark \hfill\bf\thepage} +\def\chaptermark##1{\markboth {\uppercase{\ifnum \c@secnumdepth +>\m@ne + \@chapapp\ \thechapter. \ \fi ##1}}{}}\def\sectionmark##1{\markright +{\uppercase{\ifnum \c@secnumdepth >\z@ + \thesection. \ \fi ##1}}}} +\else \def\ps@headings{\def\@oddfoot{}\def\@evenfoot{}\def\@oddhead{\hbox +{}\sl \rightmark \hfill \rm\thepage}\def\chaptermark##1{\markright +{\uppercase{\ifnum \c@secnumdepth >\m@ne + \@chapapp\ \thechapter. \ \fi ##1}}}} +\fi + +\if@twoside \def\ps@pagenum{\def\@oddfoot{} +\def\@evenfoot{}\def\@evenhead{ +\colasmm\bf\thepage\hfill} +\def\@oddhead{ +\colasmm\hfill\bf\thepage} +\def\chaptermark##1{\markboth {\uppercase{\ifnum \c@secnumdepth +>\m@ne + \@chapapp\ \thechapter. \ \fi ##1}}{}}\def\sectionmark##1{\markright +{\uppercase{\ifnum \c@secnumdepth >\z@ + \thesection. \ \fi ##1}}}} +\else \def\ps@pagenum{\def\@oddfoot{}\def\@evenfoot{}\def\@oddhead{\hbox +{}\hfil \bf\thepage}\def\chaptermark##1{\markright +{\uppercase{\ifnum \c@secnumdepth >\m@ne + \@chapapp\ \thechapter. \ \fi ##1}}}} +\fi + diff --git a/src/xpm/doc/name-3.0b-3.0c b/src/xpm/doc/name-3.0b-3.0c new file mode 100644 index 0000000..04c687b --- /dev/null +++ b/src/xpm/doc/name-3.0b-3.0c @@ -0,0 +1,48 @@ +s/^XCreatePixmapFromData$/XpmCreatePixmapFromData/g +s/^XCreatePixmapFromData\([^a-zA-Z_]\)/XpmCreatePixmapFromData\1/g +s/\([^a-zA-Z_]\)XCreatePixmapFromData$/\1XpmCreatePixmapFromData/g +s/\([^a-zA-Z_]\)XCreatePixmapFromData\([^a-zA-Z_]\)/\1XpmCreatePixmapFromData\2/g +s/^XCreateDataFromPixmap$/XpmCreateDataFromPixmap/g +s/^XCreateDataFromPixmap\([^a-zA-Z_]\)/XpmCreateDataFromPixmap\1/g +s/\([^a-zA-Z_]\)XCreateDataFromPixmap$/\1XpmCreateDataFromPixmap/g +s/\([^a-zA-Z_]\)XCreateDataFromPixmap\([^a-zA-Z_]\)/\1XpmCreateDataFromPixmap\2/g +s/^XReadPixmapFile$/XpmReadPixmapFile/g +s/^XReadPixmapFile\([^a-zA-Z_]\)/XpmReadPixmapFile\1/g +s/\([^a-zA-Z_]\)XReadPixmapFile$/\1XpmReadPixmapFile/g +s/\([^a-zA-Z_]\)XReadPixmapFile\([^a-zA-Z_]\)/\1XpmReadPixmapFile\2/g +s/^XWritePixmapFile$/XpmWritePixmapFile/g +s/^XWritePixmapFile\([^a-zA-Z_]\)/XpmWritePixmapFile\1/g +s/\([^a-zA-Z_]\)XWritePixmapFile$/\1XpmWritePixmapFile/g +s/\([^a-zA-Z_]\)XWritePixmapFile\([^a-zA-Z_]\)/\1XpmWritePixmapFile\2/g +s/^XFreeXpmAttributes$/XpmFreeAttributes/g +s/^XFreeXpmAttributes\([^a-zA-Z_]\)/XpmFreeAttributes\1/g +s/\([^a-zA-Z_]\)XFreeXpmAttributes$/\1XpmFreeAttributes/g +s/\([^a-zA-Z_]\)XFreeXpmAttributes\([^a-zA-Z_]\)/\1XpmFreeAttributes\2/g +s/^PixmapColorError$/XpmPixmapColorError/g +s/^PixmapColorError\([^a-zA-Z_]\)/XpmPixmapColorError\1/g +s/\([^a-zA-Z_]\)PixmapColorError$/\1XpmPixmapColorError/g +s/\([^a-zA-Z_]\)PixmapColorError\([^a-zA-Z_]\)/\1XpmPixmapColorError\2/g +s/^PixmapSuccess$/XpmPixmapSuccess/g +s/^PixmapSuccess\([^a-zA-Z_]\)/XpmPixmapSuccess\1/g +s/\([^a-zA-Z_]\)PixmapSuccess$/\1XpmPixmapSuccess/g +s/\([^a-zA-Z_]\)PixmapSuccess\([^a-zA-Z_]\)/\1XpmPixmapSuccess\2/g +s/^PixmapOpenFailed$/XpmPixmapOpenFailed/g +s/^PixmapOpenFailed\([^a-zA-Z_]\)/XpmPixmapOpenFailed\1/g +s/\([^a-zA-Z_]\)PixmapOpenFailed$/\1XpmPixmapOpenFailed/g +s/\([^a-zA-Z_]\)PixmapOpenFailed\([^a-zA-Z_]\)/\1XpmPixmapOpenFailed\2/g +s/^PixmapFileInvalid$/XpmPixmapFileInvalid/g +s/^PixmapFileInvalid\([^a-zA-Z_]\)/XpmPixmapFileInvalid\1/g +s/\([^a-zA-Z_]\)PixmapFileInvalid$/\1XpmPixmapFileInvalid/g +s/\([^a-zA-Z_]\)PixmapFileInvalid\([^a-zA-Z_]\)/\1XpmPixmapFileInvalid\2/g +s/^PixmapNoMemory$/XpmPixmapNoMemory/g +s/^PixmapNoMemory\([^a-zA-Z_]\)/XpmPixmapNoMemory\1/g +s/\([^a-zA-Z_]\)PixmapNoMemory$/\1XpmPixmapNoMemory/g +s/\([^a-zA-Z_]\)PixmapNoMemory\([^a-zA-Z_]\)/\1XpmPixmapNoMemory\2/g +s/^PixmapColorFailed$/XpmPixmapColorFailed/g +s/^PixmapColorFailed\([^a-zA-Z_]\)/XpmPixmapColorFailed\1/g +s/\([^a-zA-Z_]\)PixmapColorFailed$/\1XpmPixmapColorFailed/g +s/\([^a-zA-Z_]\)PixmapColorFailed\([^a-zA-Z_]\)/\1XpmPixmapColorFailed\2/g +s/^ColorSymbol$/XpmColorSymbol/g +s/^ColorSymbol\([^a-zA-Z_]\)/XpmColorSymbol\1/g +s/\([^a-zA-Z_]\)ColorSymbol$/\1XpmColorSymbol/g +s/\([^a-zA-Z_]\)ColorSymbol\([^a-zA-Z_]\)/\1XpmColorSymbol\2/g diff --git a/src/xpm/doc/name-3.0c-3.0 b/src/xpm/doc/name-3.0c-3.0 new file mode 100644 index 0000000..3187d46 --- /dev/null +++ b/src/xpm/doc/name-3.0c-3.0 @@ -0,0 +1,32 @@ +s/^XpmPixmapColorError$/XpmColorError/g +s/^XpmPixmapColorError\([^a-zA-Z_]\)/XpmColorError\1/g +s/\([^a-zA-Z_]\)XpmPixmapColorError$/\1XpmColorError/g +s/\([^a-zA-Z_]\)XpmPixmapColorError\([^a-zA-Z_]\)/\1XpmColorError\2/g +s/^XpmPixmapSuccess$/XpmSuccess/g +s/^XpmPixmapSuccess\([^a-zA-Z_]\)/XpmSuccess\1/g +s/\([^a-zA-Z_]\)XpmPixmapSuccess$/\1XpmSuccess/g +s/\([^a-zA-Z_]\)XpmPixmapSuccess\([^a-zA-Z_]\)/\1XpmSuccess\2/g +s/^XpmPixmapOpenFailed$/XpmOpenFailed/g +s/^XpmPixmapOpenFailed\([^a-zA-Z_]\)/XpmOpenFailed\1/g +s/\([^a-zA-Z_]\)XpmPixmapOpenFailed$/\1XpmOpenFailed/g +s/\([^a-zA-Z_]\)XpmPixmapOpenFailed\([^a-zA-Z_]\)/\1XpmOpenFailed\2/g +s/^XpmPixmapFileInvalid$/XpmFileInvalid/g +s/^XpmPixmapFileInvalid\([^a-zA-Z_]\)/XpmFileInvalid\1/g +s/\([^a-zA-Z_]\)XpmPixmapFileInvalid$/\1XpmFileInvalid/g +s/\([^a-zA-Z_]\)XpmPixmapFileInvalid\([^a-zA-Z_]\)/\1XpmFileInvalid\2/g +s/^XpmPixmapNoMemory$/XpmNoMemory/g +s/^XpmPixmapNoMemory\([^a-zA-Z_]\)/XpmNoMemory\1/g +s/\([^a-zA-Z_]\)XpmPixmapNoMemory$/\1XpmNoMemory/g +s/\([^a-zA-Z_]\)XpmPixmapNoMemory\([^a-zA-Z_]\)/\1XpmNoMemory\2/g +s/^XpmPixmapColorFailed$/XpmColorFailed/g +s/^XpmPixmapColorFailed\([^a-zA-Z_]\)/XpmColorFailed\1/g +s/\([^a-zA-Z_]\)XpmPixmapColorFailed$/\1XpmColorFailed/g +s/\([^a-zA-Z_]\)XpmPixmapColorFailed\([^a-zA-Z_]\)/\1XpmColorFailed\2/g +s/^XpmReadPixmapFile$/XpmReadFileToPixmap/g +s/^XpmReadPixmapFile\([^a-zA-Z_]\)/XpmReadFileToPixmap\1/g +s/\([^a-zA-Z_]\)XpmReadPixmapFile$/\1XpmReadFileToPixmap/g +s/\([^a-zA-Z_]\)XpmReadPixmapFile\([^a-zA-Z_]\)/\1XpmReadFileToPixmap\2/g +s/^XpmWritePixmapFile$/XpmWriteFileFromPixmap/g +s/^XpmWritePixmapFile\([^a-zA-Z_]\)/XpmWriteFileFromPixmap\1/g +s/\([^a-zA-Z_]\)XpmWritePixmapFile$/\1XpmWriteFileFromPixmap/g +s/\([^a-zA-Z_]\)XpmWritePixmapFile\([^a-zA-Z_]\)/\1XpmWriteFileFromPixmap\2/g diff --git a/src/xpm/doc/plaid.xpm b/src/xpm/doc/plaid.xpm new file mode 100644 index 0000000..b0e9200 --- /dev/null +++ b/src/xpm/doc/plaid.xpm @@ -0,0 +1,34 @@ +/* XPM */ +static char * plaid[] = { +/* plaid pixmap + * width height ncolors chars_per_pixel */ +"22 22 4 2 ", +/* colors */ +" c red m white s light_color ", +"Y c green m black s lines_in_mix ", +"+ c yellow m white s lines_in_dark ", +"x m black s dark_color ", +/* pixels */ +"x x x x x x x x x x x x + x x x x x ", +" x x x x x x x x x x x x x x x x ", +"x x x x x x x x x x x x + x x x x x ", +" x x x x x x x x x x x x x x x x ", +"x x x x x x x x x x x x + x x x x x ", +"Y Y Y Y Y x Y Y Y Y Y + x + x + x + x + x + ", +"x x x x x x x x x x x x + x x x x x ", +" x x x x x x x x x x x x x x x x ", +"x x x x x x x x x x x x + x x x x x ", +" x x x x x x x x x x x x x x x x ", +"x x x x x x x x x x x x + x x x x x ", +" x x x x Y x x x ", +" x x x Y x x ", +" x x x x Y x x x ", +" x x x Y x x ", +" x x x x Y x x x ", +"x x x x x x x x x x x x x x x x x x x x x x ", +" x x x x Y x x x ", +" x x x Y x x ", +" x x x x Y x x x ", +" x x x Y x x ", +" x x x x Y x x x " +} ; diff --git a/src/xpm/doc/plaid_mask.xpm b/src/xpm/doc/plaid_mask.xpm new file mode 100644 index 0000000..167d338 --- /dev/null +++ b/src/xpm/doc/plaid_mask.xpm @@ -0,0 +1,35 @@ +/* XPM */ +static char * plaid[] = { +/* plaid pixmap + * width height ncolors chars_per_pixel */ +"22 22 5 2", +/* colors */ +". c red m white s light_color ", +"Y c green m black s lines_in_mix ", +"+ c yellow m white s lines_in_dark ", +"x m black s dark_color ", +" c none s mask ", +/* pixels */ +" x x x x x + x x x x x ", +" . x x x x x x x x x x x ", +" . x x x x x x + x x x x x ", +" . x . x x x x x x x x x x x ", +" . x . x x x x x x + x x x x x ", +" Y Y Y Y Y + x + x + x + x + x + ", +" x x . x . x x x x x x + x x x x x ", +" . x . x . x . x x x x x x x x x x x ", +" . x x x . x . x x x x x x + x x x x x ", +" . x . x . x . x . x x x x x x x x x x x ", +" . x . x x x . x . x x x x x x + x x x x x ", +". . . . . x . . . . . x . x . x Y x . x . x ", +". . . . . x . . . . . . x . x . Y . x . x . ", +". . . . . x . . . . . x . x . x Y x . x . x ", +". . . . . x . . . . . . x . x . Y . x . x . ", +". . . . . x . . . . . x . x . x Y x . x . x ", +"x x x x x x x x x x x x x x x x x x x x x x ", +". . . . . x . . . . . x . x . x Y x . x . x ", +". . . . . x . . . . . . x . x . Y . x . x . ", +". . . . . x . . . . . x . x . x Y x . x . x ", +". . . . . x . . . . . . x . x . Y . x . x . ", +". . . . . x . . . . . x . x . x Y x . x . x " +} ; diff --git a/src/xpm/doc/xpm.tex b/src/xpm/doc/xpm.tex new file mode 100644 index 0000000..7614e89 --- /dev/null +++ b/src/xpm/doc/xpm.tex @@ -0,0 +1,849 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% XPM MANUAL % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% adjust these for centering on the page: +% upper-left corner of frame in title page must be at 60mm,60mm from +% upper-left corner of the page + +% normal (A4) on our Apple Laserwriter with dvi2ps +%\hoffset 0cm +%\voffset 0cm +% normal (A4 & Letter) on our Apple Laserwriter with dvips v5.0 +\hoffset -5.5mm +\voffset 0cm +% our imagen +%\hoffset -0.9cm +%\voffset -2.2cm + +% NOTE: the following line MUST be commented out! +%\includeonly{standard} + +\makeindex + +\documentstyle[twoside,colas]{article} + +% IF YOUR DVI PRINTER CHOKES ON INCLUDED POSTSCRIPT FILES +% by the \special command, uncomment the following line: +% \def\texpsfig#1#2#3{\fbox{Figure ``#1''}} + + +\pagestyle{headings} +\begin{document} + +\thispagestyle{empty} +\ +\hbox{\colastitledisp +\vbox{ +\vspace{3cm} +\begin{center} +\fboxrule 0.4pt \fboxsep 1pt +\fbox{\fboxrule 3pt \fboxsep 30pt \fbox{\Huge\bf XPM Manual}} +\end{center} +\vspace{2cm} +\begin{center} +\huge +The {\bf X} {\bf P}ix{\bf M}ap Format +\end{center} +\vspace{2cm} +\begin{center} +\Large Version \RCSRevVersion$Version: 3.2c $\\ +\end{center} +\vspace{2cm} +\begin{center} +\LARGE\sf Arnaud Le Hors\\ +\large\tt lehors@sophia.inria.fr +\end{center} +\vspace{1cm} +\vspace{1cm} +\begin{center} +\copyright BULL 1990-92 +\end{center} +}} + +\newpage + +\section*{Copyright restrictions} +{\bf\begin{flushleft} +Copyright 1990-92 GROUPE BULL\\ +\end{flushleft}} + +{\sf +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided +that the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of GROUPE BULL not be used in advertising +or publicity pertaining to distribution of the software without specific, +written prior permission. GROUPE BULL makes no representations about the +suitability of this software for any purpose. It is provided ``as is'' +without express or implied warranty. + +GROUPE BULL disclaims all warranties with regard to this software, +including all implied warranties of merchantability and fitness, +in no event shall GROUPE BULL be liable for any special, +indirect or consequential damages or any damages +whatsoever resulting from loss of use, data or profits, +whether in an action of contract, negligence or other tortious +action, arising out of or in connection with the use +or performance of this software. +} + +\section*{Acknowledgements} + +I want to thank my team partner and friend Colas Nahaboo who proposed me this +project, and who actively participates to its design. I also want to thank all +the users who help me to improve the library by giving feed back and sending +bug reports. + +\begin{flushright} +{\Large Arnaud Le Hors.\quad} +{\small +KOALA Project -- BULL Research c/o INRIA\\ +2004 route des Lucioles -- 06565 Valbonne Cedex -- FRANCE\\ +} +\end{flushright} + +\section*{Support} + +\sloppy +You can mail any question or suggestion relative to {\bf XPM} by electronic +mail to {\tt lehors@sophia.inria.fr}. There is also a mailing list, please +mail requests to {\tt xpm-talk-request@sophia.inria.fr} to subscribe. You can +find the latest release by anonymous ftp on avahi.inria.fr (138.96.24.30) or +export.lcs.mit.edu (18.30.0.238), and also an archive of the mailing list on +avahi. + + +\newpage +\section{Introduction} +First, Why another image format? We (Koala team at Bull Research, France) +felt that most images bundled with X applications will be small "icons", and +that since many applications are color-customizable, existing image formats +such as gif, tiff, iff, etc... were intended for big images with well-defined +colors and so weren't adapted to the task. So {\bf XPM} was designed with +these criterions in mind: +\begin{itemize} +\item be editable by hand (under emacs, vi...). Color pixmap editors aren't +available everywhere. +\item be includable in C code. It is unreasonable to load +1000 pixmap files on each start of an application. +\item be a portable, mailable ascii format. +\item provide defaults for monochrome/color/grayscale renderings. +\item provide overriding of colors. This way if the user wants your application +to be bluish instead of greenish, you can use the SAME icon files. +\item allow comments to be included in the file. +\item compression must be managed apart of the format. +\end{itemize} + +\newpage +\section{The {\bf XPM} Format} + +The {\bf XPM} format presents a C syntax, in order to provide the ability to +include {\bf XPM} files in C and C++ programs. It is in fact an array of +strings composed of six different sections as follows: +{\tt +\begin{quote} +/* XPM */ +static char* {\tt <variable\_name>}[] = \{ + +<Values> + +<Colors> + +<Pixels> + +<Extensions> + +\}; +\end{quote} +} + +The words are separated by a white space which can be composed of space and +tabulation characters. + +The {\tt <Values>} section is a string containing four or six integers in base +10 that correspond to: the pixmap width and height, the number of colors, the +number of characters per pixel (so there is no limit on the number of colors), +and, optionally the hotspot coordinates and the {\bf XPMEXT} tag if there is +any extension following the {\tt <Pixels>} section. + +{\tt <width> <height> <ncolors> <cpp> [<x\_hotspot> <y\_hotspot>] [XPMEXT]} + +The {\tt Colors} section contains as many strings as there are colors, and +each string is as follows: + +{\tt <chars> \{<key> <color>\}+} + +Where {\tt <chars>} is the {\tt <chars\_per\_pixel>} length string (not +surrounded by anything) representing the pixels, {\tt <color>} is the +specified color, and {\tt <key>} is a keyword describing in which context this +color should be used. Currently the keys may have the following values: + +\begin{tabbing} +\hspace{1cm}\= g4 \= for 4-level grayscale\kill +\> m \>for mono visual\\ +\> s \> for symbolic name\\ +\> g4 \> for 4-level grayscale\\ +\> g \> for grayscale with more than 4 levels\\ +\> c \> for color visual +\end{tabbing} + +Colors can be specified by giving the colorname, a \# foolwed by the RGB code, +or a \% followed by the HSV code. The symbolic name provides the ability of +specifying the colors at load time and not to hard-code them in the file. +Also the string {\bf None} can be given as a colorname to mean +``transparent''. Transparency is handled by providing a masking bitmap in +addition to the pixmap. + +The {\tt <Pixels>} section is composed by {\tt <height>} strings of {\tt +<width>} * {\tt <chars\_per\_pixel>} characters, where every {\tt +<chars\_per\_pixel>} length string must be one of the previously defined +groups in the {\tt <Colors>} section. + +Then follows the {\tt <Extensions>} section which must be labeled, if not +empty, in the {\tt <Values>} section as previously described. +This section may be composed by several {\tt <Extension>} subsections which +may be of two types: + +\begin{itemize} +\item[] one stand alone string composed as follows: + +{\tt XPMEXT <extension-name> <extension-data>} + +\item[] or a block composed by several strings: + +{\tt XPMEXT <extension-name>} + +{\tt <related extension-data composed of several strings>} + +\end{itemize} + +Finally, if not empty, this section must end by the following string: + +{\tt XPMENDEXT} + +To avoid possible conflicts with extension names in shared files, they should +be prefixed by the name of the company. This would ensure unicity. + +\vspace{0.5cm} +Below is an example which is the XPM file of a plaid pixmap. This is a 22x22 +pixmap, with 4 colors and 2 characters per pixel. The hotspot coordinates are +(0, 0). There are symbols and default colors for color and monochrome visuals. +Finally there are two extensions. + +{\small \begin{verbatim} + +/* XPM */ +static char * plaid[] = { +/* plaid pixmap + * width height ncolors chars_per_pixel */ +"22 22 4 2 0 0 XPMEXT", +/* colors */ +" c red m white s light_color ", +"Y c green m black s lines_in_mix ", +"+ c yellow m white s lines_in_dark ", +"x m black s dark_color ", +/* pixels */ +"x x x x x x x x x x x x + x x x x x ", +" x x x x x x x x x x x x x x x x ", +"x x x x x x x x x x x x + x x x x x ", +" x x x x x x x x x x x x x x x x ", +"x x x x x x x x x x x x + x x x x x ", +"Y Y Y Y Y x Y Y Y Y Y + x + x + x + x + x + ", +"x x x x x x x x x x x x + x x x x x ", +" x x x x x x x x x x x x x x x x ", +"x x x x x x x x x x x x + x x x x x ", +" x x x x x x x x x x x x x x x x ", +"x x x x x x x x x x x x + x x x x x ", +" x x x x Y x x x ", +" x x x Y x x ", +" x x x x Y x x x ", +" x x x Y x x ", +" x x x x Y x x x ", +"x x x x x x x x x x x x x x x x x x x x x x ", +" x x x x Y x x x ", +" x x x Y x x ", +" x x x x Y x x x ", +" x x x Y x x ", +" x x x x Y x x x " +"XPMEXT ext1 data1", +"XPMEXT ext2", +"data2_1", +"data2_2", +"XPMENDEXT" +}; + +\end{verbatim}} + +\newpage +\section{The {\bf XPM} Library} + +The XPM library provides a set of Xlib-level functions which allows to deal +with images, pixmaps, XPM file, and data (included XPM file) in many ways. +This section describes these functions and how to use them. + +\vspace{.5cm} +To provide a simple interface all these functions take, in addition to their +main arguments such as the display, a structure called {\bf XpmAttributes}. +This structure may be considered as composed of two different groups of +members. The first one is composed of attributes to pass data such as colormap +and visual and attributes to retrieve returned data such as pixmap's width and +height. The second group provides a way to rewrite an {\bf XPM} file without +losing information such as comments, color defaults and symbolic names which +may exist in the original file (i.e. the {\bf XpmInfo} structure in {\bf XPM 2}). +The {\bf XpmAttributes} structure is defined as follows: + +{\small \begin{tabbing} + +\hspace{1cm}\= XpmColorSymbol *colorsymbols; \=/* List of color symbols */\kill +typedef struct \{ \\ +\> unsigned long valuemask; \>/* Specifies which attributes are defined */\\ +\\ +\> Visual *visual; \>/* Specifies the visual to use */ \\ +\> Colormap colormap; \>/* Specifies the colormap to use */ \\ +\> unsigned int depth; \>/* Specifies the depth */ \\ +\> unsigned int width; \>/* Returns the width of the created pixmap */\\ +\> unsigned int height; \>/* Returns the height of the created pixmap */\\ +\> unsigned int x\_hotspot; \>/* Returns the x hotspot's coordinate */\\ +\> unsigned int y\_hotspot; \>/* Returns the y hotspot's coordinate */ \\ +\> unsigned int cpp; \>/* Specifies the number of char per pixel */ \\ +\> Pixel *pixels; \>/* List of used color pixels */ \\ +\> unsigned int npixels; \>/* Number of pixels */\\ +\> XpmColorSymbol *colorsymbols;\>/* Array of color symbols to override */ \\ +\> unsigned int numsymbols; \>/* Number of symbols */ \\ +\> char *rgb\_fname; \>/* RGB text file name */ \\ +\> unsigned int nextensions; \>/* Number of extensions */ \\ +\> XpmExtension *extensions; \>/* Array of extensions */ \\ +\\ +\> /* Infos */ \\ +\> int ncolors; \>/* Number of colors */ \\ +\> char ***colorTable; \>/* Color table pointer */ \\ +\> char *hints\_cmt; \>/* Comment of the hints section */ \\ +\> char *colors\_cmt; \>/* Comment of the colors section */ \\ +\> char *pixels\_cmt; \>/* Comment of the pixels section */ \\ +\> unsigned int mask\_pixel; \>/* Transparent pixel's color table index */\\ +\\ +\> /* Color Allocation Directives */ \\ +\> unsigned int exactColors; \>/* Only use exact colors for visual */ \\ +\> unsigned int closeness; \>/* Allowable RGB deviation */ \\ +\\ +\} XpmAttributes; + +\end{tabbing}} + +The valuemask is the bitwise inclusive OR of the valid attribute mask bits. If +the valuemask is zero, the attributes are ignored and not referenced. And +default values are taken for needed attributes which are not specified. + +The colorTable is a two dimensional array of strings, organized as follows: +\begin{flushleft} +\hspace{.5cm}colorTable[color\#][0] points to the character string associated +to the color.\\ +\hspace{.5cm}colorTable[color\#][1] points to the symbolic name of the color.\\ +\hspace{.5cm}colorTable[color\#][2] points to the default color for monochrome +visuals.\\ +\hspace{.5cm}colorTable[color\#][3] points to the default color for 4-level +grayscale visuals.\\ +\hspace{.5cm}colorTable[color\#][4] points to the default color for other +grayscale visuals.\\ +\hspace{.5cm}colorTable[color\#][5] points to the default color for color +visuals. +\end{flushleft} + +Comments are limited to a single comment string by section. If more exist in +the read file, then only the last comment of each section will be stored. + +To get information back while writing out to a file, you just have to set +the mask bits {\bf XpmReturnInfos} to the valuemask of an {\bf XpmAttributes} +structure that you pass to the {\bf XpmReadFileToPixmap} function while reading +the file, and then give the structure back to the {\bf XpmWriteFileFromPixmap} +function while writing. + +\vspace{.5cm} +To allow overriding of colors at load time the {\bf XPM} library defines the +{\bf XpmColorSymbol} structure which contains: + +\begin{tabbing} +\hspace{1cm}\= char *value; \hspace{1.5cm}\= /* Color value */\kill +typedef struct \{\\ +\> char *name; \> /* Symbolic color name */\\ +\> char *value;\> /* Color value */\\ +\> Pixel pixel;\> /* Color pixel */\\ +\} XpmColorSymbol; +\end{tabbing} + +To override default colors at load time, you just have to pass, via the {\bf +XpmAttributes} structure, a list of {\bf XpmColorSymbol} elements containing +the desired colors to the {\bf XpmReadFileToPixmap} or {\bf +XpmCreatePixmapFromData} {\bf XPM} functions. These colors can be specified by +giving the color name in the value member or directly by giving the +corresponding pixel in the pixel member. In the latter case the value member +must be set to {\bf NULL} otherwise the given pixel will not be considered. + +In addition, is is possible to set the pixel for a specific color {\bf value} +at load time by setting the color name to NULL, and setting the value and pixel +fields appropriately. For example, by setting the color name to NULL, the +value to ``red'' and the pixel to 51, all symbolic colors that are assigned to +``red'' will be set to pixel 51. It is even possible to specify the pixel used +for the transparent color ``none'' when no mask is required. + +\vspace{.5cm} +To pass and retrieve extension data use the {\bf XpmExtension} structure which +is defined below: + +\begin{tabbing} +\hspace{1cm}\= unsigned int nlines; \hspace{1cm}\= /* */ \kill +typedef struct \{ \\ +\> char *name; \> /* name of the extension */ \\ +\> unsigned int nlines; \> /* number of lines in this extension */ \\ +\> char **lines; \> /* pointer to the extension array of strings */ \\ +\} XpmExtension; +\end{tabbing} + +To retrieve possible extension data stored in an {\bf XPM} file or data, you +must set the mask bits {\bf XpmReturnExtensions} to the valuemask of an {\bf +XpmAttributes} structure that you pass to the read function you use. Then the +same structure may be passed the same way to any write function if you set the +mask bits {\bf XpmExtensions} to the valuemask. + +\vspace{.5cm} +To create a pixmap from an {\bf XPM} file, use {\bf XpmReadFileToPixmap}. + +\begin{flushleft} + +int XpmReadFileToPixmap({\it display, d, filename, \\ +\hspace{3cm}pixmap\_return, shapemask\_return, attributes})\\ + +\hspace{1cm}Display {\it *display;}\\ +\hspace{1cm}Drawable {\it d;}\\ +\hspace{1cm}char {\it *filename;}\\ +\hspace{1cm}Pixmap {\it *pixmap\_return;}\\ +\hspace{1cm}Pixmap {\it *shapemask\_return;}\\ +\hspace{1cm}XpmAttributes {\it *attributes;} + +\end{flushleft} + +\begin{description} + +\itemit{display} Specifies the connection to the X server. +\itemit{d} Specifies which screen the pixmap is created on. +\itemit{filename} Specifies the file name to use. +\itemit{pixmap\_return} Returns the pixmap which is created. +\itemit{shapemask\_return} Returns the shapemask which is created, if any. +\itemit{attributes} Specifies the location of an {\bf XpmAttributes} structure +to get and store information. + +\end{description} + +The {\bf XpmReadFileToPixmap} function reads in a file containing a pixmap in +the {\bf XPM} format. If the file cannot be opened, {\bf XpmReadFileToPixmap} +returns {\bf XpmOpenFailed}. If the file can be opened but does not +contain valid {\bf XPM} pixmap data, it returns {\bf XpmFileInvalid}. If +insufficient working storage is allocated, it returns {\bf XpmNoMemory}. + +If the passed {\bf XpmAttributes} structure pointer is not {\bf NULL}, {\bf +XpmReadFileToPixmap} looks for the following attributes: {\bf XpmVisual}, {\bf +XpmColormap}, {\bf XpmDepth}, {\bf XpmColorSymbols}, {\bf XpmExactColors}, +{\bf XpmCloseness}, {\bf XpmReturnPixels}, {\bf XpmReturnExtensions}, +{\bf XpmReturnInfos}, and sets the {\bf XpmSize} and possibly the +{\bf XpmHotspot} attributes when returning. + +{\bf XpmReadFileToPixmap} allocates colors, as read from the file or possibly +overridden as specified in the {\bf XpmColorSymbols} attributes. The colors +are allocated dependently on the type of visual and on the default colors. If +no default value exits for the specified visual, it first looks for other +defaults nearer to the monochrome visual type and secondly nearer to the color +visual type. If the color which is found is not valid (cannot parse it), it +looks for another default one according to the same algorithm. + +If allocating a color fails, and the {\bf closeness} attribute is set, it +tries to find a color already in the colormap that is closest to the desired +color, and uses that. If no color can be found that is within {\bf closeness} +of the Red, Green and Blue components of the desired color, it reverts to +trying other default values as explained above. + +The RGB Components are integers within the range 0 (black) to 65535 (white). +A closeness of less than 10000, for example, will cause only quite close colors +to be matched, while a closeness of more than 50000 will allow quite +dissimilar colors to match. Specifying a closeness of more than 65535 will +allow any color to match, thus forcing the icon to be drawn in color no matter +how bad the colormap is. The value 40000 seems to be about right for many +situations requiring reasonable but not perfect matches. With this setting the +color must only be within the same general area of the RGB cube as the desired +color. + +If the {\bf exactColors} attribute is set it then returns {\bf XpmColorError}, +otherwise it creates the pixmap and returns XpmSuccess. If no color is found, +and no close color exists or is wanted, and all visuals have been exhausted, +{\bf XpmColorFailed} is returned. + +{\bf XpmReadFileToPixmap} returns the created pixmap to pixmap\_return if not +{\bf NULL} and possibly the created shapemask to shapemask\_return if not +{\bf NULL}. If required it stores into the {\bf XpmAttributes} structure the +list of the used pixels and possible comments, color defaults and symbols. +When finished the caller must free the pixmaps using {\bf XFreePixmap}, the +colors using {\bf XFreeColors}, and possibly the data returned into the +{\bf XpmAttributes} using {\bf XpmFreeAttributes}. + +In addition on system which support such features {\bf XpmReadFileToPixmap} +deals with compressed files by forking an uncompress process and reading from +the piped result. It assumes that the specified file is compressed if the +given file name ends by .Z. In case the file name does not end so, {\bf +XpmReadFileToPixmap} first looks for a file of which the name is the given one +followed by .Z; then if such a file does not exist, it looks for the given +file (assumed as not compressed). And if instead of a file name {\bf NULL} is +passed to {\bf XpmReadFileToPixmap}, it reads from the standard input. + +\vspace{.5cm} +To write out a pixmap to an {\bf XPM} file, use {\bf XpmWriteFileFromPixmap}. + +\begin{flushleft} + +int XpmWriteFileFromPixmap({\it display, filename, pixmap, shapemask,\\ +\hspace{3cm}attributes})\\ + +\hspace{1cm}Display {\it *display;}\\ +\hspace{1cm}char {\it *filename;}\\ +\hspace{1cm}Pixmap {\it pixmap;}\\ +\hspace{1cm}Pixmap {\it shapemask;}\\ +\hspace{1cm}XpmAttributes {\it *attributes;} + +\end{flushleft} + +\begin{description} + +\itemit{display} Specifies the connection to the X server. +\itemit{filename} Specifies the file name to use. +\itemit{pixmap} Specifies the pixmap. +\itemit{shapemask} Specifies the shape mask pixmap. +\itemit{attributes} Specifies the location of an {\bf XpmAttributes} structure +containing information. + +\end{description} + +The {\bf XpmWriteFileFromPixmap} function writes a pixmap and its possible +shapemask out to a file in the {\bf XPM} format. If the file cannot be opened, +it returns {\bf XpmOpenFailed}. If insufficient working storage is +allocated, it returns {\bf XpmNoMemory}. If no error occurs then it +returns {\bf XpmSuccess}. + +If the passed {\bf XpmAttributes} structure pointer is not {\bf NULL}, {\bf +XpmWriteFileFromPixmap} look for the following attributes: {\bf XpmColormap}, +{\bf XpmSize}, {\bf XpmHotspot}, {\bf XpmCharsPerPixel}, {\bf XpmRgbFilename}, +{\bf XpmInfos} and {\bf XpmExtensions}. + +If the {\bf XpmSize} attributes are not defined {\bf XpmWriteFileFromPixmap} +performs an {\bf XGetGeometry} operation. If the filename contains an +extension such as ``.xpm'' it is cut off when writing out to the pixmap +variable name. If the {\bf XpmInfos} attributes are defined it writes out +possible stored information such as comments, color defaults and symbol. +Finally if the {\bf XpmRgbFilename} attribute is defined, {\bf +XpmWriteFileFromPixmap} searches for color names in this file and if found +writes them out instead of the rgb values. + +In addition on system which support such features if the given file name ends +by .Z it is assumed to be a compressed file. Then, {\bf XpmWriteFileFromPixmap} +writes to a piped compress process. And if instead of a file name {\bf NULL} +is passed to {\bf XpmWriteFileFromPixmap}, it writes to the standard output. + +\vspace{.5cm} +To create a pixmap from an {\bf XPM} file directly included in a program, use +{\bf XpmCreatePixmapFromData}. + +\begin{flushleft} + +int XpmCreatePixmapFromData({\it display, d, data, \\ +\hspace{3cm}pixmap\_return, shapemask\_return, attributes})\\ + +\hspace{1cm}Display {\it *display;}\\ +\hspace{1cm}Drawable {\it d;}\\ +\hspace{1cm}char {\it **data;}\\ +\hspace{1cm}Pixmap {\it *pixmap\_return;}\\ +\hspace{1cm}Pixmap {\it *shapemask\_return;}\\ +\hspace{1cm}XpmAttributes {\it *attributes;} + +\end{flushleft} + +\begin{description} + +\itemit{display} Specifies the connection to the X server. +\itemit{d} Specifies which screen the pixmap is created on. +\itemit{data} Specifies the location of the pixmap data. +\itemit{pixmap\_return} Returns the pixmap which is created. +\itemit{shapemask\_return} Returns the shape mask pixmap which is created if +any. +\itemit{attributes} Specifies the location of an {\bf XpmAttributes} structure +to get and store information, or {\bf NULL}. + +\end{description} + +The {\bf XpmCreatePixmapFromData} function allows you to include in your C +program an {\bf XPM} pixmap file which was written out by {\bf +XpmWriteFileFromPixmap} without reading in the pixmap file. + +{\bf XpmCreatePixmapFromData} exactly works as {\bf +Xpm\-Read\-File\-To\-Pixmap} does and returns the same way. It just reads data +instead of a file. Here again, it is the caller's responsibility to free the +pixmaps, the colors and possibly the data returned into the {\bf +XpmAttributes} structure. + +\vspace{.5cm} +In some cases, one may want to create an {\bf XPM} data from a pixmap in order +to be able to create a pixmap from this data using the {\bf +XpmCreatePixmapFromData} function later on. To do so use {\bf +XpmCreateDataFromPixmap}. + +\begin{flushleft} + +int XpmCreateDataFromPixmap({\it display, data\_return, pixmap, shapemask,\\ +\hspace{3cm}attributes})\\ + +\hspace{1cm}Display {\it *display;}\\ +\hspace{1cm}char {\it ***data\_return;}\\ +\hspace{1cm}Pixmap {\it pixmap;}\\ +\hspace{1cm}Pixmap {\it shapemask;}\\ +\hspace{1cm}XpmAttributes {\it *attributes;} + +\end{flushleft} + +\begin{description} + +\itemit{display} Specifies the connection to the X server. +\itemit{data\_return} Returns the data which is created. +\itemit{pixmap} Specifies the pixmap. +\itemit{shapemask} Specifies the shape mask pixmap. +\itemit{attributes} Specifies the location of an {\bf XpmAttributes} structure +containing information. + +\end{description} + +The {\bf XpmCreateDataFromPixmap} function exactly works as {\bf +Xpm\-Write\-File\-From\-Pixmap} does and returns the same way. It just writes +to a single block malloc'ed data instead of to a file. It is the caller's +responsibility to free the data when finished. + +\vspace{.5cm} +To do the same than the four functions described above do but with images +instead of pixmaps use the functions {\bf XpmReadFileToImage}, {\bf +XpmWriteFileFromImage}, {\bf XpmCreateImageFromData}, {\bf +XpmCreateDataFromImage}. + +\vspace{.2cm} +{\bf XpmReadFileToImage} creates an image from an {\bf XPM} file. + +\begin{flushleft} + +int XpmReadFileToImage({\it display, filename, \\ +\hspace{3cm}image\_return, shapeimage\_return, attributes})\\ + +\hspace{1cm}Display {\it *display;}\\ +\hspace{1cm}char {\it *filename;}\\ +\hspace{1cm}XImage {\it **image\_return;}\\ +\hspace{1cm}XImage {\it **shapeimage\_return;}\\ +\hspace{1cm}XpmAttributes {\it *attributes;} + +\end{flushleft} + +\begin{description} + +\itemit{display} Specifies the connection to the X server. +\itemit{filename} Specifies the file name to use. +\itemit{image\_return} Returns the image which is created. +\itemit{shapeimage\_return} Returns the shape mask image which is created if +any. +\itemit{attributes} Specifies the location of an {\bf XpmAttributes} structure +to get and store information. + +\end{description} + +\vspace{.5cm} +{\bf XpmWriteFileFromImage} writes out an image to an {\bf XPM} file. + +\begin{flushleft} + +int XpmWriteFileFromImage({\it display, filename, image, shapeimage,\\ +\hspace{3cm}attributes})\\ + +\hspace{1cm}Display {\it *display;}\\ +\hspace{1cm}char {\it *filename;}\\ +\hspace{1cm}XImage {\it *image;}\\ +\hspace{1cm}XImage {\it *shapeimage;}\\ +\hspace{1cm}XpmAttributes {\it *attributes;} + +\end{flushleft} + +\begin{description} + +\itemit{display} Specifies the connection to the X server. +\itemit{filename} Specifies the file name to use. +\itemit{image} Specifies the image. +\itemit{shapeimage} Specifies the shape mask image. +\itemit{attributes} Specifies the location of an {\bf XpmAttributes} structure +containing information. + +\end{description} + +\vspace{.5cm} +{\bf XpmCreateImageFromData} creates an image from an {\bf XPM} file directly included in a program. + +\begin{flushleft} + +int XpmCreateImageFromData({\it display, data, \\ +\hspace{3cm}image\_return, shapeimage\_return, attributes})\\ + +\hspace{1cm}Display {\it *display;}\\ +\hspace{1cm}char {\it **data;}\\ +\hspace{1cm}XImage {\it **image\_return;}\\ +\hspace{1cm}XImage {\it **shapeimage\_return;}\\ +\hspace{1cm}XpmAttributes {\it *attributes;} + +\end{flushleft} + +\begin{description} + +\itemit{display} Specifies the connection to the X server. +\itemit{data} Specifies the location of the image data. +\itemit{image\_return} Returns the image which is created. +\itemit{shapeimage\_return} Returns the shape mask image which is created if +any. +\itemit{attributes} Specifies the location of an {\bf XpmAttributes} structure +to get and store information, or {\bf NULL}. + +\end{description} + +\vspace{.5cm} +{\bf XpmCreateDataFromImage} creates an {\bf XPM} data from an image. + +\begin{flushleft} + +int XpmCreateDataFromImage({\it display, data\_return, image, shapeimage,\\ +\hspace{3cm}attributes})\\ + +\hspace{1cm}Display {\it *display;}\\ +\hspace{1cm}char {\it ***data\_return;}\\ +\hspace{1cm}XImage {\it *image;}\\ +\hspace{1cm}XImage {\it *shapeimage;}\\ +\hspace{1cm}XpmAttributes {\it *attributes;} + +\end{flushleft} + +\begin{description} + +\itemit{display} Specifies the connection to the X server. +\itemit{data\_return} Returns the data which is created. +\itemit{image} Specifies the image. +\itemit{shapeimage} Specifies the shape mask image. +\itemit{attributes} Specifies the location of an {\bf XpmAttributes} structure +containing information. + +\end{description} + +These four functions work exactly the same way than the four ones previously +described. + +\vspace{.5cm} +To directly tranform an {\bf XPM} file to and from an {\bf XPM} data +array, without requiring an open X display, use {\bf +XpmReadFileToData} and {\bf XpmWriteFileFromData}. + +\vspace{.2cm} +{\bf XpmReadFileToData} allocates and fills an XPM data array from an {\bf XPM} file. + +\begin{flushleft} + +int XpmReadFileToData({\it filename, data\_return})\\ + +\hspace{1cm}char {\it *filename;}\\ +\hspace{1cm}char {\it ***data\_return;} + +\end{flushleft} + +\begin{description} + +\itemit{filename} Specifies the file name to read. +\itemit{data\_return} Returns the data array created. + +\end{description} + +\vspace{.5cm} +{\bf XpmWriteFileFromData} writes an {\b XPM} data array to an {\bf XPM} file. + +\begin{flushleft} + +int XpmWriteFileFromData({\it filename, data})\\ + +\hspace{1cm}char {\it *filename;}\\ +\hspace{1cm}char {\it **data;} + +\end{flushleft} + +\begin{description} + +\itemit{filename} Specifies the file name to write. +\itemit{data} Specifies the {\b XPM} data array to read. + +\end{description} + +\vspace{.5cm} +To free possible data stored into an {\bf XpmAttributes} structure use {\bf +XpmFreeAttributes}. + +\begin{flushleft} + +int XpmFreeAttributes({\it attributes})\\ + +\hspace{1cm}XpmAttributes {\it *attributes;} + +\end{flushleft} + +\begin{description} + +\itemit{attributes} Specifies the structure to free. + +\end{description} + +The {\bf XpmFreeAttributes} frees the structure members which have been +malloc'ed: the pixels list and the infos members (comments strings and color +table). + +\vspace{.5cm} +To dynamically allocate an {\bf XpmAttributes} structure use the {\bf +Xpm\-Attributes\-Size} function. + +\begin{flushleft} + +int XpmAttributesSize() + +\end{flushleft} + +The {\bf XpmAttributesSize} function provides application using dynamic +libraries with a safe way to allocate and then refer to an {\bf XpmAttributes} +structure, disregarding whether the {\bf XpmAttributes} structure size has +changed or not since compiled. + +\vspace{.5cm} +To free data possibly stored into an array of {\bf XpmExtension} use {\bf +XpmFreeExtensions}. + +\begin{flushleft} + +int XpmFreeExtensions({\it extensions, nextensions})\\ + +\hspace{1cm}XpmExtension {\it *extensions;}\\ +\hspace{1cm}int {\it nextensions;} + +\end{flushleft} + +\begin{description} + +\itemit{extensions} Specifies the array to free. +\itemit{nextensions} Specifies the number of extensions. + +\end{description} + +This function frees all data stored in every extension and the array itself. +Note that {\bf XpmFreeAttributes} call this function and thus most of the time +it should not need to be explicitly called. + +\end{document} |