diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-05-01 20:00:56 +1000 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-05-01 20:00:56 +1000 |
commit | f2e4bb4b96a7c2176a0dd1dacd9930bf9b68d895 (patch) | |
tree | f90a4c68e4ffe70d95e0dc5f61cb6515a8033288 /vcl | |
parent | 4f45ec19fc96e4471dc3fe342e5acd910068dd12 (diff) |
Revert "VCL: move native widget rendering functions out of OutputDevice"
This reverts commit 5b86e33b5fb5f8250b88bf14e579cddd98fec36a.
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/Library_vcl.mk | 2 | ||||
-rw-r--r-- | vcl/source/outdev/nativecontrols.cxx (renamed from vcl/source/window/nativecontrols.cxx) | 40 |
2 files changed, 32 insertions, 10 deletions
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index c331fdfb82b8..d630017e0ae5 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -146,7 +146,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/window/window \ vcl/source/window/winproc \ vcl/source/window/wrkwin \ - vcl/source/window/nativecontrols \ vcl/source/control/button \ vcl/source/control/combobox \ vcl/source/control/ctrl \ @@ -196,6 +195,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/outdev/gradient \ vcl/source/outdev/curvedshapes \ vcl/source/outdev/wallpaper \ + vcl/source/outdev/nativecontrols \ vcl/source/outdev/map \ vcl/source/gdi/alpha \ vcl/source/gdi/animate \ diff --git a/vcl/source/window/nativecontrols.cxx b/vcl/source/outdev/nativecontrols.cxx index 38c84981c64f..28e2d35921f5 100644 --- a/vcl/source/window/nativecontrols.cxx +++ b/vcl/source/outdev/nativecontrols.cxx @@ -25,6 +25,29 @@ #include <salgdi.hxx> +static bool EnableNativeWidget( const OutputDevice& i_rDevice ) +{ + const OutDevType eType( i_rDevice.GetOutDevType() ); + switch ( eType ) + { + + case OUTDEV_WINDOW: + return dynamic_cast< const Window* >( &i_rDevice )->IsNativeWidgetEnabled(); + + case OUTDEV_VIRDEV: + { + const ::vcl::ExtOutDevData* pOutDevData( i_rDevice.GetExtOutDevData() ); + const ::vcl::PDFExtOutDevData* pPDFData( dynamic_cast< const ::vcl::PDFExtOutDevData* >( pOutDevData ) ); + if ( pPDFData != NULL ) + return false; + return true; + } + + default: + return false; + } +} + ImplControlValue::~ImplControlValue() { } @@ -118,9 +141,9 @@ PushButtonValue* PushButtonValue::clone() const // These functions are mainly passthrough functions that allow access to // the SalFrame behind a Window object for native widget rendering purposes. -bool Window::IsNativeControlSupported( ControlType nType, ControlPart nPart ) const +bool OutputDevice::IsNativeControlSupported( ControlType nType, ControlPart nPart ) const { - if( !IsNativeWidgetEnabled() ) + if( !EnableNativeWidget( *this ) ) return false; if ( !mpGraphics ) @@ -130,13 +153,13 @@ bool Window::IsNativeControlSupported( ControlType nType, ControlPart nPart ) co return( mpGraphics->IsNativeControlSupported(nType, nPart) ); } -bool Window::HitTestNativeControl( ControlType nType, +bool OutputDevice::HitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, const Point& aPos, bool& rIsInside ) const { - if( !IsNativeWidgetEnabled() ) + if( !EnableNativeWidget( *this ) ) return false; if ( !mpGraphics ) @@ -229,15 +252,14 @@ static boost::shared_ptr< ImplControlValue > TransformControlValue( const ImplCo } return aResult; } - -bool Window::DrawNativeControl( ControlType nType, +bool OutputDevice::DrawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue, const OUString& aCaption ) { - if( !IsNativeWidgetEnabled() ) + if( !EnableNativeWidget( *this ) ) return false; // make sure the current clip region is initialized correctly @@ -270,7 +292,7 @@ bool Window::DrawNativeControl( ControlType nType, return bRet; } -bool Window::GetNativeControlRegion( ControlType nType, +bool OutputDevice::GetNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState, @@ -279,7 +301,7 @@ bool Window::GetNativeControlRegion( ControlType nType, Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion ) const { - if( !IsNativeWidgetEnabled() ) + if( !EnableNativeWidget( *this ) ) return false; if ( !mpGraphics ) |