svdata.cxx (9f62ea84) | svdata.cxx (df906e24) |
---|---|
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 --- 22 unchanged lines hidden (view full) --- 31#include "osl/process.h" 32#include "osl/file.hxx" 33 34#include "tools/debug.hxx" 35#include "tools/resary.hxx" 36 37#include "unotools/fontcfg.hxx" 38 | 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 --- 22 unchanged lines hidden (view full) --- 31#include "osl/process.h" 32#include "osl/file.hxx" 33 34#include "tools/debug.hxx" 35#include "tools/resary.hxx" 36 37#include "unotools/fontcfg.hxx" 38 |
39//IAccessibility2 Implementation 2009----- 40#ifdef WNT 41#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_HPP_ 42#include <com/sun/star/accessibility/XAccessible.hpp> 43#endif 44#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEROLE_HPP_ 45#include <com/sun/star/accessibility/AccessibleRole.hpp> 46#endif 47#endif 48//-----IAccessibility2 Implementation 2009 |
|
39#include "vos/mutex.hxx" 40 41#include "cppuhelper/implbase1.hxx" 42 43#include "uno/current_context.hxx" 44 45#include "vcl/configsettings.hxx" 46#include "vcl/svapp.hxx" --- 15 unchanged lines hidden (view full) --- 62#include "com/sun/star/lang/XComponent.hpp" 63#include "com/sun/star/awt/XExtendedToolkit.hpp" 64#include "com/sun/star/java/JavaNotConfiguredException.hpp" 65#include "com/sun/star/java/JavaVMCreationFailureException.hpp" 66#include "com/sun/star/java/MissingJavaRuntimeException.hpp" 67#include "com/sun/star/java/JavaDisabledException.hpp" 68 69#include <stdio.h> | 49#include "vos/mutex.hxx" 50 51#include "cppuhelper/implbase1.hxx" 52 53#include "uno/current_context.hxx" 54 55#include "vcl/configsettings.hxx" 56#include "vcl/svapp.hxx" --- 15 unchanged lines hidden (view full) --- 72#include "com/sun/star/lang/XComponent.hpp" 73#include "com/sun/star/awt/XExtendedToolkit.hpp" 74#include "com/sun/star/java/JavaNotConfiguredException.hpp" 75#include "com/sun/star/java/JavaVMCreationFailureException.hpp" 76#include "com/sun/star/java/MissingJavaRuntimeException.hpp" 77#include "com/sun/star/java/JavaDisabledException.hpp" 78 79#include <stdio.h> |
80//IAccessibility2 Implementation 2009----- 81#ifdef WNT 82#include <unotools/processfactory.hxx> 83#include <com/sun/star/accessibility/XMSAAService.hpp> 84#include <win/g_msaasvc.h> 85#endif 86//-----IAccessibility2 Implementation 2009 |
|
70 71namespace { 72 73namespace css = com::sun::star; 74 75} 76 77using namespace com::sun::star::uno; --- 49 unchanged lines hidden (view full) --- 127 rtl::OUString aArg; 128 osl_getCommandArg( i, &aArg.pData ); 129 if( aArg.equalsAscii( "-enableautomation" ) ) 130 { 131 pImplSVData->mbIsTestTool = true; 132 break; 133 } 134 } | 87 88namespace { 89 90namespace css = com::sun::star; 91 92} 93 94using namespace com::sun::star::uno; --- 49 unchanged lines hidden (view full) --- 144 rtl::OUString aArg; 145 osl_getCommandArg( i, &aArg.pData ); 146 if( aArg.equalsAscii( "-enableautomation" ) ) 147 { 148 pImplSVData->mbIsTestTool = true; 149 break; 150 } 151 } |
152//IAccessibility2 Implementation 2009----- 153 //Default enable the acc bridge interface 154 pImplSVData->maAppData.m_bEnableAccessInterface =true; 155//-----IAccessibility2 Implementation 2009 |
|
135 136 // mark default layout border as unitialized 137 pImplSVData->maAppData.mnDefaultLayoutBorder = -1; 138} 139 140// ----------------------------------------------------------------------- 141 142void ImplDeInitSVData() --- 191 unchanged lines hidden (view full) --- 334 // jbu->obr: Instantiate here your interaction handler 335 } 336 else if( m_prevContext.is() ) 337 { 338 ret = m_prevContext->getValueByName( Name ); 339 } 340 return ret; 341} | 156 157 // mark default layout border as unitialized 158 pImplSVData->maAppData.mnDefaultLayoutBorder = -1; 159} 160 161// ----------------------------------------------------------------------- 162 163void ImplDeInitSVData() --- 191 unchanged lines hidden (view full) --- 355 // jbu->obr: Instantiate here your interaction handler 356 } 357 else if( m_prevContext.is() ) 358 { 359 ret = m_prevContext->getValueByName( Name ); 360 } 361 return ret; 362} |
363//IAccessibility2 Implementation 2009----- 364#ifdef WNT 365void AccessBridgehandleExistingWindow(Window * pWindow, bool bShow) 366{ 367 if ( pWindow ) 368 { 369 css::uno::Reference< css::accessibility::XAccessible > xAccessible; 370 371 // Test for combo box - drop down floating windows first 372 Window * pParentWindow = pWindow->GetParent(); |
|
342 | 373 |
374 if ( pParentWindow ) 375 { 376 try 377 { 378 // The parent window of a combo box floating window should have the role COMBO_BOX 379 css::uno::Reference< css::accessibility::XAccessible > xParentAccessible(pParentWindow->GetAccessible()); 380 if ( xParentAccessible.is() ) 381 { 382 css::uno::Reference< css::accessibility::XAccessibleContext > xParentAC( xParentAccessible->getAccessibleContext() ); 383 if ( xParentAC.is() && (css::accessibility::AccessibleRole::COMBO_BOX == xParentAC->getAccessibleRole()) ) 384 { 385 // O.k. - this is a combo box floating window corresponding to the child of role LIST of the parent. 386 // Let's not rely on a specific child order, just search for the child with the role LIST 387 sal_Int32 nCount = xParentAC->getAccessibleChildCount(); 388 for ( sal_Int32 n = 0; (n < nCount) && !xAccessible.is(); n++) 389 { 390 css::uno::Reference< css::accessibility::XAccessible > xChild = xParentAC->getAccessibleChild(n); 391 if ( xChild.is() ) 392 { 393 css::uno::Reference< css::accessibility::XAccessibleContext > xChildAC = xChild->getAccessibleContext(); 394 if ( xChildAC.is() && (css::accessibility::AccessibleRole::LIST == xChildAC->getAccessibleRole()) ) 395 { 396 xAccessible = xChild; 397 } 398 } 399 } 400 } 401 } 402 } 403 catch (::com::sun::star::uno::RuntimeException e) 404 { 405 // Ignore show events that throw DisposedExceptions in getAccessibleContext(), 406 // but keep revoking these windows in hide(s). 407 if (bShow) 408 return; 409 } 410 } |
|
343 | 411 |
412 // We have to rely on the fact that Window::GetAccessible()->getAccessibleContext() returns a valid XAccessibleContext 413 // also for other menus than menubar or toplevel popup window. Otherwise we had to traverse the hierarchy to find the 414 // context object to this menu floater. This makes the call to Window->IsMenuFloatingWindow() obsolete. 415 if ( ! xAccessible.is() ) 416 xAccessible = pWindow->GetAccessible(); 417 418 if ( xAccessible.is() && g_acc_manager1 ) 419 { 420 g_acc_manager1->handleWindowOpened( (long)(xAccessible.get())); 421 } 422 } 423} 424 425void AccessBridgeupdateOldTopWindows() 426{ 427 sal_uInt16 nTopWindowCount = (sal_uInt16)Application::GetTopWindowCount(); 428 for (sal_uInt16 i = 0; i < nTopWindowCount; i++) 429 { 430 Window* pTopWindow = Application::GetTopWindow( i ); 431 css::uno::Reference< css::accessibility::XAccessible > xAccessible = pTopWindow->GetAccessible(); 432 if ( xAccessible.is() ) 433 { 434 css::uno::Reference< css::accessibility::XAccessibleContext > xAC(xAccessible->getAccessibleContext()); 435 if ( xAC.is()) 436 { 437 short role = xAC->getAccessibleRole(); 438 if(xAC->getAccessibleName().getLength() > 0) 439 AccessBridgehandleExistingWindow(pTopWindow, true); 440 } 441 } 442 } 443} 444#endif 445//-----IAccessibility2 Implementation 2009 446 |
|
344bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) 345{ 346 rCancelled = sal_False; 347 348 bool bErrorMessage = true; 349 350 // Note: 351 // if bAllowCancel is sal_True we were called from application startup --- 14 unchanged lines hidden (view full) --- 366 367 ImplSVData* pSVData = ImplGetSVData(); 368 if( ! pSVData->mxAccessBridge.is() ) 369 { 370 css::uno::Reference< XMultiServiceFactory > xFactory(vcl::unohelper::GetMultiServiceFactory()); 371 372 if( xFactory.is() ) 373 { | 447bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) 448{ 449 rCancelled = sal_False; 450 451 bool bErrorMessage = true; 452 453 // Note: 454 // if bAllowCancel is sal_True we were called from application startup --- 14 unchanged lines hidden (view full) --- 469 470 ImplSVData* pSVData = ImplGetSVData(); 471 if( ! pSVData->mxAccessBridge.is() ) 472 { 473 css::uno::Reference< XMultiServiceFactory > xFactory(vcl::unohelper::GetMultiServiceFactory()); 474 475 if( xFactory.is() ) 476 { |
477//IAccessibility2 Implementation 2009----- 478 #ifdef WNT 479 pSVData->mxAccessBridge = xFactory->createInstance( 480 OUString::createFromAscii( "com.sun.star.accessibility.MSAAService" ) ); 481 if( pSVData->mxAccessBridge.is() ) 482 { 483 css::uno::Reference< css::uno::XInterface > pRManager= pSVData->mxAccessBridge; 484 g_acc_manager1 = (css::accessibility::XMSAAService*)(pRManager.get()); 485 AccessBridgeupdateOldTopWindows(); 486 } 487 488 if( !pSVData->mxAccessBridge.is() ) 489 bSuccess = false; 490 return bSuccess; 491 #endif 492//-----IAccessibility2 Implementation 2009 |
|
374 css::uno::Reference< XExtendedToolkit > xToolkit = 375 css::uno::Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY); 376 377 Sequence< Any > arguments(1); 378 arguments[0] = makeAny(xToolkit); 379 380 // Disable default java error messages on startup, because they were probably unreadable 381 // for a disabled user. Use native message boxes which are accessible without java support. --- 216 unchanged lines hidden --- | 493 css::uno::Reference< XExtendedToolkit > xToolkit = 494 css::uno::Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY); 495 496 Sequence< Any > arguments(1); 497 arguments[0] = makeAny(xToolkit); 498 499 // Disable default java error messages on startup, because they were probably unreadable 500 // for a disabled user. Use native message boxes which are accessible without java support. --- 216 unchanged lines hidden --- |