Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/oleacc/client.c | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-)
diff --git a/dlls/oleacc/client.c b/dlls/oleacc/client.c index 99be7d9fa37..afa2aa5babd 100644 --- a/dlls/oleacc/client.c +++ b/dlls/oleacc/client.c @@ -25,6 +25,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(oleacc);
+typedef struct win_class_vtbl win_class_vtbl; typedef struct { IAccessible IAccessible_iface; IOleWindow IOleWindow_iface; @@ -35,8 +36,14 @@ typedef struct { HWND hwnd; HWND enum_pos; INT role; + + const win_class_vtbl *vtbl; } Client;
+struct win_class_vtbl { + HRESULT (*get_state)(Client *, INT *); +}; + static inline Client* impl_from_Client(IAccessible *iface) { return CONTAINING_RECORD(iface, Client, IAccessible_iface); @@ -252,6 +259,10 @@ static HRESULT WINAPI Client_get_accState(IAccessible *iface, VARIANT varID, VAR V_I4(pvarState) |= STATE_SYSTEM_FOCUSED; if(!(style & WS_VISIBLE)) V_I4(pvarState) |= STATE_SYSTEM_INVISIBLE; + + if (This->vtbl && This->vtbl->get_state) + return This->vtbl->get_state(This, &V_I4(pvarState)); + return S_OK; }
@@ -652,7 +663,7 @@ static const IEnumVARIANTVtbl ClientEnumVARIANTVtbl = { };
static HRESULT create_class_object(HWND hwnd, const IID *iid, void **obj, - INT role) + INT role, const win_class_vtbl *vtbl) { Client *client; HRESULT hres; @@ -671,6 +682,7 @@ static HRESULT create_class_object(HWND hwnd, const IID *iid, void **obj, client->hwnd = hwnd; client->enum_pos = 0; client->role = role; + client->vtbl = vtbl;
hres = IAccessible_QueryInterface(&client->IAccessible_iface, iid, obj); IAccessible_Release(&client->IAccessible_iface); @@ -679,10 +691,29 @@ static HRESULT create_class_object(HWND hwnd, const IID *iid, void **obj,
HRESULT create_client_object(HWND hwnd, const IID *iid, void **obj) { - return create_class_object(hwnd, iid, obj, ROLE_SYSTEM_CLIENT); + return create_class_object(hwnd, iid, obj, ROLE_SYSTEM_CLIENT, NULL); }
+static HRESULT edit_get_state(Client *client, INT *state) +{ + LONG style; + + TRACE("(%p, %p)\n", client, state); + + style = GetWindowLongW(client->hwnd, GWL_STYLE); + if(style & ES_READONLY) + *state |= STATE_SYSTEM_READONLY; + if(style & ES_PASSWORD) + *state |= STATE_SYSTEM_PROTECTED; + + return S_OK; +} + +const win_class_vtbl edit_class_vtbl = { + edit_get_state, +}; + HRESULT create_edit_client_object(HWND hwnd, const IID *iid, void **obj) { - return create_class_object(hwnd, iid, obj, ROLE_SYSTEM_TEXT); + return create_class_object(hwnd, iid, obj, ROLE_SYSTEM_TEXT, &edit_class_vtbl); }