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
588c5a90
Commit
588c5a90
authored
Sep 15, 2007
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Sep 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi: Implement implicit resolving in BiDi.
parent
032543e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
bidi.c
dlls/gdi32/bidi.c
+47
-0
No files found.
dlls/gdi32/bidi.c
View file @
588c5a90
...
@@ -770,6 +770,50 @@ static void resolveNeutrals(int baselevel, WORD *pcls, const WORD *plevel, int c
...
@@ -770,6 +770,50 @@ static void resolveNeutrals(int baselevel, WORD *pcls, const WORD *plevel, int c
SetDeferredRun
(
pcls
,
cchRun
,
ich
,
clsRun
);
SetDeferredRun
(
pcls
,
cchRun
,
ich
,
clsRun
);
}
}
/* RESOLVE IMPLICIT */
/*------------------------------------------------------------------------
Function: resolveImplicit
Recursively resolves implicit embedding levels.
Implements rules I1 and I2 of the Unicode Bidirectional Algorithm.
Input: Array of direction classes
Character count
Base level
In/Out: Array of embedding levels
Note: levels may exceed 15 on output.
Accepted subset of direction classes
R, L, AN, EN
------------------------------------------------------------------------*/
static
const
WORD
addLevel
[][
4
]
=
{
/* L, R, AN, EN */
/* even */
{
0
,
1
,
2
,
2
,
},
/* odd */
{
1
,
0
,
1
,
1
,
}
};
static
void
resolveImplicit
(
const
WORD
*
pcls
,
WORD
*
plevel
,
int
cch
)
{
int
ich
=
0
;
for
(;
ich
<
cch
;
ich
++
)
{
/* cannot resolve bn here, since some bn were resolved to strong
* types in resolveWeak. To remove these we need the original
* types, which are available again in resolveWhiteSpace */
if
(
pcls
[
ich
]
==
BN
)
{
continue
;
}
ASSERT
(
pcls
[
ich
]
>
0
);
/* "No Neutrals allowed to survive here." */
ASSERT
(
pcls
[
ich
]
<
5
);
/* "Out of range." */
plevel
[
ich
]
+=
addLevel
[
odd
(
plevel
[
ich
])][
pcls
[
ich
]
-
1
];
}
}
/*************************************************************
/*************************************************************
* BIDI_Reorder
* BIDI_Reorder
*/
*/
...
@@ -868,6 +912,9 @@ BOOL BIDI_Reorder(
...
@@ -868,6 +912,9 @@ BOOL BIDI_Reorder(
/* resolve neutrals */
/* resolve neutrals */
resolveNeutrals
(
baselevel
,
chartype
,
levels
,
i
);
resolveNeutrals
(
baselevel
,
chartype
,
levels
,
i
);
/* resolveImplicit */
resolveImplicit
(
chartype
,
levels
,
i
);
/* Temporary stub: Just reverse the odd levels */
/* Temporary stub: Just reverse the odd levels */
for
(
j
=
lastgood
=
0
;
j
<
i
;
++
j
)
for
(
j
=
lastgood
=
0
;
j
<
i
;
++
j
)
if
(
levels
[
j
]
!=
levels
[
lastgood
])
if
(
levels
[
j
]
!=
levels
[
lastgood
])
...
...
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