2 * Postscript driver Escape function
4 * Copyright 1998 Huw D M Davies
12 INT32
PSDRV_Escape( DC
*dc
, INT32 nEscape
, INT32 cbInput
,
13 SEGPTR lpInData
, SEGPTR lpOutData
)
15 PSDRV_PDEVICE
*physDev
= (PSDRV_PDEVICE
*)dc
->physDev
;
20 RECT16
*r
= (RECT16
*)PTR_SEG_TO_LIN(lpOutData
);
21 if(!physDev
->job
.banding
) {
22 physDev
->job
.banding
= TRUE
;
23 SetRect16( r
, 0, 0, dc
->w
.devCaps
->horzRes
,
24 dc
->w
.devCaps
->vertRes
);
25 TRACE(psdrv
, "NEXTBAND returning %d,%d - %d,%d\n", r
->left
,
26 r
->top
, r
->right
, r
->bottom
);
29 SetRect16( r
, 0, 0, 0, 0 );
30 TRACE(psdrv
, "NEXTBAND rect to 0,0 - 0,0\n" );
31 physDev
->job
.banding
= FALSE
;
34 TRACE(psdrv
, "NEWFRAME\n");
36 if(!physDev
->job
.hJob
) {
37 FIXME(psdrv
, "hJob == 0. Now what?\n");
41 if(!PSDRV_WriteEndPage( dc
))
44 physDev
->job
.NeedPageHeader
= TRUE
;
48 TRACE(psdrv
, "STARTDOC\n");
49 if(physDev
->job
.hJob
) {
50 FIXME(psdrv
, "hJob != 0. Now what?\n");
54 physDev
->job
.hJob
= OpenJob(physDev
->job
.output
,
55 PTR_SEG_TO_LIN(lpInData
), dc
->hSelf
);
56 if(!physDev
->job
.hJob
) {
57 WARN(psdrv
, "OpenJob failed\n");
60 physDev
->job
.banding
= FALSE
;
61 physDev
->job
.NeedPageHeader
= FALSE
;
62 physDev
->job
.PageNo
= 1;
63 if(!PSDRV_WriteHeader( dc
, PTR_SEG_TO_LIN(lpInData
), cbInput
))
66 if(!PSDRV_WriteNewPage( dc
))
72 WARN(psdrv
, "cbInput != 2 (=%d) for QUERYESCSUPPORT\n", cbInput
);
75 UINT16 num
= *(UINT16
*)PTR_SEG_TO_LIN(lpInData
);
76 TRACE(psdrv
, "QUERYESCSUPPORT for %d\n", num
);
81 FIXME(psdrv
, "SETABORTPROC: ignoring\n");
86 POINT16
*p
= (POINT16
*)PTR_SEG_TO_LIN(lpOutData
);
88 p
->x
= dc
->w
.devCaps
->horzRes
;
89 p
->y
= dc
->w
.devCaps
->vertRes
;
90 TRACE(psdrv
, "GETPHYSPAGESIZE: returning %dx%d\n", p
->x
, p
->y
);
94 case GETPRINTINGOFFSET
:
96 POINT16
*p
= (POINT16
*)PTR_SEG_TO_LIN(lpOutData
);
99 TRACE(psdrv
, "GETPRINTINGOFFSET: returning %dx%d\n", p
->x
, p
->y
);
103 case GETSCALINGFACTOR
:
105 POINT16
*p
= (POINT16
*)PTR_SEG_TO_LIN(lpOutData
);
108 TRACE(psdrv
, "GETSCALINGFACTOR: returning %dx%d\n", p
->x
, p
->y
);
113 TRACE(psdrv
, "ENDDOC\n");
114 if(!physDev
->job
.hJob
) {
115 FIXME(psdrv
, "hJob == 0. Now what?\n");
119 physDev
->job
.NeedPageHeader
= FALSE
;
121 if(!PSDRV_WriteFooter( dc
))
124 if( CloseJob( physDev
->job
.hJob
) == SP_ERROR
) {
125 WARN(psdrv
, "CloseJob error\n");
128 physDev
->job
.hJob
= 0;
132 FIXME(psdrv
, "Unimplemented code 0x%x\n", nEscape
);