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
5b166890
Commit
5b166890
authored
May 09, 2023
by
Piotr Caban
Committed by
Alexandre Julliard
May 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Use standard DEVMODEW structure instead of PSDRV_DEVMODE when possible.
parent
91939284
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
92 deletions
+93
-92
driver.c
dlls/wineps.drv/driver.c
+71
-71
init.c
dlls/wineps.drv/init.c
+13
-11
printproc.c
dlls/wineps.drv/printproc.c
+1
-2
ps.c
dlls/wineps.drv/ps.c
+3
-3
psdrv.h
dlls/wineps.drv/psdrv.h
+5
-5
unixlib.c
dlls/wineps.drv/unixlib.c
+0
-0
No files found.
dlls/wineps.drv/driver.c
View file @
5b166890
This diff is collapsed.
Click to expand it.
dlls/wineps.drv/init.c
View file @
5b166890
...
...
@@ -325,7 +325,7 @@ static void PSDRV_UpdateDevCaps( print_ctx *ctx )
}
print_ctx
*
create_print_ctx
(
HDC
hdc
,
const
WCHAR
*
device
,
const
PSDRV_DEVMODE
*
devmode
)
const
DEVMODEW
*
devmode
)
{
PRINTERINFO
*
pi
=
PSDRV_FindPrinterInfo
(
device
);
print_ctx
*
ctx
;
...
...
@@ -347,21 +347,23 @@ print_ctx *create_print_ctx( HDC hdc, const WCHAR *device,
ctx
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
ctx
)
);
if
(
!
ctx
)
return
NULL
;
ctx
->
Devmode
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
PSDRV_DEVMODE
)
);
ctx
->
Devmode
=
HeapAlloc
(
GetProcessHeap
(),
0
,
pi
->
Devmode
->
dmPublic
.
dmSize
+
pi
->
Devmode
->
dmPublic
.
dmDriverExtra
);
if
(
!
ctx
->
Devmode
)
{
HeapFree
(
GetProcessHeap
(),
0
,
ctx
);
return
NULL
;
}
*
ctx
->
Devmode
=
*
pi
->
Devmode
;
memcpy
(
ctx
->
Devmode
,
pi
->
Devmode
,
pi
->
Devmode
->
dmPublic
.
dmSize
+
pi
->
Devmode
->
dmPublic
.
dmDriverExtra
);
ctx
->
pi
=
pi
;
ctx
->
logPixelsX
=
pi
->
ppd
->
DefaultResolution
;
ctx
->
logPixelsY
=
pi
->
ppd
->
DefaultResolution
;
if
(
devmode
)
{
dump_devmode
(
&
devmode
->
dmPublic
);
dump_devmode
(
devmode
);
PSDRV_MergeDevmodes
(
ctx
->
Devmode
,
devmode
,
pi
);
}
...
...
@@ -378,7 +380,7 @@ BOOL CDECL PSDRV_ResetDC( print_ctx *ctx, const DEVMODEW *lpInitData )
{
if
(
lpInitData
)
{
PSDRV_MergeDevmodes
(
ctx
->
Devmode
,
(
const
PSDRV_DEVMODE
*
)
lpInitData
,
ctx
->
pi
);
PSDRV_MergeDevmodes
(
ctx
->
Devmode
,
lpInitData
,
ctx
->
pi
);
PSDRV_UpdateDevCaps
(
ctx
);
}
return
TRUE
;
...
...
@@ -545,19 +547,19 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
if
(
GetLocaleInfoW
(
LOCALE_USER_DEFAULT
,
LOCALE_IPAPERSIZE
|
LOCALE_RETURN_NUMBER
,
(
LPWSTR
)
&
papersize
,
sizeof
(
papersize
)
/
sizeof
(
WCHAR
)))
{
PSDRV_DEVMODE
dm
;
DEVMODEW
dm
;
memset
(
&
dm
,
0
,
sizeof
(
dm
));
dm
.
dm
Public
.
dm
Fields
=
DM_PAPERSIZE
;
dm
.
dmP
ublic
.
dmP
aperSize
=
papersize
;
dm
.
dmFields
=
DM_PAPERSIZE
;
dm
.
dmPaperSize
=
papersize
;
PSDRV_MergeDevmodes
(
pi
->
Devmode
,
&
dm
,
pi
);
}
}
if
(
pi
->
ppd
->
DefaultPageSize
)
{
/* We'll let the ppd override the devmode */
PSDRV_DEVMODE
dm
;
DEVMODEW
dm
;
memset
(
&
dm
,
0
,
sizeof
(
dm
));
dm
.
dm
Public
.
dm
Fields
=
DM_PAPERSIZE
;
dm
.
dmP
ublic
.
dmP
aperSize
=
pi
->
ppd
->
DefaultPageSize
->
WinPage
;
dm
.
dmFields
=
DM_PAPERSIZE
;
dm
.
dmPaperSize
=
pi
->
ppd
->
DefaultPageSize
->
WinPage
;
PSDRV_MergeDevmodes
(
pi
->
Devmode
,
&
dm
,
pi
);
}
...
...
dlls/wineps.drv/printproc.c
View file @
5b166890
...
...
@@ -2980,8 +2980,7 @@ HANDLE WINAPI OpenPrintProcessor(WCHAR *port, PRINTPROCESSOROPENDATA *open_data)
return
NULL
;
}
SetGraphicsMode
(
hdc
,
GM_ADVANCED
);
data
->
ctx
=
create_print_ctx
(
hdc
,
open_data
->
pPrinterName
,
(
const
PSDRV_DEVMODE
*
)
open_data
->
pDevMode
);
data
->
ctx
=
create_print_ctx
(
hdc
,
open_data
->
pPrinterName
,
open_data
->
pDevMode
);
if
(
!
data
->
ctx
)
{
DeleteDC
(
hdc
);
...
...
dlls/wineps.drv/ps.c
View file @
5b166890
...
...
@@ -397,9 +397,9 @@ static void write_cups_job_ticket( print_ctx *ctx, const struct ticket_info *inf
INT
PSDRV_WriteHeader
(
print_ctx
*
ctx
,
LPCWSTR
title
)
{
char
*
buf
,
*
escaped_title
;
INPUTSLOT
*
slot
=
find_slot
(
ctx
->
pi
->
ppd
,
ctx
->
Devmode
);
PAGESIZE
*
page
=
find_pagesize
(
ctx
->
pi
->
ppd
,
ctx
->
Devmode
);
DUPLEX
*
duplex
=
find_duplex
(
ctx
->
pi
->
ppd
,
ctx
->
Devmode
);
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
;
int
ret
,
len
;
const
char
*
dmOrientation
;
...
...
dlls/wineps.drv/psdrv.h
View file @
5b166890
...
...
@@ -370,7 +370,7 @@ typedef struct
}
print_ctx
;
extern
print_ctx
*
create_print_ctx
(
HDC
hdc
,
const
WCHAR
*
device
,
const
PSDRV_DEVMODE
*
devmode
)
DECLSPEC_HIDDEN
;
const
DEVMODEW
*
devmode
)
DECLSPEC_HIDDEN
;
/*
* Every glyph name in the Adobe Glyph List and the 35 core PostScript fonts
...
...
@@ -394,9 +394,9 @@ extern HINSTANCE PSDRV_hInstance DECLSPEC_HIDDEN;
extern
HANDLE
PSDRV_Heap
DECLSPEC_HIDDEN
;
extern
char
*
PSDRV_ANSIVector
[
256
]
DECLSPEC_HIDDEN
;
extern
INPUTSLOT
*
find_slot
(
PPD
*
ppd
,
const
PSDRV_DEVMODE
*
dm
)
DECLSPEC_HIDDEN
;
extern
PAGESIZE
*
find_pagesize
(
PPD
*
ppd
,
const
PSDRV_DEVMODE
*
dm
)
DECLSPEC_HIDDEN
;
extern
DUPLEX
*
find_duplex
(
PPD
*
ppd
,
const
PSDRV_DEVMODE
*
dm
)
DECLSPEC_HIDDEN
;
extern
INPUTSLOT
*
find_slot
(
PPD
*
ppd
,
const
DEVMODEW
*
dm
)
DECLSPEC_HIDDEN
;
extern
PAGESIZE
*
find_pagesize
(
PPD
*
ppd
,
const
DEVMODEW
*
dm
)
DECLSPEC_HIDDEN
;
extern
DUPLEX
*
find_duplex
(
PPD
*
ppd
,
const
DEVMODEW
*
dm
)
DECLSPEC_HIDDEN
;
/* GDI driver functions */
extern
BOOL
CDECL
PSDRV_Arc
(
print_ctx
*
ctx
,
INT
left
,
INT
top
,
INT
right
,
INT
bottom
,
...
...
@@ -437,7 +437,7 @@ extern BOOL CDECL PSDRV_StrokeAndFillPath( print_ctx *ctx ) DECLSPEC_HIDDEN;
extern
BOOL
CDECL
PSDRV_StrokePath
(
print_ctx
*
ctx
)
DECLSPEC_HIDDEN
;
extern
BOOL
CDECL
PSDRV_ResetDC
(
print_ctx
*
ctx
,
const
DEVMODEW
*
lpInitData
)
DECLSPEC_HIDDEN
;
extern
void
PSDRV_MergeDevmodes
(
PSDRV_DEVMODE
*
dm1
,
const
PSDRV_DEVMODE
*
dm2
,
extern
void
PSDRV_MergeDevmodes
(
PSDRV_DEVMODE
*
dm1
,
const
DEVMODEW
*
dm2
,
PRINTERINFO
*
pi
)
DECLSPEC_HIDDEN
;
extern
BOOL
PSDRV_GetFontMetrics
(
void
)
DECLSPEC_HIDDEN
;
extern
PPD
*
PSDRV_ParsePPD
(
const
WCHAR
*
fname
,
HANDLE
printer
)
DECLSPEC_HIDDEN
;
...
...
dlls/wineps.drv/unixlib.c
View file @
5b166890
This diff is collapsed.
Click to expand it.
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