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
d98cd8d2
Commit
d98cd8d2
authored
May 06, 2023
by
Piotr Caban
Committed by
Alexandre Julliard
May 09, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Use printer DC in print processor.
parent
18bcec0d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
172 deletions
+4
-172
builtin.c
dlls/wineps.drv/builtin.c
+0
-43
printproc.c
dlls/wineps.drv/printproc.c
+4
-127
psdrv.h
dlls/wineps.drv/psdrv.h
+0
-2
No files found.
dlls/wineps.drv/builtin.c
View file @
d98cd8d2
...
@@ -258,24 +258,6 @@ BOOL PSDRV_WriteBuiltinGlyphShow(PHYSDEV dev, LPCWSTR str, INT count)
...
@@ -258,24 +258,6 @@ BOOL PSDRV_WriteBuiltinGlyphShow(PHYSDEV dev, LPCWSTR str, INT count)
return
TRUE
;
return
TRUE
;
}
}
/***********************************************************************
* PSDRV_GetTextMetrics
*/
BOOL
CDECL
PSDRV_GetTextMetrics
(
PHYSDEV
dev
,
TEXTMETRICW
*
metrics
)
{
PSDRV_PDEVICE
*
physDev
=
get_psdrv_dev
(
dev
);
if
(
physDev
->
font
.
fontloc
==
Download
)
{
dev
=
GET_NEXT_PHYSDEV
(
dev
,
pGetTextMetrics
);
return
dev
->
funcs
->
pGetTextMetrics
(
dev
,
metrics
);
}
memcpy
(
metrics
,
&
(
physDev
->
font
.
fontinfo
.
Builtin
.
tm
),
sizeof
(
physDev
->
font
.
fontinfo
.
Builtin
.
tm
));
return
TRUE
;
}
/******************************************************************************
/******************************************************************************
* PSDRV_UVMetrics
* PSDRV_UVMetrics
*
*
...
@@ -314,28 +296,3 @@ const AFMMETRICS *PSDRV_UVMetrics(LONG UV, const AFM *afm)
...
@@ -314,28 +296,3 @@ const AFMMETRICS *PSDRV_UVMetrics(LONG UV, const AFM *afm)
return
needle
;
return
needle
;
}
}
/***********************************************************************
* PSDRV_GetTextExtentExPoint
*/
BOOL
CDECL
PSDRV_GetTextExtentExPoint
(
PHYSDEV
dev
,
LPCWSTR
str
,
INT
count
,
LPINT
alpDx
)
{
PSDRV_PDEVICE
*
physDev
=
get_psdrv_dev
(
dev
);
int
i
;
float
width
=
0
.
0
;
if
(
physDev
->
font
.
fontloc
==
Download
)
{
dev
=
GET_NEXT_PHYSDEV
(
dev
,
pGetTextExtentExPoint
);
return
dev
->
funcs
->
pGetTextExtentExPoint
(
dev
,
str
,
count
,
alpDx
);
}
TRACE
(
"%s %i
\n
"
,
debugstr_wn
(
str
,
count
),
count
);
for
(
i
=
0
;
i
<
count
;
++
i
)
{
width
+=
PSDRV_UVMetrics
(
str
[
i
],
physDev
->
font
.
fontinfo
.
Builtin
.
afm
)
->
WX
;
alpDx
[
i
]
=
width
*
physDev
->
font
.
fontinfo
.
Builtin
.
scale
;
}
return
TRUE
;
}
dlls/wineps.drv/printproc.c
View file @
d98cd8d2
...
@@ -155,17 +155,6 @@ static struct pp_data* get_handle_data(HANDLE pp)
...
@@ -155,17 +155,6 @@ static struct pp_data* get_handle_data(HANDLE pp)
return
ret
;
return
ret
;
}
}
static
BOOL
CDECL
font_GetTextExtentExPoint
(
PHYSDEV
dev
,
const
WCHAR
*
str
,
INT
count
,
INT
*
dxs
)
{
SIZE
size
;
return
GetTextExtentExPointW
(
dev
->
hdc
,
str
,
count
,
-
1
,
NULL
,
dxs
,
&
size
);
}
static
BOOL
CDECL
font_GetTextMetrics
(
PHYSDEV
dev
,
TEXTMETRICW
*
metrics
)
{
return
GetTextMetricsW
(
dev
->
hdc
,
metrics
);
}
static
HFONT
CDECL
font_SelectFont
(
PHYSDEV
dev
,
HFONT
hfont
,
UINT
*
aa_flags
)
static
HFONT
CDECL
font_SelectFont
(
PHYSDEV
dev
,
HFONT
hfont
,
UINT
*
aa_flags
)
{
{
HFONT
tt_font
,
old_font
;
HFONT
tt_font
,
old_font
;
...
@@ -187,8 +176,6 @@ static HFONT CDECL font_SelectFont(PHYSDEV dev, HFONT hfont, UINT *aa_flags)
...
@@ -187,8 +176,6 @@ static HFONT CDECL font_SelectFont(PHYSDEV dev, HFONT hfont, UINT *aa_flags)
static
const
struct
gdi_dc_funcs
font_funcs
=
static
const
struct
gdi_dc_funcs
font_funcs
=
{
{
.
pGetTextExtentExPoint
=
font_GetTextExtentExPoint
,
.
pGetTextMetrics
=
font_GetTextMetrics
,
.
pSelectFont
=
font_SelectFont
,
.
pSelectFont
=
font_SelectFont
,
.
priority
=
GDI_PRIORITY_FONT_DRV
.
priority
=
GDI_PRIORITY_FONT_DRV
};
};
...
@@ -1151,38 +1138,9 @@ static BOOL select_hbrush(struct pp_data *data, HANDLETABLE *htable, int handle_
...
@@ -1151,38 +1138,9 @@ static BOOL select_hbrush(struct pp_data *data, HANDLETABLE *htable, int handle_
return
PSDRV_SelectBrush
(
&
data
->
pdev
->
dev
,
brush
,
pattern
)
!=
NULL
;
return
PSDRV_SelectBrush
(
&
data
->
pdev
->
dev
,
brush
,
pattern
)
!=
NULL
;
}
}
/* Performs a device to world transformation on the specified width (which
* is in integer format).
*/
static
inline
INT
INTERNAL_XDSTOWS
(
HDC
hdc
,
INT
width
)
{
double
floatWidth
;
XFORM
xform
;
GetWorldTransform
(
hdc
,
&
xform
);
/* Perform operation with floating point */
floatWidth
=
(
double
)
width
*
xform
.
eM11
;
/* Round to integers */
return
GDI_ROUND
(
floatWidth
);
}
/* Performs a device to world transformation on the specified size (which
/* Performs a device to world transformation on the specified size (which
* is in integer format).
* is in integer format).
*/
*/
static
inline
INT
INTERNAL_YDSTOWS
(
HDC
hdc
,
INT
height
)
{
double
floatHeight
;
XFORM
xform
;
GetWorldTransform
(
hdc
,
&
xform
);
/* Perform operation with floating point */
floatHeight
=
(
double
)
height
*
xform
.
eM22
;
/* Round to integers */
return
GDI_ROUND
(
floatHeight
);
}
static
inline
INT
INTERNAL_YWSTODS
(
HDC
hdc
,
INT
height
)
static
inline
INT
INTERNAL_YWSTODS
(
HDC
hdc
,
INT
height
)
{
{
POINT
pt
[
2
];
POINT
pt
[
2
];
...
@@ -1193,87 +1151,6 @@ static inline INT INTERNAL_YWSTODS(HDC hdc, INT height)
...
@@ -1193,87 +1151,6 @@ static inline INT INTERNAL_YWSTODS(HDC hdc, INT height)
return
pt
[
1
].
y
-
pt
[
0
].
y
;
return
pt
[
1
].
y
-
pt
[
0
].
y
;
}
}
/* compute positions for text rendering, in device coords */
static
BOOL
get_char_positions
(
struct
pp_data
*
data
,
const
WCHAR
*
str
,
INT
count
,
INT
*
dx
,
SIZE
*
size
)
{
TEXTMETRICW
tm
;
size
->
cx
=
size
->
cy
=
0
;
if
(
!
count
)
return
TRUE
;
PSDRV_GetTextMetrics
(
&
data
->
pdev
->
dev
,
&
tm
);
if
(
!
PSDRV_GetTextExtentExPoint
(
&
data
->
pdev
->
dev
,
str
,
count
,
dx
))
return
FALSE
;
if
(
data
->
break_extra
||
data
->
break_rem
)
{
int
i
,
space
=
0
,
rem
=
data
->
break_rem
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
(
str
[
i
]
==
tm
.
tmBreakChar
)
{
space
+=
data
->
break_extra
;
if
(
rem
>
0
)
{
space
++
;
rem
--
;
}
}
dx
[
i
]
+=
space
;
}
}
size
->
cx
=
dx
[
count
-
1
];
size
->
cy
=
tm
.
tmHeight
;
return
TRUE
;
}
static
BOOL
get_text_extent
(
struct
pp_data
*
data
,
const
WCHAR
*
str
,
INT
count
,
INT
max_ext
,
INT
*
nfit
,
INT
*
dxs
,
SIZE
*
size
,
UINT
flags
)
{
INT
buffer
[
256
],
*
pos
=
dxs
;
int
i
,
char_extra
;
BOOL
ret
;
if
(
flags
)
return
GetTextExtentExPointI
(
data
->
pdev
->
dev
.
hdc
,
str
,
count
,
max_ext
,
nfit
,
dxs
,
size
);
else
if
(
data
->
pdev
->
font
.
fontloc
==
Download
)
return
GetTextExtentExPointW
(
data
->
pdev
->
dev
.
hdc
,
str
,
count
,
max_ext
,
nfit
,
dxs
,
size
);
if
(
!
dxs
)
{
pos
=
buffer
;
if
(
count
>
256
&&
!
(
pos
=
malloc
(
count
*
sizeof
(
*
pos
))))
return
FALSE
;
}
if
((
ret
=
get_char_positions
(
data
,
str
,
count
,
pos
,
size
)))
{
char_extra
=
GetTextCharacterExtra
(
data
->
pdev
->
dev
.
hdc
);
if
(
dxs
||
nfit
)
{
for
(
i
=
0
;
i
<
count
;
i
++
)
{
unsigned
int
dx
=
abs
(
INTERNAL_XDSTOWS
(
data
->
pdev
->
dev
.
hdc
,
pos
[
i
]))
+
(
i
+
1
)
*
char_extra
;
if
(
nfit
&&
dx
>
(
unsigned
int
)
max_ext
)
break
;
if
(
dxs
)
dxs
[
i
]
=
dx
;
}
if
(
nfit
)
*
nfit
=
i
;
}
size
->
cx
=
abs
(
INTERNAL_XDSTOWS
(
data
->
pdev
->
dev
.
hdc
,
size
->
cx
))
+
count
*
char_extra
;
size
->
cy
=
abs
(
INTERNAL_YDSTOWS
(
data
->
pdev
->
dev
.
hdc
,
size
->
cy
));
}
if
(
pos
!=
buffer
&&
pos
!=
dxs
)
free
(
pos
);
TRACE
(
"(%s, %d) returning %dx%d
\n
"
,
debugstr_wn
(
str
,
count
),
max_ext
,
(
int
)
size
->
cx
,
(
int
)
size
->
cy
);
return
ret
;
}
extern
const
unsigned
short
bidi_direction_table
[]
DECLSPEC_HIDDEN
;
extern
const
unsigned
short
bidi_direction_table
[]
DECLSPEC_HIDDEN
;
/*------------------------------------------------------------------------
/*------------------------------------------------------------------------
...
@@ -1938,7 +1815,7 @@ static BOOL ext_text_out(struct pp_data *data, HANDLETABLE *htable,
...
@@ -1938,7 +1815,7 @@ static BOOL ext_text_out(struct pp_data *data, HANDLETABLE *htable,
y
=
pt
.
y
;
y
=
pt
.
y
;
}
}
PSDRV_GetTextMetrics
(
&
data
->
pdev
->
dev
,
&
tm
);
GetTextMetricsW
(
hdc
,
&
tm
);
GetObjectW
(
GetCurrentObject
(
hdc
,
OBJ_FONT
),
sizeof
(
lf
),
&
lf
);
GetObjectW
(
GetCurrentObject
(
hdc
,
OBJ_FONT
),
sizeof
(
lf
),
&
lf
);
if
(
!
(
tm
.
tmPitchAndFamily
&
TMPF_VECTOR
))
/* Non-scalable fonts shouldn't be rotated */
if
(
!
(
tm
.
tmPitchAndFamily
&
TMPF_VECTOR
))
/* Non-scalable fonts shouldn't be rotated */
...
@@ -2017,7 +1894,7 @@ static BOOL ext_text_out(struct pp_data *data, HANDLETABLE *htable,
...
@@ -2017,7 +1894,7 @@ static BOOL ext_text_out(struct pp_data *data, HANDLETABLE *htable,
{
{
INT
*
dx
=
malloc
(
count
*
sizeof
(
*
dx
));
INT
*
dx
=
malloc
(
count
*
sizeof
(
*
dx
));
get_text_extent
(
data
,
str
,
count
,
-
1
,
NULL
,
dx
,
&
sz
,
!!
(
flags
&
ETO_GLYPH_INDEX
));
NtGdiGetTextExtentExW
(
hdc
,
str
,
count
,
-
1
,
NULL
,
dx
,
&
sz
,
!!
(
flags
&
ETO_GLYPH_INDEX
));
deltas
[
0
].
x
=
dx
[
0
];
deltas
[
0
].
x
=
dx
[
0
];
deltas
[
0
].
y
=
0
;
deltas
[
0
].
y
=
0
;
...
@@ -2062,7 +1939,7 @@ static BOOL ext_text_out(struct pp_data *data, HANDLETABLE *htable,
...
@@ -2062,7 +1939,7 @@ static BOOL ext_text_out(struct pp_data *data, HANDLETABLE *htable,
{
{
POINT
desired
[
2
];
POINT
desired
[
2
];
get_text_extent
(
data
,
str
,
count
,
0
,
NULL
,
NULL
,
&
sz
,
!!
(
flags
&
ETO_GLYPH_INDEX
));
NtGdiGetTextExtentExW
(
hdc
,
str
,
count
,
0
,
NULL
,
NULL
,
&
sz
,
!!
(
flags
&
ETO_GLYPH_INDEX
));
desired
[
0
].
x
=
desired
[
0
].
y
=
0
;
desired
[
0
].
x
=
desired
[
0
].
y
=
0
;
desired
[
1
].
x
=
sz
.
cx
;
desired
[
1
].
x
=
sz
.
cx
;
desired
[
1
].
y
=
0
;
desired
[
1
].
y
=
0
;
...
@@ -3122,7 +2999,7 @@ HANDLE WINAPI OpenPrintProcessor(WCHAR *port, PRINTPROCESSOROPENDATA *open_data)
...
@@ -3122,7 +2999,7 @@ HANDLE WINAPI OpenPrintProcessor(WCHAR *port, PRINTPROCESSOROPENDATA *open_data)
data
->
doc_name
=
wcsdup
(
open_data
->
pDocumentName
);
data
->
doc_name
=
wcsdup
(
open_data
->
pDocumentName
);
data
->
out_file
=
wcsdup
(
open_data
->
pOutputFile
);
data
->
out_file
=
wcsdup
(
open_data
->
pOutputFile
);
hdc
=
Create
CompatibleDC
(
NULL
);
hdc
=
Create
DCW
(
L"winspool"
,
open_data
->
pPrinterName
,
NULL
,
open_data
->
pDevMode
);
if
(
!
hdc
)
if
(
!
hdc
)
{
{
LocalFree
(
data
);
LocalFree
(
data
);
...
...
dlls/wineps.drv/psdrv.h
View file @
d98cd8d2
...
@@ -434,8 +434,6 @@ extern INT CDECL PSDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID
...
@@ -434,8 +434,6 @@ extern INT CDECL PSDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID
extern
BOOL
CDECL
PSDRV_ExtTextOut
(
PHYSDEV
dev
,
INT
x
,
INT
y
,
UINT
flags
,
extern
BOOL
CDECL
PSDRV_ExtTextOut
(
PHYSDEV
dev
,
INT
x
,
INT
y
,
UINT
flags
,
const
RECT
*
lprect
,
LPCWSTR
str
,
UINT
count
,
const
INT
*
lpDx
)
DECLSPEC_HIDDEN
;
const
RECT
*
lprect
,
LPCWSTR
str
,
UINT
count
,
const
INT
*
lpDx
)
DECLSPEC_HIDDEN
;
extern
BOOL
CDECL
PSDRV_FillPath
(
PHYSDEV
dev
)
DECLSPEC_HIDDEN
;
extern
BOOL
CDECL
PSDRV_FillPath
(
PHYSDEV
dev
)
DECLSPEC_HIDDEN
;
extern
BOOL
CDECL
PSDRV_GetTextExtentExPoint
(
PHYSDEV
dev
,
LPCWSTR
str
,
INT
count
,
LPINT
alpDx
)
DECLSPEC_HIDDEN
;
extern
BOOL
CDECL
PSDRV_GetTextMetrics
(
PHYSDEV
dev
,
TEXTMETRICW
*
metrics
)
DECLSPEC_HIDDEN
;
extern
BOOL
CDECL
PSDRV_LineTo
(
PHYSDEV
dev
,
INT
x
,
INT
y
)
DECLSPEC_HIDDEN
;
extern
BOOL
CDECL
PSDRV_LineTo
(
PHYSDEV
dev
,
INT
x
,
INT
y
)
DECLSPEC_HIDDEN
;
extern
BOOL
CDECL
PSDRV_PaintRgn
(
PHYSDEV
dev
,
HRGN
hrgn
)
DECLSPEC_HIDDEN
;
extern
BOOL
CDECL
PSDRV_PaintRgn
(
PHYSDEV
dev
,
HRGN
hrgn
)
DECLSPEC_HIDDEN
;
extern
BOOL
CDECL
PSDRV_PatBlt
(
PHYSDEV
dev
,
struct
bitblt_coords
*
dst
,
DWORD
dwRop
)
DECLSPEC_HIDDEN
;
extern
BOOL
CDECL
PSDRV_PatBlt
(
PHYSDEV
dev
,
struct
bitblt_coords
*
dst
,
DWORD
dwRop
)
DECLSPEC_HIDDEN
;
...
...
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