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
ced916b9
Commit
ced916b9
authored
Feb 11, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Feb 11, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps.drv: Add DEVMODE dumping to make debugging device state easier.
parent
da7c4ee1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
90 additions
and
0 deletions
+90
-0
init.c
dlls/wineps.drv/init.c
+90
-0
No files found.
dlls/wineps.drv/init.c
View file @
ced916b9
...
...
@@ -148,12 +148,99 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
return
TRUE
;
}
static
void
dump_fields
(
DWORD
fields
)
{
int
add_space
=
0
;
#define CHECK_FIELD(flag) \
do \
{ \
if (fields & flag) \
{ \
if (add_space++) DPRINTF(" "); \
TRACE(#flag); \
fields &= ~flag; \
} \
} \
while (0)
CHECK_FIELD
(
DM_ORIENTATION
);
CHECK_FIELD
(
DM_PAPERSIZE
);
CHECK_FIELD
(
DM_PAPERLENGTH
);
CHECK_FIELD
(
DM_PAPERWIDTH
);
CHECK_FIELD
(
DM_SCALE
);
CHECK_FIELD
(
DM_POSITION
);
CHECK_FIELD
(
DM_NUP
);
CHECK_FIELD
(
DM_DISPLAYORIENTATION
);
CHECK_FIELD
(
DM_COPIES
);
CHECK_FIELD
(
DM_DEFAULTSOURCE
);
CHECK_FIELD
(
DM_PRINTQUALITY
);
CHECK_FIELD
(
DM_COLOR
);
CHECK_FIELD
(
DM_DUPLEX
);
CHECK_FIELD
(
DM_YRESOLUTION
);
CHECK_FIELD
(
DM_TTOPTION
);
CHECK_FIELD
(
DM_COLLATE
);
CHECK_FIELD
(
DM_FORMNAME
);
CHECK_FIELD
(
DM_LOGPIXELS
);
CHECK_FIELD
(
DM_BITSPERPEL
);
CHECK_FIELD
(
DM_PELSWIDTH
);
CHECK_FIELD
(
DM_PELSHEIGHT
);
CHECK_FIELD
(
DM_DISPLAYFLAGS
);
CHECK_FIELD
(
DM_DISPLAYFREQUENCY
);
CHECK_FIELD
(
DM_ICMMETHOD
);
CHECK_FIELD
(
DM_ICMINTENT
);
CHECK_FIELD
(
DM_MEDIATYPE
);
CHECK_FIELD
(
DM_DITHERTYPE
);
CHECK_FIELD
(
DM_PANNINGWIDTH
);
CHECK_FIELD
(
DM_PANNINGHEIGHT
);
if
(
fields
)
TRACE
(
" %#x"
,
fields
);
TRACE
(
"
\n
"
);
#undef CHECK_FIELD
}
/* Dump DEVMODE structure without a device specific part.
* Some applications and drivers fail to specify correct field
* flags (like DM_FORMNAME), so dump everything.
*/
static
void
dump_devmode
(
const
DEVMODEW
*
dm
)
{
if
(
!
TRACE_ON
(
psdrv
))
return
;
TRACE
(
"dmDeviceName: %s
\n
"
,
debugstr_w
(
dm
->
dmDeviceName
));
TRACE
(
"dmSpecVersion: 0x%04x
\n
"
,
dm
->
dmSpecVersion
);
TRACE
(
"dmDriverVersion: 0x%04x
\n
"
,
dm
->
dmDriverVersion
);
TRACE
(
"dmSize: 0x%04x
\n
"
,
dm
->
dmSize
);
TRACE
(
"dmDriverExtra: 0x%04x
\n
"
,
dm
->
dmDriverExtra
);
TRACE
(
"dmFields: 0x%04x
\n
"
,
dm
->
dmFields
);
dump_fields
(
dm
->
dmFields
);
TRACE
(
"dmOrientation: %d
\n
"
,
dm
->
u1
.
s1
.
dmOrientation
);
TRACE
(
"dmPaperSize: %d
\n
"
,
dm
->
u1
.
s1
.
dmPaperSize
);
TRACE
(
"dmPaperLength: %d
\n
"
,
dm
->
u1
.
s1
.
dmPaperLength
);
TRACE
(
"dmPaperWidth: %d
\n
"
,
dm
->
u1
.
s1
.
dmPaperWidth
);
TRACE
(
"dmScale: %d
\n
"
,
dm
->
u1
.
s1
.
dmScale
);
TRACE
(
"dmCopies: %d
\n
"
,
dm
->
u1
.
s1
.
dmCopies
);
TRACE
(
"dmDefaultSource: %d
\n
"
,
dm
->
u1
.
s1
.
dmDefaultSource
);
TRACE
(
"dmPrintQuality: %d
\n
"
,
dm
->
u1
.
s1
.
dmPrintQuality
);
TRACE
(
"dmColor: %d
\n
"
,
dm
->
dmColor
);
TRACE
(
"dmDuplex: %d
\n
"
,
dm
->
dmDuplex
);
TRACE
(
"dmYResolution: %d
\n
"
,
dm
->
dmYResolution
);
TRACE
(
"dmTTOption: %d
\n
"
,
dm
->
dmTTOption
);
TRACE
(
"dmCollate: %d
\n
"
,
dm
->
dmCollate
);
TRACE
(
"dmFormName: %s
\n
"
,
debugstr_w
(
dm
->
dmFormName
));
TRACE
(
"dmLogPixels %u
\n
"
,
dm
->
dmLogPixels
);
TRACE
(
"dmBitsPerPel %u
\n
"
,
dm
->
dmBitsPerPel
);
TRACE
(
"dmPelsWidth %u
\n
"
,
dm
->
dmPelsWidth
);
TRACE
(
"dmPelsHeight %u
\n
"
,
dm
->
dmPelsHeight
);
}
static
void
PSDRV_UpdateDevCaps
(
PSDRV_PDEVICE
*
physDev
)
{
PAGESIZE
*
page
;
RESOLUTION
*
res
;
INT
width
=
0
,
height
=
0
,
resx
=
0
,
resy
=
0
;
dump_devmode
(
&
physDev
->
Devmode
->
dmPublic
);
if
(
physDev
->
Devmode
->
dmPublic
.
dmFields
&
(
DM_PRINTQUALITY
|
DM_YRESOLUTION
|
DM_LOGPIXELS
))
{
if
(
physDev
->
Devmode
->
dmPublic
.
dmFields
&
DM_PRINTQUALITY
)
...
...
@@ -324,7 +411,10 @@ static BOOL PSDRV_CreateDC( PHYSDEV *pdev, LPCWSTR driver, LPCWSTR device,
if
(
output
&&
*
output
)
physDev
->
job
.
output
=
strdupW
(
output
);
if
(
initData
)
{
dump_devmode
(
initData
);
PSDRV_MergeDevmodes
(
physDev
->
Devmode
,
(
const
PSDRV_DEVMODE
*
)
initData
,
pi
);
}
PSDRV_UpdateDevCaps
(
physDev
);
SelectObject
(
(
*
pdev
)
->
hdc
,
PSDRV_DefaultFont
);
...
...
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