File indexing completed on 2025-01-18 10:15:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #ifndef _XpmP_h
0025 #define _XpmP_h
0026
0027
0028
0029 #define XpmCreatePixmapFromData XmeXpmCreatePixmapFromData
0030 #define XpmCreateDataFromPixmap XmeXpmCreateDataFromPixmap
0031 #define XpmReadFileToPixmap XmeXpmReadFileToPixmap
0032 #define XpmWriteFileFromPixmap XmeXpmWriteFileFromPixmap
0033 #define XpmCreateImageFromData XmeXpmCreateImageFromData
0034 #define XpmCreateDataFromImage XmeXpmCreateDataFromImage
0035 #define XpmReadFileToImage XmeXpmReadFileToImage
0036 #define XpmWriteFileFromImage XmeXpmWriteFileFromImage
0037 #define XpmCreateImageFromBuffer XmeXpmCreateImageFromBuffer
0038 #define XpmCreatePixmapFromBuffer XmeXpmCreatePixmapFromBuffer
0039 #define XpmCreateBufferFromImage XmeXpmCreateBufferFromImage
0040 #define XpmCreateBufferFromPixmap XmeXpmCreateBufferFromPixmap
0041 #define XpmReadFileToBuffer XmeXpmReadFileToBuffer
0042 #define XpmWriteFileFromBuffer XmeXpmWriteFileFromBuffer
0043 #define XpmReadFileToData XmeXpmReadFileToData
0044 #define XpmWriteFileFromData XmeXpmWriteFileFromData
0045 #define XpmAttributesSize XmeXpmAttributesSize
0046 #define XpmFreeAttributes XmeXpmFreeAttributes
0047 #define XpmFreeExtensions XmeXpmFreeExtensions
0048 #define XpmFreeXpmImage XmeXpmFreeXpmImage
0049 #define XpmFreeXpmInfo XmeXpmFreeXpmInfo
0050 #define XpmGetErrorString XmeXpmGetErrorString
0051 #define XpmLibraryVersion XmeXpmLibraryVersion
0052 #define XpmReadFileToXpmImage XmeXpmReadFileToXpmImage
0053 #define XpmWriteFileFromXpmImage XmeXpmWriteFileFromXpmImage
0054 #define XpmCreatePixmapFromXpmImage XmeXpmCreatePixmapFromXpmImage
0055 #define XpmCreateImageFromXpmImage XmeXpmCreateImageFromXpmImage
0056 #define XpmCreateXpmImageFromImage XmeXpmCreateXpmImageFromImage
0057 #define XpmCreateXpmImageFromPixmap XmeXpmCreateXpmImageFromPixmap
0058 #define XpmCreateDataFromXpmImage XmeXpmCreateDataFromXpmImage
0059 #define XpmCreateXpmImageFromData XmeXpmCreateXpmImageFromData
0060 #define XpmCreateXpmImageFromBuffer XmeXpmCreateXpmImageFromBuffer
0061 #define XpmCreateBufferFromXpmImage XmeXpmCreateBufferFromXpmImage
0062 #define XpmFree XmeXpmFree
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105 #ifndef XPM_h
0106 #define XPM_h
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120 #define XpmFormat 3
0121 #define XpmVersion 4
0122 #define XpmRevision 9
0123 #define XpmIncludeVersion ((XpmFormat * 100 + XpmVersion) * 100 + XpmRevision)
0124
0125 #ifndef XPM_NUMBERS
0126
0127 #ifdef FOR_MSW
0128 # define SYSV
0129 # include <malloc.h>
0130 # include "simx.h" /* defines some X stuff using MSW types */
0131 #define NEED_STRCASECMP
0132 #else
0133 # include <X11/Xlib.h>
0134 # include <X11/Xutil.h>
0135 #endif
0136
0137
0138 #if ! defined(_XtIntrinsic_h) && ! defined(PIXEL_ALREADY_TYPEDEFED)
0139 typedef unsigned long Pixel;
0140 # define PIXEL_ALREADY_TYPEDEFED
0141 #endif
0142
0143
0144 #ifndef NeedFunctionPrototypes
0145 # if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
0146 # define NeedFunctionPrototypes 1
0147 # else
0148 # define NeedFunctionPrototypes 0
0149 # endif
0150 #endif
0151
0152
0153
0154
0155
0156
0157
0158
0159 #define XpmColorError 1
0160 #define XpmSuccess 0
0161 #define XpmOpenFailed -1
0162 #define XpmFileInvalid -2
0163 #define XpmNoMemory -3
0164 #define XpmColorFailed -4
0165
0166 typedef struct {
0167 char *name;
0168 char *value;
0169 Pixel pixel;
0170 } XpmColorSymbol;
0171
0172 typedef struct {
0173 char *name;
0174 unsigned int nlines;
0175 char **lines;
0176 } XpmExtension;
0177
0178 typedef struct {
0179 char *string;
0180 char *symbolic;
0181 char *m_color;
0182 char *g4_color;
0183 char *g_color;
0184 char *c_color;
0185 } XpmColor;
0186
0187 typedef struct {
0188 unsigned int width;
0189 unsigned int height;
0190 unsigned int cpp;
0191 unsigned int ncolors;
0192 XpmColor *colorTable;
0193 unsigned int *data;
0194 } XpmImage;
0195
0196 typedef struct {
0197 unsigned long valuemask;
0198 char *hints_cmt;
0199 char *colors_cmt;
0200 char *pixels_cmt;
0201 unsigned int x_hotspot;
0202 unsigned int y_hotspot;
0203 unsigned int nextensions;
0204 XpmExtension *extensions;
0205 } XpmInfo;
0206
0207 typedef int (*XpmAllocColorFunc)(
0208 #if NeedFunctionPrototypes
0209 Display* ,
0210 Colormap ,
0211 char* ,
0212 XColor* ,
0213 void*
0214 #endif
0215 );
0216
0217 typedef int (*XpmFreeColorsFunc)(
0218 #if NeedFunctionPrototypes
0219 Display* ,
0220 Colormap ,
0221 Pixel* ,
0222 int ,
0223 void*
0224 #endif
0225 );
0226
0227 typedef struct {
0228 unsigned long valuemask;
0229
0230
0231 Visual *visual;
0232 Colormap colormap;
0233 unsigned int depth;
0234 unsigned int width;
0235
0236 unsigned int height;
0237
0238 unsigned int x_hotspot;
0239
0240 unsigned int y_hotspot;
0241
0242 unsigned int cpp;
0243
0244 Pixel *pixels;
0245 unsigned int npixels;
0246 XpmColorSymbol *colorsymbols;
0247 unsigned int numsymbols;
0248 char *rgb_fname;
0249 unsigned int nextensions;
0250 XpmExtension *extensions;
0251
0252 unsigned int ncolors;
0253 XpmColor *colorTable;
0254
0255 char *hints_cmt;
0256 char *colors_cmt;
0257 char *pixels_cmt;
0258
0259 unsigned int mask_pixel;
0260
0261
0262
0263 Bool exactColors;
0264 unsigned int closeness;
0265 unsigned int red_closeness;
0266 unsigned int green_closeness;
0267 unsigned int blue_closeness;
0268 int color_key;
0269
0270 Pixel *alloc_pixels;
0271
0272 Bool nalloc_pixels;
0273
0274
0275 Bool alloc_close_colors;
0276
0277
0278 int bitmap_format;
0279
0280
0281
0282 XpmAllocColorFunc alloc_color;
0283 XpmFreeColorsFunc free_colors;
0284 void *color_closure;
0285
0286
0287 } XpmAttributes;
0288
0289
0290 #define XpmVisual (1L<<0)
0291 #define XpmColormap (1L<<1)
0292 #define XpmDepth (1L<<2)
0293 #define XpmSize (1L<<3)
0294 #define XpmHotspot (1L<<4)
0295 #define XpmCharsPerPixel (1L<<5)
0296 #define XpmColorSymbols (1L<<6)
0297 #define XpmRgbFilename (1L<<7)
0298
0299 #define XpmInfos (1L<<8)
0300 #define XpmReturnInfos XpmInfos
0301
0302 #define XpmReturnPixels (1L<<9)
0303 #define XpmExtensions (1L<<10)
0304 #define XpmReturnExtensions XpmExtensions
0305
0306 #define XpmExactColors (1L<<11)
0307 #define XpmCloseness (1L<<12)
0308 #define XpmRGBCloseness (1L<<13)
0309 #define XpmColorKey (1L<<14)
0310
0311 #define XpmColorTable (1L<<15)
0312 #define XpmReturnColorTable XpmColorTable
0313
0314 #define XpmReturnAllocPixels (1L<<16)
0315 #define XpmAllocCloseColors (1L<<17)
0316 #define XpmBitmapFormat (1L<<18)
0317
0318 #define XpmAllocColor (1L<<19)
0319 #define XpmFreeColors (1L<<20)
0320 #define XpmColorClosure (1L<<21)
0321
0322
0323
0324 #define XpmComments XpmInfos
0325 #define XpmReturnComments XpmComments
0326
0327
0328 #ifndef FOR_MSW
0329 #define XpmUndefPixel 0x80000000
0330 #else
0331
0332 #define XpmUndefPixel 0x8000
0333 #endif
0334
0335
0336
0337
0338
0339 #define XPM_MONO 2
0340 #define XPM_GREY4 3
0341 #define XPM_GRAY4 3
0342 #define XPM_GREY 4
0343 #define XPM_GRAY 4
0344 #define XPM_COLOR 5
0345
0346
0347
0348 #if NeedFunctionPrototypes
0349 #define FUNC(f, t, p) extern t f p
0350 #define LFUNC(f, t, p) static t f p
0351 #else
0352 #define FUNC(f, t, p) extern t f()
0353 #define LFUNC(f, t, p) static t f()
0354 #endif
0355
0356
0357
0358
0359
0360
0361 #ifdef __cplusplus
0362 extern "C" {
0363 #endif
0364
0365
0366
0367 #ifndef FOR_MSW
0368 FUNC(XpmCreatePixmapFromData, int, (Display *display,
0369 Drawable d,
0370 char **data,
0371 Pixmap *pixmap_return,
0372 Pixmap *shapemask_return,
0373 XpmAttributes *attributes));
0374
0375 FUNC(XpmCreateDataFromPixmap, int, (Display *display,
0376 char ***data_return,
0377 Pixmap pixmap,
0378 Pixmap shapemask,
0379 XpmAttributes *attributes));
0380
0381 FUNC(XpmReadFileToPixmap, int, (Display *display,
0382 Drawable d,
0383 char *filename,
0384 Pixmap *pixmap_return,
0385 Pixmap *shapemask_return,
0386 XpmAttributes *attributes));
0387
0388 FUNC(XpmWriteFileFromPixmap, int, (Display *display,
0389 char *filename,
0390 Pixmap pixmap,
0391 Pixmap shapemask,
0392 XpmAttributes *attributes));
0393 #endif
0394
0395 FUNC(XpmCreateImageFromData, int, (Display *display,
0396 char **data,
0397 XImage **image_return,
0398 XImage **shapemask_return,
0399 XpmAttributes *attributes));
0400
0401 FUNC(XpmCreateDataFromImage, int, (Display *display,
0402 char ***data_return,
0403 XImage *image,
0404 XImage *shapeimage,
0405 XpmAttributes *attributes));
0406
0407 FUNC(XpmReadFileToImage, int, (Display *display,
0408 char *filename,
0409 XImage **image_return,
0410 XImage **shapeimage_return,
0411 XpmAttributes *attributes));
0412
0413 FUNC(XpmWriteFileFromImage, int, (Display *display,
0414 char *filename,
0415 XImage *image,
0416 XImage *shapeimage,
0417 XpmAttributes *attributes));
0418
0419 FUNC(XpmCreateImageFromBuffer, int, (Display *display,
0420 char *buffer,
0421 XImage **image_return,
0422 XImage **shapemask_return,
0423 XpmAttributes *attributes));
0424 #ifndef FOR_MSW
0425 FUNC(XpmCreatePixmapFromBuffer, int, (Display *display,
0426 Drawable d,
0427 char *buffer,
0428 Pixmap *pixmap_return,
0429 Pixmap *shapemask_return,
0430 XpmAttributes *attributes));
0431
0432 FUNC(XpmCreateBufferFromImage, int, (Display *display,
0433 char **buffer_return,
0434 XImage *image,
0435 XImage *shapeimage,
0436 XpmAttributes *attributes));
0437
0438 FUNC(XpmCreateBufferFromPixmap, int, (Display *display,
0439 char **buffer_return,
0440 Pixmap pixmap,
0441 Pixmap shapemask,
0442 XpmAttributes *attributes));
0443 #endif
0444 FUNC(XpmReadFileToBuffer, int, (char *filename, char **buffer_return));
0445 FUNC(XpmWriteFileFromBuffer, int, (char *filename, char *buffer));
0446
0447 FUNC(XpmReadFileToData, int, (char *filename, char ***data_return));
0448 FUNC(XpmWriteFileFromData, int, (char *filename, char **data));
0449
0450 FUNC(XpmAttributesSize, int, ());
0451 FUNC(XpmFreeAttributes, void, (XpmAttributes *attributes));
0452 FUNC(XpmFreeExtensions, void, (XpmExtension *extensions,
0453 int nextensions));
0454
0455 FUNC(XpmFreeXpmImage, void, (XpmImage *image));
0456 FUNC(XpmFreeXpmInfo, void, (XpmInfo *info));
0457 FUNC(XpmGetErrorString, char *, (int errcode));
0458 FUNC(XpmLibraryVersion, int, ());
0459
0460
0461 FUNC(XpmReadFileToXpmImage, int, (char *filename,
0462 XpmImage *image,
0463 XpmInfo *info));
0464
0465 FUNC(XpmWriteFileFromXpmImage, int, (char *filename,
0466 XpmImage *image,
0467 XpmInfo *info));
0468 #ifndef FOR_MSW
0469 FUNC(XpmCreatePixmapFromXpmImage, int, (Display *display,
0470 Drawable d,
0471 XpmImage *image,
0472 Pixmap *pixmap_return,
0473 Pixmap *shapemask_return,
0474 XpmAttributes *attributes));
0475 #endif
0476 FUNC(XpmCreateImageFromXpmImage, int, (Display *display,
0477 XpmImage *image,
0478 XImage **image_return,
0479 XImage **shapeimage_return,
0480 XpmAttributes *attributes));
0481
0482 FUNC(XpmCreateXpmImageFromImage, int, (Display *display,
0483 XImage *image,
0484 XImage *shapeimage,
0485 XpmImage *xpmimage,
0486 XpmAttributes *attributes));
0487 #ifndef FOR_MSW
0488 FUNC(XpmCreateXpmImageFromPixmap, int, (Display *display,
0489 Pixmap pixmap,
0490 Pixmap shapemask,
0491 XpmImage *xpmimage,
0492 XpmAttributes *attributes));
0493 #endif
0494 FUNC(XpmCreateDataFromXpmImage, int, (char ***data_return,
0495 XpmImage *image,
0496 XpmInfo *info));
0497
0498 FUNC(XpmCreateXpmImageFromData, int, (char **data,
0499 XpmImage *image,
0500 XpmInfo *info));
0501
0502 FUNC(XpmCreateXpmImageFromBuffer, int, (char *buffer,
0503 XpmImage *image,
0504 XpmInfo *info));
0505
0506 FUNC(XpmCreateBufferFromXpmImage, int, (char **buffer_return,
0507 XpmImage *image,
0508 XpmInfo *info));
0509
0510 FUNC(XpmFree, void, (void *ptr));
0511
0512 #ifdef __cplusplus
0513 }
0514 #endif
0515
0516
0517
0518
0519
0520 #define XpmPixmapColorError XpmColorError
0521 #define XpmPixmapSuccess XpmSuccess
0522 #define XpmPixmapOpenFailed XpmOpenFailed
0523 #define XpmPixmapFileInvalid XpmFileInvalid
0524 #define XpmPixmapNoMemory XpmNoMemory
0525 #define XpmPixmapColorFailed XpmColorFailed
0526
0527 #define XpmReadPixmapFile(dpy, d, file, pix, mask, att) \
0528 XpmReadFileToPixmap(dpy, d, file, pix, mask, att)
0529 #define XpmWritePixmapFile(dpy, file, pix, mask, att) \
0530 XpmWriteFileFromPixmap(dpy, file, pix, mask, att)
0531
0532
0533 #define PixmapColorError XpmColorError
0534 #define PixmapSuccess XpmSuccess
0535 #define PixmapOpenFailed XpmOpenFailed
0536 #define PixmapFileInvalid XpmFileInvalid
0537 #define PixmapNoMemory XpmNoMemory
0538 #define PixmapColorFailed XpmColorFailed
0539
0540 #define ColorSymbol XpmColorSymbol
0541
0542 #define XReadPixmapFile(dpy, d, file, pix, mask, att) \
0543 XpmReadFileToPixmap(dpy, d, file, pix, mask, att)
0544 #define XWritePixmapFile(dpy, file, pix, mask, att) \
0545 XpmWriteFileFromPixmap(dpy, file, pix, mask, att)
0546 #define XCreatePixmapFromData(dpy, d, data, pix, mask, att) \
0547 XpmCreatePixmapFromData(dpy, d, data, pix, mask, att)
0548 #define XCreateDataFromPixmap(dpy, data, pix, mask, att) \
0549 XpmCreateDataFromPixmap(dpy, data, pix, mask, att)
0550
0551 #endif
0552 #endif
0553
0554 #endif