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
44d880b4
Commit
44d880b4
authored
Apr 16, 2012
by
Huw Davies
Committed by
Alexandre Julliard
Apr 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Add a helper to find a page size.
parent
61efdbfd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
21 deletions
+25
-21
driver.c
dlls/wineps.drv/driver.c
+21
-11
ps.c
dlls/wineps.drv/ps.c
+3
-10
psdrv.h
dlls/wineps.drv/psdrv.h
+1
-0
No files found.
dlls/wineps.drv/driver.c
View file @
44d880b4
...
...
@@ -56,6 +56,17 @@ INPUTSLOT *find_slot( PPD *ppd, PSDRV_DEVMODE *dm )
return
NULL
;
}
PAGESIZE
*
find_pagesize
(
PPD
*
ppd
,
PSDRV_DEVMODE
*
dm
)
{
PAGESIZE
*
page
;
LIST_FOR_EACH_ENTRY
(
page
,
&
ppd
->
PageSizes
,
PAGESIZE
,
entry
)
if
(
page
->
WinPage
==
dm
->
dmPublic
.
u1
.
s1
.
dmPaperSize
)
return
page
;
return
NULL
;
}
/************************************************************************
*
* PSDRV_MergeDevmodes
...
...
@@ -78,14 +89,12 @@ void PSDRV_MergeDevmodes( PSDRV_DEVMODE *dm1, PSDRV_DEVMODE *dm2, PRINTERINFO *p
}
/* NB PaperWidth is always < PaperLength */
if
(
dm2
->
dmPublic
.
dmFields
&
DM_PAPERSIZE
)
{
PAGESIZE
*
page
;
if
(
dm2
->
dmPublic
.
dmFields
&
DM_PAPERSIZE
)
{
PAGESIZE
*
page
=
find_pagesize
(
pi
->
ppd
,
dm2
);
LIST_FOR_EACH_ENTRY
(
page
,
&
pi
->
ppd
->
PageSizes
,
PAGESIZE
,
entry
)
{
if
(
page
->
WinPage
==
dm2
->
dmPublic
.
u1
.
s1
.
dmPaperSize
)
break
;
}
if
(
&
page
->
entry
!=
&
pi
->
ppd
->
PageSizes
)
{
if
(
page
)
{
dm1
->
dmPublic
.
u1
.
s1
.
dmPaperSize
=
dm2
->
dmPublic
.
u1
.
s1
.
dmPaperSize
;
dm1
->
dmPublic
.
u1
.
s1
.
dmPaperWidth
=
paper_size_from_points
(
page
->
PaperDimension
->
x
);
dm1
->
dmPublic
.
u1
.
s1
.
dmPaperLength
=
paper_size_from_points
(
page
->
PaperDimension
->
y
);
...
...
@@ -94,11 +103,12 @@ void PSDRV_MergeDevmodes( PSDRV_DEVMODE *dm1, PSDRV_DEVMODE *dm2, PRINTERINFO *p
TRACE
(
"Changing page to %s %d x %d
\n
"
,
page
->
FullName
,
dm1
->
dmPublic
.
u1
.
s1
.
dmPaperWidth
,
dm1
->
dmPublic
.
u1
.
s1
.
dmPaperLength
);
}
else
{
TRACE
(
"Trying to change to unsupported pagesize %d
\n
"
,
dm2
->
dmPublic
.
u1
.
s1
.
dmPaperSize
);
}
}
else
if
((
dm2
->
dmPublic
.
dmFields
&
DM_PAPERLENGTH
)
&&
else
TRACE
(
"Trying to change to unsupported pagesize %d
\n
"
,
dm2
->
dmPublic
.
u1
.
s1
.
dmPaperSize
);
}
else
if
((
dm2
->
dmPublic
.
dmFields
&
DM_PAPERLENGTH
)
&&
(
dm2
->
dmPublic
.
dmFields
&
DM_PAPERWIDTH
))
{
dm1
->
dmPublic
.
u1
.
s1
.
dmPaperLength
=
dm2
->
dmPublic
.
u1
.
s1
.
dmPaperLength
;
dm1
->
dmPublic
.
u1
.
s1
.
dmPaperWidth
=
dm2
->
dmPublic
.
u1
.
s1
.
dmPaperWidth
;
...
...
dlls/wineps.drv/ps.c
View file @
44d880b4
...
...
@@ -302,7 +302,7 @@ INT PSDRV_WriteHeader( PHYSDEV dev, LPCWSTR title )
PSDRV_PDEVICE
*
physDev
=
get_psdrv_dev
(
dev
);
char
*
buf
,
*
escaped_title
;
INPUTSLOT
*
slot
=
find_slot
(
physDev
->
pi
->
ppd
,
physDev
->
Devmode
);
PAGESIZE
*
page
;
PAGESIZE
*
page
=
find_pagesize
(
physDev
->
pi
->
ppd
,
physDev
->
Devmode
)
;
DUPLEX
*
duplex
;
int
win_duplex
;
int
llx
,
lly
,
urx
,
ury
;
...
...
@@ -353,15 +353,8 @@ INT PSDRV_WriteHeader( PHYSDEV dev, LPCWSTR title )
if
(
slot
&&
slot
->
InvocationString
)
PSDRV_WriteFeature
(
dev
,
"*InputSlot"
,
slot
->
Name
,
slot
->
InvocationString
);
LIST_FOR_EACH_ENTRY
(
page
,
&
physDev
->
pi
->
ppd
->
PageSizes
,
PAGESIZE
,
entry
)
{
if
(
page
->
WinPage
==
physDev
->
Devmode
->
dmPublic
.
u1
.
s1
.
dmPaperSize
)
{
if
(
page
->
InvocationString
)
{
PSDRV_WriteFeature
(
dev
,
"*PageSize"
,
page
->
Name
,
page
->
InvocationString
);
break
;
}
}
}
if
(
page
&&
page
->
InvocationString
)
PSDRV_WriteFeature
(
dev
,
"*PageSize"
,
page
->
Name
,
page
->
InvocationString
);
win_duplex
=
physDev
->
Devmode
->
dmPublic
.
dmFields
&
DM_DUPLEX
?
physDev
->
Devmode
->
dmPublic
.
dmDuplex
:
0
;
...
...
dlls/wineps.drv/psdrv.h
View file @
44d880b4
...
...
@@ -402,6 +402,7 @@ extern HANDLE PSDRV_Heap DECLSPEC_HIDDEN;
extern
char
*
PSDRV_ANSIVector
[
256
]
DECLSPEC_HIDDEN
;
extern
INPUTSLOT
*
find_slot
(
PPD
*
ppd
,
PSDRV_DEVMODE
*
dm
);
extern
PAGESIZE
*
find_pagesize
(
PPD
*
ppd
,
PSDRV_DEVMODE
*
dm
);
/* GDI driver functions */
extern
BOOL
PSDRV_Arc
(
PHYSDEV
dev
,
INT
left
,
INT
top
,
INT
right
,
INT
bottom
,
...
...
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