wxWidgets/src/xpm
Robin Dunn f641dada64 Changed version number in DLL name to 23_0
Added a new value for the FINAL flag to make another kind of wxPython
build possible


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8666 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-31 23:12:24 +00:00
..
Attrib.c merged 2.2 branch 2000-07-15 19:51:35 +00:00
changes Updated lib to 3.4g 2000-02-01 18:10:04 +00:00
copyrigh.t Updated lib to 3.4g 2000-02-01 18:10:04 +00:00
CrBufFrI.c merged 2.2 branch 2000-07-15 19:51:35 +00:00
CrDatFrI.c merged 2.2 branch 2000-07-15 19:51:35 +00:00
create.c Solved a typo related to masks. Was setting *all* pixels in the mask 2000-02-18 16:10:11 +00:00
CrIFrBuf.c merged 2.2 branch 2000-07-15 19:51:35 +00:00
CrIFrDat.c merged 2.2 branch 2000-07-15 19:51:35 +00:00
data.c Updates to make VA 3.0 compile again, particularly xpm 2000-02-15 05:49:02 +00:00
dataxpm.c Copied XPM files to new names to avoid conflict when compilign with VC++ project files 2000-02-07 12:50:46 +00:00
files Updated lib to 3.4g 2000-02-01 18:10:04 +00:00
hashtab.c Updates to make VA 3.0 compile again, particularly xpm 2000-02-15 05:49:02 +00:00
Image.c merged 2.2 branch 2000-07-15 19:51:35 +00:00
imagexpm.c Copied XPM files to new names to avoid conflict when compilign with VC++ project files 2000-02-07 12:50:46 +00:00
Info.c merged 2.2 branch 2000-07-15 19:51:35 +00:00
makefile.b32 merged 2.2 branch 2000-07-15 19:51:35 +00:00
makefile.bcc Added some makefiles, more BC++/win16 fixes 2000-03-17 10:08:07 +00:00
makefile.dos Misc small changes, some for VC++ 1.5 2000-02-23 16:54:18 +00:00
MAKEFILE.VA Update for building xpm as an os2 dll 2000-03-09 21:12:05 +00:00
makefile.vc Changed version number in DLL name to 23_0 2000-10-31 23:12:24 +00:00
makefile.wat Updated lib to 3.4g 2000-02-01 18:10:04 +00:00
misc.c Updates to make VA 3.0 compile again, particularly xpm 2000-02-15 05:49:02 +00:00
parse.c Updates to make VA 3.0 compile again, particularly xpm 2000-02-15 05:49:02 +00:00
RdFToDat.c merged 2.2 branch 2000-07-15 19:51:35 +00:00
RdFToI.c second merge of the 2.2 branch (RL) 2000-08-08 06:11:51 +00:00
readme.htm Updated lib to 3.4g 2000-02-01 18:10:04 +00:00
readme.msw Updated lib to 3.4g 2000-02-01 18:10:04 +00:00
rgb.c Updates to make VA 3.0 compile again, particularly xpm 2000-02-15 05:49:02 +00:00
rgbtab.h Updates to make VA 3.0 compile again, particularly xpm 2000-02-15 05:49:02 +00:00
scan.c merged 2.2 branch 2000-07-15 19:51:35 +00:00
simx.c merged 2.2 branch 2000-07-15 19:51:35 +00:00
simx.h A few more minor fixes for OS/2 2000-02-15 19:44:04 +00:00
WrFFrDat.c merged 2.2 branch 2000-07-15 19:51:35 +00:00
WrFFrI.c merged 2.2 branch 2000-07-15 19:51:35 +00:00
xpm.dsp merged 2.2 branch 2000-07-15 19:51:35 +00:00
xpm.h more xpm fixes 2000-02-15 15:43:51 +00:00
XpmI.h merged 2.2 branch 2000-07-15 19:51:35 +00:00
XpmVC.dsp merged 2.2 branch 2000-07-15 19:51:35 +00:00
XpmVC.dsw merged 2.2 branch 2000-07-15 19:51:35 +00:00

README.MSW	hedu@cul-ipn.uni-kiel.de	5/94

		The XPM library for MS-Windows
		
Motivated by the wxWindows library, which is a (freely available) toolkit
for developing multi-platform, graphical applications from the same body 
of C++ code, I wanted to have XPM pixmaps for MS-windows. Instead of rewriting 
a XPM-parser I managed to port the XPM-library-code to MS-windows.
Thanks to Anaud Le Hors this became a part of the official XPM-library.

