/* Utilities and defines for using XPM without X on Haiku
Copyright (C) 2021 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see . */
/* Parts taken from libXpm simx.h, whose copyright notice is
reproduced below: */
/*
* 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
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of GROUPE BULL shall not be
* used in advertising or otherwise to promote the sale, use or other dealings
* in this Software without prior written authorization from GROUPE BULL.
*/
#ifndef _SIMX_H
#define _SIMX_H
#include
#define _XFUNCPROTOBEGIN
#define _XFUNCPROTOEND
typedef void *Window;
typedef void *Drawable;
typedef void *Pixmap;
typedef int Display;
typedef void *Screen;
typedef void *Visual;
typedef void *Colormap;
typedef uint32_t Pixel;
#define PIXEL_ALREADY_TYPEDEFED
typedef struct
{
Pixel pixel;
uint8_t red, green, blue;
} XColor;
typedef struct
{
void *bitmap;
unsigned int width;
unsigned int height;
unsigned int depth;
} XImage;
extern void *boundCheckingMalloc (long);
extern void *boundCheckingCalloc (long, long);
extern void *boundCheckingRealloc (void *, long);
extern int XAllocColor (Display *, Colormap, XColor *);
extern void XPutPixel (XImage *, int, int, unsigned long);
extern unsigned long XGetPixel (XImage *, int, int);
extern Visual *XDefaultVisual (Display *, Screen *);
extern Screen *XDefaultScreen (Display *);
extern Colormap *XDefaultColormap (Display *, Screen *);
extern int XDefaultDepth (Display *, Screen *);
extern int XParseColor (Display *, Colormap *, char *, XColor *);
extern void XQueryColors (Display *, Colormap *, XColor *, int);
extern int XFreeColors (Display *, Colormap, Pixel *, int, unsigned long);
extern XImage *XCreateImage (Display *, Visual *, int, int,
int, int, int, int, int, int);
extern void XDestroyImage (XImage *);
extern void XImageFree (XImage *);
#define ZPixmap 1 /* not really used */
#define XYBitmap 1 /* not really used */
#define AllPlanes ((unsigned long)~0L)
#define GCForeground 0x01
#define GCBackground 0x02
#ifndef True
#define True 1
#define False 0
#endif
#ifndef Bool
typedef int Bool;
#endif
#endif /* _SIMX_H */