This is an automated email from the ASF dual-hosted git repository. damjan pushed a commit to branch windows-amd64 in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 1a3e085a5d8dd98130f9986ce05a96232f54c559 Author: Damjan Jovanovic <dam...@apache.org> AuthorDate: Mon Jan 20 18:20:18 2025 +0200 Windows/amd64 compatibility fixes for winaccessibility. Patch by: me --- .../com/sun/star/accessibility/XMSAAService.idl | 4 +- main/vcl/source/app/svdata.cxx | 2 +- main/vcl/win/source/window/salframe.cxx | 4 +- .../winaccessibility/inc/AccObjectManagerAgent.hxx | 10 +- main/winaccessibility/inc/AccObjectWinManager.hxx | 10 +- main/winaccessibility/source/UAccCOM/AccAction.cpp | 8 +- main/winaccessibility/source/UAccCOM/AccAction.h | 10 +- .../source/UAccCOM/AccActionBase.cpp | 2 +- .../source/UAccCOM/AccActionBase.h | 6 +- .../source/UAccCOM/AccComponent.cpp | 6 +- .../winaccessibility/source/UAccCOM/AccComponent.h | 8 +- .../source/UAccCOM/AccComponentBase.cpp | 6 +- .../source/UAccCOM/AccComponentBase.h | 6 +- .../source/UAccCOM/AccEditableText.cpp | 6 +- .../source/UAccCOM/AccEditableText.h | 8 +- .../source/UAccCOM/AccHyperLink.cpp | 8 +- .../winaccessibility/source/UAccCOM/AccHyperLink.h | 10 +- .../source/UAccCOM/AccHypertext.cpp | 8 +- .../winaccessibility/source/UAccCOM/AccHypertext.h | 8 +- main/winaccessibility/source/UAccCOM/AccImage.cpp | 6 +- main/winaccessibility/source/UAccCOM/AccImage.h | 8 +- .../source/UAccCOM/AccRelation.cpp | 10 +- main/winaccessibility/source/UAccCOM/AccRelation.h | 6 +- main/winaccessibility/source/UAccCOM/AccTable.cpp | 16 +- main/winaccessibility/source/UAccCOM/AccTable.h | 8 +- main/winaccessibility/source/UAccCOM/AccText.cpp | 6 +- main/winaccessibility/source/UAccCOM/AccText.h | 8 +- .../source/UAccCOM/AccTextBase.cpp | 2 +- main/winaccessibility/source/UAccCOM/AccTextBase.h | 6 +- main/winaccessibility/source/UAccCOM/AccValue.cpp | 6 +- main/winaccessibility/source/UAccCOM/AccValue.h | 8 +- .../source/UAccCOM/EnumVariant.cpp | 12 +- main/winaccessibility/source/UAccCOM/EnumVariant.h | 6 +- .../source/UAccCOM/MAccessible.cpp | 34 +- main/winaccessibility/source/UAccCOM/MAccessible.h | 12 +- main/winaccessibility/source/UAccCOM/UNOXWrapper.h | 14 +- .../winaccessibility/source/UAccCOMIDL/UAccCOM.idl | 22 +- .../source/service/AccEventListener.cxx | 6 +- .../source/service/AccFrameEventListener.cxx | 18 +- main/winaccessibility/source/service/AccObject.cxx | 8 +- .../source/service/AccObjectManagerAgent.cxx | 14 +- .../source/service/AccObjectWinManager.cxx | 19 +- .../source/service/AccTopWindowListener.cxx | 604 ++++++++++----------- .../source/service/msaaservice_impl.cxx | 28 +- 44 files changed, 508 insertions(+), 509 deletions(-) diff --git a/main/offapi/com/sun/star/accessibility/XMSAAService.idl b/main/offapi/com/sun/star/accessibility/XMSAAService.idl index 6cb14b4b0a..9a2282cc06 100644 --- a/main/offapi/com/sun/star/accessibility/XMSAAService.idl +++ b/main/offapi/com/sun/star/accessibility/XMSAAService.idl @@ -39,9 +39,9 @@ interface XMSAAService : ::com::sun::star::uno::XInterface @see AccessibleContext */ - long getAccObjectPtr ([in] long hWnd, [in] long lParam, [in] long wParam); + hyper getAccObjectPtr ([in] hyper hWnd, [in] hyper lParam, [in] hyper wParam); - [oneway] void handleWindowOpened ([in] long i); + [oneway] void handleWindowOpened ([in] hyper i); }; }; }; }; }; diff --git a/main/vcl/source/app/svdata.cxx b/main/vcl/source/app/svdata.cxx index 534032cb70..6d26eab82f 100644 --- a/main/vcl/source/app/svdata.cxx +++ b/main/vcl/source/app/svdata.cxx @@ -412,7 +412,7 @@ void AccessBridgehandleExistingWindow(Window * pWindow, bool bShow) if ( xAccessible.is() && g_acc_manager1 ) { - g_acc_manager1->handleWindowOpened( (long)(xAccessible.get())); + g_acc_manager1->handleWindowOpened( (sal_Int64)(xAccessible.get())); } } } diff --git a/main/vcl/win/source/window/salframe.cxx b/main/vcl/win/source/window/salframe.cxx index d86a16c401..ee6190bb29 100644 --- a/main/vcl/win/source/window/salframe.cxx +++ b/main/vcl/win/source/window/salframe.cxx @@ -6232,11 +6232,11 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP */ if ( (lParam == OBJID_CLIENT ) /* && !bSkipSetTitleClient */ ) { - long RetResult = g_acc_manager1->getAccObjectPtr((long)hWnd, lParam, wParam); + sal_Int64 RetResult = g_acc_manager1->getAccObjectPtr((sal_Int64)hWnd, lParam, (sal_Int64)wParam); if(RetResult != 0) { rDef = FALSE; - return (HRESULT)RetResult; + return (LRESULT)RetResult; } } } diff --git a/main/winaccessibility/inc/AccObjectManagerAgent.hxx b/main/winaccessibility/inc/AccObjectManagerAgent.hxx index 0a9741e8c5..6b1d818baa 100644 --- a/main/winaccessibility/inc/AccObjectManagerAgent.hxx +++ b/main/winaccessibility/inc/AccObjectManagerAgent.hxx @@ -17,10 +17,10 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ + *************************************************************/ #ifndef __ACCOBJECTMANAGERAGENT_HXX -#define __ACCOBJECTMANAGERAGENT_HXX +#define __ACCOBJECTMANAGERAGENT_HXX #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_HPP_ #include <com/sun/star/accessibility/XAccessible.hpp> @@ -48,7 +48,7 @@ public: virtual unsigned char InsertAccObj( com::sun::star::accessibility::XAccessible* pXAcc, com::sun::star::accessibility::XAccessible* pParentXAcc, - long pWnd=0); + void* pWnd=0); virtual void GetIAccessibleFromResID(long childID,IMAccessible**); virtual unsigned char GetIAccessibleFromXAccessible(com::sun::star::accessibility::XAccessible* pXAcc, IAccessible** ppIA); @@ -58,7 +58,7 @@ public: unsigned char NotifyAccEvent( short pEvent = 0, com::sun::star::accessibility::XAccessible* pXAcc = 0 ); unsigned char InsertChildrenAccObj( com::sun::star::accessibility::XAccessible* pXAcc, - long pWnd=0); + void* pWnd=0); void DeleteChildrenAccObj( com::sun::star::accessibility::XAccessible* pXAcc ); void DecreaseState( com::sun::star::accessibility::XAccessible* pXAcc,unsigned short pState ); @@ -85,7 +85,7 @@ public: short GetParentRole(com::sun::star::accessibility::XAccessible* pXAcc ); unsigned short IsContainer(com::sun::star::accessibility::XAccessible* pXAcc); - void SaveTopWindowHandle(long hWnd, com::sun::star::accessibility::XAccessible* pXAcc); + void SaveTopWindowHandle(void* hwnd, com::sun::star::accessibility::XAccessible* pXAcc); void UpdateChildState(com::sun::star::accessibility::XAccessible* pXAcc); diff --git a/main/winaccessibility/inc/AccObjectWinManager.hxx b/main/winaccessibility/inc/AccObjectWinManager.hxx index 3ae13c79f7..c7071ca8a9 100644 --- a/main/winaccessibility/inc/AccObjectWinManager.hxx +++ b/main/winaccessibility/inc/AccObjectWinManager.hxx @@ -54,14 +54,14 @@ private: { bool operator()(const void* s1, const void* s2) const { - return long(s1)<long(s2); + return LONG_PTR(s1)<LONG_PTR(s2); } }; struct ltstr2 { bool operator()(const HWND s1, const HWND s2) const { - return long(s1)<long(s2); + return LONG_PTR(s1)<LONG_PTR(s2); } }; struct ltstr3 @@ -75,7 +75,7 @@ private: typedef std::map< HWND,void*,ltstr2 > XHWNDToXAccHash; typedef std::map< const long, AccObject*,ltstr3 > XResIdToAccObjHash; - typedef std::map< const long, com::sun::star::accessibility::XAccessible*,ltstr3 > XHWNDToDocumentHash; + typedef std::map< HWND, com::sun::star::accessibility::XAccessible*,ltstr2 > XHWNDToDocumentHash; //XAccessible to AccObject @@ -109,7 +109,7 @@ private: AccObject* GetTopWindowAccObj(HWND hWnd); - com::sun::star::accessibility::XAccessible* GetAccDocByHWND( long pWnd ); + com::sun::star::accessibility::XAccessible* GetAccDocByHWND( HWND pWnd ); void DeleteAccListener( AccObject* pAccObj ); void InsertAccChildNode(AccObject* pCurObj,AccObject* pParentObj,HWND pWnd); @@ -129,7 +129,7 @@ public: sal_Bool NotifyAccEvent( com::sun::star::accessibility::XAccessible* pXAcc,short state = 0 ); - long Get_ToATInterface( HWND hWnd, long lParam, long wParam); + LRESULT Get_ToATInterface( HWND hWnd, LPARAM lParam, WPARAM wParam); void DecreaseState( com::sun::star::accessibility::XAccessible* pXAcc,unsigned short pState ); void IncreaseState( com::sun::star::accessibility::XAccessible* pXAcc,unsigned short pState ); diff --git a/main/winaccessibility/source/UAccCOM/AccAction.cpp b/main/winaccessibility/source/UAccCOM/AccAction.cpp index aa0a32f35d..8b5e1366c2 100644 --- a/main/winaccessibility/source/UAccCOM/AccAction.cpp +++ b/main/winaccessibility/source/UAccCOM/AccAction.cpp @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + /** * AccAction.cpp : Implementation of CAccAction */ @@ -100,7 +100,7 @@ STDMETHODIMP CAccAction::get_keyBinding( * * @param pXInterface the pointer of UNO interface. */ -STDMETHODIMP CAccAction::put_XInterface(long pXInterface) +STDMETHODIMP CAccAction::put_XInterface(LONG_PTR pXInterface) { return CAccActionBase::put_XInterface(pXInterface); @@ -110,7 +110,7 @@ STDMETHODIMP CAccAction::put_XInterface(long pXInterface) * @param pXSubInterface XAccessibleHyperlink interface. * @return Result. */ -STDMETHODIMP CAccAction::put_XSubInterface(long pXSubInterface) +STDMETHODIMP CAccAction::put_XSubInterface(LONG_PTR pXSubInterface) { diff --git a/main/winaccessibility/source/UAccCOM/AccAction.h b/main/winaccessibility/source/UAccCOM/AccAction.h index b98e7d5139..74fc4f690b 100644 --- a/main/winaccessibility/source/UAccCOM/AccAction.h +++ b/main/winaccessibility/source/UAccCOM/AccAction.h @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #ifndef __ACCACTION_H_ #define __ACCACTION_H_ @@ -53,7 +53,7 @@ public: END_COM_MAP() static HRESULT WINAPI _SmartQI(void* pv, - REFIID iid, void** ppvObject, DWORD) + REFIID iid, void** ppvObject, DWORD_PTR) { return ((CAccAction*)pv)->SmartQI(iid,ppvObject); } @@ -95,10 +95,10 @@ public: /* [retval][out] */ long __RPC_FAR *nBinding); // Overide of IUNOXWrapper. - STDMETHOD(put_XInterface)(long pXInterface); + STDMETHOD(put_XInterface)(LONG_PTR pXInterface); // Overide of IUNOXWrapper. - STDMETHOD(put_XSubInterface)(long pXSubInterface); + STDMETHOD(put_XSubInterface)(LONG_PTR pXSubInterface); }; diff --git a/main/winaccessibility/source/UAccCOM/AccActionBase.cpp b/main/winaccessibility/source/UAccCOM/AccActionBase.cpp index 4079e77a98..74d702ff27 100644 --- a/main/winaccessibility/source/UAccCOM/AccActionBase.cpp +++ b/main/winaccessibility/source/UAccCOM/AccActionBase.cpp @@ -250,7 +250,7 @@ STDMETHODIMP CAccActionBase::get_keyBinding( * * @param pXInterface the pointer of UNO interface. */ -STDMETHODIMP CAccActionBase::put_XInterface(long pXInterface) +STDMETHODIMP CAccActionBase::put_XInterface(LONG_PTR pXInterface) { diff --git a/main/winaccessibility/source/UAccCOM/AccActionBase.h b/main/winaccessibility/source/UAccCOM/AccActionBase.h index 986a9dccfe..ddfa8094e6 100644 --- a/main/winaccessibility/source/UAccCOM/AccActionBase.h +++ b/main/winaccessibility/source/UAccCOM/AccActionBase.h @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + ////////////////////////////////////////////////////////////////////// // AccActionBase.h: interface for the CAccActionBase class. ////////////////////////////////////////////////////////////////////// @@ -72,7 +72,7 @@ public: /* [retval][out] */ long __RPC_FAR *nBinding); // Overide of IUNOXWrapper. - STDMETHOD(put_XInterface)(long pXInterface); + STDMETHOD(put_XInterface)(LONG_PTR pXInterface); static void GetkeyBindingStrByXkeyBinding( const com::sun::star::uno::Sequence< com::sun::star::awt::KeyStroke > &keySet, OLECHAR* pString ); diff --git a/main/winaccessibility/source/UAccCOM/AccComponent.cpp b/main/winaccessibility/source/UAccCOM/AccComponent.cpp index 64402ed0ff..a69cb0d50d 100644 --- a/main/winaccessibility/source/UAccCOM/AccComponent.cpp +++ b/main/winaccessibility/source/UAccCOM/AccComponent.cpp @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + /** * AccComponent.cpp : Implementation of CUAccCOMApp and DLL registration. */ @@ -65,7 +65,7 @@ STDMETHODIMP CAccComponent::get_background(IA2Color * background) * * @param pXInterface the pointer of UNO interface. */ -STDMETHODIMP CAccComponent::put_XInterface(long pXInterface) +STDMETHODIMP CAccComponent::put_XInterface(LONG_PTR pXInterface) { return CAccComponentBase::put_XInterface(pXInterface); diff --git a/main/winaccessibility/source/UAccCOM/AccComponent.h b/main/winaccessibility/source/UAccCOM/AccComponent.h index f0bbc5ee5e..22ad3fc596 100644 --- a/main/winaccessibility/source/UAccCOM/AccComponent.h +++ b/main/winaccessibility/source/UAccCOM/AccComponent.h @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #if !defined(AFX_ACCCOMPONENT_H__626D760C_3944_4B0E_BB4D_F0D20AEDF7DC__INCLUDED_) #define AFX_ACCCOMPONENT_H__626D760C_3944_4B0E_BB4D_F0D20AEDF7DC__INCLUDED_ @@ -61,7 +61,7 @@ public: END_COM_MAP() static HRESULT WINAPI _SmartQI(void* pv, - REFIID iid, void** ppvObject, DWORD) + REFIID iid, void** ppvObject, DWORD_PTR) { return ((CAccComponent*)pv)->SmartQI(iid,ppvObject); } @@ -90,7 +90,7 @@ public: STDMETHOD(get_background)(IA2Color * background); // Overide of IUNOXWrapper. - STDMETHOD(put_XInterface)(long pXInterface); + STDMETHOD(put_XInterface)(LONG_PTR pXInterface); }; diff --git a/main/winaccessibility/source/UAccCOM/AccComponentBase.cpp b/main/winaccessibility/source/UAccCOM/AccComponentBase.cpp index 280aed0225..bb0be0c0a7 100644 --- a/main/winaccessibility/source/UAccCOM/AccComponentBase.cpp +++ b/main/winaccessibility/source/UAccCOM/AccComponentBase.cpp @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #include "stdafx.h" #include "AccComponentBase.h" #include <com/sun/star/accessibility/XAccessible.hpp> @@ -185,7 +185,7 @@ STDMETHODIMP CAccComponentBase::get_background(IA2Color * background) * * @param pXInterface the pointer of UNO interface. */ -STDMETHODIMP CAccComponentBase::put_XInterface(long pXInterface) +STDMETHODIMP CAccComponentBase::put_XInterface(LONG_PTR pXInterface) { CHECK_ENABLE_INF diff --git a/main/winaccessibility/source/UAccCOM/AccComponentBase.h b/main/winaccessibility/source/UAccCOM/AccComponentBase.h index a59f6730a7..5a9b75c7e0 100644 --- a/main/winaccessibility/source/UAccCOM/AccComponentBase.h +++ b/main/winaccessibility/source/UAccCOM/AccComponentBase.h @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + ////////////////////////////////////////////////////////////////////// // AccComponentBase.h: interface for the CAccComponentBase class. ////////////////////////////////////////////////////////////////////// @@ -63,7 +63,7 @@ public: STDMETHOD(get_background)(IA2Color * background); // Overide of IUNOXWrapper. - STDMETHOD(put_XInterface)(long pXInterface); + STDMETHOD(put_XInterface)(LONG_PTR pXInterface); protected: diff --git a/main/winaccessibility/source/UAccCOM/AccEditableText.cpp b/main/winaccessibility/source/UAccCOM/AccEditableText.cpp index 42bc928c61..5ad7493617 100644 --- a/main/winaccessibility/source/UAccCOM/AccEditableText.cpp +++ b/main/winaccessibility/source/UAccCOM/AccEditableText.cpp @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + /** * AccEditableText.cpp : Implementation of CUAccCOMApp and DLL registration. */ @@ -482,7 +482,7 @@ void CAccEditableText::get_AnyFromOLECHAR(const ::rtl::OUString &ouName, const : * * @param pXInterface the pointer of UNO interface. */ -STDMETHODIMP CAccEditableText::put_XInterface(long pXInterface) +STDMETHODIMP CAccEditableText::put_XInterface(LONG_PTR pXInterface) { diff --git a/main/winaccessibility/source/UAccCOM/AccEditableText.h b/main/winaccessibility/source/UAccCOM/AccEditableText.h index 0e430248f5..99cc443a28 100644 --- a/main/winaccessibility/source/UAccCOM/AccEditableText.h +++ b/main/winaccessibility/source/UAccCOM/AccEditableText.h @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #if !defined(AFX_ACCEDITABLETEXT_H__0C41AFBE_5A87_4D9D_A284_CEC264D91F81__INCLUDED_) #define AFX_ACCEDITABLETEXT_H__0C41AFBE_5A87_4D9D_A284_CEC264D91F81__INCLUDED_ @@ -57,7 +57,7 @@ public: END_COM_MAP() static HRESULT WINAPI _SmartQI(void* pv, - REFIID iid, void** ppvObject, DWORD) + REFIID iid, void** ppvObject, DWORD_PTR) { return ((CAccEditableText*)pv)->SmartQI(iid,ppvObject); } @@ -98,7 +98,7 @@ public: STDMETHOD(setAttributes)(long startOffset, long endOffset, BSTR * attributes); // Overide of IUNOXWrapper. - STDMETHOD(put_XInterface)(long pXInterface); + STDMETHOD(put_XInterface)(LONG_PTR pXInterface); private: diff --git a/main/winaccessibility/source/UAccCOM/AccHyperLink.cpp b/main/winaccessibility/source/UAccCOM/AccHyperLink.cpp index 1f0c095172..f0277bb109 100644 --- a/main/winaccessibility/source/UAccCOM/AccHyperLink.cpp +++ b/main/winaccessibility/source/UAccCOM/AccHyperLink.cpp @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #include "stdafx.h" #include "UAccCOM2.h" #include "AccHyperLink.h" @@ -250,7 +250,7 @@ STDMETHODIMP CAccHyperLink::get_valid(/* [retval][out] */ boolean __RPC_FAR *val * @param pXInterface XAccessibleContext interface. * @return Result. */ -STDMETHODIMP CAccHyperLink::put_XInterface(long pXInterface) +STDMETHODIMP CAccHyperLink::put_XInterface(LONG_PTR pXInterface) { CHECK_ENABLE_INF @@ -284,7 +284,7 @@ STDMETHODIMP CAccHyperLink::put_XInterface(long pXInterface) * @param pXSubInterface XAccessibleHyperlink interface. * @return Result. */ -STDMETHODIMP CAccHyperLink::put_XSubInterface(long pXSubInterface) +STDMETHODIMP CAccHyperLink::put_XSubInterface(LONG_PTR pXSubInterface) { CHECK_ENABLE_INF diff --git a/main/winaccessibility/source/UAccCOM/AccHyperLink.h b/main/winaccessibility/source/UAccCOM/AccHyperLink.h index 8fe6700f10..6d3042ebd4 100644 --- a/main/winaccessibility/source/UAccCOM/AccHyperLink.h +++ b/main/winaccessibility/source/UAccCOM/AccHyperLink.h @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #if !defined(AFX_ACCHYPERLINK_H__59DA79A5_A895_43DB_9495_2B2049CF5C65__INCLUDED_) #define AFX_ACCHYPERLINK_H__59DA79A5_A895_43DB_9495_2B2049CF5C65__INCLUDED_ @@ -59,7 +59,7 @@ public: DECLARE_REGISTRY_RESOURCEID(IDR_AccHyperLink) static HRESULT WINAPI _SmartQI(void* pv, - REFIID iid, void** ppvObject, DWORD) + REFIID iid, void** ppvObject, DWORD_PTR) { return ((CAccHyperLink*)pv)->SmartQI(iid,ppvObject); } @@ -121,10 +121,10 @@ public: STDMETHOD(get_valid)(/* [retval][out] */ boolean __RPC_FAR *valid); // Overide of IUNOXWrapper. - STDMETHOD(put_XInterface)(long pXInterface); + STDMETHOD(put_XInterface)(LONG_PTR pXInterface); // Overide of IUNOXWrapper. - STDMETHOD(put_XSubInterface)(long pXSubInterface); + STDMETHOD(put_XSubInterface)(LONG_PTR pXSubInterface); private: diff --git a/main/winaccessibility/source/UAccCOM/AccHypertext.cpp b/main/winaccessibility/source/UAccCOM/AccHypertext.cpp index 29ac8bf281..9d285eb345 100644 --- a/main/winaccessibility/source/UAccCOM/AccHypertext.cpp +++ b/main/winaccessibility/source/UAccCOM/AccHypertext.cpp @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #include "stdafx.h" #include "UAccCOM2.h" #include "AccHypertext.h" @@ -338,7 +338,7 @@ STDMETHODIMP CAccHypertext::get_hyperlink(long index,IAccessibleHyperlink **hype plink->QueryInterface(IID_IUNOXWrapper, (void**)&wrapper); if(wrapper) { - wrapper->put_XSubInterface((long)pRLink.get()/*pXI*/); + wrapper->put_XSubInterface((LONG_PTR)pRLink.get()/*pXI*/); wrapper->Release(); } *hyperlink = plink; @@ -383,7 +383,7 @@ STDMETHODIMP CAccHypertext::get_hyperlinkIndex(long charIndex, long *hyperlinkIn * @param pXInterface UNO interface. * @return Result. */ -STDMETHODIMP CAccHypertext::put_XInterface(long pXInterface) +STDMETHODIMP CAccHypertext::put_XInterface(LONG_PTR pXInterface) { diff --git a/main/winaccessibility/source/UAccCOM/AccHypertext.h b/main/winaccessibility/source/UAccCOM/AccHypertext.h index 767eaa7d6a..dd202abb9a 100644 --- a/main/winaccessibility/source/UAccCOM/AccHypertext.h +++ b/main/winaccessibility/source/UAccCOM/AccHypertext.h @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #if !defined(AFX_ACCHYPERTEXT_H__6DC133B6_03DB_42C6_A9B7_27AF4FDA00CA__INCLUDED_) #define AFX_ACCHYPERTEXT_H__6DC133B6_03DB_42C6_A9B7_27AF4FDA00CA__INCLUDED_ @@ -58,7 +58,7 @@ public: END_COM_MAP() static HRESULT WINAPI _SmartQI(void* pv, - REFIID iid, void** ppvObject, DWORD) + REFIID iid, void** ppvObject, DWORD_PTR) { return ((CAccHypertext*)pv)->SmartQI(iid,ppvObject); } @@ -150,7 +150,7 @@ public: STDMETHOD(get_hyperlinkIndex)(long charIndex, long *hyperlinkIndex); // Overide of IUNOXWrapper. - STDMETHOD(put_XInterface)(long pXInterface); + STDMETHOD(put_XInterface)(LONG_PTR pXInterface); private: diff --git a/main/winaccessibility/source/UAccCOM/AccImage.cpp b/main/winaccessibility/source/UAccCOM/AccImage.cpp index e02da4adaf..0b69cb8edb 100644 --- a/main/winaccessibility/source/UAccCOM/AccImage.cpp +++ b/main/winaccessibility/source/UAccCOM/AccImage.cpp @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #include "stdafx.h" #include "UAccCOM2.h" #include "AccImage.h" @@ -75,7 +75,7 @@ STDMETHODIMP CAccImage::get_imageSize( * @param pXInterface UNO interface. * @return Result. */ -STDMETHODIMP CAccImage::put_XInterface(long pXInterface) +STDMETHODIMP CAccImage::put_XInterface(LONG_PTR pXInterface) { diff --git a/main/winaccessibility/source/UAccCOM/AccImage.h b/main/winaccessibility/source/UAccCOM/AccImage.h index 17514b477e..b45064b56e 100644 --- a/main/winaccessibility/source/UAccCOM/AccImage.h +++ b/main/winaccessibility/source/UAccCOM/AccImage.h @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #if !defined(AFX_ACCIMAGE_H__D5E55275_CCD4_497F_8E77_F9B391D2F4A8__INCLUDED_) #define AFX_ACCIMAGE_H__D5E55275_CCD4_497F_8E77_F9B391D2F4A8__INCLUDED_ @@ -56,7 +56,7 @@ public: END_COM_MAP() static HRESULT WINAPI _SmartQI(void* pv, - REFIID iid, void** ppvObject, DWORD) + REFIID iid, void** ppvObject, DWORD_PTR) { return ((CAccImage*)pv)->SmartQI(iid,ppvObject); } @@ -86,7 +86,7 @@ public: long __RPC_FAR *width); // Overide of IUNOXWrapper. - STDMETHOD(put_XInterface)(long pXInterface); + STDMETHOD(put_XInterface)(LONG_PTR pXInterface); private: diff --git a/main/winaccessibility/source/UAccCOM/AccRelation.cpp b/main/winaccessibility/source/UAccCOM/AccRelation.cpp index 9d6bcead98..3bdd576e38 100644 --- a/main/winaccessibility/source/UAccCOM/AccRelation.cpp +++ b/main/winaccessibility/source/UAccCOM/AccRelation.cpp @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #include "stdafx.h" #include "UAccCOM2.h" #include "AccRelation.h" @@ -111,7 +111,7 @@ STDMETHODIMP CAccRelation::get_target(long targetIndex, IUnknown * * target) Reference<XInterface> pRAcc = xTargets[targetIndex]; IAccessible* pRet = NULL; - BOOL isGet = CMAccessible::get_IAccessibleFromXAccessible((long)pRAcc.get(),&pRet); + BOOL isGet = CMAccessible::get_IAccessibleFromXAccessible((LONG_PTR)pRAcc.get(),&pRet); if(isGet) { *target = /*(IAccessible2 *)*/(IUnknown*)pRet; @@ -174,7 +174,7 @@ STDMETHODIMP CAccRelation::get_targets(long, IUnknown * * target, long * nTarget * @param pXSubInterface AccessibleRelation pointer. * @return Result. */ -STDMETHODIMP CAccRelation::put_XSubInterface(long pXSubInterface) +STDMETHODIMP CAccRelation::put_XSubInterface(LONG_PTR pXSubInterface) { relation = *((AccessibleRelation*)pXSubInterface); @@ -204,7 +204,7 @@ BSTR CAccRelation::getRelationTypeBSTR(int type) {IA2_RELATION_LABELED_BY , 6}, {IA2_RELATION_MEMBER_OF , 7}, {IA2_RELATION_SUBWINDOW_OF , 8}, - {IA2_RELATION_NODE_CHILD_OF, 9}, + {IA2_RELATION_NODE_CHILD_OF, 9}, {IA2_RELATION_DESCRIBED_BY , 10}, }; diff --git a/main/winaccessibility/source/UAccCOM/AccRelation.h b/main/winaccessibility/source/UAccCOM/AccRelation.h index 075b7e2fa1..8d28d9c483 100644 --- a/main/winaccessibility/source/UAccCOM/AccRelation.h +++ b/main/winaccessibility/source/UAccCOM/AccRelation.h @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #ifndef __ACCRELATION_H_ #define __ACCRELATION_H_ @@ -75,7 +75,7 @@ public: STDMETHOD(get_targets)(long maxTargets, IUnknown * * target, long * nTargets); // Overide of IUNOXWrapper. - STDMETHOD(put_XSubInterface)(long pXSubInterface); + STDMETHOD(put_XSubInterface)(LONG_PTR pXSubInterface); //static OLECHAR* getRelationTypeOLECHAR(int type); static BSTR getRelationTypeBSTR(int type); diff --git a/main/winaccessibility/source/UAccCOM/AccTable.cpp b/main/winaccessibility/source/UAccCOM/AccTable.cpp index e0d4341230..b7bd0a1660 100644 --- a/main/winaccessibility/source/UAccCOM/AccTable.cpp +++ b/main/winaccessibility/source/UAccCOM/AccTable.cpp @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + /** * AccTable.cpp : Implementation of CAccTable. */ @@ -68,7 +68,7 @@ STDMETHODIMP CAccTable::get_accessibleAt(long row, long column, IUnknown * * acc IAccessible* pRet = NULL; - BOOL isTRUE = CMAccessible::get_IAccessibleFromXAccessible((long)pRAcc.get(),&pRet); + BOOL isTRUE = CMAccessible::get_IAccessibleFromXAccessible((LONG_PTR)pRAcc.get(),&pRet); if(isTRUE) { *accessible = (IAccessible2 *)pRet; @@ -80,7 +80,7 @@ STDMETHODIMP CAccTable::get_accessibleAt(long row, long column, IUnknown * * acc Reference<XAccessible> pxTable(GetXInterface(),UNO_QUERY); CMAccessible::g_pAgent->InsertAccObj(pRAcc.get(),pxTable.get()); - isTRUE = CMAccessible::get_IAccessibleFromXAccessible((long)pRAcc.get(),&pRet); + isTRUE = CMAccessible::get_IAccessibleFromXAccessible((LONG_PTR)pRAcc.get(),&pRet); if(isTRUE) { @@ -222,7 +222,7 @@ STDMETHODIMP CAccTable::get_columnHeader(IAccessibleTable __RPC_FAR *__RPC_FAR * (void **)&m_pIMacc ); DeactivateActContext(); - ((CMAccessible*)m_pIMacc)->SetXAccessible((long)pRXColumnHeader.get()); + ((CMAccessible*)m_pIMacc)->SetXAccessible((LONG_PTR)pRXColumnHeader.get()); m_pIMacc->QueryInterface(IID_IAccessibleTable,(void **)accessibleTable); if( SUCCEEDED(hr) ) { @@ -454,7 +454,7 @@ STDMETHODIMP CAccTable::get_rowHeader(IAccessibleTable __RPC_FAR *__RPC_FAR *acc (void **)&m_pIMacc ); DeactivateActContext(); - ((CMAccessible*)m_pIMacc)->SetXAccessible((long)pRXRowHeader.get()); + ((CMAccessible*)m_pIMacc)->SetXAccessible((LONG_PTR)pRXRowHeader.get()); m_pIMacc->QueryInterface(IID_IAccessibleTable,(void **)accessibleTable); if( SUCCEEDED(hr) ) { @@ -570,7 +570,7 @@ STDMETHODIMP CAccTable::get_summary(IUnknown * * accessible) Reference<XAccessible> pRAcc = GetXInterface()->getAccessibleSummary(); IAccessible* pRet = NULL; - BOOL isTRUE = CMAccessible::get_IAccessibleFromXAccessible((long)pRAcc.get(),&pRet); + BOOL isTRUE = CMAccessible::get_IAccessibleFromXAccessible((LONG_PTR)pRAcc.get(),&pRet); if(pRet) { @@ -863,7 +863,7 @@ STDMETHODIMP CAccTable::unselectColumn(long column) * * @param pXInterface the pointer of UNO interface. */ -STDMETHODIMP CAccTable::put_XInterface(long pXInterface) +STDMETHODIMP CAccTable::put_XInterface(LONG_PTR pXInterface) { CHECK_ENABLE_INF diff --git a/main/winaccessibility/source/UAccCOM/AccTable.h b/main/winaccessibility/source/UAccCOM/AccTable.h index d3ca3ceb5f..c61ac2e13d 100644 --- a/main/winaccessibility/source/UAccCOM/AccTable.h +++ b/main/winaccessibility/source/UAccCOM/AccTable.h @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #ifndef __ACCTABLE_H_ #define __ACCTABLE_H_ @@ -53,7 +53,7 @@ public: END_COM_MAP() static HRESULT WINAPI _SmartQI(void* pv, - REFIID iid, void** ppvObject, DWORD) + REFIID iid, void** ppvObject, DWORD_PTR) { return ((CAccTable*)pv)->SmartQI(iid,ppvObject); } @@ -160,7 +160,7 @@ public: STDMETHOD(get_modelChange)(IA2TableModelChange *modelChange); // Overide of IUNOXWrapper. - STDMETHOD(put_XInterface)(long pXInterface); + STDMETHOD(put_XInterface)(LONG_PTR pXInterface); private: diff --git a/main/winaccessibility/source/UAccCOM/AccText.cpp b/main/winaccessibility/source/UAccCOM/AccText.cpp index d5f7ffe91d..176c74fc70 100644 --- a/main/winaccessibility/source/UAccCOM/AccText.cpp +++ b/main/winaccessibility/source/UAccCOM/AccText.cpp @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #include "stdafx.h" #include "UAccCOM2.h" #include "AccText.h" @@ -274,7 +274,7 @@ STDMETHODIMP CAccText::scrollSubstringTo(long startIndex, long endIndex,enum IA2 * @param pXInterface UNO interface. * @return Result. */ -STDMETHODIMP CAccText::put_XInterface(long pXInterface) +STDMETHODIMP CAccText::put_XInterface(LONG_PTR pXInterface) { return CAccTextBase::put_XInterface(pXInterface); diff --git a/main/winaccessibility/source/UAccCOM/AccText.h b/main/winaccessibility/source/UAccCOM/AccText.h index 14000ba2a8..3f2e5ecb06 100644 --- a/main/winaccessibility/source/UAccCOM/AccText.h +++ b/main/winaccessibility/source/UAccCOM/AccText.h @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #if !defined(AFX_ACCTEXT_H__F06C5496_9959_4C7C_873E_A8D50CFB290D__INCLUDED_) #define AFX_ACCTEXT_H__F06C5496_9959_4C7C_873E_A8D50CFB290D__INCLUDED_ @@ -54,7 +54,7 @@ public: END_COM_MAP() static HRESULT WINAPI _SmartQI(void* pv, - REFIID iid, void** ppvObject, DWORD) + REFIID iid, void** ppvObject, DWORD_PTR) { return ((CAccText*)pv)->SmartQI(iid,ppvObject); } @@ -133,7 +133,7 @@ public: STDMETHOD(get_oldText)( IA2TextSegment *oldText); // Overide of IUNOXWrapper. - STDMETHOD(put_XInterface)(long pXInterface); + STDMETHOD(put_XInterface)(LONG_PTR pXInterface); }; diff --git a/main/winaccessibility/source/UAccCOM/AccTextBase.cpp b/main/winaccessibility/source/UAccCOM/AccTextBase.cpp index 01c7b8a34d..56042324ce 100644 --- a/main/winaccessibility/source/UAccCOM/AccTextBase.cpp +++ b/main/winaccessibility/source/UAccCOM/AccTextBase.cpp @@ -943,7 +943,7 @@ STDMETHODIMP CAccTextBase::scrollSubstringTo(long, long, IA2ScrollType) * @param pXInterface UNO interface. * @return Result. */ -STDMETHODIMP CAccTextBase::put_XInterface(long pXInterface) +STDMETHODIMP CAccTextBase::put_XInterface(LONG_PTR pXInterface) { CHECK_ENABLE_INF diff --git a/main/winaccessibility/source/UAccCOM/AccTextBase.h b/main/winaccessibility/source/UAccCOM/AccTextBase.h index 7dc7785cab..eefa98b7b6 100644 --- a/main/winaccessibility/source/UAccCOM/AccTextBase.h +++ b/main/winaccessibility/source/UAccCOM/AccTextBase.h @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + // AccTextBase.h: interface for the CAccTextBase class. // ////////////////////////////////////////////////////////////////////// @@ -107,7 +107,7 @@ public: STDMETHOD(scrollSubstringToPoint)(long startIndex, long endIndex,enum IA2CoordinateType coordinateType, long x, long y ); // Overide of IUNOXWrapper. - STDMETHOD(put_XInterface)(long pXInterface); + STDMETHOD(put_XInterface)(LONG_PTR pXInterface); private: diff --git a/main/winaccessibility/source/UAccCOM/AccValue.cpp b/main/winaccessibility/source/UAccCOM/AccValue.cpp index a98a1b2042..2a7c011cfd 100644 --- a/main/winaccessibility/source/UAccCOM/AccValue.cpp +++ b/main/winaccessibility/source/UAccCOM/AccValue.cpp @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #include "stdafx.h" #include "UAccCOM2.h" #include "AccValue.h" @@ -198,7 +198,7 @@ STDMETHODIMP CAccValue::get_minimumValue(VARIANT *mininumValue) * @param pXInterface UNO interface. * @return Result. */ -STDMETHODIMP CAccValue::put_XInterface(long pXInterface) +STDMETHODIMP CAccValue::put_XInterface(LONG_PTR pXInterface) { diff --git a/main/winaccessibility/source/UAccCOM/AccValue.h b/main/winaccessibility/source/UAccCOM/AccValue.h index 002a757d08..6813fcbcf8 100644 --- a/main/winaccessibility/source/UAccCOM/AccValue.h +++ b/main/winaccessibility/source/UAccCOM/AccValue.h @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #if !defined(AFX_ACCVALUE_H__CBA4972C_4188_4A18_A3CD_4A1FA3DDED38__INCLUDED_) #define AFX_ACCVALUE_H__CBA4972C_4188_4A18_A3CD_4A1FA3DDED38__INCLUDED_ @@ -57,7 +57,7 @@ public: END_COM_MAP() static HRESULT WINAPI _SmartQI(void* pv, - REFIID iid, void** ppvObject, DWORD) + REFIID iid, void** ppvObject, DWORD_PTR) { return ((CAccValue*)pv)->SmartQI(iid,ppvObject); } @@ -88,7 +88,7 @@ public: STDMETHOD(get_minimumValue)(VARIANT *mininumValue); // Overide of IUNOXWrapper. - STDMETHOD(put_XInterface)(long pXInterface); + STDMETHOD(put_XInterface)(LONG_PTR pXInterface); private: diff --git a/main/winaccessibility/source/UAccCOM/EnumVariant.cpp b/main/winaccessibility/source/UAccCOM/EnumVariant.cpp index 3c797edeb8..7fb510beb2 100644 --- a/main/winaccessibility/source/UAccCOM/EnumVariant.cpp +++ b/main/winaccessibility/source/UAccCOM/EnumVariant.cpp @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #include "stdafx.h" #include "UAccCOM2.h" #include "EnumVariant.h" @@ -56,7 +56,7 @@ HRESULT STDMETHODCALLTYPE CEnumVariant::Next(ULONG cElements,VARIANT __RPC_FAR * { Reference< XAccessible > pRXAcc = m_pXAccessibleSelection->getSelectedAccessibleChild(l1); IAccessible* pChild = NULL; - BOOL isGet = CMAccessible::get_IAccessibleFromXAccessible((long)pRXAcc.get(),&pChild); + BOOL isGet = CMAccessible::get_IAccessibleFromXAccessible((LONG_PTR)pRXAcc.get(),&pChild); if(isGet) { pvar[l2].vt = VT_I4; @@ -66,7 +66,7 @@ HRESULT STDMETHODCALLTYPE CEnumVariant::Next(ULONG cElements,VARIANT __RPC_FAR * { if(CMAccessible::g_pAgent) CMAccessible::g_pAgent->InsertAccObj(pRXAcc.get(),pUNOInterface,NULL); - BOOL isGet = CMAccessible::get_IAccessibleFromXAccessible((long)pRXAcc.get(),&pChild); + BOOL isGet = CMAccessible::get_IAccessibleFromXAccessible((LONG_PTR)pRXAcc.get(),&pChild); if(isGet) { pvar[l2].vt = VT_I4; @@ -133,7 +133,7 @@ HRESULT STDMETHODCALLTYPE CEnumVariant::Clone(IEnumVARIANT __RPC_FAR *__RPC_FAR hr = Create(&penum); if( hr == S_OK ) { - penum->PutSelection((long)pUNOInterface); + penum->PutSelection((LONG_PTR)pUNOInterface); *ppenum = penum; } else @@ -219,7 +219,7 @@ static Reference<XAccessibleSelection> GetXAccessibleSelection(XAccessible* pXAc * @param pXSelection XAccessible interface. * @return Result.. */ -STDMETHODIMP CEnumVariant::PutSelection(long pXSelection) +STDMETHODIMP CEnumVariant::PutSelection(LONG_PTR pXSelection) { pUNOInterface = (XAccessible*)pXSelection; m_pXAccessibleSelection = GetXAccessibleSelection(pUNOInterface); diff --git a/main/winaccessibility/source/UAccCOM/EnumVariant.h b/main/winaccessibility/source/UAccCOM/EnumVariant.h index 9a8f0a69f4..9de2d3c0e4 100644 --- a/main/winaccessibility/source/UAccCOM/EnumVariant.h +++ b/main/winaccessibility/source/UAccCOM/EnumVariant.h @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #ifndef __ENUMVARIANT_H_ #define __ENUMVARIANT_H_ @@ -87,7 +87,7 @@ public: // IEnumVariant // - HRESULT STDMETHODCALLTYPE PutSelection(long pXSelection); + HRESULT STDMETHODCALLTYPE PutSelection(LONG_PTR pXSelection); // static HRESULT STDMETHODCALLTYPE Create(CEnumVariant __RPC_FAR *__RPC_FAR *ppenum); diff --git a/main/winaccessibility/source/UAccCOM/MAccessible.cpp b/main/winaccessibility/source/UAccCOM/MAccessible.cpp index 7a7e77680b..cac1fd18fb 100644 --- a/main/winaccessibility/source/UAccCOM/MAccessible.cpp +++ b/main/winaccessibility/source/UAccCOM/MAccessible.cpp @@ -1338,7 +1338,7 @@ STDMETHODIMP CMAccessible::Put_XAccChildID(long dChildID) * @param pAgent, the AccObjectManagerAgent point. * @return S_OK if successful and E_FAIL if failure. */ -STDMETHODIMP CMAccessible::Put_XAccAgent(long pAgent) +STDMETHODIMP CMAccessible::Put_XAccAgent(LONG_PTR pAgent) { g_pAgent = (AccObjectManagerAgent*)pAgent; return S_OK; @@ -1393,12 +1393,12 @@ IMAccessible* CMAccessible::GetChildInterface(long dChildID)//for test IAccessible* pChild = NULL; Reference< XAccessible > pXChild = pRContext->getAccessibleChild(dChildID-1); - BOOL isGet = get_IAccessibleFromXAccessible((long)pXChild.get(),&pChild); + BOOL isGet = get_IAccessibleFromXAccessible((LONG_PTR)pXChild.get(),&pChild); if(!isGet) { - g_pAgent->InsertAccObj(pXChild.get(),pUNOInterface,(long)m_hwnd); - isGet = get_IAccessibleFromXAccessible((long)pXChild.get(),&pChild); + g_pAgent->InsertAccObj(pXChild.get(),pUNOInterface,m_hwnd); + isGet = get_IAccessibleFromXAccessible((LONG_PTR)pXChild.get(),&pChild); } if(isGet) @@ -1463,7 +1463,7 @@ IMAccessible* CMAccessible::GetNavigateChildForDM(VARIANT varCur, short flags) { return NULL; } - pCurChild->GetUNOInterface((long*)&pChildXAcc); + pCurChild->GetUNOInterface((LONG_PTR*)&pChildXAcc); if(pChildXAcc==NULL) { return NULL; @@ -1732,7 +1732,7 @@ STDMETHODIMP CMAccessible::get_relation( long relationIndex, IAccessibleRelation if(SUCCEEDED(hr)) { AccessibleRelation accRelation = pRrelationSet->getRelation(relationIndex); - wrapper->put_XSubInterface((long)&accRelation); + wrapper->put_XSubInterface((LONG_PTR)&accRelation); wrapper->Release(); *relation = pRelation; return S_OK; @@ -1795,7 +1795,7 @@ STDMETHODIMP CMAccessible::get_relations( long, IAccessibleRelation __RPC_FAR *_ if(SUCCEEDED(hr)) { AccessibleRelation accRelation = pRrelationSet->getRelation(i); - wrapper->put_XSubInterface((long)&accRelation); + wrapper->put_XSubInterface((LONG_PTR)&accRelation); wrapper->Release(); } (relation)[i] = pRelation; @@ -2273,11 +2273,11 @@ HRESULT CMAccessible::DeSelectMultipleChildren( XAccessible** pItem,int size ) * @param pXAcc, the XAccessible object of current object. * @return S_OK if successful. */ -STDMETHODIMP CMAccessible::SetXAccessible(long pXAcc) +STDMETHODIMP CMAccessible::SetXAccessible(LONG_PTR pXAcc) { pUNOInterface = (XAccessible*)pXAcc; pRef = pUNOInterface; - m_pEnumVar->PutSelection(/*XAccessibleSelection*/(long)pUNOInterface); + m_pEnumVar->PutSelection(/*XAccessibleSelection*/(LONG_PTR)pUNOInterface); pRContext = pUNOInterface->getAccessibleContext(); pRContextInterface = (XAccessibleContext*)pRContext.is(); @@ -2332,7 +2332,7 @@ STDMETHODIMP CMAccessible::accSelect(long flagsSelect, VARIANT varChild) if( flagsSelect&SELFLAG_TAKEFOCUS ) { - long pTempUNO = 0; + LONG_PTR pTempUNO = 0; pSelectAcc->GetUNOInterface( &pTempUNO); if( pTempUNO == NULL ) @@ -2388,13 +2388,13 @@ STDMETHODIMP CMAccessible::accSelect(long flagsSelect, VARIANT varChild) * @param pXAcc, [in, out] the Uno interface of the current object. * @return S_OK if successful. */ -STDMETHODIMP CMAccessible::GetUNOInterface(long* pXAcc) +STDMETHODIMP CMAccessible::GetUNOInterface(LONG_PTR* pXAcc) { // #CHECK# if(pXAcc == NULL) return E_INVALIDARG; - *pXAcc = (long)pUNOInterface; + *pXAcc = (LONG_PTR)pUNOInterface; return S_OK; } @@ -2403,7 +2403,7 @@ STDMETHODIMP CMAccessible::GetUNOInterface(long* pXAcc) * @param pAction, the default action point of the current object. * @return S_OK if successful. */ -STDMETHODIMP CMAccessible::SetDefaultAction(long pAction) +STDMETHODIMP CMAccessible::SetDefaultAction(LONG_PTR pAction) { m_pXAction = (XAccessibleAction*)pAction; return S_OK; @@ -2595,7 +2595,7 @@ HRESULT WINAPI CMAccessible::SmartQI(void* pv, REFIID iid, void** ppvObject) ((IUnknown*)*ppvObject)->QueryInterface(IID_IUNOXWrapper, (void**)&wrapper); if(wrapper) { - wrapper->put_XInterface((long)pUNOInterface); + wrapper->put_XInterface((LONG_PTR)pUNOInterface); wrapper->Release(); } return S_OK; @@ -2610,7 +2610,7 @@ HRESULT WINAPI CMAccessible::SmartQI(void* pv, REFIID iid, void** ppvObject) LEAVE_PROTECTED_BLOCK } -BOOL CMAccessible::get_IAccessibleFromXAccessible(long pXAcc, IAccessible **ppIA) +BOOL CMAccessible::get_IAccessibleFromXAccessible(LONG_PTR pXAcc, IAccessible **ppIA) { ENTER_PROTECTED_BLOCK @@ -2963,12 +2963,12 @@ void CMAccessible::ConvertAnyToVariant(const ::com::sun::star::uno::Any &rAnyVal if(pXAcc.is()) { IAccessible* pIAcc = NULL; - get_IAccessibleFromXAccessible((long)pXAcc.get(), &pIAcc); + get_IAccessibleFromXAccessible((LONG_PTR)pXAcc.get(), &pIAcc); if(pIAcc == NULL) { Reference< XAccessibleContext > pXAccContext = pXAcc->getAccessibleContext(); g_pAgent->InsertAccObj(pXAcc.get(),pXAccContext->getAccessibleParent().get()); - get_IAccessibleFromXAccessible((long)pXAcc.get(), &pIAcc); + get_IAccessibleFromXAccessible((LONG_PTR)pXAcc.get(), &pIAcc); } if(pIAcc) { diff --git a/main/winaccessibility/source/UAccCOM/MAccessible.h b/main/winaccessibility/source/UAccCOM/MAccessible.h index c7342ebc1d..19d7f6b457 100644 --- a/main/winaccessibility/source/UAccCOM/MAccessible.h +++ b/main/winaccessibility/source/UAccCOM/MAccessible.h @@ -200,12 +200,12 @@ public: STDMETHOD(Put_XAccParent)(IMAccessible __RPC_FAR *pIParent); STDMETHOD(Put_XAccWindowHandle)(HWND hwnd); STDMETHOD(Put_XAccChildID)(long dChildID); - STDMETHOD(Put_XAccAgent)(long pAgent); + STDMETHOD(Put_XAccAgent)(LONG_PTR pAgent); STDMETHOD(NotifyDestroy)(BOOL isDestroy); STDMETHOD(Put_ActionDescription)( const OLECHAR* szAction); - STDMETHOD(SetDefaultAction)(long pAction); - STDMETHOD(GetUNOInterface)(long*); - STDMETHOD(SetXAccessible)(long); + STDMETHOD(SetDefaultAction)(LONG_PTR pAction); + STDMETHOD(GetUNOInterface)(LONG_PTR*); + STDMETHOD(SetXAccessible)(LONG_PTR); private: OLECHAR* m_pszName; @@ -271,12 +271,12 @@ public: // implement some specific MSAA methods,such as accSelection,accNavigate static AccObjectManagerAgent* g_pAgent; - static BOOL get_IAccessibleFromXAccessible(long pXAcc,IAccessible** ppIA); + static BOOL get_IAccessibleFromXAccessible(LONG_PTR pXAcc,IAccessible** ppIA); BOOL m_bRequiresSave; XGUIDToComObjHash m_containedObjects; static HRESULT WINAPI _SmartQI(void* pv, - REFIID iid, void** ppvObject, DWORD) + REFIID iid, void** ppvObject, DWORD_PTR) { return ((CMAccessible*)pv)->SmartQI(pv,iid,ppvObject); } diff --git a/main/winaccessibility/source/UAccCOM/UNOXWrapper.h b/main/winaccessibility/source/UAccCOM/UNOXWrapper.h index c0d28d0911..e169743ba6 100644 --- a/main/winaccessibility/source/UAccCOM/UNOXWrapper.h +++ b/main/winaccessibility/source/UAccCOM/UNOXWrapper.h @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #ifndef __UNOXWRAPPER_H_ #define __UNOXWRAPPER_H_ @@ -42,24 +42,24 @@ public: public: // IUNOXWrapper - STDMETHOD(put_XInterface)(long pXInterface) + STDMETHOD(put_XInterface)(LONG_PTR pXInterface) { pUNOInterface = (com::sun::star::accessibility::XAccessible*)pXInterface; return S_OK; } - STDMETHOD(put_XSubInterface)(long) + STDMETHOD(put_XSubInterface)(LONG_PTR) { return S_OK; } - STDMETHOD(get_XInterface)(/*[out,retval]*/long *pXInterface) + STDMETHOD(get_XInterface)(/*[out,retval]*/LONG_PTR *pXInterface) { - *pXInterface = (long)pUNOInterface;//.get(); + *pXInterface = (LONG_PTR)pUNOInterface;//.get(); return S_OK; } - STDMETHOD(get_XSubInterface)(/*[out,retval]*/long *) + STDMETHOD(get_XSubInterface)(/*[out,retval]*/LONG_PTR *) { return S_OK; } diff --git a/main/winaccessibility/source/UAccCOMIDL/UAccCOM.idl b/main/winaccessibility/source/UAccCOMIDL/UAccCOM.idl index 5248d5b88e..9abe2db63b 100644 --- a/main/winaccessibility/source/UAccCOMIDL/UAccCOM.idl +++ b/main/winaccessibility/source/UAccCOMIDL/UAccCOM.idl @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + import "oaidl.idl"; import "ocidl.idl"; @@ -46,11 +46,11 @@ import "defines.idl"; [id(10), helpstring("method Put_XAccParent")] HRESULT Put_XAccParent(IMAccessible* pIParent); [id(13), helpstring("method Put_XAccWindowHandle")] HRESULT Put_XAccWindowHandle(HWND hwnd); [id(14), helpstring("method Put_XAccChildID")] HRESULT Put_XAccChildID(long dChildID); - [id(19), helpstring("method SetXAccessible")] HRESULT SetXAccessible( long XAccessible); - [id(20), helpstring("method GetUNOInterface")] HRESULT GetUNOInterface(long* UNOInterface); - [id(23), helpstring("method SetDefaultAction")] HRESULT SetDefaultAction(long pAction); + [id(19), helpstring("method SetXAccessible")] HRESULT SetXAccessible( LONG_PTR XAccessible); + [id(20), helpstring("method GetUNOInterface")] HRESULT GetUNOInterface(LONG_PTR* UNOInterface); + [id(23), helpstring("method SetDefaultAction")] HRESULT SetDefaultAction(LONG_PTR pAction); [id(24), helpstring("method Put_ActionDescription")] HRESULT Put_ActionDescription( const OLECHAR* szAction); - [id(25), helpstring("method Put_XAccAgent")] HRESULT Put_XAccAgent(long pAgent); + [id(25), helpstring("method Put_XAccAgent")] HRESULT Put_XAccAgent(LONG_PTR pAgent); [id(26), helpstring("method NotifyDestroy")] HRESULT NotifyDestroy(BOOL isDestroy); [id(30), helpstring("method Get_XAccChildID")] HRESULT Get_XAccChildID([out,retval] long* childID); }; @@ -64,7 +64,7 @@ import "defines.idl"; interface IEnumVariant : IEnumVARIANT { [id(1), helpstring("method ClearEnumeration")] HRESULT ClearEnumeration(); - [id(2), helpstring("method PutSelection")] HRESULT PutSelection(long pXSeletion); + [id(2), helpstring("method PutSelection")] HRESULT PutSelection(LONG_PTR pXSeletion); }; [ object, @@ -75,10 +75,10 @@ import "defines.idl"; ] interface IUNOXWrapper : IUnknown { - [id(1), helpstring("method put_XInterface")] HRESULT put_XInterface(long pXInterface); - [id(2), helpstring("method put_XSubInterface")] HRESULT put_XSubInterface(long pXSubInterface); - [id(3), helpstring("method get_XInterface")] HRESULT get_XInterface([out,retval]long* pXInterface); - [id(4), helpstring("method get_XSubInterface")] HRESULT get_XSubInterface([out,retval]long* pXSubInterface); + [id(1), helpstring("method put_XInterface")] HRESULT put_XInterface(LONG_PTR pXInterface); + [id(2), helpstring("method put_XSubInterface")] HRESULT put_XSubInterface(LONG_PTR pXSubInterface); + [id(3), helpstring("method get_XInterface")] HRESULT get_XInterface([out,retval]LONG_PTR* pXInterface); + [id(4), helpstring("method get_XSubInterface")] HRESULT get_XSubInterface([out,retval]LONG_PTR* pXSubInterface); }; [ diff --git a/main/winaccessibility/source/service/AccEventListener.cxx b/main/winaccessibility/source/service/AccEventListener.cxx index e348c56c1b..b475935e51 100644 --- a/main/winaccessibility/source/service/AccEventListener.cxx +++ b/main/winaccessibility/source/service/AccEventListener.cxx @@ -17,8 +17,8 @@ * 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> @@ -26,7 +26,7 @@ #ifndef _SV_SYSDATA_HXX #if defined( WIN ) || defined( WNT ) || defined( OS2 ) -typedef sal_Int32 HWND; +typedef void* HWND; #endif #endif #include "AccEventListener.hxx" diff --git a/main/winaccessibility/source/service/AccFrameEventListener.cxx b/main/winaccessibility/source/service/AccFrameEventListener.cxx index a978874d0a..86244fdde6 100644 --- a/main/winaccessibility/source/service/AccFrameEventListener.cxx +++ b/main/winaccessibility/source/service/AccFrameEventListener.cxx @@ -17,14 +17,14 @@ * 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 "AccFrameEventListener.hxx" #include "AccObjectManagerAgent.hxx" #include "unomsaaevent.hxx" @@ -37,12 +37,12 @@ using namespace com::sun::star::accessibility; #ifndef _SV_SYSDATA_HXX #if defined( WIN ) || defined( WNT ) || defined( OS2 ) -typedef sal_Int32 HWND; +typedef void* HWND; typedef sal_Int32 HMENU; typedef sal_Int32 HDC; -typedef void *PVOID; -typedef PVOID HANDLE; -typedef HANDLE HFONT; +typedef void *PVOID; +typedef PVOID HANDLE; +typedef HANDLE HFONT; #endif #include <vcl/sysdata.hxx> #endif @@ -51,8 +51,8 @@ typedef HANDLE HFONT; AccFrameEventListener::AccFrameEventListener(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent) :AccEventListener(pAcc, Agent) { -} - +} + AccFrameEventListener::~AccFrameEventListener() { } diff --git a/main/winaccessibility/source/service/AccObject.cxx b/main/winaccessibility/source/service/AccObject.cxx index 935a7126b6..dfcecca208 100644 --- a/main/winaccessibility/source/service/AccObject.cxx +++ b/main/winaccessibility/source/service/AccObject.cxx @@ -71,9 +71,9 @@ AccObject::AccObject(XAccessible* pAcc,AccObjectManagerAgent* pAgent ,AccEventLi m_accRole = m_xAccContextRef -> getAccessibleRole(); if( m_pIMAcc ) { - m_pIMAcc->SetXAccessible((long) m_xAccRef.get()); - m_pIMAcc->Put_XAccAgent((long)pAgent); - m_pIMAcc->SetDefaultAction((long)m_xAccActionRef.get()); + m_pIMAcc->SetXAccessible((LONG_PTR) m_xAccRef.get()); + m_pIMAcc->Put_XAccAgent((LONG_PTR)pAgent); + m_pIMAcc->SetDefaultAction((LONG_PTR)m_xAccActionRef.get()); } } /** @@ -223,7 +223,7 @@ void AccObject::UpdateAction() if( m_xAccActionRef->getAccessibleActionCount() > 0 ) { UpdateDefaultAction( ); - m_pIMAcc->SetDefaultAction((long)m_xAccActionRef.get()); + m_pIMAcc->SetDefaultAction((LONG_PTR)m_xAccActionRef.get()); } } } diff --git a/main/winaccessibility/source/service/AccObjectManagerAgent.cxx b/main/winaccessibility/source/service/AccObjectManagerAgent.cxx index 2a395f5eca..4c27b40b0a 100644 --- a/main/winaccessibility/source/service/AccObjectManagerAgent.cxx +++ b/main/winaccessibility/source/service/AccObjectManagerAgent.cxx @@ -17,7 +17,7 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ + *************************************************************/ #include "AccObjectManagerAgent.hxx" #include "AccObjectWinManager.hxx" @@ -142,10 +142,10 @@ void AccObjectManagerAgent::UpdateDescription( XAccessible* pXAcc, Any newDesc * @param pWnd The top window handle containing control. * @return If the method is correctly processed. */ -unsigned char AccObjectManagerAgent::InsertAccObj( XAccessible* pXAcc,XAccessible* pParentXAcc,long pWnd) +unsigned char AccObjectManagerAgent::InsertAccObj( XAccessible* pXAcc,XAccessible* pParentXAcc,void *pWnd) { if( pWinManager ) - return (unsigned char)pWinManager->InsertAccObj( pXAcc, pParentXAcc,HWND((void*)pWnd) ); + return (unsigned char)pWinManager->InsertAccObj( pXAcc, pParentXAcc, (HWND)pWnd ); return sal_False; } @@ -156,10 +156,10 @@ unsigned char AccObjectManagerAgent::InsertAccObj( XAccessible* pXAcc,XAccessibl * @param pXAcc XAccessible interface for top window * @return void */ -void AccObjectManagerAgent::SaveTopWindowHandle(long hWnd, com::sun::star::accessibility::XAccessible* pXAcc) +void AccObjectManagerAgent::SaveTopWindowHandle(void *hWnd, com::sun::star::accessibility::XAccessible* pXAcc) { if( pWinManager ) - pWinManager->SaveTopWindowHandle( HWND((void*)hWnd), pXAcc ); + pWinManager->SaveTopWindowHandle( (HWND)hWnd, pXAcc ); } @@ -171,10 +171,10 @@ void AccObjectManagerAgent::SaveTopWindowHandle(long hWnd, com::sun::star::acces * @return If the method is correctly processed. */ unsigned char AccObjectManagerAgent::InsertChildrenAccObj( XAccessible* pXAcc, - long pWnd) + void *pWnd) { if( pWinManager ) - return (unsigned char)pWinManager->InsertChildrenAccObj( pXAcc, HWND((void*)pWnd) ); + return (unsigned char)pWinManager->InsertChildrenAccObj( pXAcc, (HWND)pWnd ); return sal_False; } diff --git a/main/winaccessibility/source/service/AccObjectWinManager.cxx b/main/winaccessibility/source/service/AccObjectWinManager.cxx index 37c74e57fd..ed903d24e4 100644 --- a/main/winaccessibility/source/service/AccObjectWinManager.cxx +++ b/main/winaccessibility/source/service/AccObjectWinManager.cxx @@ -64,10 +64,10 @@ AccObjectWinManager* AccObjectWinManager::me = NULL; * @param * @return Com interface. */ -long GetMSComPtr(long hWnd, long lParam, long wParam) +sal_IntPtr GetMSComPtr(sal_IntPtr hWnd, sal_IntPtr lParam, sal_IntPtr wParam) { if( g_acc_manager ) - return (long)g_acc_manager->Get_ToATInterface(HWND((void*)hWnd),lParam,wParam ); + return (sal_IntPtr)g_acc_manager->Get_ToATInterface(HWND((void*)hWnd), (LPARAM)lParam, (WPARAM)wParam ); return NULL; } @@ -133,7 +133,7 @@ AccObjectWinManager::~AccObjectWinManager() * @return Com interface with event. */ -long AccObjectWinManager::Get_ToATInterface( HWND hWnd, long lParam, long wParam) +LRESULT AccObjectWinManager::Get_ToATInterface( HWND hWnd, LPARAM lParam, WPARAM wParam) { vos::OGuard localGuard(maATInterfaceMutex);// @@ -153,7 +153,7 @@ long AccObjectWinManager::Get_ToATInterface( HWND hWnd, long lParam, long wParam if ( pRetIMAcc && lParam == OBJID_CLIENT ) { IAccessible* pTemp = dynamic_cast<IAccessible*>( pRetIMAcc ); - HRESULT result = LresultFromObject(IID_IAccessible, wParam, pTemp); + LRESULT result = LresultFromObject(IID_IAccessible, wParam, pTemp); pTemp->Release(); return result; } @@ -773,12 +773,12 @@ sal_Bool AccObjectWinManager::InsertAccObj( XAccessible* pXAcc,XAccessible* pPar //for file name support if ( pObj.GetRole() == DOCUMENT ) { - XHWNDToDocumentHash::iterator aIter = XHWNDDocList.find( (long)pWnd ); + XHWNDToDocumentHash::iterator aIter = XHWNDDocList.find( pWnd ); if ( aIter != XHWNDDocList.end() ) { XHWNDDocList.erase( aIter ); } - XHWNDDocList.insert( XHWNDToDocumentHash::value_type( (long)pWnd, pXAcc ) ); + XHWNDDocList.insert( XHWNDToDocumentHash::value_type( pWnd, pXAcc ) ); } //end of file name @@ -1290,7 +1290,7 @@ short AccObjectWinManager::GetRole(com::sun::star::accessibility::XAccessible* p return -1; } -XAccessible* AccObjectWinManager::GetAccDocByHWND( long pWnd ) +XAccessible* AccObjectWinManager::GetAccDocByHWND( HWND pWnd ) { XHWNDToDocumentHash::iterator aIter; aIter = XHWNDDocList.find( pWnd ); @@ -1305,8 +1305,7 @@ XAccessible* AccObjectWinManager::GetAccDocByHWND( long pWnd ) XAccessible* AccObjectWinManager::GetAccDocByAccTopWin( XAccessible* pXAcc ) { AccObject* pAccObj = GetAccObjByXAcc( pXAcc ); - long pWnd = (long)( pAccObj->GetParentHWND() ); - return GetAccDocByHWND( pWnd ); + return GetAccDocByHWND( pAccObj->GetParentHWND() ); } bool AccObjectWinManager::IsTopWinAcc( com::sun::star::accessibility::XAccessible* pXAcc ) @@ -1318,4 +1317,4 @@ bool AccObjectWinManager::IsTopWinAcc( com::sun::star::accessibility::XAccessibl bRet = ( pAccObj->GetParentObj() == NULL ); } return bRet; -} \ No newline at end of file +} diff --git a/main/winaccessibility/source/service/AccTopWindowListener.cxx b/main/winaccessibility/source/service/AccTopWindowListener.cxx index 2d47a2d48c..5cdd04122a 100644 --- a/main/winaccessibility/source/service/AccTopWindowListener.cxx +++ b/main/winaccessibility/source/service/AccTopWindowListener.cxx @@ -17,305 +17,305 @@ * 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 - } -} + *************************************************************/ + +#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 void* 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(sal_Int64 pAcc) +{ + if( g_pTop && pAcc != NULL ) + g_pTop->handleWindowOpened( (com::sun::star::accessibility::XAccessible*)((void*)(sal_IntPtr)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 + } +} diff --git a/main/winaccessibility/source/service/msaaservice_impl.cxx b/main/winaccessibility/source/service/msaaservice_impl.cxx index ca6c04500e..8689ccf9d8 100644 --- a/main/winaccessibility/source/service/msaaservice_impl.cxx +++ b/main/winaccessibility/source/service/msaaservice_impl.cxx @@ -17,8 +17,8 @@ * specific language governing permissions and limitations * under the License. * - *************************************************************/ - + *************************************************************/ + #include <cppuhelper/implbase3.hxx> #include <cppuhelper/factory.hxx> #include <cppuhelper/implementationentry.hxx> @@ -30,22 +30,22 @@ #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; + +typedef void* HWND; #include "AccTopWindowListener.hxx" -#include "g_msacc.hxx" +#include "g_msacc.hxx" extern void FreeTopWindowListener(); -extern long GetMSComPtr(long hWnd, long lParam, long wParam); -extern void handleWindowOpened_impl( long pAcc); +extern sal_IntPtr GetMSComPtr( sal_IntPtr hWnd, sal_IntPtr lParam, sal_IntPtr wParam); +extern void handleWindowOpened_impl( sal_Int64 pAcc); namespace my_sc_impl @@ -110,9 +110,9 @@ public: virtual void SAL_CALL initialize( Sequence< Any > const & args ) throw (Exception); // XMSAAService - virtual sal_Int32 SAL_CALL getAccObjectPtr (long hWnd, long lParam, long wParam) + virtual sal_Int64 SAL_CALL getAccObjectPtr (sal_Int64 hWnd, sal_Int64 lParam, sal_Int64 wParam) throw (RuntimeException); - virtual void SAL_CALL handleWindowOpened(sal_Int32) + virtual void SAL_CALL handleWindowOpened(sal_Int64) throw (RuntimeException); // XServiceInfo virtual OUString SAL_CALL getImplementationName() @@ -151,9 +151,9 @@ void MSAAServiceImpl::initialize( Sequence< Any > const & args ) throw (Exceptio * @param * @return Com interface. */ -sal_Int32 MSAAServiceImpl::getAccObjectPtr ( long hWnd, long lParam, long wParam) throw (RuntimeException) +sal_Int64 MSAAServiceImpl::getAccObjectPtr ( sal_Int64 hWnd, sal_Int64 lParam, sal_Int64 wParam) throw (RuntimeException) { - return GetMSComPtr(hWnd, lParam, wParam); + return (sal_Int64)GetMSComPtr((sal_IntPtr)hWnd, (sal_IntPtr)lParam, (sal_IntPtr)wParam); } /** @@ -162,7 +162,7 @@ sal_Int32 MSAAServiceImpl::getAccObjectPtr ( long hWnd, long lParam, long wParam * @param * @return */ -void MSAAServiceImpl::handleWindowOpened( sal_Int32 pAcc) +void MSAAServiceImpl::handleWindowOpened( sal_Int64 pAcc) { handleWindowOpened_impl(pAcc); } @@ -278,7 +278,7 @@ extern "C" 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 )