summaryrefslogtreecommitdiff
path: root/vcl/inc/salgdi.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/inc/salgdi.hxx')
-rw-r--r--vcl/inc/salgdi.hxx139
1 files changed, 36 insertions, 103 deletions
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index a8c2d87969d0..36f70b2a8b57 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -69,11 +69,11 @@ typedef std::map< sal_Ucs, sal_uInt32 > Ucs2UIntMap;
// note: all positions are in pixel and relative to
// the top/left-position of the virtual output area
-class VCL_PLUGIN_PUBLIC SalGraphics
+class VCL_PLUGIN_PUBLIC SalGraphics : protected vcl::WidgetDrawInterface
{
public:
- SalGraphics();
- virtual ~SalGraphics();
+ SalGraphics();
+ ~SalGraphics() override;
virtual SalGraphicsImpl* GetImpl() const = 0;
@@ -340,19 +340,12 @@ public:
// native widget rendering functions
/**
- * Query the platform layer for native control support.
- *
- * @param [in] eType The widget type.
- * @param [in] ePart The part of the widget.
- * @return true if the platform supports native drawing of the widget type defined by part.
+ * @see WidgetDrawInterface::isNativeControlSupported
*/
- bool IsSupported(ControlType eType, ControlPart ePart);
-
+ inline bool IsNativeControlSupported(ControlType, ControlPart);
/**
- * Query the native control to determine if it was acted upon
- *
- * @see hitTestNativeControl
+ * @see WidgetDrawInterface::hitTestNativeControl
*/
bool HitTestNativeScrollbar(
ControlPart nPart,
@@ -362,9 +355,7 @@ public:
const OutputDevice *pOutDev );
/**
- * Request rendering of a particular control and/or part
- *
- * @see drawNativeControl
+ * @see WidgetDrawInterface::drawNativeControl
*/
bool DrawNativeControl(
ControlType nType,
@@ -376,9 +367,7 @@ public:
const OutputDevice *pOutDev );
/**
- * Query the native control's actual drawing region (including adornment)
- *
- * @see getNativeControlRegion
+ * @see WidgetDrawInterface::getNativeControlRegion
*/
bool GetNativeControlRegion(
ControlType nType,
@@ -390,6 +379,11 @@ public:
tools::Rectangle &rNativeContentRegion,
const OutputDevice *pOutDev );
+ /**
+ * @see WidgetDrawInterface::updateSettings
+ */
+ inline bool UpdateSettings(AllSettings&);
+
bool BlendBitmap(
const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
@@ -440,11 +434,6 @@ public:
#endif // ENABLE_CAIRO_CANVAS
-private:
- bool callGetNativeControlRegion(ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion);
- bool callDrawNativeControl(ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption);
- bool callHitTestNativeControl(ControlType eType, ControlPart nPart, const tools::Rectangle& rControlRegion, const Point& aPos, bool& rIsInside);
-
protected:
virtual bool setClipRegion( const vcl::Region& ) = 0;
@@ -538,81 +527,6 @@ protected:
void* pPtr,
sal_uInt32 nSize ) = 0;
- /**
- * Query the platform layer for native control support.
- *
- * @param [in] eType The widget type.
- * @param [in] ePart The part of the widget.
- * @return true if the platform supports native drawing of the widget type defined by part.
- */
- virtual bool IsNativeControlSupported(ControlType eType, ControlPart ePart);
-
- /**
- * Query if a position is inside the native widget part.
- *
- * Mainly used for scrollbars.
- *
- * @param [in] eType The widget type.
- * @param [in] ePart The part of the widget.
- * @param [in] rBoundingControlRegion The bounding Rectangle of
- the complete control in VCL frame coordinates.
- * @param [in] aPos The position to check the hit.
- * @param [out] rIsInside true, if \a aPos was inside the native widget.
- * @return true, if the query was successful.
- */
- virtual bool hitTestNativeControl(
- ControlType eType, ControlPart ePart,
- const tools::Rectangle& rBoundingControlRegion,
- const Point& aPos, bool& rIsInside );
-
- /**
- * Draw the requested control.
- *
- * @param [in] eType The widget type.
- * @param [in] ePart The part of the widget.
- * @param [in] rBoundingControlRegion The bounding rectangle of
- * the complete control in VCL frame coordinates.
- * @param [in] eState The general state of the control (enabled, focused, etc.).
- * @param [in] aValue Addition control specific information.
- * @param [in] aCaption A caption or title string (like button text etc.).
- * @return true, if the control could be drawn.
- */
- virtual bool drawNativeControl(
- ControlType eType, ControlPart ePart,
- const tools::Rectangle& rBoundingControlRegion,
- ControlState eState,
- const ImplControlValue& aValue,
- const OUString& aCaption );
-
- /**
- * Get the native control regions for the control part.
- *
- * If the return value is true, \a rNativeBoundingRegion contains
- * the true bounding region covered by the control including any
- * adornment, while \a rNativeContentRegion contains the area
- * within the control that can be safely drawn into without drawing over
- * the borders of the control.
- *
- * @param [in] eType Type of the widget.
- * @param [in] ePart Specification of the widget's part if it consists of more than one.
- * @param [in] rBoundingControlRegion The bounding region of the control in VCL frame coordinates.
- * @param [in] eState The general state of the control (enabled, focused, etc.).
- * @param [in] aValue Addition control specific information.
- * @param [in] aCaption A caption or title string (like button text etc.).
- * @param [out] rNativeBoundingRegion The region covered by the control including any adornment.
- * @param [out] rNativeContentRegion The region within the control that can be safely drawn into.
- * @return true, if the regions are filled.
- */
- virtual bool getNativeControlRegion(
- ControlType eType, ControlPart ePart,
- const tools::Rectangle& rBoundingControlRegion,
- ControlState eState,
- const ImplControlValue& aValue,
- const OUString& aCaption,
- tools::Rectangle &rNativeBoundingRegion,
- tools::Rectangle &rNativeContentRegion );
-
-
/** Blend the bitmap with the current buffer */
virtual bool blendBitmap(
const SalTwoRect&,
@@ -678,16 +592,35 @@ protected:
inline long GetDeviceWidth(const OutputDevice* pOutDev) const;
+ /**
+ * Handle damage done by drawing with a widget draw override
+ *
+ * If a m_pWidgetDraw is set and successfully draws using drawNativeControl,
+ * this function is called to handle the damage done to the graphics buffer.
+ *
+ * @param rDamagedRegion the region damaged by drawNativeControl.
+ **/
+ virtual inline void handleDamage(const tools::Rectangle& rDamagedRegion);
+
// native controls
bool initWidgetDrawBackends(bool bForce = false);
- bool hasWidgetDraw()
- {
- return bool(m_pWidgetDraw);
- }
std::unique_ptr<vcl::WidgetDrawInterface> m_pWidgetDraw;
+ vcl::WidgetDrawInterface* forWidget() { return m_pWidgetDraw ? m_pWidgetDraw.get() : this; }
};
+bool SalGraphics::IsNativeControlSupported(ControlType eType, ControlPart ePart)
+{
+ return forWidget()->isNativeControlSupported(eType, ePart);
+}
+
+bool SalGraphics::UpdateSettings(AllSettings& rSettings)
+{
+ return forWidget()->updateSettings(rSettings);
+}
+
+void SalGraphics::handleDamage(const tools::Rectangle&) {}
+
#endif // INCLUDED_VCL_INC_SALGDI_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */