annotate src/xpm/include/simx.h @ 17497:28747b2876ee

Added tag v8.1.1746 for changeset c8152af9fa336169e24c5c873a51a48247d9b43f
author Bram Moolenaar <Bram@vim.org>
date Wed, 24 Jul 2019 22:45:06 +0200
parents c2c3577021ed
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3764
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 /*
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2 * Copyright (C) 1989-95 GROUPE BULL
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
3 *
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
5 * of this software and associated documentation files (the "Software"), to
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6 * deal in the Software without restriction, including without limitation the
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 * sell copies of the Software, and to permit persons to whom the Software is
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9 * furnished to do so, subject to the following conditions:
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 *
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 * The above copyright notice and this permission notice shall be included in
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 * all copies or substantial portions of the Software.
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 *
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17 * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20 *
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21 * Except as contained in this notice, the name of GROUPE BULL shall not be
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22 * used in advertising or otherwise to promote the sale, use or other dealings
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23 * in this Software without prior written authorization from GROUPE BULL.
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
26 /*****************************************************************************\
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
27 * simx.h: 0.1a *
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
28 * *
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
29 * This emulates some Xlib functionality for MSW. It's not a general solution, *
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
30 * it is close related to XPM-lib. It is only intended to satisfy what is need *
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31 * there. Thus allowing to read XPM files under MS windows. *
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32 * *
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
33 * Developed by HeDu 3/94 (hedu@cul-ipn.uni-kiel.de) *
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
34 \*****************************************************************************/
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
35
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
36
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
37 #ifndef _SIMX_H
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
38 #define _SIMX_H
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
39
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
40 #ifdef FOR_MSW
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
41
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
42 #include "windows.h" /* MS windows GDI types */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
43
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
44 /*
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
45 * minimal portability layer between ansi and KR C
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
46 */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
47 /* this comes from xpm.h, and is here again, to avoid complicated
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
48 includes, since this is included from xpm.h */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
49 /* these defines get undefed at the end of this file */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
50 #if __STDC__ || defined(__cplusplus) || defined(c_plusplus)
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
51 /* ANSI || C++ */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
52 #define FUNC(f, t, p) extern t f p
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
53 #define LFUNC(f, t, p) static t f p
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
54 #else /* k&R */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
55 #define FUNC(f, t, p) extern t f()
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
56 #define LFUNC(f, t, p) static t f()
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
57 #endif
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
58
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
59
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
60 FUNC(boundCheckingMalloc, void *, (long s));
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
61 FUNC(boundCheckingCalloc, void *, (long num, long s));
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
62 FUNC(boundCheckingRealloc, void *, (void *p, long s));
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
63
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
64 /* define MSW types for X window types,
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
65 I don't know much about MSW, but the following defines do the job */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
66
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
67 typedef HDC Display; /* this should be similar */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
68 typedef void *Screen; /* not used */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
69 typedef void *Visual; /* not used yet, is for GRAY, COLOR,
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
70 * MONO */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
71
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
72 typedef void *Colormap; /* should be COLORPALETTE, not done
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
73 * yet */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
74
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
75 typedef COLORREF Pixel;
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
76
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
77 #define PIXEL_ALREADY_TYPEDEFED /* to let xpm.h know about it */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
78
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
79 typedef struct {
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
80 Pixel pixel;
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
81 BYTE red, green, blue;
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
82 } XColor;
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
83
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
84 typedef struct {
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
85 HBITMAP bitmap;
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
86 unsigned int width;
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
87 unsigned int height;
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
88 unsigned int depth;
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
89 } XImage;
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
90
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
91 #if defined(__cplusplus) || defined(c_plusplus)
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
92 extern "C" {
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
93 #endif
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
94 /* some replacements for X... functions */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
95
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
96 /* XDefaultXXX */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
97 FUNC(XDefaultVisual, Visual *, (Display *display, Screen *screen));
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
98 FUNC(XDefaultScreen, Screen *, (Display *d));
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
99 FUNC(XDefaultColormap, Colormap *, (Display *display, Screen *screen));
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
100 FUNC(XDefaultDepth, int, (Display *d, Screen *s));
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
101
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
102 /* color related */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
103 FUNC(XParseColor, int, (Display *, Colormap *, char *, XColor *));
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
104 FUNC(XAllocColor, int, (Display *, Colormap *, XColor *));
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
105 FUNC(XQueryColors, void, (Display *display, Colormap *colormap,
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
106 XColor *xcolors, int ncolors));
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
107 FUNC(XFreeColors, int, (Display *d, Colormap cmap,
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
108 unsigned long pixels[],
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
109 int npixels, unsigned long planes));
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
110 /* XImage */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
111 FUNC(XCreateImage, XImage *, (Display *, Visual *, int depth, int format,
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
112 int x, int y, int width, int height,
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
113 int pad, int foo));
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
114
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
115 /* free and destroy bitmap */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
116 FUNC(XDestroyImage, void /* ? */ , (XImage *));
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
117 /* free only, bitmap remains */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
118 FUNC(XImageFree, void, (XImage *));
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
119 #if defined(__cplusplus) || defined(c_plusplus)
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
120 } /* end of extern "C" */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
121 #endif /* cplusplus */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
122
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
123 #define ZPixmap 1 /* not really used */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
124 #define XYBitmap 1 /* not really used */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
125
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
126 #ifndef True
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
127 #define True 1
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
128 #define False 0
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
129 #endif
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
130 #ifndef Bool
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
131 typedef BOOL Bool; /* take MSW bool */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
132 #endif
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
133 /* make these local here, simx.c gets the same from xpm.h */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
134 #undef LFUNC
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
135 #undef FUNC
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
136
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
137 #endif /* def FOR_MSW */
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
138
c2c3577021ed updated for version 7.3.640
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
139 #endif /* _SIMX_H */