diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-08-22 13:43:11 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-11-09 18:42:24 +0100 |
commit | 527397abd6f59654f5a26643d62ec098170369c1 (patch) | |
tree | 1e9bf4aa8c3be80c01c95ff3594e31b686d3b861 /vcl/headless/svpgdi.cxx | |
parent | 63f320f6352bfca0dcd7ed0b55b95e8bc27d8d67 (diff) |
Support drawing custom widgets in headless backend
..and fallback the headless dawing also in gtk3 where needed
Change-Id: Ic5da8fa7a04089342db8e2f334ced69691a15217
Diffstat (limited to 'vcl/headless/svpgdi.cxx')
-rw-r--r-- | vcl/headless/svpgdi.cxx | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 4e9c4d55e06e..8941faef5c18 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -599,6 +599,7 @@ SvpSalGraphics::SvpSalGraphics() , m_ePaintMode(PaintMode::Over) , m_aTextRenderImpl(*this) { + m_pWidgetDraw.reset(new vcl::CustomWidgetDraw(*this)); } SvpSalGraphics::~SvpSalGraphics() @@ -1893,6 +1894,62 @@ bool SvpSalGraphics::drawEPS( long, long, long, long, void*, sal_uLong ) return false; } +/* Widget drawing */ + +bool SvpSalGraphics::IsNativeControlSupported(ControlType eType, ControlPart ePart) +{ + if (hasWidgetDraw()) + return m_pWidgetDraw->isNativeControlSupported(eType, ePart); + + return false; +} + +bool SvpSalGraphics::hitTestNativeControl(ControlType eType, ControlPart ePart, + const tools::Rectangle& rBoundingControlRegion, + const Point& rPosition, bool& rIsInside) +{ + if (hasWidgetDraw()) + { + return m_pWidgetDraw->hitTestNativeControl(eType, ePart, rBoundingControlRegion, rPosition, rIsInside); + } + + return false; +} + +bool SvpSalGraphics::drawNativeControl(ControlType eType, ControlPart ePart, + const tools::Rectangle& rControlRegion, + ControlState eState, const ImplControlValue& aValue, + const OUString& aCaptions) +{ + if (hasWidgetDraw()) + { + bool bReturn = m_pWidgetDraw->drawNativeControl(eType, ePart, rControlRegion, + eState, aValue, aCaptions); + return bReturn; + } + + return false; +} + +bool SvpSalGraphics::getNativeControlRegion(ControlType eType, ControlPart ePart, + const tools::Rectangle& rBoundingControlRegion, + ControlState eState, + const ImplControlValue& aValue, + const OUString& aCaption, + tools::Rectangle& rNativeBoundingRegion, + tools::Rectangle& rNativeContentRegion) +{ + if (hasWidgetDraw()) + { + return m_pWidgetDraw->getNativeControlRegion(eType, ePart, rBoundingControlRegion, + eState, aValue, aCaption, + rNativeBoundingRegion, rNativeContentRegion); + } + + return false; +} + + namespace { bool isCairoCompatible(const BitmapBuffer* pBuffer) |