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
57826074
Commit
57826074
authored
Sep 28, 2006
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 29, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Add a stub implementation and a test for ScriptLayout.
parent
6fa9343b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
95 additions
and
1 deletion
+95
-1
usp10.c
dlls/usp10/tests/usp10.c
+47
-0
usp10.c
dlls/usp10/usp10.c
+47
-0
usp10.spec
dlls/usp10/usp10.spec
+1
-1
No files found.
dlls/usp10/tests/usp10.c
View file @
57826074
...
...
@@ -727,6 +727,52 @@ void test_ScriptGetGlyphABCWidth(HDC hdc)
ok
(
hr
==
S_OK
,
"expected S_OK, got 0x%08lx
\n
"
,
hr
);
}
void
test_ScriptLayout
(
void
)
{
HRESULT
hr
;
static
const
BYTE
levels
[][
5
]
=
{
{
0
,
0
,
0
,
0
,
0
},
{
1
,
1
,
1
,
1
,
1
},
{
2
,
2
,
2
,
2
,
2
},
{
3
,
3
,
3
,
3
,
3
},
};
static
const
int
expect
[][
5
]
=
{
{
0
,
1
,
2
,
3
,
4
},
{
4
,
3
,
2
,
1
,
0
},
{
0
,
1
,
2
,
3
,
4
},
{
4
,
3
,
2
,
1
,
0
}
};
int
i
,
j
,
vistolog
[
sizeof
(
levels
[
0
])],
logtovis
[
sizeof
(
levels
[
0
])];
hr
=
ScriptLayout
(
sizeof
(
levels
[
0
]),
NULL
,
vistolog
,
logtovis
);
ok
(
hr
==
E_INVALIDARG
,
"expected E_INVALIDARG, got 0x%08lx
\n
"
,
hr
);
hr
=
ScriptLayout
(
sizeof
(
levels
[
0
]),
levels
[
0
],
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"expected E_INVALIDARG, got 0x%08lx
\n
"
,
hr
);
for
(
i
=
0
;
i
<
sizeof
(
levels
)
/
sizeof
(
levels
[
0
]);
i
++
)
{
hr
=
ScriptLayout
(
sizeof
(
levels
[
0
]),
levels
[
i
],
vistolog
,
logtovis
);
ok
(
hr
==
S_OK
,
"expected S_OK, got 0x%08lx
\n
"
,
hr
);
for
(
j
=
0
;
j
<
sizeof
(
levels
[
i
]);
j
++
)
{
ok
(
expect
[
i
][
j
]
==
vistolog
[
j
],
"failure: levels[%d][%d] = %d, vistolog[%d] = %d
\n
"
,
i
,
j
,
levels
[
i
][
j
],
j
,
vistolog
[
j
]
);
}
for
(
j
=
0
;
j
<
sizeof
(
levels
[
i
]);
j
++
)
{
ok
(
expect
[
i
][
j
]
==
logtovis
[
j
],
"failure: levels[%d][%d] = %d, logtovis[%d] = %d
\n
"
,
i
,
j
,
levels
[
i
][
j
],
j
,
logtovis
[
j
]
);
}
}
}
static
const
struct
{
LGRPID
group
;
...
...
@@ -1010,6 +1056,7 @@ START_TEST(usp10)
test_ScriptTextOut
();
test_ScriptXtoX
();
test_ScriptString
();
test_ScriptLayout
();
test_digit_substitution
();
}
dlls/usp10/usp10.c
View file @
57826074
...
...
@@ -1124,3 +1124,50 @@ HRESULT WINAPI ScriptGetGlyphABCWidth(HDC hdc, SCRIPT_CACHE *psc, WORD glyph, AB
return
S_OK
;
}
/***********************************************************************
* ScriptLayout (USP10.@)
*
* Map embedding levels to visual and/or logical order.
*
* PARAMS
* runs [I] Size of level array.
* level [I] Array of embedding levels.
* vistolog [O] Map of embedding levels from visual to logical order.
* logtovis [O] Map of embedding levels from logical to visual order.
*
* RETURNS
* Success: S_OK
* Failure: Non-zero HRESULT value.
*
* BUGS
* This stub works correctly for any sequence of a single
* embedding level but not for sequences of different
* embedding levels, i.e. mixtures of RTL and LTR scripts.
*/
HRESULT
WINAPI
ScriptLayout
(
int
runs
,
const
BYTE
*
level
,
int
*
vistolog
,
int
*
logtovis
)
{
int
i
,
j
=
runs
-
1
,
k
=
0
;
FIXME
(
"(%d, %p, %p, %p): stub
\n
"
,
runs
,
level
,
vistolog
,
logtovis
);
if
(
!
level
||
(
!
vistolog
&&
!
logtovis
))
return
E_INVALIDARG
;
for
(
i
=
0
;
i
<
runs
;
i
++
)
{
if
(
level
[
i
]
%
2
)
{
if
(
vistolog
)
*
vistolog
++
=
j
;
if
(
logtovis
)
*
logtovis
++
=
j
;
j
--
;
}
else
{
if
(
vistolog
)
*
vistolog
++
=
k
;
if
(
logtovis
)
*
logtovis
++
=
k
;
k
++
;
}
}
return
S_OK
;
}
dlls/usp10/usp10.spec
View file @
57826074
...
...
@@ -13,7 +13,7 @@
@ stdcall ScriptIsComplex(wstr long long)
@ stdcall ScriptItemize(wstr long long ptr ptr ptr ptr)
@ stub ScriptJustify
@ st
ub ScriptLayout
@ st
dcall ScriptLayout(long ptr ptr ptr)
@ stdcall ScriptPlace(ptr ptr ptr long ptr ptr ptr ptr ptr)
@ stdcall ScriptRecordDigitSubstitution(ptr ptr)
@ stdcall ScriptShape(ptr ptr ptr long long ptr ptr ptr ptr ptr)
...
...
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