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
b49aaf1f
Commit
b49aaf1f
authored
Jul 07, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps.drv: Use the HDC from the gdi_physdev structure.
parent
10dcba49
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
29 additions
and
31 deletions
+29
-31
brush.c
dlls/wineps.drv/brush.c
+4
-4
builtin.c
dlls/wineps.drv/builtin.c
+3
-3
clipping.c
dlls/wineps.drv/clipping.c
+3
-3
download.c
dlls/wineps.drv/download.c
+10
-10
escape.c
dlls/wineps.drv/escape.c
+1
-1
graphics.c
dlls/wineps.drv/graphics.c
+2
-2
init.c
dlls/wineps.drv/init.c
+2
-3
pen.c
dlls/wineps.drv/pen.c
+2
-2
ps.c
dlls/wineps.drv/ps.c
+2
-2
psdrv.h
dlls/wineps.drv/psdrv.h
+0
-1
No files found.
dlls/wineps.drv/brush.c
View file @
b49aaf1f
...
...
@@ -37,7 +37,7 @@ HBRUSH CDECL PSDRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush )
TRACE
(
"hbrush = %p
\n
"
,
hbrush
);
if
(
hbrush
==
GetStockObject
(
DC_BRUSH
))
logbrush
.
lbColor
=
GetDCBrushColor
(
physD
ev
->
hdc
);
logbrush
.
lbColor
=
GetDCBrushColor
(
d
ev
->
hdc
);
switch
(
logbrush
.
lbStyle
)
{
...
...
@@ -73,7 +73,7 @@ COLORREF CDECL PSDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color )
{
PSDRV_PDEVICE
*
physDev
=
get_psdrv_dev
(
dev
);
if
(
GetCurrentObject
(
physD
ev
->
hdc
,
OBJ_BRUSH
)
==
GetStockObject
(
DC_BRUSH
))
if
(
GetCurrentObject
(
d
ev
->
hdc
,
OBJ_BRUSH
)
==
GetStockObject
(
DC_BRUSH
))
{
PSDRV_CreateColor
(
dev
,
&
physDev
->
brush
.
color
,
color
);
physDev
->
brush
.
set
=
FALSE
;
...
...
@@ -93,7 +93,7 @@ static BOOL PSDRV_SetBrush( PHYSDEV dev )
LOGBRUSH
logbrush
;
BOOL
ret
=
TRUE
;
if
(
!
GetObjectA
(
GetCurrentObject
(
physD
ev
->
hdc
,
OBJ_BRUSH
),
sizeof
(
logbrush
),
&
logbrush
))
if
(
!
GetObjectA
(
GetCurrentObject
(
d
ev
->
hdc
,
OBJ_BRUSH
),
sizeof
(
logbrush
),
&
logbrush
))
{
ERR
(
"Can't get BRUSHOBJ
\n
"
);
return
FALSE
;
...
...
@@ -159,7 +159,7 @@ BOOL PSDRV_Brush(PHYSDEV dev, BOOL EO)
if
(
physDev
->
pathdepth
)
return
FALSE
;
if
(
!
GetObjectA
(
GetCurrentObject
(
physD
ev
->
hdc
,
OBJ_BRUSH
),
sizeof
(
logbrush
),
&
logbrush
))
if
(
!
GetObjectA
(
GetCurrentObject
(
d
ev
->
hdc
,
OBJ_BRUSH
),
sizeof
(
logbrush
),
&
logbrush
))
{
ERR
(
"Can't get BRUSHOBJ
\n
"
);
return
FALSE
;
...
...
dlls/wineps.drv/builtin.c
View file @
b49aaf1f
...
...
@@ -218,7 +218,7 @@ BOOL PSDRV_SelectBuiltinFont(PHYSDEV dev, HFONT hfont,
POINT
pts
[
2
];
pts
[
0
].
x
=
pts
[
0
].
y
=
pts
[
1
].
x
=
0
;
pts
[
1
].
y
=
height
;
LPtoDP
(
physD
ev
->
hdc
,
pts
,
2
);
LPtoDP
(
d
ev
->
hdc
,
pts
,
2
);
height
=
pts
[
1
].
y
-
pts
[
0
].
y
;
}
ScaleFont
(
physDev
->
font
.
fontinfo
.
Builtin
.
afm
,
height
,
...
...
@@ -437,7 +437,7 @@ BOOL CDECL PSDRV_EnumDeviceFonts( PHYSDEV dev, LPLOGFONTW plf, FONTENUMPROCW pro
UINT
fm
;
TRACE
(
"Got '%s'
\n
"
,
afmle
->
afm
->
FontName
);
fm
=
PSDRV_GetFontMetric
(
physD
ev
->
hdc
,
afmle
->
afm
,
&
tm
,
&
lf
);
fm
=
PSDRV_GetFontMetric
(
d
ev
->
hdc
,
afmle
->
afm
,
&
tm
,
&
lf
);
if
(
(
b
=
(
*
proc
)(
&
lf
.
elfLogFont
,
(
TEXTMETRICW
*
)
&
tm
,
fm
,
lp
))
)
bRet
=
b
;
else
break
;
...
...
@@ -451,7 +451,7 @@ BOOL CDECL PSDRV_EnumDeviceFonts( PHYSDEV dev, LPLOGFONTW plf, FONTENUMPROCW pro
afmle
=
family
->
afmlist
;
TRACE
(
"Got '%s'
\n
"
,
afmle
->
afm
->
FontName
);
fm
=
PSDRV_GetFontMetric
(
physD
ev
->
hdc
,
afmle
->
afm
,
&
tm
,
&
lf
);
fm
=
PSDRV_GetFontMetric
(
d
ev
->
hdc
,
afmle
->
afm
,
&
tm
,
&
lf
);
if
(
(
b
=
(
*
proc
)(
&
lf
.
elfLogFont
,
(
TEXTMETRICW
*
)
&
tm
,
fm
,
lp
))
)
bRet
=
b
;
else
break
;
...
...
dlls/wineps.drv/clipping.c
View file @
b49aaf1f
...
...
@@ -44,14 +44,14 @@ void PSDRV_SetClip( PHYSDEV dev )
HRGN
hrgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
BOOL
empty
;
TRACE
(
"hdc=%p
\n
"
,
physD
ev
->
hdc
);
TRACE
(
"hdc=%p
\n
"
,
d
ev
->
hdc
);
if
(
physDev
->
pathdepth
)
{
TRACE
(
"inside a path, so not clipping
\n
"
);
goto
end
;
}
empty
=
!
GetClipRgn
(
physD
ev
->
hdc
,
hrgn
);
empty
=
!
GetClipRgn
(
d
ev
->
hdc
,
hrgn
);
if
(
!
empty
)
{
size
=
GetRegionData
(
hrgn
,
0
,
NULL
);
...
...
@@ -121,7 +121,7 @@ void PSDRV_ResetClip( PHYSDEV dev )
HRGN
hrgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
BOOL
empty
;
empty
=
!
GetClipRgn
(
physD
ev
->
hdc
,
hrgn
);
empty
=
!
GetClipRgn
(
d
ev
->
hdc
,
hrgn
);
if
(
!
empty
&&
!
physDev
->
pathdepth
)
PSDRV_WriteGRestore
(
dev
);
DeleteObject
(
hrgn
);
...
...
dlls/wineps.drv/download.c
View file @
b49aaf1f
...
...
@@ -252,7 +252,7 @@ BOOL PSDRV_WriteSetDownloadFont(PHYSDEV dev)
PSDRV_PDEVICE
*
physDev
=
get_psdrv_dev
(
dev
);
char
*
ps_name
;
LPOUTLINETEXTMETRICA
potm
;
DWORD
len
=
GetOutlineTextMetricsA
(
physD
ev
->
hdc
,
0
,
NULL
);
DWORD
len
=
GetOutlineTextMetricsA
(
d
ev
->
hdc
,
0
,
NULL
);
DOWNLOAD
*
pdl
;
LOGFONTW
lf
;
UINT
ppem
;
...
...
@@ -261,20 +261,20 @@ BOOL PSDRV_WriteSetDownloadFont(PHYSDEV dev)
assert
(
physDev
->
font
.
fontloc
==
Download
);
potm
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
GetOutlineTextMetricsA
(
physD
ev
->
hdc
,
len
,
potm
);
GetOutlineTextMetricsA
(
d
ev
->
hdc
,
len
,
potm
);
get_download_name
(
dev
,
potm
,
&
ps_name
);
physDev
->
font
.
fontinfo
.
Download
=
is_font_downloaded
(
physDev
,
ps_name
);
if
(
!
GetObjectW
(
GetCurrentObject
(
physD
ev
->
hdc
,
OBJ_FONT
),
sizeof
(
lf
),
&
lf
))
if
(
!
GetObjectW
(
GetCurrentObject
(
d
ev
->
hdc
,
OBJ_FONT
),
sizeof
(
lf
),
&
lf
))
return
FALSE
;
ppem
=
calc_ppem_for_height
(
physD
ev
->
hdc
,
lf
.
lfHeight
);
ppem
=
calc_ppem_for_height
(
d
ev
->
hdc
,
lf
.
lfHeight
);
/* Retrieve the world -> device transform */
GetTransform
(
physD
ev
->
hdc
,
0x204
,
&
xform
);
GetTransform
(
d
ev
->
hdc
,
0x204
,
&
xform
);
if
(
GetGraphicsMode
(
physD
ev
->
hdc
)
==
GM_COMPATIBLE
)
if
(
GetGraphicsMode
(
d
ev
->
hdc
)
==
GM_COMPATIBLE
)
{
xform
.
eM11
=
xform
.
eM22
=
fabs
(
xform
.
eM22
);
xform
.
eM21
=
xform
.
eM12
=
0
;
...
...
@@ -294,7 +294,7 @@ BOOL PSDRV_WriteSetDownloadFont(PHYSDEV dev)
RECT
bbox
;
UINT
emsize
;
if
(
!
get_bbox
(
physD
ev
->
hdc
,
&
bbox
,
&
emsize
))
{
if
(
!
get_bbox
(
d
ev
->
hdc
,
&
bbox
,
&
emsize
))
{
HeapFree
(
GetProcessHeap
(),
0
,
potm
);
return
FALSE
;
}
...
...
@@ -320,7 +320,7 @@ BOOL PSDRV_WriteSetDownloadFont(PHYSDEV dev)
if
(
pdl
->
type
==
Type42
)
{
char
g_name
[
MAX_G_NAME
+
1
];
get_glyph_name
(
physD
ev
->
hdc
,
0
,
g_name
);
get_glyph_name
(
d
ev
->
hdc
,
0
,
g_name
);
T42_download_glyph
(
dev
,
pdl
,
0
,
g_name
);
}
}
...
...
@@ -357,7 +357,7 @@ BOOL PSDRV_WriteDownloadGlyphShow(PHYSDEV dev, WORD *glyphs,
switch
(
physDev
->
font
.
fontinfo
.
Download
->
type
)
{
case
Type42
:
for
(
i
=
0
;
i
<
count
;
i
++
)
{
get_glyph_name
(
physD
ev
->
hdc
,
glyphs
[
i
],
g_name
);
get_glyph_name
(
d
ev
->
hdc
,
glyphs
[
i
],
g_name
);
T42_download_glyph
(
dev
,
physDev
->
font
.
fontinfo
.
Download
,
glyphs
[
i
],
g_name
);
PSDRV_WriteGlyphShow
(
dev
,
g_name
);
}
...
...
@@ -365,7 +365,7 @@ BOOL PSDRV_WriteDownloadGlyphShow(PHYSDEV dev, WORD *glyphs,
case
Type1
:
for
(
i
=
0
;
i
<
count
;
i
++
)
{
get_glyph_name
(
physD
ev
->
hdc
,
glyphs
[
i
],
g_name
);
get_glyph_name
(
d
ev
->
hdc
,
glyphs
[
i
],
g_name
);
T1_download_glyph
(
dev
,
physDev
->
font
.
fontinfo
.
Download
,
glyphs
[
i
],
g_name
);
PSDRV_WriteGlyphShow
(
dev
,
g_name
);
}
...
...
dlls/wineps.drv/escape.c
View file @
b49aaf1f
...
...
@@ -155,7 +155,7 @@ INT CDECL PSDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID in_dat
r
->
bottom
=
0
;
TRACE
(
"NEXTBAND rect to 0,0 - 0,0
\n
"
);
physDev
->
job
.
banding
=
FALSE
;
return
EndPage
(
physD
ev
->
hdc
);
return
EndPage
(
d
ev
->
hdc
);
}
case
SETCOPYCOUNT
:
...
...
dlls/wineps.drv/graphics.c
View file @
b49aaf1f
...
...
@@ -107,12 +107,12 @@ BOOL CDECL PSDRV_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT botto
rect
.
top
=
top
;
rect
.
right
=
right
;
rect
.
bottom
=
bottom
;
LPtoDP
(
physD
ev
->
hdc
,
(
POINT
*
)
&
rect
,
2
);
LPtoDP
(
d
ev
->
hdc
,
(
POINT
*
)
&
rect
,
2
);
/* Windows does something truly hacky here. If we're in passthrough mode
and our rop is R2_NOP, then we output the string below. This is used in
Office 2k when inserting eps files */
if
(
physDev
->
job
.
in_passthrough
&&
!
physDev
->
job
.
had_passthrough_rect
&&
GetROP2
(
physD
ev
->
hdc
)
==
R2_NOP
)
{
if
(
physDev
->
job
.
in_passthrough
&&
!
physDev
->
job
.
had_passthrough_rect
&&
GetROP2
(
d
ev
->
hdc
)
==
R2_NOP
)
{
char
buf
[
256
];
sprintf
(
buf
,
"N %d %d %d %d B
\n
"
,
rect
.
right
-
rect
.
left
,
rect
.
bottom
-
rect
.
top
,
rect
.
left
,
rect
.
top
);
write_spool
(
dev
,
buf
,
strlen
(
buf
));
...
...
dlls/wineps.drv/init.c
View file @
b49aaf1f
...
...
@@ -342,7 +342,6 @@ BOOL CDECL PSDRV_CreateDC( HDC hdc, PSDRV_PDEVICE **pdev, LPCWSTR driver, LPCWST
physDev
=
HeapAlloc
(
PSDRV_Heap
,
HEAP_ZERO_MEMORY
,
sizeof
(
*
physDev
)
);
if
(
!
physDev
)
return
FALSE
;
*
pdev
=
physDev
;
physDev
->
hdc
=
hdc
;
physDev
->
pi
=
pi
;
...
...
@@ -408,7 +407,7 @@ HDC CDECL PSDRV_ResetDC( PHYSDEV dev, const DEVMODEW *lpInitData )
HeapFree
(
PSDRV_Heap
,
0
,
devmodeA
);
PSDRV_UpdateDevCaps
(
physDev
);
}
return
physD
ev
->
hdc
;
return
d
ev
->
hdc
;
}
/***********************************************************************
...
...
@@ -520,7 +519,7 @@ INT CDECL PSDRV_GetDeviceCaps( PHYSDEV dev, INT cap )
case
SHADEBLENDCAPS
:
return
SB_NONE
;
default:
FIXME
(
"(%p): unsupported capability %d, will return 0
\n
"
,
physD
ev
->
hdc
,
cap
);
FIXME
(
"(%p): unsupported capability %d, will return 0
\n
"
,
d
ev
->
hdc
,
cap
);
return
0
;
}
}
...
...
dlls/wineps.drv/pen.c
View file @
b49aaf1f
...
...
@@ -71,7 +71,7 @@ HPEN CDECL PSDRV_SelectPen( PHYSDEV dev, HPEN hpen )
if
(
physDev
->
pen
.
width
<
0
)
physDev
->
pen
.
width
=
-
physDev
->
pen
.
width
;
}
if
(
hpen
==
GetStockObject
(
DC_PEN
))
logpen
.
lopnColor
=
GetDCPenColor
(
physD
ev
->
hdc
);
logpen
.
lopnColor
=
GetDCPenColor
(
d
ev
->
hdc
);
switch
(
logpen
.
lopnStyle
&
PS_JOIN_MASK
)
{
...
...
@@ -134,7 +134,7 @@ COLORREF CDECL PSDRV_SetDCPenColor( PHYSDEV dev, COLORREF color )
{
PSDRV_PDEVICE
*
physDev
=
get_psdrv_dev
(
dev
);
if
(
GetCurrentObject
(
physD
ev
->
hdc
,
OBJ_PEN
)
==
GetStockObject
(
DC_PEN
))
if
(
GetCurrentObject
(
d
ev
->
hdc
,
OBJ_PEN
)
==
GetStockObject
(
DC_PEN
))
PSDRV_CreateColor
(
dev
,
&
physDev
->
pen
.
color
,
color
);
return
color
;
}
...
...
dlls/wineps.drv/ps.c
View file @
b49aaf1f
...
...
@@ -839,8 +839,8 @@ BOOL PSDRV_WritePatternDict(PHYSDEV dev, BITMAP *bm, BYTE *bits)
PSDRV_WriteSpool
(
dev
,
"def
\n
"
,
4
);
PSDRV_WriteIndexColorSpaceBegin
(
dev
,
1
);
map
[
0
]
=
GetTextColor
(
physD
ev
->
hdc
);
map
[
1
]
=
GetBkColor
(
physD
ev
->
hdc
);
map
[
0
]
=
GetTextColor
(
d
ev
->
hdc
);
map
[
1
]
=
GetBkColor
(
d
ev
->
hdc
);
PSDRV_WriteRGB
(
dev
,
map
,
2
);
PSDRV_WriteIndexColorSpaceEnd
(
dev
);
...
...
dlls/wineps.drv/psdrv.h
View file @
b49aaf1f
...
...
@@ -355,7 +355,6 @@ typedef struct {
typedef
struct
{
struct
gdi_physdev
dev
;
HDC
hdc
;
PSFONT
font
;
/* Current PS font */
DOWNLOAD
*
downloaded_fonts
;
PSPEN
pen
;
...
...
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