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
ca3b8202
Commit
ca3b8202
authored
Apr 28, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Add a helper function for paper size conversions.
parent
e5942684
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
20 deletions
+17
-20
driver.c
dlls/wineps.drv/driver.c
+17
-20
No files found.
dlls/wineps.drv/driver.c
View file @
ca3b8202
...
@@ -39,6 +39,11 @@
...
@@ -39,6 +39,11 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
psdrv
);
WINE_DEFAULT_DEBUG_CHANNEL
(
psdrv
);
/* convert points to paper size units (10th of a millimeter) */
static
inline
int
paper_size_from_points
(
float
size
)
{
return
size
*
254
/
72
;
}
/************************************************************************
/************************************************************************
*
*
...
@@ -72,10 +77,8 @@ void PSDRV_MergeDevmodes(PSDRV_DEVMODEA *dm1, PSDRV_DEVMODEA *dm2,
...
@@ -72,10 +77,8 @@ void PSDRV_MergeDevmodes(PSDRV_DEVMODEA *dm1, PSDRV_DEVMODEA *dm2,
}
}
if
(
&
page
->
entry
!=
&
pi
->
ppd
->
PageSizes
)
{
if
(
&
page
->
entry
!=
&
pi
->
ppd
->
PageSizes
)
{
dm1
->
dmPublic
.
u1
.
s1
.
dmPaperSize
=
dm2
->
dmPublic
.
u1
.
s1
.
dmPaperSize
;
dm1
->
dmPublic
.
u1
.
s1
.
dmPaperSize
=
dm2
->
dmPublic
.
u1
.
s1
.
dmPaperSize
;
dm1
->
dmPublic
.
u1
.
s1
.
dmPaperWidth
=
page
->
PaperDimension
->
x
*
dm1
->
dmPublic
.
u1
.
s1
.
dmPaperWidth
=
paper_size_from_points
(
page
->
PaperDimension
->
x
);
254
.
0
/
72
.
0
;
dm1
->
dmPublic
.
u1
.
s1
.
dmPaperLength
=
paper_size_from_points
(
page
->
PaperDimension
->
y
);
dm1
->
dmPublic
.
u1
.
s1
.
dmPaperLength
=
page
->
PaperDimension
->
y
*
254
.
0
/
72
.
0
;
dm1
->
dmPublic
.
dmFields
&=
~
(
DM_PAPERLENGTH
|
DM_PAPERWIDTH
);
dm1
->
dmPublic
.
dmFields
&=
~
(
DM_PAPERLENGTH
|
DM_PAPERWIDTH
);
dm1
->
dmPublic
.
dmFields
|=
DM_PAPERSIZE
;
dm1
->
dmPublic
.
dmFields
|=
DM_PAPERSIZE
;
TRACE
(
"Changing page to %s %d x %d
\n
"
,
page
->
FullName
,
TRACE
(
"Changing page to %s %d x %d
\n
"
,
page
->
FullName
,
...
@@ -458,8 +461,8 @@ DWORD CDECL PSDRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice, LPCSTR
...
@@ -458,8 +461,8 @@ DWORD CDECL PSDRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice, LPCSTR
TRACE
(
"DC_PAPERSIZE: %f x %f
\n
"
,
ps
->
PaperDimension
->
x
,
ps
->
PaperDimension
->
y
);
TRACE
(
"DC_PAPERSIZE: %f x %f
\n
"
,
ps
->
PaperDimension
->
x
,
ps
->
PaperDimension
->
y
);
i
++
;
i
++
;
if
(
lpszOutput
!=
NULL
)
{
if
(
lpszOutput
!=
NULL
)
{
pt
->
x
=
ps
->
PaperDimension
->
x
*
254
.
0
/
72
.
0
;
pt
->
x
=
paper_size_from_points
(
ps
->
PaperDimension
->
x
)
;
pt
->
y
=
ps
->
PaperDimension
->
y
*
254
.
0
/
72
.
0
;
pt
->
y
=
paper_size_from_points
(
ps
->
PaperDimension
->
y
)
;
pt
++
;
pt
++
;
}
}
}
}
...
@@ -564,33 +567,27 @@ DWORD CDECL PSDRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice, LPCSTR
...
@@ -564,33 +567,27 @@ DWORD CDECL PSDRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice, LPCSTR
case
DC_MAXEXTENT
:
case
DC_MAXEXTENT
:
{
{
PAGESIZE
*
ps
;
PAGESIZE
*
ps
;
POINT
ptMax
;
float
x
=
0
,
y
=
0
;
ptMax
.
x
=
ptMax
.
y
=
0
;
LIST_FOR_EACH_ENTRY
(
ps
,
&
pi
->
ppd
->
PageSizes
,
PAGESIZE
,
entry
)
LIST_FOR_EACH_ENTRY
(
ps
,
&
pi
->
ppd
->
PageSizes
,
PAGESIZE
,
entry
)
{
{
if
(
ps
->
PaperDimension
->
x
>
ptMax
.
x
)
if
(
ps
->
PaperDimension
->
x
>
x
)
x
=
ps
->
PaperDimension
->
x
;
ptMax
.
x
=
ps
->
PaperDimension
->
x
;
if
(
ps
->
PaperDimension
->
y
>
y
)
y
=
ps
->
PaperDimension
->
y
;
if
(
ps
->
PaperDimension
->
y
>
ptMax
.
y
)
ptMax
.
y
=
ps
->
PaperDimension
->
y
;
}
}
return
MAKELONG
(
ptMax
.
x
*
254
.
0
/
72
.
0
,
ptMax
.
y
*
254
.
0
/
72
.
0
);
return
MAKELONG
(
paper_size_from_points
(
x
),
paper_size_from_points
(
y
)
);
}
}
case
DC_MINEXTENT
:
case
DC_MINEXTENT
:
{
{
PAGESIZE
*
ps
;
PAGESIZE
*
ps
;
POINT
ptMin
;
float
x
=
1e6
,
y
=
1e6
;
ptMin
.
x
=
ptMin
.
y
=
-
1
;
LIST_FOR_EACH_ENTRY
(
ps
,
&
pi
->
ppd
->
PageSizes
,
PAGESIZE
,
entry
)
LIST_FOR_EACH_ENTRY
(
ps
,
&
pi
->
ppd
->
PageSizes
,
PAGESIZE
,
entry
)
{
{
if
(
ptMin
.
x
==
-
1
||
ps
->
PaperDimension
->
x
<
ptMin
.
x
)
if
(
ps
->
PaperDimension
->
x
<
x
)
x
=
ps
->
PaperDimension
->
x
;
ptMin
.
x
=
ps
->
PaperDimension
->
x
;
if
(
ps
->
PaperDimension
->
y
<
y
)
y
=
ps
->
PaperDimension
->
y
;
if
(
ptMin
.
y
==
-
1
||
ps
->
PaperDimension
->
y
<
ptMin
.
y
)
ptMin
.
y
=
ps
->
PaperDimension
->
y
;
}
}
return
MAKELONG
(
ptMin
.
x
*
254
.
0
/
72
.
0
,
ptMin
.
y
*
254
.
0
/
72
.
0
);
return
MAKELONG
(
paper_size_from_points
(
x
),
paper_size_from_points
(
y
)
);
}
}
case
DC_SIZE
:
case
DC_SIZE
:
...
...
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