Until now it's only used together with wxWindows. And even there it's more 
a kind of beta. But it should be possible to run it as a simple libxpm.a 
without wxWindows.

The key is a transformation of some X types plus some basic X functions.
There is not yet a special MSW-API, so you should know the X types used.

The following is done in simx.h:

typedef HDC Display;
typedef COLORREF Pixel;

typedef struct {
    Pixel pixel;
    BYTE red, green, blue;
}      XColor;

typedef struct {
    HBITMAP bitmap;
    unsigned int width;
    unsigned int height;
    unsigned int depth;
}      XImage;

With these defines and the according functions from simx.c you can call
XPM-functions the way it's done under X windows. It can look like this:

	ErrorStatus=XpmCreateImageFromData(&dc, data, 
				&ximage,(XImage **)NULL, &xpmAttr);
	ms_bitmap = ximage->bitmap;
	// releases the malloc,but do not destroy the bitmap
	XImageFree(ximage);
	
Supported functions are the Xpm*Image* but not the Xpm*Pixmap*.

DRAWBACKS:
The main drawback is the missing support for Colormaps! There was nothing for
it in wxWindows, so I did not know how to deal with Colormaps.

The size of the pixmaps is bounded by malloc() (width*height*2 < 64K).

Close colors do not look that close. But that seems to be the window system.

Neither a special API for MSW nor a special MSW documentation other than this.
(I can only point you to wxxpm as an example , see below.)

INSTALLATION:
There is not yet a makefile with it. Simply take all the *.c files
into your project except the files related to Pixmap operations: *P*.c.
!!!You MUST set FOR_MSW on the preprocessor options!!!
(You might uncomment NEED_STRCASECMP in xpm.h if it's in your lib)
This should compile into libxpm.a. Good luck...

FTP:  
wxWindows is currently available from the Artificial Intelligence
Applications Institute (University of Edinburgh) by anonymous FTP.
	skye.aiai.ed.ac.uk  pub/wxwin/
or read http://burray.aiai.ed.ac.uk/aiai/aiai.html

wxxpm, XPM support for wxWindows, the latest version is available at
	yoda.cul-ipn.uni-kiel.de pub/wxxpm/
	and maybe in the contrib or tools of wxWindows
	
Please contact me if you have suggestions, comments or problems!

================================================================
Some fixes and comments by Jan Wielemaker (jan@swi.psy.uva.nl),
Oct 24, 1996:

	* Please try not to disturb me on this, XPM is not my
	piece of cake.

	* Hermann Dunkel has appearently moved in virtual space.

Changes:

	* I've used the xpm package under NT 4.0 and MSVC++ 4.2.

	* I've made a big performance improvement in 
	ParseAndPutPixels(), fixed creation of the mask in
	SetColor() in create.c.  I looked into XCreateImage()
	in simx.c, but commented out my improvement for reasons
	you'll find there.  If you know what is going on, statement
	(1) does not apply to you.

Comments on installation:

	* Donot include the to/from pixmap files into the project.
	These are the ones containing a capital P somewhere in their
	name.  You can also first include all, and then remove all
	the files you get errors on :-)

	* The DC that is requested should be a valid memory DC, thus
	CreateCompatibleDC(NULL) provides a good generic one, but
	GetDC(NULL) doesn't!  This costed me some time.

	* The real difficulty is using the mask, mostly due to the
	bad documentation.  If 95 or NT is your target, use:

	MaskBlt(context.hdc,	// Destination DC
		x, y, w, h,	// Destination area
		mhdc,		// Memory DC with the image selected
		sx, sy,		// Source X,Y
		msk,		// HBITMAP of the mask
		sx, sy,		// Mask X,Y
		MAKEROP4(SRCPAINT, SRCCOPY));	// The magic op code.
================================================================


--
   ////|\\\\   \\\\\\  Hermann Dunkel
     O   O     //////  IPN Uni Kiel, Germany
       |       \\\\\\  Tel: +49 431 / 880 3144
     \___/     //////  E-mail: hedu@cul-ipn.uni-kiel.de
      \_/      \\\\\\  X.400 : c=de;a=d400;p=uni-kiel;ou=nw-didaktik;s=dunkel