summaryrefslogtreecommitdiff
path: root/winaccessibility/source/service/AccTopWindowListener.cxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2013-11-18 15:41:26 +0000
committerMichael Meeks <michael.meeks@collabora.com>2013-11-19 00:01:36 +0000
commita78df2821277fc1e3a2929b7da960817cece17be (patch)
treee372b89d1aff59eb9ce30131698d43486126476e /winaccessibility/source/service/AccTopWindowListener.cxx
parent51931f68763a51ac119b56342cbb3d17571bfdb8 (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 'winaccessibility/source/service/AccTopWindowListener.cxx')
-rwxr-xr-xwinaccessibility/source/service/AccTopWindowListener.cxx48
1 files changed, 13 insertions, 35 deletions
diff --git a/winaccessibility/source/service/AccTopWindowListener.cxx b/winaccessibility/source/service/AccTopWindowListener.cxx
index 28d2b7930ead..5c55cbd3b2a1 100755
--- a/winaccessibility/source/service/AccTopWindowListener.cxx
+++ b/winaccessibility/source/service/AccTopWindowListener.cxx
@@ -23,17 +23,6 @@
#include <vcl/window.hxx>
#include <toolkit/awt/Vclxwindow.hxx>
-//#ifndef _SV_SYSDATA_HXX
-#if 0
-#if defined( WIN ) || defined( WNT ) || defined( OS2 )
-typedef sal_Int32 HWND;
-typedef sal_Int32 HMENU;
-typedef sal_Int32 HDC;
-typedef void *PVOID;
-typedef PVOID HANDLE;
-typedef HANDLE HFONT;
-#endif
-#endif
#include <vcl/sysdata.hxx>
#include "AccTopWindowListener.hxx"
@@ -53,11 +42,9 @@ using namespace com::sun::star::bridge;
using namespace com::sun::star::awt;
using namespace rtl;
using namespace cppu;
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
AccTopWindowListener* g_pTop = NULL;
+
//when proccess exit, call FreeTopWindowListener() in svmain
void FreeTopWindowListener()
{
@@ -73,7 +60,7 @@ void FreeTopWindowListener()
*/
void handleWindowOpened_impl(long pAcc)
{
- if( g_pTop && pAcc != NULL )
+ if( g_pTop && pAcc != 0 )
g_pTop->handleWindowOpened( (com::sun::star::accessibility::XAccessible*)((void*)pAcc) );
}
@@ -99,14 +86,13 @@ void AccTopWindowListener::handleWindowOpened( com::sun::star::accessibility::XA
}
Reference<com::sun::star::accessibility::XAccessibleContext> xContext(pAccessible->getAccessibleContext(),UNO_QUERY);
if(!xContext.is())
- {
return;
- }
+
com::sun::star::accessibility::XAccessibleContext* pAccessibleContext = xContext.get();
//Only AccessibleContext exist, add all listeners
if(pAccessibleContext != NULL && systemdata != NULL)
{
- accManagerAgent.SaveTopWindowHandle((long)(HWND)systemdata->hWnd, pAccessible);
+ accManagerAgent.SaveTopWindowHandle((long)(HWND)systemdata->hWnd, pAccessible);
AddAllListeners(pAccessible,NULL,(HWND)systemdata->hWnd);
@@ -115,7 +101,6 @@ void AccTopWindowListener::handleWindowOpened( com::sun::star::accessibility::XA
short role = pAccessibleContext->getAccessibleRole();
-
if (role == com::sun::star::accessibility::AccessibleRole::POPUP_MENU ||
role == com::sun::star::accessibility::AccessibleRole::MENU )
{
@@ -147,20 +132,17 @@ AccTopWindowListener::~AccTopWindowListener()
*/
void AccTopWindowListener::windowOpened( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException)
{
+ SAL_INFO( "iacc2", "windowOpened triggered" );
+
if ( !e.Source.is())
- {
return;
- }
Reference< com::sun::star::accessibility::XAccessible > xAccessible ( e.Source, UNO_QUERY );
com::sun::star::accessibility::XAccessible* pAccessible = xAccessible.get();
- if ( pAccessible == NULL)
- {
+ if ( !pAccessible )
return;
- }
-
- handleWindowOpened(pAccessible);
+ handleWindowOpened( pAccessible );
}
/**
@@ -213,16 +195,14 @@ void AccTopWindowListener::AddAllListeners(com::sun::star::accessibility::XAcces
= mpAccessible->getAccessibleContext();
com::sun::star::accessibility::XAccessibleContext* mpContext = mxAccessibleContext.get();
if(mpContext != NULL)
- {
- //fprintf(output, "go on add child's children event listener\n");
- AddAllListeners(mpAccessible,pAccessible,pWND);
- }
+ AddAllListeners( mpAccessible, pAccessible, pWND);
}
}
}
void AccTopWindowListener::windowClosing( const ::com::sun::star::lang::EventObject& ) throw (::com::sun::star::uno::RuntimeException)
{
+ SAL_INFO( "iacc2", "windowClosing triggered" );
}
/**
@@ -232,17 +212,15 @@ void AccTopWindowListener::windowClosing( const ::com::sun::star::lang::EventObj
*/
void AccTopWindowListener::windowClosed( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException)
{
+ SAL_INFO( "iacc2", "windowClosed triggered" );
+
if ( !e.Source.is())
- {
return;
- }
+
Reference< com::sun::star::accessibility::XAccessible > xAccessible ( e.Source, UNO_QUERY );
com::sun::star::accessibility::XAccessible* pAccessible = xAccessible.get();
if ( pAccessible == NULL)
- {
return;
- }
-
VCLXWindow* pvclwindow = (VCLXWindow*)pAccessible;
Window* window = pvclwindow->GetWindow();