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
45468c06
Commit
45468c06
authored
Mar 03, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed the GetTextExtentPoint graphics driver entry point to return
device coordinates. Removed not used breakCount field in the DC structure.
parent
a631ef63
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
34 deletions
+14
-34
builtin.c
dlls/wineps/builtin.c
+2
-13
text.c
dlls/x11drv/text.c
+4
-11
gdi.h
include/gdi.h
+0
-1
dc.c
objects/dc.c
+0
-3
font.c
objects/font.c
+8
-6
No files found.
dlls/wineps/builtin.c
View file @
45468c06
...
@@ -310,7 +310,6 @@ BOOL PSDRV_GetTextExtentPoint(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count, LP
...
@@ -310,7 +310,6 @@ BOOL PSDRV_GetTextExtentPoint(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count, LP
{
{
int
i
;
int
i
;
float
width
=
0
.
0
;
float
width
=
0
.
0
;
POINT
pt
[
3
];
assert
(
physDev
->
font
.
fontloc
==
Builtin
);
assert
(
physDev
->
font
.
fontloc
==
Builtin
);
...
@@ -319,18 +318,8 @@ BOOL PSDRV_GetTextExtentPoint(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count, LP
...
@@ -319,18 +318,8 @@ BOOL PSDRV_GetTextExtentPoint(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count, LP
for
(
i
=
0
;
i
<
count
&&
str
[
i
]
!=
'\0'
;
++
i
)
for
(
i
=
0
;
i
<
count
&&
str
[
i
]
!=
'\0'
;
++
i
)
width
+=
PSDRV_UVMetrics
(
str
[
i
],
physDev
->
font
.
fontinfo
.
Builtin
.
afm
)
->
WX
;
width
+=
PSDRV_UVMetrics
(
str
[
i
],
physDev
->
font
.
fontinfo
.
Builtin
.
afm
)
->
WX
;
width
*=
physDev
->
font
.
fontinfo
.
Builtin
.
scale
;
size
->
cx
=
width
*
physDev
->
font
.
fontinfo
.
Builtin
.
scale
;
size
->
cy
=
physDev
->
font
.
fontinfo
.
Builtin
.
tm
.
tmHeight
;
/* convert back to logical coords */
pt
[
0
].
x
=
0
;
pt
[
0
].
y
=
0
;
pt
[
1
].
x
=
width
;
pt
[
1
].
y
=
0
;
pt
[
2
].
x
=
0
;
pt
[
2
].
y
=
physDev
->
font
.
fontinfo
.
Builtin
.
tm
.
tmHeight
;
DPtoLP
(
physDev
->
hdc
,
pt
,
3
);
size
->
cx
=
pt
[
1
].
x
-
pt
[
0
].
x
;
size
->
cy
=
pt
[
2
].
y
-
pt
[
0
].
y
;
TRACE
(
"cx=%li cy=%li
\n
"
,
size
->
cx
,
size
->
cy
);
TRACE
(
"cx=%li cy=%li
\n
"
,
size
->
cx
,
size
->
cy
);
...
...
dlls/x11drv/text.c
View file @
45468c06
...
@@ -444,12 +444,10 @@ END:
...
@@ -444,12 +444,10 @@ END:
BOOL
X11DRV_GetTextExtentPoint
(
X11DRV_PDEVICE
*
physDev
,
LPCWSTR
str
,
INT
count
,
BOOL
X11DRV_GetTextExtentPoint
(
X11DRV_PDEVICE
*
physDev
,
LPCWSTR
str
,
INT
count
,
LPSIZE
size
)
LPSIZE
size
)
{
{
DC
*
dc
=
physDev
->
dc
;
fontObject
*
pfo
=
XFONT_GetFontObject
(
physDev
->
font
);
fontObject
*
pfo
=
XFONT_GetFontObject
(
physDev
->
font
);
TRACE
(
"%s %d
\n
"
,
debugstr_wn
(
str
,
count
),
count
);
TRACE
(
"%s %d
\n
"
,
debugstr_wn
(
str
,
count
),
count
);
if
(
pfo
)
{
if
(
pfo
)
{
INT
charExtra
=
GetTextCharacterExtra
(
physDev
->
hdc
);
XChar2b
*
p
=
X11DRV_cptable
[
pfo
->
fi
->
cptable
].
punicode_to_char2b
(
pfo
,
str
,
count
);
XChar2b
*
p
=
X11DRV_cptable
[
pfo
->
fi
->
cptable
].
punicode_to_char2b
(
pfo
,
str
,
count
);
if
(
!
p
)
return
FALSE
;
if
(
!
p
)
return
FALSE
;
if
(
!
pfo
->
lpX11Trans
)
{
if
(
!
pfo
->
lpX11Trans
)
{
...
@@ -458,10 +456,8 @@ BOOL X11DRV_GetTextExtentPoint( X11DRV_PDEVICE *physDev, LPCWSTR str, INT count,
...
@@ -458,10 +456,8 @@ BOOL X11DRV_GetTextExtentPoint( X11DRV_PDEVICE *physDev, LPCWSTR str, INT count,
X11DRV_cptable
[
pfo
->
fi
->
cptable
].
pTextExtents
(
pfo
,
p
,
X11DRV_cptable
[
pfo
->
fi
->
cptable
].
pTextExtents
(
pfo
,
p
,
count
,
&
dir
,
&
ascent
,
&
descent
,
&
info_width
);
count
,
&
dir
,
&
ascent
,
&
descent
,
&
info_width
);
size
->
cx
=
fabs
((
FLOAT
)(
info_width
+
dc
->
breakRem
+
count
*
size
->
cx
=
info_width
;
charExtra
)
*
dc
->
xformVport2World
.
eM11
);
size
->
cy
=
pfo
->
fs
->
ascent
+
pfo
->
fs
->
descent
;
size
->
cy
=
fabs
((
FLOAT
)(
pfo
->
fs
->
ascent
+
pfo
->
fs
->
descent
)
*
dc
->
xformVport2World
.
eM22
);
}
else
{
}
else
{
INT
i
;
INT
i
;
float
x
=
0
.
0
,
y
=
0
.
0
;
float
x
=
0
.
0
,
y
=
0
.
0
;
...
@@ -473,11 +469,8 @@ BOOL X11DRV_GetTextExtentPoint( X11DRV_PDEVICE *physDev, LPCWSTR str, INT count,
...
@@ -473,11 +469,8 @@ BOOL X11DRV_GetTextExtentPoint( X11DRV_PDEVICE *physDev, LPCWSTR str, INT count,
}
}
y
=
pfo
->
lpX11Trans
->
RAW_ASCENT
+
pfo
->
lpX11Trans
->
RAW_DESCENT
;
y
=
pfo
->
lpX11Trans
->
RAW_ASCENT
+
pfo
->
lpX11Trans
->
RAW_DESCENT
;
TRACE
(
"x = %f y = %f
\n
"
,
x
,
y
);
TRACE
(
"x = %f y = %f
\n
"
,
x
,
y
);
x
*=
pfo
->
lpX11Trans
->
pixelsize
/
1000
.
0
;
size
->
cx
=
x
*
pfo
->
lpX11Trans
->
pixelsize
/
1000
.
0
;
y
*=
pfo
->
lpX11Trans
->
pixelsize
/
1000
.
0
;
size
->
cy
=
y
*
pfo
->
lpX11Trans
->
pixelsize
/
1000
.
0
;
size
->
cx
=
fabs
((
x
+
dc
->
breakRem
+
count
*
charExtra
)
*
dc
->
xformVport2World
.
eM11
);
size
->
cy
=
fabs
(
y
*
dc
->
xformVport2World
.
eM22
);
}
}
size
->
cx
*=
pfo
->
rescale
;
size
->
cx
*=
pfo
->
rescale
;
size
->
cy
*=
pfo
->
rescale
;
size
->
cy
*=
pfo
->
rescale
;
...
...
include/gdi.h
View file @
45468c06
...
@@ -139,7 +139,6 @@ typedef struct tagDC
...
@@ -139,7 +139,6 @@ typedef struct tagDC
WORD
textAlign
;
/* Text alignment from SetTextAlign() */
WORD
textAlign
;
/* Text alignment from SetTextAlign() */
INT
charExtra
;
/* Spacing from SetTextCharacterExtra() */
INT
charExtra
;
/* Spacing from SetTextCharacterExtra() */
INT
breakCount
;
/* Break char. count */
INT
breakExtra
;
/* breakTotalExtra / breakCount */
INT
breakExtra
;
/* breakTotalExtra / breakCount */
INT
breakRem
;
/* breakTotalExtra % breakCount */
INT
breakRem
;
/* breakTotalExtra % breakCount */
INT
MapMode
;
INT
MapMode
;
...
...
objects/dc.c
View file @
45468c06
...
@@ -98,7 +98,6 @@ DC *DC_AllocDC( const DC_FUNCTIONS *funcs, WORD magic )
...
@@ -98,7 +98,6 @@ DC *DC_AllocDC( const DC_FUNCTIONS *funcs, WORD magic )
dc
->
brushOrgY
=
0
;
dc
->
brushOrgY
=
0
;
dc
->
textAlign
=
TA_LEFT
|
TA_TOP
|
TA_NOUPDATECP
;
dc
->
textAlign
=
TA_LEFT
|
TA_TOP
|
TA_NOUPDATECP
;
dc
->
charExtra
=
0
;
dc
->
charExtra
=
0
;
dc
->
breakCount
=
0
;
dc
->
breakExtra
=
0
;
dc
->
breakExtra
=
0
;
dc
->
breakRem
=
0
;
dc
->
breakRem
=
0
;
dc
->
MapMode
=
MM_TEXT
;
dc
->
MapMode
=
MM_TEXT
;
...
@@ -306,7 +305,6 @@ HDC WINAPI GetDCState( HDC hdc )
...
@@ -306,7 +305,6 @@ HDC WINAPI GetDCState( HDC hdc )
newdc
->
brushOrgY
=
dc
->
brushOrgY
;
newdc
->
brushOrgY
=
dc
->
brushOrgY
;
newdc
->
textAlign
=
dc
->
textAlign
;
newdc
->
textAlign
=
dc
->
textAlign
;
newdc
->
charExtra
=
dc
->
charExtra
;
newdc
->
charExtra
=
dc
->
charExtra
;
newdc
->
breakCount
=
dc
->
breakCount
;
newdc
->
breakExtra
=
dc
->
breakExtra
;
newdc
->
breakExtra
=
dc
->
breakExtra
;
newdc
->
breakRem
=
dc
->
breakRem
;
newdc
->
breakRem
=
dc
->
breakRem
;
newdc
->
MapMode
=
dc
->
MapMode
;
newdc
->
MapMode
=
dc
->
MapMode
;
...
@@ -395,7 +393,6 @@ void WINAPI SetDCState( HDC hdc, HDC hdcs )
...
@@ -395,7 +393,6 @@ void WINAPI SetDCState( HDC hdc, HDC hdcs )
dc
->
brushOrgY
=
dcs
->
brushOrgY
;
dc
->
brushOrgY
=
dcs
->
brushOrgY
;
dc
->
textAlign
=
dcs
->
textAlign
;
dc
->
textAlign
=
dcs
->
textAlign
;
dc
->
charExtra
=
dcs
->
charExtra
;
dc
->
charExtra
=
dcs
->
charExtra
;
dc
->
breakCount
=
dcs
->
breakCount
;
dc
->
breakExtra
=
dcs
->
breakExtra
;
dc
->
breakExtra
=
dcs
->
breakExtra
;
dc
->
breakRem
=
dcs
->
breakRem
;
dc
->
breakRem
=
dcs
->
breakRem
;
dc
->
MapMode
=
dcs
->
MapMode
;
dc
->
MapMode
=
dcs
->
MapMode
;
...
...
objects/font.c
View file @
45468c06
...
@@ -900,11 +900,10 @@ BOOL WINAPI SetTextJustification( HDC hdc, INT extra, INT breaks )
...
@@ -900,11 +900,10 @@ BOOL WINAPI SetTextJustification( HDC hdc, INT extra, INT breaks )
{
{
extra
=
abs
((
extra
*
dc
->
vportExtX
+
dc
->
wndExtX
/
2
)
/
dc
->
wndExtX
);
extra
=
abs
((
extra
*
dc
->
vportExtX
+
dc
->
wndExtX
/
2
)
/
dc
->
wndExtX
);
if
(
!
extra
)
breaks
=
0
;
if
(
!
extra
)
breaks
=
0
;
dc
->
breakCount
=
breaks
;
if
(
breaks
)
if
(
breaks
)
{
{
dc
->
breakExtra
=
extra
/
breaks
;
dc
->
breakExtra
=
extra
/
breaks
;
dc
->
breakRem
=
extra
-
(
dc
->
breakCount
*
dc
->
breakExtra
);
dc
->
breakRem
=
extra
-
(
breaks
*
dc
->
breakExtra
);
}
}
else
else
{
{
...
@@ -1008,14 +1007,17 @@ BOOL WINAPI GetTextExtentPoint32W(
...
@@ -1008,14 +1007,17 @@ BOOL WINAPI GetTextExtentPoint32W(
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
!
dc
)
return
FALSE
;
if
(
!
dc
)
return
FALSE
;
if
(
dc
->
gdiFont
)
{
if
(
dc
->
gdiFont
)
ret
=
WineEngGetTextExtentPoint
(
dc
->
gdiFont
,
str
,
count
,
size
);
ret
=
WineEngGetTextExtentPoint
(
dc
->
gdiFont
,
str
,
count
,
size
);
else
if
(
dc
->
funcs
->
pGetTextExtentPoint
)
ret
=
dc
->
funcs
->
pGetTextExtentPoint
(
dc
->
physDev
,
str
,
count
,
size
);
if
(
ret
)
{
size
->
cx
=
abs
(
INTERNAL_XDSTOWS
(
dc
,
size
->
cx
));
size
->
cx
=
abs
(
INTERNAL_XDSTOWS
(
dc
,
size
->
cx
));
size
->
cy
=
abs
(
INTERNAL_YDSTOWS
(
dc
,
size
->
cy
));
size
->
cy
=
abs
(
INTERNAL_YDSTOWS
(
dc
,
size
->
cy
));
size
->
cx
+=
count
*
dc
->
charExtra
;
size
->
cx
+=
count
*
dc
->
charExtra
+
dc
->
breakRem
;
}
}
else
if
(
dc
->
funcs
->
pGetTextExtentPoint
)
ret
=
dc
->
funcs
->
pGetTextExtentPoint
(
dc
->
physDev
,
str
,
count
,
size
);
GDI_ReleaseObj
(
hdc
);
GDI_ReleaseObj
(
hdc
);
...
...
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