From e5de42525c84af47bb591734d1897b19da915692 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Thu, 23 Sep 2021 15:25:11 +0200 Subject: [PATCH 1/3] oleacc: Reorganize class specific behaviour handling. To: wine-devel --- dlls/oleacc/client.c | 36 ++++++++++++++++ dlls/oleacc/main.c | 82 +++++------------------------------- dlls/oleacc/oleacc_private.h | 7 +++ dlls/oleacc/window.c | 9 ++++ 4 files changed, 62 insertions(+), 72 deletions(-) diff --git a/dlls/oleacc/client.c b/dlls/oleacc/client.c index 93f6b590f78..333a95dc388 100644 --- a/dlls/oleacc/client.c +++ b/dlls/oleacc/client.c @@ -19,6 +19,7 @@ #define COBJMACROS #include "oleacc_private.h" +#include "commctrl.h" #include "wine/debug.h" #include "wine/heap.h" @@ -650,6 +651,39 @@ static const IEnumVARIANTVtbl ClientEnumVARIANTVtbl = { Client_EnumVARIANT_Clone }; +static const struct win_class_data classes[] = { + {WC_LISTBOXW, 0x10000, TRUE}, + {L"#32768", 0x10001, TRUE}, /* menu */ + {WC_BUTTONW, 0x10002, TRUE}, + {WC_STATICW, 0x10003, TRUE}, + {WC_EDITW, 0x10004, TRUE}, + {WC_COMBOBOXW, 0x10005, TRUE}, + {L"#32770", 0x10006, TRUE}, /* dialog */ + {L"#32771", 0x10007, TRUE}, /* winswitcher */ + {L"MDIClient", 0x10008, TRUE}, + {L"#32769", 0x10009, TRUE}, /* desktop */ + {WC_SCROLLBARW, 0x1000a, TRUE}, + {STATUSCLASSNAMEW, 0x1000b, TRUE}, + {TOOLBARCLASSNAMEW, 0x1000c, TRUE}, + {PROGRESS_CLASSW, 0x1000d, TRUE}, + {ANIMATE_CLASSW, 0x1000e, TRUE}, + {WC_TABCONTROLW, 0x1000f, TRUE}, + {HOTKEY_CLASSW, 0x10010, TRUE}, + {WC_HEADERW, 0x10011, TRUE}, + {TRACKBAR_CLASSW, 0x10012, TRUE}, + {WC_LISTVIEWW, 0x10013, TRUE}, + {UPDOWN_CLASSW, 0x10016, TRUE}, + {TOOLTIPS_CLASSW, 0x10018, TRUE}, + {WC_TREEVIEWW, 0x10019, TRUE}, + {MONTHCAL_CLASSW, 0, TRUE}, + {DATETIMEPICK_CLASSW, 0, TRUE}, + {WC_IPADDRESSW, 0, TRUE}, + {L"RICHEDIT", 0x1001c, TRUE}, + {L"RichEdit20A", 0, TRUE}, + {L"RichEdit20W", 0, TRUE}, + {NULL} +}; + HRESULT create_client_object(HWND hwnd, const IID *iid, void **obj) { Client *client; @@ -662,6 +696,8 @@ HRESULT create_client_object(HWND hwnd, const IID *iid, void **obj) if(!client) return E_OUTOFMEMORY; + find_class_data(hwnd, classes); + client->IAccessible_iface.lpVtbl = &ClientVtbl; client->IOleWindow_iface.lpVtbl = &ClientOleWindowVtbl; client->IEnumVARIANT_iface.lpVtbl = &ClientEnumVARIANTVtbl; diff --git a/dlls/oleacc/main.c b/dlls/oleacc/main.c index db9f646988c..3ce616ae0c1 100644 --- a/dlls/oleacc/main.c +++ b/dlls/oleacc/main.c @@ -20,13 +20,6 @@ #define COBJMACROS -#include -#include "windef.h" -#include "winbase.h" -#include "ole2.h" -#include "commctrl.h" -#include "rpcproxy.h" - #include "initguid.h" #include "oleacc_private.h" #include "resource.h" @@ -37,50 +30,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(oleacc); static const WCHAR lresult_atom_prefix[] = {'w','i','n','e','_','o','l','e','a','c','c',':'}; -typedef HRESULT (*accessible_create)(HWND, const IID*, void**); - extern HRESULT WINAPI OLEACC_DllGetClassObject(REFCLSID, REFIID, void**) DECLSPEC_HIDDEN; extern BOOL WINAPI OLEACC_DllMain(HINSTANCE, DWORD, void*) DECLSPEC_HIDDEN; extern HRESULT WINAPI OLEACC_DllRegisterServer(void) DECLSPEC_HIDDEN; extern HRESULT WINAPI OLEACC_DllUnregisterServer(void) DECLSPEC_HIDDEN; -static struct { - const WCHAR *name; - DWORD idx; - accessible_create create_client; - accessible_create create_window; -} builtin_classes[] = { - {WC_LISTBOXW, 0x10000, NULL, NULL}, - {L"#32768", 0x10001, NULL, NULL}, /* menu */ - {WC_BUTTONW, 0x10002, NULL, NULL}, - {WC_STATICW, 0x10003, NULL, NULL}, - {WC_EDITW, 0x10004, NULL, NULL}, - {WC_COMBOBOXW, 0x10005, NULL, NULL}, - {L"#32770", 0x10006, NULL, NULL}, /* dialog */ - {L"#32771", 0x10007, NULL, NULL}, /* winswitcher */ - {L"MDIClient", 0x10008, NULL, NULL}, - {L"#32769", 0x10009, NULL, NULL}, /* desktop */ - {WC_SCROLLBARW, 0x1000a, NULL, NULL}, - {STATUSCLASSNAMEW, 0x1000b, NULL, NULL}, - {TOOLBARCLASSNAMEW, 0x1000c, NULL, NULL}, - {PROGRESS_CLASSW, 0x1000d, NULL, NULL}, - {ANIMATE_CLASSW, 0x1000e, NULL, NULL}, - {WC_TABCONTROLW, 0x1000f, NULL, NULL}, - {HOTKEY_CLASSW, 0x10010, NULL, NULL}, - {WC_HEADERW, 0x10011, NULL, NULL}, - {TRACKBAR_CLASSW, 0x10012, NULL, NULL}, - {WC_LISTVIEWW, 0x10013, NULL, NULL}, - {UPDOWN_CLASSW, 0x10016, NULL, NULL}, - {TOOLTIPS_CLASSW, 0x10018, NULL, NULL}, - {WC_TREEVIEWW, 0x10019, NULL, NULL}, - {MONTHCAL_CLASSW, 0, NULL, NULL}, - {DATETIMEPICK_CLASSW, 0, NULL, NULL}, - {WC_IPADDRESSW, 0, NULL, NULL}, - {L"RICHEDIT", 0x1001c, NULL, NULL}, - {L"RichEdit20A", 0, NULL, NULL}, - {L"RichEdit20W", 0, NULL, NULL}, -}; - static HINSTANCE oleacc_handle = 0; int convert_child_id(VARIANT *v) @@ -94,7 +48,7 @@ int convert_child_id(VARIANT *v) } } -static accessible_create get_builtin_accessible_obj(HWND hwnd, LONG objid) +const struct win_class_data* find_class_data(HWND hwnd, const struct win_class_data *classes) { WCHAR class_name[64]; int i, idx; @@ -103,31 +57,21 @@ static accessible_create get_builtin_accessible_obj(HWND hwnd, LONG objid) return NULL; TRACE("got window class: %s\n", debugstr_w(class_name)); - for(i=0; iIAccessible_iface.lpVtbl = &WindowVtbl; window->IOleWindow_iface.lpVtbl = &WindowOleWindowVtbl; window->IEnumVARIANT_iface.lpVtbl = &WindowEnumVARIANTVtbl; -- 2.32.0