diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2013-11-18 15:41:26 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2013-11-19 10:02:27 +0000 |
commit | 448727e598ca0c35ee9cd6f2c25a847c8147943b (patch) | |
tree | 7379fabae33030487350fc58286e2aa95f5c9349 /vcl/win | |
parent | fd035fe61604042609c21aba06eb2d8ffed32dda (diff) |
uia: merge VCL pieces of IAccessible2 work.
Original code from:
Author: Steve Yin <steve_y@apache.org>
Date: Sat Nov 16 23:58:19 2013 +0100
Integrate branch of IAccessible2
With these improvements:
Make IAccessible2 an experimental feature, with fallback to Java a11y.
Move initial setup of windows into the bridge and clean, remove conditionals
Check for presence of AT in the bridge as well to clean. Merge VCL events
extensions and their handling. Clean and split WB_GETOBJECT handling out to
it's own method. Add component prefix namespacing.
Cleanup msaa service info, and implement XComponent to share mxAccessBridge.
Add suitable debugging output, remove VCL dependency from UAccCOM causing
registration issues.
Change-Id: Ib19e38ddca71182018df438df27dcdb555d91402
Diffstat (limited to 'vcl/win')
-rw-r--r-- | vcl/win/source/window/salframe.cxx | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 87e5c1a2ec92..8ee2cae0a3c4 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -77,6 +77,12 @@ using ::std::max; #include <com/sun/star/uno/Exception.hpp> +#include <oleacc.h> +#include <com/sun/star/accessibility/XMSAAService.hpp> +#ifndef WM_GETOBJECT // TESTME does this ever happen ? +# define WM_GETOBJECT 0x003D +#endif + #include <time.h> #if defined ( __MINGW32__ ) @@ -5178,7 +5184,7 @@ static sal_Bool ImplHandleIMEStartComposition( HWND hWnd ) // ----------------------------------------------------------------------- static sal_Bool ImplHandleIMECompositionInput( WinSalFrame* pFrame, - HIMC hIMC, LPARAM lParam ) + HIMC hIMC, LPARAM lParam ) { sal_Bool bDef = TRUE; @@ -5478,6 +5484,46 @@ static void ImplHandleIMENotify( HWND hWnd, WPARAM wParam ) // ----------------------------------------------------------------------- +static bool ImplHandleGetObject( HWND hWnd, LPARAM lParam, WPARAM wParam, long &nRet ) +{ + // IA2 should be enabled automatically + AllSettings aSettings = Application::GetSettings(); + MiscSettings aMisc = aSettings.GetMiscSettings(); + aMisc.SetEnableATToolSupport( sal_True ); + aSettings.SetMiscSettings( aMisc ); + Application::SetSettings( aSettings ); + + if (!Application::GetSettings().GetMiscSettings().GetEnableATToolSupport()) + return false; // locked down somehow ? + + ImplSVData* pSVData = ImplGetSVData(); + + // Make sure to launch Accessibiliity only the following criterias are satisfied + // to avoid RFT interrupts regular accessibility processing + if ( !pSVData->mxAccessBridge.is() ) + { + bool bCancelled = false; + InitAccessBridge( false, bCancelled ); + if( bCancelled ) + return false; + } + + uno::Reference< accessibility::XMSAAService > xMSAA( pSVData->mxAccessBridge, uno::UNO_QUERY ); + if ( xMSAA.is() ) + { + // mhOnSetTitleWnd not set to reasonable value anywhere... + if ( lParam == OBJID_CLIENT ) + { + nRet = xMSAA->getAccObjectPtr( (long)hWnd, lParam, wParam ); + if( nRet != 0 ) + return true; + } + } + return false; +} + +// ----------------------------------------------------------------------- + static LRESULT ImplHandleIMEReconvertString( HWND hWnd, LPARAM lParam ) { WinSalFrame* pFrame = GetWindowPtr( hWnd ); @@ -6005,6 +6051,16 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP case WM_IME_NOTIFY: ImplHandleIMENotify( hWnd, wParam ); break; + + case WM_GETOBJECT: + long nRet; + if ( ImplHandleGetObject( hWnd, lParam, wParam, nRet ) ) + { + rDef = false; + return (HRESULT) nRet; + } + break; + case WM_APPCOMMAND: if( ImplHandleAppCommand( hWnd, lParam ) ) { |