Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
410b0f4d
Commit
410b0f4d
authored
May 17, 2023
by
Piotr Caban
Committed by
Alexandre Julliard
May 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Don't store ImageableArea in print_ctx.
parent
cdb57c52
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
72 deletions
+47
-72
init.c
dlls/wineps.drv/init.c
+4
-49
ps.c
dlls/wineps.drv/ps.c
+43
-18
psdrv.h
dlls/wineps.drv/psdrv.h
+0
-5
No files found.
dlls/wineps.drv/init.c
View file @
410b0f4d
...
...
@@ -408,50 +408,6 @@ static void dump_devmode(const DEVMODEW *dm)
TRACE
(
"dmPelsHeight %lu
\n
"
,
dm
->
dmPelsHeight
);
}
static
void
PSDRV_UpdateDevCaps
(
print_ctx
*
ctx
)
{
int
log_pixels_x
=
GetDeviceCaps
(
ctx
->
hdc
,
ASPECTX
);
int
log_pixels_y
=
GetDeviceCaps
(
ctx
->
hdc
,
ASPECTY
);
PAGESIZE
*
page
;
dump_devmode
(
&
ctx
->
Devmode
->
dmPublic
);
if
(
ctx
->
Devmode
->
dmPublic
.
dmFields
&
DM_PAPERSIZE
)
{
LIST_FOR_EACH_ENTRY
(
page
,
&
ctx
->
pi
->
ppd
->
PageSizes
,
PAGESIZE
,
entry
)
{
if
(
page
->
WinPage
==
ctx
->
Devmode
->
dmPublic
.
dmPaperSize
)
break
;
}
if
(
&
page
->
entry
==
&
ctx
->
pi
->
ppd
->
PageSizes
)
{
FIXME
(
"Can't find page
\n
"
);
SetRectEmpty
(
&
ctx
->
ImageableArea
);
}
else
if
(
page
->
ImageableArea
)
{
/* ctx sizes in device units; ppd sizes in 1/72" */
SetRect
(
&
ctx
->
ImageableArea
,
page
->
ImageableArea
->
llx
*
log_pixels_x
/
72
,
page
->
ImageableArea
->
ury
*
log_pixels_y
/
72
,
page
->
ImageableArea
->
urx
*
log_pixels_x
/
72
,
page
->
ImageableArea
->
lly
*
log_pixels_y
/
72
);
}
else
{
ctx
->
ImageableArea
.
left
=
ctx
->
ImageableArea
.
bottom
=
0
;
ctx
->
ImageableArea
.
right
=
page
->
PaperDimension
->
x
*
log_pixels_x
/
72
;
ctx
->
ImageableArea
.
top
=
page
->
PaperDimension
->
y
*
log_pixels_y
/
72
;
}
}
else
if
((
ctx
->
Devmode
->
dmPublic
.
dmFields
&
DM_PAPERLENGTH
)
&&
(
ctx
->
Devmode
->
dmPublic
.
dmFields
&
DM_PAPERWIDTH
))
{
/* ctx sizes in device units; Devmode sizes in 1/10 mm */
ctx
->
ImageableArea
.
left
=
ctx
->
ImageableArea
.
bottom
=
0
;
ctx
->
ImageableArea
.
right
=
ctx
->
Devmode
->
dmPublic
.
dmPaperWidth
*
log_pixels_x
/
254
;
ctx
->
ImageableArea
.
top
=
ctx
->
Devmode
->
dmPublic
.
dmPaperLength
*
log_pixels_y
/
254
;
}
else
{
FIXME
(
"Odd dmFields %lx
\n
"
,
ctx
->
Devmode
->
dmPublic
.
dmFields
);
SetRectEmpty
(
&
ctx
->
ImageableArea
);
}
TRACE
(
"ImageableArea = %s
\n
"
,
wine_dbgstr_rect
(
&
ctx
->
ImageableArea
));
}
print_ctx
*
create_print_ctx
(
HDC
hdc
,
const
WCHAR
*
device
,
const
DEVMODEW
*
devmode
)
{
...
...
@@ -494,7 +450,6 @@ print_ctx *create_print_ctx( HDC hdc, const WCHAR *device,
PSDRV_MergeDevmodes
(
ctx
->
Devmode
,
devmode
,
pi
);
}
PSDRV_UpdateDevCaps
(
ctx
);
SelectObject
(
hdc
,
GetStockObject
(
DEVICE_DEFAULT_FONT
));
return
ctx
;
}
...
...
@@ -502,12 +457,12 @@ print_ctx *create_print_ctx( HDC hdc, const WCHAR *device,
/**********************************************************************
* ResetDC (WINEPS.@)
*/
BOOL
CDECL
PSDRV_ResetDC
(
print_ctx
*
ctx
,
const
DEVMODEW
*
lpInitData
)
BOOL
CDECL
PSDRV_ResetDC
(
print_ctx
*
ctx
,
const
DEVMODEW
*
devmode
)
{
if
(
lpInitData
)
if
(
devmode
)
{
PSDRV_MergeDevmodes
(
ctx
->
Devmode
,
lpInitData
,
ctx
->
pi
);
PSDRV_
UpdateDevCaps
(
ctx
);
dump_devmode
(
devmode
);
PSDRV_
MergeDevmodes
(
ctx
->
Devmode
,
devmode
,
ctx
->
pi
);
}
return
TRUE
;
}
...
...
dlls/wineps.drv/ps.c
View file @
410b0f4d
...
...
@@ -400,7 +400,7 @@ INT PSDRV_WriteHeader( print_ctx *ctx, LPCWSTR title )
INPUTSLOT
*
slot
=
find_slot
(
ctx
->
pi
->
ppd
,
&
ctx
->
Devmode
->
dmPublic
);
PAGESIZE
*
page
=
find_pagesize
(
ctx
->
pi
->
ppd
,
&
ctx
->
Devmode
->
dmPublic
);
DUPLEX
*
duplex
=
find_duplex
(
ctx
->
pi
->
ppd
,
&
ctx
->
Devmode
->
dmPublic
);
int
llx
,
lly
,
urx
,
ury
,
log_pixels_x
,
log_pixels_y
;
int
llx
,
lly
,
urx
,
ury
;
int
ret
,
len
;
const
char
*
dmOrientation
;
...
...
@@ -429,12 +429,34 @@ INT PSDRV_WriteHeader( print_ctx *ctx, LPCWSTR title )
/* BBox co-ords are in default user co-ord system so urx < ury even in
landscape mode */
log_pixels_x
=
GetDeviceCaps
(
ctx
->
hdc
,
ASPECTX
);
log_pixels_y
=
GetDeviceCaps
(
ctx
->
hdc
,
ASPECTY
);
llx
=
ctx
->
ImageableArea
.
left
*
72
.
0
/
log_pixels_x
;
lly
=
ctx
->
ImageableArea
.
bottom
*
72
.
0
/
log_pixels_y
;
urx
=
ctx
->
ImageableArea
.
right
*
72
.
0
/
log_pixels_x
;
ury
=
ctx
->
ImageableArea
.
top
*
72
.
0
/
log_pixels_y
;
if
((
ctx
->
Devmode
->
dmPublic
.
dmFields
&
DM_PAPERSIZE
)
&&
page
)
{
if
(
page
->
ImageableArea
)
{
llx
=
page
->
ImageableArea
->
llx
;
lly
=
page
->
ImageableArea
->
lly
;
urx
=
page
->
ImageableArea
->
urx
;
ury
=
page
->
ImageableArea
->
ury
;
}
else
{
llx
=
lly
=
0
;
urx
=
page
->
PaperDimension
->
x
;
ury
=
page
->
PaperDimension
->
y
;
}
}
else
if
((
ctx
->
Devmode
->
dmPublic
.
dmFields
&
DM_PAPERLENGTH
)
&&
(
ctx
->
Devmode
->
dmPublic
.
dmFields
&
DM_PAPERWIDTH
))
{
/* Devmode sizes in 1/10 mm */
llx
=
lly
=
0
;
urx
=
ctx
->
Devmode
->
dmPublic
.
dmPaperWidth
*
72
.
0
/
254
.
0
;
ury
=
ctx
->
Devmode
->
dmPublic
.
dmPaperLength
*
72
.
0
/
254
.
0
;
}
else
{
llx
=
lly
=
urx
=
ury
=
0
;
}
/* FIXME should do something better with BBox */
dmOrientation
=
(
ctx
->
Devmode
->
dmPublic
.
dmOrientation
==
DMORIENT_LANDSCAPE
?
"Landscape"
:
"Portrait"
);
...
...
@@ -519,18 +541,21 @@ INT PSDRV_WriteNewPage( print_ctx *ctx )
if
(
ctx
->
Devmode
->
dmPublic
.
dmOrientation
==
DMORIENT_LANDSCAPE
)
{
if
(
ctx
->
pi
->
ppd
->
LandscapeOrientation
==
-
90
)
{
xtrans
=
ctx
->
ImageableArea
.
right
;
ytrans
=
ctx
->
ImageableArea
.
top
;
rotation
=
90
;
}
else
{
xtrans
=
ctx
->
ImageableArea
.
left
;
ytrans
=
ctx
->
ImageableArea
.
bottom
;
rotation
=
-
90
;
}
xtrans
=
GetDeviceCaps
(
ctx
->
hdc
,
PHYSICALHEIGHT
)
-
GetDeviceCaps
(
ctx
->
hdc
,
PHYSICALOFFSETY
);
ytrans
=
GetDeviceCaps
(
ctx
->
hdc
,
PHYSICALWIDTH
)
-
GetDeviceCaps
(
ctx
->
hdc
,
PHYSICALOFFSETX
);
rotation
=
90
;
}
else
{
xtrans
=
GetDeviceCaps
(
ctx
->
hdc
,
PHYSICALOFFSETY
);
ytrans
=
GetDeviceCaps
(
ctx
->
hdc
,
PHYSICALOFFSETX
);
rotation
=
-
90
;
}
}
else
{
xtrans
=
ctx
->
ImageableArea
.
left
;
ytrans
=
ctx
->
ImageableArea
.
top
;
rotation
=
0
;
xtrans
=
GetDeviceCaps
(
ctx
->
hdc
,
PHYSICALOFFSETX
);
ytrans
=
GetDeviceCaps
(
ctx
->
hdc
,
PHYSICALHEIGHT
)
-
GetDeviceCaps
(
ctx
->
hdc
,
PHYSICALOFFSETY
);
rotation
=
0
;
}
sprintf
(
buf
,
psnewpage
,
name
,
ctx
->
job
.
PageNo
,
...
...
dlls/wineps.drv/psdrv.h
View file @
410b0f4d
...
...
@@ -341,11 +341,6 @@ typedef struct
JOB
job
;
PSDRV_DEVMODE
*
Devmode
;
PRINTERINFO
*
pi
;
RECT
ImageableArea
;
/* Imageable area in device units */
/* NB both PageSize and ImageableArea
are not rotated in landscape mode,
so PageSize.cx is generally
< PageSize.cy */
int
pathdepth
;
}
print_ctx
;
...
...
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