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
bb66ad44
Commit
bb66ad44
authored
Feb 03, 2023
by
Connor McAdams
Committed by
Alexandre Julliard
Feb 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uiautomationcore: Implement get_BoundingRectangle for MSAA providers.
Signed-off-by:
Connor McAdams
<
cmcadams@codeweavers.com
>
parent
2b8c8be7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
107 additions
and
2 deletions
+107
-2
uiautomation.c
dlls/uiautomationcore/tests/uiautomation.c
+79
-0
uia_provider.c
dlls/uiautomationcore/uia_provider.c
+28
-2
No files found.
dlls/uiautomationcore/tests/uiautomation.c
View file @
bb66ad44
...
...
@@ -3440,7 +3440,9 @@ static void test_UiaProviderFromIAccessible(void)
{
ILegacyIAccessibleProvider
*
accprov
;
IRawElementProviderSimple
*
elprov
,
*
elprov2
;
IRawElementProviderFragment
*
elfrag
;
enum
ProviderOptions
prov_opt
;
struct
UiaRect
rect
;
IAccessible
*
acc
;
IUnknown
*
unk
;
WNDCLASSA
cls
;
...
...
@@ -3958,6 +3960,83 @@ static void test_UiaProviderFromIAccessible(void)
IRawElementProviderSimple_Release
(
elprov
);
ok
(
Accessible
.
ref
==
1
,
"Unexpected refcnt %ld
\n
"
,
Accessible
.
ref
);
/*
* Test IRawElementProviderFragment_get_BoundingRectangle.
*/
set_accessible_props
(
&
Accessible
,
ROLE_SYSTEM_DOCUMENT
,
STATE_SYSTEM_FOCUSABLE
,
0
,
L"acc_name"
,
25
,
25
,
50
,
50
);
/* Test the case where Accessible is not the root for its HWND. */
acc_client
=
NULL
;
hr
=
pUiaProviderFromIAccessible
(
&
Accessible
.
IAccessible_iface
,
CHILDID_SELF
,
UIA_PFIA_DEFAULT
,
&
elprov
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
Accessible
.
ref
==
2
,
"Unexpected refcnt %ld
\n
"
,
Accessible
.
ref
);
hr
=
IRawElementProviderSimple_QueryInterface
(
elprov
,
&
IID_IRawElementProviderFragment
,
(
void
**
)
&
elfrag
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!!
elfrag
,
"elfrag == NULL
\n
"
);
SET_EXPECT
(
winproc_GETOBJECT_CLIENT
);
SET_EXPECT
(
Accessible_get_accRole
);
SET_EXPECT
(
Accessible_get_accState
);
SET_EXPECT
(
Accessible_accLocation
);
hr
=
IRawElementProviderFragment_get_BoundingRectangle
(
elfrag
,
&
rect
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
rect
.
left
==
(
double
)
Accessible
.
left
,
"Unexpected left value %f
\n
"
,
rect
.
left
);
ok
(
rect
.
top
==
(
double
)
Accessible
.
top
,
"Unexpected top value %f
\n
"
,
rect
.
top
);
ok
(
rect
.
width
==
(
double
)
Accessible
.
width
,
"Unexpected width value %f
\n
"
,
rect
.
width
);
ok
(
rect
.
height
==
(
double
)
Accessible
.
height
,
"Unexpected height value %f
\n
"
,
rect
.
height
);
CHECK_CALLED
(
winproc_GETOBJECT_CLIENT
);
CHECK_CALLED
(
Accessible_get_accRole
);
CHECK_CALLED
(
Accessible_get_accState
);
CHECK_CALLED
(
Accessible_accLocation
);
/* If Accessible has STATE_SYSTEM_OFFSCREEN, it will return an empty rect. */
set_accessible_props
(
&
Accessible
,
ROLE_SYSTEM_DOCUMENT
,
STATE_SYSTEM_OFFSCREEN
,
0
,
L"acc_name"
,
0
,
0
,
50
,
50
);
SET_EXPECT
(
Accessible_get_accState
);
hr
=
IRawElementProviderFragment_get_BoundingRectangle
(
elfrag
,
&
rect
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
rect
.
left
==
0
.
0
,
"Unexpected left value %f
\n
"
,
rect
.
left
);
ok
(
rect
.
top
==
0
.
0
,
"Unexpected top value %f
\n
"
,
rect
.
top
);
ok
(
rect
.
width
==
0
.
0
,
"Unexpected width value %f
\n
"
,
rect
.
width
);
ok
(
rect
.
height
==
0
.
0
,
"Unexpected height value %f
\n
"
,
rect
.
height
);
CHECK_CALLED
(
Accessible_get_accState
);
IRawElementProviderFragment_Release
(
elfrag
);
IRawElementProviderSimple_Release
(
elprov
);
ok
(
Accessible
.
ref
==
1
,
"Unexpected refcnt %ld
\n
"
,
Accessible
.
ref
);
/* Test case where accessible is the root accessible. */
set_accessible_props
(
&
Accessible
,
ROLE_SYSTEM_DOCUMENT
,
0
,
0
,
L"acc_name"
,
0
,
0
,
0
,
0
);
acc_client
=
&
Accessible
.
IAccessible_iface
;
hr
=
pUiaProviderFromIAccessible
(
&
Accessible
.
IAccessible_iface
,
CHILDID_SELF
,
UIA_PFIA_DEFAULT
,
&
elprov
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
Accessible
.
ref
==
2
,
"Unexpected refcnt %ld
\n
"
,
Accessible
.
ref
);
hr
=
IRawElementProviderSimple_QueryInterface
(
elprov
,
&
IID_IRawElementProviderFragment
,
(
void
**
)
&
elfrag
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!!
elfrag
,
"elfrag == NULL
\n
"
);
SET_EXPECT
(
winproc_GETOBJECT_CLIENT
);
hr
=
IRawElementProviderFragment_get_BoundingRectangle
(
elfrag
,
&
rect
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
rect
.
left
==
0
.
0
,
"Unexpected left value %f
\n
"
,
rect
.
left
);
ok
(
rect
.
top
==
0
.
0
,
"Unexpected top value %f
\n
"
,
rect
.
top
);
ok
(
rect
.
width
==
0
.
0
,
"Unexpected width value %f
\n
"
,
rect
.
width
);
ok
(
rect
.
height
==
0
.
0
,
"Unexpected height value %f
\n
"
,
rect
.
height
);
CHECK_CALLED
(
winproc_GETOBJECT_CLIENT
);
/* Second call does nothing. */
hr
=
IRawElementProviderFragment_get_BoundingRectangle
(
elfrag
,
&
rect
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
rect
.
left
==
0
.
0
,
"Unexpected left value %f
\n
"
,
rect
.
left
);
ok
(
rect
.
top
==
0
.
0
,
"Unexpected top value %f
\n
"
,
rect
.
top
);
ok
(
rect
.
width
==
0
.
0
,
"Unexpected width value %f
\n
"
,
rect
.
width
);
ok
(
rect
.
height
==
0
.
0
,
"Unexpected height value %f
\n
"
,
rect
.
height
);
IRawElementProviderFragment_Release
(
elfrag
);
IRawElementProviderSimple_Release
(
elprov
);
ok
(
Accessible
.
ref
==
1
,
"Unexpected refcnt %ld
\n
"
,
Accessible
.
ref
);
acc_client
=
NULL
;
test_uia_prov_from_acc_properties
();
test_uia_prov_from_acc_navigation
();
test_uia_prov_from_acc_ia2
();
...
...
dlls/uiautomationcore/uia_provider.c
View file @
bb66ad44
...
...
@@ -868,8 +868,34 @@ static HRESULT WINAPI msaa_fragment_GetRuntimeId(IRawElementProviderFragment *if
static
HRESULT
WINAPI
msaa_fragment_get_BoundingRectangle
(
IRawElementProviderFragment
*
iface
,
struct
UiaRect
*
ret_val
)
{
FIXME
(
"%p, %p: stub!
\n
"
,
iface
,
ret_val
);
return
E_NOTIMPL
;
struct
msaa_provider
*
msaa_prov
=
impl_from_msaa_fragment
(
iface
);
LONG
left
,
top
,
width
,
height
;
HRESULT
hr
;
TRACE
(
"%p, %p
\n
"
,
iface
,
ret_val
);
memset
(
ret_val
,
0
,
sizeof
(
*
ret_val
));
/*
* If this IAccessible is at the root of its HWND, the BaseHwnd provider
* will supply the bounding rectangle.
*/
if
(
msaa_check_root_acc
(
msaa_prov
))
return
S_OK
;
if
(
msaa_check_acc_state
(
msaa_prov
->
acc
,
msaa_prov
->
cid
,
STATE_SYSTEM_OFFSCREEN
))
return
S_OK
;
hr
=
IAccessible_accLocation
(
msaa_prov
->
acc
,
&
left
,
&
top
,
&
width
,
&
height
,
msaa_prov
->
cid
);
if
(
FAILED
(
hr
))
return
hr
;
ret_val
->
left
=
left
;
ret_val
->
top
=
top
;
ret_val
->
width
=
width
;
ret_val
->
height
=
height
;
return
S_OK
;
}
static
HRESULT
WINAPI
msaa_fragment_GetEmbeddedFragmentRoots
(
IRawElementProviderFragment
*
iface
,
...
...
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