VirtualBox

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

最後變更 在這個檔案從93022是 51223,由 vboxsync 提交於 11 年 前

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

  • 屬性 svn:eol-style 設為 native
檔案大小: 14.5 KB
 
1/* $Xorg: Pcl.h,v 1.3 2000/08/17 19:48:07 cpqbld Exp $ */
2/*******************************************************************
3**
4** *********************************************************
5** *
6** * File: Pcl.h
7** *
8** * Contents: defines and includes for the Pcl driver
9** * for a printing X server.
10** *
11** * Created: 1/30/95
12** *
13** *********************************************************
14**
15********************************************************************/
16/*
17(c) Copyright 1996 Hewlett-Packard Company
18(c) Copyright 1996 International Business Machines Corp.
19(c) Copyright 1996 Sun Microsystems, Inc.
20(c) Copyright 1996 Novell, Inc.
21(c) Copyright 1996 Digital Equipment Corp.
22(c) Copyright 1996 Fujitsu Limited
23(c) Copyright 1996 Hitachi, Ltd.
24
25Permission is hereby granted, free of charge, to any person obtaining a copy
26of this software and associated documentation files (the "Software"), to deal
27in the Software without restriction, including without limitation the rights
28to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
29copies of the Software, and to permit persons to whom the Software is
30furnished to do so, subject to the following conditions:
31
32The above copyright notice and this permission notice shall be included in
33all copies or substantial portions of the Software.
34
35THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
38COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
39IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
40CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41
42Except as contained in this notice, the names of the copyright holders shall
43not be used in advertising or otherwise to promote the sale, use or other
44dealings in this Software without prior written authorization from said
45copyright holders.
46*/
47/* $XFree86: xc/programs/Xserver/Xprint/pcl/Pcl.h,v 1.12 2001/12/21 21:02:05 dawes Exp $ */
48
49#ifdef HAVE_DIX_CONFIG_H
50#include <dix-config.h>
51#endif
52
53#ifndef _PCL_H_
54#define _PCL_H_
55
56#include <stdio.h>
57#include "scrnintstr.h"
58
59#include "PclDef.h"
60#include "Pclmap.h"
61#include "PclSFonts.h"
62
63#include <X11/extensions/Print.h>
64#include <X11/extensions/Printstr.h>
65
66#include "regionstr.h"
67#include <X11/fonts/fontstruct.h>
68#include "dixfontstr.h"
69#include "gcstruct.h"
70
71/*
72 * Some sleazes to force the XrmDB stuff into the server
73 */
74#ifndef HAVE_XPointer
75typedef char *XPointer;
76#endif
77#define Status int
78#define True 1
79#define False 0
80#include "misc.h"
81#include <X11/Xfuncproto.h>
82#include <X11/Xresource.h>
83#include "attributes.h"
84
85/******
86 * externally visible variables from PclInit.c
87 ******/
88extern int PclScreenPrivateIndex, PclWindowPrivateIndex;
89extern int PclContextPrivateIndex;
90extern int PclPixmapPrivateIndex;
91extern int PclGCPrivateIndex;
92
93/******
94 * externally visible variables from PclAttVal.c
95 ******/
96extern XpValidatePoolsRec PclValidatePoolsRec;
97
98/*
99 * This structure defines a mapping from an X colormap ID to a list of
100 * print contexts which use the colormap.
101 */
102typedef struct _pclcontextlist {
103 XpContextPtr context;
104 struct _pclcontextlist *next;
105} PclContextList, *PclContextListPtr;
106
107typedef struct _pclcmaptocontexts {
108 long colormapId;
109 PclContextListPtr contexts;
110 struct _pclcmaptocontexts *next;
111} PclCmapToContexts;
112
113typedef struct {
114 PclCmapToContexts *colormaps;
115 CloseScreenProcPtr CloseScreen;
116} PclScreenPrivRec, *PclScreenPrivPtr;
117
118/*
119 * This structure defines a mapping from an X colormap ID to a PCL
120 * palette ID.
121 */
122typedef struct _palettemap {
123 long colormapId;
124 int paletteId;
125 int downloaded;
126 struct _palettemap *next;
127} PclPaletteMap, *PclPaletteMapPtr;
128
129typedef struct {
130 char *jobFileName;
131 FILE *pJobFile;
132 char *pageFileName;
133 FILE *pPageFile;
134 GC lastGC;
135 unsigned char *dash;
136 int validGC;
137 ClientPtr getDocClient;
138 int getDocBufSize;
139 PclSoftFontInfoPtr pSoftFontInfo;
140 PclPaletteMapPtr palettes;
141 int currentPalette;
142 int nextPaletteId;
143 PclPaletteMap staticGrayPalette;
144 PclPaletteMap trueColorPalette;
145 PclPaletteMap specialTrueColorPalette;
146 unsigned char *ctbl;
147 int ctbldim;
148 int isRaw;
149#ifdef XP_PCL_LJ3
150 unsigned int fcount;
151 unsigned int fcount_max;
152 char *figures;
153#endif /* XP_PCL_LJ3 */
154} PclContextPrivRec, *PclContextPrivPtr;
155
156typedef struct {
157 int validContext;
158 XpContextPtr context;
159} PclWindowPrivRec, *PclWindowPrivPtr;
160
161typedef struct {
162 unsigned long stippleFg, stippleBg;
163} PclGCPrivRec, *PclGCPrivPtr;
164
165typedef struct {
166 XpContextPtr context;
167 char *tempFileName;
168 FILE *tempFile;
169 GC lastGC;
170 int validGC;
171} PclPixmapPrivRec, *PclPixmapPrivPtr;
172
173/******
174 * Defined functions
175 ******/
176#define SEND_PCL(f,c) fwrite( c, sizeof( char ), strlen( c ), f )
177#define SEND_PCL_COUNT(f,c,n) fwrite( c, sizeof( char ), n, f )
178
179#ifndef XP_PCL_LJ3
180#define SAVE_PCL(f,p,c) SEND_PCL(f,c)
181#define SAVE_PCL_COUNT(f,p,c,n) SEND_PCL_COUNT(f,c,n)
182#define MACRO_START(f,p) SEND_PCL(f, "\033&f1Y\033&f0X")
183#define MACRO_END(f) SEND_PCL(f, "\033&f1X")
184#else
185#define SAVE_PCL(f,p,c) PclSpoolFigs(p, c, strlen(c))
186#define SAVE_PCL_COUNT(f,p,c,n) PclSpoolFigs(p, c, n)
187#define MACRO_START(f,p) p->fcount = 0
188#define MACRO_END(f) /* do nothing */
189#endif /* XP_PCL_LJ3 */
190
191#define MIN(a,b) (((a)<(b))?(a):(b))
192#ifndef MAX
193#define MAX(a,b) (((a)>(b))?(a):(b))
194#endif
195
196/******
197 * Functions in PclArc.c
198 ******/
199extern void PclPolyArc(
200 DrawablePtr pDrawable,
201 GCPtr pGC,
202 int nArcs,
203 xArc *pArcs);
204extern void PclPolyFillArc(
205 DrawablePtr pDrawable,
206 GCPtr pGC,
207 int nArcs,
208 xArc *pArcs);
209
210/******
211 * Functions in PclArea.c
212 ******/
213extern void PclPutImage(
214 DrawablePtr pDrawable,
215 GCPtr pGC,
216 int depth,
217 int x,
218 int y,
219 int w,
220 int h,
221 int leftPad,
222 int format,
223 char *pImage);
224extern RegionPtr PclCopyArea(
225 DrawablePtr pSrc,
226 DrawablePtr pDst,
227 GCPtr pGC,
228 int srcx,
229 int srcy,
230 int width,
231 int height,
232 int dstx,
233 int dsty);
234RegionPtr PclCopyPlane(
235 DrawablePtr pSrc,
236 DrawablePtr pDst,
237 GCPtr pGC,
238 int srcx,
239 int srcy,
240 int width,
241 int height,
242 int dstx,
243 int dsty,
244 unsigned long plane);
245
246
247/******
248 * Functions in PclAttr.c
249 ******/
250extern char *PclGetAttributes(
251 XpContextPtr pCon,
252 XPAttributes pool );
253extern char *PclGetOneAttribute(
254 XpContextPtr pCon,
255 XPAttributes pool,
256 char *attr );
257extern int PclAugmentAttributes(
258 XpContextPtr pCon,
259 XPAttributes pool,
260 char *attrs );
261extern int PclSetAttributes(
262 XpContextPtr pCon,
263 XPAttributes pool,
264 char *attrs );
265
266/******
267 * Functions in PclColor.c
268 ******/
269extern Bool PclCreateDefColormap(ScreenPtr pScreen);
270extern Bool PclCreateColormap(ColormapPtr pColor);
271extern void PclDestroyColormap(ColormapPtr pColor);
272extern void PclInstallColormap(ColormapPtr pColor);
273extern void PclUninstallColormap(ColormapPtr pColor);
274extern int PclListInstalledColormaps(ScreenPtr pScreen,
275 XID *pCmapList);
276extern void PclStoreColors(ColormapPtr pColor,
277 int ndef,
278 xColorItem *pdefs);
279extern void PclResolveColor(unsigned short *pRed,
280 unsigned short *pGreen,
281 unsigned short *pBlue,
282 VisualPtr pVisual);
283extern int PclUpdateColormap(DrawablePtr pDrawable,
284 XpContextPtr pCon,
285 GCPtr gc,
286 FILE *outFile);
287extern void PclLookUp(ColormapPtr cmap,
288 PclContextPrivPtr cPriv,
289 unsigned short *r,
290 unsigned short *g,
291 unsigned short *b);
292extern PclPaletteMapPtr PclFindPaletteMap(PclContextPrivPtr cPriv,
293 ColormapPtr cmap,
294 GCPtr gc);
295extern unsigned char *PclReadMap(char *, int *);
296
297
298/******
299 * Functions in PclCursor.c
300 ******/
301extern void PclConstrainCursor(
302 ScreenPtr pScreen,
303 BoxPtr pBox);
304extern void PclCursorLimits(
305 ScreenPtr pScreen,
306 CursorPtr pCursor,
307 BoxPtr pHotBox,
308 BoxPtr pTopLeftbox);
309extern Bool PclDisplayCursor(
310 ScreenPtr pScreen,
311 CursorPtr pCursor);
312extern Bool PclRealizeCursor(
313 ScreenPtr pScreen,
314 CursorPtr pCursor);
315extern Bool PclUnrealizeCursor(
316 ScreenPtr pScreen,
317 CursorPtr pCursor);
318extern void PclRecolorCursor(
319 ScreenPtr pScreen,
320 CursorPtr pCursor,
321 Bool displayed);
322extern Bool PclSetCursorPosition(
323 ScreenPtr pScreen,
324 int x,
325 int y,
326 Bool generateEvent);
327
328/******
329 * Functions in PclSFonts.c
330 ******/
331extern void
332PclDownloadSoftFont8(
333 FILE *fp,
334 PclSoftFontInfoPtr pSoftFontInfo,
335 PclFontHead8Ptr pfh,
336 PclCharDataPtr pcd,
337 unsigned char *code);
338extern void PclDownloadSoftFont16(
339 FILE *fp,
340 PclSoftFontInfoPtr pSoftFontInfo,
341 PclFontHead16Ptr pfh,
342 PclCharDataPtr pcd,
343 unsigned char row,
344 unsigned char col);
345extern PclSoftFontInfoPtr PclCreateSoftFontInfo(void);
346extern void PclDestroySoftFontInfo(
347 PclSoftFontInfoPtr pSoftFontInfo );
348
349/******
350 * Functions in PclGC.c
351 ******/
352extern Bool PclCreateGC(GCPtr pGC);
353extern void PclDestroyGC(GCPtr pGC);
354extern int PclUpdateDrawableGC(
355 GCPtr pGC,
356 DrawablePtr pDrawable,
357 FILE **outFile);
358extern void PclValidateGC(
359 GCPtr pGC,
360 unsigned long changes,
361 DrawablePtr pDrawable);
362extern void PclSetDrawablePrivateStuff(
363 DrawablePtr pDrawable,
364 GC gc );
365extern int PclGetDrawablePrivateStuff(
366 DrawablePtr pDrawable,
367 GC *gc,
368 unsigned long *valid,
369 FILE **file );
370extern void PclSetDrawablePrivateGC(
371 DrawablePtr pDrawable,
372 GC gc);
373extern void PclComputeCompositeClip(
374 GCPtr pGC,
375 DrawablePtr pDrawable);
376
377/******
378 * Functions in PclInit.c
379 ******/
380extern Bool PclCloseScreen(
381 int index,
382 ScreenPtr pScreen);
383extern Bool InitializeColorPclDriver(
384 int ndx,
385 ScreenPtr pScreen,
386 int argc,
387 char **argv);
388extern Bool InitializeMonoPclDriver(
389 int ndx,
390 ScreenPtr pScreen,
391 int argc,
392 char **argv);
393extern Bool InitializeLj3PclDriver(
394 int ndx,
395 ScreenPtr pScreen,
396 int argc,
397 char **argv);
398extern XpContextPtr PclGetContextFromWindow( WindowPtr win );
399
400/******
401 * Functions in PclLine.c
402 ******/
403extern void PclPolyLine(
404 DrawablePtr pDrawable,
405 GCPtr pGC,
406 int mode,
407 int nPoints,
408 xPoint *pPoints);
409extern void PclPolySegment(
410 DrawablePtr pDrawable,
411 GCPtr pGC,
412 int nSegments,
413 xSegment *pSegments);
414
415/******
416 * Functions in PclMisc.c
417 ******/
418extern void PclQueryBestSize(
419 int class,
420 short *pwidth,
421 short *pheight,
422 ScreenPtr pScreen);
423extern char *GetPropString(WindowPtr pWin, char *propName);
424extern int SystemCmd(char *cmdStr);
425extern int PclGetMediumDimensions(
426 XpContextPtr pCon,
427 CARD16 *pWidth,
428 CARD16 *pHeight);
429extern int PclGetReproducibleArea(
430 XpContextPtr pCon,
431 xRectangle *pRect);
432extern void PclSendData(
433 FILE *outFile,
434 PclContextPrivPtr pConPriv,
435 BoxPtr pbox,
436 int nbox,
437 double ratio);
438
439/******
440 * Functions in PclPixel.c
441 ******/
442extern void PclPolyPoint(
443 DrawablePtr pDrawable,
444 GCPtr pGC,
445 int mode,
446 int nPoints,
447 xPoint *pPoints);
448extern void PclPushPixels(
449 GCPtr pGC,
450 PixmapPtr pBitmap,
451 DrawablePtr pDrawable,
452 int width,
453 int height,
454 int x,
455 int y);
456
457/******
458 * Functions in PclPixmap.c
459 ******/
460extern PixmapPtr PclCreatePixmap(
461 ScreenPtr pScreen,
462 int width,
463 int height,
464 int depth);
465extern Bool PclDestroyPixmap(PixmapPtr pPixmap);
466
467/******
468 * Functions in PclPolygon.c
469 ******/
470extern void PclPolyRectangle(
471 DrawablePtr pDrawable,
472 GCPtr pGC,
473 int nRects,
474 xRectangle *pRects);
475extern void PclFillPolygon(
476 DrawablePtr pDrawable,
477 GCPtr pGC,
478 int shape,
479 int mode,
480 int nPoints,
481 DDXPointPtr pPoints);
482extern void PclPolyFillRect(
483 DrawablePtr pDrawable,
484 GCPtr pGC,
485 int nRects,
486 xRectangle *pRects);
487
488/******
489 * Functions in PclSpans.c
490 ******/
491extern void PclFillSpans(
492 DrawablePtr pDrawable,
493 GCPtr pGC,
494 int nSpans,
495 DDXPointPtr pPoints,
496 int *pWidths,
497 int fSorted);
498extern void PclSetSpans(
499 DrawablePtr pDrawable,
500 GCPtr pGC,
501 char *pSrc,
502 DDXPointPtr pPoints,
503 int *pWidths,
504 int nSpans,
505 int fSorted);
506
507/******
508 * Functions in PclText.c
509 ******/
510extern int PclPolyText8(
511 DrawablePtr pDrawable,
512 GCPtr pGC,
513 int x,
514 int y,
515 int count,
516 char *string);
517extern int PclPolyText16(
518 DrawablePtr pDrawable,
519 GCPtr pGC,
520 int x,
521 int y,
522 int count,
523 unsigned short *string);
524extern void PclImageText8(
525 DrawablePtr pDrawable,
526 GCPtr pGC,
527 int x,
528 int y,
529 int count,
530 char *string);
531extern void PclImageText16(
532 DrawablePtr pDrawable,
533 GCPtr pGC,
534 int x,
535 int y,
536 int count,
537 unsigned short *string);
538extern void PclImageGlyphBlt(
539 DrawablePtr pDrawable,
540 GCPtr pGC,
541 int x,
542 int y,
543 unsigned int nGlyphs,
544 CharInfoPtr *pCharInfo,
545 pointer pGlyphBase);
546extern void PclPolyGlyphBlt(
547 DrawablePtr pDrawable,
548 GCPtr pGC,
549 int x,
550 int y,
551 unsigned int nGlyphs,
552 CharInfoPtr *pCharInfo,
553 pointer pGlyphBase);
554
555/******
556 * Functions in PclWindow.c
557 ******/
558extern Bool PclCreateWindow(register WindowPtr pWin);
559extern Bool PclDestroyWindow(WindowPtr pWin);
560extern Bool PclMapWindow(WindowPtr pWindow);
561extern Bool PclPositionWindow(
562 register WindowPtr pWin,
563 int x,
564 int y);
565extern Bool PclUnmapWindow(WindowPtr pWindow);
566extern void PclCopyWindow(
567 WindowPtr pWin,
568 DDXPointRec ptOldOrg,
569 RegionPtr prgnSrc);
570extern Bool PclChangeWindowAttributes(
571 register WindowPtr pWin,
572 register unsigned long mask);
573extern void PclPaintWindow(
574 WindowPtr pWin,
575 RegionPtr pRegion,
576 int what);
577
578/******
579 * Functions in PclFonts.c
580 ******/
581extern Bool PclRealizeFont(
582 ScreenPtr pscr,
583 FontPtr pFont);
584extern Bool PclUnrealizeFont(
585 ScreenPtr pscr,
586 FontPtr pFont);
587
588/******
589 * Functions in PclPrint.c
590 ******/
591extern int PclStartJob(
592 XpContextPtr pCon,
593 Bool sendClientData,
594 ClientPtr client);
595extern int PclEndJob(
596 XpContextPtr pCon,
597 Bool cancel);
598extern int PclStartPage(
599 XpContextPtr pCon,
600 WindowPtr pWin);
601extern int PclEndPage(
602 XpContextPtr pCon,
603 WindowPtr pWin);
604extern int PclStartDoc(XpContextPtr pCon,
605 XPDocumentType type);
606extern int PclEndDoc(
607 XpContextPtr pCon,
608 Bool cancel);
609extern int PclDocumentData(
610 XpContextPtr pCon,
611 DrawablePtr pDraw,
612 char *pData,
613 int len_data,
614 char *pFmt,
615 int len_fmt,
616 char *pOpt,
617 int len_opt,
618 ClientPtr client);
619extern int PclGetDocumentData(
620 XpContextPtr pCon,
621 ClientPtr client,
622 int maxBufferSize);
623
624
625#endif /* _PCL_H_ */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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