X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/16a12a3d27d3d3e2557bcde15365245ef2675bb4..538f35ccf43be97a317a1a80ae4b5c1b29068b01:/src/xpm/simx.h diff --git a/src/xpm/simx.h b/src/xpm/simx.h index ced9b39157..9b916182f7 100644 --- a/src/xpm/simx.h +++ b/src/xpm/simx.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1989-94 GROUPE BULL + * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -39,12 +39,33 @@ #ifdef FOR_MSW -#if defined(__OS2__) -#define INCL_OS2 -#include -#else +#if !defined(__OS2__) #include "windows.h" /* MS windows GDI types */ +#else +#define INCL_PM +#define INCL_GPI +#define INCL_DEV +#include +typedef unsigned long COLORREF; +/* +// RGB under OS2 is more like a PALETTEENTRY struct under Windows so we need a real RGB def +// #define OS2RGB(r,g,b) ((ULONG ((BYTE) (r) | ((UINT) (g) << 8)) | (((ULONG)(BYTE)(b)) << 16))) +*/ +#ifndef OS2RGB +# define OS2RGB(r,g,b) ((unsigned long)r<<16|(unsigned long)g<<8|(unsigned long)b) +#endif + +#ifndef GetBValue +# define GetBValue(rgb) ((BYTE)((rgb) >> 16)) #endif +#ifndef GetGValue +# define GetGValue(rgb) ((BYTE)(((UINT)(rgb)) >> 8)) +#endif +#ifndef GetRValue +# define GetRValue(rgb) ((BYTE)(rgb)) +#endif +#endif /* else __OS2__ */ + /* * minimal portability layer between ansi and KR C @@ -54,11 +75,11 @@ /* these defines get undefed at the end of this file */ #if __STDC__ || defined(__cplusplus) || defined(c_plusplus) /* ANSI || C++ */ -#define FUNC(f, t, p) extern t f p -#define LFUNC(f, t, p) static t f p +# define FUNC(f, t, p) extern t f p +# define LFUNC(f, t, p) static t f p #else /* k&R */ -#define FUNC(f, t, p) extern t f() -#define LFUNC(f, t, p) static t f() +# define FUNC(f, t, p) extern t f() +# define LFUNC(f, t, p) static t f() #endif @@ -69,7 +90,12 @@ FUNC(boundCheckingRealloc, void *, (void *p, long s)); /* define MSW types for X window types, I don't know much about MSW, but the following defines do the job */ +#if !defined(__OS2__) typedef HDC Display; /* this should be similar */ +#else +typedef HPS Display; +#endif + typedef void *Screen; /* not used */ typedef void *Visual; /* not used yet, is for GRAY, COLOR, * MONO */ @@ -77,12 +103,7 @@ typedef void *Visual; /* not used yet, is for GRAY, COLOR, typedef void *Colormap; /* should be COLORPALETTE, not done * yet */ -#if !defined(__OS2__) typedef COLORREF Pixel; -#else -typedef unsigned long COLORREF; -typedef unsigned long Pixel; -#endif #define PIXEL_ALREADY_TYPEDEFED /* to let xpm.h know about it */ @@ -131,18 +152,15 @@ extern "C" { #endif /* cplusplus */ #define ZPixmap 1 /* not really used */ +#define XYBitmap 1 /* not really used */ #ifndef True #define True 1 #define False 0 #endif - -/* #ifndef Bool -typedef BOOL Bool; +typedef BOOL Bool; /* take MSW bool */ #endif -*/ - /* make these local here, simx.c gets the same from xpm.h */ #undef LFUNC #undef FUNC