Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f7c15b9f
Commit
f7c15b9f
authored
Oct 03, 2018
by
Huw Davies
Committed by
Alexandre Julliard
Oct 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Use a tri-state to describe the passthrough state.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0e35782f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
16 deletions
+24
-16
escape.c
dlls/wineps.drv/escape.c
+6
-6
graphics.c
dlls/wineps.drv/graphics.c
+8
-6
ps.c
dlls/wineps.drv/ps.c
+2
-2
psdrv.h
dlls/wineps.drv/psdrv.h
+8
-2
No files found.
dlls/wineps.drv/escape.c
View file @
f7c15b9f
...
...
@@ -269,11 +269,12 @@ INT PSDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID in_data,
* length of the string, rather than 2 more. So we'll use the WORD at
* in_data[0] instead.
*/
if
(
!
physDev
->
job
.
in_passthrough
)
{
write_spool
(
dev
,
psbegindocument
,
sizeof
(
psbegindocument
)
-
1
);
physDev
->
job
.
in_passthrough
=
TRUE
;
if
(
physDev
->
job
.
passthrough_state
==
passthrough_none
)
{
write_spool
(
dev
,
psbegindocument
,
sizeof
(
psbegindocument
)
-
1
);
physDev
->
job
.
passthrough_state
=
passthrough_active
;
}
return
write_spool
(
dev
,
((
char
*
)
in_data
)
+
2
,
*
(
const
WORD
*
)
in_data
);
return
write_spool
(
dev
,
((
char
*
)
in_data
)
+
2
,
*
(
const
WORD
*
)
in_data
);
}
case
POSTSCRIPT_IGNORE
:
...
...
@@ -451,8 +452,7 @@ INT PSDRV_StartDoc( PHYSDEV dev, const DOCINFOW *doc )
physDev
->
job
.
OutOfPage
=
TRUE
;
physDev
->
job
.
PageNo
=
0
;
physDev
->
job
.
quiet
=
FALSE
;
physDev
->
job
.
in_passthrough
=
FALSE
;
physDev
->
job
.
had_passthrough_rect
=
FALSE
;
physDev
->
job
.
passthrough_state
=
passthrough_none
;
physDev
->
job
.
doc_name
=
strdupW
(
doc
->
lpszDocName
);
return
physDev
->
job
.
id
;
...
...
dlls/wineps.drv/graphics.c
View file @
f7c15b9f
...
...
@@ -113,12 +113,14 @@ BOOL PSDRV_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
/* Windows does something truly hacky here. If we're in passthrough mode
and our rop is R2_NOP, then we output the string below. This is used in
Office 2k when inserting eps files */
if
(
physDev
->
job
.
in_passthrough
&&
!
physDev
->
job
.
had_passthrough_rect
&&
GetROP2
(
dev
->
hdc
)
==
R2_NOP
)
{
char
buf
[
256
];
sprintf
(
buf
,
"N %d %d %d %d B
\n
"
,
rect
.
right
-
rect
.
left
,
rect
.
bottom
-
rect
.
top
,
rect
.
left
,
rect
.
top
);
write_spool
(
dev
,
buf
,
strlen
(
buf
));
physDev
->
job
.
had_passthrough_rect
=
TRUE
;
return
TRUE
;
if
(
physDev
->
job
.
passthrough_state
==
passthrough_active
&&
GetROP2
(
dev
->
hdc
)
==
R2_NOP
)
{
char
buf
[
256
];
sprintf
(
buf
,
"N %d %d %d %d B
\n
"
,
rect
.
right
-
rect
.
left
,
rect
.
bottom
-
rect
.
top
,
rect
.
left
,
rect
.
top
);
write_spool
(
dev
,
buf
,
strlen
(
buf
));
physDev
->
job
.
passthrough_state
=
passthrough_had_rect
;
return
TRUE
;
}
PSDRV_SetPen
(
dev
);
...
...
dlls/wineps.drv/ps.c
View file @
f7c15b9f
...
...
@@ -226,9 +226,9 @@ DWORD PSDRV_WriteSpool(PHYSDEV dev, LPCSTR lpData, DWORD cch)
return
0
;
}
if
(
physDev
->
job
.
in_passthrough
)
{
/* Was in PASSTHROUGH mode */
if
(
physDev
->
job
.
passthrough_state
!=
passthrough_none
)
{
/* Was in PASSTHROUGH mode */
write_spool
(
dev
,
psenddocument
,
sizeof
(
psenddocument
)
-
1
);
physDev
->
job
.
in_passthrough
=
physDev
->
job
.
had_passthrough_rect
=
FALSE
;
physDev
->
job
.
passthrough_state
=
passthrough_none
;
}
if
(
physDev
->
job
.
OutOfPage
)
{
/* Will get here after NEWFRAME Escape */
...
...
dlls/wineps.drv/psdrv.h
View file @
f7c15b9f
...
...
@@ -343,6 +343,13 @@ typedef struct {
BOOL
set
;
}
PSPEN
;
enum
passthrough
{
passthrough_none
,
passthrough_active
,
passthrough_had_rect
,
/* See the comment in PSDRV_Rectangle */
};
typedef
struct
{
DWORD
id
;
/* Job id */
HANDLE
hprinter
;
/* Printer handle */
...
...
@@ -352,8 +359,7 @@ typedef struct {
BOOL
OutOfPage
;
/* Page header not sent yet */
INT
PageNo
;
BOOL
quiet
;
/* Don't actually output anything */
BOOL
in_passthrough
;
/* In PASSTHROUGH mode */
BOOL
had_passthrough_rect
;
/* See the comment in PSDRV_Rectangle */
enum
passthrough
passthrough_state
;
}
JOB
;
typedef
struct
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment