/** * @file XTPMarkupGdiPlusTransformationMatrix.h * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ /** @cond */ #if !defined(__XTPMARKUPGDIPLUSTRANSFORMATIONMATRIX_H__) # define __XTPMARKUPGDIPLUSTRANSFORMATIONMATRIX_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPGdiPlus; /** * @brief * Encapsulates GDI+ transformation matrix access. */ class _XTP_EXT_CLASS CXTPMarkupGdiPlusTransformationMatrix : public CXTPMarkupTransformationMatrix { /** @cond */ DECLARE_DYNAMIC(CXTPMarkupGdiPlusTransformationMatrix); /** @endcond */ public: /** * @brief * Constructs a GDI+ markup matrix. * @param pReserved Reserved. Not used. * @param pMatrix A pointer to a native GDI+ matrix. The wrapper takes * exclusive ownership of the native GDI+ matrix passed. */ CXTPMarkupGdiPlusTransformationMatrix(CXTPGdiPlus* pReserved, GpMatrix* pMatrix); /** * @brief * Cleans up resources held. */ ~CXTPMarkupGdiPlusTransformationMatrix(); /** @cond */ _XTP_DEPRECATED CXTPGdiPlus* GetGdiPlus(); _XTP_DEPRECATED const CXTPGdiPlus* GetGdiPlus() const; /** @endcond */ /** * @brief * Provides access to the native GDI+ matrix instance. * @return * A pointer to the native GDI+ matrix instance. */ GpMatrix* GetMatrix(); /** * @brief * Provides access to the native GDI+ matrix instance. * @return * A pointer to the native GDI+ matrix instance. */ const GpMatrix* GetMatrix() const; public: /** * @brief * Clones a matrix object. * @return * A pointer to the cloned matrix. It is the responsibility * of the caller to delete the returned object. */ virtual CXTPMarkupTransformationMatrix* Clone() const; /** * @brief * Adds offset to the current matrix. * @param offset Offset to add. */ virtual void Offset(const POINT& offset); /** * @brief * Checks if a point is inside a rectangle with transformation applied. * @param rect Rectangle in relative coordinates to test in. * @param absoluteOffset Absolute offset of the rectangle. * @param point Absolute point to test. * @return * TRUE if the point hits the specified rectangle. */ virtual BOOL PtInRect(const RECT& rect, const POINT& absoluteOffset, const POINT& point) const; /** * @brief * Computes the bounding rectangle after transformation. * @param rect Rectangle in relative coordinates to transform. * @param absoluteOffset Absolute offset of the rectangle. * @return * A CRect object containing the bounding rectangle after transformation. */ virtual CRect GetBoundRect(const RECT& rect, const POINT& absoluteOffset) const; private: BOOL TransformRect(const RECT& rect, const POINT& absoluteOffset, PointF (&transformedRectPoints)[4]) const; private: GpMatrix* m_pMatrix; /**< Pointer to the native GDI+ matrix instance. */ }; /** @cond */ AFX_INLINE CXTPGdiPlus* CXTPMarkupGdiPlusTransformationMatrix::GetGdiPlus() { return NULL; } AFX_INLINE const CXTPGdiPlus* CXTPMarkupGdiPlusTransformationMatrix::GetGdiPlus() const { return NULL; } /** @endcond */ AFX_INLINE GpMatrix* CXTPMarkupGdiPlusTransformationMatrix::GetMatrix() { return m_pMatrix; } AFX_INLINE const GpMatrix* CXTPMarkupGdiPlusTransformationMatrix::GetMatrix() const { return m_pMatrix; } # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPMARKUPGDIPLUSTRANSFORMATIONMATRIX_H__) /** @endcond */