/** * @file XTPMarkupTranslateTransform.cpp * * @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 * */ #include "StdAfx.h" #include "Common/XTPTypeId.h" #include "Common/XTPCasting.h" #include "Common/XTPFramework.h" #include "Common/XTPSystemHelpers.h" #include "Markup/XTPMarkupObject.h" #include "Markup/Transform/XTPMarkupTransform.h" #include "Markup/Transform/XTPMarkupTranslateTransform.h" #include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" #ifdef _DEBUG # undef THIS_FILE static char THIS_FILE[] = __FILE__; # define new DEBUG_NEW #endif ////////////////////////////////////////////////////////////////////////// // CXTPMarkupTranslateTransform CXTPMarkupDependencyProperty* CXTPMarkupTranslateTransform::m_pPropertyX = NULL; CXTPMarkupDependencyProperty* CXTPMarkupTranslateTransform::m_pPropertyY = NULL; IMPLEMENT_MARKUPCLASS(NULL, CXTPMarkupTranslateTransform, CXTPMarkupTransform); void CXTPMarkupTranslateTransform::RegisterMarkupClass() { m_pPropertyX = CXTPMarkupDependencyProperty::Register( L"X", MARKUP_TYPE(CXTPMarkupDouble), MARKUP_TYPE(CXTPMarkupTranslateTransform), new CXTPMarkupPropertyMetadata(NULL, CXTPMarkupPropertyMetadata::flagAffectsRender | CXTPMarkupPropertyMetadata::flagHorzDpiSensible)); m_pPropertyY = CXTPMarkupDependencyProperty::Register( L"Y", MARKUP_TYPE(CXTPMarkupDouble), MARKUP_TYPE(CXTPMarkupTranslateTransform), new CXTPMarkupPropertyMetadata(NULL, CXTPMarkupPropertyMetadata::flagAffectsRender | CXTPMarkupPropertyMetadata::flagVertDpiSensible)); } double CXTPMarkupTranslateTransform::GetX() const { double nX = 0; CXTPMarkupDouble* pX = MARKUP_DYNAMICCAST(CXTPMarkupDouble, GetValue(m_pPropertyX)); if (NULL != pX) nX = *pX; return nX; } void CXTPMarkupTranslateTransform::SetX(double x) { SetValue(m_pPropertyX, new CXTPMarkupDouble(x)); } double CXTPMarkupTranslateTransform::GetY() const { double nY = 0; CXTPMarkupDouble* pY = MARKUP_DYNAMICCAST(CXTPMarkupDouble, GetValue(m_pPropertyY)); if (NULL != pY) nY = *pY; return nY; } void CXTPMarkupTranslateTransform::SetY(double y) { SetValue(m_pPropertyY, new CXTPMarkupDouble(y)); } CXTPMarkupTransformationMatrix* CXTPMarkupTranslateTransform::ApplyTransform(const CXTPMarkupTransformationMatrix* pMatrix) { _ASSERTE(NULL != pMatrix); UNREFERENCED_PARAMETER(pMatrix); return NULL; } #include "Common/Base/Diagnostic/XTPBeginAfxMap.h" BEGIN_DISPATCH_MAP(CXTPMarkupTranslateTransform, CXTPMarkupTransform) DISP_PROPERTY_EX(CXTPMarkupTranslateTransform, "X", OleGetX, OleSetX, VT_R8) DISP_PROPERTY_EX(CXTPMarkupTranslateTransform, "Y", OleGetY, OleSetY, VT_R8) END_DISPATCH_MAP() #include "Common/Base/Diagnostic/XTPEndAfxMap.h" double CXTPMarkupTranslateTransform::OleGetX() { return GetX(); } void CXTPMarkupTranslateTransform::OleSetX(double x) { SetX(x); } double CXTPMarkupTranslateTransform::OleGetY() { return GetY(); } void CXTPMarkupTranslateTransform::OleSetY(double y) { SetY(y); }