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
1f89a886
Commit
1f89a886
authored
Sep 29, 2022
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps.drv: Add DrvDocumentPropertySheets implementation.
parent
c4f1f5b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
102 additions
and
0 deletions
+102
-0
driver.c
dlls/wineps.drv/driver.c
+101
-0
wineps.drv.spec
dlls/wineps.drv/wineps.drv.spec
+1
-0
No files found.
dlls/wineps.drv/driver.c
View file @
1f89a886
...
...
@@ -23,6 +23,7 @@
*/
#include <stdarg.h>
#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
...
...
@@ -39,6 +40,18 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
psdrv
);
typedef
struct
{
WORD
cbSize
;
WORD
Reserved
;
HANDLE
hPrinter
;
LPCWSTR
pszPrinterName
;
PDEVMODEW
pdmIn
;
PDEVMODEW
pdmOut
;
DWORD
cbOut
;
DWORD
fMode
;
}
DOCUMENTPROPERTYHEADERW
;
/* convert points to paper size units (10th of a millimeter) */
static
inline
int
paper_size_from_points
(
float
size
)
{
...
...
@@ -522,6 +535,94 @@ INT WINAPI DrvDocumentProperties(HWND hwnd, const WCHAR *device, DEVMODEW *outpu
}
/******************************************************************************
* DrvDocumentPropertySheets (wineps.drv.@)
*/
LONG
WINAPI
DrvDocumentPropertySheets
(
PROPSHEETUI_INFO
*
info
,
LPARAM
lparam
)
{
DOCUMENTPROPERTYHEADERW
*
dph
;
PRINTERINFO
*
pi
;
TRACE
(
"(info=%p, lparam=%Id)
\n
"
,
info
,
lparam
);
dph
=
(
DOCUMENTPROPERTYHEADERW
*
)(
info
?
info
->
lParamInit
:
lparam
);
if
(
!
(
pi
=
PSDRV_FindPrinterInfo
(
dph
->
pszPrinterName
)))
return
ERR_CPSUI_GETLASTERROR
;
if
(
!
info
||
info
->
Reason
==
PROPSHEETUI_REASON_INIT
)
{
/* If dph->fMode == 0, return size of DEVMODE structure */
if
(
!
dph
->
fMode
||
!
dph
->
pdmOut
)
{
dph
->
cbOut
=
pi
->
Devmode
->
dmPublic
.
dmSize
+
pi
->
Devmode
->
dmPublic
.
dmDriverExtra
;
return
dph
->
cbOut
;
}
/* If DM_MODIFY is set, change settings in accordance with pdmIn */
if
((
dph
->
fMode
&
DM_MODIFY
)
&&
dph
->
pdmIn
)
{
TRACE
(
"DM_MODIFY set. devIn->dmFields = %08lx
\n
"
,
dph
->
pdmIn
->
dmFields
);
PSDRV_MergeDevmodes
(
pi
->
Devmode
,
(
PSDRV_DEVMODE
*
)
dph
->
pdmIn
,
pi
);
}
/* If DM_PROMPT is set, present modal dialog box */
if
(
dph
->
fMode
&
DM_PROMPT
)
{
PROPSHEETPAGEW
psp
;
PSDRV_DLGINFO
*
di
;
if
(
!
info
)
{
ERR
(
"DM_PROMPT passed with NULL PROPSHEETUI_INFO
\n
"
);
return
ERR_CPSUI_GETLASTERROR
;
}
di
=
malloc
(
sizeof
(
*
di
));
if
(
!
di
)
return
ERR_CPSUI_ALLOCMEM_FAILED
;
info
->
UserData
=
(
ULONG_PTR
)
di
;
di
->
dlgdm
=
malloc
(
sizeof
(
*
di
->
dlgdm
));
if
(
!
di
->
dlgdm
)
return
ERR_CPSUI_ALLOCMEM_FAILED
;
memset
(
&
psp
,
0
,
sizeof
(
psp
));
di
->
pi
=
pi
;
*
di
->
dlgdm
=
*
pi
->
Devmode
;
psp
.
dwSize
=
sizeof
(
psp
);
psp
.
hInstance
=
PSDRV_hInstance
;
psp
.
pszTemplate
=
L"PAPER"
;
psp
.
pszIcon
=
NULL
;
psp
.
pfnDlgProc
=
PSDRV_PaperDlgProc
;
psp
.
lParam
=
(
LPARAM
)
di
;
if
(
!
info
->
pfnComPropSheet
(
info
->
hComPropSheet
,
CPSFUNC_ADD_PROPSHEETPAGEW
,
(
LPARAM
)
&
psp
,
0
))
return
ERR_CPSUI_GETLASTERROR
;
}
}
if
(
info
&&
info
->
Reason
==
PROPSHEETUI_REASON_DESTROY
)
{
if
(
info
->
UserData
)
free
(((
PSDRV_DLGINFO
*
)
info
->
UserData
)
->
dlgdm
);
free
((
void
*
)
info
->
UserData
);
}
if
(
!
info
||
(
info
->
Reason
==
PROPSHEETUI_REASON_DESTROY
&&
lparam
))
{
/* If DM_UPDATE is set, should write settings to environment and initialization file */
if
(
dph
->
fMode
&
DM_UPDATE
)
FIXME
(
"Mode DM_UPDATE. Just do the same as DM_COPY
\n
"
);
/* If DM_COPY is set, should write settings to pdmOut */
if
(
dph
->
pdmOut
&&
(
dph
->
fMode
&
(
DM_COPY
|
DM_UPDATE
)))
memcpy
(
dph
->
pdmOut
,
&
pi
->
Devmode
->
dmPublic
,
pi
->
Devmode
->
dmPublic
.
dmSize
+
pi
->
Devmode
->
dmPublic
.
dmDriverExtra
);
}
return
CPSUI_OK
;
}
/******************************************************************************
* DrvDeviceCapabilities (wineps.drv.@)
*/
DWORD
WINAPI
DrvDeviceCapabilities
(
HANDLE
printer
,
WCHAR
*
device_name
,
WORD
capability
,
...
...
dlls/wineps.drv/wineps.drv.spec
View file @
1f89a886
...
...
@@ -3,3 +3,4 @@
# Printer driver config exports
@ stdcall DrvDeviceCapabilities(ptr wstr long ptr ptr)
@ stdcall DrvDocumentProperties(long wstr ptr ptr long)
@ stdcall DrvDocumentPropertySheets(ptr long)
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