1
/* $Xorg: Pcl.h,v 1.3 2000/08/17 19:48:07 cpqbld Exp $ */
2
/*******************************************************************
4
** *********************************************************
8
** * Contents: defines and includes for the Pcl driver
9
** * for a printing X server.
13
** *********************************************************
15
********************************************************************/
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.
25
Permission is hereby granted, free of charge, to any person obtaining a copy
26
of this software and associated documentation files (the "Software"), to deal
27
in the Software without restriction, including without limitation the rights
28
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
29
copies of the Software, and to permit persons to whom the Software is
30
furnished to do so, subject to the following conditions:
32
The above copyright notice and this permission notice shall be included in
33
all copies or substantial portions of the Software.
35
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
38
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
39
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
40
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
42
Except as contained in this notice, the names of the copyright holders shall
43
not be used in advertising or otherwise to promote the sale, use or other
44
dealings in this Software without prior written authorization from said
47
/* $XFree86: xc/programs/Xserver/Xprint/pcl/Pcl.h,v 1.12 2001/12/21 21:02:05 dawes Exp $ */
49
#ifdef HAVE_DIX_CONFIG_H
50
#include <dix-config.h>
57
#include "scrnintstr.h"
61
#include "PclSFonts.h"
63
#include <X11/extensions/Print.h>
64
#include <X11/extensions/Printstr.h>
66
#include "regionstr.h"
67
#include <X11/fonts/fontstruct.h>
68
#include "dixfontstr.h"
72
* Some sleazes to force the XrmDB stuff into the server
75
typedef char *XPointer;
81
#include <X11/Xfuncproto.h>
82
#include <X11/Xresource.h>
83
#include "attributes.h"
86
* externally visible variables from PclInit.c
88
extern int PclScreenPrivateIndex, PclWindowPrivateIndex;
89
extern int PclContextPrivateIndex;
90
extern int PclPixmapPrivateIndex;
91
extern int PclGCPrivateIndex;
94
* externally visible variables from PclAttVal.c
96
extern XpValidatePoolsRec PclValidatePoolsRec;
99
* This structure defines a mapping from an X colormap ID to a list of
100
* print contexts which use the colormap.
102
typedef struct _pclcontextlist {
103
XpContextPtr context;
104
struct _pclcontextlist *next;
105
} PclContextList, *PclContextListPtr;
107
typedef struct _pclcmaptocontexts {
109
PclContextListPtr contexts;
110
struct _pclcmaptocontexts *next;
114
PclCmapToContexts *colormaps;
115
CloseScreenProcPtr CloseScreen;
116
} PclScreenPrivRec, *PclScreenPrivPtr;
119
* This structure defines a mapping from an X colormap ID to a PCL
122
typedef struct _palettemap {
126
struct _palettemap *next;
127
} PclPaletteMap, *PclPaletteMapPtr;
137
ClientPtr getDocClient;
139
PclSoftFontInfoPtr pSoftFontInfo;
140
PclPaletteMapPtr palettes;
143
PclPaletteMap staticGrayPalette;
144
PclPaletteMap trueColorPalette;
145
PclPaletteMap specialTrueColorPalette;
151
unsigned int fcount_max;
153
#endif /* XP_PCL_LJ3 */
154
} PclContextPrivRec, *PclContextPrivPtr;
158
XpContextPtr context;
159
} PclWindowPrivRec, *PclWindowPrivPtr;
162
unsigned long stippleFg, stippleBg;
163
} PclGCPrivRec, *PclGCPrivPtr;
166
XpContextPtr context;
171
} PclPixmapPrivRec, *PclPixmapPrivPtr;
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 )
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")
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 */
191
#define MIN(a,b) (((a)<(b))?(a):(b))
193
#define MAX(a,b) (((a)>(b))?(a):(b))
197
* Functions in PclArc.c
199
extern void PclPolyArc(
200
DrawablePtr pDrawable,
204
extern void PclPolyFillArc(
205
DrawablePtr pDrawable,
211
* Functions in PclArea.c
213
extern void PclPutImage(
214
DrawablePtr pDrawable,
224
extern RegionPtr PclCopyArea(
234
RegionPtr PclCopyPlane(
244
unsigned long plane);
248
* Functions in PclAttr.c
250
extern char *PclGetAttributes(
253
extern char *PclGetOneAttribute(
257
extern int PclAugmentAttributes(
261
extern int PclSetAttributes(
267
* Functions in PclColor.c
269
extern Bool PclCreateDefColormap(ScreenPtr pScreen);
270
extern Bool PclCreateColormap(ColormapPtr pColor);
271
extern void PclDestroyColormap(ColormapPtr pColor);
272
extern void PclInstallColormap(ColormapPtr pColor);
273
extern void PclUninstallColormap(ColormapPtr pColor);
274
extern int PclListInstalledColormaps(ScreenPtr pScreen,
276
extern void PclStoreColors(ColormapPtr pColor,
279
extern void PclResolveColor(unsigned short *pRed,
280
unsigned short *pGreen,
281
unsigned short *pBlue,
283
extern int PclUpdateColormap(DrawablePtr pDrawable,
287
extern void PclLookUp(ColormapPtr cmap,
288
PclContextPrivPtr cPriv,
292
extern PclPaletteMapPtr PclFindPaletteMap(PclContextPrivPtr cPriv,
295
extern unsigned char *PclReadMap(char *, int *);
299
* Functions in PclCursor.c
301
extern void PclConstrainCursor(
304
extern void PclCursorLimits(
309
extern Bool PclDisplayCursor(
312
extern Bool PclRealizeCursor(
315
extern Bool PclUnrealizeCursor(
318
extern void PclRecolorCursor(
322
extern Bool PclSetCursorPosition(
329
* Functions in PclSFonts.c
332
PclDownloadSoftFont8(
334
PclSoftFontInfoPtr pSoftFontInfo,
337
unsigned char *code);
338
extern void PclDownloadSoftFont16(
340
PclSoftFontInfoPtr pSoftFontInfo,
341
PclFontHead16Ptr pfh,
345
extern PclSoftFontInfoPtr PclCreateSoftFontInfo(void);
346
extern void PclDestroySoftFontInfo(
347
PclSoftFontInfoPtr pSoftFontInfo );
350
* Functions in PclGC.c
352
extern Bool PclCreateGC(GCPtr pGC);
353
extern void PclDestroyGC(GCPtr pGC);
354
extern int PclUpdateDrawableGC(
356
DrawablePtr pDrawable,
358
extern void PclValidateGC(
360
unsigned long changes,
361
DrawablePtr pDrawable);
362
extern void PclSetDrawablePrivateStuff(
363
DrawablePtr pDrawable,
365
extern int PclGetDrawablePrivateStuff(
366
DrawablePtr pDrawable,
368
unsigned long *valid,
370
extern void PclSetDrawablePrivateGC(
371
DrawablePtr pDrawable,
373
extern void PclComputeCompositeClip(
375
DrawablePtr pDrawable);
378
* Functions in PclInit.c
380
extern Bool PclCloseScreen(
383
extern Bool InitializeColorPclDriver(
388
extern Bool InitializeMonoPclDriver(
393
extern Bool InitializeLj3PclDriver(
398
extern XpContextPtr PclGetContextFromWindow( WindowPtr win );
401
* Functions in PclLine.c
403
extern void PclPolyLine(
404
DrawablePtr pDrawable,
409
extern void PclPolySegment(
410
DrawablePtr pDrawable,
413
xSegment *pSegments);
416
* Functions in PclMisc.c
418
extern void PclQueryBestSize(
423
extern char *GetPropString(WindowPtr pWin, char *propName);
424
extern int SystemCmd(char *cmdStr);
425
extern int PclGetMediumDimensions(
429
extern int PclGetReproducibleArea(
432
extern void PclSendData(
434
PclContextPrivPtr pConPriv,
440
* Functions in PclPixel.c
442
extern void PclPolyPoint(
443
DrawablePtr pDrawable,
448
extern void PclPushPixels(
451
DrawablePtr pDrawable,
458
* Functions in PclPixmap.c
460
extern PixmapPtr PclCreatePixmap(
465
extern Bool PclDestroyPixmap(PixmapPtr pPixmap);
468
* Functions in PclPolygon.c
470
extern void PclPolyRectangle(
471
DrawablePtr pDrawable,
475
extern void PclFillPolygon(
476
DrawablePtr pDrawable,
481
DDXPointPtr pPoints);
482
extern void PclPolyFillRect(
483
DrawablePtr pDrawable,
489
* Functions in PclSpans.c
491
extern void PclFillSpans(
492
DrawablePtr pDrawable,
498
extern void PclSetSpans(
499
DrawablePtr pDrawable,
508
* Functions in PclText.c
510
extern int PclPolyText8(
511
DrawablePtr pDrawable,
517
extern int PclPolyText16(
518
DrawablePtr pDrawable,
523
unsigned short *string);
524
extern void PclImageText8(
525
DrawablePtr pDrawable,
531
extern void PclImageText16(
532
DrawablePtr pDrawable,
537
unsigned short *string);
538
extern void PclImageGlyphBlt(
539
DrawablePtr pDrawable,
543
unsigned int nGlyphs,
544
CharInfoPtr *pCharInfo,
546
extern void PclPolyGlyphBlt(
547
DrawablePtr pDrawable,
551
unsigned int nGlyphs,
552
CharInfoPtr *pCharInfo,
556
* Functions in PclWindow.c
558
extern Bool PclCreateWindow(register WindowPtr pWin);
559
extern Bool PclDestroyWindow(WindowPtr pWin);
560
extern Bool PclMapWindow(WindowPtr pWindow);
561
extern Bool PclPositionWindow(
562
register WindowPtr pWin,
565
extern Bool PclUnmapWindow(WindowPtr pWindow);
566
extern void PclCopyWindow(
568
DDXPointRec ptOldOrg,
570
extern Bool PclChangeWindowAttributes(
571
register WindowPtr pWin,
572
register unsigned long mask);
573
extern void PclPaintWindow(
579
* Functions in PclFonts.c
581
extern Bool PclRealizeFont(
584
extern Bool PclUnrealizeFont(
589
* Functions in PclPrint.c
591
extern int PclStartJob(
595
extern int PclEndJob(
598
extern int PclStartPage(
601
extern int PclEndPage(
604
extern int PclStartDoc(XpContextPtr pCon,
605
XPDocumentType type);
606
extern int PclEndDoc(
609
extern int PclDocumentData(
619
extern int PclGetDocumentData(