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
b2258d83
Commit
b2258d83
authored
Jan 21, 2009
by
Huw Davies
Committed by
Alexandre Julliard
Jan 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Move invocation of the Printer... dialog to a separate function.
parent
26f11704
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
18 deletions
+77
-18
printdlg.c
dlls/comdlg32/printdlg.c
+77
-18
No files found.
dlls/comdlg32/printdlg.c
View file @
b2258d83
...
...
@@ -2638,6 +2638,25 @@ static void pagesetup_set_defaultsource(PageSetupDataA *pda, WORD source)
GlobalUnlock
(
pda
->
dlga
->
hDevMode
);
}
static
WCHAR
*
pagesetup_get_drvname
(
const
PageSetupDataA
*
pda
)
{
DEVNAMES
*
dn
;
int
len
;
WCHAR
*
name
;
dn
=
GlobalLock
(
pda
->
dlga
->
hDevNames
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
(
char
*
)
dn
+
dn
->
wDriverOffset
,
-
1
,
NULL
,
0
);
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
(
char
*
)
dn
+
dn
->
wDriverOffset
,
-
1
,
name
,
len
);
GlobalUnlock
(
pda
->
dlga
->
hDevNames
);
return
name
;
}
static
void
pagesetup_release_drvname
(
const
PageSetupDataA
*
pda
,
WCHAR
*
name
)
{
HeapFree
(
GetProcessHeap
(),
0
,
name
);
}
static
WCHAR
*
pagesetup_get_devname
(
const
PageSetupDataA
*
pda
)
{
DEVNAMES
*
dn
;
...
...
@@ -2941,6 +2960,59 @@ static void pagesetup_init_combos(HWND hDlg, PageSetupDataA *pda)
pagesetup_release_devmode
(
pda
,
dm
);
}
/****************************************************************************************
* pagesetup_change_printer_dialog
*
* Pops up another dialog that lets the user pick another printer.
*
* For now we display the PrintDlg, this should display a striped down version of it.
*/
static
void
pagesetup_change_printer_dialog
(
HWND
hDlg
,
PageSetupDataA
*
pda
)
{
PRINTDLGW
prnt
;
LPWSTR
drvname
,
devname
,
portname
;
DEVMODEW
*
tmp_dm
,
*
dm
;
memset
(
&
prnt
,
0
,
sizeof
(
prnt
));
prnt
.
lStructSize
=
sizeof
(
prnt
);
prnt
.
Flags
=
0
;
prnt
.
hwndOwner
=
hDlg
;
drvname
=
pagesetup_get_drvname
(
pda
);
devname
=
pagesetup_get_devname
(
pda
);
portname
=
pagesetup_get_portname
(
pda
);
prnt
.
hDevNames
=
0
;
PRINTDLG_CreateDevNamesW
(
&
prnt
.
hDevNames
,
drvname
,
devname
,
portname
);
pagesetup_release_portname
(
pda
,
portname
);
pagesetup_release_devname
(
pda
,
devname
);
pagesetup_release_drvname
(
pda
,
drvname
);
tmp_dm
=
pagesetup_get_devmode
(
pda
);
prnt
.
hDevMode
=
GlobalAlloc
(
GMEM_MOVEABLE
,
tmp_dm
->
dmSize
+
tmp_dm
->
dmDriverExtra
);
dm
=
GlobalLock
(
prnt
.
hDevMode
);
memcpy
(
dm
,
tmp_dm
,
tmp_dm
->
dmSize
+
tmp_dm
->
dmDriverExtra
);
GlobalUnlock
(
prnt
.
hDevMode
);
pagesetup_release_devmode
(
pda
,
tmp_dm
);
if
(
PrintDlgW
(
&
prnt
))
{
DEVMODEW
*
dm
=
GlobalLock
(
prnt
.
hDevMode
);
DEVNAMES
*
dn
=
GlobalLock
(
prnt
.
hDevNames
);
pagesetup_set_devnames
(
pda
,
(
WCHAR
*
)
dn
+
dn
->
wDriverOffset
,
(
WCHAR
*
)
dn
+
dn
->
wDeviceOffset
,
(
WCHAR
*
)
dn
+
dn
->
wOutputOffset
);
pagesetup_set_devmode
(
pda
,
dm
);
GlobalUnlock
(
prnt
.
hDevNames
);
GlobalUnlock
(
prnt
.
hDevMode
);
pagesetup_init_combos
(
hDlg
,
pda
);
}
GlobalFree
(
prnt
.
hDevMode
);
GlobalFree
(
prnt
.
hDevNames
);
}
static
void
PRINTDLG_PS_SetOrientationW
(
HWND
hDlg
,
PageSetupDataW
*
pdw
)
{
WCHAR
PaperName
[
64
];
...
...
@@ -3168,25 +3240,12 @@ PRINTDLG_PS_WMCommandA(
EndDialog
(
hDlg
,
FALSE
);
return
FALSE
;
case
psh3
:
{
PRINTDLGA
prnt
;
memset
(
&
prnt
,
0
,
sizeof
(
prnt
));
prnt
.
lStructSize
=
sizeof
(
prnt
);
prnt
.
Flags
=
0
;
prnt
.
hwndOwner
=
hDlg
;
prnt
.
hDevNames
=
pda
->
dlga
->
hDevNames
;
prnt
.
hDevMode
=
pda
->
dlga
->
hDevMode
;
if
(
PrintDlgA
(
&
prnt
))
{
pda
->
dlga
->
hDevNames
=
prnt
.
hDevNames
;
pda
->
dlga
->
hDevMode
=
prnt
.
hDevMode
;
pagesetup_init_combos
(
hDlg
,
pda
);
}
case
psh3
:
/* Printer... */
pagesetup_change_printer_dialog
(
hDlg
,
pda
);
return
TRUE
;
}
case
rad1
:
case
rad2
:
case
rad1
:
/* Portrait */
case
rad2
:
/* Landscape */
if
((
id
==
rad1
&&
pagesetup_get_orientation
(
pda
)
==
DMORIENT_LANDSCAPE
)
||
(
id
==
rad2
&&
pagesetup_get_orientation
(
pda
)
==
DMORIENT_PORTRAIT
))
{
...
...
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