svapp.cxx (df906e24) | svapp.cxx (2e2269f7) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 10 unchanged lines hidden (view full) --- 19 * 20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_vcl.hxx" 26 | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 10 unchanged lines hidden (view full) --- 19 * 20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_vcl.hxx" 26 |
27#include "svsys.h" | 27//#include "svsys.h" |
28 29#include "comphelper/processfactory.hxx" 30 31#include "osl/module.h" 32#include "osl/file.hxx" 33#include "osl/thread.h" 34 35#include "rtl/tencinfo.h" --- 1687 unchanged lines hidden (view full) --- 1723extern "C" { static void SAL_CALL thisModule() {} } 1724 1725UnoWrapperBase* Application::GetUnoWrapper( sal_Bool bCreateIfNotExist ) 1726{ 1727 ImplSVData* pSVData = ImplGetSVData(); 1728 static sal_Bool bAlreadyTriedToCreate = sal_False; 1729 if ( !pSVData->mpUnoWrapper && bCreateIfNotExist && !bAlreadyTriedToCreate ) 1730 { | 28 29#include "comphelper/processfactory.hxx" 30 31#include "osl/module.h" 32#include "osl/file.hxx" 33#include "osl/thread.h" 34 35#include "rtl/tencinfo.h" --- 1687 unchanged lines hidden (view full) --- 1723extern "C" { static void SAL_CALL thisModule() {} } 1724 1725UnoWrapperBase* Application::GetUnoWrapper( sal_Bool bCreateIfNotExist ) 1726{ 1727 ImplSVData* pSVData = ImplGetSVData(); 1728 static sal_Bool bAlreadyTriedToCreate = sal_False; 1729 if ( !pSVData->mpUnoWrapper && bCreateIfNotExist && !bAlreadyTriedToCreate ) 1730 { |
1731 ::rtl::OUString aLibName = ::vcl::unohelper::CreateLibraryName( "tk", sal_True ); | 1731 ::rtl::OUString aLibName = ::vcl::unohelper::CreateLibraryName( "ootk", sal_True ); |
1732 oslModule hTkLib = osl_loadModuleRelative( 1733 &thisModule, aLibName.pData, SAL_LOADMODULE_DEFAULT ); 1734 if ( hTkLib ) 1735 { 1736 ::rtl::OUString aFunctionName( RTL_CONSTASCII_USTRINGPARAM( "CreateUnoWrapper" ) ); 1737 FN_TkCreateUnoWrapper fnCreateWrapper = (FN_TkCreateUnoWrapper)osl_getFunctionSymbol( hTkLib, aFunctionName.pData ); 1738 if ( fnCreateWrapper ) 1739 { --- 300 unchanged lines hidden (view full) --- 2040void Application::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType) 2041{ 2042 ImplSVData* pSVData = ImplGetSVData(); 2043 pSVData->mpDefInst->AddToRecentDocumentList(rFileUrl, rMimeType); 2044} 2045 2046sal_Bool Application::IsAccessibilityEnabled() 2047{ | 1732 oslModule hTkLib = osl_loadModuleRelative( 1733 &thisModule, aLibName.pData, SAL_LOADMODULE_DEFAULT ); 1734 if ( hTkLib ) 1735 { 1736 ::rtl::OUString aFunctionName( RTL_CONSTASCII_USTRINGPARAM( "CreateUnoWrapper" ) ); 1737 FN_TkCreateUnoWrapper fnCreateWrapper = (FN_TkCreateUnoWrapper)osl_getFunctionSymbol( hTkLib, aFunctionName.pData ); 1738 if ( fnCreateWrapper ) 1739 { --- 300 unchanged lines hidden (view full) --- 2040void Application::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType) 2041{ 2042 ImplSVData* pSVData = ImplGetSVData(); 2043 pSVData->mpDefInst->AddToRecentDocumentList(rFileUrl, rMimeType); 2044} 2045 2046sal_Bool Application::IsAccessibilityEnabled() 2047{ |
2048//IAccessibility2 Implementation 2009----- 2049#ifdef WNT 2050 return IsWNTInitAccessBridge(); 2051#else | |
2052 return sal_False; | 2048 return sal_False; |
2053#endif 2054//-----IAccessibility2 Implementation 2009 | |
2055} 2056 2057sal_Bool InitAccessBridge( sal_Bool bShowCancel, sal_Bool &rCancelled ) 2058{ | 2049} 2050 2051sal_Bool InitAccessBridge( sal_Bool bShowCancel, sal_Bool &rCancelled ) 2052{ |
2059 sal_Bool bRet = sal_True; 2060 rCancelled = sal_False; | 2053 sal_Bool bRet = true; |
2061 2062// Disable Java bridge on UNIX 2063#if defined UNX 2064 (void) bShowCancel; // unsued | 2054 2055// Disable Java bridge on UNIX 2056#if defined UNX 2057 (void) bShowCancel; // unsued |
2058 (void) rCancelled; // unused |
|
2065#else | 2059#else |
2060 bRet = ImplInitAccessBridge( bShowCancel, rCancelled ); 2061 2062 if( !bRet && bShowCancel && !rCancelled ) 2063 { 2064 // disable accessibility if the user chooses to continue 2065 AllSettings aSettings = Application::GetSettings(); 2066 MiscSettings aMisc = aSettings.GetMiscSettings(); 2067 aMisc.SetEnableATToolSupport( sal_False ); 2068 aSettings.SetMiscSettings( aMisc ); 2069 Application::SetSettings( aSettings ); 2070 } 2071#endif // !UNX |
|
2066 | 2072 |
2067 // Checking TestBridgeRegistered() && HasAtHook() was introduced with IBM's IA2 CWS. 2068 if(TestBridgeRegistered() /* && HasAtHook() */ ) 2069 { 2070 bRet = ImplInitAccessBridge( bShowCancel, rCancelled ); 2071 2072 if( !bRet && bShowCancel && !rCancelled ) 2073 { 2074 // disable accessibility if the user chooses to continue 2075 AllSettings aSettings = Application::GetSettings(); 2076 MiscSettings aMisc = aSettings.GetMiscSettings(); 2077 aMisc.SetEnableATToolSupport( sal_False ); 2078 aSettings.SetMiscSettings( aMisc ); 2079 Application::SetSettings( aSettings ); 2080 } 2081 } 2082 else 2083 { 2084 bRet = sal_False; 2085 } 2086#endif 2087 | |
2088 return bRet; 2089} 2090 | 2073 return bRet; 2074} 2075 |
2091//IAccessibility2 Implementation 2009----- 2092#ifdef WNT 2093sal_Bool HasAtHook() 2094{ 2095 // Added by Steve Yin 2096 sal_Int32 bIsRuning=0; 2097 // BOOL WINAPI SystemParametersInfo( 2098 // __in UINT uiAction, 2099 // __in UINT uiParam, 2100 // __inout PVOID pvParam, 2101 // __in UINT fWinIni 2102 // ); 2103 // pvParam must be BOOL (defined in MFC as int) 2104 // End 2105 if(SystemParametersInfo(SPI_GETSCREENREADER,0,&bIsRuning,0)) 2106 { 2107 if( bIsRuning ) 2108 return sal_True; 2109 } 2110 return sal_False; 2111} 2112#endif 2113//-----IAccessibility2 Implementation 2009 | |
2114// MT: AppProperty, AppEvent was in oldsv.cxx, but is still needed... 2115// ------------------------------------------------------------------------ 2116 2117TYPEINIT0(ApplicationProperty) 2118 2119// ------------------------------------------------------------------------ 2120 2121static PropertyHandler* pHandler=NULL; --- 5 unchanged lines hidden (view full) --- 2127} 2128 2129void Application::SetPropertyHandler( PropertyHandler* p ) 2130{ 2131 if ( pHandler ) 2132 delete pHandler; 2133 pHandler = p; 2134} | 2076// MT: AppProperty, AppEvent was in oldsv.cxx, but is still needed... 2077// ------------------------------------------------------------------------ 2078 2079TYPEINIT0(ApplicationProperty) 2080 2081// ------------------------------------------------------------------------ 2082 2083static PropertyHandler* pHandler=NULL; --- 5 unchanged lines hidden (view full) --- 2089} 2090 2091void Application::SetPropertyHandler( PropertyHandler* p ) 2092{ 2093 if ( pHandler ) 2094 delete pHandler; 2095 pHandler = p; 2096} |
2135//IAccessibility2 Implementation 2009----- 2136bool Application::EnableAccessInterface(bool bEnable) 2137{ 2138#ifdef WNT 2139 return WNTEnableAccessInterface(bEnable); 2140#else 2141 bEnable = TRUE; // avoid compiler warning 2142 return TRUE; 2143#endif 2144} 2145bool Application::IsEnableAccessInterface() 2146{ 2147 return ImplGetSVData()->maAppData.m_bEnableAccessInterface; 2148} 2149//-----IAccessibility2 Implementation 2009 | |
2150 2151 2152 2153void Application::AppEvent( const ApplicationEvent& /*rAppEvent*/ ) 2154{ 2155} | 2097 2098 2099 2100void Application::AppEvent( const ApplicationEvent& /*rAppEvent*/ ) 2101{ 2102} |
2156//IAccessibility2 Implementation 2009----- 2157#ifdef WNT 2158bool TestBridgeRegistered() 2159{ 2160 const CLSID CLSID_MAccessible = {0xCF8DF8BA,0x44FE,0x4B10,{0xBD,0x2E,0x8C,0x8C,0xB3,0x22,0x48,0x5F}}; 2161 2162 LPCOLESTR lpMAcc=L"UAccCOM.MAccessible"; 2163 2164 CLSID mid; 2165 bool bReg = false; 2166 if(S_OK == CLSIDFromProgID(lpMAcc,&mid)) 2167 { 2168 if( IsEqualCLSID(mid,CLSID_MAccessible)) 2169 bReg = true; 2170 else 2171 bReg = false; 2172 } 2173 2174 ImplGetSVData()->maAppData.m_mbIsBridgeRegistered =bReg; 2175 return bReg; 2176} 2177 2178bool IsBridgeRegistered() 2179{ 2180 return ImplGetSVData()->maAppData.m_mbIsBridgeRegistered;; 2181} 2182 2183#endif 2184//-----IAccessibility2 Implementation 2009 | |