diff options
Diffstat (limited to 'toolkit/source')
-rw-r--r-- | toolkit/source/awt/vclxdialog.cxx | 1 | ||||
-rw-r--r-- | toolkit/source/awt/vclxtopwindow.cxx | 166 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindow.cxx | 27 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindows.cxx | 9 | ||||
-rw-r--r-- | toolkit/source/controls/unocontrol.cxx | 8 | ||||
-rw-r--r-- | toolkit/source/controls/unocontrolmodel.cxx | 7 | ||||
-rw-r--r-- | toolkit/source/helper/property.cxx | 15 | ||||
-rw-r--r-- | toolkit/source/helper/throbberimpl.cxx | 4 |
8 files changed, 171 insertions, 66 deletions
diff --git a/toolkit/source/awt/vclxdialog.cxx b/toolkit/source/awt/vclxdialog.cxx index 0712f8ca074c..32f2931e7438 100644 --- a/toolkit/source/awt/vclxdialog.cxx +++ b/toolkit/source/awt/vclxdialog.cxx @@ -66,6 +66,7 @@ DBG_NAME( VCLXDialog ) VCLXDialog::VCLXDialog() : VCLXWindow() + , VCLXTopWindow_Base( true ) , VCLXDialog_Base() , Bin() , bRealized( false ) diff --git a/toolkit/source/awt/vclxtopwindow.cxx b/toolkit/source/awt/vclxtopwindow.cxx index 26e457d74583..6e532c7bef3e 100644 --- a/toolkit/source/awt/vclxtopwindow.cxx +++ b/toolkit/source/awt/vclxtopwindow.cxx @@ -46,6 +46,7 @@ #include <vcl/syschild.hxx> #include <vcl/sysdata.hxx> #include <cppuhelper/typeprovider.hxx> +#include <comphelper/sequence.hxx> #include <toolkit/awt/vclxtopwindow.hxx> #include <toolkit/awt/vclxmenu.hxx> @@ -54,13 +55,44 @@ #include <vcl/wrkwin.hxx> #include <vcl/syswin.hxx> #include <vcl/menu.hxx> +#include <vcl/svapp.hxx> #include <tools/debug.hxx> +using ::com::sun::star::uno::RuntimeException; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::Type; +using ::com::sun::star::uno::Any; +using ::com::sun::star::lang::IndexOutOfBoundsException; + +VCLXTopWindow_Base::VCLXTopWindow_Base( const bool _bSupportSystemWindowPeer ) + :m_bWHWND( _bSupportSystemWindowPeer ) +{ +} + VCLXTopWindow_Base::~VCLXTopWindow_Base() { } +Any VCLXTopWindow_Base::queryInterface( const Type & rType ) throw(RuntimeException) +{ + ::com::sun::star::uno::Any aRet( VCLXTopWindow_XBase::queryInterface( rType ) ); + + // do not expose XSystemDependentWindowPeer if we do not have a system window handle + if ( !aRet.hasValue() && m_bWHWND ) + aRet = VCLXTopWindow_SBase::queryInterface( rType ); + + return aRet; +} + +Sequence< Type > VCLXTopWindow_Base::getTypes() throw(RuntimeException) +{ + Sequence< Type > aTypes( VCLXTopWindow_XBase::getTypes() ); + if ( m_bWHWND ) + aTypes = ::comphelper::concatSequences( aTypes, VCLXTopWindow_SBase::getTypes() ); + return aTypes; +} + ::com::sun::star::uno::Any VCLXTopWindow_Base::getWindowHandle( const ::com::sun::star::uno::Sequence< sal_Int8 >& /*ProcessId*/, sal_Int16 SystemType ) throw(::com::sun::star::uno::RuntimeException) { ::vos::OGuard aGuard( GetMutexImpl() ); @@ -157,6 +189,81 @@ void VCLXTopWindow_Base::setMenuBar( const ::com::sun::star::uno::Reference< ::c mxMenuBar = rxMenu; } +//-------------------------------------------------------------------- +::sal_Bool SAL_CALL VCLXTopWindow_Base::getIsMaximized() throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutexImpl() ); + + const WorkWindow* pWindow = dynamic_cast< const WorkWindow* >( GetWindowImpl() ); + if ( !pWindow ) + return sal_False; + + return pWindow->IsMaximized(); +} + +//-------------------------------------------------------------------- +void SAL_CALL VCLXTopWindow_Base::setIsMaximized( ::sal_Bool _ismaximized ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutexImpl() ); + + WorkWindow* pWindow = dynamic_cast< WorkWindow* >( GetWindowImpl() ); + if ( !pWindow ) + return; + + pWindow->Maximize( _ismaximized ); +} + +//-------------------------------------------------------------------- +::sal_Bool SAL_CALL VCLXTopWindow_Base::getIsMinimized() throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutexImpl() ); + + const WorkWindow* pWindow = dynamic_cast< const WorkWindow* >( GetWindowImpl() ); + if ( !pWindow ) + return sal_False; + + return pWindow->IsMinimized(); +} + +//-------------------------------------------------------------------- +void SAL_CALL VCLXTopWindow_Base::setIsMinimized( ::sal_Bool _isMinimized ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutexImpl() ); + + WorkWindow* pWindow = dynamic_cast< WorkWindow* >( GetWindowImpl() ); + if ( !pWindow ) + return; + + _isMinimized ? pWindow->Minimize() : pWindow->Restore(); +} + +//-------------------------------------------------------------------- +::sal_Int32 SAL_CALL VCLXTopWindow_Base::getDisplay() throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutexImpl() ); + + const SystemWindow* pWindow = dynamic_cast< const SystemWindow* >( GetWindowImpl() ); + if ( !pWindow ) + return 0; + + return pWindow->GetScreenNumber(); +} + +//-------------------------------------------------------------------- +void SAL_CALL VCLXTopWindow_Base::setDisplay( ::sal_Int32 _display ) throw (RuntimeException, IndexOutOfBoundsException) +{ + ::vos::OGuard aGuard( GetMutexImpl() ); + + if ( ( _display < 0 ) || ( _display >= (sal_Int32)Application::GetScreenCount() ) ) + throw IndexOutOfBoundsException(); + + SystemWindow* pWindow = dynamic_cast< SystemWindow* >( GetWindowImpl() ); + if ( !pWindow ) + return; + + pWindow->SetScreenNumber( _display ); +} + // ---------------------------------------------------- // class VCLXTopWindow // ---------------------------------------------------- @@ -167,7 +274,7 @@ void VCLXTopWindow::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) } VCLXTopWindow::VCLXTopWindow(bool bWHWND) - : m_bWHWND(bWHWND) + : VCLXTopWindow_Base( bWHWND ) { } @@ -193,24 +300,19 @@ Window* VCLXTopWindow::GetWindowImpl() // ::com::sun::star::uno::XInterface ::com::sun::star::uno::Any VCLXTopWindow::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { - ::com::sun::star::uno::Any aRet; - if(! m_bWHWND) { - aRet = ::cppu::queryInterface( rType, - SAL_STATIC_CAST( ::com::sun::star::awt::XTopWindow*, this ) ); - } - else { - aRet = ::cppu::queryInterface( rType, - SAL_STATIC_CAST( ::com::sun::star::awt::XTopWindow*, this ), - SAL_STATIC_CAST( ::com::sun::star::awt::XSystemDependentWindowPeer*, this ) ); - } - return (aRet.hasValue() ? aRet : VCLXContainer::queryInterface( rType )); + ::com::sun::star::uno::Any aRet( VCLXTopWindow_Base::queryInterface( rType ) ); + + if ( !aRet.hasValue() ) + aRet = VCLXContainer::queryInterface( rType ); + + return aRet; } ::com::sun::star::uno::Sequence< sal_Int8 > VCLXTopWindow::getImplementationId() throw(::com::sun::star::uno::RuntimeException) { static ::cppu::OImplementationId* pId = NULL; static ::cppu::OImplementationId* pIdWithHandle = NULL; - if ( m_bWHWND ) + if ( isSystemDependentWindowPeer() ) { if( !pIdWithHandle ) { @@ -242,41 +344,5 @@ Window* VCLXTopWindow::GetWindowImpl() ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > VCLXTopWindow::getTypes() throw(::com::sun::star::uno::RuntimeException) { - static ::cppu::OTypeCollection* pCollection = NULL; - static ::cppu::OTypeCollection* pCollectionWithHandle = NULL; - - if ( m_bWHWND ) - { - if( !pCollectionWithHandle ) - { - ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ); - if( !pCollectionWithHandle ) - { - static ::cppu::OTypeCollection collectionWithHandle( - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XTypeProvider>* ) NULL ), - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindow>* ) NULL ), - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XSystemDependentWindowPeer>* ) NULL ), - VCLXContainer::getTypes() ); - pCollectionWithHandle = &collectionWithHandle; - } - } - - return (*pCollectionWithHandle).getTypes(); - } - else - { - if( !pCollection ) - { - ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ); - if( !pCollection ) - { - static ::cppu::OTypeCollection collection( - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XTypeProvider>* ) NULL ), - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindow>* ) NULL ), - VCLXContainer::getTypes() ); - pCollection = &collection; - } - } - return (*pCollection).getTypes(); - } + return ::comphelper::concatSequences( VCLXTopWindow_Base::getTypes(), VCLXContainer::getTypes() ); } diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 9ca21c5fb36b..3d2069ab8385 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -64,6 +64,7 @@ #include <vcl/dockwin.hxx> #include <vcl/pdfextoutdevdata.hxx> #include <vcl/tabpage.hxx> +#include <vcl/button.hxx> #include <comphelper/asyncnotification.hxx> #include <toolkit/helper/solarrelease.hxx> @@ -76,6 +77,7 @@ using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::lang::EventObject; using ::com::sun::star::awt::XWindowListener2; using ::com::sun::star::awt::XDockableWindowListener; +using ::com::sun::star::awt::XDevice; using ::com::sun::star::style::VerticalAlignment; using ::com::sun::star::style::VerticalAlignment_TOP; using ::com::sun::star::style::VerticalAlignment_MIDDLE; @@ -1585,6 +1587,18 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com:: sal_uInt16 nPropType = GetPropertyId( PropertyName ); switch ( nPropType ) { + case BASEPROPERTY_REFERENCE_DEVICE: + { + Control* pControl = dynamic_cast< Control* >( pWindow ); + OSL_ENSURE( pControl, "VCLXWindow::setProperty( RefDevice ): need a Control for this!" ); + if ( !pControl ) + break; + Reference< XDevice > xDevice( Value, UNO_QUERY ); + OutputDevice* pDevice = VCLUnoHelper::GetOutputDevice( xDevice ); + pControl->SetReferenceDevice( pDevice ); + } + break; + case BASEPROPERTY_CONTEXT_WRITING_MODE: { OSL_VERIFY( Value >>= mpImpl->mnContextWritingMode ); @@ -2103,6 +2117,19 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com:: sal_uInt16 nPropType = GetPropertyId( PropertyName ); switch ( nPropType ) { + case BASEPROPERTY_REFERENCE_DEVICE: + { + Control* pControl = dynamic_cast< Control* >( GetWindow() ); + OSL_ENSURE( pControl, "VCLXWindow::setProperty( RefDevice ): need a Control for this!" ); + if ( !pControl ) + break; + + VCLXDevice* pDevice = new VCLXDevice; + pDevice->SetOutputDevice( pControl->GetReferenceDevice() ); + aProp <<= Reference< XDevice >( pDevice ); + } + break; + case BASEPROPERTY_CONTEXT_WRITING_MODE: aProp <<= mpImpl->mnContextWritingMode; break; diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index b49fa1a621d6..7757d170256a 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -408,6 +408,7 @@ void VCLXButton::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) BASEPROPERTY_VERTICALALIGN, BASEPROPERTY_WRITING_MODE, BASEPROPERTY_CONTEXT_WRITING_MODE, + BASEPROPERTY_REFERENCE_DEVICE, 0); VCLXImageConsumer::ImplGetPropertyIds( rIds ); } @@ -420,9 +421,6 @@ VCLXButton::VCLXButton() VCLXButton::~VCLXButton() { -#ifndef __SUNPRO_CC - OSL_TRACE ("%s", __FUNCTION__); -#endif } ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > VCLXButton::CreateAccessibleContext() @@ -817,6 +815,7 @@ void VCLXCheckBox::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) BASEPROPERTY_VERTICALALIGN, BASEPROPERTY_WRITING_MODE, BASEPROPERTY_CONTEXT_WRITING_MODE, + BASEPROPERTY_REFERENCE_DEVICE, 0); VCLXImageConsumer::ImplGetPropertyIds( rIds ); } @@ -1116,6 +1115,7 @@ void VCLXRadioButton::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) BASEPROPERTY_VERTICALALIGN, BASEPROPERTY_WRITING_MODE, BASEPROPERTY_CONTEXT_WRITING_MODE, + BASEPROPERTY_REFERENCE_DEVICE, 0); VCLXImageConsumer::ImplGetPropertyIds( rIds ); } @@ -1540,6 +1540,7 @@ void VCLXListBox::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) BASEPROPERTY_ALIGN, BASEPROPERTY_WRITING_MODE, BASEPROPERTY_CONTEXT_WRITING_MODE, + BASEPROPERTY_REFERENCE_DEVICE, BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR, 0); VCLXWindow::ImplGetPropertyIds( rIds ); @@ -2759,6 +2760,7 @@ void VCLXFixedText::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) BASEPROPERTY_VERTICALALIGN, BASEPROPERTY_WRITING_MODE, BASEPROPERTY_CONTEXT_WRITING_MODE, + BASEPROPERTY_REFERENCE_DEVICE, 0); VCLXWindow::ImplGetPropertyIds( rIds ); } @@ -3762,6 +3764,7 @@ void VCLXComboBox::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) BASEPROPERTY_ALIGN, BASEPROPERTY_WRITING_MODE, BASEPROPERTY_CONTEXT_WRITING_MODE, + BASEPROPERTY_REFERENCE_DEVICE, BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR, 0); // no, don't call VCLXEdit here - it has properties which we do *not* want to have at at combo box diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx index 0775b6ee74f3..21876feb072b 100644 --- a/toolkit/source/controls/unocontrol.cxx +++ b/toolkit/source/controls/unocontrol.cxx @@ -1050,10 +1050,10 @@ void UnoControl::draw( sal_Int32 x, sal_Int32 y ) throw(RuntimeException) if ( xDrawPeerView.is() ) { - Reference< XVclWindowPeer > xWindowPeer; - xWindowPeer.set( xDrawPeer, UNO_QUERY ); - if ( xWindowPeer.is() ) - xWindowPeer->setDesignMode( mbDesignMode ); + Reference< XVclWindowPeer > xWindowPeer; + xWindowPeer.set( xDrawPeer, UNO_QUERY ); + if ( xWindowPeer.is() ) + xWindowPeer->setDesignMode( mbDesignMode ); xDrawPeerView->draw( x, y ); } diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx index cc5faa27eec8..a4febcd33b33 100644 --- a/toolkit/source/controls/unocontrolmodel.cxx +++ b/toolkit/source/controls/unocontrolmodel.cxx @@ -38,6 +38,7 @@ #include <com/sun/star/awt/FontSlant.hpp> #include <com/sun/star/awt/MouseWheelBehavior.hpp> #include <com/sun/star/graphic/XGraphicProvider.hpp> +#include <com/sun/star/awt/XDevice.hpp> #include <com/sun/star/text/WritingMode2.hpp> #include <com/sun/star/io/XMarkableStream.hpp> #include <toolkit/controls/unocontrolmodel.hxx> @@ -262,7 +263,11 @@ void UnoControlModel::ImplPropertyChanged( sal_uInt16 ) switch ( nPropId ) { case BASEPROPERTY_GRAPHIC: - aDefault <<= makeAny( Reference< graphic::XGraphic >() ); + aDefault <<= Reference< graphic::XGraphic >(); + break; + + case BASEPROPERTY_REFERENCE_DEVICE: + aDefault <<= Reference< awt::XDevice >(); break; case BASEPROPERTY_VERTICALALIGN: diff --git a/toolkit/source/helper/property.cxx b/toolkit/source/helper/property.cxx index e71c03bae47d..a59af95a2e1f 100644 --- a/toolkit/source/helper/property.cxx +++ b/toolkit/source/helper/property.cxx @@ -47,6 +47,7 @@ #include <com/sun/star/awt/FontUnderline.hpp> #include <com/sun/star/awt/FontStrikeout.hpp> #include <com/sun/star/awt/FontPitch.hpp> +#include <com/sun/star/awt/XDevice.hpp> #include <com/sun/star/awt/tree/XTreeDataModel.hpp> #include <com/sun/star/awt/grid/XGridDataModel.hpp> #include <com/sun/star/awt/grid/XGridColumnModel.hpp> @@ -65,6 +66,7 @@ using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Reference; +using ::com::sun::star::awt::XDevice; using ::com::sun::star::awt::FontDescriptor; using ::com::sun::star::style::VerticalAlignment; @@ -275,12 +277,13 @@ ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount ) DECL_PROP_2 ( "URL", URL, ::rtl::OUString, BOUND, MAYBEDEFAULT ), DECL_PROP_2 ( "WritingMode", WRITING_MODE, sal_Int16, BOUND, MAYBEDEFAULT ), DECL_PROP_3 ( "ContextWritingMode", CONTEXT_WRITING_MODE, sal_Int16, BOUND, MAYBEDEFAULT, TRANSIENT ), - DECL_PROP_2 ( "ShowRowHeader", GRID_SHOWROWHEADER, sal_Bool, BOUND, MAYBEDEFAULT ), - DECL_PROP_2 ( "ShowColumnHeader", GRID_SHOWCOLUMNHEADER, sal_Bool, BOUND, MAYBEDEFAULT ), - DECL_PROP_3 ( "GridDataModel", GRID_DATAMODEL, Reference< ::com::sun::star::awt::grid::XGridDataModel >, BOUND, MAYBEDEFAULT, MAYBEVOID ), - DECL_PROP_3 ( "ColumnModel", GRID_COLUMNMODEL, Reference< ::com::sun::star::awt::grid::XGridColumnModel >, BOUND, MAYBEDEFAULT, MAYBEVOID ), - DECL_PROP_3 ( "SelectionModel", GRID_SELECTIONMODE, ::com::sun::star::view::SelectionType, BOUND, MAYBEDEFAULT, MAYBEVOID ), - DECL_PROP_2 ( "EnableVisible", ENABLEVISIBLE, sal_Bool, BOUND, MAYBEDEFAULT ) + DECL_PROP_2 ( "ShowRowHeader", GRID_SHOWROWHEADER, sal_Bool, BOUND, MAYBEDEFAULT ), + DECL_PROP_2 ( "ShowColumnHeader", GRID_SHOWCOLUMNHEADER, sal_Bool, BOUND, MAYBEDEFAULT ), + DECL_PROP_3 ( "GridDataModel", GRID_DATAMODEL, Reference< ::com::sun::star::awt::grid::XGridDataModel >, BOUND, MAYBEDEFAULT, MAYBEVOID ), + DECL_PROP_3 ( "ColumnModel", GRID_COLUMNMODEL, Reference< ::com::sun::star::awt::grid::XGridColumnModel >, BOUND, MAYBEDEFAULT, MAYBEVOID ), + DECL_PROP_3 ( "SelectionModel", GRID_SELECTIONMODE, ::com::sun::star::view::SelectionType, BOUND, MAYBEDEFAULT, MAYBEVOID ), + DECL_PROP_2 ( "EnableVisible", ENABLEVISIBLE, sal_Bool, BOUND, MAYBEDEFAULT ), + DECL_PROP_3 ( "ReferenceDevice", REFERENCE_DEVICE, Reference< XDevice >,BOUND, MAYBEDEFAULT, TRANSIENT ) }; pPropertyInfos = aImplPropertyInfos; nElements = sizeof( aImplPropertyInfos ) / sizeof( ImplPropertyInfo ); diff --git a/toolkit/source/helper/throbberimpl.cxx b/toolkit/source/helper/throbberimpl.cxx index 902792918de0..423e40c4f305 100644 --- a/toolkit/source/helper/throbberimpl.cxx +++ b/toolkit/source/helper/throbberimpl.cxx @@ -110,9 +110,9 @@ namespace toolkit { FixedImage* pImage = static_cast< FixedImage* >( mxParent->GetWindow() ); if ( pImage ) - return pImage->GetSettings().GetStyleSettings().GetFaceColor().IsDark(); + return pImage->GetSettings().GetStyleSettings().GetHighContrastMode(); else - return Application::GetSettings().GetStyleSettings().GetFaceColor().IsDark(); + return Application::GetSettings().GetStyleSettings().GetHighContrastMode(); } // ----------------------------------------------------------------------- |