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
7602ad01
Commit
7602ad01
authored
Oct 17, 2022
by
Connor McAdams
Committed by
Alexandre Julliard
Nov 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uiautomationcore: Implement ConditionType_True child navigation for HUIANODEs.
Signed-off-by:
Connor McAdams
<
cmcadams@codeweavers.com
>
parent
ef7e88ea
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
2 deletions
+66
-2
uiautomation.c
dlls/uiautomationcore/tests/uiautomation.c
+0
-0
uia_client.c
dlls/uiautomationcore/uia_client.c
+66
-2
No files found.
dlls/uiautomationcore/tests/uiautomation.c
View file @
7602ad01
This diff is collapsed.
Click to expand it.
dlls/uiautomationcore/uia_client.c
View file @
7602ad01
...
...
@@ -727,6 +727,64 @@ exit:
return
S_OK
;
}
static
HRESULT
get_child_for_node
(
struct
uia_node
*
node
,
int
start_prov_idx
,
int
nav_dir
,
VARIANT
*
out_node
)
{
int
prov_idx
=
start_prov_idx
;
HUIANODE
tmp_node
=
NULL
;
HRESULT
hr
;
VARIANT
v
;
while
((
prov_idx
>=
0
)
&&
(
prov_idx
<
node
->
prov_count
))
{
struct
uia_node
*
node_data
;
hr
=
get_navigate_from_node_provider
(
&
node
->
IWineUiaNode_iface
,
prov_idx
,
nav_dir
,
&
v
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
nav_dir
==
NavigateDirection_FirstChild
)
prov_idx
--
;
else
prov_idx
++
;
/* If we failed to get a child, try the next provider. */
hr
=
UiaHUiaNodeFromVariant
(
&
v
,
&
tmp_node
);
if
(
FAILED
(
hr
))
continue
;
node_data
=
impl_from_IWineUiaNode
((
IWineUiaNode
*
)
tmp_node
);
/* This child is the parent link of its node, so we can return it. */
if
(
node_creator_is_parent_link
(
node_data
))
break
;
/*
* If the first child provider isn't the parent link of it's HUIANODE,
* we need to check the child provider for any valid siblings.
*/
if
(
nav_dir
==
NavigateDirection_FirstChild
)
hr
=
get_sibling_from_node_provider
(
node_data
,
node_data
->
creator_prov_idx
,
NavigateDirection_NextSibling
,
&
v
);
else
hr
=
get_sibling_from_node_provider
(
node_data
,
node_data
->
creator_prov_idx
,
NavigateDirection_PreviousSibling
,
&
v
);
UiaNodeRelease
(
tmp_node
);
if
(
FAILED
(
hr
))
return
hr
;
/* If we got a valid sibling from the child provider, return it. */
hr
=
UiaHUiaNodeFromVariant
(
&
v
,
&
tmp_node
);
if
(
SUCCEEDED
(
hr
))
break
;
}
if
(
tmp_node
)
*
out_node
=
v
;
return
S_OK
;
}
static
HRESULT
navigate_uia_node
(
struct
uia_node
*
node
,
int
nav_dir
,
HUIANODE
*
out_node
)
{
HRESULT
hr
;
...
...
@@ -739,8 +797,14 @@ static HRESULT navigate_uia_node(struct uia_node *node, int nav_dir, HUIANODE *o
{
case
NavigateDirection_FirstChild
:
case
NavigateDirection_LastChild
:
FIXME
(
"Unimplemented NavigateDirection %d
\n
"
,
nav_dir
);
return
E_NOTIMPL
;
/* First child always comes from last provider index. */
if
(
nav_dir
==
NavigateDirection_FirstChild
)
hr
=
get_child_for_node
(
node
,
node
->
prov_count
-
1
,
nav_dir
,
&
v
);
else
hr
=
get_child_for_node
(
node
,
0
,
nav_dir
,
&
v
);
if
(
FAILED
(
hr
))
WARN
(
"Child navigation failed with hr %#lx
\n
"
,
hr
);
break
;
case
NavigateDirection_NextSibling
:
case
NavigateDirection_PreviousSibling
:
...
...
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