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
62d76348
Commit
62d76348
authored
Jun 13, 2022
by
Connor McAdams
Committed by
Alexandre Julliard
Jun 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uiautomationcore: Add basic IAccessible2 support.
Signed-off-by:
Connor McAdams
<
cmcadams@codeweavers.com
>
parent
7d5708a1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
0 deletions
+53
-0
uiautomation.c
dlls/uiautomationcore/tests/uiautomation.c
+0
-0
uia_provider.c
dlls/uiautomationcore/uia_provider.c
+53
-0
No files found.
dlls/uiautomationcore/tests/uiautomation.c
View file @
62d76348
This diff is collapsed.
Click to expand it.
dlls/uiautomationcore/uia_provider.c
View file @
62d76348
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/heap.h"
#include "initguid.h"
#include "initguid.h"
#include "wine/iaccessible2.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
uiautomation
);
WINE_DEFAULT_DEBUG_CHANNEL
(
uiautomation
);
...
@@ -54,6 +55,28 @@ static BOOL msaa_check_acc_state(IAccessible *acc, VARIANT cid, ULONG flag)
...
@@ -54,6 +55,28 @@ static BOOL msaa_check_acc_state(IAccessible *acc, VARIANT cid, ULONG flag)
return
FALSE
;
return
FALSE
;
}
}
static
IAccessible2
*
msaa_acc_get_ia2
(
IAccessible
*
acc
)
{
IServiceProvider
*
serv_prov
;
IAccessible2
*
ia2
=
NULL
;
HRESULT
hr
;
hr
=
IAccessible_QueryInterface
(
acc
,
&
IID_IServiceProvider
,
(
void
**
)
&
serv_prov
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IServiceProvider_QueryService
(
serv_prov
,
&
IID_IAccessible2
,
&
IID_IAccessible2
,
(
void
**
)
&
ia2
);
IServiceProvider_Release
(
serv_prov
);
if
(
SUCCEEDED
(
hr
)
&&
ia2
)
return
ia2
;
}
hr
=
IAccessible_QueryInterface
(
acc
,
&
IID_IAccessible2
,
(
void
**
)
&
ia2
);
if
(
SUCCEEDED
(
hr
)
&&
ia2
)
return
ia2
;
return
NULL
;
}
static
IAccessible
*
msaa_acc_da_unwrap
(
IAccessible
*
acc
)
static
IAccessible
*
msaa_acc_da_unwrap
(
IAccessible
*
acc
)
{
{
IServiceProvider
*
sp
;
IServiceProvider
*
sp
;
...
@@ -149,8 +172,10 @@ static HRESULT msaa_acc_prop_match(IAccessible *acc, IAccessible *acc2)
...
@@ -149,8 +172,10 @@ static HRESULT msaa_acc_prop_match(IAccessible *acc, IAccessible *acc2)
static
BOOL
msaa_acc_compare
(
IAccessible
*
acc
,
IAccessible
*
acc2
)
static
BOOL
msaa_acc_compare
(
IAccessible
*
acc
,
IAccessible
*
acc2
)
{
{
IAccessible2
*
ia2
[
2
]
=
{
NULL
,
NULL
};
IUnknown
*
unk
,
*
unk2
;
IUnknown
*
unk
,
*
unk2
;
BOOL
matched
=
FALSE
;
BOOL
matched
=
FALSE
;
LONG
unique_id
[
2
];
BSTR
name
[
2
];
BSTR
name
[
2
];
VARIANT
cid
;
VARIANT
cid
;
HRESULT
hr
;
HRESULT
hr
;
...
@@ -165,6 +190,26 @@ static BOOL msaa_acc_compare(IAccessible *acc, IAccessible *acc2)
...
@@ -165,6 +190,26 @@ static BOOL msaa_acc_compare(IAccessible *acc, IAccessible *acc2)
goto
exit
;
goto
exit
;
}
}
ia2
[
0
]
=
msaa_acc_get_ia2
(
acc
);
ia2
[
1
]
=
msaa_acc_get_ia2
(
acc2
);
if
(
!
ia2
[
0
]
!=
!
ia2
[
1
])
goto
exit
;
if
(
ia2
[
0
])
{
hr
=
IAccessible2_get_uniqueID
(
ia2
[
0
],
&
unique_id
[
0
]);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IAccessible2_get_uniqueID
(
ia2
[
1
],
&
unique_id
[
1
]);
if
(
SUCCEEDED
(
hr
))
{
if
(
unique_id
[
0
]
==
unique_id
[
1
])
matched
=
TRUE
;
goto
exit
;
}
}
}
hr
=
msaa_acc_prop_match
(
acc
,
acc2
);
hr
=
msaa_acc_prop_match
(
acc
,
acc2
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
goto
exit
;
goto
exit
;
...
@@ -201,6 +246,10 @@ exit:
...
@@ -201,6 +246,10 @@ exit:
IUnknown_Release
(
unk2
);
IUnknown_Release
(
unk2
);
IAccessible_Release
(
acc
);
IAccessible_Release
(
acc
);
IAccessible_Release
(
acc2
);
IAccessible_Release
(
acc2
);
if
(
ia2
[
0
])
IAccessible2_Release
(
ia2
[
0
]);
if
(
ia2
[
1
])
IAccessible2_Release
(
ia2
[
1
]);
return
matched
;
return
matched
;
}
}
...
@@ -456,6 +505,7 @@ struct msaa_provider {
...
@@ -456,6 +505,7 @@ struct msaa_provider {
LONG
refcount
;
LONG
refcount
;
IAccessible
*
acc
;
IAccessible
*
acc
;
IAccessible2
*
ia2
;
VARIANT
cid
;
VARIANT
cid
;
HWND
hwnd
;
HWND
hwnd
;
LONG
control_type
;
LONG
control_type
;
...
@@ -535,6 +585,8 @@ ULONG WINAPI msaa_provider_Release(IRawElementProviderSimple *iface)
...
@@ -535,6 +585,8 @@ ULONG WINAPI msaa_provider_Release(IRawElementProviderSimple *iface)
IAccessible_Release
(
msaa_prov
->
acc
);
IAccessible_Release
(
msaa_prov
->
acc
);
if
(
msaa_prov
->
parent
)
if
(
msaa_prov
->
parent
)
IAccessible_Release
(
msaa_prov
->
parent
);
IAccessible_Release
(
msaa_prov
->
parent
);
if
(
msaa_prov
->
ia2
)
IAccessible2_Release
(
msaa_prov
->
ia2
);
heap_free
(
msaa_prov
);
heap_free
(
msaa_prov
);
}
}
...
@@ -1069,6 +1121,7 @@ HRESULT WINAPI UiaProviderFromIAccessible(IAccessible *acc, long child_id, DWORD
...
@@ -1069,6 +1121,7 @@ HRESULT WINAPI UiaProviderFromIAccessible(IAccessible *acc, long child_id, DWORD
variant_init_i4
(
&
msaa_prov
->
cid
,
child_id
);
variant_init_i4
(
&
msaa_prov
->
cid
,
child_id
);
msaa_prov
->
acc
=
acc
;
msaa_prov
->
acc
=
acc
;
IAccessible_AddRef
(
acc
);
IAccessible_AddRef
(
acc
);
msaa_prov
->
ia2
=
msaa_acc_get_ia2
(
acc
);
*
elprov
=
&
msaa_prov
->
IRawElementProviderSimple_iface
;
*
elprov
=
&
msaa_prov
->
IRawElementProviderSimple_iface
;
return
S_OK
;
return
S_OK
;
...
...
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