fdo#46808, Adapt awt::Toolkit UNO service to new style

Create a merged XToolkit2 interface for this service to implement.
Which is backwards-compatible, but does not require creating a new service.

Also mark sub-interfaces as non-optional.

Change-Id: I278d0288e92be277033013302267cf93f7d70480
This commit is contained in:
Noel Grandin
2012-10-24 16:49:49 +02:00
committed by Stephan Bergmann
parent f252b332dd
commit 33a0f8ce65
54 changed files with 312 additions and 340 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ public:
@onerror -
*/
BaseContainerControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
BaseContainerControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
/**_______________________________________________________________________________________________________
@short -
+3 -3
View File
@@ -144,7 +144,7 @@ public:
@onerror -
*/
BaseControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
BaseControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
/**_______________________________________________________________________________________________________
@short -
@@ -1049,7 +1049,7 @@ protected:
@onerror -
*/
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > impl_getMultiServiceFactory();
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > impl_getComponentContext();
/**_______________________________________________________________________________________________________
@short -
@@ -1217,7 +1217,7 @@ private:
private:
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory ;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xComponentContext ;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xDelegator ;
OMRCListenerMultiplexerHelper* m_pMultiplexer ; // multiplex events
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xMultiplexer ;
@@ -39,8 +39,8 @@ namespace unocontrols{
// construct/destruct
//____________________________________________________________________________________________________________
BaseContainerControl::BaseContainerControl( const Reference< XMultiServiceFactory >& xFactory )
: BaseControl ( xFactory )
BaseContainerControl::BaseContainerControl( const Reference< XComponentContext >& rxContext )
: BaseControl ( rxContext )
, m_aListeners ( m_aMutex )
{
}
+8 -7
View File
@@ -24,6 +24,8 @@
#include <com/sun/star/awt/DeviceInfo.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
@@ -48,16 +50,15 @@ namespace unocontrols{
#define DEFAULT_VISIBLE sal_False
#define DEFAULT_INDESIGNMODE sal_False
#define DEFAULT_ENABLE sal_True
#define SERVICE_VCLTOOLKIT "com.sun.star.awt.Toolkit"
//____________________________________________________________________________________________________________
// construct/destruct
//____________________________________________________________________________________________________________
BaseControl::BaseControl( const Reference< XMultiServiceFactory >& xFactory )
BaseControl::BaseControl( const Reference< XComponentContext >& rxContext )
: IMPL_MutexContainer ( )
, OComponentHelper ( m_aMutex )
, m_xFactory ( xFactory )
, m_xComponentContext ( rxContext )
, m_pMultiplexer ( DEFAULT_PMULTIPLEXER )
, m_nX ( DEFAULT_X )
, m_nY ( DEFAULT_Y )
@@ -335,8 +336,8 @@ void SAL_CALL BaseControl::createPeer( const Reference< XToolkit >& xToo
Reference< XToolkit > xLocalToolkit = xToolkit ;
if ( xLocalToolkit.is() == sal_False )
{
// but first create wellknown toolkit, if it not exist
xLocalToolkit = Reference< XToolkit > ( m_xFactory->createInstance( SERVICE_VCLTOOLKIT ), UNO_QUERY );
// but first create well known toolkit, if it not exist
xLocalToolkit = Reference< XToolkit > ( Toolkit::create(m_xComponentContext), UNO_QUERY_THROW );
}
m_xPeer = xLocalToolkit->createWindow( *pDescriptor );
m_xPeerWindow = Reference< XWindow >( m_xPeer, UNO_QUERY );
@@ -848,9 +849,9 @@ const OUString BaseControl::impl_getStaticImplementationName()
// protected method
//____________________________________________________________________________________________________________
const Reference< XMultiServiceFactory > BaseControl::impl_getMultiServiceFactory()
const Reference< XComponentContext > BaseControl::impl_getComponentContext()
{
return m_xFactory ;
return m_xComponentContext ;
}
//____________________________________________________________________________________________________________
+2 -1
View File
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <comphelper/processfactory.hxx>
#include <cppuhelper/factory.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
@@ -55,7 +56,7 @@ using namespace ::com::sun::star::registry ;
\
static Reference< XInterface > SAL_CALL CLASS##_createInstance ( const Reference< XMultiServiceFactory >& rServiceManager ) throw ( Exception ) \
{ \
return Reference< XInterface >( *(OWeakObject*)(new CLASS( rServiceManager )) ); \
return Reference< XInterface >( *(OWeakObject*)(new CLASS( comphelper::getComponentContext(rServiceManager) )) ); \
}
//******************************************************************************************************************************
+6 -6
View File
@@ -49,8 +49,8 @@ namespace unocontrols{
// construct/destruct
//______________________________________________________________________________________________________________
FrameControl::FrameControl( const Reference< XMultiServiceFactory >& xFactory )
: BaseControl ( xFactory )
FrameControl::FrameControl( const Reference< XComponentContext >& rxContext)
: BaseControl ( rxContext )
, OBroadcastHelper ( m_aMutex )
, OPropertySetHelper ( *(static_cast< OBroadcastHelper * >(this)) )
, m_aInterfaceContainer ( m_aMutex )
@@ -467,7 +467,9 @@ void FrameControl::impl_createFrame( const Reference< XWindowPeer >& xPee
xOldFrame = m_xFrame ;
}
xNewFrame = Reference< XFrame > ( impl_getMultiServiceFactory()->createInstance ( "com.sun.star.frame.Frame" ), UNO_QUERY ) ;
xNewFrame = Reference< XFrame > ( impl_getComponentContext()->getServiceManager()->createInstanceWithContext("com.sun.star.frame.Frame", impl_getComponentContext()), UNO_QUERY ) ;
Reference< XDispatchProvider > xDSP ( xNewFrame, UNO_QUERY ) ;
if (xDSP.is())
@@ -478,9 +480,7 @@ void FrameControl::impl_createFrame( const Reference< XWindowPeer >& xPee
// option
//xFrame->setName( "WhatYouWant" );
Reference< XURLTransformer > xTrans (
URLTransformer::create(
::comphelper::getComponentContext( impl_getMultiServiceFactory() ) ) );
Reference< XURLTransformer > xTrans = URLTransformer::create( impl_getComponentContext() );
// load file
URL aURL ;
+2 -2
View File
@@ -42,8 +42,8 @@ namespace unocontrols{
// construct/destruct
//____________________________________________________________________________________________________________
ProgressBar::ProgressBar( const Reference< XMultiServiceFactory >& xFactory )
: BaseControl ( xFactory )
ProgressBar::ProgressBar( const Reference< XComponentContext >& rxContext )
: BaseControl ( rxContext )
, m_bHorizontal ( PROGRESSBAR_DEFAULT_HORIZONTAL )
, m_aBlockSize ( PROGRESSBAR_DEFAULT_BLOCKDIMENSION )
, m_nForegroundColor ( PROGRESSBAR_DEFAULT_FOREGROUNDCOLOR )
+15 -13
View File
@@ -47,20 +47,21 @@ namespace unocontrols{
// construct/destruct
//____________________________________________________________________________________________________________
ProgressMonitor::ProgressMonitor( const Reference< XMultiServiceFactory >& xFactory )
: BaseContainerControl ( xFactory )
ProgressMonitor::ProgressMonitor( const Reference< XComponentContext >& rxContext )
: BaseContainerControl ( rxContext )
{
// Its not allowed to work with member in this method (refcounter !!!)
// But with a HACK (++refcount) its "OK" :-(
++m_refCount ;
// Create instances for fixedtext, button and progress ...
m_xTopic_Top = Reference< XFixedText > ( xFactory->createInstance ( FIXEDTEXT_SERVICENAME ), UNO_QUERY ) ;
m_xText_Top = Reference< XFixedText > ( xFactory->createInstance ( FIXEDTEXT_SERVICENAME ), UNO_QUERY ) ;
m_xTopic_Bottom = Reference< XFixedText > ( xFactory->createInstance ( FIXEDTEXT_SERVICENAME ), UNO_QUERY ) ;
m_xText_Bottom = Reference< XFixedText > ( xFactory->createInstance ( FIXEDTEXT_SERVICENAME ), UNO_QUERY ) ;
m_xButton = Reference< XButton > ( xFactory->createInstance ( BUTTON_SERVICENAME ), UNO_QUERY ) ;
m_xProgressBar = Reference< XProgressBar > ( xFactory->createInstance ( SERVICENAME_PROGRESSBAR ), UNO_QUERY ) ;
m_xTopic_Top = Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY ) ;
m_xText_Top = Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY ) ;
m_xTopic_Bottom = Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY ) ;
m_xText_Bottom = Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY ) ;
m_xButton = Reference< XButton > ( rxContext->getServiceManager()->createInstanceWithContext( BUTTON_SERVICENAME, rxContext ), UNO_QUERY ) ;
m_xProgressBar = Reference< XProgressBar > ( rxContext->getServiceManager()->createInstanceWithContext( SERVICENAME_PROGRESSBAR, rxContext ), UNO_QUERY ) ;
// ... cast controls to Reference< XControl > (for "setModel"!) ...
Reference< XControl > xRef_Topic_Top ( m_xTopic_Top , UNO_QUERY ) ;
@@ -70,12 +71,13 @@ ProgressMonitor::ProgressMonitor( const Reference< XMultiServiceFactory >& xFact
Reference< XControl > xRef_Button ( m_xButton , UNO_QUERY ) ;
Reference< XControl > xRef_ProgressBar ( m_xProgressBar , UNO_QUERY ) ;
// ... set models ...
xRef_Topic_Top->setModel ( Reference< XControlModel > ( xFactory->createInstance ( FIXEDTEXT_MODELNAME ), UNO_QUERY ) ) ;
xRef_Text_Top->setModel ( Reference< XControlModel > ( xFactory->createInstance ( FIXEDTEXT_MODELNAME ), UNO_QUERY ) ) ;
xRef_Topic_Bottom->setModel ( Reference< XControlModel > ( xFactory->createInstance ( FIXEDTEXT_MODELNAME ), UNO_QUERY ) ) ;
xRef_Text_Bottom->setModel ( Reference< XControlModel > ( xFactory->createInstance ( FIXEDTEXT_MODELNAME ), UNO_QUERY ) ) ;
xRef_Button->setModel ( Reference< XControlModel > ( xFactory->createInstance ( BUTTON_MODELNAME ), UNO_QUERY ) ) ;
xRef_Topic_Top->setModel ( Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) ) ;
xRef_Text_Top->setModel ( Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) ) ;
xRef_Topic_Bottom->setModel ( Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) ) ;
xRef_Text_Bottom->setModel ( Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) ) ;
xRef_Button->setModel ( Reference< XControlModel > ( rxContext->getServiceManager()->createInstanceWithContext( BUTTON_MODELNAME, rxContext ), UNO_QUERY ) ) ;
// ProgressBar has no model !!!
// ... and add controls to basecontainercontrol!
@@ -39,21 +39,21 @@ namespace unocontrols{
// construct/destruct
//____________________________________________________________________________________________________________
StatusIndicator::StatusIndicator( const Reference< XMultiServiceFactory >& xFactory )
: BaseContainerControl ( xFactory )
StatusIndicator::StatusIndicator( const Reference< XComponentContext >& rxContext )
: BaseContainerControl ( rxContext )
{
// Its not allowed to work with member in this method (refcounter !!!)
// But with a HACK (++refcount) its "OK" :-(
++m_refCount ;
// Create instances for fixedtext and progress ...
m_xText = Reference< XFixedText > ( xFactory->createInstance( FIXEDTEXT_SERVICENAME ), UNO_QUERY );
m_xProgressBar = Reference< XProgressBar > ( xFactory->createInstance( SERVICENAME_PROGRESSBAR ), UNO_QUERY );
m_xText = Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY );
m_xProgressBar = Reference< XProgressBar > ( rxContext->getServiceManager()->createInstanceWithContext( SERVICENAME_PROGRESSBAR, rxContext ), UNO_QUERY );
// ... cast controls to Reference< XControl > and set model ...
// ( ProgressBar has no model !!! )
Reference< XControl > xTextControl ( m_xText , UNO_QUERY );
Reference< XControl > xProgressControl ( m_xProgressBar, UNO_QUERY );
xTextControl->setModel( Reference< XControlModel >( xFactory->createInstance( FIXEDTEXT_MODELNAME ), UNO_QUERY ) );
xTextControl->setModel( Reference< XControlModel >( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) );
// ... and add controls to basecontainercontrol!
addControl( CONTROLNAME_TEXT, xTextControl );
addControl( CONTROLNAME_PROGRESSBAR, xProgressControl );
+1 -1
View File
@@ -84,7 +84,7 @@ public:
@onerror
*/
FrameControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
FrameControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
/**_________________________________________________________________________________________________________
@short
+1 -1
View File
@@ -73,7 +73,7 @@ public:
@onerror
*/
ProgressBar( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
ProgressBar( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
/**_________________________________________________________________________________________________________
@short
+1 -1
View File
@@ -128,7 +128,7 @@ public:
@onerror
*/
ProgressMonitor( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
ProgressMonitor( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
/**_______________________________________________________________________________________________________
@short
+1 -1
View File
@@ -84,7 +84,7 @@ class StatusIndicator : public ::com::sun::star::awt::XLayoutConstrains
@onerror
*/
StatusIndicator( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
StatusIndicator( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
/**_______________________________________________________________________________________________________
@short
@@ -42,7 +42,7 @@
#include "com/sun/star/awt/WindowAttribute.hpp"
#include "com/sun/star/awt/WindowClass.hpp"
#include "com/sun/star/awt/WindowDescriptor.hpp"
#include "com/sun/star/awt/XToolkit.hpp"
#include "com/sun/star/awt/Toolkit.hpp"
#include "com/sun/star/awt/XWindow.hpp"
#include "com/sun/star/awt/XWindowPeer.hpp"
#include "com/sun/star/beans/NamedValue.hpp"
@@ -554,17 +554,9 @@ UpdateDialog::UpdateDialog(
m_xExtensionManager = deployment::ExtensionManager::get( context );
uno::Reference< awt::XToolkit > toolkit;
uno::Reference< awt::XToolkit2 > toolkit;
try {
toolkit = uno::Reference< awt::XToolkit >(
(uno::Reference< lang::XMultiComponentFactory >(
m_context->getServiceManager(),
uno::UNO_QUERY_THROW)->
createInstanceWithContext(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit")),
m_context)),
uno::UNO_QUERY_THROW);
toolkit = awt::Toolkit::create(m_context);
} catch (const uno::RuntimeException &) {
throw;
} catch (const uno::Exception & e) {
@@ -31,6 +31,7 @@
#include "boost/noncopyable.hpp"
#include "com/sun/star/awt/MessageBoxButtons.hpp"
#include "com/sun/star/awt/Rectangle.hpp"
#include "com/sun/star/awt/Toolkit.hpp"
#include "com/sun/star/awt/XMessageBox.hpp"
#include "com/sun/star/awt/XMessageBoxFactory.hpp"
#include "com/sun/star/awt/XWindowPeer.hpp"
@@ -235,13 +236,12 @@ void Dispatch::dispatch(
css::uno::Sequence< css::beans::PropertyValue > const &)
throw (css::uno::RuntimeException)
{
css::uno::Reference< css::lang::XMultiComponentFactory > smgr(
context_->getServiceManager(), css::uno::UNO_SET_THROW);
css::uno::Reference< css::lang::XMultiComponentFactory > smgr( context_->getServiceManager(), css::uno::UNO_SET_THROW);
css::uno::Reference< css::awt::XToolkit > toolkit( css::awt::Toolkit::create(context_), css::uno::UNO_SET_THROW);
css::uno::Reference< css::awt::XMessageBox > box(
css::uno::Reference< css::awt::XMessageBoxFactory >(
smgr->createInstanceWithContext(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.awt.Toolkit")), context_),
toolkit,
css::uno::UNO_QUERY_THROW)->createMessageBox(
css::uno::Reference< css::awt::XWindowPeer >(
css::uno::Reference< css::frame::XFrame >(
@@ -32,6 +32,7 @@
#include "com/sun/star/awt/MessageBoxButtons.hpp"
#include "com/sun/star/awt/Rectangle.hpp"
#include "com/sun/star/awt/XMessageBox.hpp"
#include "com/sun/star/awt/Toolkit.hpp"
#include "com/sun/star/awt/XMessageBoxFactory.hpp"
#include "com/sun/star/awt/XWindowPeer.hpp"
#include "com/sun/star/beans/PropertyValue.hpp"
@@ -233,13 +234,12 @@ void Dispatch::dispatch(
css::uno::Sequence< css::beans::PropertyValue > const &)
throw (css::uno::RuntimeException)
{
css::uno::Reference< css::lang::XMultiComponentFactory > smgr(
context_->getServiceManager(), css::uno::UNO_SET_THROW);
css::uno::Reference< css::lang::XMultiComponentFactory > smgr(context_->getServiceManager(), css::uno::UNO_SET_THROW);
css::uno::Reference< css::awt::XToolkit > toolkit( css::awt::Toolkit::create(context_), css::uno::UNO_SET_THROW);
css::uno::Reference< css::awt::XMessageBox > box(
css::uno::Reference< css::awt::XMessageBoxFactory >(
smgr->createInstanceWithContext(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.awt.Toolkit")), context_),
toolkit,
css::uno::UNO_QUERY_THROW)->createMessageBox(
css::uno::Reference< css::awt::XWindowPeer >(
css::uno::Reference< css::frame::XFrame >(
+3 -5
View File
@@ -38,6 +38,7 @@
#include <com/sun/star/frame/XControllerBorder.hpp>
#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/awt/XView.hpp>
@@ -454,11 +455,8 @@ sal_Bool DocumentHolder::ShowInplace( const uno::Reference< awt::XWindowPeer >&
awt::Rectangle(),//aOwnRectangle,
awt::WindowAttribute::SHOW | awt::VclWindowPeerAttribute::CLIPCHILDREN );
uno::Reference< awt::XToolkit > xToolkit(
m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" )) ),
uno::UNO_QUERY );
if ( !xToolkit.is() )
throw uno::RuntimeException();
uno::Reference< awt::XToolkit2 > xToolkit =
awt::Toolkit::create(comphelper::getComponentContext(m_xFactory));
uno::Reference< awt::XWindowPeer > xNewWinPeer = xToolkit->createWindow( aOwnWinDescriptor );
uno::Reference< awt::XWindow > xOwnWindow( xNewWinPeer, uno::UNO_QUERY );
+26 -32
View File
@@ -31,6 +31,7 @@
#include "common.h"
#include <Windows.h>
#include <com/sun/star/lang/SystemDependent.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XSystemChildFactory.hpp>
#include <com/sun/star/awt/XSystemDependentWindowPeer.hpp>
#include <com/sun/star/awt/XSystemDependentMenuPeer.hpp>
@@ -283,36 +284,32 @@ HRESULT DocumentHolder::InPlaceActivate(
HWND hWndxWinParent(0);
uno::Reference<awt::XWindow> xWin;
static const ::rtl::OUString aToolkitServiceName(
RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.awt.Toolkit" ) );
uno::Reference<awt::XSystemChildFactory> xToolkit(
m_xFactory->createInstance(aToolkitServiceName ),uno::UNO_QUERY);
uno::Reference<awt::XToolkit2> xToolkit =
awt::Toolkit::create(comphelper::getComponentContext(m_xFactory));
if(xToolkit.is()) {
// create system window wrapper for hwnd
if( !m_pCHatchWin )
m_pCHatchWin = new winwrap::CHatchWin(
m_hInstance,this);
// create system window wrapper for hwnd
if( !m_pCHatchWin )
m_pCHatchWin = new winwrap::CHatchWin(
m_hInstance,this);
if(m_pCHatchWin->Init(hWndSite,/*ID_HATCHWINDOW*/2000, NULL)) {
m_pCHatchWin->RectsSet(&rcPos,&rcClip); //set visible area
hWndxWinParent = m_pCHatchWin->Window();
ShowWindow(hWndxWinParent,SW_SHOW); //Make visible.
}
else {
// no success initializing hatch window
delete m_pCHatchWin, m_pCHatchWin = 0;
hWndxWinParent = hWndSite;
}
aAny <<= sal_Int32(hWndxWinParent);
xWin = uno::Reference<awt::XWindow>(
xToolkit->createSystemChild(
aAny,
aProcessIdent,
lang::SystemDependent::SYSTEM_WIN32),
uno::UNO_QUERY);
if(m_pCHatchWin->Init(hWndSite,/*ID_HATCHWINDOW*/2000, NULL)) {
m_pCHatchWin->RectsSet(&rcPos,&rcClip); //set visible area
hWndxWinParent = m_pCHatchWin->Window();
ShowWindow(hWndxWinParent,SW_SHOW); //Make visible.
}
else {
// no success initializing hatch window
delete m_pCHatchWin, m_pCHatchWin = 0;
hWndxWinParent = hWndSite;
}
aAny <<= sal_Int32(hWndxWinParent);
xWin = uno::Reference<awt::XWindow>(
xToolkit->createSystemChild(
aAny,
aProcessIdent,
lang::SystemDependent::SYSTEM_WIN32),
uno::UNO_QUERY);
if(xWin.is()) {
xWin->setPosSize(
@@ -1301,12 +1298,9 @@ DocumentHolder::getContainerWindow(
uno::Reference<awt::XWindow> xWin(0);
static const ::rtl::OUString aToolkitServiceName(
RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.awt.Toolkit" ) );
uno::Reference<awt::XSystemChildFactory> xToolkit(
m_xFactory->createInstance(aToolkitServiceName ),uno::UNO_QUERY);
uno::Reference<awt::XToolkit2> xToolkit = awt::Toolkit::create( comphelper::getComponentContext(m_xFactory) );
if(xToolkit.is() && m_pIOleIPFrame) {
if(m_pIOleIPFrame) {
HWND hWnd;
m_pIOleIPFrame->GetWindow(&hWnd);
@@ -31,6 +31,7 @@
#include <com/sun/star/frame/DispatchHelper.hpp>
#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
#include <com/sun/star/lang/SystemDependent.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XSystemChildFactory.hpp>
#include <com/sun/star/awt/XVclWindowPeer.hpp>
#include <com/sun/star/util/XCloseable.hpp>
@@ -132,15 +133,11 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent)
try
{
Reference< beans::XPropertySet > xFactoryProperties( mxRemoteMSF, uno::UNO_QUERY );
Reference< uno::XComponentContext > xContext( xFactoryProperties->getPropertyValue( "DefaultContext" ), UNO_QUERY );
// try to create netscape plugin window
Reference< awt::XToolkit > xToolkit(
mxRemoteMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit")) ),
uno::UNO_QUERY );
if( !xToolkit.is() )
{
debug_fprintf(NSP_LOG_APPEND, "Can not create Toolkit!\n");
return sal_False;
}
Reference< awt::XToolkit > xToolkit( awt::Toolkit::create(xContext), uno::UNO_QUERY_THROW );
// prepare parameters for plugin window
css::uno::Any hwndParent = css::uno::makeAny((sal_Int32)hParent);
@@ -240,8 +237,6 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent)
}
//create stream for the document
Reference< uno::XComponentContext > xContext(
comphelper::getComponentContext( mxRemoteMSF ) );
Reference< ucb::XSimpleFileAccess2 > xSimpleFileAccess( ucb::SimpleFileAccess::create(xContext) );
Reference<io::XInputStream> xInputStream = xSimpleFileAccess->openFileRead( m_sURL );
-1
View File
@@ -38,7 +38,6 @@ namespace framework{
#define SERVICENAME_MEDIATYPEDETECTIONHELPER DECLARE_ASCII("com.sun.star.frame.MediaTypeDetectionHelper" )
#define SERVICENAME_LOGINDIALOG DECLARE_ASCII("com.sun.star.framework.LoginDialog" )
#define SERVICENAME_CONFIGURATION DECLARE_ASCII("com.sun.star.configuration.ConfigurationRegistry" )
#define SERVICENAME_VCLTOOLKIT DECLARE_ASCII("com.sun.star.awt.Toolkit" )
#define SERVICENAME_SIMPLEREGISTRY DECLARE_ASCII("com.sun.star.registry.SimpleRegistry" )
#define SERVICENAME_NESTEDREGISTRY DECLARE_ASCII("com.sun.star.registry.NestedRegistry" )
#define SERVICENAME_GENERICFRAMELOADER DECLARE_ASCII("com.sun.star.comp.office.FilterDetect" )
+2 -2
View File
@@ -33,7 +33,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XSingleComponentFactory.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/awt/XToolkit.hpp>
#include <com/sun/star/awt/XToolkit2.hpp>
#include <cppuhelper/implbase2.hxx>
#include <rtl/ustring.hxx>
@@ -57,7 +57,7 @@ class TabWinFactory : protected ThreadHelpBase
private:
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > m_xToolkit;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit2 > m_xToolkit;
};
}
@@ -33,7 +33,6 @@
#include <services.h>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <com/sun/star/awt/XToolkit.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/awt/WindowDescriptor.hpp>
#include <com/sun/star/awt/PosSize.hpp>
@@ -34,7 +34,6 @@
#include <properties.h>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <com/sun/star/awt/XToolkit.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/awt/WindowDescriptor.hpp>
#include <com/sun/star/awt/PosSize.hpp>
+14 -20
View File
@@ -31,6 +31,7 @@
#include <services.h>
#include <com/sun/star/ui/DockingArea.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/frame/XDispatchHelper.hpp>
#include <com/sun/star/awt/XDockableWindow.hpp>
@@ -38,6 +39,7 @@
#include <com/sun/star/awt/XWindowListener.hpp>
#include <com/sun/star/ui/XUIElement.hpp>
#include <comphelper/processfactory.hxx>
#include <comphelper/mediadescriptor.hxx>
#include <vcl/svapp.hxx>
#include <toolkit/unohlp.hxx>
@@ -169,29 +171,21 @@ bool lcl_checkUIElement(const uno::Reference< ui::XUIElement >& xUIElement, awt:
return bRet;
}
uno::Reference< awt::XWindowPeer > createToolkitWindow( const uno::Reference< lang::XMultiServiceFactory >& rFactory, const uno::Reference< awt::XWindowPeer >& rParent, const char* pService )
uno::Reference< awt::XWindowPeer > createToolkitWindow( const uno::Reference< uno::XComponentContext >& rxContext, const uno::Reference< awt::XWindowPeer >& rParent, const char* pService )
{
const rtl::OUString aAWTToolkit( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ));
uno::Reference< awt::XToolkit2 > xToolkit = awt::Toolkit::create( rxContext );
uno::Reference< awt::XWindowPeer > xPeer;
if ( rFactory.is() )
{
uno::Reference< awt::XToolkit > xToolkit( rFactory->createInstance( aAWTToolkit ), uno::UNO_QUERY_THROW );
if ( xToolkit.is() )
{
// describe window properties.
css::awt::WindowDescriptor aDescriptor;
aDescriptor.Type = awt::WindowClass_SIMPLE;
aDescriptor.WindowServiceName = ::rtl::OUString::createFromAscii( pService );
aDescriptor.ParentIndex = -1;
aDescriptor.Parent = uno::Reference< awt::XWindowPeer >( rParent, uno::UNO_QUERY );
aDescriptor.Bounds = awt::Rectangle(0,0,0,0);
aDescriptor.WindowAttributes = 0;
// describe window properties.
css::awt::WindowDescriptor aDescriptor;
aDescriptor.Type = awt::WindowClass_SIMPLE;
aDescriptor.WindowServiceName = ::rtl::OUString::createFromAscii( pService );
aDescriptor.ParentIndex = -1;
aDescriptor.Parent = uno::Reference< awt::XWindowPeer >( rParent, uno::UNO_QUERY );
aDescriptor.Bounds = awt::Rectangle(0,0,0,0);
aDescriptor.WindowAttributes = 0;
// create a awt window
xPeer = xToolkit->createWindow( aDescriptor );
}
}
// create a awt window
uno::Reference< awt::XWindowPeer > xPeer = xToolkit->createWindow( aDescriptor );
return xPeer;
}
+4 -2
View File
@@ -34,6 +34,8 @@
#include <properties.h>
#include <com/sun/star/awt/XWindowPeer.hpp>
#include <com/sun/star/awt/XToolkit2.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/ui/XUIElement.hpp>
@@ -66,7 +68,7 @@ SystemWindow* getTopSystemWindow( const ::com::sun::star::uno::Reference< ::com:
bool equalRectangles( const css::awt::Rectangle& rRect1, const css::awt::Rectangle& rRect2 );
void setZeroRectangle( ::Rectangle& rRect );
bool lcl_checkUIElement(const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >& xUIElement,::com::sun::star::awt::Rectangle& _rPosSize, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xWindow);
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > createToolkitWindow( const css::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rFactory, const css::uno::Reference< ::com::sun::star::awt::XWindowPeer >& rParent, const char* pService );
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > createToolkitWindow( const css::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const css::uno::Reference< ::com::sun::star::awt::XWindowPeer >& rParent, const char* pService );
WindowAlign ImplConvertAlignment( sal_Int16 aAlignment );
::rtl::OUString getElementTypeFromResourceURL( const ::rtl::OUString& aResourceURL );
void parseResourceURL( const rtl::OUString& aResourceURL, rtl::OUString& aElementType, rtl::OUString& aElementName );
@@ -77,7 +79,7 @@ sal_Bool implts_isPreviewModel( const ::com::sun::star::uno::Reference< ::com::s
sal_Bool implts_isFrameOrWindowTop( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame );
void impl_setDockingWindowVisibility( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& rSMGR, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& rDockingWindowName, bool bVisible );
void impl_addWindowListeners( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xThis, const ::com::sun::star::uno::Reference< css::ui::XUIElement >& xUIElement );
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > implts_createToolkitWindow( const css::uno::Reference< ::com::sun::star::awt::XToolkit >& rToolkit, const css::uno::Reference< ::com::sun::star::awt::XWindowPeer >& rParent );
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > implts_createToolkitWindow( const css::uno::Reference< ::com::sun::star::awt::XToolkit2 >& rToolkit, const css::uno::Reference< ::com::sun::star::awt::XWindowPeer >& rParent );
}
@@ -34,6 +34,7 @@
#include <uiconfiguration/windowstateconfiguration.hxx>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/ui/UIElementType.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
@@ -82,7 +83,7 @@ ToolbarLayoutManager::ToolbarLayoutManager(
setZeroRectangle( m_aDockingArea );
// create toolkit object
m_xToolkit = uno::Reference< awt::XToolkit >( m_xSMGR->createInstance( SERVICENAME_VCLTOOLKIT ), uno::UNO_QUERY );
m_xToolkit = awt::Toolkit::create( comphelper::getComponentContext(m_xSMGR) );
}
ToolbarLayoutManager::~ToolbarLayoutManager()
@@ -912,10 +913,10 @@ void ToolbarLayoutManager::setParentWindow(
{
static const char DOCKINGAREASTRING[] = "dockingarea";
uno::Reference< awt::XWindow > xTopDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( m_xSMGR, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
uno::Reference< awt::XWindow > xLeftDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( m_xSMGR, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
uno::Reference< awt::XWindow > xRightDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( m_xSMGR, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
uno::Reference< awt::XWindow > xBottomDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( m_xSMGR, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
uno::Reference< awt::XWindow > xTopDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( comphelper::getComponentContext(m_xSMGR), xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
uno::Reference< awt::XWindow > xLeftDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( comphelper::getComponentContext(m_xSMGR), xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
uno::Reference< awt::XWindow > xRightDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( comphelper::getComponentContext(m_xSMGR), xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
uno::Reference< awt::XWindow > xBottomDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( comphelper::getComponentContext(m_xSMGR), xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
WriteGuard aWriteLock( m_aLock );
m_xContainerWindow = uno::Reference< awt::XWindow2 >( xParentWindow, uno::UNO_QUERY );
@@ -63,6 +63,7 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/ui/XUIElementFactory.hpp>
#include <com/sun/star/ui/DockingArea.hpp>
#include <com/sun/star/awt/XToolkit2.hpp>
#include <com/sun/star/awt/XTopWindow2.hpp>
#include <com/sun/star/awt/XWindow2.hpp>
#include <com/sun/star/awt/XDockableWindow.hpp>
@@ -305,7 +306,7 @@ class ToolbarLayoutManager : public ::cppu::WeakImplHelper3< ::com::sun::star::a
css::uno::Reference< ::com::sun::star::ui::XUIElementFactory > m_xUIElementFactoryManager;
css::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xModuleCfgMgr;
css::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xDocCfgMgr;
css::uno::Reference< ::com::sun::star::awt::XToolkit > m_xToolkit;
css::uno::Reference< ::com::sun::star::awt::XToolkit2 > m_xToolkit;
css::uno::Reference< ::com::sun::star::container::XNameAccess > m_xPersistentWindowState;
ILayoutNotifications* m_pParentLayouter;
+11 -16
View File
@@ -44,6 +44,7 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XDataTransferProviderAccess.hpp>
#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
#include <com/sun/star/awt/KeyEvent.hpp>
@@ -471,15 +472,12 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f
::framework::DropTargetListener* pDropListener = new ::framework::DropTargetListener(m_xSMGR, m_xFrame);
m_xDropTargetListener = css::uno::Reference< css::datatransfer::dnd::XDropTargetListener >(static_cast< ::cppu::OWeakObject* >(pDropListener), css::uno::UNO_QUERY);
css::uno::Reference< css::awt::XDataTransferProviderAccess > xTransfer(m_xSMGR->createInstance(SERVICENAME_VCLTOOLKIT), css::uno::UNO_QUERY);
if (xTransfer.is())
css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(m_xSMGR) );
css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xToolkit->getDropTarget(m_xWindow);
if (xDropTarget.is())
{
css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xTransfer->getDropTarget(m_xWindow);
if (xDropTarget.is())
{
xDropTarget->addDropTargetListener(m_xDropTargetListener);
xDropTarget->setActive(sal_True);
}
xDropTarget->addDropTargetListener(m_xDropTargetListener);
xDropTarget->setActive(sal_True);
}
// initialize the component and it's parent window
@@ -690,15 +688,12 @@ void SAL_CALL BackingComp::dispose()
// deregister drag&drop helper
if (m_xDropTargetListener.is())
{
css::uno::Reference< css::awt::XDataTransferProviderAccess > xTransfer(m_xSMGR->createInstance(SERVICENAME_VCLTOOLKIT), css::uno::UNO_QUERY);
if (xTransfer.is())
css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(m_xSMGR) );
css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xToolkit->getDropTarget(m_xWindow);
if (xDropTarget.is())
{
css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xTransfer->getDropTarget(m_xWindow);
if (xDropTarget.is())
{
xDropTarget->removeDropTargetListener(m_xDropTargetListener);
xDropTarget->setActive(sal_False);
}
xDropTarget->removeDropTargetListener(m_xDropTargetListener);
xDropTarget->setActive(sal_False);
}
m_xDropTargetListener = css::uno::Reference< css::datatransfer::dnd::XDropTargetListener >();
}
-1
View File
@@ -48,7 +48,6 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <com/sun/star/awt/XToolkit.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
#include <com/sun/star/awt/WindowDescriptor.hpp>
+11 -16
View File
@@ -54,6 +54,7 @@
#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
@@ -2926,15 +2927,12 @@ void Frame::implts_startWindowListening()
{
xTopWindow->addTopWindowListener( xTopWindowListener );
css::uno::Reference< css::awt::XDataTransferProviderAccess > xTransfer( xFactory->createInstance( SERVICENAME_VCLTOOLKIT ), css::uno::UNO_QUERY );
if( xTransfer.is() == sal_True )
css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(xFactory) );
css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xToolkit->getDropTarget( xContainerWindow );
if( xDropTarget.is() == sal_True )
{
css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xTransfer->getDropTarget( xContainerWindow );
if( xDropTarget.is() == sal_True )
{
xDropTarget->addDropTargetListener( xDragDropListener );
xDropTarget->setActive( sal_True );
}
xDropTarget->addDropTargetListener( xDragDropListener );
xDropTarget->setActive( sal_True );
}
}
}
@@ -2969,15 +2967,12 @@ void Frame::implts_stopWindowListening()
{
xTopWindow->removeTopWindowListener( xTopWindowListener );
css::uno::Reference< css::awt::XDataTransferProviderAccess > xTransfer( xFactory->createInstance( SERVICENAME_VCLTOOLKIT ), css::uno::UNO_QUERY );
if( xTransfer.is() == sal_True )
css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(xFactory) );
css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xToolkit->getDropTarget( xContainerWindow );
if( xDropTarget.is() == sal_True )
{
css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xTransfer->getDropTarget( xContainerWindow );
if( xDropTarget.is() == sal_True )
{
xDropTarget->removeDropTargetListener( xDragDropListener );
xDropTarget->setActive( sal_False );
}
xDropTarget->removeDropTargetListener( xDragDropListener );
xDropTarget->setActive( sal_False );
}
}
}
+2 -1
View File
@@ -40,6 +40,7 @@
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/awt/WindowDescriptor.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
@@ -220,7 +221,7 @@ css::uno::Reference< css::awt::XWindow > TaskCreatorService::implts_createContai
// <- SAFE
// get toolkit to create task container window
css::uno::Reference< css::awt::XToolkit > xToolkit( xSMGR->createInstance( SERVICENAME_VCLTOOLKIT ), css::uno::UNO_QUERY_THROW);
css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(xSMGR) );
// Check if child frames can be created realy. We need at least a valid window at the parent frame ...
css::uno::Reference< css::awt::XWindowPeer > xParentWindowPeer;
+3 -3
View File
@@ -32,6 +32,7 @@
#include <threadhelp/resetableguard.hxx>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/awt/WindowDescriptor.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -299,15 +300,14 @@ throw (css::uno::Exception, css::uno::RuntimeException)
{
css::beans::PropertyValue aPropValue;
css::uno::Reference< css::awt::XTopWindow > xTopWindow;
css::uno::Reference< css::awt::XToolkit > xToolkit;
css::uno::Reference< css::awt::XToolkit2 > xToolkit;
css::awt::WindowDescriptor aDescriptor;
if ( xSMGR.is() )
{
try
{
xToolkit = css::uno::Reference< css::awt::XToolkit >(
xSMGR->createInstance( SERVICENAME_VCLTOOLKIT ), css::uno::UNO_QUERY );
xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(xSMGR) );
}
catch ( const css::uno::RuntimeException& )
{
+22 -27
View File
@@ -33,6 +33,7 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
@@ -90,7 +91,7 @@ throw ( css::uno::Exception, css::uno::RuntimeException )
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
ResetableGuard aLock( m_aLock );
css::uno::Reference< css::awt::XToolkit > xToolkit = m_xToolkit;
css::uno::Reference< css::awt::XToolkit2 > xToolkit = m_xToolkit;
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR( m_xServiceManager );
aLock.unlock();
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
@@ -110,37 +111,31 @@ throw ( css::uno::Exception, css::uno::RuntimeException )
if ( !xToolkit.is() && xSMGR.is() )
{
xToolkit = css::uno::Reference< css::awt::XToolkit >( xSMGR->createInstance( SERVICENAME_VCLTOOLKIT ), css::uno::UNO_QUERY );
if ( xToolkit.is() )
{
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
aLock.lock();
m_xToolkit = xToolkit;
aLock.unlock();
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
}
xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(xSMGR) );
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
aLock.lock();
m_xToolkit = xToolkit;
aLock.unlock();
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
}
if ( !xTopWindow.is() )
{
if ( xToolkit.is() )
{
// describe window properties.
css::awt::WindowDescriptor aDescriptor;
aDescriptor.Type = css::awt::WindowClass_TOP ;
aDescriptor.ParentIndex = -1 ;
aDescriptor.Parent = css::uno::Reference< css::awt::XWindowPeer >() ;
aDescriptor.Bounds = css::awt::Rectangle(0,0,0,0) ;
aDescriptor.WindowAttributes = css::awt::WindowAttribute::BORDER|
css::awt::WindowAttribute::SIZEABLE|
css::awt::WindowAttribute::MOVEABLE|
css::awt::WindowAttribute::CLOSEABLE|
css::awt::WindowAttribute::MINSIZE;
// describe window properties.
css::awt::WindowDescriptor aDescriptor;
aDescriptor.Type = css::awt::WindowClass_TOP ;
aDescriptor.ParentIndex = -1 ;
aDescriptor.Parent = css::uno::Reference< css::awt::XWindowPeer >() ;
aDescriptor.Bounds = css::awt::Rectangle(0,0,0,0) ;
aDescriptor.WindowAttributes = css::awt::WindowAttribute::BORDER|
css::awt::WindowAttribute::SIZEABLE|
css::awt::WindowAttribute::MOVEABLE|
css::awt::WindowAttribute::CLOSEABLE|
css::awt::WindowAttribute::MINSIZE;
// create a parent window
xTopWindow = css::uno::Reference< css::awt::XTopWindow >(
xToolkit->createWindow( aDescriptor ), css::uno::UNO_QUERY );
}
// create a parent window
xTopWindow = css::uno::Reference< css::awt::XTopWindow >(
xToolkit->createWindow( aDescriptor ), css::uno::UNO_QUERY );
}
if ( xTopWindow.is() )
@@ -38,7 +38,6 @@
#include <com/sun/star/container/XContainer.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/awt/XToolkit.hpp>
#include <com/sun/star/awt/XControlModel.hpp>
#include <com/sun/star/awt/XControl.hpp>
@@ -36,11 +36,12 @@
#include <addon.hxx>
#include <osl/diagnose.h>
#include <rtl/ustring.hxx>
#include <comphelper/componentcontext.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/awt/XToolkit.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/awt/XMessageBox.hpp>
@@ -104,9 +105,7 @@ void SAL_CALL Addon::initialize( const Sequence< Any >& aArguments ) throw ( Exc
}
// Create the toolkit to have access to it later
mxToolkit = Reference< XToolkit >( mxMSF->createInstance(
OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.awt.Toolkit" ))), UNO_QUERY );
mxToolkit = Reference< XToolkit >( Toolkit::create(comphelper::getComponentContext(mxMSF)), UNO_QUERY_THROW );
}
/**
@@ -43,6 +43,7 @@
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/XControlNotificationListener.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/awt/Toolkitr.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/awt/XMessageBox.hpp>
@@ -53,6 +54,7 @@
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/container/XContainerQuery.hpp>
#include <compphelper/componentcontext.hxx>
#include <osl/file.hxx>
using namespace com::sun::star::uno;
@@ -77,9 +79,8 @@ ListenerHelper aListenerHelper;
void BaseDispatch::ShowMessageBox( const Reference< XFrame >& rFrame, const ::rtl::OUString& aTitle, const ::rtl::OUString& aMsgText )
{
if ( !mxToolkit.is() )
mxToolkit = Reference< XToolkit > ( mxMSF->createInstance(
::rtl::OUString( "com.sun.star.awt.Toolkit" )), UNO_QUERY );
if ( rFrame.is() && mxToolkit.is() )
mxToolkit = Reference< XToolkit > ( Toolkit::create(comphelper::getComponentContext(mxMSF)), UNO_QUERY_THROW );
if ( rFrame.is() )
{
// describe window properties.
WindowDescriptor aDescriptor;
+2 -1
View File
@@ -54,6 +54,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/awt,\
MenuBar \
PopupMenu \
TabController \
Toolkit \
UnoControlDialogModelProvider \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/awt/grid,\
@@ -374,7 +375,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/awt,\
RoadmapItem \
SpinningProgressControlModel \
TabControllerModel \
Toolkit \
UnoControl \
UnoControlButton \
UnoControlButtonModel \
@@ -1822,6 +1822,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/awt,\
XTimeField \
XToggleButton \
XToolkit \
XToolkit2 \
XToolkitExperimental \
XTopWindow \
XTopWindow2 \
+2 -17
View File
@@ -19,16 +19,11 @@
#ifndef __com_sun_star_awt_Toolkit_idl__
#define __com_sun_star_awt_Toolkit_idl__
#include <com/sun/star/awt/XToolkit.idl>
#include <com/sun/star/awt/XDataTransferProviderAccess.idl>
#include <com/sun/star/awt/XSystemChildFactory.idl>
#include <com/sun/star/awt/XMessageBoxFactory.idl>
#include <com/sun/star/awt/XToolkit2.idl>
module com { module sun { module star { module awt {
/** describes a toolkit that creates windows on a screen.
<p>The design of the interfaces for the toolkit implementation
@@ -36,17 +31,7 @@ module com { module sun { module star { module awt {
of the toolkit should be one-way. Too many synchronous calls kill the
remote performance.</p>
*/
published service Toolkit
{
interface XToolkit;
[optional] interface com::sun::star::awt::XDataTransferProviderAccess;
[optional] interface com::sun::star::awt::XSystemChildFactory;
[optional] interface com::sun::star::awt::XMessageBoxFactory;
};
published service Toolkit : XToolkit2;
}; }; }; };
+59
View File
@@ -0,0 +1,59 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef __com_sun_star_awt_XToolkit2_idl__
#define __com_sun_star_awt_XToolkit2_idl__
#include <com/sun/star/awt/XToolkit.idl>
#include <com/sun/star/awt/XDataTransferProviderAccess.idl>
#include <com/sun/star/awt/XSystemChildFactory.idl>
#include <com/sun/star/awt/XMessageBoxFactory.idl>
#include <com/sun/star/awt/XExtendedToolkit.idl>
#include <com/sun/star/awt/XReschedule.idl>
module com { module sun { module star { module awt {
/**
Provides a unified interface for the new-style service Toolkit to implement.
@since LibreOffice 3.7
*/
published interface XToolkit2
{
interface XToolkit;
interface com::sun::star::awt::XDataTransferProviderAccess;
interface com::sun::star::awt::XSystemChildFactory;
interface com::sun::star::awt::XMessageBoxFactory;
interface com::sun::star::awt::XExtendedToolkit;
interface com::sun::star::awt::XReschedule;
};
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -10,14 +10,14 @@
#ifndef __com_sun_star_awt_XToolkitExperimental_idl__
#define __com_sun_star_awt_XToolkitExperimental_idl__
#include <com/sun/star/awt/XToolkit.idl>
#include <com/sun/star/awt/XToolkit2.idl>
module com { module sun { module star { module awt {
/** Work in progress, don't use unless you know what you are doing.
*/
interface XToolkitExperimental: XToolkit
interface XToolkitExperimental : XToolkit2
{
/** Create a bitmap device using a byte buffer allocated outside of UNO territory.
*
Binary file not shown.
+3 -4
View File
@@ -21,6 +21,7 @@
#include "DialogModelProvider.hxx"
#include "dlgprov.hxx"
#include "dlgevtatt.hxx"
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XControlContainer.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
#include <com/sun/star/io/XInputStreamProvider.hpp>
@@ -519,10 +520,8 @@ static ::rtl::OUString aResourceResolverPropName("ResourceResolver");
}
// create a peer
Reference< XToolkit> xToolkit( xSMgr->createInstanceWithContext(
::rtl::OUString( "com.sun.star.awt.Toolkit" ), m_xContext ), UNO_QUERY );
if ( xToolkit.is() )
xDialogControl->createPeer( xToolkit, xPeer );
Reference< XToolkit> xToolkit( Toolkit::create( m_xContext ), UNO_QUERY_THROW );
xDialogControl->createPeer( xToolkit, xPeer );
}
}
}
+2 -5
View File
@@ -23,7 +23,7 @@
#include <com/sun/star/drawing/framework/XPane.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
#include <com/sun/star/awt/XToolkit.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/WindowClass.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/awt/PosSize.hpp>
@@ -83,10 +83,7 @@ namespace sd { namespace colortoolpanel
{
ENSURE_OR_THROW( i_rContext.is(), "illegal component context" );
Reference< XMultiComponentFactory > xFactory( i_rContext->getServiceManager(), UNO_SET_THROW );
Reference< XToolkit > xToolkit( xFactory->createInstanceWithContext(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ),
i_rContext
), UNO_QUERY_THROW );
Reference< XToolkit2 > xToolkit = Toolkit::create(i_rContext);
WindowDescriptor aWindow;
aWindow.Type = WindowClass_SIMPLE;
+2 -1
View File
@@ -25,6 +25,7 @@
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/view/XControlAccess.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XMessageBoxFactory.hpp>
#include <com/sun/star/awt/MessageBoxButtons.hpp>
@@ -97,7 +98,7 @@ Reference< XWindowPeer > UnoDialog::createWindowPeer( Reference< XWindowPeer > x
throw ( Exception )
{
mxDialogWindow->setVisible( sal_False );
Reference< XToolkit > xToolkit( mxMSF->getServiceManager()->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ), mxMSF ), UNO_QUERY_THROW );
Reference< XToolkit > xToolkit( Toolkit::create( mxMSF ), UNO_QUERY_THROW );
if ( !xParentPeer.is() )
xParentPeer = xToolkit->getDesktopWindow();
mxReschedule = Reference< XReschedule >( xToolkit, UNO_QUERY );
@@ -25,6 +25,7 @@
#include "PresenterPaneContainer.hxx"
#include <com/sun/star/awt/InvalidateStyle.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/awt/XWindow2.hpp>
@@ -834,11 +835,7 @@ Reference<awt::XWindow> PresenterSlideShowView::CreateViewWindow (
if ( ! xFactory.is())
return xViewWindow;
Reference<awt::XToolkit> xToolkit (
xFactory->createInstanceWithContext(
OUString("com.sun.star.awt.Toolkit"),
mxComponentContext),
UNO_QUERY_THROW);
Reference<awt::XToolkit2> xToolkit = awt::Toolkit::create(mxComponentContext);
awt::WindowDescriptor aWindowDescriptor (
awt::WindowClass_CONTAINER,
OUString(),
+2 -5
View File
@@ -22,7 +22,7 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
#include <com/sun/star/awt/XToolkit.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/WindowClass.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/awt/PosSize.hpp>
@@ -81,10 +81,7 @@ namespace sd { namespace colortoolpanel
{
ENSURE_OR_THROW( i_rContext.is(), "illegal component context" );
Reference< XMultiComponentFactory > xFactory( i_rContext->getServiceManager(), UNO_SET_THROW );
Reference< XToolkit > xToolkit( xFactory->createInstanceWithContext(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ),
i_rContext
), UNO_QUERY_THROW );
Reference< XToolkit2 > xToolkit = Toolkit::create(i_rContext);
WindowDescriptor aWindow;
aWindow.Type = WindowClass_SIMPLE;
@@ -41,7 +41,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/awt/WindowDescriptor.hpp>
#include <com/sun/star/awt/XToolkit.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XWindow2.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
@@ -150,11 +150,7 @@ namespace slideshow
// create an awt window to contain the applet
// ==========================================
uno::Reference< awt::XToolkit > xToolkit(
xFactory->createInstanceWithContext(
::rtl::OUString("com.sun.star.awt.Toolkit" ),
mxComponentContext ),
uno::UNO_QUERY_THROW );
uno::Reference< awt::XToolkit2 > xToolkit = awt::Toolkit::create(mxComponentContext);
awt::WindowDescriptor aOwnWinDescriptor( awt::WindowClass_SIMPLE,
::rtl::OUString(),
+32 -32
View File
@@ -43,6 +43,7 @@
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/view/XViewSettingsSupplier.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
@@ -123,50 +124,49 @@ void SwOneExampleFrame::CreateControl()
return ;
uno::Reference< lang::XMultiServiceFactory >
xMgr = comphelper::getProcessServiceFactory();
uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
uno::Reference< uno::XInterface > xInst = xMgr->createInstance( C2U("com.sun.star.frame.FrameControl") );
_xControl = uno::Reference< awt::XControl >(xInst, uno::UNO_QUERY);
if(_xControl.is())
{
uno::Reference< awt::XWindowPeer > xParent( rWindow.GetComponentInterface() );
uno::Reference< awt::XToolkit > xToolkit( xMgr->createInstance( C2U("com.sun.star.awt.Toolkit") ), uno::UNO_QUERY );
if(xToolkit.is())
{
_xControl->createPeer( xToolkit, xParent );
uno::Reference< awt::XToolkit > xToolkit( awt::Toolkit::create(xContext), uno::UNO_QUERY_THROW );
uno::Reference< awt::XWindow > xWin( _xControl, uno::UNO_QUERY );
xWin->setVisible( sal_False );
Size aWinSize(rWindow.GetOutputSizePixel());
xWin->setPosSize( 0, 0, aWinSize.Width(), aWinSize.Height(), awt::PosSize::SIZE );
_xControl->createPeer( xToolkit, xParent );
uno::Reference< beans::XPropertySet > xPrSet(xInst, uno::UNO_QUERY);
uno::Any aURL;
// create new doc
rtl::OUString sTempURL(cFactory);
if(sArgumentURL.Len())
sTempURL = sArgumentURL;
aURL <<= sTempURL;
uno::Reference< awt::XWindow > xWin( _xControl, uno::UNO_QUERY );
xWin->setVisible( sal_False );
Size aWinSize(rWindow.GetOutputSizePixel());
xWin->setPosSize( 0, 0, aWinSize.Width(), aWinSize.Height(), awt::PosSize::SIZE );
uno::Sequence<beans::PropertyValue> aSeq(3);
beans::PropertyValue* pValues = aSeq.getArray();
pValues[0].Name = C2U("ReadOnly");
sal_Bool bTrue = sal_True;
pValues[0].Value.setValue(&bTrue, ::getBooleanCppuType());
pValues[1].Name = C2U("OpenFlags");
pValues[1].Value <<= C2U("-RB");
pValues[2].Name = C2U("Referer");
pValues[2].Value <<= C2U("private:user");
uno::Any aArgs;
aArgs.setValue(&aSeq, ::getCppuType((uno::Sequence<beans::PropertyValue>*)0));
uno::Reference< beans::XPropertySet > xPrSet(xInst, uno::UNO_QUERY);
uno::Any aURL;
// create new doc
rtl::OUString sTempURL(cFactory);
if(sArgumentURL.Len())
sTempURL = sArgumentURL;
aURL <<= sTempURL;
xPrSet->setPropertyValue( C2U("LoaderArguments"), aArgs );
//save and set readonly???
uno::Sequence<beans::PropertyValue> aSeq(3);
beans::PropertyValue* pValues = aSeq.getArray();
pValues[0].Name = C2U("ReadOnly");
sal_Bool bTrue = sal_True;
pValues[0].Value.setValue(&bTrue, ::getBooleanCppuType());
pValues[1].Name = C2U("OpenFlags");
pValues[1].Value <<= C2U("-RB");
pValues[2].Name = C2U("Referer");
pValues[2].Value <<= C2U("private:user");
uno::Any aArgs;
aArgs.setValue(&aSeq, ::getCppuType((uno::Sequence<beans::PropertyValue>*)0));
xPrSet->setPropertyValue(C2U("ComponentURL"), aURL);
xPrSet->setPropertyValue( C2U("LoaderArguments"), aArgs );
//save and set readonly???
aLoadedTimer.Start();
bServiceAvailable = sal_True;
}
xPrSet->setPropertyValue(C2U("ComponentURL"), aURL);
aLoadedTimer.Start();
bServiceAvailable = sal_True;
}
}
+3 -12
View File
@@ -21,14 +21,10 @@
#define _TOOLKIT_AWT_VCLXTOOLKIT_HXX_
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/awt/XSystemChildFactory.hpp>
#include <com/sun/star/awt/XToolkitExperimental.hpp>
#include <com/sun/star/awt/XDataTransferProviderAccess.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/awt/XExtendedToolkit.hpp>
#include <com/sun/star/awt/XReschedule.hpp>
#include <com/sun/star/awt/XMessageBoxFactory.hpp>
#include <cppuhelper/compbase7.hxx>
#include <cppuhelper/compbase2.hxx>
#include "cppuhelper/interfacecontainer.hxx"
#include <osl/mutex.hxx>
#include <osl/module.h>
@@ -69,14 +65,9 @@ protected:
};
class VCLXToolkit : public VCLXToolkit_Impl,
public cppu::WeakComponentImplHelper7<
public cppu::WeakComponentImplHelper2<
::com::sun::star::awt::XToolkitExperimental,
::com::sun::star::lang::XServiceInfo,
::com::sun::star::awt::XSystemChildFactory,
::com::sun::star::awt::XMessageBoxFactory,
::com::sun::star::awt::XDataTransferProviderAccess,
::com::sun::star::awt::XExtendedToolkit,
::com::sun::star::awt::XReschedule >
::com::sun::star::lang::XServiceInfo >
{
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxClipboard;
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxSelection;
+2 -7
View File
@@ -463,14 +463,9 @@ static void SAL_CALL ToolkitWorkerFunction( void* pArgs )
// contructor, which might initialize VCL
VCLXToolkit::VCLXToolkit( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr ):
cppu::WeakComponentImplHelper7<
cppu::WeakComponentImplHelper2<
::com::sun::star::awt::XToolkitExperimental,
::com::sun::star::lang::XServiceInfo,
::com::sun::star::awt::XSystemChildFactory,
::com::sun::star::awt::XMessageBoxFactory,
::com::sun::star::awt::XDataTransferProviderAccess,
::com::sun::star::awt::XExtendedToolkit,
::com::sun::star::awt::XReschedule>( GetMutex() ),
::com::sun::star::lang::XServiceInfo>( GetMutex() ),
m_aTopWindowListeners(rBHelper.rMutex),
m_aKeyHandlers(rBHelper.rMutex),
m_aFocusListeners(rBHelper.rMutex),
+4 -8
View File
@@ -53,6 +53,7 @@
#include <vcl/graph.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/awt/Point.hpp>
@@ -62,15 +63,10 @@ using namespace ::com::sun::star;
// class VCLUnoHelper
// ----------------------------------------------------
::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit> VCLUnoHelper::CreateToolkit()
uno::Reference< ::com::sun::star::awt::XToolkit> VCLUnoHelper::CreateToolkit()
{
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface > xI = xMSF->createInstance( ::rtl::OUString::createFromAscii( szServiceName2_Toolkit ) );
::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit> xToolkit;
if ( xI.is() )
xToolkit = ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit>( xI, ::com::sun::star::uno::UNO_QUERY );
uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
uno::Reference< awt::XToolkit> xToolkit( awt::Toolkit::create(xContext), uno::UNO_QUERY_THROW );
return xToolkit;
}
+2 -1
View File
@@ -32,6 +32,7 @@
#undef _LINUX_SOURCE_COMPAT
#endif
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
@@ -975,7 +976,7 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute() throw( uno::RuntimeException )
int btn = GTK_RESPONSE_NO;
uno::Reference< awt::XExtendedToolkit > xToolkit(
createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit")) ),
awt::Toolkit::create(m_xContext),
UNO_QUERY_THROW );
uno::Reference< frame::XDesktop > xDesktop(
+2 -1
View File
@@ -32,6 +32,7 @@
#undef _LINUX_SOURCE_COMPAT
#endif
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
@@ -145,7 +146,7 @@ sal_Int16 SAL_CALL SalGtkFolderPicker::execute() throw( uno::RuntimeException )
sal_Int16 retVal = 0;
uno::Reference< awt::XExtendedToolkit > xToolkit(
createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit"))),
awt::Toolkit::create(m_xContext),
uno::UNO_QUERY);
uno::Reference< frame::XDesktop > xDesktop(
+10 -16
View File
@@ -33,6 +33,7 @@
#include <rtl/uri.hxx>
#include <osl/file.hxx>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
#include <rtl/ustrbuf.hxx>
#include "inputstream.hxx"
#include <algorithm>
@@ -1208,24 +1209,17 @@ void Databases::cascadingStylesheet( const rtl::OUString& Language,
if ( aCSS.compareToAscii( "default" ) == 0 )
{
// #i50760: "default" needs to adapt HC mode
uno::Reference< awt::XToolkit > xToolkit = uno::Reference< awt::XToolkit >(
::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( "com.sun.star.awt.Toolkit" ) ), uno::UNO_QUERY );
if ( xToolkit.is() )
uno::Reference< awt::XToolkit2 > xToolkit =
awt::Toolkit::create( ::comphelper::getProcessComponentContext() );
uno::Reference< awt::XTopWindow > xTopWindow = xToolkit->getActiveTopWindow();
if ( xTopWindow.is() )
{
uno::Reference< awt::XExtendedToolkit > xExtToolkit( xToolkit, uno::UNO_QUERY );
if ( xExtToolkit.is() )
uno::Reference< awt::XVclWindowPeer > xVclWindowPeer( xTopWindow, uno::UNO_QUERY );
if ( xVclWindowPeer.is() )
{
uno::Reference< awt::XTopWindow > xTopWindow = xExtToolkit->getActiveTopWindow();
if ( xTopWindow.is() )
{
uno::Reference< awt::XVclWindowPeer > xVclWindowPeer( xTopWindow, uno::UNO_QUERY );
if ( xVclWindowPeer.is() )
{
uno::Any aHCMode = xVclWindowPeer->getProperty( rtl::OUString( "HighContrastMode" ) );
if ( ( aHCMode >>= bHighContrastMode ) && bHighContrastMode )
aCSS = rtl::OUString( "highcontrastblack" );
}
}
uno::Any aHCMode = xVclWindowPeer->getProperty( rtl::OUString( "HighContrastMode" ) );
if ( ( aHCMode >>= bHighContrastMode ) && bHighContrastMode )
aCSS = rtl::OUString( "highcontrastblack" );
}
}
}