Commit a4c3ed02 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

Implemented Escapes *_PATH and POSTSCRIPT_IGNORE.

parent 94705862
...@@ -134,6 +134,9 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO) ...@@ -134,6 +134,9 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO)
LOGBRUSH logbrush; LOGBRUSH logbrush;
BOOL ret = TRUE; BOOL ret = TRUE;
if(physDev->pathdepth)
return FALSE;
if (!GetObjectA( GetCurrentObject(physDev->hdc,OBJ_BRUSH), sizeof(logbrush), &logbrush )) if (!GetObjectA( GetCurrentObject(physDev->hdc,OBJ_BRUSH), sizeof(logbrush), &logbrush ))
{ {
ERR("Can't get BRUSHOBJ\n"); ERR("Can't get BRUSHOBJ\n");
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
*/ */
#include "windef.h" #include "windef.h"
#include "wingdi.h" #include "wingdi.h"
#include "wine/wingdi16.h"
#include "wine/winuser16.h" #include "wine/winuser16.h"
#include "wownt32.h" #include "wownt32.h"
#include "psdrv.h" #include "psdrv.h"
...@@ -27,7 +28,6 @@ ...@@ -27,7 +28,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(psdrv); WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
/********************************************************************** /**********************************************************************
* ExtEscape (WINEPS.@) * ExtEscape (WINEPS.@)
*/ */
...@@ -56,8 +56,13 @@ INT PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPCVOID i ...@@ -56,8 +56,13 @@ INT PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPCVOID i
case EXT_DEVICE_CAPS: case EXT_DEVICE_CAPS:
case SET_BOUNDS: case SET_BOUNDS:
case EPSPRINTING: case EPSPRINTING:
case POSTSCRIPT_DATA:
case PASSTHROUGH: case PASSTHROUGH:
case POSTSCRIPT_PASSTHROUGH: case POSTSCRIPT_PASSTHROUGH:
case POSTSCRIPT_IGNORE:
case BEGIN_PATH:
case CLIP_TO_PATH:
case END_PATH:
return TRUE; return TRUE;
default: default:
...@@ -192,6 +197,8 @@ INT PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPCVOID i ...@@ -192,6 +197,8 @@ INT PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPCVOID i
TRACE("EPS Printing support %sable.\n",epsprint?"en":"dis"); TRACE("EPS Printing support %sable.\n",epsprint?"en":"dis");
return 1; return 1;
} }
case POSTSCRIPT_DATA:
case PASSTHROUGH: case PASSTHROUGH:
case POSTSCRIPT_PASSTHROUGH: case POSTSCRIPT_PASSTHROUGH:
{ {
...@@ -204,6 +211,14 @@ INT PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPCVOID i ...@@ -204,6 +211,14 @@ INT PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPCVOID i
return WriteSpool16(physDev->job.hJob,((char*)in_data)+2,cbInput-2); return WriteSpool16(physDev->job.hJob,((char*)in_data)+2,cbInput-2);
} }
case POSTSCRIPT_IGNORE:
{
BOOL ret = physDev->job.quiet;
TRACE("POSTSCRIPT_IGNORE %d\n", *(short*)in_data);
physDev->job.quiet = *(short*)in_data;
return ret;
}
case GETSETPRINTORIENT: case GETSETPRINTORIENT:
{ {
/* If lpInData is present, it is a 20 byte structure, first 32 /* If lpInData is present, it is a 20 byte structure, first 32
...@@ -213,6 +228,63 @@ INT PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPCVOID i ...@@ -213,6 +228,63 @@ INT PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPCVOID i
FIXME("GETSETPRINTORIENT not implemented (data %p)!\n",in_data); FIXME("GETSETPRINTORIENT not implemented (data %p)!\n",in_data);
return 1; return 1;
} }
case BEGIN_PATH:
TRACE("BEGIN_PATH\n");
if(physDev->pathdepth)
FIXME("Nested paths not yet handled\n");
return ++physDev->pathdepth;
case END_PATH:
{
struct PATH_INFO *info = (struct PATH_INFO*)in_data;
TRACE("END_PATH\n");
if(!physDev->pathdepth) {
ERR("END_PATH called without a BEIGN_PATH\n");
return -1;
}
TRACE("RenderMode = %d, FillMode = %d, BkMode = %d\n",
info->RenderMode, info->FillMode, info->BkMode);
switch(info->RenderMode) {
case RENDERMODE_NO_DISPLAY:
PSDRV_WriteClosePath(physDev); /* not sure if this is necessary, but it can't hurt */
break;
case RENDERMODE_OPEN:
case RENDERMODE_CLOSED:
default:
FIXME("END_PATH: RenderMode %d, not yet supported\n", info->RenderMode);
break;
}
return --physDev->pathdepth;
}
case CLIP_TO_PATH:
{
WORD mode = *(WORD*)in_data;
switch(mode) {
case CLIP_SAVE:
TRACE("CLIP_TO_PATH: CLIP_SAVE\n");
PSDRV_WriteGSave(physDev);
return 1;
case CLIP_RESTORE:
TRACE("CLIP_TO_PATH: CLIP_RESTORE\n");
PSDRV_WriteGRestore(physDev);
return 1;
case CLIP_INCLUSIVE:
TRACE("CLIP_TO_PATH: CLIP_INCLUSIVE\n");
/* FIXME to clip or eoclip ? (see PATH_INFO.FillMode) */
PSDRV_WriteClip(physDev);
return 1;
case CLIP_EXCLUSIVE:
FIXME("CLIP_EXCLUSIVE: not implemented\n");
return 0;
default:
FIXME("Unknown CLIP_TO_PATH mode %d\n", mode);
return 0;
}
return 0;
}
default: default:
FIXME("Unimplemented code 0x%x\n", nEscape); FIXME("Unimplemented code 0x%x\n", nEscape);
return 0; return 0;
...@@ -288,6 +360,7 @@ INT PSDRV_StartDoc( PSDRV_PDEVICE *physDev, const DOCINFOA *doc ) ...@@ -288,6 +360,7 @@ INT PSDRV_StartDoc( PSDRV_PDEVICE *physDev, const DOCINFOA *doc )
*/ */
INT PSDRV_EndDoc( PSDRV_PDEVICE *physDev ) INT PSDRV_EndDoc( PSDRV_PDEVICE *physDev )
{ {
INT ret = 1;
if(!physDev->job.hJob) { if(!physDev->job.hJob) {
FIXME("hJob == 0. Now what?\n"); FIXME("hJob == 0. Now what?\n");
return 0; return 0;
...@@ -297,13 +370,12 @@ INT PSDRV_EndDoc( PSDRV_PDEVICE *physDev ) ...@@ -297,13 +370,12 @@ INT PSDRV_EndDoc( PSDRV_PDEVICE *physDev )
WARN("Somebody forgot a EndPage\n"); WARN("Somebody forgot a EndPage\n");
PSDRV_EndPage( physDev ); PSDRV_EndPage( physDev );
} }
if(!PSDRV_WriteFooter( physDev )) PSDRV_WriteFooter( physDev );
return 0;
if( CloseJob16( physDev->job.hJob ) == SP_ERROR ) { if( CloseJob16( physDev->job.hJob ) == SP_ERROR ) {
WARN("CloseJob error\n"); WARN("CloseJob error\n");
return 0; ret = 0;
} }
physDev->job.hJob = 0; physDev->job.hJob = 0;
return 1; return ret;
} }
...@@ -361,6 +361,9 @@ COLORREF PSDRV_SetPixel( PSDRV_PDEVICE *physDev, INT x, INT y, COLORREF color ) ...@@ -361,6 +361,9 @@ COLORREF PSDRV_SetPixel( PSDRV_PDEVICE *physDev, INT x, INT y, COLORREF color )
*/ */
VOID PSDRV_DrawLine( PSDRV_PDEVICE *physDev ) VOID PSDRV_DrawLine( PSDRV_PDEVICE *physDev )
{ {
if(physDev->pathdepth)
return;
if (physDev->pen.style == PS_NULL) if (physDev->pen.style == PS_NULL)
PSDRV_WriteNewPath(physDev); PSDRV_WriteNewPath(physDev);
else else
......
...@@ -53,7 +53,8 @@ static char psprolog[] = ...@@ -53,7 +53,8 @@ static char psprolog[] =
" r cvi gap idiv gap mul\n" " r cvi gap idiv gap mul\n"
" {t moveto 0 b t sub rlineto}\n" " {t moveto 0 b t sub rlineto}\n"
" for\n" " for\n"
"} bind def\n"; "} bind def\n"
"/B {pop pop pop pop} def\n";
static char psbeginsetup[] = static char psbeginsetup[] =
"%%BeginSetup\n"; "%%BeginSetup\n";
...@@ -191,9 +192,14 @@ static char psarraydef[] = ...@@ -191,9 +192,14 @@ static char psarraydef[] =
int PSDRV_WriteSpool(PSDRV_PDEVICE *physDev, LPSTR lpData, WORD cch) int PSDRV_WriteSpool(PSDRV_PDEVICE *physDev, LPSTR lpData, WORD cch)
{ {
if(physDev->job.quiet) {
TRACE("ignoring output\n");
return 0;
}
if(physDev->job.OutOfPage) { /* Will get here after NEWFRAME Escape */ if(physDev->job.OutOfPage) { /* Will get here after NEWFRAME Escape */
if( !PSDRV_StartPage(physDev) ) if( !PSDRV_StartPage(physDev) )
return FALSE; return 0;
} }
return WriteSpool16( physDev->job.hJob, lpData, cch ); return WriteSpool16( physDev->job.hJob, lpData, cch );
} }
......
...@@ -305,6 +305,7 @@ typedef struct { ...@@ -305,6 +305,7 @@ typedef struct {
BOOL banding; /* Have we received a NEXTBAND */ BOOL banding; /* Have we received a NEXTBAND */
BOOL OutOfPage; /* Page header not sent yet */ BOOL OutOfPage; /* Page header not sent yet */
INT PageNo; INT PageNo;
BOOL quiet; /* Don't actually output anything */
} JOB; } JOB;
typedef struct { typedef struct {
...@@ -331,6 +332,8 @@ typedef struct { ...@@ -331,6 +332,8 @@ typedef struct {
int vertSize; int vertSize;
int logPixelsX; int logPixelsX;
int logPixelsY; int logPixelsY;
int pathdepth;
} PSDRV_PDEVICE; } PSDRV_PDEVICE;
typedef struct { typedef struct {
......
...@@ -354,6 +354,27 @@ typedef BOOL16 (CALLBACK *ABORTPROC16)(HDC16, INT16); ...@@ -354,6 +354,27 @@ typedef BOOL16 (CALLBACK *ABORTPROC16)(HDC16, INT16);
#define INT_PD_DEFAULT_DEVMODE 1 #define INT_PD_DEFAULT_DEVMODE 1
#define INT_PD_DEFAULT_MODEL 2 #define INT_PD_DEFAULT_MODEL 2
/* Escape: CLIP_TO_PATH modes */
#define CLIP_SAVE 0
#define CLIP_RESTORE 1
#define CLIP_INCLUSIVE 2
#define CLIP_EXCLUSIVE 3
/* Escape: END_PATH info */
struct PATH_INFO {
short RenderMode;
BYTE FillMode;
BYTE BkMode;
LOGPEN16 Pen;
LOGBRUSH16 Brush;
DWORD BkColor;
};
/* RenderMode */
#define RENDERMODE_NO_DISPLAY 0
#define RENDERMODE_OPEN 1
#define RENDERMODE_CLOSED 2
#include "poppack.h" #include "poppack.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment