mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-01 16:23:37 +00:00
oleacc: Implement AccessibleObjectFromEvent.
Signed-off-by: Connor McAdams <cmcadams@codeweavers.com> Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7f1cd647f6
commit
602a36a253
|
@ -331,6 +331,53 @@ HRESULT WINAPI AccessibleObjectFromPoint( POINT ptScreen, IAccessible** ppacc, V
|
|||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static void variant_init_i4( VARIANT *v, int val )
|
||||
{
|
||||
V_VT(v) = VT_I4;
|
||||
V_I4(v) = val;
|
||||
}
|
||||
|
||||
HRESULT WINAPI AccessibleObjectFromEvent( HWND hwnd, DWORD object_id, DWORD child_id,
|
||||
IAccessible **acc_out, VARIANT *child_id_out )
|
||||
{
|
||||
VARIANT child_id_variant;
|
||||
IAccessible *acc = NULL;
|
||||
IDispatch *child = NULL;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("%p %d %d %p %p\n", hwnd, object_id, child_id, acc_out, child_id_out);
|
||||
|
||||
if (!acc_out)
|
||||
return E_INVALIDARG;
|
||||
*acc_out = NULL;
|
||||
VariantInit(child_id_out);
|
||||
|
||||
hr = AccessibleObjectFromWindow(hwnd, object_id, &IID_IAccessible, (void **)&acc);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
variant_init_i4(&child_id_variant, child_id);
|
||||
hr = IAccessible_get_accChild(acc, child_id_variant, &child);
|
||||
if (FAILED(hr))
|
||||
TRACE("get_accChild failed with %#x!\n", hr);
|
||||
|
||||
if (SUCCEEDED(hr) && child)
|
||||
{
|
||||
IAccessible_Release(acc);
|
||||
hr = IDispatch_QueryInterface(child, &IID_IAccessible, (void **)&acc);
|
||||
IDispatch_Release(child);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
variant_init_i4(&child_id_variant, CHILDID_SELF);
|
||||
}
|
||||
|
||||
*acc_out = acc;
|
||||
*child_id_out = child_id_variant;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI AccessibleObjectFromWindow( HWND hwnd, DWORD dwObjectID,
|
||||
REFIID riid, void** ppvObject )
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
@ stdcall AccessibleChildren(ptr long long ptr ptr)
|
||||
@ stub AccessibleObjectFromEvent
|
||||
@ stdcall AccessibleObjectFromEvent(ptr long long ptr ptr)
|
||||
@ stdcall AccessibleObjectFromPoint(int64 ptr ptr)
|
||||
@ stdcall AccessibleObjectFromWindow(ptr long ptr ptr)
|
||||
@ stdcall CreateStdAccessibleObject(ptr long ptr ptr)
|
||||
|
|
Loading…
Reference in a new issue