You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ja...@apache.org on 2013/11/28 13:54:23 UTC
svn commit: r1546358 [9/9] - in /openoffice/branches/capstone2013/main:
vcl/inc/win/ winaccessibility/source/UAccCOM/
winaccessibility/source/UAccCOMIDL/ winaccessibility/source/service/
Added: openoffice/branches/capstone2013/main/winaccessibility/source/service/AccParagraphEventListener.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/winaccessibility/source/service/AccParagraphEventListener.cxx?rev=1546358&view=auto
==============================================================================
--- openoffice/branches/capstone2013/main/winaccessibility/source/service/AccParagraphEventListener.cxx (added)
+++ openoffice/branches/capstone2013/main/winaccessibility/source/service/AccParagraphEventListener.cxx Thu Nov 28 12:54:21 2013
@@ -0,0 +1,145 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
+
+#include "AccParagraphEventListener.hxx"
+#include "AccObjectManagerAgent.hxx"
+#include "unomsaaevent.hxx"
+
+using namespace com::sun::star::uno;
+using namespace com::sun::star::accessibility;
+
+AccParagraphEventListener::AccParagraphEventListener(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent)
+ :AccContainerEventListener(pAcc, Agent)
+{}
+AccParagraphEventListener::~AccParagraphEventListener()
+{
+}
+
+/**
+ * Uno's event notifier when event is captured
+ * @param AccessibleEventObject the event object which contains information about event
+ */
+void AccParagraphEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
+throw (::com::sun::star::uno::RuntimeException)
+{
+ switch (aEvent.EventId)
+ {
+ case AccessibleEventId::CARET_CHANGED:
+ handleCaretChangedEvent(aEvent.OldValue, aEvent.NewValue);
+ break;
+ case AccessibleEventId::VISIBLE_DATA_CHANGED:
+ handleVisibleDataChangedEvent();
+ break;
+ case AccessibleEventId::BOUNDRECT_CHANGED:
+ handleBoundrectChangedEvent();
+ break;
+ //Added for paragraph selected state.
+ case AccessibleEventId::STATE_CHANGED:
+ {
+ short State;
+ if( (aEvent.NewValue >>= State) && (State == AccessibleStateType::SELECTED) )
+ {
+ pAgent->IncreaseState( pAccessible, State);
+ break;
+ }
+ else if( (aEvent.OldValue >>= State) && (State == AccessibleStateType::SELECTED) )
+ {
+ pAgent->DecreaseState( pAccessible, State);
+ break;
+ }
+
+ AccContainerEventListener::notifyEvent(aEvent);
+ break;
+ }
+
+ case AccessibleEventId::TEXT_SELECTION_CHANGED:
+ handleTextSelectionChangedEvent();
+ break;
+
+ default:
+ AccContainerEventListener::notifyEvent(aEvent);
+ break;
+ }
+}
+
+/**
+ * handle the CARET_CHANGED event
+ * @param oldValue in UNO, this parameter is always NULL
+ * @param newValue in UNO, this parameter is always NULL
+ */
+void AccParagraphEventListener::handleCaretChangedEvent(Any oldValue, Any newValue)
+{
+ pAgent->UpdateLocation(pAccessible);
+ pAgent->NotifyAccEvent(UM_EVENT_OBJECT_CARETCHANGE, pAccessible);
+}
+
+/**
+ * handle the VISIBLE_DATA_CHANGED event
+ */
+void AccParagraphEventListener::handleVisibleDataChangedEvent()
+{
+ AccEventListener::handleVisibleDataChangedEvent();
+}
+
+/**
+ * handle the BOUNDRECT_CHANGED event
+ */
+void AccParagraphEventListener::handleBoundrectChangedEvent()
+{
+ AccEventListener::handleBoundrectChangedEvent();
+}
+
+/**
+ * set the new state and fire the MSAA event
+ * @param state new state id
+ * @param enable true if state is set, false if state is unset
+ */
+void AccParagraphEventListener::setComponentState(short state, bool enable )
+{
+ // only the following state can be fired state event.
+ switch (state)
+ {
+ case AccessibleStateType::EDITABLE:
+ // no msaa state
+ break;
+ case AccessibleStateType::MULTI_LINE:
+ // no msaa state mapping
+ break;
+ case AccessibleStateType::SINGLE_LINE:
+ // no msaa state mapping
+ break;
+ default:
+ AccContainerEventListener::setComponentState(state, enable);
+ break;
+ }
+}
+
+void AccParagraphEventListener::handleTextSelectionChangedEvent()
+{
+ pAgent->NotifyAccEvent(UM_EVENT_TEXT_SELECTION_CHANGED, pAccessible);
+}
+
Propchange: openoffice/branches/capstone2013/main/winaccessibility/source/service/AccParagraphEventListener.cxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/capstone2013/main/winaccessibility/source/service/AccResource.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/winaccessibility/source/service/AccResource.cxx?rev=1546358&view=auto
==============================================================================
--- openoffice/branches/capstone2013/main/winaccessibility/source/service/AccResource.cxx (added)
+++ openoffice/branches/capstone2013/main/winaccessibility/source/service/AccResource.cxx Thu Nov 28 12:54:21 2013
@@ -0,0 +1,85 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "AccResource.hxx"
+
+#include <tools/simplerm.hxx>
+
+// ---- needed as long as we have no contexts for components ---
+#include <vcl/svapp.hxx>
+
+//2009.04. Comment the following code because the acc resource is not necessary now. Can open them if necessary
+//#ifndef _TOOLS_INTN_HXX
+//#include <tools/intn.hxx>
+//#endif
+//#ifndef _SOLAR_HRC
+//#include <svtools/solar.hrc>
+//#endif
+
+//.........................................................................
+
+//==================================================================
+//= ResourceManager
+//==================================================================
+SimpleResMgr* ResourceManager::m_pImpl = NULL;
+
+//------------------------------------------------------------------
+ResourceManager::EnsureDelete::~EnsureDelete()
+{
+ delete ResourceManager::m_pImpl;
+}
+
+//------------------------------------------------------------------
+void ResourceManager::ensureImplExists()
+{
+ //Comment the following code because the acc resource is not necessary now. Can open them if necessary
+ /*
+ if (m_pImpl)
+ return;
+
+ LanguageType nType = Application::GetSettings().GetUILanguage();
+
+ ByteString sFileName("winaccessibility");
+ sFileName += ByteString::CreateFromInt32( (sal_Int32)SOLARUPD );
+
+ m_pImpl = SimpleResMgr::Create(sFileName.GetBuffer(), nType);
+
+ if (m_pImpl)
+ {
+ // no that we have a impl class make sure it's deleted on unloading the library
+ static ResourceManager::EnsureDelete s_aDeleteTheImplClas;
+ }
+ */
+}
+
+//------------------------------------------------------------------
+::rtl::OUString ResourceManager::loadString(sal_uInt16 _nResId)
+{
+ ::rtl::OUString sReturn;
+
+ ensureImplExists();
+ if (m_pImpl)
+ sReturn = m_pImpl->ReadString(_nResId);
+
+ return sReturn;
+}
+
+
Propchange: openoffice/branches/capstone2013/main/winaccessibility/source/service/AccResource.cxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTableEventListener.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTableEventListener.cxx?rev=1546358&view=auto
==============================================================================
--- openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTableEventListener.cxx (added)
+++ openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTableEventListener.cxx Thu Nov 28 12:54:21 2013
@@ -0,0 +1,146 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
+#include <com/sun/star/accessibility/AccessibleTableModelChange.hpp>
+
+#include "AccTableEventListener.hxx"
+#include "AccObjectManagerAgent.hxx"
+#include "unomsaaevent.hxx"
+
+using namespace com::sun::star::uno;
+using namespace com::sun::star::accessibility;
+
+AccTableEventListener::AccTableEventListener(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent)
+ :AccDescendantManagerEventListener(pAcc, Agent)
+{}
+AccTableEventListener::~AccTableEventListener()
+{
+}
+
+/**
+ * Uno's event notifier when event is captured
+ * @param AccessibleEventObject the event object which contains information about event
+ */
+void AccTableEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
+throw (::com::sun::star::uno::RuntimeException)
+{
+ switch (aEvent.EventId)
+ {
+ case AccessibleEventId::ACTIVE_DESCENDANT_CHANGED:
+ handleActiveDescendantChangedEvent(aEvent.OldValue, aEvent.NewValue);
+ break;
+
+ case AccessibleEventId::TABLE_CAPTION_CHANGED:
+ {
+
+ pAgent->NotifyAccEvent(UM_EVENT_TABLE_CAPTION_CHANGED, pAccessible);
+ break;
+ }
+ case AccessibleEventId::TABLE_COLUMN_DESCRIPTION_CHANGED:
+ {
+
+ pAgent->NotifyAccEvent(UM_EVENT_TABLE_COLUMN_DESCRIPTION_CHANGED, pAccessible);
+ break;
+ }
+ case AccessibleEventId::TABLE_COLUMN_HEADER_CHANGED:
+ {
+
+ pAgent->NotifyAccEvent(UM_EVENT_TABLE_COLUMN_HEADER_CHANGED, pAccessible);
+ break;
+ }
+ case AccessibleEventId::TABLE_ROW_HEADER_CHANGED:
+ {
+
+ pAgent->NotifyAccEvent(UM_EVENT_TABLE_ROW_HEADER_CHANGED, pAccessible);
+ break;
+ }
+ case AccessibleEventId::TABLE_MODEL_CHANGED:
+ {
+
+ handleTableModelChangeEvent(aEvent.NewValue);
+ break;
+ }
+ case AccessibleEventId::TABLE_SUMMARY_CHANGED:
+ {
+
+ pAgent->NotifyAccEvent(UM_EVENT_TABLE_SUMMARY_CHANGED, pAccessible);
+ break;
+ }
+ case AccessibleEventId::TABLE_ROW_DESCRIPTION_CHANGED:
+ {
+
+ pAgent->NotifyAccEvent(UM_EVENT_TABLE_ROW_DESCRIPTION_CHANGED, pAccessible);
+ break;
+ }
+ default:
+ AccDescendantManagerEventListener::notifyEvent(aEvent);
+ break;
+ }
+}
+
+/**
+ * handle the ACTIVE_DESCENDANT_CHANGED event
+ * @param oldValue the child to lose active
+ * @param newValue the child to get active
+ */
+void AccTableEventListener::handleActiveDescendantChangedEvent(Any oldValue, Any newValue)
+{
+ Reference< XAccessible > xChild;
+ if(newValue >>= xChild )
+ {
+ if(xChild.is())
+ {
+ XAccessible* pAcc = xChild.get();
+ pAgent->InsertAccObj(pAcc,pAccessible);
+ pAgent->NotifyAccEvent(UM_EVENT_ACTIVE_DESCENDANT_CHANGED, pAcc);
+ }
+ }
+ else if (oldValue >>= xChild)
+ {
+ //delete an existing child
+ if(xChild.is())
+ {
+ XAccessible* pAcc = xChild.get();
+ pAgent->DeleteAccObj( pAcc );
+ }
+ }
+
+}
+void AccTableEventListener::handleTableModelChangeEvent(Any newValue)
+{
+ AccessibleTableModelChange aModelChange;
+ if (newValue >>= aModelChange)
+ {
+ if( pAccessible )
+ {
+ //delete all oldValue's existing children
+ pAgent->DeleteChildrenAccObj( pAccessible );
+ //add all oldValue's existing children
+ pAgent->InsertChildrenAccObj( pAccessible );
+ }
+ pAgent->NotifyAccEvent(UM_EVENT_TABLE_MODEL_CHANGED, pAccessible);
+ }
+}
Propchange: openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTableEventListener.cxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTextComponentEventListener.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTextComponentEventListener.cxx?rev=1546358&view=auto
==============================================================================
--- openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTextComponentEventListener.cxx (added)
+++ openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTextComponentEventListener.cxx Thu Nov 28 12:54:21 2013
@@ -0,0 +1,65 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
+
+#include "AccTextComponentEventListener.hxx"
+#include "AccObjectManagerAgent.hxx"
+#include "unomsaaevent.hxx"
+
+using namespace com::sun::star::uno;
+using namespace com::sun::star::accessibility;
+
+AccTextComponentEventListener::AccTextComponentEventListener(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent)
+ :AccComponentEventListener(pAcc, Agent)
+{}
+AccTextComponentEventListener::~AccTextComponentEventListener()
+{
+}
+
+/**
+ * set the new state and fire the MSAA event
+ * @param state new state id
+ * @param enable true if state is set, false if state is unset
+ */
+void AccTextComponentEventListener::setComponentState(short state, bool enable )
+{
+ // only the following state can be fired state event.
+ switch (state)
+ {
+ case AccessibleStateType::EDITABLE:
+ // no msaa state mapping
+ break;
+ case AccessibleStateType::MULTI_LINE:
+ // no msaa state mapping
+ break;
+ case AccessibleStateType::SINGLE_LINE:
+ // no msaa state mapping
+ break;
+ default:
+ AccComponentEventListener::setComponentState(state, enable);
+ break;
+ }
+}
Propchange: openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTextComponentEventListener.cxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTopWindowListener.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTopWindowListener.cxx?rev=1546358&view=auto
==============================================================================
--- openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTopWindowListener.cxx (added)
+++ openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTopWindowListener.cxx Thu Nov 28 12:54:21 2013
@@ -0,0 +1,321 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include <cppuhelper/bootstrap.hxx>
+#include <com/sun/star/bridge/XUnoUrlResolver.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <vcl/window.hxx>
+#include <toolkit/awt/Vclxwindow.hxx>
+
+#ifndef _SV_SYSDATA_HXX
+#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
+#include <vcl/sysdata.hxx>
+#endif
+
+#include "AccTopWindowListener.hxx"
+#include "unomsaaevent.hxx"
+
+#include <com/sun/star/awt/XExtendedToolkit.hpp>
+#include <com/sun/star/uno/XInterface.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventListener.hpp>
+#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+
+using namespace com::sun::star::uno;
+using namespace com::sun::star::lang;
+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()
+{
+ if( g_pTop )
+ {
+ g_pTop->release();
+ g_pTop = NULL;
+ }
+}
+
+/**
+ * As a global method to invoke the handleWindowOpened() method
+ */
+void handleWindowOpened_impl(long pAcc)
+{
+ if( g_pTop && pAcc != NULL )
+ g_pTop->handleWindowOpened( (com::sun::star::accessibility::XAccessible*)((void*)pAcc) );
+}
+
+/**
+ * For the new opened window, generate all the UNO accessible's object, COM object and add
+ * accessible listener to monitor all these objects.
+ * @param pAccessible the accessible of the new opened window
+ */
+void AccTopWindowListener::handleWindowOpened( com::sun::star::accessibility::XAccessible* pAccessible )
+{
+ //get SystemData from window
+ VCLXWindow* pvclwindow = (VCLXWindow*)pAccessible;
+ Window* window = pvclwindow->GetWindow();
+ // The SalFrame of window may be destructed at this time
+ const SystemEnvData* systemdata = NULL;
+ try
+ {
+ systemdata = window->GetSystemData();
+ }
+ catch(...)
+ {
+ systemdata = NULL;
+ }
+ 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((HWND)systemdata->hWnd, pAccessible);
+
+ AddAllListeners(pAccessible,NULL,(HWND)systemdata->hWnd);
+
+ if( window->GetStyle() & WB_MOVEABLE )
+ accManagerAgent.IncreaseState( pAccessible, -1 /* U_MOVEBLE */ );
+
+ short role = pAccessibleContext->getAccessibleRole();
+
+
+ if (role == com::sun::star::accessibility::AccessibleRole::POPUP_MENU ||
+ role == com::sun::star::accessibility::AccessibleRole::MENU )
+ {
+ accManagerAgent.NotifyAccEvent(UM_EVENT_MENUPOPUPSTART, pAccessible);
+ }
+
+ if (role == com::sun::star::accessibility::AccessibleRole::FRAME ||
+ role == com::sun::star::accessibility::AccessibleRole::DIALOG ||
+ role == com::sun::star::accessibility::AccessibleRole::WINDOW ||
+ role == com::sun::star::accessibility::AccessibleRole::ALERT)
+ {
+ accManagerAgent.NotifyAccEvent(UM_EVENT_SHOW, pAccessible);
+ }
+ }
+}
+
+AccTopWindowListener::AccTopWindowListener():
+ accManagerAgent(),
+ m_refcount(1)
+{
+}
+
+AccTopWindowListener::~AccTopWindowListener()
+{
+}
+
+/**
+ * It is invoked when a new window is opened, the source of this EventObject is the window
+ */
+void AccTopWindowListener::windowOpened( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException)
+{
+ 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;
+ }
+
+ handleWindowOpened(pAccessible);
+
+}
+
+/**
+ * Add the accessible event listener to object and all its children objects.
+ * @param pAccessible the accessible object
+ * @param pParentXAcc the parent of current accessible object
+ * @param pWND the handle of top window which current object resides
+ */
+void AccTopWindowListener::AddAllListeners(com::sun::star::accessibility::XAccessible* pAccessible, com::sun::star::accessibility::XAccessible* pParentXAcc, HWND pWND)
+{
+ Reference<com::sun::star::accessibility::XAccessibleContext> xContext(pAccessible->getAccessibleContext(),UNO_QUERY);
+ if(!xContext.is())
+ {
+ return;
+ }
+ com::sun::star::accessibility::XAccessibleContext* pAccessibleContext = xContext.get();
+ if(pAccessibleContext == NULL)
+ {
+ return;
+ }
+
+ accManagerAgent.InsertAccObj( pAccessible, pParentXAcc,pWND );
+
+ if (!accManagerAgent.IsContainer(pAccessible))
+ {
+ return;
+ }
+
+
+ short role = pAccessibleContext->getAccessibleRole();
+ if(com::sun::star::accessibility::AccessibleRole::DOCUMENT == role )
+ {
+ if(accManagerAgent.IsStateManageDescendant(pAccessible))
+ {
+ return ;
+ }
+ }
+
+
+ int count = pAccessibleContext->getAccessibleChildCount();
+ for (int i=0;i<count;i++)
+ {
+ Reference<com::sun::star::accessibility::XAccessible> mxAccessible
+ = pAccessibleContext->getAccessibleChild(i);
+
+ com::sun::star::accessibility::XAccessible* mpAccessible = mxAccessible.get();
+ if(mpAccessible != NULL)
+ {
+ Reference<com::sun::star::accessibility::XAccessibleContext> mxAccessibleContext
+ = 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);
+ }
+ }
+ }
+}
+
+void AccTopWindowListener::windowClosing( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException)
+{
+}
+
+/**
+ * Invoke this method when the top window is closed, remove all the objects and its children
+ * from current manager's cache, and remove the COM object and the accessible event listener
+ * assigned to the accessible objects.
+ */
+void AccTopWindowListener::windowClosed( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException)
+{
+ 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();
+ const SystemEnvData* systemdata=window->GetSystemData();
+
+ Reference<com::sun::star::accessibility::XAccessibleContext> xContext(pAccessible->getAccessibleContext(),UNO_QUERY);
+ if(!xContext.is())
+ {
+ return;
+ }
+ com::sun::star::accessibility::XAccessibleContext* pAccessibleContext = xContext.get();
+
+ short role = -1;
+ if(pAccessibleContext != NULL)
+ {
+ role = pAccessibleContext->getAccessibleRole();
+
+ if (role == com::sun::star::accessibility::AccessibleRole::POPUP_MENU ||
+ role == com::sun::star::accessibility::AccessibleRole::MENU)
+ {
+ accManagerAgent.NotifyAccEvent(UM_EVENT_MENUPOPUPEND, pAccessible);
+ }
+ }
+
+
+ accManagerAgent.DeleteChildrenAccObj( pAccessible );
+ if( role != com::sun::star::accessibility::AccessibleRole::POPUP_MENU )
+ accManagerAgent.DeleteAccObj( pAccessible );
+
+}
+
+void AccTopWindowListener::windowMinimized( const ::com::sun::star::lang::EventObject& ) throw (::com::sun::star::uno::RuntimeException)
+{
+}
+
+void AccTopWindowListener::windowNormalized( const ::com::sun::star::lang::EventObject& ) throw (::com::sun::star::uno::RuntimeException)
+{
+}
+
+void AccTopWindowListener::windowActivated( const ::com::sun::star::lang::EventObject& ) throw (::com::sun::star::uno::RuntimeException)
+{
+}
+
+void AccTopWindowListener::windowDeactivated( const ::com::sun::star::lang::EventObject& ) throw (::com::sun::star::uno::RuntimeException)
+{
+}
+
+void AccTopWindowListener::disposing( const ::com::sun::star::lang::EventObject& ) throw (::com::sun::star::uno::RuntimeException)
+{
+}
+
+//need to investigate further
+::com::sun::star::uno::Any SAL_CALL AccTopWindowListener::queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException)
+{
+ if (aType.equals( ::getCppuType( (Reference< com::sun::star::awt::XTopWindowListener> const *)0 ) ))
+ {
+ Reference< com::sun::star::awt::XTopWindowListener> xTopListener( static_cast< com::sun::star::awt::XTopWindowListener* >(this));
+ return makeAny(xTopListener);
+ }
+ return Any();
+}
+
+void AccTopWindowListener::acquire( ) throw ()
+{
+ ::osl_incrementInterlockedCount( &m_refcount );
+}
+
+void AccTopWindowListener::release() throw ()
+{
+ // thread-safe decrementation of reference count
+ if (0 == ::osl_decrementInterlockedCount( &m_refcount ))
+ {
+ delete this; // shutdown this object
+ }
+}
Propchange: openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTopWindowListener.cxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTreeEventListener.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTreeEventListener.cxx?rev=1546358&view=auto
==============================================================================
--- openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTreeEventListener.cxx (added)
+++ openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTreeEventListener.cxx Thu Nov 28 12:54:21 2013
@@ -0,0 +1,87 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
+
+#include "AccTreeEventListener.hxx"
+#include "AccObjectManagerAgent.hxx"
+#include "unomsaaevent.hxx"
+
+using namespace com::sun::star::uno;
+using namespace com::sun::star::accessibility;
+
+AccTreeEventListener::AccTreeEventListener(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent)
+ :AccDescendantManagerEventListener(pAcc, Agent)
+{}
+AccTreeEventListener::~AccTreeEventListener()
+{
+}
+
+/**
+ * Uno's event notifier when event is captured
+ * @param AccessibleEventObject the event object which contains information about event
+ */
+void AccTreeEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException)
+{
+ switch (aEvent.EventId)
+ {
+ case AccessibleEventId::ACTIVE_DESCENDANT_CHANGED:
+ handleActiveDescendantChangedEvent(aEvent.OldValue, aEvent.NewValue);
+ break;
+ default:
+ AccDescendantManagerEventListener::notifyEvent(aEvent);
+ break;
+ }
+}
+
+/**
+ * handle the ACTIVE_DESCENDANT_CHANGED event
+ * @param oldValue the child to lose active
+ * @param newValue the child to get active
+ */
+void AccTreeEventListener::handleActiveDescendantChangedEvent(Any oldValue, Any newValue)
+{
+ Reference< XAccessible > xChild;
+ if(newValue >>= xChild )
+ {
+ if(xChild.is())
+ {
+ XAccessible* pAcc = xChild.get();
+ pAgent->InsertAccObj(pAcc,pAccessible);
+ pAgent->NotifyAccEvent(UM_EVENT_ACTIVE_DESCENDANT_CHANGED, pAcc);
+ pActiveDescendant = pAcc;
+ }
+ }
+ if (oldValue >>= xChild)
+ {
+ //delete an existing child
+ if(xChild.is())
+ {
+ XAccessible* pAcc = xChild.get();
+ pAgent->DeleteAccObj( pAcc );
+ }
+ }
+
+}
Propchange: openoffice/branches/capstone2013/main/winaccessibility/source/service/AccTreeEventListener.cxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/capstone2013/main/winaccessibility/source/service/AccWindowEventListener.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/winaccessibility/source/service/AccWindowEventListener.cxx?rev=1546358&view=auto
==============================================================================
--- openoffice/branches/capstone2013/main/winaccessibility/source/service/AccWindowEventListener.cxx (added)
+++ openoffice/branches/capstone2013/main/winaccessibility/source/service/AccWindowEventListener.cxx Thu Nov 28 12:54:21 2013
@@ -0,0 +1,152 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
+
+#include "AccWindowEventListener.hxx"
+#include "AccObjectManagerAgent.hxx"
+#include "unomsaaevent.hxx"
+
+using namespace com::sun::star::uno;
+using namespace com::sun::star::accessibility;
+
+AccWindowEventListener::AccWindowEventListener(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent)
+ :AccEventListener(pAcc, Agent)
+{}
+AccWindowEventListener::~AccWindowEventListener()
+{
+}
+
+/**
+ * Uno's event notifier when event is captured
+ * @param AccessibleEventObject: the event object which contains information about event
+ */
+void AccWindowEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException)
+{
+ switch (aEvent.EventId)
+ {
+ case AccessibleEventId::CHILD:
+ handleChildChangedEvent(aEvent.OldValue, aEvent.NewValue);
+ break;
+ case AccessibleEventId::VISIBLE_DATA_CHANGED:
+ handleVisibleDataChangedEvent();
+ break;
+ case AccessibleEventId::BOUNDRECT_CHANGED:
+ handleBoundrectChangedEvent();
+ break;
+ default:
+ AccEventListener::notifyEvent(aEvent);
+ break;
+ }
+}
+
+/**
+ * handle the VISIBLE_DATA_CHANGED event
+ */
+void AccWindowEventListener::handleVisibleDataChangedEvent()
+{
+ AccEventListener::handleVisibleDataChangedEvent();
+}
+
+/**
+ * handle the BOUNDRECT_CHANGED event
+ */
+void AccWindowEventListener::handleBoundrectChangedEvent()
+{
+ AccEventListener::handleBoundrectChangedEvent();
+}
+
+/**
+ * handle the CHILD event
+ * @param oldValue the child to be deleted
+ * @param newValue the child to be added
+ */
+void AccWindowEventListener::handleChildChangedEvent(Any oldValue, Any newValue)
+{
+ Reference< XAccessible > xChild;
+ if( newValue >>= xChild)
+ {
+ //create a new child
+ if(xChild.is())
+ {
+ XAccessible* pAcc = xChild.get();
+ //add this child
+ pAgent->InsertAccObj( pAcc,pAccessible);
+ //add all oldValue's existing children
+ pAgent->InsertChildrenAccObj(pAcc);
+ pAgent->NotifyAccEvent(UM_EVENT_CHILD_ADDED, pAcc);
+ }
+ else
+ {}
+ }
+ else if (oldValue >>= xChild)
+ {
+ //delete a existing child
+ if(xChild.is())
+ {
+ XAccessible* pAcc = xChild.get();
+ pAgent->NotifyAccEvent(UM_EVENT_CHILD_REMOVED, pAcc);
+ pAgent->DeleteChildrenAccObj( pAcc );
+ //delete this child
+ pAgent->DeleteAccObj( pAcc );
+ }
+ else
+ {}
+ }
+}
+
+/**
+ * set the new state and fire the MSAA event
+ * @param state new state id
+ * @param enable true if state is set, false if state is unset
+ */
+void AccWindowEventListener::setComponentState(short state, bool enable )
+{
+ // only the following state can be fired state event.
+ switch (state)
+ {
+ case AccessibleStateType::ICONIFIED:
+ // no msaa state
+ break;
+ case AccessibleStateType::VISIBLE:
+ // UNO !VISIBLE == MSAA INVISIBLE
+ if( enable )
+ pAgent->IncreaseState( pAccessible, AccessibleStateType::VISIBLE );
+ else
+ pAgent->DecreaseState( pAccessible, AccessibleStateType::VISIBLE );
+ break;
+ case AccessibleStateType::SHOWING:
+ // UNO !SHOWING == MSAA OFFSCREEN
+ if( enable )
+ {
+ pAgent->IncreaseState( pAccessible, AccessibleStateType::SHOWING );
+ }
+ else
+ pAgent->DecreaseState( pAccessible, AccessibleStateType::SHOWING );
+ break;
+ default:
+ break;
+ }
+}
Propchange: openoffice/branches/capstone2013/main/winaccessibility/source/service/AccWindowEventListener.cxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/capstone2013/main/winaccessibility/source/service/ResIDGenerator.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/winaccessibility/source/service/ResIDGenerator.cxx?rev=1546358&view=auto
==============================================================================
--- openoffice/branches/capstone2013/main/winaccessibility/source/service/ResIDGenerator.cxx (added)
+++ openoffice/branches/capstone2013/main/winaccessibility/source/service/ResIDGenerator.cxx Thu Nov 28 12:54:21 2013
@@ -0,0 +1,54 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "ResIDGenerator.hxx"
+
+/**
+ * Destructor
+ *
+ * @param
+ * @return
+ */
+ResIDGenerator::~ResIDGenerator()
+{
+}
+
+/**
+ * SubList stores those IDs that were ever generated and deleted, the method
+ * return the ID from subList first if subList is not empty,else return ++max.
+ * Add the obsolete IDs by calling SetSub method
+ *
+ * @param
+ * @return new resource ID.
+ */
+long ResIDGenerator::GenerateNewResID()
+{
+ if (max == LONG_MAX)
+ {
+ if (!subList.empty())
+ {
+ long nRes = *(subList.begin());
+ subList.pop_front();
+ return nRes;
+ }
+ }
+ return -(++max);
+}
Propchange: openoffice/branches/capstone2013/main/winaccessibility/source/service/ResIDGenerator.cxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/capstone2013/main/winaccessibility/source/service/checkmt.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/winaccessibility/source/service/checkmt.cxx?rev=1546358&view=auto
==============================================================================
--- openoffice/branches/capstone2013/main/winaccessibility/source/service/checkmt.cxx (added)
+++ openoffice/branches/capstone2013/main/winaccessibility/source/service/checkmt.cxx Thu Nov 28 12:54:21 2013
@@ -0,0 +1,36 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "checkmt.hxx"
+#include <vcl/svapp.hxx>
+
+bool IsInMainThread()
+{
+ if( Application::GetMainThreadIdentifier() == ::vos::OThread::getCurrentIdentifier())
+ return true;
+ else
+ return false;
+}
+
+vos::IMutex& GetSolarMutex()
+{
+ return Application::GetSolarMutex();
+}
Propchange: openoffice/branches/capstone2013/main/winaccessibility/source/service/checkmt.cxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/capstone2013/main/winaccessibility/source/service/checkmt.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/winaccessibility/source/service/checkmt.hxx?rev=1546358&view=auto
==============================================================================
--- openoffice/branches/capstone2013/main/winaccessibility/source/service/checkmt.hxx (added)
+++ openoffice/branches/capstone2013/main/winaccessibility/source/service/checkmt.hxx Thu Nov 28 12:54:21 2013
@@ -0,0 +1,28 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#pragma once
+
+#include <vos/mutex.hxx>
+
+bool IsInMainThread();
+
+vos::IMutex& GetSolarMutex();
Propchange: openoffice/branches/capstone2013/main/winaccessibility/source/service/checkmt.hxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/capstone2013/main/winaccessibility/source/service/exports.dxp
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/winaccessibility/source/service/exports.dxp?rev=1546358&view=auto
==============================================================================
--- openoffice/branches/capstone2013/main/winaccessibility/source/service/exports.dxp (added)
+++ openoffice/branches/capstone2013/main/winaccessibility/source/service/exports.dxp Thu Nov 28 12:54:21 2013
@@ -0,0 +1,2 @@
+component_getImplementationEnvironment
+component_getFactory
Propchange: openoffice/branches/capstone2013/main/winaccessibility/source/service/exports.dxp
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/capstone2013/main/winaccessibility/source/service/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/winaccessibility/source/service/makefile.mk?rev=1546358&view=auto
==============================================================================
--- openoffice/branches/capstone2013/main/winaccessibility/source/service/makefile.mk (added)
+++ openoffice/branches/capstone2013/main/winaccessibility/source/service/makefile.mk Thu Nov 28 12:54:21 2013
@@ -0,0 +1,118 @@
+#**************************************************************
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#**************************************************************
+
+.IF "$(GUI)"=="WNT"
+PRJ=..$/..
+PRJNAME=winaccessibility
+TARGET=winaccessibility
+LIBTARGET=NO
+USE_DEFFILE=TRUE
+ENABLE_EXCEPTIONS=TRUE
+VERSIONOBJ=
+AUTOSEG=true
+NO_BSYMBOLIC= TRUE
+
+# output directory (one dir for each project)
+UNOUCROUT=$(OUT)$/inc
+# adding to inludepath
+INCPRE+=$(UNOUCROUT)
+INCPRE+=$(MISC)
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Files --------------------------------------------------------
+SLOFILES= $(SLO)$/AccObject.obj \
+ $(SLO)$/ResIDGenerator.obj \
+ $(SLO)$/AccObjectWinManager.obj \
+ $(SLO)$/AccObjectManagerAgent.obj \
+ $(SLO)$/AccEventListener.obj \
+ $(SLO)$/AccComponentEventListener.obj \
+ $(SLO)$/AccContainerEventListener.obj \
+ $(SLO)$/AccDialogEventListener.obj \
+ $(SLO)$/AccFrameEventListener.obj \
+ $(SLO)$/AccWindowEventListener.obj \
+ $(SLO)$/AccMenuEventListener.obj \
+ $(SLO)$/AccTextComponentEventListener.obj \
+ $(SLO)$/AccObjectContainerEventListener.obj \
+ $(SLO)$/AccParagraphEventListener.obj \
+ $(SLO)$/AccDescendantManagerEventListener.obj \
+ $(SLO)$/AccListEventListener.obj \
+ $(SLO)$/AccTableEventListener.obj \
+ $(SLO)$/AccTreeEventListener.obj \
+ $(SLO)$/AccTopWindowListener.obj \
+ $(SLO)$/msaaservice_impl.obj \
+ $(SLO)$/checkmt.obj \
+ $(SLO)$/AccResource.obj
+
+#SRCFILES=winaccessibility.src
+#RES1FILELIST=$(SRS)$/winaccessibility.srs
+#RESLIB1NAME=$(TARGET)
+#RESLIB1SRSFILES=$(RES1FILELIST)
+
+SHL1TARGET=winaccessibility
+SHL1IMPLIB=i$(SHL1TARGET)
+SHL1STDLIBS=\
+ $(VCLLIB) \
+ $(CPPULIB) \
+ $(SALLIB) \
+ $(CPPUHELPERLIB) \
+ $(TOOLSLIB) \
+ $(TKLIB) \
+ $(VOSLIB) \
+ $(UWINAPILIB) \
+ $(GDI32LIB) \
+ $(WINSPOOLLIB) \
+ $(OLE32LIB) \
+ $(SHELL32LIB) \
+ $(ADVAPI32LIB) \
+ $(IMM32LIB) \
+ $(UUIDLIB) \
+ oleacc.lib
+
+SHL1OBJS=$(SLOFILES)
+SHL1VERSIONOBJ=
+SHL1DESCRIPTIONOBJ=
+
+DEF1NAME=$(SHL1TARGET)
+DEF1EXPORTFILE=exports.dxp
+
+
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
+ALLTAR : \
+ $(MISC)/winaccessibility.component
+
+.IF "$(OS)" == "WNT"
+my_platform = .windows
+.END
+
+$(MISC)/winaccessibility.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt winaccessibility.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt winaccessibility.component
+
+
+.ENDIF # "$(GUI)"=="WNT"
Propchange: openoffice/branches/capstone2013/main/winaccessibility/source/service/makefile.mk
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/capstone2013/main/winaccessibility/source/service/msaaservice_impl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/winaccessibility/source/service/msaaservice_impl.cxx?rev=1546358&view=auto
==============================================================================
--- openoffice/branches/capstone2013/main/winaccessibility/source/service/msaaservice_impl.cxx (added)
+++ openoffice/branches/capstone2013/main/winaccessibility/source/service/msaaservice_impl.cxx Thu Nov 28 12:54:21 2013
@@ -0,0 +1,289 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/factory.hxx>
+#include <cppuhelper/implementationentry.hxx>
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/accessibility/XMSAAService.hpp>
+
+#include <com/sun/star/awt/XExtendedToolkit.hpp>
+#include <vcl/svapp.hxx>
+
+using namespace ::rtl; // for OUString
+using namespace ::com::sun::star; // for odk interfaces
+using namespace ::com::sun::star::uno; // for basic types
+using namespace ::com::sun::star::accessibility;
+
+using namespace ::com::sun::star::awt;
+
+typedef sal_Int32 HWND;
+
+#include "AccTopWindowListener.hxx"
+#include "g_msacc.hxx"
+
+extern void FreeTopWindowListener();
+extern long GetMSComPtr(long hWnd, long lParam, long wParam);
+extern void handleWindowOpened_impl( long pAcc);
+
+
+namespace my_sc_impl
+{
+
+extern Sequence< OUString > SAL_CALL getSupportedServiceNames_MSAAServiceImpl();
+extern OUString SAL_CALL getImplementationName_MSAAServiceImpl();
+extern Reference< XInterface > SAL_CALL create_MSAAServiceImpl(
+ Reference< XComponentContext > const & xContext )
+ SAL_THROW( () );
+/**
+ * Method that returns the service name.
+ * @param
+ * @return Name sequence.
+ */
+static Sequence< OUString > getSupportedServiceNames_MSAAServiceImpl()
+{
+ static Sequence < OUString > *pNames = 0;
+ if( ! pNames )
+ {
+ // MutexGuard guard( Mutex::getGlobalMutex() );
+ if( !pNames )
+ {
+ static Sequence< OUString > seqNames(1);
+ seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.accessibility.MSAAService"));
+ pNames = &seqNames;
+ }
+ }
+ return *pNames;
+}
+
+/**
+ * Method that returns the service name.
+ * @param
+ * @return Name sequence.
+ */
+static OUString getImplementationName_MSAAServiceImpl()
+{
+ static OUString *pImplName = 0;
+ if( ! pImplName )
+ {
+ // MutexGuard guard( Mutex::getGlobalMutex() );
+ if( ! pImplName )
+ {
+ static OUString implName( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.accessibility.my_sc_implementation.MSAAService") );
+ pImplName = &implName;
+ }
+ }
+ return *pImplName;
+}
+
+class MSAAServiceImpl : public ::cppu::WeakImplHelper3<
+ XMSAAService, lang::XServiceInfo, lang::XInitialization >
+{
+ OUString m_arg;
+public:
+ // focus on three given interfaces,
+ // no need to implement XInterface, XTypeProvider, XWeak
+ MSAAServiceImpl ();
+ virtual ~MSAAServiceImpl( void );
+ // XInitialization will be called upon createInstanceWithArguments[AndContext]()
+ virtual void SAL_CALL initialize( Sequence< Any > const & args )
+ throw (Exception);
+ // XMSAAService
+ virtual sal_Int32 SAL_CALL getAccObjectPtr (long hWnd, long lParam, long wParam)
+ throw (RuntimeException);
+ virtual void SAL_CALL handleWindowOpened(sal_Int32)
+ throw (RuntimeException);
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName()
+ throw (RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( OUString const & serviceName )
+ throw (RuntimeException);
+ virtual Sequence< OUString > SAL_CALL getSupportedServiceNames()
+ throw (RuntimeException);
+};
+
+/**
+ * Implemention of XInitialization.
+ * @param
+ * @return.
+ */
+void MSAAServiceImpl::initialize( Sequence< Any > const & args ) throw (Exception)
+{
+ if (1 != args.getLength())
+ {
+ throw lang::IllegalArgumentException(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("give a string instanciating this component!") ),
+ (::cppu::OWeakObject *)this, // resolve to XInterface reference
+ 0 ); // argument pos
+ }
+ if (! (args[ 0 ] >>= m_arg))
+ {
+ throw lang::IllegalArgumentException(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("no string given as argument!") ),
+ (::cppu::OWeakObject *)this, // resolve to XInterface reference
+ 0 ); // argument pos
+ }
+}
+
+/**
+ * Implemention of getAccObjectPtr.
+ * @param
+ * @return Com interface.
+ */
+sal_Int32 MSAAServiceImpl::getAccObjectPtr ( long hWnd, long lParam, long wParam) throw (RuntimeException)
+{
+ return GetMSComPtr(hWnd, lParam, wParam);
+}
+
+/**
+ * Implemention of handleWindowOpened,the method will be invoked when a top window
+ * opened and AT starts up.
+ * @param
+ * @return
+ */
+void MSAAServiceImpl::handleWindowOpened( sal_Int32 pAcc)
+{
+ handleWindowOpened_impl(pAcc);
+}
+
+/**
+ * Implemention of XServiceInfo.
+ * @param
+ * @return Implementataion name.
+ */
+OUString MSAAServiceImpl::getImplementationName() throw (RuntimeException)
+{
+ // unique implementation name
+ return OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.accessibility.my_sc_impl.MSAAService") );
+}
+
+/**
+ * Implemention of XServiceInfo,return support service name.
+ * @param Service name.
+ * @return If the service name is supported.
+ */
+sal_Bool MSAAServiceImpl::supportsService( OUString const & serviceName ) throw (RuntimeException)
+{
+ // this object only supports one service, so the test is simple
+ return serviceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.accessibility.MSAAService") );
+}
+
+/**
+ * Implemention of XServiceInfo,return all service names.
+ * @param.
+ * @return service name sequence.
+ */
+Sequence< OUString > MSAAServiceImpl::getSupportedServiceNames() throw (RuntimeException)
+{
+ return getSupportedServiceNames_MSAAServiceImpl();
+}
+
+/**
+ * Static method that can create an entity of our MSAA Service
+ * @param xContext No use here.
+ * @return The object interface.
+ */
+Reference< XInterface > SAL_CALL create_MSAAServiceImpl( Reference< XComponentContext > const & /*xContext*/ ) SAL_THROW( () )
+{
+ MSAAServiceImpl* xxx = new MSAAServiceImpl();
+ //return static_cast< lang::XTypeProvider * >( xxx );
+ Reference< XMSAAService > p( xxx );
+ return p;
+}
+
+/**
+ * Constructor.
+ * @param
+ * @return
+ */
+MSAAServiceImpl::MSAAServiceImpl()
+{
+ Reference< XExtendedToolkit > xToolkit =
+ Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY);
+
+ if(xToolkit.is())
+ {
+ AccTopWindowListener *accListener;
+ accListener = new AccTopWindowListener();
+ g_pTop = accListener;
+ Reference< XTopWindowListener> x(accListener);
+ xToolkit->addTopWindowListener(x);
+ }
+}
+
+/**
+ * Static method that can create an entity of our MSAA Service
+ * @param Destructor
+ * @return
+ */
+MSAAServiceImpl::~MSAAServiceImpl()
+{
+
+ // As all folders and streams contain references to their parents,
+ // we must remove these references so that they will be deleted when
+ // the hash_map of the root folder is cleared, releasing all subfolders
+ // and substreams which in turn release theirs, etc. When xRootFolder is
+ // released when this destructor completes, the folder tree should be
+ // deleted fully (and automagically).
+ FreeTopWindowListener();
+
+
+}
+
+}
+
+/* shared lib exports implemented without helpers in service_impl1.cxx */
+namespace my_sc_impl
+{
+static struct ::cppu::ImplementationEntry s_component_entries [] =
+ {
+ {
+ create_MSAAServiceImpl, getImplementationName_MSAAServiceImpl,
+ getSupportedServiceNames_MSAAServiceImpl, ::cppu::createSingleComponentFactory,
+ 0, 0
+ },
+ {
+ create_MSAAServiceImpl, getImplementationName_MSAAServiceImpl,
+ getSupportedServiceNames_MSAAServiceImpl, ::cppu::createSingleComponentFactory,
+ 0, 0
+ },
+ { 0, 0, 0, 0, 0, 0 }
+ };
+}
+
+extern "C"
+{
+ void SAL_CALL component_getImplementationEnvironment(
+ sal_Char const ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
+ {
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+ }
+ void * SAL_CALL component_getFactory(
+ sal_Char const * implName, lang::XMultiServiceFactory * xMgr,
+ registry::XRegistryKey * xRegistry )
+ {
+ return ::cppu::component_getFactoryHelper(
+ implName, xMgr, xRegistry, ::my_sc_impl::s_component_entries );
+ }
+}
Propchange: openoffice/branches/capstone2013/main/winaccessibility/source/service/msaaservice_impl.cxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/capstone2013/main/winaccessibility/source/service/winaccessibility.component
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/winaccessibility/source/service/winaccessibility.component?rev=1546358&view=auto
==============================================================================
Binary file - no diff available.
Propchange: openoffice/branches/capstone2013/main/winaccessibility/source/service/winaccessibility.component
------------------------------------------------------------------------------
svn:executable = *
Propchange: openoffice/branches/capstone2013/main/winaccessibility/source/service/winaccessibility.component
------------------------------------------------------------------------------
svn:mime-type = application/xml