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
cd4f48f2
Commit
cd4f48f2
authored
May 03, 2023
by
Piotr Caban
Committed by
Alexandre Julliard
May 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Store page size full name as unicode string.
parent
bcb5fabc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
17 deletions
+24
-17
driver.c
dlls/wineps.drv/driver.c
+6
-6
ppd.c
dlls/wineps.drv/ppd.c
+17
-10
psdrv.h
dlls/wineps.drv/psdrv.h
+1
-1
No files found.
dlls/wineps.drv/driver.c
View file @
cd4f48f2
...
...
@@ -126,13 +126,13 @@ void PSDRV_MergeDevmodes( PSDRV_DEVMODE *dm1, const PSDRV_DEVMODE *dm2, PRINTERI
dm1
->
dmPublic
.
dmPaperWidth
=
paper_size_from_points
(
page
->
PaperDimension
->
x
);
dm1
->
dmPublic
.
dmPaperLength
=
paper_size_from_points
(
page
->
PaperDimension
->
y
);
dm1
->
dmPublic
.
dmFields
|=
DM_PAPERSIZE
|
DM_PAPERWIDTH
|
DM_PAPERLENGTH
;
TRACE
(
"Changing page to %s %d x %d
\n
"
,
page
->
FullName
,
TRACE
(
"Changing page to %s %d x %d
\n
"
,
debugstr_w
(
page
->
FullName
)
,
dm1
->
dmPublic
.
dmPaperWidth
,
dm1
->
dmPublic
.
dmPaperLength
);
if
(
dm1
->
dmPublic
.
dmSize
>=
FIELD_OFFSET
(
DEVMODEW
,
dmFormName
)
+
CCHFORMNAME
*
sizeof
(
WCHAR
))
{
MultiByteToWideChar
(
CP_ACP
,
0
,
page
->
FullName
,
-
1
,
dm1
->
dmPublic
.
dmForm
Name
,
CCHFORMNAME
);
lstrcpynW
(
dm1
->
dmPublic
.
dmFormName
,
page
->
Full
Name
,
CCHFORMNAME
);
dm1
->
dmPublic
.
dmFields
|=
DM_FORMNAME
;
}
}
...
...
@@ -351,7 +351,7 @@ static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg,
i
++
;
}
TRACE
(
"Setting pagesize to item %d, WinPage %d (%s), PaperSize %.2fx%.2f
\n
"
,
Cursel
,
ps
->
WinPage
,
ps
->
FullName
,
ps
->
PaperDimension
->
x
,
ps
->
PaperDimension
->
y
);
ps
->
WinPage
,
debugstr_w
(
ps
->
FullName
)
,
ps
->
PaperDimension
->
x
,
ps
->
PaperDimension
->
y
);
di
->
dlgdm
->
dmPublic
.
dmPaperSize
=
ps
->
WinPage
;
di
->
dlgdm
->
dmPublic
.
dmFields
|=
DM_PAPERSIZE
;
...
...
@@ -361,7 +361,7 @@ static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg,
if
(
di
->
dlgdm
->
dmPublic
.
dmSize
>=
FIELD_OFFSET
(
DEVMODEW
,
dmFormName
)
+
CCHFORMNAME
*
sizeof
(
WCHAR
))
{
MultiByteToWideChar
(
CP_ACP
,
0
,
ps
->
FullName
,
-
1
,
di
->
dlgdm
->
dmPublic
.
dmForm
Name
,
CCHFORMNAME
);
lstrcpynW
(
di
->
dlgdm
->
dmPublic
.
dmFormName
,
ps
->
Full
Name
,
CCHFORMNAME
);
di
->
dlgdm
->
dmPublic
.
dmFields
|=
DM_FORMNAME
;
}
SendMessageW
(
GetParent
(
hwnd
),
PSM_CHANGED
,
0
,
0
);
...
...
@@ -599,10 +599,10 @@ DWORD WINAPI DrvDeviceCapabilities(HANDLE printer, WCHAR *device_name, WORD capa
LIST_FOR_EACH_ENTRY
(
ps
,
&
pi
->
ppd
->
PageSizes
,
PAGESIZE
,
entry
)
{
TRACE
(
"DC_PAPERNAMES: %s
\n
"
,
debugstr_
a
(
ps
->
FullName
));
TRACE
(
"DC_PAPERNAMES: %s
\n
"
,
debugstr_
w
(
ps
->
FullName
));
i
++
;
if
(
output
!=
NULL
)
{
MultiByteToWideChar
(
CP_ACP
,
0
,
ps
->
FullName
,
-
1
,
cp
,
64
);
lstrcpynW
(
cp
,
ps
->
FullName
,
64
);
cp
+=
64
;
}
}
...
...
dlls/wineps.drv/ppd.c
View file @
cd4f48f2
...
...
@@ -28,6 +28,7 @@
#include "windef.h"
#include "winbase.h"
#include "winternl.h"
#include "winnls.h"
#include "wine/debug.h"
#include "psdrv.h"
...
...
@@ -822,13 +823,17 @@ PPD *PSDRV_ParsePPD( const WCHAR *fname, HANDLE printer )
tuple
.
option
=
NULL
;
}
if
(
!
page
->
FullName
)
{
int
len
;
if
(
tuple
.
opttrans
)
{
page
->
FullName
=
tuple
.
opttrans
;
tuple
.
opttrans
=
NULL
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
tuple
.
opttrans
,
-
1
,
NULL
,
0
);
page
->
FullName
=
HeapAlloc
(
PSDRV_Heap
,
0
,
len
*
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
tuple
.
opttrans
,
-
1
,
page
->
FullName
,
len
);
}
else
{
page
->
FullName
=
HeapAlloc
(
PSDRV_Heap
,
0
,
strlen
(
page
->
Name
)
+
1
);
strcpy
(
page
->
FullName
,
page
->
Name
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
page
->
Name
,
-
1
,
NULL
,
0
);
page
->
FullName
=
HeapAlloc
(
PSDRV_Heap
,
0
,
len
*
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
page
->
Name
,
-
1
,
page
->
FullName
,
len
);
}
}
if
(
!
page
->
InvocationString
)
{
...
...
@@ -871,8 +876,9 @@ PPD *PSDRV_ParsePPD( const WCHAR *fname, HANDLE printer )
tuple
.
option
=
NULL
;
}
if
(
!
page
->
FullName
)
{
page
->
FullName
=
tuple
.
opttrans
;
tuple
.
opttrans
=
NULL
;
int
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
tuple
.
opttrans
,
-
1
,
NULL
,
0
);
page
->
FullName
=
HeapAlloc
(
PSDRV_Heap
,
0
,
len
*
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
tuple
.
opttrans
,
-
1
,
page
->
FullName
,
len
);
}
#define PIA page->ImageableArea
...
...
@@ -894,8 +900,9 @@ PPD *PSDRV_ParsePPD( const WCHAR *fname, HANDLE printer )
tuple
.
option
=
NULL
;
}
if
(
!
page
->
FullName
)
{
page
->
FullName
=
tuple
.
opttrans
;
tuple
.
opttrans
=
NULL
;
int
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
tuple
.
opttrans
,
-
1
,
NULL
,
0
);
page
->
FullName
=
HeapAlloc
(
PSDRV_Heap
,
0
,
len
*
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
tuple
.
opttrans
,
-
1
,
page
->
FullName
,
len
);
}
#define PD page->PaperDimension
...
...
@@ -1026,7 +1033,7 @@ PPD *PSDRV_ParsePPD( const WCHAR *fname, HANDLE printer )
{
if
(
!
page
->
InvocationString
||
!
page
->
PaperDimension
)
{
WARN
(
"Removing page %s since it has a missing %s entry
\n
"
,
debugstr_
a
(
page
->
FullName
),
WARN
(
"Removing page %s since it has a missing %s entry
\n
"
,
debugstr_
w
(
page
->
FullName
),
page
->
InvocationString
?
"PaperDimension"
:
"InvocationString"
);
HeapFree
(
PSDRV_Heap
,
0
,
page
->
Name
);
HeapFree
(
PSDRV_Heap
,
0
,
page
->
FullName
);
...
...
@@ -1085,7 +1092,7 @@ PPD *PSDRV_ParsePPD( const WCHAR *fname, HANDLE printer )
LIST_FOR_EACH_ENTRY
(
page
,
&
ppd
->
PageSizes
,
PAGESIZE
,
entry
)
{
TRACE
(
"'%s' aka '%s' (%d) invoked by '%s'
\n
"
,
page
->
Name
,
page
->
FullName
,
page
->
WinPage
,
page
->
InvocationString
);
debugstr_w
(
page
->
FullName
)
,
page
->
WinPage
,
page
->
InvocationString
);
if
(
page
->
ImageableArea
)
TRACE
(
"Area = %.2f,%.2f - %.2f, %.2f
\n
"
,
page
->
ImageableArea
->
llx
,
page
->
ImageableArea
->
lly
,
...
...
dlls/wineps.drv/psdrv.h
View file @
cd4f48f2
...
...
@@ -136,7 +136,7 @@ typedef struct {
typedef
struct
_tagPAGESIZE
{
struct
list
entry
;
char
*
Name
;
char
*
FullName
;
WCHAR
*
FullName
;
char
*
InvocationString
;
IMAGEABLEAREA
*
ImageableArea
;
PAPERDIMENSION
*
PaperDimension
;
...
...
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