VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.1.0/psout.h@ 78293

Last change on this file since 78293 was 51223, checked in by vboxsync, 11 years ago

Additions/x11/x11include: added header files for X.Org Server 1.0 and 1.1.

  • Property svn:eol-style set to native
File size: 11.7 KB
Line 
1/* $Xorg: psout.h,v 1.6 2001/02/09 02:04:37 xorgcvs Exp $ */
2/*
3
4Copyright 1996, 1998 The Open Group
5
6Permission to use, copy, modify, distribute, and sell this software and its
7documentation for any purpose is hereby granted without fee, provided that
8the above copyright notice appear in all copies and that both that
9copyright notice and this permission notice appear in supporting
10documentation.
11
12The above copyright notice and this permission notice shall be included in
13all copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
22Except as contained in this notice, the name of The Open Group shall not be
23used in advertising or otherwise to promote the sale, use or other dealings
24in this Software without prior written authorization from The Open Group.
25
26*/
27/*
28 * (c) Copyright 1996 Hewlett-Packard Company
29 * (c) Copyright 1996 International Business Machines Corp.
30 * (c) Copyright 1996 Sun Microsystems, Inc.
31 * (c) Copyright 1996 Novell, Inc.
32 * (c) Copyright 1996 Digital Equipment Corp.
33 * (c) Copyright 1996 Fujitsu Limited
34 * (c) Copyright 1996 Hitachi, Ltd.
35 *
36 * Permission is hereby granted, free of charge, to any person obtaining
37 * a copy of this software and associated documentation files (the
38 * "Software"), to deal in the Software without restriction, including
39 * without limitation the rights to use, copy, modify, merge, publish,
40 * distribute, sublicense, and/or sell copies of the Software, and to
41 * permit persons to whom the Software is furnished to do so, subject
42 * to the following conditions:
43 *
44 * The above copyright notice and this permission notice shall be included
45 * in all copies or substantial portions of the Software.
46 *
47 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
48 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
49 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
50 * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
51 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
52 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
53 * SOFTWARE.
54 *
55 * Except as contained in this notice, the names of the copyright holders
56 * shall not be used in advertising or otherwise to promote the sale, use
57 * or other dealings in this Software without prior written authorization
58 * from said copyright holders.
59 */
60
61/*******************************************************************
62**
63** *********************************************************
64** *
65** * File: psout.h
66** *
67** * Contents: Include file for psout.c
68** *
69** * Created By: Roger Helmendach (Liberty Systems)
70** *
71** * Copyright: Copyright 1996 The Open Group, Inc.
72** *
73** *********************************************************
74**
75********************************************************************/
76
77#ifdef HAVE_DIX_CONFIG_H
78#include <dix-config.h>
79#endif
80
81#ifndef _psout_
82#define _psout_
83
84#include <stdio.h>
85
86typedef enum PsCapEnum_ { PsCButt=0, PsCRound, PsCSquare } PsCapEnum;
87typedef enum PsJoinEnum_ { PsJMiter=0, PsJRound, PsJBevel } PsJoinEnum;
88typedef enum PsArcEnum_ { PsChord, PsPieSlice } PsArcEnum;
89typedef enum PsRuleEnum_ { PsEvenOdd, PsNZWinding } PsRuleEnum;
90typedef enum PsFillEnum_ { PsSolid=0, PsTile, PsStip, PsOpStip } PsFillEnum;
91
92typedef struct PsPointRec_
93{
94 int x;
95 int y;
96} PsPointRec;
97
98typedef PsPointRec *PsPointPtr;
99
100typedef struct PsRectRec_
101{
102 int x;
103 int y;
104 int w;
105 int h;
106} PsRectRec;
107
108typedef PsRectRec *PsRectPtr;
109
110typedef struct PsArcRec_
111{
112 int x;
113 int y;
114 int w;
115 int h;
116 int a1;
117 int a2;
118 PsArcEnum style;
119} PsArcRec;
120
121typedef PsArcRec *PsArcPtr;
122
123#define PSOUT_RECT 0
124#define PSOUT_ARC 1
125#define PSOUT_POINTS 2
126
127typedef struct PsElmRec_
128{
129 int type;
130 int nPoints;
131 union
132 {
133 PsRectRec rect;
134 PsArcRec arc;
135 PsPointPtr points;
136 } c;
137} PsElmRec;
138
139typedef PsElmRec *PsElmPtr;
140
141typedef struct PsClipRec_
142{
143 int nRects;
144 PsRectPtr rects;
145 int nElms;
146 PsElmPtr elms;
147 int nOutterClips;
148 PsRectPtr outterClips;
149} PsClipRec;
150
151typedef PsClipRec *PsClipPtr;
152
153typedef enum PsFTDownloadFontType_
154{
155 PsFontBitmap=0,
156 PsFontType1,
157 PsFontType3
158} PsFTDownloadFontType;
159
160/* Define |PsOutColor| color type which can hold one RGB value
161 * (note: this needs to be |signed| long/long long to represent
162 * special values such as |PSOUTCOLOR_NOCOLOR|)
163 */
164#ifdef PSOUT_USE_DEEPCOLOR
165/* 64bit |PsOutColor| which can hold 16bit R-,G-,B-values */
166#ifdef WIN32
167typedef signed __int64 PsOutColor;
168#else
169# if defined(__alpha__) || defined(__alpha) || \
170 defined(ia64) || defined(__ia64__) || \
171 defined(__sparc64__) || defined(_LP64) || \
172 defined(__s390x__) || \
173 defined(amd64) || defined (__amd64__) || \
174 defined (__powerpc64__) || \
175 (defined(sgi) && (_MIPS_SZLONG == 64))
176typedef signed long PsOutColor;
177# else
178typedef signed long long PsOutColor;
179# endif /* native 64bit platform */
180#endif /* WIN32 */
181
182#define PSOUTCOLOR_TO_REDBITS(clr) ((clr) >> 32)
183#define PSOUTCOLOR_TO_GREENBITS(clr) (((clr) >> 16) & 0xFFFF)
184#define PSOUTCOLOR_TO_BLUEBITS(clr) ((clr) & 0xFFFF)
185#define PSOUTCOLOR_BITS_TO_PSFLOAT(b) ((float)(b) / 65535.)
186#define PSOUTCOLOR_WHITE (0xFFFFFFFFFFFFLL)
187#define PSOUTCOLOR_NOCOLOR (-1LL)
188#define PSOUTCOLOR_TO_RGB24BIT(clr) (((PSOUTCOLOR_TO_REDBITS(clr) >> 8) << 16) | \
189 ((PSOUTCOLOR_TO_GREENBITS(clr) >> 8) << 8) | \
190 ((PSOUTCOLOR_TO_BLUEBITS(clr) >> 8) << 0))
191#else
192/* 32bit |PsOutColor| which can hold 8bit R-,G-,B-values */
193typedef signed long PsOutColor;
194#define PSOUTCOLOR_TO_REDBITS(clr) ((clr) >> 16)
195#define PSOUTCOLOR_TO_GREENBITS(clr) (((clr) >> 8) & 0xFF)
196#define PSOUTCOLOR_TO_BLUEBITS(clr) ((clr) & 0xFF)
197#define PSOUTCOLOR_BITS_TO_PSFLOAT(b) ((float)(b) / 255.)
198#define PSOUTCOLOR_WHITE (0xFFFFFF)
199#define PSOUTCOLOR_NOCOLOR (-1)
200#define PSOUTCOLOR_TO_RGB24BIT(clr) ((PSOUTCOLOR_TO_REDBITS(clr) << 16) | \
201 (PSOUTCOLOR_TO_GREENBITS(clr) << 8) | \
202 (PSOUTCOLOR_TO_BLUEBITS(clr) << 0))
203#endif /* PSOUT_USE_DEEPCOLOR */
204
205#ifdef USE_PSOUT_PRIVATE
206typedef void *voidPtr;
207
208typedef struct PsPatRec_
209{
210 PsFillEnum type;
211 voidPtr tag;
212} PsPatRec;
213
214typedef PsPatRec *PsPatPtr;
215
216typedef struct PsOutRec_
217{
218 FILE *Fp;
219 char Buf[16384];
220 PsOutColor CurColor;
221 int LineWidth;
222 PsCapEnum LineCap;
223 PsJoinEnum LineJoin;
224 int NDashes;
225 int *Dashes;
226 int DashOffset;
227 PsOutColor LineBClr;
228 PsRuleEnum FillRule;
229 char *FontName;
230 int FontSize;
231 float FontMtx[4];
232 int ImageFormat;
233 int RevImage;
234 int NPatterns;
235 int MxPatterns;
236 PsPatPtr Patterns;
237 int ClipType;
238 PsClipRec Clip;
239 int InFrame;
240 int XOff;
241 int YOff;
242
243 PsFillEnum InTile;
244 int ImgSkip;
245 PsOutColor ImgBClr;
246 PsOutColor ImgFClr;
247 int ImgX;
248 int ImgY;
249 int ImgW;
250 int ImgH;
251 int SclW;
252 int SclH;
253
254 Bool isRaw;
255
256 int pagenum;
257
258 int start_image;
259} PsOutRec;
260
261typedef struct PsOutRec_ *PsOutPtr;
262
263extern void S_Flush(PsOutPtr self);
264extern void S_OutNum(PsOutPtr self, float num);
265extern void S_OutTok(PsOutPtr self, char *tok, int cr);
266#else
267typedef struct PsOutRec_ *PsOutPtr;
268#endif /* USE_PSOUT_PRIVATE */
269
270extern PsOutPtr PsOut_BeginFile(FILE *fp, char *title, int orient, int count, int plex,
271 int res, int wd, int ht, Bool raw);
272extern void PsOut_EndFile(PsOutPtr self, int closeFile);
273extern void PsOut_BeginPage(PsOutPtr self, int orient, int count, int plex,
274 int res, int wd, int ht);
275extern void PsOut_EndPage(PsOutPtr self);
276extern void PsOut_DirtyAttributes(PsOutPtr self);
277extern void PsOut_Comment(PsOutPtr self, char *comment);
278extern void PsOut_Offset(PsOutPtr self, int x, int y);
279
280extern void PsOut_Clip(PsOutPtr self, int clpTyp, PsClipPtr clpinf);
281
282extern void PsOut_Color(PsOutPtr self, PsOutColor clr);
283extern void PsOut_FillRule(PsOutPtr self, PsRuleEnum rule);
284extern void PsOut_LineAttrs(PsOutPtr self, int wd, PsCapEnum cap,
285 PsJoinEnum join, int nDsh, int *dsh, int dshOff,
286 PsOutColor bclr);
287extern void PsOut_TextAttrs(PsOutPtr self, char *fnam, int siz, int iso);
288extern void PsOut_TextAttrsMtx(PsOutPtr self, char *fnam, float *mtx, int iso);
289
290extern void PsOut_Polygon(PsOutPtr self, int nPts, PsPointPtr pts);
291extern void PsOut_FillRect(PsOutPtr self, int x, int y, int w, int h);
292extern void PsOut_FillArc(PsOutPtr self, int x, int y, int w, int h,
293 float ang1, float ang2, PsArcEnum style);
294
295extern void PsOut_Lines(PsOutPtr self, int nPts, PsPointPtr pts);
296extern void PsOut_Points(PsOutPtr self, int nPts, PsPointPtr pts);
297extern void PsOut_DrawRect(PsOutPtr self, int x, int y, int w, int h);
298extern void PsOut_DrawArc(PsOutPtr self, int x, int y, int w, int h,
299 float ang1, float ang2);
300
301extern void PsOut_Text(PsOutPtr self, int x, int y, char *text, int textl,
302 PsOutColor bclr);
303extern void PsOut_Text16(PsOutPtr self, int x, int y, unsigned short *text, int textl, PsOutColor bclr);
304
305extern void PsOut_BeginImage(PsOutPtr self, PsOutColor bclr, PsOutColor fclr, int x, int y,
306 int w, int h, int sw, int sh, int format);
307extern void PsOut_BeginImageIM(PsOutPtr self, PsOutColor bclr, PsOutColor fclr, int x, int y,
308 int w, int h, int sw, int sh, int format);
309extern void PsOut_EndImage(PsOutPtr self);
310extern void PsOut_OutImageBytes(PsOutPtr self, int nBytes, char *bytes);
311
312extern void PsOut_BeginFrame(PsOutPtr self, int xoff, int yoff, int x, int y,
313 int w, int h);
314extern void PsOut_EndFrame(PsOutPtr self);
315
316extern int PsOut_BeginPattern(PsOutPtr self, void *tag, int w, int h,
317 PsFillEnum type, PsOutColor bclr, PsOutColor fclr);
318extern void PsOut_EndPattern(PsOutPtr self);
319extern void PsOut_SetPattern(PsOutPtr self, void *tag, PsFillEnum type);
320
321extern void PsOut_RawData(PsOutPtr self, char *data, int len);
322
323extern int PsOut_DownloadType1(PsOutPtr self, const char *auditmsg, const char *name, const char *fname);
324
325extern int PsOut_DownloadFreeType1(PsOutPtr self, const char *psfontname, FontPtr pFont, long block_offset);
326extern int PsOut_DownloadFreeType3(PsOutPtr self, const char *psfontname, FontPtr pFont, long block_offset);
327
328extern int PsOut_DownloadFreeType(PsOutPtr self, PsFTDownloadFontType downloadfonttype, const char *psfontname, FontPtr pFont, long block_offset);
329extern void PsOut_Get_FreeType_Glyph_Name( char *destbuf, FontPtr pFont, unsigned long x11fontindex);
330extern void PsOut_FreeType_Text(FontPtr pFont, PsOutPtr self, int x, int y, char *text, int textl);
331extern void PsOut_FreeType_Text16(FontPtr pFont, PsOutPtr self, int x, int y, unsigned short *text, int textl);
332
333extern void PsOut_FreeType_TextAttrs16(PsOutPtr self, char *fnam, int siz, int iso);
334extern void PsOut_FreeType_TextAttrsMtx16(PsOutPtr self, char *fnam, float *mtx, int iso);
335#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette