From 27a51bca41de6add69e1a025ec02ccf11afcb4d1 Mon Sep 17 00:00:00 2001 From: "Sergey.Konovalov" Date: Wed, 8 Oct 2014 15:52:42 +0000 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D1=85=D0=BE=D0=B4=20?= =?UTF-8?q?=D0=BE=D1=82=20IASCRenderer=20=D0=BA=20IRenderer=20=D0=B8=D0=B7?= =?UTF-8?q?=20DesktopEditor;=20=D0=BE=D1=82=D0=BA=D0=B0=D0=B7=20=D0=BE?= =?UTF-8?q?=D1=82=20=D0=B8=D0=BC=D0=BF=D0=BE=D1=80=D1=82=D0=B0=20=D0=B4?= =?UTF-8?q?=D0=BB=D0=BB=20ASCImageStudio3=20ASCHTMLRenderer;=20=D0=BE?= =?UTF-8?q?=D1=82=20AscGraphics=20=D1=82=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20F?= =?UTF-8?q?ontPicker=20=D0=B8=20FontManager.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58742 954022d7-b5bf-4e40-9824-e11837661b57 --- ASCHTMLRenderer/ASCHTMLRendererLib.vcproj | 329 ++ ASCHTMLRenderer/ASCSVGWriter.cpp | 1814 ++++--- ASCHTMLRenderer/ASCSVGWriter.h | 452 +- ASCHTMLRenderer/CASCImage.cpp | 441 ++ ASCHTMLRenderer/CASCImage.h | 107 + ASCHTMLRenderer/CASCSVGRenderer.cpp | 1051 ++++ ASCHTMLRenderer/CASCSVGRenderer.h | 234 + ASCHTMLRenderer/CMetafile.cpp | 245 + ASCHTMLRenderer/CMetafile.h | 15 + ASCHTMLRenderer/IBaseMatrixUpdater.h | 13 + ASCHTMLRenderer/Writer/CanvasWriter.h | 4 +- ASCHTMLRenderer/Writer/Common.h | 43 +- ASCHTMLRenderer/Writer/Document.h | 8 +- ASCHTMLRenderer/Writer/FontManager.h | 40 - ASCHTMLRenderer/Writer/SVGWriter.h | 14 +- ASCHTMLRenderer/Writer/StringWriter.h | 3 +- ASCHTMLRenderer/Writer/VMLWriter.h | 8 +- .../Writer/VectorGraphicsWriter2.h | 17 +- ASCHTMLRenderer/version.h | 6 +- .../Objects/Image/Wmf/RendererOutput.h | 76 +- .../ASCGraphics/Objects/Image/Wmf/WmfFile.h | 97 +- .../ASCGraphics/Objects/Image/Wmf/WmfTypes.h | 11 + ASCOfficeDocxFile2/ASCOfficeDocxFile2.sln | 556 +- .../BinWriter/BinEquationWriter.h | 48 +- .../DocWrapper/DocxSerializer.cpp | 5 +- ASCOfficeDocxFile2/DocWrapper/FontProcessor.h | 3 + .../ASCOfficeDrawingConverter.cpp | 19 +- ASCOfficePPTXFile/ASCOfficeDrawingConverter.h | 10 +- ASCOfficePPTXFile/ASCOfficePPTXFile.h | 2 - .../ASCOfficePPTXFileRealization.cpp | 4 - .../Editor/BinaryFileReaderWriter.cpp | 64 +- .../Editor/WMFToImageConverter.h | 59 +- ASCOfficePPTXFile/Editor/XmlWriter.h | 5 +- ASCOfficePPTXFile/Editor/imagemanager.h | 463 +- .../PPTXFormat/Logic/Geometry.cpp | 20 +- ASCOfficePPTXFile/PPTXFormat/Logic/Geometry.h | 4 +- ASCOfficePPTXFile/PPTXLib/PPTXFormat.vcproj | 36 +- ASCOfficePPTXFile/PPTXLib/stdafx.cpp | 4 - ASCOfficePPTXFile/PPTXLib/stdafx.h | 63 - ASCOfficePPTXFile/stdafx.h | 10 +- .../OfficeDrawing/Attributes.h | 73 +- .../OfficeDrawing/Elements.h | 27 +- .../Shapes/BaseShape/BaseShape.h | 2 +- .../OfficeDrawing/Shapes/BaseShape/Common.h | 342 +- .../Shapes/BaseShape/GraphicsPath.h | 24 +- .../Shapes/BaseShape/PPTXShape/PPTXShape.h | 2 +- .../OfficeDrawing/Shapes/BaseShape/Path.h | 3 +- .../OfficeDrawing/Shapes/Shape.h | 2 +- DesktopEditor/agg-2.4/agg_vs2005.vcproj | 823 +++ DesktopEditor/common/File.h | 10 +- .../cximage/CxImage/cximage_vs2005.vcproj | 3169 ++++++++++++ .../cximage/jasper/jasper_vs2005.vcproj | 4569 +++++++++++++++++ DesktopEditor/cximage/jbig/jbig_vs2005.vcproj | 769 +++ DesktopEditor/cximage/jpeg/Jpeg_vs2005.vcproj | 3778 ++++++++++++++ .../cximage/libpsd/libpsd_vs2005.vcproj | 4080 +++++++++++++++ DesktopEditor/cximage/mng/mng_vs2005.vcproj | 2010 ++++++++ DesktopEditor/cximage/png/png_vs2005.vcproj | 1777 +++++++ .../cximage/raw/libdcr_vs2005.vcproj | 701 +++ DesktopEditor/cximage/tiff/Tiff_vs2005.vcproj | 3262 ++++++++++++ DesktopEditor/cximage/zlib/zlib_vs2005.vcproj | 1413 +++++ DesktopEditor/fontengine/FontManager.cpp | 51 + DesktopEditor/fontengine/FontManager.h | 2 + .../fontengine/font_engine_vs2005.sln | 20 - DesktopEditor/graphics/GraphicsPath.cpp | 4 +- DesktopEditor/graphics/GraphicsPath.h | 4 +- DesktopEditor/graphics/IRenderer.h | 35 + DesktopEditor/graphics/Image.cpp | 24 + DesktopEditor/graphics/Image.h | 4 + DesktopEditor/graphics/graphics_vs2005.vcproj | 282 + DesktopEditor/graphics/structures.h | 1 + DesktopEditor/raster/BgraFrame.cpp | 13 + DesktopEditor/raster/BgraFrame.h | 2 +- DesktopEditor/raster/raster_vs2005.vcproj | 654 +++ 73 files changed, 32126 insertions(+), 2209 deletions(-) create mode 100644 ASCHTMLRenderer/ASCHTMLRendererLib.vcproj create mode 100644 ASCHTMLRenderer/CASCImage.cpp create mode 100644 ASCHTMLRenderer/CASCImage.h create mode 100644 ASCHTMLRenderer/CASCSVGRenderer.cpp create mode 100644 ASCHTMLRenderer/CASCSVGRenderer.h create mode 100644 ASCHTMLRenderer/CMetafile.cpp create mode 100644 ASCHTMLRenderer/CMetafile.h create mode 100644 ASCHTMLRenderer/IBaseMatrixUpdater.h delete mode 100644 ASCOfficePPTXFile/PPTXLib/stdafx.cpp delete mode 100644 ASCOfficePPTXFile/PPTXLib/stdafx.h create mode 100644 DesktopEditor/agg-2.4/agg_vs2005.vcproj create mode 100644 DesktopEditor/cximage/CxImage/cximage_vs2005.vcproj create mode 100644 DesktopEditor/cximage/jasper/jasper_vs2005.vcproj create mode 100644 DesktopEditor/cximage/jbig/jbig_vs2005.vcproj create mode 100644 DesktopEditor/cximage/jpeg/Jpeg_vs2005.vcproj create mode 100644 DesktopEditor/cximage/libpsd/libpsd_vs2005.vcproj create mode 100644 DesktopEditor/cximage/mng/mng_vs2005.vcproj create mode 100644 DesktopEditor/cximage/png/png_vs2005.vcproj create mode 100644 DesktopEditor/cximage/raw/libdcr_vs2005.vcproj create mode 100644 DesktopEditor/cximage/tiff/Tiff_vs2005.vcproj create mode 100644 DesktopEditor/cximage/zlib/zlib_vs2005.vcproj delete mode 100644 DesktopEditor/fontengine/font_engine_vs2005.sln create mode 100644 DesktopEditor/graphics/graphics_vs2005.vcproj create mode 100644 DesktopEditor/raster/raster_vs2005.vcproj diff --git a/ASCHTMLRenderer/ASCHTMLRendererLib.vcproj b/ASCHTMLRenderer/ASCHTMLRendererLib.vcproj new file mode 100644 index 0000000000..25a65195ad --- /dev/null +++ b/ASCHTMLRenderer/ASCHTMLRendererLib.vcproj @@ -0,0 +1,329 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ASCHTMLRenderer/ASCSVGWriter.cpp b/ASCHTMLRenderer/ASCSVGWriter.cpp index 8767e0c871..0f34520663 100644 --- a/ASCHTMLRenderer/ASCSVGWriter.cpp +++ b/ASCHTMLRenderer/ASCSVGWriter.cpp @@ -1,886 +1,11 @@ -#include "stdafx.h" -#include "./ASCSVGWriter.h" +#include "ASCSVGWriter.h" -CASCSVGWriter::CASCSVGWriter() -{ -} +#include "../DesktopEditor/graphics/GraphicsPath.h" +#include "Writer/VectorGraphicsWriter2.h" -HRESULT CASCSVGWriter::FinalConstruct() +namespace NSHtmlRenderer { - m_dDpiX = 96.0; - m_dDpiY = 96.0; - - m_dWidth = 100; - m_dHeight = 100; - m_bIsRaster = false; - - m_lClipMode = c_nClipRegionTypeWinding; - - m_pSimpleGraphicsConverter = NULL; - CoCreateInstance(Graphics::CLSID_CASCGraphicSimpleComverter, NULL, CLSCTX_ALL, Graphics::IID_IASCGraphicSimpleComverter, (void**)&m_pSimpleGraphicsConverter); - - IUnknown* punkRenderer = NULL; - this->QueryInterface(IID_IUnknown, (void**)&punkRenderer); - - m_pSimpleGraphicsConverter->put_Renderer(punkRenderer); - RELEASEINTERFACE(punkRenderer); - - m_dTransformAngle = 0.0; - - m_pFonts = NULL; - m_pFontManager = NULL; - - CoCreateInstance(__uuidof(Graphics::CASCFontManager), NULL, CLSCTX_ALL, __uuidof(Graphics::IASCFontManager), (void**)&m_pFontManager); - m_pFontManager->Initialize(L""); - - m_oVectorWriter.m_pSimpleConverter = m_pSimpleGraphicsConverter; - m_oVectorWriter.m_pFullTransform = &m_oFullTransform; - m_oVectorWriter.SetSettings(&m_oPen, &m_oBrush, m_pSimpleGraphicsConverter); - - return S_OK; -} - -void CASCSVGWriter::FinalRelease() -{ - RELEASEINTERFACE(m_pSimpleGraphicsConverter); - RELEASEINTERFACE(m_pFonts); - RELEASEINTERFACE(m_pFontManager); -} - -STDMETHODIMP CASCSVGWriter::get_Type(LONG* lType) -{ - if (NULL == lType) - return S_FALSE; - - *lType = c_nSVGRendrerer; - return S_OK; -} -//-------- Функции для работы со страницей -------------------------------------------------- -STDMETHODIMP CASCSVGWriter::NewPage() -{ - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_Height(double* dHeight) -{ - *dHeight = m_dHeight; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_Height(double dHeight) -{ - m_dHeight = dHeight; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_Width(double* dWidth) -{ - *dWidth = m_dWidth; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_Width(double dWidth) -{ - m_dWidth = dWidth; - return S_OK; -} - -STDMETHODIMP CASCSVGWriter::get_DpiX(double* dDpiX) -{ - if (NULL != dDpiX) - *dDpiX = m_dDpiX; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_DpiY(double* dDpiY) -{ - if (NULL != dDpiY) - *dDpiY = m_dDpiY; - return S_OK; -} -// pen -------------------------------------------------------------------------------------- -STDMETHODIMP CASCSVGWriter::SetPen(BSTR bsXML) -{ - m_oPen.FromXmlString((CString)bsXML); - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_PenColor(LONG* lColor) -{ - *lColor = m_oPen.Color; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_PenColor(LONG lColor) -{ - m_oPen.Color = lColor; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_PenAlpha(LONG* lAlpha) -{ - *lAlpha = m_oPen.Alpha; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_PenAlpha(LONG lAlpha) -{ - m_oPen.Alpha = lAlpha; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_PenSize(double* dSize) -{ - *dSize = m_oPen.Size; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_PenSize(double dSize) -{ - m_oPen.Size = dSize; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_PenDashStyle(BYTE* val) -{ - *val = m_oPen.DashStyle; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_PenDashStyle(BYTE val) -{ - m_oPen.DashStyle = val; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_PenLineStartCap(BYTE* val) -{ - *val = m_oPen.LineStartCap; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_PenLineStartCap(BYTE val) -{ - m_oPen.LineStartCap = val; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_PenLineEndCap(BYTE* val) -{ - *val = m_oPen.LineEndCap; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_PenLineEndCap(BYTE val) -{ - m_oPen.LineEndCap = val; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_PenLineJoin(BYTE* val) -{ - *val = m_oPen.LineJoin; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_PenLineJoin(BYTE val) -{ - m_oPen.LineJoin = val; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_PenDashOffset(double* val) -{ - *val = m_oPen.DashOffset; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_PenDashOffset(double val) -{ - m_oPen.DashOffset = val; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_PenAlign(LONG* val) -{ - *val = m_oPen.Align; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_PenAlign(LONG val) -{ - m_oPen.Align = val; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_PenMiterLimit(double* val) -{ - *val = m_oPen.MiterLimit; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_PenMiterLimit(double val) -{ - m_oPen.MiterLimit = val; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::PenDashPattern(SAFEARRAY* pPattern) -{ - if (NULL != pPattern) - { - m_oPen.SetDashPattern((double*)pPattern->pvData, pPattern->rgsabound[0].cElements); - } - - return S_OK; -} -// brush ------------------------------------------------------------------------------------ -STDMETHODIMP CASCSVGWriter::SetBrush(BSTR bsXML) -{ - m_oBrush.FromXmlString((CString)bsXML); - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_BrushType(LONG* lType) -{ - *lType = m_oBrush.Type; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_BrushType(LONG lType) -{ - m_oBrush.Type = lType; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_BrushColor1(LONG* lColor) -{ - *lColor = m_oBrush.Color1; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_BrushColor1(LONG lColor) -{ - m_oBrush.Color1 = lColor; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_BrushAlpha1(LONG* lAlpha) -{ - *lAlpha = m_oBrush.Alpha1; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_BrushAlpha1(LONG lAlpha) -{ - m_oBrush.Alpha1 = lAlpha; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_BrushColor2(LONG* lColor) -{ - *lColor = m_oBrush.Color2; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_BrushColor2(LONG lColor) -{ - m_oBrush.Color2 = lColor; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_BrushAlpha2(LONG* lAlpha) -{ - *lAlpha = m_oBrush.Alpha2; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_BrushAlpha2(LONG lAlpha) -{ - m_oBrush.Alpha2 = lAlpha; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_BrushTexturePath(BSTR* bsPath) -{ - *bsPath = m_oBrush.TexturePath.AllocSysString(); - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_BrushTexturePath(BSTR bsPath) -{ - m_oBrush.TexturePath = (CString)bsPath; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_BrushTextureMode(LONG* lMode) -{ - *lMode = m_oBrush.TextureMode; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_BrushTextureMode(LONG lMode) -{ - m_oBrush.TextureMode = lMode; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_BrushTextureAlpha(LONG* lTxAlpha) -{ - *lTxAlpha = m_oBrush.TextureAlpha; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_BrushTextureAlpha(LONG lTxAlpha) -{ - m_oBrush.TextureAlpha = lTxAlpha; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_BrushLinearAngle(double* dAngle) -{ - *dAngle = m_oBrush.LinearAngle; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_BrushLinearAngle(double dAngle) -{ - m_oBrush.LinearAngle = dAngle; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::BrushRect(BOOL val, double left, double top, double width, double height) -{ - m_oBrush.Rectable = val; - m_oBrush.Rect.X = (float)left; - m_oBrush.Rect.Y = (float)top; - m_oBrush.Rect.Width = (float)width; - m_oBrush.Rect.Height = (float)height; - - return S_OK; -} -// font ------------------------------------------------------------------------------------- -STDMETHODIMP CASCSVGWriter::SetFont(BSTR bsXML) -{ - m_oFont.FromXmlString((CString)bsXML); - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_FontName(BSTR* bsName) -{ - *bsName = m_oFont.Name.AllocSysString(); - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_FontName(BSTR bsName) -{ - m_oFont.Name = (CString)bsName; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_FontPath(BSTR* bsName) -{ - *bsName = m_oFont.Path.AllocSysString(); - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_FontPath(BSTR bsName) -{ - m_oFont.Path = bsName; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_FontSize(double* dSize) -{ - *dSize = m_oFont.Size; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_FontSize(double dSize) -{ - m_oFont.Size = dSize; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_FontStyle(LONG* lStyle) -{ - *lStyle = m_oFont.GetStyle(); - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_FontStyle(LONG lStyle) -{ - m_oFont.SetStyle(lStyle); - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_FontStringGID(BOOL* bGID) -{ - *bGID = m_oFont.StringGID; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_FontStringGID(BOOL bGID) -{ - m_oFont.StringGID = bGID; - m_pFontManager->SetStringGID(bGID); - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_FontCharSpace(double* dSpace) -{ - *dSpace = m_oFont.CharSpace; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_FontCharSpace(double dSpace) -{ - m_oFont.CharSpace = dSpace; - return S_OK; -} -// shadow ----------------------------------------------------------------------------------- -STDMETHODIMP CASCSVGWriter::SetShadow(BSTR bsXML) -{ - m_oShadow.FromXmlString((CString)bsXML); - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_ShadowDistanceX(double* val) -{ - *val = m_oShadow.DistanceX; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_ShadowDistanceX(double val) -{ - m_oShadow.DistanceX = val; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_ShadowDistanceY(double* val) -{ - *val = m_oShadow.DistanceY; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_ShadowDistanceY(double val) -{ - m_oShadow.DistanceY = val; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_ShadowBlurSize(double* val) -{ - *val = m_oShadow.BlurSize; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_ShadowBlurSize(double val) -{ - m_oShadow.BlurSize = val; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_ShadowColor(LONG* val) -{ - *val = m_oShadow.Color; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_ShadowColor(LONG val) -{ - m_oShadow.Color = val; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_ShadowAlpha(LONG* val) -{ - *val = m_oShadow.Alpha; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_ShadowAlpha(LONG val) -{ - m_oShadow.Alpha = val; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_ShadowVisible(BOOL* val) -{ - *val = m_oShadow.Visible; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_ShadowVisible(BOOL val) -{ - m_oShadow.Visible = val; - return S_OK; -} -// edge ------------------------------------------------------------------------------------- -STDMETHODIMP CASCSVGWriter::SetEdgeText(BSTR bsXML) -{ - m_oEdge.FromXmlString((CString)bsXML); - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_EdgeVisible(LONG* val) -{ - *val = m_oEdge.Visible; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_EdgeVisible(LONG val) -{ - m_oEdge.Visible = val; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_EdgeColor(LONG* val) -{ - *val = m_oEdge.Color; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_EdgeColor(LONG val) -{ - m_oEdge.Color = val; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_EdgeAlpha(LONG* val) -{ - *val = m_oEdge.Alpha; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_EdgeAlpha(LONG val) -{ - m_oEdge.Alpha = val; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::get_EdgeDist(double* val) -{ - *val = m_oEdge.Dist; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_EdgeDist(double val) -{ - m_oEdge.Dist = val; - return S_OK; -} -//-------- Функции для вывода текста -------------------------------------------------------- -STDMETHODIMP CASCSVGWriter::CommandDrawText(BSTR bsText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset) -{ - if (c_nHyperlinkType == m_lCurrentCommandType) - return S_OK; - - if (m_bIsRaster) - return S_OK; - - PathCommandEnd(); - BeginCommand(c_nPathType); - PathCommandText(bsText, fX, fY, fWidth, fHeight, fBaseLineOffset); - DrawPath(c_nWindingFillMode); - EndCommand(c_nPathType); - PathCommandEnd(); - return S_OK; -} -STDMETHODIMP CASCSVGWriter::CommandDrawTextEx(BSTR bsText, BSTR bsGidText, BSTR bsSourceCodeText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset, DWORD lFlags) -{ - if (m_bIsRaster) - return S_OK; - - PathCommandEnd(); - BeginCommand(c_nPathType); - PathCommandTextEx(bsText, bsGidText, bsSourceCodeText, fX, fY, fWidth, fHeight, fBaseLineOffset, lFlags); - DrawPath(c_nWindingFillMode); - EndCommand(c_nPathType); - PathCommandEnd(); - return S_OK; -} -//-------- Маркеры для команд --------------------------------------------------------------- -STDMETHODIMP CASCSVGWriter::BeginCommand(DWORD lType) -{ - if (m_bIsRaster) - return S_OK; - - if (c_nClipType == lType) - { - m_oVectorWriter.WritePathClip(); - } - else if (c_nPathType == lType) - { - m_oVectorWriter.WritePathStart(); - m_pSimpleGraphicsConverter->PathCommandEnd(); - } - m_lCurrentCommandType = lType; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::EndCommand(DWORD lType) -{ - if (m_bIsRaster) - return S_OK; - - if (c_nClipType == lType) - { - m_oVectorWriter.WritePathClipEnd(); - } - else if (c_nResetClipType == lType) - { - m_oVectorWriter.WritePathResetClip(); - } - m_lCurrentCommandType = -1; - return S_OK; -} -//-------- Функции для работы с Graphics Path ----------------------------------------------- -STDMETHODIMP CASCSVGWriter::PathCommandMoveTo(double fX, double fY) -{ - if (m_bIsRaster) - return S_OK; - - if (c_nSimpleGraphicType == m_lCurrentCommandType) - { - MoveTo(fX, fY); - } - else - { - m_pSimpleGraphicsConverter->PathCommandMoveTo(fX, fY); - } - return S_OK; -} -STDMETHODIMP CASCSVGWriter::PathCommandLineTo(double fX, double fY) -{ - if (m_bIsRaster) - return S_OK; - - if (c_nSimpleGraphicType == m_lCurrentCommandType) - { - LineTo(fX, fY); - } - else - { - m_pSimpleGraphicsConverter->PathCommandLineTo(fX, fY); - } - - return S_OK; -} -STDMETHODIMP CASCSVGWriter::PathCommandLinesTo(SAFEARRAY* pPoints) -{ - if (m_bIsRaster) - return S_OK; - - m_pSimpleGraphicsConverter->PathCommandLinesTo(pPoints); - return S_OK; -} -STDMETHODIMP CASCSVGWriter::PathCommandCurveTo(double fX1, double fY1, double fX2, double fY2, double fX3, double fY3) -{ - if (m_bIsRaster) - return S_OK; - - if (c_nSimpleGraphicType == m_lCurrentCommandType) - { - CurveTo(fX1, fY1, fX2, fY2, fX3, fY3); - } - else - { - m_pSimpleGraphicsConverter->PathCommandCurveTo(fX1, fY1, fX2, fY2, fX3, fY3); - } - - return S_OK; -} -STDMETHODIMP CASCSVGWriter::PathCommandCurvesTo(SAFEARRAY* pPoints) -{ - if (m_bIsRaster) - return S_OK; - - m_pSimpleGraphicsConverter->PathCommandCurvesTo(pPoints); - return S_OK; -} -STDMETHODIMP CASCSVGWriter::PathCommandArcTo(double fX, double fY, double fWidth, double fHeight, double fStartAngle, double fSweepAngle) -{ - if (m_bIsRaster) - return S_OK; - - m_pSimpleGraphicsConverter->PathCommandArcTo(fX, fY, fWidth, fHeight, fStartAngle, fSweepAngle); - return S_OK; -} -STDMETHODIMP CASCSVGWriter::PathCommandClose() -{ - if (m_bIsRaster) - return S_OK; - - if (c_nSimpleGraphicType == m_lCurrentCommandType) - { - Close(); - } - else - { - m_pSimpleGraphicsConverter->PathCommandClose(); - } - - return S_OK; -} -STDMETHODIMP CASCSVGWriter::PathCommandEnd() -{ - if (m_bIsRaster) - return S_OK; - - if (c_nSimpleGraphicType == m_lCurrentCommandType) - { - End(); - } - else - { - m_pSimpleGraphicsConverter->PathCommandEnd(); - } - - return S_OK; -} -STDMETHODIMP CASCSVGWriter::DrawPath(long nType) -{ - if (m_oBrush.Type == c_BrushTypeTexture) - m_bIsRaster = true; - - if (m_bIsRaster) - return S_OK; - - m_oVectorWriter.WriteDrawPath(nType); - return S_OK; -} -STDMETHODIMP CASCSVGWriter::PathCommandStart() -{ - if (m_bIsRaster) - return S_OK; - - if (c_nSimpleGraphicType == m_lCurrentCommandType) - { - Start(); - } - else - { - m_pSimpleGraphicsConverter->PathCommandEnd(); - m_pSimpleGraphicsConverter->PathCommandStart(); - } - - return S_OK; -} -STDMETHODIMP CASCSVGWriter::PathCommandGetCurrentPoint(double* fX, double* fY) -{ - m_pSimpleGraphicsConverter->PathCommandGetCurrentPoint(fX, fY); - return S_OK; -} -STDMETHODIMP CASCSVGWriter::PathCommandText(BSTR bsText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset) -{ - if (m_bIsRaster) - return S_OK; - - _SetFont(); - m_pSimpleGraphicsConverter->PathCommandText(bsText, m_pFontManager, fX, fY, fWidth, fHeight, fBaseLineOffset); - return S_OK; -} -STDMETHODIMP CASCSVGWriter::PathCommandTextEx(BSTR bsText, BSTR bsGidText, BSTR bsSourceCodeText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset, DWORD lFlags) -{ - if (m_bIsRaster) - return S_OK; - - BOOL bGid = m_oFont.StringGID; - if (NULL != bsGidText) - { - m_oFont.StringGID = TRUE; - PathCommandText(bsGidText, fX, fY, fWidth, fHeight, fBaseLineOffset); - } - - m_oFont.StringGID = FALSE; - PathCommandText(bsText, fX, fY, fWidth, fHeight, fBaseLineOffset); - - m_oFont.StringGID = bGid; - return S_OK; -} -//-------- Функции для вывода изображений --------------------------------------------------- -STDMETHODIMP CASCSVGWriter::DrawImage(IUnknown* pInterface, double fX, double fY, double fWidth, double fHeight) -{ - m_bIsRaster = true; - /* - double x = fX; - double y = fY; - - double r = fX + fWidth; - double b = fY + fHeight; - - if (0 == m_dTransformAngle) - { - m_oFullTransform.TransformPoint(x, y); - m_oFullTransform.TransformPoint(r, b); - } - else - { - NSHtmlRenderer::CMatrix oTemp = m_oFullTransform; - - double dCx = (x + r) / 2; - double dCy = (y + b) / 2; - m_oFullTransform.TransformPoint(dCx, dCy); - oTemp.RotateAt(-m_dTransformAngle, dCx, dCy, Aggplus::MatrixOrderAppend); - - oTemp.TransformPoint(x, y); - oTemp.TransformPoint(r, b); - } - - m_oWriter.WriteImage(pInterface, x, y, r - x, b - y, m_dTransformAngle); - */ - - return S_OK; -} -STDMETHODIMP CASCSVGWriter::DrawImageFromFile(BSTR bstrVal, double fX, double fY, double fWidth, double fHeight) -{ - m_bIsRaster = true; - /* - double x = fX; - double y = fY; - - double r = fX + fWidth; - double b = fY + fHeight; - - if (0 == m_dTransformAngle) - { - m_oFullTransform.TransformPoint(x, y); - m_oFullTransform.TransformPoint(r, b); - } - else - { - NSHtmlRenderer::CMatrix oTemp = m_oFullTransform; - - double dCx = (x + r) / 2; - double dCy = (y + b) / 2; - m_oFullTransform.TransformPoint(dCx, dCy); - oTemp.RotateAt(-m_dTransformAngle, dCx, dCy, Aggplus::MatrixOrderAppend); - - oTemp.TransformPoint(x, y); - oTemp.TransformPoint(r, b); - } - - m_oWriter.WriteImage((CString)bstrVal, x, y, r - x, b - y, m_oTransform.z_Rotation()); - */ - - return S_OK; -} -// transform -------------------------------------------------------------------------------- -STDMETHODIMP CASCSVGWriter::GetCommandParams(double* dAngle, double* dLeft, double* dTop, double* dWidth, double* dHeight, DWORD* lFlags) -{ - return S_OK; -} -STDMETHODIMP CASCSVGWriter::SetCommandParams(double dAngle, double dLeft, double dTop, double dWidth, double dHeight, DWORD lFlags) -{ - if ((dWidth <= 1) || (dHeight <= 1)) - lFlags = 0; - - BOOL bFlipX = (0 != (c_nParamFlipX & lFlags)); - BOOL bFlipY = (0 != (c_nParamFlipY & lFlags)); - - double m11 = bFlipX ? -1.0 : 1.0; - double m22 = bFlipY ? -1.0 : 1.0; - - NSHtmlRenderer::CMatrix oMatrix(1, 0, 0, 1, 0, 0); - - if ((0 != dAngle) || (0 != lFlags)) - { - double dCentreX = (dLeft + dWidth / 2.0); - double dCentreY = (dTop + dHeight / 2.0); - - oMatrix.Translate(-dCentreX, -dCentreY , Aggplus::MatrixOrderAppend); - - oMatrix.Rotate(dAngle , Aggplus::MatrixOrderAppend); - oMatrix.Scale(m11, m22 , Aggplus::MatrixOrderAppend); - - oMatrix.Translate(dCentreX, dCentreY , Aggplus::MatrixOrderAppend); - } - - m_oTransform = oMatrix; - CalculateFullTransform(); - - return S_OK; -} -STDMETHODIMP CASCSVGWriter::SetTransform(double dA, double dB, double dC, double dD, double dE, double dF) -{ - NSHtmlRenderer::CMatrix oTrans(dA, dB, dC, dD, dE, dF); - m_oTransform = oTrans; - - CalculateFullTransform(); - - return S_OK; -} -STDMETHODIMP CASCSVGWriter::GetTransform(double *pdA, double *pdB, double *pdC, double *pdD, double *pdE, double *pdF) -{ - return S_OK; -} -STDMETHODIMP CASCSVGWriter::ResetTransform(void) -{ - m_oTransform.Reset(); - CalculateFullTransform(); - return S_OK; -} -// ----------------------------------------------------------------------------------------- -STDMETHODIMP CASCSVGWriter::get_ClipMode(LONG* plMode) -{ - *plMode = m_lClipMode; - return S_OK; -} -STDMETHODIMP CASCSVGWriter::put_ClipMode(LONG lMode) -{ - m_lClipMode = lMode; - m_oVectorWriter.SetClipMode(m_lClipMode); - return S_OK; -} -// additiaonal params ---------------------------------------------------------------------- -STDMETHODIMP CASCSVGWriter::SetAdditionalParam(BSTR ParamName, VARIANT ParamValue) -{ - CString sParamName = ParamName; - if ( _T("SaveFile") == sParamName && ParamValue.vt == VT_BSTR) - { - CString strFileSave = (CString)ParamValue.bstrVal; - CFile oFile; - if (oFile.CreateFile(strFileSave) == S_OK) - { - LONG lW = (LONG)m_dWidth; - LONG lH = (LONG)m_dHeight; - CString strStart = _T(""); - strStart.Format(NSHtmlRenderer::g_svg_string_svgOpen, (LONG)(m_dWidth / 100), (LONG)(m_dHeight / 100), lW, lH); - - oFile.WriteStringUTF8(strStart); - - CString s = m_oVectorWriter.m_oSVG.m_oDocument.GetCString(); - oFile.WriteStringUTF8(s); - - CString strEnd = _T(""); - oFile.WriteStringUTF8(strEnd); - } - oFile.CloseFile(); - } - else if (_T("ReInit") == sParamName) + CASCSVGWriter::CASCSVGWriter() { m_dDpiX = 96.0; m_dDpiY = 96.0; @@ -891,44 +16,909 @@ STDMETHODIMP CASCSVGWriter::SetAdditionalParam(BSTR ParamName, VARIANT ParamValu m_lClipMode = c_nClipRegionTypeWinding; - RELEASEINTERFACE(m_pSimpleGraphicsConverter); - CoCreateInstance(Graphics::CLSID_CASCGraphicSimpleComverter, NULL, CLSCTX_ALL, Graphics::IID_IASCGraphicSimpleComverter, (void**)&m_pSimpleGraphicsConverter); - - IUnknown* punkRenderer = NULL; - this->QueryInterface(IID_IUnknown, (void**)&punkRenderer); - - m_pSimpleGraphicsConverter->put_Renderer(punkRenderer); - RELEASEINTERFACE(punkRenderer); + m_pSimpleGraphicsConverter = new Aggplus::CGraphicsPathSimpleConverter(); + m_pSimpleGraphicsConverter->SetRenderer(this); m_dTransformAngle = 0.0; - m_pFonts = NULL; - - m_oVectorWriter.m_pSimpleConverter = m_pSimpleGraphicsConverter; - m_oVectorWriter.m_pFullTransform = &m_oFullTransform; - m_oVectorWriter.SetSettings(&m_oPen, &m_oBrush, m_pSimpleGraphicsConverter); + m_pFontManager = NULL; + m_pPen = new NSStructures::CPen(); + m_pBrush = new NSStructures::CBrush(); + m_pFont = new NSStructures::CFont(); + m_pInstalledFont = new NSStructures::CFont(); - m_oPen.SetDefaultParams(); - m_oBrush.SetDefaultParams(); - m_oFont.SetDefaultParams(); + m_pBaseTransform = new Aggplus::CMatrix(); + m_pTransform = new Aggplus::CMatrix(); + m_pFullTransform = new Aggplus::CMatrix(); - m_oBaseTransform.Reset(); - m_oTransform.Reset(); - m_oFullTransform.Reset(); + //todo вроде как подбора нет, но может нужно передавать? + m_pFontManager = new CFontManager(); + m_pFontManager->Initialize(); - m_oVectorWriter.m_oSVG.ReInit(); + m_pVectorWriter = new NSHtmlRenderer::CSVGGraphicsWriter(); + m_pVectorWriter->m_pSimpleConverter = m_pSimpleGraphicsConverter; + m_pVectorWriter->m_pFullTransform = m_pFullTransform; + m_pVectorWriter->SetSettings(m_pPen, m_pBrush, m_pSimpleGraphicsConverter); } - return S_OK; -} -STDMETHODIMP CASCSVGWriter::GetAdditionalParam(BSTR ParamName, VARIANT* ParamValue) -{ - CString sParamName = ParamName; - if ( _T("IsRaster") == sParamName ) + CASCSVGWriter::~CASCSVGWriter() { - ParamValue->vt = VT_BOOL; - ParamValue->boolVal = m_bIsRaster ? VARIANT_TRUE : VARIANT_FALSE; + RELEASEOBJECT(m_pSimpleGraphicsConverter); + if(m_bDeleteFontManager) + RELEASEOBJECT(m_pFontManager); + RELEASEOBJECT(m_pPen); + RELEASEOBJECT(m_pBrush); + RELEASEOBJECT(m_pFont); + RELEASEOBJECT(m_pBaseTransform); + RELEASEOBJECT(m_pTransform); + RELEASEOBJECT(m_pFullTransform); } - - return S_OK; -} -// -------------------------------------------------------------------------------------------- \ No newline at end of file + + HRESULT CASCSVGWriter::get_Type(LONG* lType) + { + if (NULL == lType) + return S_FALSE; + + *lType = c_nSVGRendrerer; + return S_OK; + } + //-------- Функции для работы со страницей -------------------------------------------------- + HRESULT CASCSVGWriter::NewPage() + { + return S_OK; + } + HRESULT CASCSVGWriter::get_Height(double* dHeight) + { + *dHeight = m_dHeight; + return S_OK; + } + HRESULT CASCSVGWriter::put_Height(const double& dHeight) + { + m_dHeight = dHeight; + return S_OK; + } + HRESULT CASCSVGWriter::get_Width(double* dWidth) + { + *dWidth = m_dWidth; + return S_OK; + } + HRESULT CASCSVGWriter::put_Width(const double& dWidth) + { + m_dWidth = dWidth; + return S_OK; + } + + HRESULT CASCSVGWriter::get_DpiX(double* dDpiX) + { + if (NULL != dDpiX) + *dDpiX = m_dDpiX; + return S_OK; + } + HRESULT CASCSVGWriter::get_DpiY(double* dDpiY) + { + if (NULL != dDpiY) + *dDpiY = m_dDpiY; + return S_OK; + } + // pen -------------------------------------------------------------------------------------- + HRESULT CASCSVGWriter::get_PenColor(LONG* lColor) + { + *lColor = m_pPen->Color; + return S_OK; + } + HRESULT CASCSVGWriter::put_PenColor(const LONG& lColor) + { + m_pPen->Color = lColor; + return S_OK; + } + HRESULT CASCSVGWriter::get_PenAlpha(LONG* lAlpha) + { + *lAlpha = m_pPen->Alpha; + return S_OK; + } + HRESULT CASCSVGWriter::put_PenAlpha(const LONG& lAlpha) + { + m_pPen->Alpha = lAlpha; + return S_OK; + } + HRESULT CASCSVGWriter::get_PenSize(double* dSize) + { + *dSize = m_pPen->Size; + return S_OK; + } + HRESULT CASCSVGWriter::put_PenSize(const double& dSize) + { + m_pPen->Size = dSize; + return S_OK; + } + HRESULT CASCSVGWriter::get_PenDashStyle(BYTE* val) + { + *val = m_pPen->DashStyle; + return S_OK; + } + HRESULT CASCSVGWriter::put_PenDashStyle(const BYTE& val) + { + m_pPen->DashStyle = val; + return S_OK; + } + HRESULT CASCSVGWriter::get_PenLineStartCap(BYTE* val) + { + *val = m_pPen->LineStartCap; + return S_OK; + } + HRESULT CASCSVGWriter::put_PenLineStartCap(const BYTE& val) + { + m_pPen->LineStartCap = val; + return S_OK; + } + HRESULT CASCSVGWriter::get_PenLineEndCap(BYTE* val) + { + *val = m_pPen->LineEndCap; + return S_OK; + } + HRESULT CASCSVGWriter::put_PenLineEndCap(const BYTE& val) + { + m_pPen->LineEndCap = val; + return S_OK; + } + HRESULT CASCSVGWriter::get_PenLineJoin(BYTE* val) + { + *val = m_pPen->LineJoin; + return S_OK; + } + HRESULT CASCSVGWriter::put_PenLineJoin(const BYTE& val) + { + m_pPen->LineJoin = val; + return S_OK; + } + HRESULT CASCSVGWriter::get_PenDashOffset(double* val) + { + *val = m_pPen->DashOffset; + return S_OK; + } + HRESULT CASCSVGWriter::put_PenDashOffset(const double& val) + { + m_pPen->DashOffset = val; + return S_OK; + } + HRESULT CASCSVGWriter::get_PenAlign(LONG* val) + { + *val = m_pPen->Align; + return S_OK; + } + HRESULT CASCSVGWriter::put_PenAlign(const LONG& val) + { + m_pPen->Align = val; + return S_OK; + } + HRESULT CASCSVGWriter::get_PenMiterLimit(double* val) + { + *val = m_pPen->MiterLimit; + return S_OK; + } + HRESULT CASCSVGWriter::put_PenMiterLimit(const double& val) + { + m_pPen->MiterLimit = val; + return S_OK; + } + HRESULT CASCSVGWriter::PenDashPattern(double* pPattern, LONG lCount) + { + if (NULL != pPattern) + { + m_pPen->SetDashPattern(pPattern, lCount); + } + + return S_OK; + } + // brush ------------------------------------------------------------------------------------ + HRESULT CASCSVGWriter::get_BrushType(LONG* lType) + { + *lType = m_pBrush->Type; + return S_OK; + } + HRESULT CASCSVGWriter::put_BrushType(const LONG& lType) + { + m_pBrush->Type = lType; + return S_OK; + } + HRESULT CASCSVGWriter::get_BrushColor1(LONG* lColor) + { + *lColor = m_pBrush->Color1; + return S_OK; + } + HRESULT CASCSVGWriter::put_BrushColor1(const LONG& lColor) + { + m_pBrush->Color1 = lColor; + return S_OK; + } + HRESULT CASCSVGWriter::get_BrushAlpha1(LONG* lAlpha) + { + *lAlpha = m_pBrush->Alpha1; + return S_OK; + } + HRESULT CASCSVGWriter::put_BrushAlpha1(const LONG& lAlpha) + { + m_pBrush->Alpha1 = lAlpha; + return S_OK; + } + HRESULT CASCSVGWriter::get_BrushColor2(LONG* lColor) + { + *lColor = m_pBrush->Color2; + return S_OK; + } + HRESULT CASCSVGWriter::put_BrushColor2(const LONG& lColor) + { + m_pBrush->Color2 = lColor; + return S_OK; + } + HRESULT CASCSVGWriter::get_BrushAlpha2(LONG* lAlpha) + { + *lAlpha = m_pBrush->Alpha2; + return S_OK; + } + HRESULT CASCSVGWriter::put_BrushAlpha2(const LONG& lAlpha) + { + m_pBrush->Alpha2 = lAlpha; + return S_OK; + } + HRESULT CASCSVGWriter::get_BrushTexturePath(std::wstring* bsPath) + { + *bsPath = m_pBrush->TexturePath; + return S_OK; + } + HRESULT CASCSVGWriter::put_BrushTexturePath(const std::wstring& bsPath) + { + m_pBrush->TexturePath = bsPath; + return S_OK; + } + HRESULT CASCSVGWriter::get_BrushTextureMode(LONG* lMode) + { + *lMode = m_pBrush->TextureMode; + return S_OK; + } + HRESULT CASCSVGWriter::put_BrushTextureMode(const LONG& lMode) + { + m_pBrush->TextureMode = lMode; + return S_OK; + } + HRESULT CASCSVGWriter::get_BrushTextureAlpha(LONG* lTxAlpha) + { + *lTxAlpha = m_pBrush->TextureAlpha; + return S_OK; + } + HRESULT CASCSVGWriter::put_BrushTextureAlpha(const LONG& lTxAlpha) + { + m_pBrush->TextureAlpha = lTxAlpha; + return S_OK; + } + HRESULT CASCSVGWriter::get_BrushLinearAngle(double* dAngle) + { + *dAngle = m_pBrush->LinearAngle; + return S_OK; + } + HRESULT CASCSVGWriter::put_BrushLinearAngle(const double& dAngle) + { + m_pBrush->LinearAngle = dAngle; + return S_OK; + } + HRESULT CASCSVGWriter::BrushRect(const INT& val, const double& left, const double& top, const double& width, const double& height) + { + m_pBrush->Rectable = val; + m_pBrush->Rect.X = (float)left; + m_pBrush->Rect.Y = (float)top; + m_pBrush->Rect.Width = (float)width; + m_pBrush->Rect.Height = (float)height; + + return S_OK; + } + HRESULT CASCSVGWriter::BrushBounds(const double& left, const double& top, const double& width, const double& height) + { + return S_OK; + } + + HRESULT CASCSVGWriter::put_BrushGradientColors(LONG* lColors, double* pPositions, LONG nCount) + { + return S_OK; + } + + // font ------------------------------------------------------------------------------------- + HRESULT CASCSVGWriter::get_FontName(std::wstring* bsName) + { + *bsName = m_pFont->Name; + return S_OK; + } + HRESULT CASCSVGWriter::put_FontName(const std::wstring& bsName) + { + m_pFont->Name = bsName; + return S_OK; + } + HRESULT CASCSVGWriter::get_FontPath(std::wstring* bsName) + { + *bsName = m_pFont->Path; + return S_OK; + } + HRESULT CASCSVGWriter::put_FontPath(const std::wstring& bsName) + { + m_pFont->Path = bsName; + return S_OK; + } + HRESULT CASCSVGWriter::get_FontSize(double* dSize) + { + *dSize = m_pFont->Size; + return S_OK; + } + HRESULT CASCSVGWriter::put_FontSize(const double& dSize) + { + m_pFont->Size = dSize; + return S_OK; + } + HRESULT CASCSVGWriter::get_FontStyle(LONG* lStyle) + { + *lStyle = m_pFont->GetStyle(); + return S_OK; + } + HRESULT CASCSVGWriter::put_FontStyle(const LONG& lStyle) + { + m_pFont->SetStyle(lStyle); + return S_OK; + } + HRESULT CASCSVGWriter::get_FontStringGID(INT* bGID) + { + *bGID = m_pFont->StringGID; + return S_OK; + } + HRESULT CASCSVGWriter::put_FontStringGID(const INT& bGID) + { + m_pFont->StringGID = bGID; + m_pFontManager->SetStringGID(bGID); + return S_OK; + } + HRESULT CASCSVGWriter::get_FontCharSpace(double* dSpace) + { + *dSpace = m_pFont->CharSpace; + return S_OK; + } + HRESULT CASCSVGWriter::put_FontCharSpace(const double& dSpace) + { + m_pFont->CharSpace = dSpace; + return S_OK; + } + HRESULT CASCSVGWriter::get_FontFaceIndex(int* lFaceIndex) + { + *lFaceIndex = m_pFont->FaceIndex; + return S_OK; + } + HRESULT CASCSVGWriter::put_FontFaceIndex(const int& lFaceIndex) + { + m_pFont->FaceIndex = lFaceIndex; + return S_OK; + } + //-------- Функции для вывода текста -------------------------------------------------------- + HRESULT CASCSVGWriter::CommandDrawTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset) + { + //todo new command + return S_OK; + } + HRESULT CASCSVGWriter::CommandDrawText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset) + { + if (c_nHyperlinkType == m_lCurrentCommandType) + return S_OK; + + if (m_bIsRaster) + return S_OK; + + PathCommandEnd(); + BeginCommand(c_nPathType); + PathCommandText(bsText, x, y, w, h, baselineOffset); + DrawPath(c_nWindingFillMode); + EndCommand(c_nPathType); + PathCommandEnd(); + return S_OK; + } + HRESULT CASCSVGWriter::CommandDrawTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags) + { + //todo new command + return S_OK; + } + HRESULT CASCSVGWriter::CommandDrawTextEx(const std::wstring& bsUnicodeText, const std::wstring& bsGidText, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags) + { + if (m_bIsRaster) + return S_OK; + + PathCommandEnd(); + BeginCommand(c_nPathType); + PathCommandTextEx(bsUnicodeText, bsGidText, x, y, w, h, baselineOffset, lFlags); + DrawPath(c_nWindingFillMode); + EndCommand(c_nPathType); + PathCommandEnd(); + return S_OK; + } + //-------- Маркеры для команд --------------------------------------------------------------- + HRESULT CASCSVGWriter::BeginCommand(const DWORD& lType) + { + if (m_bIsRaster) + return S_OK; + + if (c_nClipType == lType) + { + m_pVectorWriter->WritePathClip(); + } + else if (c_nPathType == lType) + { + m_pVectorWriter->WritePathStart(); + m_pSimpleGraphicsConverter->PathCommandEnd(); + } + m_lCurrentCommandType = lType; + return S_OK; + } + HRESULT CASCSVGWriter::EndCommand(const DWORD& lType) + { + if (m_bIsRaster) + return S_OK; + + if (c_nClipType == lType) + { + m_pVectorWriter->WritePathClipEnd(); + } + else if (c_nResetClipType == lType) + { + m_pVectorWriter->WritePathResetClip(); + } + m_lCurrentCommandType = -1; + return S_OK; + } + //-------- Функции для работы с Graphics Path ----------------------------------------------- + HRESULT CASCSVGWriter::PathCommandMoveTo(const double& fX, const double& fY) + { + if (m_bIsRaster) + return S_OK; + + if (c_nSimpleGraphicType == m_lCurrentCommandType) + { + MoveTo(fX, fY); + } + else + { + m_pSimpleGraphicsConverter->PathCommandMoveTo(fX, fY); + } + return S_OK; + } + HRESULT CASCSVGWriter::PathCommandLineTo(const double& fX, const double& fY) + { + if (m_bIsRaster) + return S_OK; + + if (c_nSimpleGraphicType == m_lCurrentCommandType) + { + LineTo(fX, fY); + } + else + { + m_pSimpleGraphicsConverter->PathCommandLineTo(fX, fY); + } + + return S_OK; + } + HRESULT CASCSVGWriter::PathCommandLinesTo(double* points, const int& count) + { + if (m_bIsRaster) + return S_OK; + + m_pSimpleGraphicsConverter->PathCommandLinesTo(points, count); + return S_OK; + } + HRESULT CASCSVGWriter::PathCommandCurveTo(const double& fX1, const double& fY1, const double& fX2, const double& fY2, const double& fX3, const double& fY3) + { + if (m_bIsRaster) + return S_OK; + + if (c_nSimpleGraphicType == m_lCurrentCommandType) + { + CurveTo(fX1, fY1, fX2, fY2, fX3, fY3); + } + else + { + m_pSimpleGraphicsConverter->PathCommandCurveTo(fX1, fY1, fX2, fY2, fX3, fY3); + } + + return S_OK; + } + HRESULT CASCSVGWriter::PathCommandCurvesTo(double* points, const int& count) + { + if (m_bIsRaster) + return S_OK; + + m_pSimpleGraphicsConverter->PathCommandCurvesTo(points, count); + return S_OK; + } + HRESULT CASCSVGWriter::PathCommandArcTo(const double& fX, const double& fY, const double& fWidth, const double& fHeight, const double& fStartAngle, const double& fSweepAngle) + { + if (m_bIsRaster) + return S_OK; + + m_pSimpleGraphicsConverter->PathCommandArcTo(fX, fY, fWidth, fHeight, fStartAngle, fSweepAngle); + return S_OK; + } + HRESULT CASCSVGWriter::PathCommandClose() + { + if (m_bIsRaster) + return S_OK; + + if (c_nSimpleGraphicType == m_lCurrentCommandType) + { + Close(); + } + else + { + m_pSimpleGraphicsConverter->PathCommandClose(); + } + + return S_OK; + } + HRESULT CASCSVGWriter::PathCommandEnd() + { + if (m_bIsRaster) + return S_OK; + + if (c_nSimpleGraphicType == m_lCurrentCommandType) + { + End(); + } + else + { + m_pSimpleGraphicsConverter->PathCommandEnd(); + } + + return S_OK; + } + HRESULT CASCSVGWriter::DrawPath(const long& nType) + { + if (m_pBrush->Type == c_BrushTypeTexture) + m_bIsRaster = true; + + if (m_bIsRaster) + return S_OK; + + m_pVectorWriter->WriteDrawPath(nType); + return S_OK; + } + HRESULT CASCSVGWriter::PathCommandStart() + { + if (m_bIsRaster) + return S_OK; + + if (c_nSimpleGraphicType == m_lCurrentCommandType) + { + Start(); + } + else + { + m_pSimpleGraphicsConverter->PathCommandEnd(); + m_pSimpleGraphicsConverter->PathCommandStart(); + } + + return S_OK; + } + HRESULT CASCSVGWriter::PathCommandGetCurrentPoint(double* fX, double* fY) + { + m_pSimpleGraphicsConverter->PathCommandGetCurrentPoint(fX, fY); + return S_OK; + } + HRESULT CASCSVGWriter::PathCommandTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset) + { + //todo new command + return S_OK; + } + HRESULT CASCSVGWriter::PathCommandText(const std::wstring& bsText, const double& fX, const double& fY, const double& fWidth, const double& fHeight, const double& fBaseLineOffset) + { + if (m_bIsRaster) + return S_OK; + + _SetFont(); + m_pSimpleGraphicsConverter->PathCommandText(bsText, m_pFontManager, fX, fY, fWidth, fHeight, fBaseLineOffset); + return S_OK; + } + HRESULT CASCSVGWriter::PathCommandTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags) + { + //todo new command + return S_OK; + } + HRESULT CASCSVGWriter::PathCommandTextEx(const std::wstring& bsUnicodeText, const std::wstring& bsGidText, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags) + { + if (m_bIsRaster) + return S_OK; + + BOOL bGid = m_pFont->StringGID; + if (bsGidText.empty()) + { + m_pFont->StringGID = TRUE; + PathCommandText(bsGidText, x, y, w, h, baselineOffset); + } + + m_pFont->StringGID = FALSE; + PathCommandText(bsUnicodeText, x, y, w, h, baselineOffset); + + m_pFont->StringGID = bGid; + return S_OK; + } + //-------- Функции для вывода изображений --------------------------------------------------- + HRESULT CASCSVGWriter::DrawImage(IGrObject* pImage, const double& fX, const double& fY, const double& fWidth, const double& fHeight) + { + m_bIsRaster = true; + /* + double x = fX; + double y = fY; + + double r = fX + fWidth; + double b = fY + fHeight; + + if (0 == m_dTransformAngle) + { + m_pFullTransform->TransformPoint(x, y); + m_pFullTransform->TransformPoint(r, b); + } + else + { + NSHtmlRenderer::CMatrix oTemp = *m_pFullTransform; + + double dCx = (x + r) / 2; + double dCy = (y + b) / 2; + m_pFullTransform->TransformPoint(dCx, dCy); + oTemp.RotateAt(-m_dTransformAngle, dCx, dCy, Aggplus::MatrixOrderAppend); + + oTemp.TransformPoint(x, y); + oTemp.TransformPoint(r, b); + } + + m_oWriter.WriteImage(pInterface, x, y, r - x, b - y, m_dTransformAngle); + */ + + return S_OK; + } + HRESULT CASCSVGWriter::DrawImageFromFile(const std::wstring& sVal, const double& x, const double& y, const double& w, const double& h, const BYTE& lAlpha = 255) + { + m_bIsRaster = true; + /* + double x = fX; + double y = fY; + + double r = fX + fWidth; + double b = fY + fHeight; + + if (0 == m_dTransformAngle) + { + m_pFullTransform->TransformPoint(x, y); + m_pFullTransform->TransformPoint(r, b); + } + else + { + NSHtmlRenderer::CMatrix oTemp = *m_pFullTransform; + + double dCx = (x + r) / 2; + double dCy = (y + b) / 2; + m_pFullTransform->TransformPoint(dCx, dCy); + oTemp.RotateAt(-m_dTransformAngle, dCx, dCy, Aggplus::MatrixOrderAppend); + + oTemp.TransformPoint(x, y); + oTemp.TransformPoint(r, b); + } + + m_oWriter.WriteImage((CString)bstrVal, x, y, r - x, b - y, m_pTransform->z_Rotation()); + */ + + return S_OK; + } + // transform -------------------------------------------------------------------------------- + HRESULT CASCSVGWriter::SetTransform(const double& dA, const double& dB, const double& dC, const double& dD, const double& dE, const double& dF) + { + Aggplus::CMatrix oTrans(dA, dB, dC, dD, dE, dF); + *m_pTransform = oTrans; + + CalculateFullTransform(); + + return S_OK; + } + HRESULT CASCSVGWriter::GetTransform(double *pdA, double *pdB, double *pdC, double *pdD, double *pdE, double *pdF) + { + return S_OK; + } + HRESULT CASCSVGWriter::ResetTransform(void) + { + m_pTransform->Reset(); + CalculateFullTransform(); + return S_OK; + } + // ----------------------------------------------------------------------------------------- + HRESULT CASCSVGWriter::get_ClipMode(LONG* plMode) + { + *plMode = m_lClipMode; + return S_OK; + } + HRESULT CASCSVGWriter::put_ClipMode(const LONG& lMode) + { + m_lClipMode = lMode; + m_pVectorWriter->SetClipMode(m_lClipMode); + return S_OK; + } + // additiaonal params ---------------------------------------------------------------------- + HRESULT CASCSVGWriter::SaveFile(const std::wstring& strFileSave) + { + NSFile::CFileBinary oFile; + if(oFile.CreateFileW(strFileSave)) + { + LONG lW = (LONG)m_dWidth; + LONG lH = (LONG)m_dHeight; + CString strStart = _T(""); + strStart.Format(NSHtmlRenderer::g_svg_string_svgOpen, (LONG)(m_dWidth / 100), (LONG)(m_dHeight / 100), lW, lH); + + oFile.WriteStringUTF8(std::wstring(strStart.GetString())); + + CString s = m_pVectorWriter->m_oSVG.m_oDocument.GetCString(); + oFile.WriteStringUTF8(std::wstring(s.GetString())); + + CString strEnd = _T(""); + oFile.WriteStringUTF8(std::wstring(strEnd.GetString())); + } + oFile.CloseFile(); + return S_OK; + } + HRESULT CASCSVGWriter::ReInit() + { + m_dDpiX = 96.0; + m_dDpiY = 96.0; + + m_dWidth = 100; + m_dHeight = 100; + m_bIsRaster = false; + + m_lClipMode = c_nClipRegionTypeWinding; + + RELEASEOBJECT(m_pSimpleGraphicsConverter); + m_pSimpleGraphicsConverter = new Aggplus::CGraphicsPathSimpleConverter(); + m_pSimpleGraphicsConverter->SetRenderer(this); + + m_dTransformAngle = 0.0; + + + m_pVectorWriter->m_pSimpleConverter = m_pSimpleGraphicsConverter; + m_pVectorWriter->m_pFullTransform = m_pFullTransform; + m_pVectorWriter->SetSettings(m_pPen, m_pBrush, m_pSimpleGraphicsConverter); + + m_pPen->SetDefaultParams(); + m_pBrush->SetDefaultParams(); + m_pFont->SetDefaultParams(); + + m_pBaseTransform->Reset(); + m_pTransform->Reset(); + m_pFullTransform->Reset(); + + m_pVectorWriter->m_oSVG.ReInit(); + return S_OK; + } + HRESULT CASCSVGWriter::IsRaster(bool* bVal) + { + *bVal = m_bIsRaster ? VARIANT_TRUE : VARIANT_FALSE; + return S_OK; + } + // additiaonal params ---------------------------------------------------------------------- + HRESULT CASCSVGWriter::CommandLong(const LONG& lType, const LONG& lCommand) + { + //todo new command + return S_OK; + } + HRESULT CASCSVGWriter::CommandDouble(const LONG& lType, const double& dCommand) + { + //todo new command + return S_OK; + } + HRESULT CASCSVGWriter::CommandString(const LONG& lType, const std::wstring& sCommand) + { + //todo new command + return S_OK; + } + // -------------------------------------------------------------------------------------------- + void CASCSVGWriter::OnBaseMatrixUpdate(const double& dWidth, const double& dHeight) + { + m_pBaseTransform->Reset(); + + double dScaleX = m_dDpiX / NSHtmlRenderer::c_ag_Inch_to_MM; + double dScaleY = m_dDpiY / NSHtmlRenderer::c_ag_Inch_to_MM; + + m_pBaseTransform->Scale(dScaleX, dScaleY, Aggplus::MatrixOrderAppend); + + CalculateFullTransform(); + + double dWidthPix = dScaleX * dWidth; + double dHeightPix = dScaleY * dHeight; + } + void CASCSVGWriter::SetFontManager(CFontManager* pFontManager) + { + if(NULL != pFontManager) + { + m_pFontManager = pFontManager; + m_bDeleteFontManager = false; + } + } + void CASCSVGWriter::CalculateFullTransform() + { + *m_pFullTransform = *m_pBaseTransform; + m_pFullTransform->Multiply(m_pTransform, Aggplus::MatrixOrderPrepend); + + m_dTransformAngle = m_pTransform->z_Rotation(); + } + + inline void CASCSVGWriter::MoveTo(const double& dX, const double& dY) + { + double x = dX; + double y = dY; + m_pFullTransform->TransformPoint(x, y); + + m_pVectorWriter->WritePathMoveTo(x, y); + } + inline void CASCSVGWriter::LineTo(const double& dX, const double& dY) + { + double x = dX; + double y = dY; + m_pFullTransform->TransformPoint(x, y); + + m_pVectorWriter->WritePathLineTo(x, y); + } + inline void CASCSVGWriter::CurveTo(const double& x1, const double& y1, const double& x2, const double& y2, const double& x3, const double& y3) + { + double _x1 = x1; + double _y1 = y1; + m_pFullTransform->TransformPoint(_x1, _y1); + + double _x2 = x2; + double _y2 = y2; + m_pFullTransform->TransformPoint(_x2, _y2); + + double _x3 = x3; + double _y3 = y3; + m_pFullTransform->TransformPoint(_x3, _y3); + + m_pVectorWriter->WritePathCurveTo(_x1, _y1, _x2, _y2, _x3, _y3); + } + void CASCSVGWriter::Start() + { + m_pVectorWriter->WritePathStart(); + } + void CASCSVGWriter::End() + { + m_pVectorWriter->WriteEndPath(); + } + void CASCSVGWriter::Close() + { + m_pVectorWriter->WritePathClose(); + } + + void CASCSVGWriter::_SetFont() + { + double dPix = m_pFont->CharSpace * m_dDpiX / 25.4; + + if (m_pInstalledFont->IsEqual(m_pFont)) + { + if (1 < m_dWidth) + { + m_pFontManager->SetCharSpacing(dPix); + } + return; + } + + m_pFontManager->SetStringGID(m_pFont->StringGID); + if (1 < m_dWidth) + { + m_pFontManager->SetCharSpacing(dPix); + } + + if (_T("") == m_pFont->Path) + { + m_pFontManager->LoadFontByName(m_pFont->Name, (float)m_pFont->Size, m_pFont->GetStyle(), m_dDpiX, m_dDpiY); + } + else + { + m_pFontManager->LoadFontFromFile(m_pFont->Path, (float)m_pFont->Size, m_dDpiX, m_dDpiY, 0); + } + + *m_pInstalledFont = *m_pFont; + } +} \ No newline at end of file diff --git a/ASCHTMLRenderer/ASCSVGWriter.h b/ASCHTMLRenderer/ASCSVGWriter.h index dca386cbd4..465dabacfc 100644 --- a/ASCHTMLRenderer/ASCSVGWriter.h +++ b/ASCHTMLRenderer/ASCSVGWriter.h @@ -1,313 +1,203 @@ #pragma once -#include "stdafx.h" -#include "resource.h" // main symbols -#include +#include "../DesktopEditor/graphics/IRenderer.h" +#include "IBaseMatrixUpdater.h" -#include "..\Common\ASCUtils.h" -#include "..\ASCImageStudio3\ASCGraphics\Interfaces\ASCRenderer.h" -#include "..\Common\MediaFormatDefine.h" -#include "..\Common\TemporaryCS.h" - -#include "Writer\Writer.h" -#include "Graphics\Matrix.h" - -#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA) -#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms." -#endif - -// CASCSVGWriter -[ coclass, default(IASCRenderer), threading(apartment), vi_progid("AVSHTMLRend.SvgWr"), progid("AVSHTMLRend.SvgWr.1"), version(1.0), uuid("EE5F599A-B5FE-48ec-A041-32528EAD4727") ] -class ATL_NO_VTABLE CASCSVGWriter : - public IASCRenderer, - public NSHtmlRenderer::IBaseMatrixUpdater +namespace Aggplus { -public: - DECLARE_PROTECT_FINAL_CONSTRUCT() - - CASCSVGWriter(); - ~CASCSVGWriter() + class CMatrix; + class CGraphicsPathSimpleConverter; +} +class CFontManager; +namespace NSHtmlRenderer +{ + class CSVGGraphicsWriter; +} +namespace NSStructures +{ + class CPen; + class CBrush; + class CFont; +} +namespace NSHtmlRenderer +{ + class CASCSVGWriter : public IRenderer, public NSHtmlRenderer::IBaseMatrixUpdater { - } + public: + CASCSVGWriter(); + ~CASCSVGWriter(); -public: - // ------------------------------------ renderer -------------------------------------------- - STDMETHOD(get_Type)(LONG* lType); - //-------- Функции для работы со страницей -------------------------------------------------- - STDMETHOD(NewPage)(); - STDMETHOD(get_Height)(double* dHeight); - STDMETHOD(put_Height)(double dHeight); - STDMETHOD(get_Width)(double* dWidth); - STDMETHOD(put_Width)(double dWidth); + public: + // тип рендерера----------------------------------------------------------------------------- + HRESULT get_Type(LONG* lType); + //-------- Функции для работы со страницей -------------------------------------------------- + HRESULT NewPage(); + HRESULT get_Height(double* dHeight); + HRESULT put_Height(const double& dHeight); + HRESULT get_Width(double* dWidth); + HRESULT put_Width(const double& dWidth); + HRESULT get_DpiX(double* dDpiX); + HRESULT get_DpiY(double* dDpiY); - STDMETHOD(get_DpiX)(double* dDpiX); - STDMETHOD(get_DpiY)(double* dDpiY); -// pen -------------------------------------------------------------------------------------- - STDMETHOD(SetPen)(BSTR bsXML); - STDMETHOD(get_PenColor)(LONG* lColor); - STDMETHOD(put_PenColor)(LONG lColor); - STDMETHOD(get_PenAlpha)(LONG* lAlpha); - STDMETHOD(put_PenAlpha)(LONG lAlpha); - STDMETHOD(get_PenSize)(double* dSize); - STDMETHOD(put_PenSize)(double dSize); - STDMETHOD(get_PenDashStyle)(BYTE* val); - STDMETHOD(put_PenDashStyle)(BYTE val); - STDMETHOD(get_PenLineStartCap)(BYTE* val); - STDMETHOD(put_PenLineStartCap)(BYTE val); - STDMETHOD(get_PenLineEndCap)(BYTE* val); - STDMETHOD(put_PenLineEndCap)(BYTE val); - STDMETHOD(get_PenLineJoin)(BYTE* val); - STDMETHOD(put_PenLineJoin)(BYTE val); - STDMETHOD(get_PenDashOffset)(double* val); - STDMETHOD(put_PenDashOffset)(double val); - STDMETHOD(get_PenAlign)(LONG* val); - STDMETHOD(put_PenAlign)(LONG val); - STDMETHOD(get_PenMiterLimit)(double* val); - STDMETHOD(put_PenMiterLimit)(double val); - STDMETHOD(PenDashPattern)(SAFEARRAY* pPattern); -// brush ------------------------------------------------------------------------------------ - STDMETHOD(SetBrush)(BSTR bsXML); - STDMETHOD(get_BrushType)(LONG* lType); - STDMETHOD(put_BrushType)(LONG lType); - STDMETHOD(get_BrushColor1)(LONG* lColor); - STDMETHOD(put_BrushColor1)(LONG lColor); - STDMETHOD(get_BrushAlpha1)(LONG* lAlpha); - STDMETHOD(put_BrushAlpha1)(LONG lAlpha); - STDMETHOD(get_BrushColor2)(LONG* lColor); - STDMETHOD(put_BrushColor2)(LONG lColor); - STDMETHOD(get_BrushAlpha2)(LONG* lAlpha); - STDMETHOD(put_BrushAlpha2)(LONG lAlpha); - STDMETHOD(get_BrushTexturePath)(BSTR* bsPath); - STDMETHOD(put_BrushTexturePath)(BSTR bsPath); - STDMETHOD(get_BrushTextureMode)(LONG* lMode); - STDMETHOD(put_BrushTextureMode)(LONG lMode); - STDMETHOD(get_BrushTextureAlpha)(LONG* lTxAlpha); - STDMETHOD(put_BrushTextureAlpha)(LONG lTxAlpha); - STDMETHOD(get_BrushLinearAngle)(double* dAngle); - STDMETHOD(put_BrushLinearAngle)(double dAngle); - STDMETHOD(BrushRect)(BOOL val, double left, double top, double width, double height); -// font ------------------------------------------------------------------------------------- - STDMETHOD(SetFont)(BSTR bsXML); - STDMETHOD(get_FontName)(BSTR* bsName); - STDMETHOD(put_FontName)(BSTR bsName); - STDMETHOD(get_FontPath)(BSTR* bsName); - STDMETHOD(put_FontPath)(BSTR bsName); - STDMETHOD(get_FontSize)(double* dSize); - STDMETHOD(put_FontSize)(double dSize); - STDMETHOD(get_FontStyle)(LONG* lStyle); - STDMETHOD(put_FontStyle)(LONG lStyle); - STDMETHOD(get_FontStringGID)(BOOL* bGID); - STDMETHOD(put_FontStringGID)(BOOL bGID); - STDMETHOD(get_FontCharSpace)(double* dSpace); - STDMETHOD(put_FontCharSpace)(double dSpace); -// shadow ----------------------------------------------------------------------------------- - STDMETHOD(SetShadow)(BSTR bsXML); - STDMETHOD(get_ShadowDistanceX)(double* val); - STDMETHOD(put_ShadowDistanceX)(double val); - STDMETHOD(get_ShadowDistanceY)(double* val); - STDMETHOD(put_ShadowDistanceY)(double val); - STDMETHOD(get_ShadowBlurSize)(double* val); - STDMETHOD(put_ShadowBlurSize)(double val); - STDMETHOD(get_ShadowColor)(LONG* val); - STDMETHOD(put_ShadowColor)(LONG val); - STDMETHOD(get_ShadowAlpha)(LONG* val); - STDMETHOD(put_ShadowAlpha)(LONG val); - STDMETHOD(get_ShadowVisible)(BOOL* val); - STDMETHOD(put_ShadowVisible)(BOOL val); -// edge ------------------------------------------------------------------------------------- - STDMETHOD(SetEdgeText)(BSTR bsXML); - STDMETHOD(get_EdgeVisible)(LONG* val); - STDMETHOD(put_EdgeVisible)(LONG val); - STDMETHOD(get_EdgeColor)(LONG* val); - STDMETHOD(put_EdgeColor)(LONG val); - STDMETHOD(get_EdgeAlpha)(LONG* val); - STDMETHOD(put_EdgeAlpha)(LONG val); - STDMETHOD(get_EdgeDist)(double* val); - STDMETHOD(put_EdgeDist)(double val); -//-------- Функции для вывода текста -------------------------------------------------------- - STDMETHOD(CommandDrawText)(BSTR bsText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset); - STDMETHOD(CommandDrawTextEx)(BSTR bsText, BSTR bsGidText, BSTR bsSourceCodeText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset, DWORD lFlags); -//-------- Маркеры для команд --------------------------------------------------------------- - STDMETHOD(BeginCommand)(DWORD lType); - STDMETHOD(EndCommand)(DWORD lType); -//-------- Функции для работы с Graphics Path ----------------------------------------------- - STDMETHOD(PathCommandMoveTo)(double fX, double fY); - STDMETHOD(PathCommandLineTo)(double fX, double fY); - STDMETHOD(PathCommandLinesTo)(SAFEARRAY* pPoints); - STDMETHOD(PathCommandCurveTo)(double fX1, double fY1, double fX2, double fY2, double fX3, double fY3); - STDMETHOD(PathCommandCurvesTo)(SAFEARRAY* pPoints); - STDMETHOD(PathCommandArcTo)(double fX, double fY, double fWidth, double fHeight, double fStartAngle, double fSweepAngle); - STDMETHOD(PathCommandClose)(); - STDMETHOD(PathCommandEnd)(); - STDMETHOD(DrawPath)(long nType); - STDMETHOD(PathCommandStart)(); - STDMETHOD(PathCommandGetCurrentPoint)(double* fX, double* fY); - STDMETHOD(PathCommandText)(BSTR bsText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset); - STDMETHOD(PathCommandTextEx)(BSTR bsText, BSTR bsGidText, BSTR bsSourceCodeText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset, DWORD lFlags); -//-------- Функции для вывода изображений --------------------------------------------------- - STDMETHOD(DrawImage)(IUnknown* pInterface, double fX, double fY, double fWidth, double fHeight); - STDMETHOD(DrawImageFromFile)(BSTR bstrVal, double fX, double fY, double fWidth, double fHeight); -// transform -------------------------------------------------------------------------------- - STDMETHOD(GetCommandParams)(double* dAngle, double* dLeft, double* dTop, double* dWidth, double* dHeight, DWORD* lFlags); - STDMETHOD(SetCommandParams)(double dAngle, double dLeft, double dTop, double dWidth, double dHeight, DWORD lFlags); - STDMETHOD(SetTransform)(double dA, double dB, double dC, double dD, double dE, double dF); - STDMETHOD(GetTransform)(double *pdA, double *pdB, double *pdC, double *pdD, double *pdE, double *pdF); - STDMETHOD(ResetTransform)(void); -// ----------------------------------------------------------------------------------------- - STDMETHOD(get_ClipMode)(LONG* plMode); - STDMETHOD(put_ClipMode)(LONG lMode); -// additiaonal params ---------------------------------------------------------------------- - STDMETHOD(SetAdditionalParam)(BSTR ParamName, VARIANT ParamValue); - STDMETHOD(GetAdditionalParam)(BSTR ParamName, VARIANT* ParamValue); -// -------------------------------------------------------------------------------------------- + // pen -------------------------------------------------------------------------------------- + HRESULT get_PenColor(LONG* lColor); + HRESULT put_PenColor(const LONG& lColor); + HRESULT get_PenAlpha(LONG* lAlpha); + HRESULT put_PenAlpha(const LONG& lAlpha); + HRESULT get_PenSize(double* dSize); + HRESULT put_PenSize(const double& dSize); + HRESULT get_PenDashStyle(BYTE* val); + HRESULT put_PenDashStyle(const BYTE& val); + HRESULT get_PenLineStartCap(BYTE* val); + HRESULT put_PenLineStartCap(const BYTE& val); + HRESULT get_PenLineEndCap(BYTE* val); + HRESULT put_PenLineEndCap(const BYTE& val); + HRESULT get_PenLineJoin(BYTE* val); + HRESULT put_PenLineJoin(const BYTE& val); + HRESULT get_PenDashOffset(double* dOffset); + HRESULT put_PenDashOffset(const double& dOffset); + HRESULT get_PenAlign(LONG* lAlign); + HRESULT put_PenAlign(const LONG& lAlign); + HRESULT get_PenMiterLimit(double* dOffset); + HRESULT put_PenMiterLimit(const double& dOffset); + HRESULT PenDashPattern(double* pPattern, LONG lCount); -public: - HRESULT FinalConstruct(); - void FinalRelease(); + // brush ------------------------------------------------------------------------------------ + HRESULT get_BrushType(LONG* lType); + HRESULT put_BrushType(const LONG& lType); + HRESULT get_BrushColor1(LONG* lColor); + HRESULT put_BrushColor1(const LONG& lColor); + HRESULT get_BrushAlpha1(LONG* lAlpha); + HRESULT put_BrushAlpha1(const LONG& lAlpha); + HRESULT get_BrushColor2(LONG* lColor); + HRESULT put_BrushColor2(const LONG& lColor); + HRESULT get_BrushAlpha2(LONG* lAlpha); + HRESULT put_BrushAlpha2(const LONG& lAlpha); + HRESULT get_BrushTexturePath(std::wstring* bsPath); + HRESULT put_BrushTexturePath(const std::wstring& bsPath); + HRESULT get_BrushTextureMode(LONG* lMode); + HRESULT put_BrushTextureMode(const LONG& lMode); + HRESULT get_BrushTextureAlpha(LONG* lTxAlpha); + HRESULT put_BrushTextureAlpha(const LONG& lTxAlpha); + HRESULT get_BrushLinearAngle(double* dAngle); + HRESULT put_BrushLinearAngle(const double& dAngle); + HRESULT BrushRect(const INT& val, const double& left, const double& top, const double& width, const double& height); + HRESULT BrushBounds(const double& left, const double& top, const double& width, const double& height); -public: + HRESULT put_BrushGradientColors(LONG* lColors, double* pPositions, LONG nCount); - virtual void OnBaseMatrixUpdate(const double& dWidth, const double& dHeight) - { - m_oBaseTransform.Reset(); + // font ------------------------------------------------------------------------------------- + HRESULT get_FontName(std::wstring* bsName); + HRESULT put_FontName(const std::wstring& bsName); + HRESULT get_FontPath(std::wstring* bsName); + HRESULT put_FontPath(const std::wstring& bsName); + HRESULT get_FontSize(double* dSize); + HRESULT put_FontSize(const double& dSize); + HRESULT get_FontStyle(LONG* lStyle) ; + HRESULT put_FontStyle(const LONG& lStyle); + HRESULT get_FontStringGID(INT* bGID); + HRESULT put_FontStringGID(const INT& bGID); + HRESULT get_FontCharSpace(double* dSpace); + HRESULT put_FontCharSpace(const double& dSpace); + HRESULT get_FontFaceIndex(int* lFaceIndex); + HRESULT put_FontFaceIndex(const int& lFaceIndex); - double dScaleX = m_dDpiX / NSHtmlRenderer::c_ag_Inch_to_MM; - double dScaleY = m_dDpiY / NSHtmlRenderer::c_ag_Inch_to_MM; + //-------- Функции для вывода текста -------------------------------------------------------- + HRESULT CommandDrawTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset); + HRESULT CommandDrawText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset); - m_oBaseTransform.Scale(dScaleX, dScaleY, Aggplus::MatrixOrderAppend); + HRESULT CommandDrawTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags); + HRESULT CommandDrawTextEx(const std::wstring& bsUnicodeText, const std::wstring& bsGidText, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags); - CalculateFullTransform(); + //-------- Маркеры для команд --------------------------------------------------------------- + HRESULT BeginCommand(const DWORD& lType); + HRESULT EndCommand(const DWORD& lType); - double dWidthPix = dScaleX * dWidth; - double dHeightPix = dScaleY * dHeight; - } + //-------- Функции для работы с Graphics Path ----------------------------------------------- + HRESULT PathCommandMoveTo(const double& x, const double& y); + HRESULT PathCommandLineTo(const double& x, const double& y); + HRESULT PathCommandLinesTo(double* points, const int& count); + HRESULT PathCommandCurveTo(const double& x1, const double& y1, const double& x2, const double& y2, const double& x3, const double& y3); + HRESULT PathCommandCurvesTo(double* points, const int& count); + HRESULT PathCommandArcTo(const double& x, const double& y, const double& w, const double& h, const double& startAngle, const double& sweepAngle); + HRESULT PathCommandClose(); + HRESULT PathCommandEnd(); + HRESULT DrawPath(const LONG& nType); + HRESULT PathCommandStart(); + HRESULT PathCommandGetCurrentPoint(double* x, double* y); -private: - - NSHtmlRenderer::CSVGGraphicsWriter m_oVectorWriter; + HRESULT PathCommandTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset); + HRESULT PathCommandText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset); - Graphics::IASCGraphicSimpleComverter* m_pSimpleGraphicsConverter; // конвертер сложных гафических путей в простые - Graphics::IASCFontManager* m_pFontManager; // менеджер шрифтов + HRESULT PathCommandTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags); + HRESULT PathCommandTextEx(const std::wstring& bsUnicodeText, const std::wstring& bsGidText, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags); - NSHtmlRenderer::CMatrix m_oBaseTransform; // матрица перерасчета координатных осей (здесь: миллиметры -> пикселы) - NSHtmlRenderer::CMatrix m_oTransform; // текущая матрица преобразований рендерера - NSHtmlRenderer::CMatrix m_oFullTransform; // полная матрица преобразований (m_oBaseTransform * m_oTransform) + //-------- Функции для вывода изображений --------------------------------------------------- + HRESULT DrawImage(IGrObject* pImage, const double& x, const double& y, const double& w, const double& h); + HRESULT DrawImageFromFile(const std::wstring&, const double& x, const double& y, const double& w, const double& h, const BYTE& lAlpha); - double m_dTransformAngle; + // transform -------------------------------------------------------------------------------- + HRESULT SetTransform(const double& m1, const double& m2, const double& m3, const double& m4, const double& m5, const double& m6); + HRESULT GetTransform(double *pdA, double *pdB, double *pdC, double *pdD, double *pdE, double *pdF); + HRESULT ResetTransform(); - LONG m_lCurrentCommandType; // текущая команда + // ----------------------------------------------------------------------------------------- + HRESULT get_ClipMode(LONG* plMode); + HRESULT put_ClipMode(const LONG& lMode); + // additiaonal params ---------------------------------------------------------------------- + HRESULT SaveFile(const std::wstring& strFileSave); + HRESULT ReInit(); + HRESULT IsRaster(bool* bVal); + // additiaonal params ---------------------------------------------------------------------- + HRESULT CommandLong(const LONG& lType, const LONG& lCommand); + HRESULT CommandDouble(const LONG& lType, const double& dCommand); + HRESULT CommandString(const LONG& lType, const std::wstring& sCommand); + public: - double m_dDpiX; - double m_dDpiY; + void OnBaseMatrixUpdate(const double& dWidth, const double& dHeight); + void SetFontManager(CFontManager* pFontManager); - double m_dWidth; - double m_dHeight; + private: - LONG m_lClipMode; + NSHtmlRenderer::CSVGGraphicsWriter* m_pVectorWriter; - NSStructures::CPen m_oPen; // настройки всей графики (скопирован ашник из AVSGraphics) - NSStructures::CBrush m_oBrush; - NSStructures::CFont m_oFont; - NSStructures::CShadow m_oShadow; - NSStructures::CEdgeText m_oEdge; + Aggplus::CGraphicsPathSimpleConverter* m_pSimpleGraphicsConverter; // конвертер сложных гафических путей в простые + CFontManager* m_pFontManager; // менеджер шрифтов + bool m_bDeleteFontManager; - NSStructures::CFont m_oInstalledFont; + Aggplus::CMatrix* m_pBaseTransform; // матрица перерасчета координатных осей (здесь: миллиметры -> пикселы) + Aggplus::CMatrix* m_pTransform; // текущая матрица преобразований рендерера + Aggplus::CMatrix* m_pFullTransform; // полная матрица преобразований (m_oBaseTransform * m_oTransform) - Graphics::IASCWinFonts* m_pFonts; + double m_dTransformAngle; - bool m_bIsRaster; + LONG m_lCurrentCommandType; // текущая команда -protected: - void CalculateFullTransform() - { - m_oFullTransform = m_oBaseTransform; - m_oFullTransform.Multiply(&m_oTransform, Aggplus::MatrixOrderPrepend); + double m_dDpiX; + double m_dDpiY; - m_dTransformAngle = m_oTransform.z_Rotation(); - } + double m_dWidth; + double m_dHeight; - inline void MoveTo(const double& dX, const double& dY) - { - double x = dX; - double y = dY; - m_oFullTransform.TransformPoint(x, y); + LONG m_lClipMode; - m_oVectorWriter.WritePathMoveTo(x, y); - } - inline void LineTo(const double& dX, const double& dY) - { - double x = dX; - double y = dY; - m_oFullTransform.TransformPoint(x, y); + NSStructures::CPen* m_pPen; // настройки всей графики (скопирован ашник из AVSGraphics) + NSStructures::CBrush* m_pBrush; + NSStructures::CFont* m_pFont; - m_oVectorWriter.WritePathLineTo(x, y); - } - inline void CurveTo(const double& x1, const double& y1, const double& x2, const double& y2, const double& x3, const double& y3) - { - double _x1 = x1; - double _y1 = y1; - m_oFullTransform.TransformPoint(_x1, _y1); + NSStructures::CFont* m_pInstalledFont; - double _x2 = x2; - double _y2 = y2; - m_oFullTransform.TransformPoint(_x2, _y2); + bool m_bIsRaster; + //todo + //IASCWinFonts* m_pFonts; - double _x3 = x3; - double _y3 = y3; - m_oFullTransform.TransformPoint(_x3, _y3); - - m_oVectorWriter.WritePathCurveTo(_x1, _y1, _x2, _y2, _x3, _y3); - } - void Start() - { - m_oVectorWriter.WritePathStart(); - } - void End() - { - m_oVectorWriter.WriteEndPath(); - } - void Close() - { - m_oVectorWriter.WritePathClose(); - } - - void _SetFont() - { - if (NULL == m_pFontManager) - { - CoCreateInstance(__uuidof(Graphics::CASCFontManager), NULL, CLSCTX_ALL, __uuidof(Graphics::IASCFontManager), (void**)&m_pFontManager); - m_pFontManager->Initialize(L""); - } - - double dPix = m_oFont.CharSpace * m_dDpiX / 25.4; - - if (m_oInstalledFont.IsEqual(&m_oFont)) - { - if (1 < m_dWidth) - { - m_pFontManager->SetCharSpacing(dPix); - } - return; - } - - m_pFontManager->SetStringGID(m_oFont.StringGID); - if (1 < m_dWidth) - { - m_pFontManager->SetCharSpacing(dPix); - } - - if (_T("") == m_oFont.Path) - { - BSTR bsName = m_oFont.Name.AllocSysString(); - m_pFontManager->LoadFontByName(bsName, (float)m_oFont.Size, m_oFont.GetStyle(), m_dDpiX, m_dDpiY); - SysFreeString(bsName); - } - else - { - BSTR bsName = m_oFont.Path.AllocSysString(); - m_pFontManager->LoadFontFromFile(bsName, (float)m_oFont.Size, m_dDpiX, m_dDpiY, 0); - SysFreeString(bsName); - } - - m_oInstalledFont = m_oFont; - } -}; \ No newline at end of file + protected: + void CalculateFullTransform(); + inline void MoveTo(const double& dX, const double& dY); + inline void LineTo(const double& dX, const double& dY); + inline void CurveTo(const double& x1, const double& y1, const double& x2, const double& y2, const double& x3, const double& y3); + void Start(); + void End(); + void Close(); + void _SetFont(); + }; +} \ No newline at end of file diff --git a/ASCHTMLRenderer/CASCImage.cpp b/ASCHTMLRenderer/CASCImage.cpp new file mode 100644 index 0000000000..91323e16ce --- /dev/null +++ b/ASCHTMLRenderer/CASCImage.cpp @@ -0,0 +1,441 @@ +#include "CASCImage.h" + +#include "../ASCImageStudio3/ASCGraphics/Objects/Image/Wmf/WmfFile.h" +#include "../ASCImageStudio3/ASCGraphics/Objects/Image/Wmf/RendererOutput.h" +#include "../DesktopEditor/graphics/Image.h" + +#ifdef _WIN32 +#include "../Common/GdiPlusEx.h" +#import "../Redist/ASCMediaCore3.dll" named_guids raw_interfaces_only rename_namespace("MediaCore"), exclude("tagRECT") +#include "../Common/MediaFormatDefine.h" +namespace NSGdiMeta +{ + static BOOL ByteArrayToMediaData(BYTE* pArray, int nWidth, int nHeight, Aggplus::CImage** ppImage, BOOL bFlipVertical = TRUE) + { + if (!ppImage || nWidth < 1 || nHeight < 1) + return FALSE; + + *ppImage = new Aggplus::CImage; + Aggplus::CImage* pImage = *ppImage; + + // specify settings + long nBufferSize = 4 * nWidth * nHeight; + long nStride; + if(TRUE == bFlipVertical) + nStride = -4 * nWidth; + else + nStride = 4 * nWidth; + BYTE* pBuffer = new BYTE[nBufferSize]; + memcpy(pBuffer, pArray, nBufferSize); + pImage->Create(pBuffer, nWidth, nHeight, nStride); + + return TRUE; + } + + static BOOL GdiPlusBitmapToMediaData(Gdiplus::Bitmap* pBitmap, Aggplus::CImage** ppImage, BOOL bFlipVertical = TRUE) + { + if (!pBitmap) + return FALSE; + + int nWidth = pBitmap->GetWidth(); + int nHeight = pBitmap->GetHeight(); + + double dHorDpi = (double)pBitmap->GetHorizontalResolution(); + double dVerDpi = (double)pBitmap->GetVerticalResolution(); + + int nWidthDest = (int)(96.0 * nWidth / dHorDpi); + int nHeightDest = (int)(96.0 * nHeight / dVerDpi); + + if (nWidth == nWidthDest && nHeight == nHeightDest) + { + Gdiplus::Rect oRect(0, 0, nWidth, nHeight); + Gdiplus::BitmapData oBitmapData; + + if (pBitmap->LockBits(&oRect, Gdiplus::ImageLockModeRead, PixelFormat32bppARGB, &oBitmapData) != Gdiplus::Ok) + return FALSE; + + BOOL bSuccess = ByteArrayToMediaData((BYTE*)oBitmapData.Scan0, nWidth, nHeight, ppImage, bFlipVertical); + + pBitmap->UnlockBits(&oBitmapData); + + return bSuccess; + } + + BYTE* pData = new BYTE[4 * nWidthDest * nHeightDest]; + Gdiplus::Bitmap oBitmap(nWidthDest, nHeightDest, 4 * nWidthDest, PixelFormat32bppARGB, pData); + + Gdiplus::Graphics* pGraphics = Gdiplus::Graphics::FromImage(&oBitmap); + + pGraphics->SetInterpolationMode(Gdiplus::InterpolationModeBilinear); + pGraphics->DrawImage(pBitmap, 0, 0, nWidthDest, nHeightDest); + + RELEASEOBJECT(pGraphics); + + BOOL bSuccess = ByteArrayToMediaData(pData, nWidthDest, nHeightDest, ppImage, bFlipVertical); + RELEASEARRAYOBJECTS(pData); + + return bSuccess; + } +} + +#endif + +namespace NSHtmlRenderer +{ + CASCImage::CASCImage() + { + m_pWmfFile = new CWmfFile(); + m_pRect = new TWmfRectF(); + m_pMediaData = NULL; + + m_bLoadOnlyMeta = FALSE; + + m_lImageType = c_lImageTypeUnknown; + + m_dDpiX = 72; + m_dDpiY = 72; + + m_wsTempFilePath.Empty(); + } + CASCImage::~CASCImage() + { + Close(); + RELEASEOBJECT(m_pWmfFile); + RELEASEOBJECT(m_pRect); + } + void CASCImage::Open(const std::wstring& bsFilePath) + { + // Закроем раннее открытый файл (если он был открыт) + Close(); + + // Сначала попытаемя открыть файл как WMF + m_pWmfFile->OpenFromFile( bsFilePath.c_str() ); + m_pWmfFile->Scan( m_pRect ); + + // Файл открылся нормально + if ( !m_pWmfFile->CheckError() ) + { + m_lImageType = c_lImageTypeMetafile | c_lMetaWmf; + return; + } + + // Это не Wmf, попробуем открыть его как Emf + m_pWmfFile->Close(); +#ifdef _WIN32 + CGdiPlusInit oCGdiPlusInit; + oCGdiPlusInit.Init(); + Gdiplus::Metafile *pMetaFile = new Gdiplus::Metafile( bsFilePath.c_str() ); + if ( NULL != pMetaFile ) + { + // Похоже это метафайл, конвертируем его в Wmf с помощью Gdi + HENHMETAFILE hEmf = pMetaFile->GetHENHMETAFILE(); + if ( NULL != hEmf ) + { + UINT unSize = Gdiplus::Metafile::EmfToWmfBits( hEmf, 0, NULL, MM_ANISOTROPIC, Gdiplus::EmfToWmfBitsFlagsIncludePlaceable); + + if (0 != unSize) + { + BYTE *pBuffer = new BYTE[unSize]; + INT nConvertedSize = Gdiplus::Metafile::EmfToWmfBits( hEmf, unSize, pBuffer, MM_ANISOTROPIC, Gdiplus::EmfToWmfBitsFlagsEmbedEmf ); + + HMETAFILE hWmf = SetMetaFileBitsEx( unSize, pBuffer ); + + FILE *pFile = NULL; + WmfOpenTempFile( &m_wsTempFilePath, &pFile, _T("wb+"), _T(".wmf"), NULL ); + if ( !pFile ) + { + DeleteMetaFile( hWmf ); + DeleteEnhMetaFile( hEmf ); + delete[] pBuffer; + delete pMetaFile; + + m_lImageType = c_lImageTypeUnknown; + } + else + { + ::fclose( pFile ); + + // Сохраняем Wmf + HMETAFILE hTempWmf = CopyMetaFile( hWmf, m_wsTempFilePath.GetBuffer() ); + DeleteMetaFile( hTempWmf ); + + // Открываем Wmf + m_pWmfFile->OpenFromFile( m_wsTempFilePath.GetBuffer() ); + m_pWmfFile->Scan( m_pRect ); + + if ( !m_pWmfFile->CheckError() ) + { + // Wmf нормально открылся + m_lImageType = c_lImageTypeMetafile | c_lMetaWmf; + + DeleteMetaFile( hWmf ); + DeleteEnhMetaFile( hEmf ); + delete[] pBuffer; + delete pMetaFile; + + return; + } + else if ( m_pWmfFile->UnSupportedWmf() ) + { + // Исходный файл Emf, но после конвертации в Wmf он не открылся + m_lImageType = c_lImageTypeMetafile | c_lMetaEmf; + } + else + { + // Сконвертированный файл не прочитался + m_pWmfFile->Close(); + m_lImageType = c_lImageTypeUnknown; + } + + DeleteMetaFile( hWmf ); + DeleteEnhMetaFile( hEmf ); + delete[] pBuffer; + delete pMetaFile; + } + } + else + { + DeleteEnhMetaFile( hEmf ); + delete pMetaFile; + } + if (TRUE) + { + Gdiplus::Bitmap* pBitmap = new Gdiplus::Bitmap(bsFilePath.c_str()); + + Aggplus::CImage* pImage = NULL; + BOOL bIsSuccess = NSGdiMeta::GdiPlusBitmapToMediaData(pBitmap, &pImage, FALSE); + RELEASEOBJECT(pBitmap); + + if (bIsSuccess) + { + m_lImageType = c_lImageTypeBitmap; + m_pMediaData = pImage; + return; + } + RELEASEOBJECT(pImage); + return; + } + } + } +#endif + //todo + //if ( (c_lImageTypeMetafile | c_lMetaEmf) == m_lImageType ) + //{ + // m_pEmfFile->Open(bsFilePath); + //} + //else + { + // Исходный файл не явлется метафайлом (Wmf/Emf) + // TODO: Сделать чтение Bitmap + m_pMediaData = new Aggplus::CImage(bsFilePath); + if(Aggplus::Ok != m_pMediaData->GetLastStatus()) + m_lImageType = c_lImageTypeBitmap; + else + m_pMediaData = NULL; + } + return; + } + + + void CASCImage::Close() + { + if ( m_lImageType & c_lImageTypeMetafile ) + { + m_pWmfFile->Close(); + if ( m_lImageType & c_lMetaEmf ) + { + // Удаляем временный файл + ::_wunlink( m_wsTempFilePath.GetBuffer() ); + } + } + + m_lImageType = c_lImageTypeUnknown; + m_wsTempFilePath = _T(""); + + RELEASEOBJECT(m_pMediaData); + } + HRESULT CASCImage::get_Type(LONG* lType) + { + if (NULL != lType) + *lType = m_lImageType; + + return S_OK; + } + HRESULT CASCImage::get_Width(LONG* lWidth) + { + if ( NULL != lWidth ) + { + if (NULL != m_pMediaData) + { + *lWidth = m_pMediaData->GetWidth(); + } + else if ( (c_lImageTypeMetafile | c_lMetaWmf) == m_lImageType || (c_lImageTypeMetafile | c_lMetaEmf) == m_lImageType ) + { + float fWidth, fHeight; + m_pWmfFile->GetSize( &fWidth, &fHeight ); + *lWidth = (LONG)fWidth; + } + else + { + *lWidth = 0; + } + } + + return S_OK; + } + HRESULT CASCImage::put_Width(LONG lWidth) + { + return S_OK; + } + HRESULT CASCImage::get_Height(LONG* lHeight) + { + if ( NULL != lHeight ) + { + if (NULL != m_pMediaData) + { + *lHeight = m_pMediaData->GetHeight(); + } + else if ( (c_lImageTypeMetafile | c_lMetaWmf) == m_lImageType || (c_lImageTypeMetafile | c_lMetaEmf) == m_lImageType ) + { + float fWidth, fHeight; + m_pWmfFile->GetSize( &fWidth, &fHeight ); + *lHeight = (LONG)fHeight; + } + else + { + *lHeight = 0; + } + } + + return S_OK; + } + HRESULT CASCImage::put_Height(LONG lHeight) + { + return S_OK; + } + HRESULT CASCImage::get_DpiX(double* dDpiX) + { + *dDpiX = m_dDpiX; + return S_OK; + } + HRESULT CASCImage::put_DpiX(double dDpiX) + { + m_dDpiX = dDpiX; + return S_OK; + } + HRESULT CASCImage::get_DpiY(double* dDpiY) + { + *dDpiY = m_dDpiY; + return S_OK; + } + HRESULT CASCImage::put_DpiY(double dDpiY) + { + m_dDpiY = dDpiY; + return S_OK; + } + HRESULT CASCImage::LoadFromFile(const std::wstring& bsFilePath) + { + // Внутри комманды Open выполняется команда Close + Open( bsFilePath ); + + return S_OK; + } + HRESULT CASCImage::DrawOnRenderer(IRenderer* pRenderer, double dX, double dY, double dWidth, double dHeight) + { + if (NULL == pRenderer) + return S_FALSE; + + pRenderer->BeginCommand(c_nImageType); + + if ( NULL != m_pMediaData ) + { + pRenderer->DrawImage(m_pMediaData, dX, dY, dWidth, dHeight); + } + else if ( (c_lImageTypeMetafile | c_lMetaWmf) == m_lImageType || (c_lImageTypeMetafile | c_lMetaEmf) == m_lImageType ) + { + pRenderer->get_DpiX(&m_dDpiX); + pRenderer->get_DpiY(&m_dDpiY); + + CRendererOutput oWmfOut( m_pWmfFile, pRenderer, dX, dY, dWidth, dHeight ); + + double fSrcWidth, fSrcHeight; + + float fW, fH; + m_pWmfFile->GetSize( &fW, &fH ); + m_pWmfFile->GetDisplaySize( &fSrcWidth, &fSrcHeight,m_dDpiX, m_dDpiY ); + + //m_pWmfFile->GetDisplaySize( &fSrcWidth, &fSrcHeight, 25.4, 25.4 ); + TWmfRectF oRectB = m_pWmfFile->GetBounds( ); + + //double dW = m_oRect.oBR.fX - m_oRect.oTL.fX; + //double dH = m_oRect.oBR.fY - m_oRect.oTL.fY; + double dW = oRectB.oBR.fX - oRectB.oTL.fX; + double dH = oRectB.oBR.fY - oRectB.oTL.fY; + + double dScaleX = dWidth / dW;//fSrcWidth; + double dScaleY = dHeight / dH;//fSrcHeight; + //double dScaleX = dWidth / fSrcWidth; + //double dScaleY = dHeight / fSrcHeight; + + double dSrcDpiX, dSrcDpiY; + m_pWmfFile->GetDpi( &dSrcDpiX, &dSrcDpiY ); + + double dDpiKoefX = m_dDpiX / dSrcDpiX; + double dDpiKoefY = m_dDpiY / dSrcDpiY; + + double dDpi = dSrcDpiY * fSrcHeight / fH; + oWmfOut.SetDpi( m_dDpiX, dDpi ); + oWmfOut.SetWmfRect( oRectB ); + oWmfOut.SetScales( dScaleX, dScaleY ); + + m_pWmfFile->SetOutputDevice( &oWmfOut ); + + TWmfRectF oRect; + m_pWmfFile->Play( &oRect ); + + } + + pRenderer->EndCommand(c_nImageType); + return S_OK; + } + + //------------------------------------------------------------------------------------------- + // IASCGraphicsBase + //------------------------------------------------------------------------------------------- + HRESULT CASCImage::LoadOnlyMeta(bool bVal) + { + m_bLoadOnlyMeta = bVal; + return S_OK; + } + HRESULT CASCImage::LoadSVG(const std::wstring& sVal) + { + //Close(); + //CoCreateInstance( __uuidof(SVGTransformer), NULL, CLSCTX_ALL, __uuidof(ISVGTransformer), (void**)(&m_pSVGFile) ); + //if (NULL != m_pSVGFile) + //{ + // if ( AVS_ERROR_FILEFORMAT == m_pSVGFile->Load( ParamValue.bstrVal ) ) + // { + // RELEASEINTERFACE( m_pSVGFile ); + // return S_FALSE; + // } + // else + // { + // m_lImageType = c_lImageTypeMetafile | c_lMetaSVG; + // } + //} + return S_OK; + } + CFontManager* CASCImage::get_FontManager() + { + return m_pWmfFile->GetFontManager(); + } + void CASCImage::put_FontManager(CFontManager* pManager) + { + m_pWmfFile->SetFontManager(pManager); + } + + Aggplus::CImage* CASCImage::get_BitmapImage() + { + return m_pMediaData; + } +} \ No newline at end of file diff --git a/ASCHTMLRenderer/CASCImage.h b/ASCHTMLRenderer/CASCImage.h new file mode 100644 index 0000000000..fa04ca762f --- /dev/null +++ b/ASCHTMLRenderer/CASCImage.h @@ -0,0 +1,107 @@ +#ifndef C_IMAGE_RENDERER +#define C_IMAGE_RENDERER + +#ifdef _WIN32 +#include +#include +#else +#include "../Common/DocxFormat/Source/Base/ASCString.h" +#endif + +#include "../DesktopEditor/graphics/IRenderer.h" + +const long c_lImageTypeUnknown = 0x0000; +const long c_lImageTypeMetafile = 0x1000; +const long c_lImageTypeBitmap = 0x2000; + +const long c_lMetaWmf = 0x01; +const long c_lMetaEmf = 0x02; +const long c_lMetaSVG = 0x04; + + +const long c_ag_ImageTypeBitmap = 0; +const long c_ag_ImageTypeMetafile = 1; + +class CFontManager; +class CWmfFile; +struct TWmfRectF; +namespace Aggplus +{ + class CImage; +} +namespace NSHtmlRenderer +{ + class IASCImage + { + public: + virtual HRESULT get_Type(LONG* lType) = 0; + + virtual HRESULT get_Width(LONG* lWidth) = 0; + virtual HRESULT put_Width(LONG lWidth) = 0; + + virtual HRESULT get_Height(LONG* lHeight) = 0; + virtual HRESULT put_Height(LONG lHeight) = 0; + + virtual HRESULT get_DpiX(double* dDpiX) = 0; + virtual HRESULT put_DpiX(double dDpiX) = 0; + + virtual HRESULT get_DpiY(double* dDpiY) = 0; + virtual HRESULT put_DpiY(double dDpiY) = 0; + + virtual CFontManager* get_FontManager() = 0; + virtual void put_FontManager(CFontManager* pManager) = 0; + + virtual HRESULT LoadFromFile(const std::wstring& bsFilePath) = 0; + virtual HRESULT DrawOnRenderer(IRenderer* pRenderer, double dX, double dY, double dWidth, double dHeight) = 0; + }; + + // CAVSImage + class CASCImage : public IASCImage + { + private: + + CWmfFile* m_pWmfFile; + + TWmfRectF* m_pRect; + + CString m_wsTempFilePath; + + long m_lImageType; // 0 - BMP, 1 - WMF, 2 - EFM + + double m_dDpiX; + double m_dDpiY; + + Aggplus::CImage* m_pMediaData; + + BOOL m_bLoadOnlyMeta; // Загружаем только метафайл + + public: + + CASCImage(); + ~CASCImage(); + + private: + + void Open(const std::wstring& bsFilePath); + void Close(); + public: + + HRESULT get_Type(LONG* lType); + HRESULT get_Width(LONG* lWidth); + HRESULT put_Width(LONG lWidth); + HRESULT get_Height(LONG* lHeight); + HRESULT put_Height(LONG lHeight); + HRESULT get_DpiX(double* dDpiX); + HRESULT put_DpiX(double dDpiX); + HRESULT get_DpiY(double* dDpiY); + HRESULT put_DpiY(double dDpiY); + HRESULT LoadFromFile(const std::wstring& bsFilePath); + HRESULT DrawOnRenderer(IRenderer* pRenderer, double dX, double dY, double dWidth, double dHeight); + HRESULT LoadOnlyMeta(bool bVal); + HRESULT LoadSVG(const std::wstring& sVal); + CFontManager* get_FontManager(); + void put_FontManager(CFontManager* oManager); + Aggplus::CImage* get_BitmapImage(); + }; +} +#endif \ No newline at end of file diff --git a/ASCHTMLRenderer/CASCSVGRenderer.cpp b/ASCHTMLRenderer/CASCSVGRenderer.cpp new file mode 100644 index 0000000000..cc01d40bd6 --- /dev/null +++ b/ASCHTMLRenderer/CASCSVGRenderer.cpp @@ -0,0 +1,1051 @@ +#include "CASCSVGRenderer.h" +#include "../DesktopEditor/graphics/GraphicsPath.h" +#include "Writer/StringWriter.h" +#include "CMetafile.h" + +//#include "ASCMetafile.h" +//#include "StringWriter.h" +//#include "..\Objects\Structures.h" +//#include "ASCGraphicsSimpleConverter.h" +//#include "..\Objects\ASCWinFonts.h" +//#include "..\Objects\ASCFontManager.h" +//#include "GdiplusEx.h" + +namespace NSSVG +{ + inline static double FABS(double dVal) + { + return (dVal >= 0) ? dVal : -dVal; + } + inline static int round(double dVal) + { + return (int)(dVal + 0.5); + } + inline static LONG ConvertColor(LONG lBGR) + { + return (0x00FFFFFF & (((lBGR & 0xFF) << 16) | (lBGR & 0x0000FF00) | ((lBGR >> 16) & 0xFF))); + } +} + +namespace NSHtmlRenderer +{ + static CString g_string_svgOpen = _T("\n"); + static _bstr_t g_bstr_svgClose = L""; + + static CString g_string_image = _T("\n"); + + static _bstr_t g_bstr_graphicOpen = L"\n"; + static _bstr_t g_bstr_graphicClose = L"\n"; + + static _bstr_t g_bstr_path_d = L" d=\""; + static _bstr_t g_bstr_path_d_end = L"\" "; + + static _bstr_t g_bstr_vml_ClosePath = L"Z "; + static CString g_string_vml_MoveTo = _T("M %d,%d "); + static CString g_string_vml_LineTo = _T("L %d,%d "); + static CString g_string_vml_CurveTo = _T("C %d,%d %d,%d %d,%d "); + static _bstr_t g_bstr_vml_Path = L"\n"; + static CString g_string_vml_StyleStroke = _T("style=\"fill:none;stroke:#%06x;stroke-width:%dpx;stroke-opacity:%.2lf\" "); + static CString g_string_vml_StyleStroke_class = _T("class=\"stroke%d\" style=\"fill:none;stroke-width:%dpx;stroke-opacity:%.2lf\" "); + static CString g_string_vml_StyleFill = _T("style=\"fill:#%06x;fill-opacity:%.2lf;fill-rule:%s;stroke:none\" "); + static CString g_string_vml_StyleFill_class = _T("class=\"fill%d\" style=\"fill-opacity:%.2lf;fill-rule:%s;stroke:none\" "); + static CString g_string_vml_Style = _T("style=\"fill:#%06x;fill-opacity:%.2lf;fill-rule:%s;stroke:#%06x;stroke-width:%dpx;stroke-opacity:%.2lf\" "); + static CString g_string_vml_Style1 = _T("class=\"stroke%d\" style=\"fill:#%06x;fill-opacity:%.2lf;fill-rule:%s;stroke-width:%dpx;stroke-opacity:%.2lf\" "); + static CString g_string_vml_Style2 = _T("class=\"fill%d\" style=\"fill-opacity:%.2lf;fill-rule:%s;stroke:#%06x;stroke-width:%dpx;stroke-opacity:%.2lf\" "); + static CString g_string_vml_Style3 = _T("class=\"stroke%d fill%d\" style=\"fill-opacity:%.2lf;fill-rule:%s;stroke-width:%dpx;stroke-opacity:%.2lf\" "); + + CASCSVGRenderer::CASCSVGRenderer() + { + m_dDpiX = 96.0; + m_dDpiY = 96.0; + + m_dWidth = -1; + m_dHeight = -1; + + m_lClipMode = c_nClipRegionTypeWinding; + + m_pSimpleGraphicsConverter = new Aggplus::CGraphicsPathSimpleConverter(); + m_pSimpleGraphicsConverter->SetRenderer(this); + + m_pFontManager = NULL; + m_pPen = new NSStructures::CPen(); + m_pBrush = new NSStructures::CBrush(); + m_pFont = new NSStructures::CFont(); + m_pInstalledFont = new NSStructures::CFont(); + m_pInstalledFont->Name = _T(""); + + m_pBaseTransform = new Aggplus::CMatrix(); + m_pTransform = new Aggplus::CMatrix(); + m_pFullTransform = new Aggplus::CMatrix(); + + m_pWriter = new NSStrings::CStringWriter(); + m_pWriterVML = new NSStrings::CStringWriter(); + } + CASCSVGRenderer::~CASCSVGRenderer() + { + RELEASEOBJECT(m_pSimpleGraphicsConverter); + RELEASEOBJECT(m_pFontManager); + RELEASEOBJECT(m_pPen); + RELEASEOBJECT(m_pBrush); + RELEASEOBJECT(m_pFont); + RELEASEOBJECT(m_pBaseTransform); + RELEASEOBJECT(m_pTransform); + RELEASEOBJECT(m_pFullTransform); + RELEASEOBJECT(m_pWriter); + RELEASEOBJECT(m_pWriterVML); + } + + HRESULT CASCSVGRenderer::get_Type(LONG* lType) + { + if (NULL == lType) + return S_FALSE; + + *lType = c_nSVGRendrerer; + return S_OK; + } + //-------- Функции для работы со страницей -------------------------------------------------- + HRESULT CASCSVGRenderer::NewPage() + { + return S_OK; + } + HRESULT CASCSVGRenderer::get_Height(double* dHeight) + { + *dHeight = m_dHeight; + return S_OK; + } + HRESULT CASCSVGRenderer::put_Height(const double& dHeight) + { + m_dHeight = dHeight; + + if (-1 != m_dWidth) + OnBaseMatrixUpdate(); + + return S_OK; + } + HRESULT CASCSVGRenderer::get_Width(double* dWidth) + { + *dWidth = m_dWidth; + return S_OK; + } + HRESULT CASCSVGRenderer::put_Width(const double& dWidth) + { + m_dWidth = dWidth; + + if (-1 != m_dHeight) + OnBaseMatrixUpdate(); + + return S_OK; + } + + HRESULT CASCSVGRenderer::get_DpiX(double* dDpiX) + { + if (NULL != dDpiX) + *dDpiX = m_dDpiX; + return S_OK; + } + HRESULT CASCSVGRenderer::get_DpiY(double* dDpiY) + { + if (NULL != dDpiY) + *dDpiY = m_dDpiY; + return S_OK; + } + // pen -------------------------------------------------------------------------------------- + HRESULT CASCSVGRenderer::get_PenColor(LONG* lColor) + { + *lColor = m_pPen->Color; + return S_OK; + } + HRESULT CASCSVGRenderer::put_PenColor(const LONG& lColor) + { + m_pPen->Color = (lColor & 0x00FFFFFF); + + DWORD dwVal = (DWORD)lColor; + LONG lSchemeIndex = ((BYTE)(dwVal >> 24) - 100); + if (lSchemeIndex >= 0) + m_lColorSchemeIndexPen1 = lSchemeIndex; + else + m_lColorSchemeIndexPen1 = -1; + + return S_OK; + } + HRESULT CASCSVGRenderer::get_PenAlpha(LONG* lAlpha) + { + *lAlpha = m_pPen->Alpha; + return S_OK; + } + HRESULT CASCSVGRenderer::put_PenAlpha(const LONG& lAlpha) + { + m_pPen->Alpha = lAlpha; + return S_OK; + } + HRESULT CASCSVGRenderer::get_PenSize(double* dSize) + { + *dSize = m_pPen->Size; + return S_OK; + } + HRESULT CASCSVGRenderer::put_PenSize(const double& dSize) + { + m_pPen->Size = dSize; + return S_OK; + } + HRESULT CASCSVGRenderer::get_PenDashStyle(BYTE* val) + { + *val = m_pPen->DashStyle; + return S_OK; + } + HRESULT CASCSVGRenderer::put_PenDashStyle(const BYTE& val) + { + m_pPen->DashStyle = val; + return S_OK; + } + HRESULT CASCSVGRenderer::get_PenLineStartCap(BYTE* val) + { + *val = m_pPen->LineStartCap; + return S_OK; + } + HRESULT CASCSVGRenderer::put_PenLineStartCap(const BYTE& val) + { + m_pPen->LineStartCap = val; + return S_OK; + } + HRESULT CASCSVGRenderer::get_PenLineEndCap(BYTE* val) + { + *val = m_pPen->LineEndCap; + return S_OK; + } + HRESULT CASCSVGRenderer::put_PenLineEndCap(const BYTE& val) + { + m_pPen->LineEndCap = val; + return S_OK; + } + HRESULT CASCSVGRenderer::get_PenLineJoin(BYTE* val) + { + *val = m_pPen->LineJoin; + return S_OK; + } + HRESULT CASCSVGRenderer::put_PenLineJoin(const BYTE& val) + { + m_pPen->LineJoin = val; + return S_OK; + } + HRESULT CASCSVGRenderer::get_PenDashOffset(double* val) + { + *val = m_pPen->DashOffset; + return S_OK; + } + HRESULT CASCSVGRenderer::put_PenDashOffset(const double& val) + { + m_pPen->DashOffset = val; + return S_OK; + } + HRESULT CASCSVGRenderer::get_PenAlign(LONG* val) + { + *val = m_pPen->Align; + return S_OK; + } + HRESULT CASCSVGRenderer::put_PenAlign(const LONG& val) + { + m_pPen->Align = val; + return S_OK; + } + HRESULT CASCSVGRenderer::get_PenMiterLimit(double* val) + { + *val = m_pPen->MiterLimit; + return S_OK; + } + HRESULT CASCSVGRenderer::put_PenMiterLimit(const double& val) + { + m_pPen->MiterLimit = val; + return S_OK; + } + HRESULT CASCSVGRenderer::PenDashPattern(double* pPattern, LONG lCount) + { + if (NULL != pPattern) + { + m_pPen->SetDashPattern(pPattern, lCount); + } + return S_OK; + } + // brush ------------------------------------------------------------------------------------ + HRESULT CASCSVGRenderer::get_BrushType(LONG* lType) + { + *lType = m_pBrush->Type; + return S_OK; + } + HRESULT CASCSVGRenderer::put_BrushType(const LONG& lType) + { + m_pBrush->Type = lType; + return S_OK; + } + HRESULT CASCSVGRenderer::get_BrushColor1(LONG* lColor) + { + *lColor = m_pBrush->Color1; + return S_OK; + } + HRESULT CASCSVGRenderer::put_BrushColor1(const LONG& lColor) + { + m_pBrush->Color1 = (lColor & 0x00FFFFFF); + + DWORD dwVal = (DWORD)lColor; + LONG lSchemeIndex = ((BYTE)(dwVal >> 24) - 100); + if (lSchemeIndex >= 0) + m_lColorSchemeIndexBrush1 = lSchemeIndex; + else + m_lColorSchemeIndexBrush1 = -1; + + return S_OK; + } + HRESULT CASCSVGRenderer::get_BrushAlpha1(LONG* lAlpha) + { + *lAlpha = m_pBrush->Alpha1; + return S_OK; + } + HRESULT CASCSVGRenderer::put_BrushAlpha1(const LONG& lAlpha) + { + m_pBrush->Alpha1 = lAlpha; + return S_OK; + } + HRESULT CASCSVGRenderer::get_BrushColor2(LONG* lColor) + { + *lColor = m_pBrush->Color2; + return S_OK; + } + HRESULT CASCSVGRenderer::put_BrushColor2(const LONG& lColor) + { + m_pBrush->Color2 = lColor; + return S_OK; + } + HRESULT CASCSVGRenderer::get_BrushAlpha2(LONG* lAlpha) + { + *lAlpha = m_pBrush->Alpha2; + return S_OK; + } + HRESULT CASCSVGRenderer::put_BrushAlpha2(const LONG& lAlpha) + { + m_pBrush->Alpha2 = lAlpha; + return S_OK; + } + HRESULT CASCSVGRenderer::get_BrushTexturePath(std::wstring* bsPath) + { + *bsPath = m_pBrush->TexturePath; + return S_OK; + } + HRESULT CASCSVGRenderer::put_BrushTexturePath(const std::wstring& bsPath) + { + m_pBrush->TexturePath = bsPath; + return S_OK; + } + HRESULT CASCSVGRenderer::get_BrushTextureMode(LONG* lMode) + { + *lMode = m_pBrush->TextureMode; + return S_OK; + } + HRESULT CASCSVGRenderer::put_BrushTextureMode(const LONG& lMode) + { + m_pBrush->TextureMode = lMode; + return S_OK; + } + HRESULT CASCSVGRenderer::get_BrushTextureAlpha(LONG* lTxAlpha) + { + *lTxAlpha = m_pBrush->TextureAlpha; + return S_OK; + } + HRESULT CASCSVGRenderer::put_BrushTextureAlpha(const LONG& lTxAlpha) + { + m_pBrush->TextureAlpha = lTxAlpha; + return S_OK; + } + HRESULT CASCSVGRenderer::get_BrushLinearAngle(double* dAngle) + { + *dAngle = m_pBrush->LinearAngle; + return S_OK; + } + HRESULT CASCSVGRenderer::put_BrushLinearAngle(const double& dAngle) + { + m_pBrush->LinearAngle = dAngle; + return S_OK; + } + HRESULT CASCSVGRenderer::BrushRect(const INT& val, const double& left, const double& top, const double& width, const double& height) + { + m_pBrush->Rectable = val; + m_pBrush->Rect.X = (float)left; + m_pBrush->Rect.Y = (float)top; + m_pBrush->Rect.Width = (float)width; + m_pBrush->Rect.Height = (float)height; + + return S_OK; + } + HRESULT CASCSVGRenderer::BrushBounds(const double& left, const double& top, const double& width, const double& height) + { + //todo new command + return S_OK; + } + + HRESULT CASCSVGRenderer::put_BrushGradientColors(LONG* lColors, double* pPositions, LONG nCount) + { + //todo new command + return S_OK; + } + // font ------------------------------------------------------------------------------------- + HRESULT CASCSVGRenderer::get_FontName(std::wstring* bsName) + { + *bsName = m_pFont->Name; + return S_OK; + } + HRESULT CASCSVGRenderer::put_FontName(const std::wstring& bsName) + { + m_pFont->Name = bsName; + return S_OK; + } + HRESULT CASCSVGRenderer::get_FontPath(std::wstring* bsName) + { + *bsName = m_pFont->Path; + return S_OK; + } + HRESULT CASCSVGRenderer::put_FontPath(const std::wstring& bsName) + { + m_pFont->Path = bsName; + return S_OK; + } + HRESULT CASCSVGRenderer::get_FontSize(double* dSize) + { + *dSize = m_pFont->Size; + return S_OK; + } + HRESULT CASCSVGRenderer::put_FontSize(const double& dSize) + { + m_pFont->Size = dSize; + return S_OK; + } + HRESULT CASCSVGRenderer::get_FontStyle(LONG* lStyle) + { + *lStyle = m_pFont->GetStyle(); + return S_OK; + } + HRESULT CASCSVGRenderer::put_FontStyle(const LONG& lStyle) + { + m_pFont->SetStyle(lStyle); + return S_OK; + } + HRESULT CASCSVGRenderer::get_FontStringGID(INT* bGID) + { + *bGID = m_pFont->StringGID; + return S_OK; + } + HRESULT CASCSVGRenderer::put_FontStringGID(const INT& bGID) + { + m_pFont->StringGID = bGID; + return S_OK; + } + HRESULT CASCSVGRenderer::get_FontCharSpace(double* dSpace) + { + *dSpace = m_pFont->CharSpace; + return S_OK; + } + HRESULT CASCSVGRenderer::put_FontCharSpace(const double& dSpace) + { + m_pFont->CharSpace = dSpace; + return S_OK; + } + HRESULT CASCSVGRenderer::get_FontFaceIndex(int* lFaceIndex) + { + *lFaceIndex = m_pFont->FaceIndex; + return S_OK; + } + HRESULT CASCSVGRenderer::put_FontFaceIndex(const int& lFaceIndex) + { + m_pFont->FaceIndex = lFaceIndex; + return S_OK; + } + //-------- Функции для вывода текста -------------------------------------------------------- + HRESULT CASCSVGRenderer::CommandDrawTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset) + { + //todo new command + return S_OK; + } + HRESULT CASCSVGRenderer::CommandDrawText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset) + { + if (c_nHyperlinkType == m_lCurrentCommandType) + return S_OK; + + PathCommandStart(); + PathCommandText(bsText, x, y, w, h, baselineOffset); + + //double dOldPenW = m_pPen->Size; + //long lOldPenC = m_pPen->Color; + //long lOldPenA = m_pPen->Alpha; + + //m_pPen->Size = 25.4 / 96; + //m_pPen->Color = m_pBrush->Color1; + //m_pPen->Alpha = m_pBrush->Alpha1; + + DrawPath(0x0100); + + //m_pPen->Size = dOldPenW; + //m_pPen->Color = lOldPenC; + //m_pPen->Alpha = lOldPenA; + + PathCommandEnd(); + + //double x = fX; + //double y = fY; + //m_pFullTransform->TransformPoint(x, y); + + //double r = fX + fWidth; + //double b = fY + fHeight; + //m_pFullTransform->TransformPoint(r, b); + + //m_pWriter->WriteText(bsText, NULL, x, y, r - x, b - y, fBaseLineOffset); + + return S_OK; + } + HRESULT CASCSVGRenderer::CommandDrawTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags) + { + //todo new command + return S_OK; + } + HRESULT CASCSVGRenderer::CommandDrawTextEx(const std::wstring& bsUnicodeText, const std::wstring& bsGidText, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags) + { + if (!bsGidText.empty()) + { + m_pFont->StringGID = TRUE; + return CommandDrawText(bsGidText, x, y, w, h, baselineOffset); + } + + m_pFont->StringGID = FALSE; + return CommandDrawText(bsUnicodeText, x, y, w, h, baselineOffset); + } + //-------- Маркеры для команд --------------------------------------------------------------- + HRESULT CASCSVGRenderer::BeginCommand(const DWORD& lType) + { + if (c_nClipType == lType) + { + //m_pWriter->WritePathClip(); + } + else if (c_nPathType == lType) + { + //m_pWriter->WriteBeginPath(); + } + m_lCurrentCommandType = lType; + + return S_OK; + } + HRESULT CASCSVGRenderer::EndCommand(const DWORD& lType) + { + if (c_nPageType == lType) + { + EndPage(); + } + else if (c_nClipType == lType) + { + //m_pWriter->WritePathClipEnd(); + } + else if (c_nResetClipType == lType) + { + //m_pWriter->WritePathResetClip(); + } + m_lCurrentCommandType = -1; + + return S_OK; + } + //-------- Функции для работы с Graphics Path ----------------------------------------------- + HRESULT CASCSVGRenderer::PathCommandMoveTo(const double& fX, const double& fY) + { + if (c_nSimpleGraphicType == m_lCurrentCommandType) + { + MoveTo(fX, fY); + } + else + { + m_pSimpleGraphicsConverter->PathCommandMoveTo(fX, fY); + } + + return S_OK; + } + HRESULT CASCSVGRenderer::PathCommandLineTo(const double& fX, const double& fY) + { + if (c_nSimpleGraphicType == m_lCurrentCommandType) + { + LineTo(fX, fY); + } + else + { + m_pSimpleGraphicsConverter->PathCommandLineTo(fX, fY); + } + + return S_OK; + } + HRESULT CASCSVGRenderer::PathCommandLinesTo(double* points, const int& count) + { + m_pSimpleGraphicsConverter->PathCommandLinesTo(points, count); + return S_OK; + } + HRESULT CASCSVGRenderer::PathCommandCurveTo(const double& fX1, const double& fY1, const double& fX2, const double& fY2, const double& fX3, const double& fY3) + { + if (c_nSimpleGraphicType == m_lCurrentCommandType) + { + CurveTo(fX1, fY1, fX2, fY2, fX3, fY3); + } + else + { + m_pSimpleGraphicsConverter->PathCommandCurveTo(fX1, fY1, fX2, fY2, fX3, fY3); + } + + return S_OK; + } + HRESULT CASCSVGRenderer::PathCommandCurvesTo(double* points, const int& count) + { + m_pSimpleGraphicsConverter->PathCommandCurvesTo(points, count); + return S_OK; + } + HRESULT CASCSVGRenderer::PathCommandArcTo(const double& fX, const double& fY, const double& fWidth, const double& fHeight, const double& fStartAngle, const double& fSweepAngle) + { + m_pSimpleGraphicsConverter->PathCommandArcTo(fX, fY, fWidth, fHeight, fStartAngle, fSweepAngle); + return S_OK; + } + HRESULT CASCSVGRenderer::PathCommandClose() + { + if (c_nSimpleGraphicType == m_lCurrentCommandType) + { + Close(); + } + else + { + m_pSimpleGraphicsConverter->PathCommandClose(); + } + + return S_OK; + } + HRESULT CASCSVGRenderer::PathCommandEnd() + { + if (c_nSimpleGraphicType == m_lCurrentCommandType) + { + End(); + } + else + { + m_pSimpleGraphicsConverter->PathCommandEnd(); + } + + return S_OK; + } + HRESULT CASCSVGRenderer::DrawPath(const long& nType) + { + if (m_pWriterVML->GetCurSize() < 3) + return S_OK; + + //m_pWriter->WriteDrawPath(nType); + + BOOL bStroke = (0x01 == (0x01 & nType)); + BOOL bFill = (0x01 < nType); + + if (0 == m_pPen->Alpha) + bStroke = false; + if ((0 == m_pBrush->Alpha1) && (c_BrushTypeSolid == m_pBrush->Type)) + bFill = false; + else if ((0 == m_pBrush->TextureAlpha) && (c_BrushTypeTexture == m_pBrush->Type || c_BrushTypePattern == m_pBrush->Type)) + bFill = false; + + if (!bFill) + { + // stroke + int nColorPen = NSSVG::ConvertColor(m_pPen->Color); + int nPenW = NSSVG::round(m_pPen->Size * m_dDpiY / c_ag_Inch_to_MM); + + CString strStyle = _T(""); + if (-1 == m_lColorSchemeIndexPen1) + strStyle.Format(g_string_vml_StyleStroke, nColorPen, nPenW, (double)m_pPen->Alpha / 255); + else + strStyle.Format(g_string_vml_StyleStroke_class, m_lColorSchemeIndexPen1, nPenW, (double)m_pPen->Alpha / 255); + + m_pWriter->WriteString(g_bstr_vml_Path); + m_pWriter->WriteString(strStyle); + m_pWriter->WriteString(g_bstr_path_d); + m_pWriter->Write(*m_pWriterVML); + m_pWriter->WriteString(g_bstr_path_d_end); + m_pWriter->WriteString(g_bstr_nodeClose); + + return S_OK; + } + else if (c_BrushTypeTexture == m_pBrush->Type || c_BrushTypePattern == m_pBrush->Type) + { + double x = 0; + double y = 0; + double w = 0; + double h = 0; + m_pSimpleGraphicsConverter->PathCommandGetBounds(x, y, w, h); + + DrawImageFromFile(m_pBrush->TexturePath, x, y, w, h, 255); + return S_OK; + //double x = 0; + //double y = 0; + //double r = 0; + //double b = 0; + + //m_pSimpleGraphicsConverter->PathCommandGetBounds(&x, &y, &r, &b); + //r += x; + //b += y; + + //m_pFullTransform->TransformPoint(x, y); + //m_pFullTransform->TransformPoint(r, b); + + //CString str = _T(""); + //str.Format(g_string_image, NSSVG::round(x), NSSVG::round(y), NSSVG::round(r - x), NSSVG::round(b - y), m_pBrush->TexturePath); + + //m_pWriter->WriteString(str); + //return S_OK; + } + + int nColorBrush = NSSVG::ConvertColor(m_pBrush->Color1); + CString strMode = _T("nonzero"); + if (nType & c_nEvenOddFillMode) + strMode = _T("evenodd"); + + if (!bStroke) + { + CString strStyle = _T(""); + if (-1 == m_lColorSchemeIndexBrush1) + strStyle.Format(g_string_vml_StyleFill, nColorBrush, (double)m_pBrush->Alpha1 / 255, strMode); + else + strStyle.Format(g_string_vml_StyleFill_class, m_lColorSchemeIndexBrush1, (double)m_pBrush->Alpha1 / 255, strMode); + + m_pWriter->WriteString(g_bstr_vml_Path); + m_pWriter->WriteString(strStyle); + m_pWriter->WriteString(g_bstr_path_d); + m_pWriter->Write(*m_pWriterVML); + m_pWriter->WriteString(g_bstr_path_d_end); + m_pWriter->WriteString(g_bstr_nodeClose); + return S_OK; + } + + int nPenColor = NSSVG::ConvertColor(m_pPen->Color); + int nPenW = NSSVG::round(m_pPen->Size * m_dDpiY / c_ag_Inch_to_MM); + CString strStyle = _T(""); + if (-1 != m_lColorSchemeIndexPen1 && -1 != m_lColorSchemeIndexBrush1) + strStyle.Format(g_string_vml_Style3, m_lColorSchemeIndexPen1, m_lColorSchemeIndexBrush1, (double)m_pBrush->Alpha1 / 255, strMode, nPenW, (double)m_pPen->Alpha / 255); + else if (-1 != m_lColorSchemeIndexPen1) + strStyle.Format(g_string_vml_Style1, m_lColorSchemeIndexPen1, nColorBrush, (double)m_pBrush->Alpha1 / 255, strMode, nPenW, (double)m_pPen->Alpha / 255); + else if (-1 != m_lColorSchemeIndexBrush1) + strStyle.Format(g_string_vml_Style2, m_lColorSchemeIndexBrush1, (double)m_pBrush->Alpha1 / 255, strMode, nPenColor, nPenW, (double)m_pPen->Alpha / 255); + else + strStyle.Format(g_string_vml_Style, nColorBrush, (double)m_pBrush->Alpha1 / 255, strMode, nPenColor, nPenW, (double)m_pPen->Alpha / 255); + + m_pWriter->WriteString(g_bstr_vml_Path); + m_pWriter->WriteString(strStyle); + m_pWriter->WriteString(g_bstr_path_d); + m_pWriter->Write(*m_pWriterVML); + m_pWriter->WriteString(g_bstr_path_d_end); + m_pWriter->WriteString(g_bstr_nodeClose); + + return S_OK; + } + HRESULT CASCSVGRenderer::PathCommandStart() + { + if (c_nSimpleGraphicType == m_lCurrentCommandType) + { + Start(); + } + else + { + m_pSimpleGraphicsConverter->PathCommandStart(); + } + + return S_OK; + } + HRESULT CASCSVGRenderer::PathCommandGetCurrentPoint(double* fX, double* fY) + { + m_pSimpleGraphicsConverter->PathCommandGetCurrentPoint(fX, fY); + return S_OK; + } + HRESULT CASCSVGRenderer::PathCommandTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset) + { + //todo new command + return S_OK; + } + HRESULT CASCSVGRenderer::PathCommandText(const std::wstring& bsText, const double& fX, const double& fY, const double& fWidth, const double& fHeight, const double& fBaseLineOffset) + { + if (NULL == m_pFontManager) + { + m_pFontManager = new CFontManager(); + m_pFontManager->Initialize(); + } + + _SetFont(); + m_pSimpleGraphicsConverter->PathCommandText(bsText, m_pFontManager, fX, fY, fWidth, fHeight, fBaseLineOffset); + return S_OK; + } + HRESULT CASCSVGRenderer::PathCommandTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags) + { + //todo new command + return S_OK; + } + HRESULT CASCSVGRenderer::PathCommandTextEx(const std::wstring& bsUnicodeText, const std::wstring& bsGidText, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags) + { + if (!bsGidText.empty()) + { + m_pFont->StringGID = TRUE; + return PathCommandText(bsGidText, x, y, w, h, baselineOffset); + } + + m_pFont->StringGID = FALSE; + return PathCommandText(bsUnicodeText, x, y, w, h, baselineOffset); + } + //-------- Функции для вывода изображений --------------------------------------------------- + HRESULT CASCSVGRenderer::DrawImage(IGrObject* pImage, const double& fX, const double& fY, const double& fWidth, const double& fHeight) + { + double x = fX; + double y = fY; + m_pFullTransform->TransformPoint(x, y); + + double r = fX + fWidth; + double b = fY + fHeight; + m_pFullTransform->TransformPoint(r, b); + + //m_pWriter->WriteImage(pInterface, x, y, r - x, b - y); + + return S_OK; + } + HRESULT CASCSVGRenderer::DrawImageFromFile(const std::wstring& sVal, const double& fX, const double& fY, const double& fWidth, const double& fHeight, const BYTE& lAlpha = 255) + { + double x = fX; + double y = fY; + m_pFullTransform->TransformPoint(x, y); + + double r = fX + fWidth; + double b = fY + fHeight; + m_pFullTransform->TransformPoint(r, b); + + CImageExt oExt; + LONG lFileType = oExt.GetImageType(sVal); + + if ((1 == lFileType) || (2 == lFileType)) + { + // метафайл + oExt.DrawOnRenderer(this, sVal, fX, fY, fWidth, fHeight, TRUE); + return S_OK; + } + + CString str = _T(""); + str.Format(g_string_image, NSSVG::round(x), NSSVG::round(y), NSSVG::round(r - x), NSSVG::round(b - y), sVal.c_str()); + + m_pWriter->WriteString(str); + return S_OK; + } + // transform -------------------------------------------------------------------------------- + HRESULT CASCSVGRenderer::SetTransform(const double& dA, const double& dB, const double& dC, const double& dD, const double& dE, const double& dF) + { + Aggplus::CMatrix oTrans(dA, dB, dC, dD, dE, dF); + *m_pTransform = oTrans; + + CalculateFullTransform(); + + return S_OK; + } + HRESULT CASCSVGRenderer::GetTransform(double *pdA, double *pdB, double *pdC, double *pdD, double *pdE, double *pdF) + { + return S_OK; + } + HRESULT CASCSVGRenderer::ResetTransform(void) + { + m_pTransform->Reset(); + CalculateFullTransform(); + return S_OK; + } + // ----------------------------------------------------------------------------------------- + HRESULT CASCSVGRenderer::get_ClipMode(LONG* plMode) + { + *plMode = m_lClipMode; + return S_OK; + } + HRESULT CASCSVGRenderer::put_ClipMode(const LONG& lMode) + { + m_lClipMode = lMode; + return S_OK; + } + // -------------------------------------------------------------------------------------------- + HRESULT CASCSVGRenderer::CommandLong(const LONG& lType, const LONG& lCommand) + { + //todo new command; + return S_OK; + } + HRESULT CASCSVGRenderer::CommandDouble(const LONG& lType, const double& dCommand) + { + //todo new command; + return S_OK; + } + HRESULT CASCSVGRenderer::CommandString(const LONG& lType, const std::wstring& sCommand) + { + //todo new command; + return S_OK; + } + // file + HRESULT CASCSVGRenderer::CreateOfficeFile(const std::wstring& bsFilePath, const LONG& lFonts) + { + m_strDstFile = bsFilePath; + m_pWriter->Clear(); + + if (0 != lFonts) + { + //todo + //if (NULL == m_pFonts) + //{ + // CoCreateInstance(__uuidof(CASCWinFonts), NULL, CLSCTX_ALL, __uuidof(IASCWinFonts), (void**)&m_pFonts); + //} + if (NULL == m_pFontManager) + { + m_pFontManager = new CFontManager(); + m_pFontManager->Initialize(); + //m_pFontManager->SetDefaultFont(L"Arial"); + } + } + + double dW = m_dWidth; + double dH = m_dHeight; + m_pFullTransform->TransformPoint(dW, dH); + + int w = NSSVG::round(dW); + int h = NSSVG::round(dH); + + CString strSVG = _T(""); + strSVG.Format(g_string_svgOpen, w, h, w, h); + + m_pWriter->WriteString(strSVG); + m_pWriter->WriteString(g_bstr_graphicOpen); + + m_lColorSchemeIndexBrush1 = -1; + m_lColorSchemeIndexPen1 = -1; + + return S_OK; + } + HRESULT CASCSVGRenderer::CloseFile(const LONG& lSave) + { + m_pWriter->WriteString(g_bstr_graphicClose); + m_pWriter->WriteString(g_bstr_svgClose); + + if (0 == lSave) + return S_OK; + + NSFile::CFileBinary oFile; + + if (S_OK == oFile.CreateFile(m_strDstFile)) + { + CString strData = m_pWriter->GetCString(); + oFile.WriteFile((BYTE*)strData.GetBuffer(), sizeof(WCHAR) * strData.GetLength()); + } + + return S_OK; + } + HRESULT CASCSVGRenderer::get_Data(std::wstring* bsData) + { + *bsData = std::wstring(m_pWriter->GetCString().GetString()); + return S_OK; + } + void CASCSVGRenderer::CalculateFullTransform() + { + *m_pFullTransform = *m_pBaseTransform; + m_pFullTransform->Multiply(m_pTransform, Aggplus::MatrixOrderPrepend); + } + + inline void CASCSVGRenderer::MoveTo(const double& dX, const double& dY) + { + double x = dX; + double y = dY; + m_pFullTransform->TransformPoint(x, y); + + CString str = _T(""); + str.Format(g_string_vml_MoveTo, (int)x, (int)y); + m_pWriterVML->WriteString(str); + } + inline void CASCSVGRenderer::LineTo(const double& dX, const double& dY) + { + double x = dX; + double y = dY; + m_pFullTransform->TransformPoint(x, y); + + CString str = _T(""); + str.Format(g_string_vml_LineTo, (int)x, (int)y); + m_pWriterVML->WriteString(str); + } + inline void CASCSVGRenderer::CurveTo(const double& x1, const double& y1, const double& x2, const double& y2, const double& x3, const double& y3) + { + double _x1 = x1; + double _y1 = y1; + m_pFullTransform->TransformPoint(_x1, _y1); + + double _x2 = x2; + double _y2 = y2; + m_pFullTransform->TransformPoint(_x2, _y2); + + double _x3 = x3; + double _y3 = y3; + m_pFullTransform->TransformPoint(_x3, _y3); + + CString str = _T(""); + str.Format(g_string_vml_CurveTo, (int)_x1, (int)_y1, (int)_x2, (int)_y2, (int)_x3, (int)_y3); + m_pWriterVML->WriteString(str); + } + inline void CASCSVGRenderer::Start() + { + } + void CASCSVGRenderer::End() + { + m_pWriterVML->ClearNoAttack(); + } + void CASCSVGRenderer::Close() + { + m_pWriterVML->WriteString(g_bstr_vml_ClosePath); + } + + void CASCSVGRenderer::StartPage(double& dWidth, double& dHeight) + { + m_dWidth = dWidth; + m_dHeight = dHeight; + } + void CASCSVGRenderer::EndPage() + { + } + + void CASCSVGRenderer::OnBaseMatrixUpdate() + { + m_pBaseTransform->Reset(); + + double dScaleX = m_dDpiX / c_ag_Inch_to_MM; + double dScaleY = m_dDpiY / c_ag_Inch_to_MM; + + m_pBaseTransform->Scale(dScaleX, dScaleY, Aggplus::MatrixOrderAppend); + + CalculateFullTransform(); + } + + void CASCSVGRenderer::_SetFont() + { + double dPix = m_pFont->CharSpace * m_dDpiX / 25.4; + + if (m_pInstalledFont->IsEqual(m_pFont)) + { + if (1 < m_dWidth) + { + m_pFontManager->SetCharSpacing(dPix); + } + return; + } + + m_pFontManager->SetStringGID(m_pFont->StringGID); + if (1 < m_dWidth) + { + m_pFontManager->SetCharSpacing(dPix); + } + + if (_T("") == m_pFont->Path) + { + m_pFontManager->LoadFontByName(m_pFont->Name, (float)m_pFont->Size, m_pFont->GetStyle(), m_dDpiX, m_dDpiY); + } + else + { + m_pFontManager->LoadFontFromFile(m_pFont->Path, m_pFont->FaceIndex, (float)m_pFont->Size, m_dDpiX, m_dDpiY); + } + + *m_pInstalledFont = *m_pFont; + } +} \ No newline at end of file diff --git a/ASCHTMLRenderer/CASCSVGRenderer.h b/ASCHTMLRenderer/CASCSVGRenderer.h new file mode 100644 index 0000000000..399c42e7ee --- /dev/null +++ b/ASCHTMLRenderer/CASCSVGRenderer.h @@ -0,0 +1,234 @@ +#ifndef C_ASC_SVG_RENDERER +#define C_ASC_SVG_RENDERER + +#include "../DesktopEditor/graphics/IRenderer.h" + +#ifdef _WIN32 +#include +#include +#else +#include "../../Common/DocxFormat/Source/Base/ASCString.h" +#endif + +namespace Aggplus +{ + class CMatrix; + class CGraphicsPathSimpleConverter; +} +class CFontManager; +namespace NSStrings +{ + class CStringWriter; +} +namespace NSHtmlRenderer +{ + class CSVGGraphicsWriter; +} +namespace NSStructures +{ + class CPen; + class CBrush; + class CFont; +} +namespace NSHtmlRenderer +{ + class IASCSVGRenderer : public IRenderer + { + public: + virtual HRESULT CreateOfficeFile(const std::wstring& bsFileName, const LONG& lFonts) = 0; + virtual HRESULT CloseFile(const LONG& lSave) = 0; + virtual HRESULT get_Data(std::wstring* pbstrSVG) = 0; + }; + + class CASCSVGRenderer : public IASCSVGRenderer + { + public: + CASCSVGRenderer(); + ~CASCSVGRenderer(); + + public: + // тип рендерера----------------------------------------------------------------------------- + HRESULT get_Type(LONG* lType); + //-------- Функции для работы со страницей -------------------------------------------------- + HRESULT NewPage(); + HRESULT get_Height(double* dHeight); + HRESULT put_Height(const double& dHeight); + HRESULT get_Width(double* dWidth); + HRESULT put_Width(const double& dWidth); + HRESULT get_DpiX(double* dDpiX); + HRESULT get_DpiY(double* dDpiY); + + // pen -------------------------------------------------------------------------------------- + HRESULT get_PenColor(LONG* lColor); + HRESULT put_PenColor(const LONG& lColor); + HRESULT get_PenAlpha(LONG* lAlpha); + HRESULT put_PenAlpha(const LONG& lAlpha); + HRESULT get_PenSize(double* dSize); + HRESULT put_PenSize(const double& dSize); + HRESULT get_PenDashStyle(BYTE* val); + HRESULT put_PenDashStyle(const BYTE& val); + HRESULT get_PenLineStartCap(BYTE* val); + HRESULT put_PenLineStartCap(const BYTE& val); + HRESULT get_PenLineEndCap(BYTE* val); + HRESULT put_PenLineEndCap(const BYTE& val); + HRESULT get_PenLineJoin(BYTE* val); + HRESULT put_PenLineJoin(const BYTE& val); + HRESULT get_PenDashOffset(double* dOffset); + HRESULT put_PenDashOffset(const double& dOffset); + HRESULT get_PenAlign(LONG* lAlign); + HRESULT put_PenAlign(const LONG& lAlign); + HRESULT get_PenMiterLimit(double* dOffset); + HRESULT put_PenMiterLimit(const double& dOffset); + HRESULT PenDashPattern(double* pPattern, LONG lCount); + + // brush ------------------------------------------------------------------------------------ + HRESULT get_BrushType(LONG* lType); + HRESULT put_BrushType(const LONG& lType); + HRESULT get_BrushColor1(LONG* lColor); + HRESULT put_BrushColor1(const LONG& lColor); + HRESULT get_BrushAlpha1(LONG* lAlpha); + HRESULT put_BrushAlpha1(const LONG& lAlpha); + HRESULT get_BrushColor2(LONG* lColor); + HRESULT put_BrushColor2(const LONG& lColor); + HRESULT get_BrushAlpha2(LONG* lAlpha); + HRESULT put_BrushAlpha2(const LONG& lAlpha); + HRESULT get_BrushTexturePath(std::wstring* bsPath); + HRESULT put_BrushTexturePath(const std::wstring& bsPath); + HRESULT get_BrushTextureMode(LONG* lMode); + HRESULT put_BrushTextureMode(const LONG& lMode); + HRESULT get_BrushTextureAlpha(LONG* lTxAlpha); + HRESULT put_BrushTextureAlpha(const LONG& lTxAlpha); + HRESULT get_BrushLinearAngle(double* dAngle); + HRESULT put_BrushLinearAngle(const double& dAngle); + HRESULT BrushRect(const INT& val, const double& left, const double& top, const double& width, const double& height); + HRESULT BrushBounds(const double& left, const double& top, const double& width, const double& height); + + HRESULT put_BrushGradientColors(LONG* lColors, double* pPositions, LONG nCount); + + // font ------------------------------------------------------------------------------------- + HRESULT get_FontName(std::wstring* bsName); + HRESULT put_FontName(const std::wstring& bsName); + HRESULT get_FontPath(std::wstring* bsName); + HRESULT put_FontPath(const std::wstring& bsName); + HRESULT get_FontSize(double* dSize); + HRESULT put_FontSize(const double& dSize); + HRESULT get_FontStyle(LONG* lStyle) ; + HRESULT put_FontStyle(const LONG& lStyle); + HRESULT get_FontStringGID(INT* bGID); + HRESULT put_FontStringGID(const INT& bGID); + HRESULT get_FontCharSpace(double* dSpace); + HRESULT put_FontCharSpace(const double& dSpace); + HRESULT get_FontFaceIndex(int* lFaceIndex); + HRESULT put_FontFaceIndex(const int& lFaceIndex); + + //-------- Функции для вывода текста -------------------------------------------------------- + HRESULT CommandDrawTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset); + HRESULT CommandDrawText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset); + + HRESULT CommandDrawTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags); + HRESULT CommandDrawTextEx(const std::wstring& bsUnicodeText, const std::wstring& bsGidText, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags); + + //-------- Маркеры для команд --------------------------------------------------------------- + HRESULT BeginCommand(const DWORD& lType); + HRESULT EndCommand(const DWORD& lType); + + //-------- Функции для работы с Graphics Path ----------------------------------------------- + HRESULT PathCommandMoveTo(const double& x, const double& y); + HRESULT PathCommandLineTo(const double& x, const double& y); + HRESULT PathCommandLinesTo(double* points, const int& count); + HRESULT PathCommandCurveTo(const double& x1, const double& y1, const double& x2, const double& y2, const double& x3, const double& y3); + HRESULT PathCommandCurvesTo(double* points, const int& count); + HRESULT PathCommandArcTo(const double& x, const double& y, const double& w, const double& h, const double& startAngle, const double& sweepAngle); + HRESULT PathCommandClose(); + HRESULT PathCommandEnd(); + HRESULT DrawPath(const LONG& nType); + HRESULT PathCommandStart(); + HRESULT PathCommandGetCurrentPoint(double* x, double* y); + + HRESULT PathCommandTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset); + HRESULT PathCommandText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset); + + HRESULT PathCommandTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags); + HRESULT PathCommandTextEx(const std::wstring& bsUnicodeText, const std::wstring& bsGidText, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags); + + //-------- Функции для вывода изображений --------------------------------------------------- + HRESULT DrawImage(IGrObject* pImage, const double& x, const double& y, const double& w, const double& h); + HRESULT DrawImageFromFile(const std::wstring&, const double& x, const double& y, const double& w, const double& h, const BYTE& lAlpha); + + // transform -------------------------------------------------------------------------------- + HRESULT SetTransform(const double& m1, const double& m2, const double& m3, const double& m4, const double& m5, const double& m6); + HRESULT GetTransform(double *pdA, double *pdB, double *pdC, double *pdD, double *pdE, double *pdF); + HRESULT ResetTransform(); + + // ----------------------------------------------------------------------------------------- + HRESULT get_ClipMode(LONG* plMode); + HRESULT put_ClipMode(const LONG& lMode); + // additiaonal params ---------------------------------------------------------------------- + HRESULT SaveFile(const std::wstring& strFileSave); + HRESULT ReInit(); + HRESULT IsRaster(bool* bVal); + // additiaonal params ---------------------------------------------------------------------- + HRESULT CommandLong(const LONG& lType, const LONG& lCommand); + HRESULT CommandDouble(const LONG& lType, const double& dCommand); + HRESULT CommandString(const LONG& lType, const std::wstring& sCommand); + // -------------------------------------------------------------------------------------------- + + // file + HRESULT CreateOfficeFile(const std::wstring& bsFileName, const LONG& lFonts); + HRESULT CloseFile(const LONG& lSave); + HRESULT get_Data(std::wstring* pbstrSVG); + + private: + + NSStrings::CStringWriter* m_pWriter; + NSStrings::CStringWriter* m_pWriterVML; + std::wstring m_strDstFile; + + Aggplus::CGraphicsPathSimpleConverter* m_pSimpleGraphicsConverter; // конвертер сложных гафических путей в простые + CFontManager* m_pFontManager; // менеджер шрифтов + + Aggplus::CMatrix* m_pBaseTransform; // матрица перерасчета координатных осей (здесь: миллиметры -> пикселы) + Aggplus::CMatrix* m_pTransform; // текущая матрица преобразований рендерера + Aggplus::CMatrix* m_pFullTransform; // полная матрица преобразований (m_oBaseTransform * m_oTransform) + + LONG m_lCurrentCommandType; // текущая команда + + double m_dDpiX; + double m_dDpiY; + + double m_dWidth; + double m_dHeight; + + LONG m_lClipMode; + + LONG m_lColorSchemeIndexBrush1; + LONG m_lColorSchemeIndexPen1; + + NSStructures::CPen* m_pPen; // настройки всей графики (скопирован ашник из AVSGraphics) + NSStructures::CBrush* m_pBrush; + NSStructures::CFont* m_pFont; + + NSStructures::CFont* m_pInstalledFont; + + //todo + //IASCWinFonts* m_pFonts; + + protected: + void CalculateFullTransform(); + + inline void MoveTo(const double& dX, const double& dY); + inline void LineTo(const double& dX, const double& dY); + inline void CurveTo(const double& x1, const double& y1, const double& x2, const double& y2, const double& x3, const double& y3); + inline void Start(); + void End(); + void Close(); + + void StartPage(double& dWidth, double& dHeight); + void EndPage(); + + void OnBaseMatrixUpdate(); + + void _SetFont(); + }; +} +#endif \ No newline at end of file diff --git a/ASCHTMLRenderer/CMetafile.cpp b/ASCHTMLRenderer/CMetafile.cpp new file mode 100644 index 0000000000..e69bc05681 --- /dev/null +++ b/ASCHTMLRenderer/CMetafile.cpp @@ -0,0 +1,245 @@ +#include "CMetafile.h" +#include "../DesktopEditor/common/File.h" +#include "../DesktopEditor/graphics/Image.h" +#include "../DesktopEditor/graphics/structures.h" +#include "../DesktopEditor/fontengine/GlyphString.h" +#include "CASCImage.h" + +namespace NSHtmlRenderer +{ + LONG CImageExt::GetImageType(const std::wstring& strFile) + { + NSFile::CFileBinary oFile; + if (S_OK != oFile.OpenFile(strFile)) + { + oFile.CloseFile(); + return 0; + } + + DWORD dwSize = (DWORD)oFile.GetFileSize(); + + if (44 > dwSize) + { + return 0; + } + + DWORD dwKey = 0; + DWORD dwSizeRead; + oFile.ReadFile((BYTE*)(&dwKey), 4, dwSizeRead); + + if (0x9AC6CDD7 == dwKey) + { + // placeable meta + oFile.CloseFile(); + return 1; + } + + if (0x00000001 == dwKey) + { + BYTE aTemp[40]; + oFile.ReadFile((BYTE*)&aTemp, 40, dwSizeRead); + oFile.ReadFile((BYTE*)(&dwKey), 4, dwSizeRead); + oFile.CloseFile(); + + if (0x464D4520 == dwKey) + { + // EMF/EMF+ + return 2; + } + else + { + // + return 0; + } + } + + oFile.CloseFile(); + + if (0x00090001 == dwKey) + { + return 1; + } + + return 0; + } + + void CImageExt::DrawOnRenderer(IRenderer* pRenderer, const std::wstring& strFile, const double& dX, const double& dY, const double& dW, const double& dH, const BOOL& bIsFromFileUse = TRUE) + { + if (NULL == pRenderer) + return; + + LONG lRendType = 0; + pRenderer->get_Type(&lRendType); + if (c_nPDFWriter == lRendType) + { + //todo + //VARIANT var; + //var.vt = VT_BOOL; + //var.boolVal = VARIANT_TRUE; + //pRenderer->SetAdditionalParam(L"WhiteBackImage", var); + } + + LONG lFileType = 0; + + if (c_nEbookWriter != lRendType) + lFileType = GetImageType(strFile); + + BOOL bIsGraphics = FALSE; + + //todo + //IASCGraphicsRenderer* pGR = NULL; + //pRenderer->QueryInterface(__uuidof(IASCGraphicsRenderer), (void**)&pGR); + + //if (NULL != pGR) + //{ + // bIsGraphics = TRUE; + //} + + //RELEASEINTERFACE(pGR); + + if (0 == lFileType) + { + // картинка + if (bIsGraphics) + { + pRenderer->DrawImageFromFile(strFile, dX, dY, dW, dH); + } + else + { + Aggplus::CImage oImage(strFile); + pRenderer->DrawImage(&oImage, dX, dY, dW, dH); + } + } + else if (1 == lFileType || 2 == lFileType) + { + // Запоминаем все настройки Brush, Font, Pen, Shadow и т.д. + NSStructures::CBrush oBrush; + std::wstring bsBrushTexturePath; + pRenderer->get_BrushAlpha1( &oBrush.Alpha1 ); + pRenderer->get_BrushAlpha2( &oBrush.Alpha2 ); + pRenderer->get_BrushColor1( &oBrush.Color1 ); + pRenderer->get_BrushColor2( &oBrush.Color2 ); + pRenderer->get_BrushLinearAngle( &oBrush.LinearAngle ); + pRenderer->get_BrushTextureMode( &oBrush.TextureMode ); + pRenderer->get_BrushTextureAlpha( &oBrush.TextureAlpha ); + pRenderer->get_BrushTexturePath( &bsBrushTexturePath ); + pRenderer->get_BrushType( &oBrush.Type ); + + NSStructures::CFont oFont; + std::wstring bsFontPath, bsFontName; + pRenderer->get_FontName( &bsFontName ); + pRenderer->get_FontPath( &bsFontPath ); + pRenderer->get_FontSize( &oFont.Size ); + LONG lStyle; + pRenderer->get_FontStyle( &lStyle ); + oFont.Bold = lStyle & FontConstants::FontStyleBold; + oFont.Italic = lStyle & FontConstants::FontStyleItalic; + oFont.Strikeout = lStyle & FontConstants::FontStyleStrikeout; + oFont.Underline = lStyle & FontConstants::FontStyleUnderline; + pRenderer->get_FontStringGID( &oFont.StringGID ); + + NSStructures::CPen oPen; + pRenderer->get_PenAlign( &oPen.Align ); + pRenderer->get_PenAlpha( &oPen.Alpha ); + pRenderer->get_PenColor( &oPen.Color ); + + + NSHtmlRenderer::CASCImage oImage; + + oImage.put_FontManager(NULL); + + oImage.LoadFromFile( strFile ); + oImage.DrawOnRenderer( pRenderer, dX, dY, dW, dH ); + + // Восстанавливаем параметры + + pRenderer->put_BrushAlpha1( oBrush.Alpha1 ); + pRenderer->put_BrushAlpha2( oBrush.Alpha2 ); + pRenderer->put_BrushColor1( oBrush.Color1 ); + pRenderer->put_BrushColor2( oBrush.Color2 ); + pRenderer->put_BrushLinearAngle( oBrush.LinearAngle ); + pRenderer->put_BrushTextureMode( oBrush.TextureMode ); + pRenderer->put_BrushTextureAlpha( oBrush.TextureAlpha ); + pRenderer->put_BrushTexturePath( bsBrushTexturePath ); + pRenderer->put_BrushType( oBrush.Type ); + + pRenderer->put_FontName( bsFontName ); + pRenderer->put_FontPath( bsFontPath ); + pRenderer->put_FontSize( oFont.Size ); + pRenderer->put_FontStyle( oFont.GetStyle() ); + pRenderer->put_FontStringGID( oFont.StringGID ); + + pRenderer->put_PenAlign( oPen.Align ); + pRenderer->put_PenAlpha( oPen.Alpha ); + pRenderer->put_PenColor( oPen.Color ); + + // на всякий случай скидываем path + pRenderer->PathCommandEnd(); + } + //else if (2 == lFileType) + //{ + // if (bIsGraphics) + // { + // pRenderer->DrawImageFromFile(strFile, dX, dY, dW, dH); + // return; + // } + + // NSDocumentViewer::CDIB oSection; + + // double dDpiX = 0; + // double dDpiY = 0; + // pRenderer->get_DpiX(&dDpiX); + // pRenderer->get_DpiY(&dDpiY); + + // LONG lPixW = (LONG)dW * dDpiX / NSDocumentViewer::c_dInch_to_MM; + // LONG lPixH = (LONG)dH * dDpiX / NSDocumentViewer::c_dInch_to_MM; + + // oSection.Create(lPixW, lPixH, dDpiX, dDpiY); + + // LONG lCount = lPixW * lPixH; + // memset(oSection.m_pBits, 0xFF, 4 * lCount); + + // HDC hDC = GetDC(NULL); + + // HDC memDC = CreateCompatibleDC(hDC); + // ReleaseDC(0, hDC); + + // HBITMAP hOldBitmap = (HBITMAP)SelectObject(memDC, oSection.m_hBitmap); + + // RECT oRectPlay; + // oRectPlay.left = 0; + // oRectPlay.top = 0; + // oRectPlay.right = lPixW; + // oRectPlay.bottom = lPixH; + + // HENHMETAFILE hMeta = GetEnhMetaFile(strFile); + + // PlayEnhMetaFile(memDC, hMeta, &oRectPlay); + // DeleteEnhMetaFile(hMeta); + + // MediaCore::IAVSUncompressedVideoFrame* pMediaData = NULL; + // CoCreateInstance(MediaCore::CLSID_CAVSUncompressedVideoFrame, NULL, CLSCTX_INPROC, MediaCore::IID_IAVSUncompressedVideoFrame, (void**)&pMediaData); + + // pMediaData->put_ColorSpace(CSP_VFLIP | CSP_BGRA); + // pMediaData->put_Width(lPixW); + // pMediaData->put_Height(lPixH); + // pMediaData->SetDefaultStrides(); + // pMediaData->AllocateBuffer(-1); + + // BYTE* pPixels = NULL; + // pMediaData->get_Buffer(&pPixels); + // memcpy(pPixels, oSection.m_pBits, 4 * lPixW * lPixH); + + // DeleteObject(hOldBitmap); + // DeleteDC(memDC); + + // IUnknown* punkImage = NULL; + // pMediaData->QueryInterface(IID_IUnknown, (void**)&punkImage); + + // RELEASEINTERFACE(pMediaData); + + // pRenderer->DrawImage(punkImage, dX, dY, dW, dH); + // RELEASEINTERFACE(punkImage); + //} + } +} \ No newline at end of file diff --git a/ASCHTMLRenderer/CMetafile.h b/ASCHTMLRenderer/CMetafile.h new file mode 100644 index 0000000000..66f47a8438 --- /dev/null +++ b/ASCHTMLRenderer/CMetafile.h @@ -0,0 +1,15 @@ +#ifndef C_METAFILE +#define C_METAFILE + +#include "../DesktopEditor/graphics/IRenderer.h" +namespace NSHtmlRenderer +{ + class CImageExt + { + public: + LONG GetImageType(const std::wstring& strFile); + + void DrawOnRenderer(IRenderer* pRenderer, const std::wstring& strFile, const double& dX, const double& dY, const double& dW, const double& dH, const BOOL& bIsFromFileUse); + }; +} +#endif \ No newline at end of file diff --git a/ASCHTMLRenderer/IBaseMatrixUpdater.h b/ASCHTMLRenderer/IBaseMatrixUpdater.h new file mode 100644 index 0000000000..3a4d719c82 --- /dev/null +++ b/ASCHTMLRenderer/IBaseMatrixUpdater.h @@ -0,0 +1,13 @@ +#ifndef I_BASE_MATRIX_UPDATER +#define I_BASE_MATRIX_UPDATER + +namespace NSHtmlRenderer +{ + class IBaseMatrixUpdater + { + public: + virtual void OnBaseMatrixUpdate(const double& dWidth, const double& dHeight) = 0; + }; +} + +#endif \ No newline at end of file diff --git a/ASCHTMLRenderer/Writer/CanvasWriter.h b/ASCHTMLRenderer/Writer/CanvasWriter.h index 9ac07a6914..3ce9bf3435 100644 --- a/ASCHTMLRenderer/Writer/CanvasWriter.h +++ b/ASCHTMLRenderer/Writer/CanvasWriter.h @@ -76,7 +76,7 @@ namespace NSHtmlRenderer { if (_T("") != strFile) { - CDirectory::SaveToFile(strFile, m_oDocument.GetCString()); + NSFile::CFileBinary::SaveToFile(std::wstring(strFile.GetString()), std::wstring(m_oDocument.GetCString().GetString())); } m_oDocument.ClearNoAttack(); @@ -136,7 +136,7 @@ namespace NSHtmlRenderer strPath.Format(g_vml_string_CurveTo, round(x1), round(y1), round(x2), round(y2), round(x3), round(y3)); m_oPath.WriteString(strPath); } - void WriteDrawPath(LONG lType, CMatrix* pTransform, Graphics::IASCGraphicSimpleComverter* pConverter, LONG lTxId) + void WriteDrawPath(LONG lType, Aggplus::CMatrix* pTransform, Graphics::IASCGraphicSimpleComverter* pConverter, LONG lTxId) { bool bStroke = false; diff --git a/ASCHTMLRenderer/Writer/Common.h b/ASCHTMLRenderer/Writer/Common.h index 5ff85f40d2..27e82bfa8e 100644 --- a/ASCHTMLRenderer/Writer/Common.h +++ b/ASCHTMLRenderer/Writer/Common.h @@ -1,8 +1,49 @@ #pragma once -#include "../stdafx.h" +//#include "../stdafx.h" +#include "Const.h" namespace NSHtmlRenderer { + inline LONG ConvertColor(LONG lBGR) + { + return (0x00FFFFFF & (((lBGR & 0xFF) << 16) | (lBGR & 0x0000FF00) | ((lBGR >> 16) & 0xFF))); + } + inline CString GetStringColor(LONG lBGR) + { + BYTE R = (BYTE)(lBGR & 0xFF); + BYTE G = (BYTE)((lBGR >> 8) & 0xFF); + BYTE B = (BYTE)((lBGR >> 16) & 0xFF); + + CString strTemp = _T(""); + strTemp.Format(g_string_css_color, R, G, B); + + return strTemp; + } + inline CString SetStrokeColor(LONG lBGR, LONG lA) + { + BYTE R = (BYTE)(lBGR & 0xFF); + BYTE G = (BYTE)((lBGR >> 8) & 0xFF); + BYTE B = (BYTE)((lBGR >> 16) & 0xFF); + + CString strTemp = _T(""); + strTemp.Format(g_string_canvas_StrokeColorA, R, G, B, (double)lA / 255); + + return strTemp; + } + inline CString SetFillColor(LONG lBGR, LONG lA) + { + BYTE R = (BYTE)(lBGR & 0xFF); + BYTE G = (BYTE)((lBGR >> 8) & 0xFF); + BYTE B = (BYTE)((lBGR >> 16) & 0xFF); + + CString strTemp = _T(""); + strTemp.Format(g_string_canvas_FillColorA, R, G, B, (double)lA / 255); + + return strTemp; + } + + + static RECT GetImageBounds(MediaCore::IAVSUncompressedVideoFrame* pFrame) { BYTE* pBuffer = NULL; diff --git a/ASCHTMLRenderer/Writer/Document.h b/ASCHTMLRenderer/Writer/Document.h index 3c073cc1f3..b116fede29 100644 --- a/ASCHTMLRenderer/Writer/Document.h +++ b/ASCHTMLRenderer/Writer/Document.h @@ -1,14 +1,8 @@ #pragma once -#include "Writer\File.h" +#include "File.h" namespace NSHtmlRenderer { - class IBaseMatrixUpdater - { - public: - virtual void OnBaseMatrixUpdate(const double& dWidth, const double& dHeight) = 0; - }; - class CPageInfo { private: diff --git a/ASCHTMLRenderer/Writer/FontManager.h b/ASCHTMLRenderer/Writer/FontManager.h index 560631a1dd..c58c88b8c4 100644 --- a/ASCHTMLRenderer/Writer/FontManager.h +++ b/ASCHTMLRenderer/Writer/FontManager.h @@ -15,46 +15,6 @@ namespace NSHtmlRenderer const long g_lNewNoJustifySpace = 5; - inline LONG ConvertColor(LONG lBGR) - { - return (0x00FFFFFF & (((lBGR & 0xFF) << 16) | (lBGR & 0x0000FF00) | ((lBGR >> 16) & 0xFF))); - } - inline CString GetStringColor(LONG lBGR) - { - BYTE R = (BYTE)(lBGR & 0xFF); - BYTE G = (BYTE)((lBGR >> 8) & 0xFF); - BYTE B = (BYTE)((lBGR >> 16) & 0xFF); - - CString strTemp = _T(""); - strTemp.Format(g_string_css_color, R, G, B); - - return strTemp; - } - inline CString SetStrokeColor(LONG lBGR, LONG lA) - { - BYTE R = (BYTE)(lBGR & 0xFF); - BYTE G = (BYTE)((lBGR >> 8) & 0xFF); - BYTE B = (BYTE)((lBGR >> 16) & 0xFF); - - CString strTemp = _T(""); - strTemp.Format(g_string_canvas_StrokeColorA, R, G, B, (double)lA / 255); - - return strTemp; - } - inline CString SetFillColor(LONG lBGR, LONG lA) - { - BYTE R = (BYTE)(lBGR & 0xFF); - BYTE G = (BYTE)((lBGR >> 8) & 0xFF); - BYTE B = (BYTE)((lBGR >> 16) & 0xFF); - - CString strTemp = _T(""); - strTemp.Format(g_string_canvas_FillColorA, R, G, B, (double)lA / 255); - - return strTemp; - } - - - class CFontManager : public CFontManagerBase { public: diff --git a/ASCHTMLRenderer/Writer/SVGWriter.h b/ASCHTMLRenderer/Writer/SVGWriter.h index d03caafb96..6521a03373 100644 --- a/ASCHTMLRenderer/Writer/SVGWriter.h +++ b/ASCHTMLRenderer/Writer/SVGWriter.h @@ -1,6 +1,8 @@ #pragma once #include "..\stdafx.h" #include "StringWriter.h" +#include +#include namespace NSHtmlRenderer { @@ -316,10 +318,10 @@ namespace NSHtmlRenderer { m_oDocument.WriteString(g_svg_bstr_svgClose); //CDirectory::SaveToFile(strFile, m_oDocument.GetCString()); - CFile oFile; - oFile.CreateFile(strFile); + NSFile::CFileBinary oFile; + oFile.CreateFile(std::wstring(strFile.GetString())); CStringA strA(m_oDocument.GetBuffer(), (int)m_oDocument.GetCurSize()); - oFile.WriteFile(strA.GetBuffer(), strA.GetLength()); + oFile.WriteFile((BYTE*)strA.GetBuffer(), strA.GetLength()); } if (3000000 < m_oDocument.GetSize()) @@ -466,7 +468,7 @@ namespace NSHtmlRenderer m_oPath.AddIntNoCheck(round(y3)); m_oPath.AddSpaceNoCheck(); } - void WriteDrawPath(LONG nType, CMatrix* pTransform, Graphics::IASCGraphicSimpleComverter* pConverter, CImageInfo& oInfo, const double& dAngle) + void WriteDrawPath(LONG nType, Aggplus::CMatrix* pTransform, Aggplus::CGraphicsPathSimpleConverter* pConverter, CImageInfo& oInfo, const double& dAngle) { if (m_oPath.GetCurSize() < 3) return; @@ -528,7 +530,7 @@ namespace NSHtmlRenderer double r = 0; double b = 0; - pConverter->PathCommandGetBounds(&x, &y, &r, &b); + pConverter->PathCommandGetBounds(x, y, r, b); r += x; b += y; @@ -539,7 +541,7 @@ namespace NSHtmlRenderer } else { - NSHtmlRenderer::CMatrix oTemp = *pTransform; + Aggplus::CMatrix oTemp = *pTransform; double dCx = (x + r) / 2; double dCy = (y + b) / 2; diff --git a/ASCHTMLRenderer/Writer/StringWriter.h b/ASCHTMLRenderer/Writer/StringWriter.h index 81edc3bb3d..5df3172722 100644 --- a/ASCHTMLRenderer/Writer/StringWriter.h +++ b/ASCHTMLRenderer/Writer/StringWriter.h @@ -1,6 +1,5 @@ #pragma once -#include "..\stdafx.h" -#include "File.h" +#include "../../DesktopEditor/common/File.h" #include "TextItem.h" #include "Common.h" diff --git a/ASCHTMLRenderer/Writer/VMLWriter.h b/ASCHTMLRenderer/Writer/VMLWriter.h index 0259a9ab1b..fd11e56d2f 100644 --- a/ASCHTMLRenderer/Writer/VMLWriter.h +++ b/ASCHTMLRenderer/Writer/VMLWriter.h @@ -81,10 +81,10 @@ namespace NSHtmlRenderer { m_oDocument.WriteString(g_vml_bstr_document_end); //CDirectory::SaveToFile(strFile, m_oDocument.GetCString()); - CFile oFile; - oFile.CreateFile(strFile); + NSFile::CFileBinary oFile; + oFile.CreateFile(std::wstring(strFile.GetString())); CStringA strA(m_oDocument.GetBuffer(), (int)m_oDocument.GetCurSize()); - oFile.WriteFile(strA.GetBuffer(), strA.GetLength()); + oFile.WriteFile((BYTE*)strA.GetBuffer(), strA.GetLength()); } if (3000000 < m_oDocument.GetSize()) @@ -164,7 +164,7 @@ namespace NSHtmlRenderer strPath.Format(g_vml_string_CurveTo, round(x1), round(y1), round(x2), round(y2), round(x3), round(y3)); m_oPath.WriteString(strPath); } - void WriteDrawPath(LONG lType, CMatrix* pTransform, Graphics::IASCGraphicSimpleComverter* pConverter, CImageInfo& oInfo, const double& dAngle) + void WriteDrawPath(LONG lType, Aggplus::CMatrix* pTransform, Aggplus::CGraphicsPathSimpleConverter* pConverter, CImageInfo& oInfo, const double& dAngle) { if (m_oPath.GetCurSize() < 3) return; diff --git a/ASCHTMLRenderer/Writer/VectorGraphicsWriter2.h b/ASCHTMLRenderer/Writer/VectorGraphicsWriter2.h index ae400b3fe5..2d4b07f070 100644 --- a/ASCHTMLRenderer/Writer/VectorGraphicsWriter2.h +++ b/ASCHTMLRenderer/Writer/VectorGraphicsWriter2.h @@ -1,9 +1,10 @@ #pragma once -#include "Const.h" +//#include "Const.h" #include "SVGWriter.h" #include "VMLWriter.h" #include "CanvasWriter.h" +#include "../DesktopEditor/graphics/GraphicsPath.h" namespace NSHtmlRenderer { @@ -14,12 +15,12 @@ namespace NSHtmlRenderer CVMLWriter m_oVML; CCanvasWriter m_oCanvas; - Graphics::IASCGraphicSimpleComverter* m_pSimpleConverter; + Aggplus::CGraphicsPathSimpleConverter* m_pSimpleConverter; NSStructures::CPen* m_pPen; NSStructures::CBrush* m_pBrush; - CMatrix* m_pFullTransform; + Aggplus::CMatrix* m_pFullTransform; LONG m_lCurrentObjectInPage; @@ -37,7 +38,7 @@ namespace NSHtmlRenderer { } - void SetSettings(NSStructures::CPen* pPen, NSStructures::CBrush* pBrush, Graphics::IASCGraphicSimpleComverter* pSimpleConverter) + void SetSettings(NSStructures::CPen* pPen, NSStructures::CBrush* pBrush, Aggplus::CGraphicsPathSimpleConverter* pSimpleConverter) { m_pPen = pPen; m_pBrush = pBrush; @@ -117,7 +118,7 @@ namespace NSHtmlRenderer double y = 0; double r = 0; double b = 0; - m_pSimpleConverter->PathCommandGetBounds(&x, &y, &r, &b); + m_pSimpleConverter->PathCommandGetBounds(x, y, r, b); r += x; b += y; @@ -211,12 +212,12 @@ namespace NSHtmlRenderer { public: CSVGWriter m_oSVG; - Graphics::IASCGraphicSimpleComverter* m_pSimpleConverter; + Aggplus::CGraphicsPathSimpleConverter* m_pSimpleConverter; NSStructures::CPen* m_pPen; NSStructures::CBrush* m_pBrush; - CMatrix* m_pFullTransform; + Aggplus::CMatrix* m_pFullTransform; double m_dWidth; double m_dHeight; @@ -230,7 +231,7 @@ namespace NSHtmlRenderer { } - void SetSettings(NSStructures::CPen* pPen, NSStructures::CBrush* pBrush, Graphics::IASCGraphicSimpleComverter* pSimpleConverter) + void SetSettings(NSStructures::CPen* pPen, NSStructures::CBrush* pBrush, Aggplus::CGraphicsPathSimpleConverter* pSimpleConverter) { m_pPen = pPen; m_pBrush = pBrush; diff --git a/ASCHTMLRenderer/version.h b/ASCHTMLRenderer/version.h index a2ecc0fdda..87bf9e8804 100644 --- a/ASCHTMLRenderer/version.h +++ b/ASCHTMLRenderer/version.h @@ -2,6 +2,6 @@ //1 //0 //0 -//77 -#define INTVER 1,0,0,77 -#define STRVER "1,0,0,77\0" +//84 +#define INTVER 1,0,0,84 +#define STRVER "1,0,0,84\0" diff --git a/ASCImageStudio3/ASCGraphics/Objects/Image/Wmf/RendererOutput.h b/ASCImageStudio3/ASCGraphics/Objects/Image/Wmf/RendererOutput.h index 87045d75a3..b7fc734682 100644 --- a/ASCImageStudio3/ASCGraphics/Objects/Image/Wmf/RendererOutput.h +++ b/ASCImageStudio3/ASCGraphics/Objects/Image/Wmf/RendererOutput.h @@ -1,10 +1,17 @@ #ifndef _RENDERER_OUTPUT_H #define _RENDERER_OUTPUT_H +#ifdef DESKTOP_EDITOR_GRAPHICS +#include "../../../../../DesktopEditor/graphics/IRenderer.h" +#include "../../../../../DesktopEditor/graphics/structures.h" +#include "../../../../../DesktopEditor/graphics/Image.h" +#include "../../../../../DesktopEditor/raster/ImageFileFormatChecker.h" +#else #include "../../../stdafx.h" #include "..\..\..\Interfaces\ASCRenderer.h" #include "..\..\Structures.h" +#endif #include "WmfUtils.h" #include "WmfCharsets.h" @@ -28,8 +35,11 @@ class CRendererOutput : public CWmfOutputDevice { public: - +#ifdef DESKTOP_EDITOR_GRAPHICS + CRendererOutput(CWmfFile *pFile, IRenderer *pRenderer, double dX, double dY, double dWidth, double dHeight) +#else CRendererOutput(CWmfFile *pFile, IASCRenderer *pRenderer, double dX, double dY, double dWidth, double dHeight) +#endif { m_pWmfFile = pFile; @@ -47,9 +57,10 @@ public: return; m_pRenderer = pRenderer; - +#ifndef DESKTOP_EDITOR_GRAPHICS m_oShadow.Visible = FALSE; m_pRenderer->put_ShadowVisible(m_oShadow.Visible); +#endif /*BSTR bsShadow = m_oShadow.ToXmlString().AllocSysString(); m_pRenderer->SetShadow( bsShadow ); ::SysFreeString( bsShadow );*/ @@ -568,7 +579,16 @@ public: void Bmp_Draw(TWmfBMPDraw *pDrawBitmap) { TWmfDC *pDC = pDrawBitmap->pDC; - +#ifdef DESKTOP_EDITOR_GRAPHICS + USHORT nWidth = pDrawBitmap->oBitmap.ushWidth; + USHORT nHeight = pDrawBitmap->oBitmap.ushHeight; + int nBufferSize = 4 * nWidth * nHeight; + if ( nBufferSize < 1 ) + return; + Aggplus::CImage oImage; + BYTE* pBufferPtr = new BYTE[4 * nWidth * nHeight]; + oImage.Create(pBufferPtr, nWidth, nHeight, 4 * nWidth); +#else // create result interface IUnknown *pInterface = NULL; HRESULT hRes = CoCreateInstance( MediaCore::CLSID_CAVSUncompressedVideoFrame, NULL, CLSCTX_ALL, MediaCore::IID_IAVSUncompressedVideoFrame, (void**)&pInterface ); @@ -604,6 +624,7 @@ public: pInterface = pMediaData; +#endif // Пишем данные в pBufferPtr for ( int nIndex = 0; nIndex < 4 * nWidth * nHeight; nIndex += 4 ) @@ -623,7 +644,11 @@ public: Trans( pDC, &dX, &dY ); Trans( pDC, &dX1, &dY1 ); +#ifdef DESKTOP_EDITOR_GRAPHICS + m_pRenderer->DrawImage( &oImage, (float)dX, (float)dY, (float)(dX1 - dX), (float)(dY1 - dY)); +#else m_pRenderer->DrawImage( pInterface, (float)dX, (float)dY, (float)(dX1 - dX), (float)(dY1 - dY)); +#endif } void Bmp_Read(TWmfBMPRead *pReadBitmap) @@ -676,10 +701,19 @@ public: TWmfFont *pFont = pText->pDC->pFont; long lStyle = ( pFont->ushWeight > 550 ? 1 : 0 ) + ( pFont->unItalic ? 2 : 0 ); m_pWmfFile->m_pFontManager->LoadFontByName( A2W(pText->pDC->pFont->sFaceName), dSize, lStyle, 72, 72 ); +#ifdef DESKTOP_EDITOR_GRAPHICS + m_pWmfFile->m_pFontManager->LoadString2( A2W(pText->sText), 0, 0 ); + TBBox oBox = m_pWmfFile->m_pFontManager->MeasureString2(); + fL = oBox.fMinX; + fT = oBox.fMinY; + fW = oBox.fMaxX - oBox.fMinX; + fH = oBox.fMaxY - oBox.fMinY; + m_pWmfFile->m_pFontManager->GetUnderline( &fUndX1, &fUndY1, &fUndX2, &fUndY2, &fUndSize ); +#else m_pWmfFile->m_pFontManager->LoadStringW( A2W(pText->sText), 0, 0 ); m_pWmfFile->m_pFontManager->MeasureString2( &fL, &fT, &fW, &fH ); m_pWmfFile->m_pFontManager->GetUnderline( &fUndX1, &fUndY1, &fUndX2, &fUndY2, &fUndSize ); - +#endif double fKoef = 25.4 / 72; fL *= fKoef; @@ -1447,7 +1481,16 @@ private: { if ( NULL == pBrush->oBitmap.pData || 0 == pBrush->oBitmap.ushHeight || 0 == pBrush->oBitmap.ushWidth ) return false; - +#ifdef DESKTOP_EDITOR_GRAPHICS + USHORT nWidth = pBrush->oBitmap.ushWidth; + USHORT nHeight = pBrush->oBitmap.ushHeight; + int nBufferSize = 4 * nWidth * nHeight; + if ( nBufferSize < 1 ) + return false; + Aggplus::CImage oImage; + BYTE* pBufferPtr = new BYTE[4 * nWidth * nHeight]; + oImage.Create(pBufferPtr, nWidth, nHeight, 4 * nWidth); +#else // create result interface IUnknown *pInterface = NULL; HRESULT hRes = CoCreateInstance( MediaCore::CLSID_CAVSUncompressedVideoFrame, NULL, CLSCTX_ALL, MediaCore::IID_IAVSUncompressedVideoFrame, (void**)&pInterface ); @@ -1482,7 +1525,7 @@ private: return false; pInterface = pMediaData; - +#endif // Пишем данные в pBufferPtr for ( int nIndex = 0; nIndex < 4 * nWidth * nHeight; nIndex += 4 ) @@ -1498,16 +1541,22 @@ private: CString wsTempFileName; if ( !WmfOpenTempFile( &wsTempFileName, &pTempFile, _T("wb"), _T(".wmf0"), NULL ) ) { +#ifndef DESKTOP_EDITOR_GRAPHICS RELEASEINTERFACE( pInterface ); +#endif return false; } ::fclose( pTempFile ); +#ifdef DESKTOP_EDITOR_GRAPHICS + oImage.SaveFile(std::wstring(wsTempFileName.GetString()), _CXIMAGE_FORMAT_PNG); +#else BOOL bRet = ImageStudio::SaveImageAsPNG(pInterface, wsTempFileName); if (!bRet) return false; RELEASEINTERFACE( pInterface ); +#endif m_oBrush.TexturePath = wsTempFileName; m_oBrush.TextureMode = c_BrushTextureModeTile; @@ -1515,9 +1564,13 @@ private: m_pRenderer->put_BrushTextureMode( m_oBrush.Type ); m_pRenderer->put_BrushType( m_oBrush.Type ); +#ifdef DESKTOP_EDITOR_GRAPHICS + m_pRenderer->put_BrushTexturePath(m_oBrush.TexturePath); +#else BSTR bsTexture = m_oBrush.TexturePath.AllocSysString(); m_pRenderer->put_BrushTexturePath(bsTexture); ::SysFreeString(bsTexture); +#endif //m_oBrush.SetTexturePath( wsTempFileName ); //m_oBrush.SetTextureMode( 1 ); @@ -1667,7 +1720,8 @@ private: return false; // Читаем через ImageStudio - + //todo +#ifndef DESKTOP_EDITOR_GRAPHICS USES_CONVERSION; CStringW wsTempFileName = _T(""); FILE *pTempFile = NULL; @@ -1687,6 +1741,7 @@ private: //pTransform->GetResult( 0, &oVar ); ::_wunlink( wsTempFileName.GetBuffer() ); +#endif return false; @@ -1930,13 +1985,18 @@ private: } private: - +#ifdef DESKTOP_EDITOR_GRAPHICS + IRenderer *m_pRenderer; +#else IASCRenderer *m_pRenderer; +#endif NSStructures::CPen m_oPen; NSStructures::CBrush m_oBrush; +#ifndef DESKTOP_EDITOR_GRAPHICS NSStructures::CShadow m_oShadow; NSStructures::CEdgeText m_oEdgeText; +#endif NSStructures::CFont m_oFont; diff --git a/ASCImageStudio3/ASCGraphics/Objects/Image/Wmf/WmfFile.h b/ASCImageStudio3/ASCGraphics/Objects/Image/Wmf/WmfFile.h index fb825e66d3..752b4b66ad 100644 --- a/ASCImageStudio3/ASCGraphics/Objects/Image/Wmf/WmfFile.h +++ b/ASCImageStudio3/ASCGraphics/Objects/Image/Wmf/WmfFile.h @@ -9,9 +9,13 @@ #include "WmfRegion.h" #include "WmfOutputDevice.h" #include "WmfMemory.h" - +#ifdef DESKTOP_EDITOR_GRAPHICS +#include "../../../../../DesktopEditor/fontengine/FontManager.h" +#include "../../../../../DesktopEditor/fontengine/ApplicationFonts.h" +#else #include "..\..\ASCFontManager.h" #include "..\..\Font\FontUtils.h" +#endif #ifdef _DEBUG //#define DebugWriteXml @@ -57,6 +61,7 @@ public: pPlayer->ulFlags = 0; m_pFontManager = NULL; + bDeleteFontManager = false; } ~CWmfFile() @@ -66,15 +71,23 @@ public: if ( m_pBufferData ) delete m_pBufferData; - +#ifdef DESKTOP_EDITOR_GRAPHICS + if(bDeleteFontManager) + RELEASEOBJECT( m_pFontManager ); +#else RELEASEINTERFACE( m_pFontManager ); +#endif if ( m_pPlayerData ) { m_oMemoryManager.Free( m_pPlayerData ); } } +#ifdef DESKTOP_EDITOR_GRAPHICS + BOOL OpenFromFile(const wchar_t *wsFilePath) +#else BOOL OpenFromFile(wchar_t *wsFilePath) +#endif { if ( m_pBufferData ) delete m_pBufferData; @@ -102,7 +115,24 @@ public: return TRUE; } +#ifdef DESKTOP_EDITOR_GRAPHICS + void SetFontManager(CFontManager* pManager = NULL) + { + if (NULL == pManager) + { + RELEASEOBJECT(m_pFontManager); + m_pFontManager = new CFontManager(); + m_pFontManager->Initialize(); + bDeleteFontManager = true; + } + else + { + m_pFontManager = pManager; + } + } + inline CFontManager* GetFontManager() +#else void SetFontManager(IASCFontManager* pManager = NULL) { if (NULL == pManager) @@ -123,6 +153,7 @@ public: } inline IASCFontManager* GetFontManager() +#endif { return m_pFontManager; } @@ -3449,9 +3480,19 @@ private: float fTempX, fTempY, fTempW, fTempH; m_pFontManager->LoadFontByName( A2W(pPlayer->pDC->pFont->sFaceName), (float)(oDrawText.dFontHeight * 72 / 25.4), lStyle, 72.0f, 72.0f ); +#ifdef DESKTOP_EDITOR_GRAPHICS + m_pFontManager->LoadString2( A2W(oDrawText.sText), 0, 0 ); + + TBBox oBox = m_pFontManager->MeasureString2(); + fTempX = oBox.fMinX; + fTempY = oBox.fMinY; + fTempW = oBox.fMaxX - oBox.fMinX; + fTempH = oBox.fMaxX - oBox.fMinX; +#else m_pFontManager->LoadStringW( A2W(oDrawText.sText), 0, 0 ); m_pFontManager->MeasureString2( &fTempX, &fTempY, &fTempW, &fTempH ); +#endif fWidth = fTempW * 25.4f / 72.0f; } @@ -3900,8 +3941,14 @@ private: // В спецификации Wmf сказано, что значение DEFAULT_CHARSET может означать, что // шрифт ищется только по имени и размеру. +#ifdef DESKTOP_EDITOR_GRAPHICS + //todo + //if ( DEFAULT_CHARSET == pFont->unCharSet ) + // pFont->unCharSet = GetDefaultCharset( FALSE ); +#else if ( DEFAULT_CHARSET == pFont->unCharSet ) pFont->unCharSet = GetDefaultCharset( FALSE ); +#endif ushParam = Record_GetUShortPar( pRecord, 7 ); pFont->unOutPrecision = ushParam & 0xff; @@ -3954,7 +4001,17 @@ private: { unsigned long ulBit = 0; unsigned int unIndex = 0; - +#ifdef DESKTOP_EDITOR_GRAPHICS + //todo + //if ( UNKNOWN_CHARSET != pFont->unCharSet ) + //{ + // GetCodePageByCharset( pFont->unCharSet, &ulBit, &unIndex ); + // VARIANT_BOOL vbSuccess; + // m_pFontManager->IsUnicodeRangeAvailable( ulBit, unIndex, &vbSuccess ); + // if ( VARIANT_TRUE != vbSuccess ) + // bNeedFindByParams = TRUE; + //} +#else if ( UNKNOWN_CHARSET != pFont->unCharSet ) { GetCodePageByCharset( pFont->unCharSet, &ulBit, &unIndex ); @@ -3963,6 +4020,7 @@ private: if ( VARIANT_TRUE != vbSuccess ) bNeedFindByParams = TRUE; } +#endif } else bNeedFindByParams = TRUE; @@ -3971,6 +4029,33 @@ private: { USES_CONVERSION; ::SysFreeString( bsFontName ); +#ifdef DESKTOP_EDITOR_GRAPHICS + CFontSelectFormat oFontSelectFormat; + oFontSelectFormat.wsName = new std::wstring(A2W(pFont->sFaceName)); + oFontSelectFormat.unCharset = new BYTE; + *oFontSelectFormat.unCharset = pFont->unCharSet; + oFontSelectFormat.usWeight = new USHORT; + *oFontSelectFormat.usWeight = pFont->ushWeight; + + CFontInfo* pFontInfo = m_pFontManager->GetFontInfoByParams(oFontSelectFormat); + + long lStyle = ( pFontInfo->m_bBold ? 1 : 0 ) + ( pFontInfo->m_bItalic ? 2 : 0 ); + if ( NULL != pFontInfo && S_OK == m_pFontManager->LoadFontByName( pFontInfo->m_wsFontName, 11, lStyle, 96, 96 ) ) + { + free( pFont->sFaceName ); + char *sNewName = W2A( bsFontName ); + int nLen = (int)strlen( sNewName ); + pFont->sFaceName = (char*)m_oMemoryManager.Malloc( nLen + 1, _T("Meta_FontCreate function") ); + if ( !pFont->sFaceName ) + m_eError = wmf_error_NotEnoughMemory; + else + { + pFont->sFaceName[nLen] = '\0'; + memcpy( pFont->sFaceName, sNewName, nLen ); + } + } + ::SysFreeString( bsFontName ); +#else CString sXml; sXml.Format( _T(""), A2W(pFont->sFaceName), pFont->unCharSet, pFont->ushWeight); BSTR bsXml = sXml.AllocSysString(); @@ -4001,6 +4086,7 @@ private: } ::SysFreeString( bsPath ); +#endif } else { @@ -5371,7 +5457,12 @@ private: TWmfAttributeStore m_oStore; // Хранение Xml TWmfPlayer *m_pPlayerData; // Проигрыватель Wmf файла +#ifdef DESKTOP_EDITOR_GRAPHICS + CFontManager *m_pFontManager; // Интерефейс для работы с шрифтами + bool bDeleteFontManager; +#else IASCFontManager *m_pFontManager; // Интерефейс для работы с шрифтами +#endif CWmfColor m_oColorData; // Паллитра CWmfOutputDevice *m_pOutput; // Выходное устройство, для изображения данного метафайла diff --git a/ASCImageStudio3/ASCGraphics/Objects/Image/Wmf/WmfTypes.h b/ASCImageStudio3/ASCGraphics/Objects/Image/Wmf/WmfTypes.h index 16a4448bbc..20bc658f6e 100644 --- a/ASCImageStudio3/ASCGraphics/Objects/Image/Wmf/WmfTypes.h +++ b/ASCImageStudio3/ASCGraphics/Objects/Image/Wmf/WmfTypes.h @@ -1,6 +1,17 @@ #ifndef _WMF_TYPES_H_ #define _WMF_TYPES_H_ +#ifdef DESKTOP_EDITOR_GRAPHICS +// freetype +#include +#include FT_OUTLINE_H +//#include FT_SIZES_H +//#include FT_GLYPH_H +//#include FT_TRUETYPE_IDS_H +//#include FT_TRUETYPE_TABLES_H +//#include FT_XFREE86_H +//#include FT_ADVANCES_H +#endif //--------------------------------------------------------------------------------------------------- // Преобразование типов diff --git a/ASCOfficeDocxFile2/ASCOfficeDocxFile2.sln b/ASCOfficeDocxFile2/ASCOfficeDocxFile2.sln index 2f5977fd1a..c98a5e2e10 100644 --- a/ASCOfficeDocxFile2/ASCOfficeDocxFile2.sln +++ b/ASCOfficeDocxFile2/ASCOfficeDocxFile2.sln @@ -3,8 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 9.00 # Visual C++ Express 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeDocxFile2", "ASCOfficeDocxFile2.vcproj", "{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}" ProjectSection(ProjectDependencies) = postProject - {C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56} - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} + {DC24710E-8DF2-4A7A-B7C3-2313E294143C} = {DC24710E-8DF2-4A7A-B7C3-2313E294143C} {36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302} {A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0} EndProjectSection @@ -12,103 +11,656 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocxFormat", "..\Common\DocxFormat\Projects\DocxFormat2005.vcproj", "{A100103A-353E-45E8-A9B8-90B87CC5C0B0}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PPTXFormat", "..\ASCOfficePPTXFile\PPTXLib\PPTXFormat.vcproj", "{36636678-AE25-4BE6-9A34-2561D1BCF302}" + ProjectSection(ProjectDependencies) = postProject + {DC24710E-8DF2-4A7A-B7C3-2313E294143C} = {DC24710E-8DF2-4A7A-B7C3-2313E294143C} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "..\DesktopEditor\freetype-2.5.2\builds\windows\vc2005\freetype.vcproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "font_engine", "..\DesktopEditor\fontengine\font_engine_vs2005.vcproj", "{C739151F-5384-41DF-A1A6-F089E2C1AD56}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCHTMLRenderer", "..\ASCHTMLRenderer\ASCHTMLRendererLib.vcproj", "{DC24710E-8DF2-4A7A-B7C3-2313E294143C}" + ProjectSection(ProjectDependencies) = postProject + {818753F2-DBB9-4D3B-898A-A604309BE470} = {818753F2-DBB9-4D3B-898A-A604309BE470} + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81} = {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81} + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D} = {FFDA5DA1-BB65-4695-B678-BE59B4A1355D} + {BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36} + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD} = {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD} + {9A037A69-D1DF-4505-AB2A-6CB3641C476E} = {9A037A69-D1DF-4505-AB2A-6CB3641C476E} + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} + {40A69F40-063E-43FD-8543-455495D8733E} = {40A69F40-063E-43FD-8543-455495D8733E} + {0588563C-F05C-428C-B21A-DD74756628B3} = {0588563C-F05C-428C-B21A-DD74756628B3} + {DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169} + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239} = {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239} + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} + {C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56} + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7} = {43A0E60E-5C4A-4C09-A29B-7683F503BBD7} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "graphics", "..\DesktopEditor\graphics\graphics_vs2005.vcproj", "{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}" + ProjectSection(ProjectDependencies) = postProject + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD} = {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cximage", "..\DesktopEditor\cximage\CxImage\cximage_vs2005.vcproj", "{BC52A07C-A797-423D-8C4F-8678805BBB36}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jasper", "..\DesktopEditor\cximage\jasper\jasper_vs2005.vcproj", "{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jbig", "..\DesktopEditor\cximage\jbig\jbig_vs2005.vcproj", "{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mng", "..\DesktopEditor\cximage\mng\mng_vs2005.vcproj", "{40A69F40-063E-43FD-8543-455495D8733E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "png", "..\DesktopEditor\cximage\png\png_vs2005.vcproj", "{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\DesktopEditor\cximage\tiff\Tiff_vs2005.vcproj", "{0588563C-F05C-428C-B21A-DD74756628B3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "..\DesktopEditor\cximage\zlib\zlib_vs2005.vcproj", "{7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpeg", "..\DesktopEditor\cximage\jpeg\Jpeg_vs2005.vcproj", "{818753F2-DBB9-4D3B-898A-A604309BE470}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpsd", "..\DesktopEditor\cximage\libpsd\libpsd_vs2005.vcproj", "{9A037A69-D1DF-4505-AB2A-6CB3641C476E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdcr", "..\DesktopEditor\cximage\raw\libdcr_vs2005.vcproj", "{DF861D33-9BC1-418C-82B1-581F590FE169}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raster", "..\DesktopEditor\raster\raster_vs2005.vcproj", "{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "agg2d", "..\DesktopEditor\agg-2.4\agg_vs2005.vcproj", "{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug Multithreaded|Win32 = Debug Multithreaded|Win32 + Debug Multithreaded|x64 = Debug Multithreaded|x64 Debug Singlethreaded|Win32 = Debug Singlethreaded|Win32 + Debug Singlethreaded|x64 = Debug Singlethreaded|x64 Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Release Multithreaded|Win32 = Release Multithreaded|Win32 + Release Multithreaded|x64 = Release Multithreaded|x64 Release Singlethreaded|Win32 = Release Singlethreaded|Win32 + Release Singlethreaded|x64 = Release Singlethreaded|x64 Release|Win32 = Release|Win32 + Release|x64 = Release|x64 ReleaseASC|Win32 = ReleaseASC|Win32 + ReleaseASC|x64 = ReleaseASC|x64 ReleaseOpenSource|Win32 = ReleaseOpenSource|Win32 + ReleaseOpenSource|x64 = ReleaseOpenSource|x64 + Unicode Debug|Win32 = Unicode Debug|Win32 + Unicode Debug|x64 = Unicode Debug|x64 + Unicode Release|Win32 = Unicode Release|Win32 + Unicode Release|x64 = Unicode Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32 {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Debug Multithreaded|Win32.Build.0 = Debug|Win32 + {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32 {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Debug Singlethreaded|Win32.ActiveCfg = Debug|Win32 {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Debug Singlethreaded|Win32.Build.0 = Debug|Win32 + {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Debug Singlethreaded|x64.ActiveCfg = Debug|Win32 {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Debug|Win32.ActiveCfg = Debug|Win32 {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Debug|Win32.Build.0 = Debug|Win32 + {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Debug|x64.ActiveCfg = Debug|Win32 {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Release Multithreaded|Win32.ActiveCfg = ReleaseOpenSource|Win32 {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Release Multithreaded|Win32.Build.0 = ReleaseOpenSource|Win32 + {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Release Multithreaded|x64.ActiveCfg = ReleaseOpenSource|Win32 {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Release Singlethreaded|Win32.ActiveCfg = ReleaseOpenSource|Win32 {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Release Singlethreaded|Win32.Build.0 = ReleaseOpenSource|Win32 + {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Release Singlethreaded|x64.ActiveCfg = ReleaseOpenSource|Win32 {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Release|Win32.ActiveCfg = Release|Win32 {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Release|Win32.Build.0 = Release|Win32 + {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Release|x64.ActiveCfg = Release|Win32 {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.ReleaseASC|Win32.ActiveCfg = ReleaseASC|Win32 {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.ReleaseASC|Win32.Build.0 = ReleaseASC|Win32 + {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.ReleaseASC|x64.ActiveCfg = ReleaseASC|Win32 {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.ReleaseOpenSource|Win32.ActiveCfg = ReleaseOpenSource|Win32 {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.ReleaseOpenSource|Win32.Build.0 = ReleaseOpenSource|Win32 + {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.ReleaseOpenSource|x64.ActiveCfg = ReleaseOpenSource|Win32 + {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Unicode Debug|Win32.ActiveCfg = Debug|Win32 + {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Unicode Debug|Win32.Build.0 = Debug|Win32 + {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Unicode Debug|x64.ActiveCfg = Debug|Win32 + {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Unicode Release|Win32.ActiveCfg = Release|Win32 + {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Unicode Release|Win32.Build.0 = Release|Win32 + {D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Unicode Release|x64.ActiveCfg = Release|Win32 {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32 {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug Multithreaded|Win32.Build.0 = Debug|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32 {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug Singlethreaded|Win32.ActiveCfg = Debug|Win32 {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug Singlethreaded|Win32.Build.0 = Debug|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug Singlethreaded|x64.ActiveCfg = Debug|Win32 {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|Win32.ActiveCfg = Debug|Win32 {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|Win32.Build.0 = Debug|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|x64.ActiveCfg = Debug|Win32 {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release Multithreaded|Win32.ActiveCfg = ReleaseOpenSource|Win32 {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release Multithreaded|Win32.Build.0 = ReleaseOpenSource|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release Multithreaded|x64.ActiveCfg = ReleaseOpenSource|Win32 {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release Singlethreaded|Win32.ActiveCfg = ReleaseOpenSource|Win32 {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release Singlethreaded|Win32.Build.0 = ReleaseOpenSource|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release Singlethreaded|x64.ActiveCfg = ReleaseOpenSource|Win32 {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|Win32.ActiveCfg = Release|Win32 {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|Win32.Build.0 = Release|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|x64.ActiveCfg = Release|Win32 {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.ReleaseASC|Win32.ActiveCfg = Release|Win32 {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.ReleaseASC|Win32.Build.0 = Release|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.ReleaseASC|x64.ActiveCfg = ReleaseOpenSource|Win32 {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.ReleaseOpenSource|Win32.ActiveCfg = ReleaseOpenSource|Win32 {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.ReleaseOpenSource|Win32.Build.0 = ReleaseOpenSource|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.ReleaseOpenSource|x64.ActiveCfg = ReleaseOpenSource|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Unicode Debug|Win32.ActiveCfg = Debug|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Unicode Debug|Win32.Build.0 = Debug|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Unicode Debug|x64.ActiveCfg = Debug|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Unicode Release|Win32.ActiveCfg = Release|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Unicode Release|Win32.Build.0 = Release|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Unicode Release|x64.ActiveCfg = Release|Win32 {36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32 {36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug Multithreaded|Win32.Build.0 = Debug|Win32 + {36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32 {36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug Singlethreaded|Win32.ActiveCfg = Debug|Win32 {36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug Singlethreaded|Win32.Build.0 = Debug|Win32 + {36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug Singlethreaded|x64.ActiveCfg = Debug|Win32 {36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug|Win32.ActiveCfg = Debug|Win32 {36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug|Win32.Build.0 = Debug|Win32 + {36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug|x64.ActiveCfg = Debug|Win32 {36636678-AE25-4BE6-9A34-2561D1BCF302}.Release Multithreaded|Win32.ActiveCfg = Release|Win32 {36636678-AE25-4BE6-9A34-2561D1BCF302}.Release Multithreaded|Win32.Build.0 = Release|Win32 + {36636678-AE25-4BE6-9A34-2561D1BCF302}.Release Multithreaded|x64.ActiveCfg = Release|Win32 {36636678-AE25-4BE6-9A34-2561D1BCF302}.Release Singlethreaded|Win32.ActiveCfg = Release|Win32 {36636678-AE25-4BE6-9A34-2561D1BCF302}.Release Singlethreaded|Win32.Build.0 = Release|Win32 + {36636678-AE25-4BE6-9A34-2561D1BCF302}.Release Singlethreaded|x64.ActiveCfg = Release|Win32 {36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|Win32.ActiveCfg = Release|Win32 {36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|Win32.Build.0 = Release|Win32 + {36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|x64.ActiveCfg = Release|Win32 {36636678-AE25-4BE6-9A34-2561D1BCF302}.ReleaseASC|Win32.ActiveCfg = Release|Win32 {36636678-AE25-4BE6-9A34-2561D1BCF302}.ReleaseASC|Win32.Build.0 = Release|Win32 + {36636678-AE25-4BE6-9A34-2561D1BCF302}.ReleaseASC|x64.ActiveCfg = Release|Win32 {36636678-AE25-4BE6-9A34-2561D1BCF302}.ReleaseOpenSource|Win32.ActiveCfg = Release|Win32 {36636678-AE25-4BE6-9A34-2561D1BCF302}.ReleaseOpenSource|Win32.Build.0 = Release|Win32 + {36636678-AE25-4BE6-9A34-2561D1BCF302}.ReleaseOpenSource|x64.ActiveCfg = Release|Win32 + {36636678-AE25-4BE6-9A34-2561D1BCF302}.Unicode Debug|Win32.ActiveCfg = Debug|Win32 + {36636678-AE25-4BE6-9A34-2561D1BCF302}.Unicode Debug|Win32.Build.0 = Debug|Win32 + {36636678-AE25-4BE6-9A34-2561D1BCF302}.Unicode Debug|x64.ActiveCfg = Debug|Win32 + {36636678-AE25-4BE6-9A34-2561D1BCF302}.Unicode Release|Win32.ActiveCfg = Release|Win32 + {36636678-AE25-4BE6-9A34-2561D1BCF302}.Unicode Release|Win32.Build.0 = Release|Win32 + {36636678-AE25-4BE6-9A34-2561D1BCF302}.Unicode Release|x64.ActiveCfg = Release|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|Win32.ActiveCfg = Debug Multithreaded|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|Win32.Build.0 = Debug Multithreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|x64.ActiveCfg = Debug Multithreaded|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|Win32.ActiveCfg = Debug Singlethreaded|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|Win32.Build.0 = Debug Singlethreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|x64.ActiveCfg = Debug Singlethreaded|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.ActiveCfg = Debug|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.Build.0 = Debug|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.ActiveCfg = Debug|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded|Win32.ActiveCfg = Release Multithreaded|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded|Win32.Build.0 = Release Multithreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded|x64.ActiveCfg = Release Multithreaded|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded|Win32.ActiveCfg = Release Singlethreaded|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded|Win32.Build.0 = Release Singlethreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded|x64.ActiveCfg = Release Singlethreaded|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.ActiveCfg = Release|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.Build.0 = Release|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.ActiveCfg = Release|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.ReleaseASC|Win32.ActiveCfg = Release Singlethreaded|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.ReleaseASC|Win32.Build.0 = Release Singlethreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.ReleaseASC|x64.ActiveCfg = Release Singlethreaded|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.ReleaseOpenSource|Win32.ActiveCfg = Release Singlethreaded|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.ReleaseOpenSource|Win32.Build.0 = Release Singlethreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.ReleaseOpenSource|x64.ActiveCfg = Release Singlethreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Unicode Debug|Win32.ActiveCfg = Debug|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Unicode Debug|Win32.Build.0 = Debug|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Unicode Debug|x64.ActiveCfg = Debug|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Unicode Release|Win32.ActiveCfg = Release|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Unicode Release|Win32.Build.0 = Release|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Unicode Release|x64.ActiveCfg = Release|Win32 {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32 {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug Multithreaded|Win32.Build.0 = Debug|Win32 + {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32 {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug Singlethreaded|Win32.ActiveCfg = Debug|Win32 {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug Singlethreaded|Win32.Build.0 = Debug|Win32 + {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug Singlethreaded|x64.ActiveCfg = Debug|Win32 {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|Win32.ActiveCfg = Debug|Win32 {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|Win32.Build.0 = Debug|Win32 + {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|x64.ActiveCfg = Debug|Win32 {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release Multithreaded|Win32.ActiveCfg = Release|Win32 {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release Multithreaded|Win32.Build.0 = Release|Win32 + {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release Multithreaded|x64.ActiveCfg = Release|Win32 {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release Singlethreaded|Win32.ActiveCfg = Release|Win32 {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release Singlethreaded|Win32.Build.0 = Release|Win32 + {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release Singlethreaded|x64.ActiveCfg = Release|Win32 {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|Win32.ActiveCfg = Release|Win32 {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|Win32.Build.0 = Release|Win32 + {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|x64.ActiveCfg = Release|Win32 {C739151F-5384-41DF-A1A6-F089E2C1AD56}.ReleaseASC|Win32.ActiveCfg = Release|Win32 {C739151F-5384-41DF-A1A6-F089E2C1AD56}.ReleaseASC|Win32.Build.0 = Release|Win32 + {C739151F-5384-41DF-A1A6-F089E2C1AD56}.ReleaseASC|x64.ActiveCfg = Release|Win32 {C739151F-5384-41DF-A1A6-F089E2C1AD56}.ReleaseOpenSource|Win32.ActiveCfg = Release|Win32 {C739151F-5384-41DF-A1A6-F089E2C1AD56}.ReleaseOpenSource|Win32.Build.0 = Release|Win32 + {C739151F-5384-41DF-A1A6-F089E2C1AD56}.ReleaseOpenSource|x64.ActiveCfg = Release|Win32 + {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Unicode Debug|Win32.ActiveCfg = Debug|Win32 + {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Unicode Debug|Win32.Build.0 = Debug|Win32 + {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Unicode Debug|x64.ActiveCfg = Debug|Win32 + {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Unicode Release|Win32.ActiveCfg = Release|Win32 + {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Unicode Release|Win32.Build.0 = Release|Win32 + {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Unicode Release|x64.ActiveCfg = Release|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug Multithreaded|Win32.Build.0 = Debug|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug Singlethreaded|Win32.ActiveCfg = Debug|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug Singlethreaded|Win32.Build.0 = Debug|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug Singlethreaded|x64.ActiveCfg = Debug|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug|Win32.ActiveCfg = Debug|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug|Win32.Build.0 = Debug|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug|x64.ActiveCfg = Debug|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release Multithreaded|Win32.ActiveCfg = Release|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release Multithreaded|Win32.Build.0 = Release|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release Multithreaded|x64.ActiveCfg = Release|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release Singlethreaded|Win32.ActiveCfg = Release|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release Singlethreaded|Win32.Build.0 = Release|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release Singlethreaded|x64.ActiveCfg = Release|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release|Win32.ActiveCfg = Release|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release|Win32.Build.0 = Release|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release|x64.ActiveCfg = Release|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.ReleaseASC|Win32.ActiveCfg = Release|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.ReleaseASC|Win32.Build.0 = Release|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.ReleaseASC|x64.ActiveCfg = Release|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.ReleaseOpenSource|Win32.ActiveCfg = Release|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.ReleaseOpenSource|Win32.Build.0 = Release|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.ReleaseOpenSource|x64.ActiveCfg = Release|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Unicode Debug|Win32.ActiveCfg = Debug|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Unicode Debug|Win32.Build.0 = Debug|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Unicode Debug|x64.ActiveCfg = Debug|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Unicode Release|Win32.ActiveCfg = Release|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Unicode Release|Win32.Build.0 = Release|Win32 + {DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Unicode Release|x64.ActiveCfg = Release|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug Multithreaded|Win32.Build.0 = Debug|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug Singlethreaded|Win32.ActiveCfg = Debug|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug Singlethreaded|Win32.Build.0 = Debug|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug Singlethreaded|x64.ActiveCfg = Debug|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|Win32.ActiveCfg = Debug|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|Win32.Build.0 = Debug|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|x64.ActiveCfg = Debug|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release Multithreaded|Win32.ActiveCfg = Release|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release Multithreaded|Win32.Build.0 = Release|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release Multithreaded|x64.ActiveCfg = Release|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release Singlethreaded|Win32.ActiveCfg = Release|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release Singlethreaded|Win32.Build.0 = Release|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release Singlethreaded|x64.ActiveCfg = Release|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|Win32.ActiveCfg = Release|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|Win32.Build.0 = Release|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|x64.ActiveCfg = Release|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.ReleaseASC|Win32.ActiveCfg = Release|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.ReleaseASC|Win32.Build.0 = Release|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.ReleaseASC|x64.ActiveCfg = Release|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.ReleaseOpenSource|Win32.ActiveCfg = Release|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.ReleaseOpenSource|Win32.Build.0 = Release|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.ReleaseOpenSource|x64.ActiveCfg = Release|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Unicode Debug|Win32.ActiveCfg = Debug|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Unicode Debug|Win32.Build.0 = Debug|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Unicode Debug|x64.ActiveCfg = Debug|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Unicode Release|Win32.ActiveCfg = Release|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Unicode Release|Win32.Build.0 = Release|Win32 + {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Unicode Release|x64.ActiveCfg = Release|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug Multithreaded|Win32.Build.0 = Debug|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug Singlethreaded|Win32.ActiveCfg = Debug|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug Singlethreaded|Win32.Build.0 = Debug|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug Singlethreaded|x64.ActiveCfg = Debug|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug|Win32.ActiveCfg = Debug|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug|Win32.Build.0 = Debug|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug|x64.ActiveCfg = Debug|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Release Multithreaded|Win32.ActiveCfg = Release|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Release Multithreaded|Win32.Build.0 = Release|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Release Multithreaded|x64.ActiveCfg = Release|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Release Singlethreaded|Win32.ActiveCfg = Release|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Release Singlethreaded|Win32.Build.0 = Release|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Release Singlethreaded|x64.ActiveCfg = Release|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Release|Win32.ActiveCfg = Release|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Release|Win32.Build.0 = Release|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Release|x64.ActiveCfg = Release|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.ReleaseASC|Win32.ActiveCfg = Release|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.ReleaseASC|Win32.Build.0 = Release|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.ReleaseASC|x64.ActiveCfg = Release|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.ReleaseOpenSource|Win32.ActiveCfg = Release|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.ReleaseOpenSource|Win32.Build.0 = Release|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.ReleaseOpenSource|x64.ActiveCfg = Release|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Unicode Debug|x64.ActiveCfg = Unicode Debug|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 + {BC52A07C-A797-423D-8C4F-8678805BBB36}.Unicode Release|x64.ActiveCfg = Unicode Release|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug Multithreaded|Win32.Build.0 = Debug|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug Singlethreaded|Win32.ActiveCfg = Debug|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug Singlethreaded|Win32.Build.0 = Debug|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug Singlethreaded|x64.ActiveCfg = Debug|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug|Win32.ActiveCfg = Debug|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug|Win32.Build.0 = Debug|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug|x64.ActiveCfg = Debug|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release Multithreaded|Win32.ActiveCfg = Release|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release Multithreaded|Win32.Build.0 = Release|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release Multithreaded|x64.ActiveCfg = Release|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release Singlethreaded|Win32.ActiveCfg = Release|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release Singlethreaded|Win32.Build.0 = Release|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release Singlethreaded|x64.ActiveCfg = Release|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release|Win32.ActiveCfg = Release|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release|Win32.Build.0 = Release|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release|x64.ActiveCfg = Release|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.ReleaseASC|Win32.ActiveCfg = Release|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.ReleaseASC|Win32.Build.0 = Release|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.ReleaseASC|x64.ActiveCfg = Release|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.ReleaseOpenSource|Win32.ActiveCfg = Release|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.ReleaseOpenSource|Win32.Build.0 = Release|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.ReleaseOpenSource|x64.ActiveCfg = Release|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Unicode Debug|x64.ActiveCfg = Unicode Debug|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 + {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Unicode Release|x64.ActiveCfg = Unicode Release|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug Multithreaded|Win32.Build.0 = Debug|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug Singlethreaded|Win32.ActiveCfg = Debug|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug Singlethreaded|Win32.Build.0 = Debug|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug Singlethreaded|x64.ActiveCfg = Debug|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug|Win32.ActiveCfg = Debug|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug|Win32.Build.0 = Debug|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug|x64.ActiveCfg = Debug|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release Multithreaded|Win32.ActiveCfg = Release|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release Multithreaded|Win32.Build.0 = Release|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release Multithreaded|x64.ActiveCfg = Release|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release Singlethreaded|Win32.ActiveCfg = Release|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release Singlethreaded|Win32.Build.0 = Release|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release Singlethreaded|x64.ActiveCfg = Release|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release|Win32.ActiveCfg = Release|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release|Win32.Build.0 = Release|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release|x64.ActiveCfg = Release|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.ReleaseASC|Win32.ActiveCfg = Release|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.ReleaseASC|Win32.Build.0 = Release|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.ReleaseASC|x64.ActiveCfg = Release|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.ReleaseOpenSource|Win32.ActiveCfg = Release|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.ReleaseOpenSource|Win32.Build.0 = Release|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.ReleaseOpenSource|x64.ActiveCfg = Release|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Unicode Debug|x64.ActiveCfg = Unicode Debug|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 + {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Unicode Release|x64.ActiveCfg = Unicode Release|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Debug Multithreaded|Win32.Build.0 = Debug|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Debug Singlethreaded|Win32.ActiveCfg = Debug|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Debug Singlethreaded|Win32.Build.0 = Debug|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Debug Singlethreaded|x64.ActiveCfg = Debug|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Debug|Win32.ActiveCfg = Debug|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Debug|Win32.Build.0 = Debug|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Debug|x64.ActiveCfg = Debug|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Release Multithreaded|Win32.ActiveCfg = Release|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Release Multithreaded|Win32.Build.0 = Release|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Release Multithreaded|x64.ActiveCfg = Release|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Release Singlethreaded|Win32.ActiveCfg = Release|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Release Singlethreaded|Win32.Build.0 = Release|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Release Singlethreaded|x64.ActiveCfg = Release|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Release|Win32.ActiveCfg = Release|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Release|Win32.Build.0 = Release|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Release|x64.ActiveCfg = Release|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.ReleaseASC|Win32.ActiveCfg = Release|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.ReleaseASC|Win32.Build.0 = Release|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.ReleaseASC|x64.ActiveCfg = Release|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.ReleaseOpenSource|Win32.ActiveCfg = Release|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.ReleaseOpenSource|Win32.Build.0 = Release|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.ReleaseOpenSource|x64.ActiveCfg = Release|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Unicode Debug|x64.ActiveCfg = Unicode Debug|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 + {40A69F40-063E-43FD-8543-455495D8733E}.Unicode Release|x64.ActiveCfg = Unicode Release|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug Multithreaded|Win32.Build.0 = Debug|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug Singlethreaded|Win32.ActiveCfg = Debug|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug Singlethreaded|Win32.Build.0 = Debug|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug Singlethreaded|x64.ActiveCfg = Debug|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug|Win32.ActiveCfg = Debug|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug|Win32.Build.0 = Debug|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug|x64.ActiveCfg = Debug|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release Multithreaded|Win32.ActiveCfg = Release|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release Multithreaded|Win32.Build.0 = Release|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release Multithreaded|x64.ActiveCfg = Release|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release Singlethreaded|Win32.ActiveCfg = Release|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release Singlethreaded|Win32.Build.0 = Release|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release Singlethreaded|x64.ActiveCfg = Release|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release|Win32.ActiveCfg = Release|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release|Win32.Build.0 = Release|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release|x64.ActiveCfg = Release|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.ReleaseASC|Win32.ActiveCfg = Release|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.ReleaseASC|Win32.Build.0 = Release|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.ReleaseASC|x64.ActiveCfg = Release|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.ReleaseOpenSource|Win32.ActiveCfg = Release|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.ReleaseOpenSource|Win32.Build.0 = Release|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.ReleaseOpenSource|x64.ActiveCfg = Release|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Unicode Debug|x64.ActiveCfg = Unicode Debug|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 + {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Unicode Release|x64.ActiveCfg = Unicode Release|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Debug Multithreaded|Win32.Build.0 = Debug|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Debug Singlethreaded|Win32.ActiveCfg = Debug|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Debug Singlethreaded|Win32.Build.0 = Debug|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Debug Singlethreaded|x64.ActiveCfg = Debug|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Debug|Win32.ActiveCfg = Debug|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Debug|Win32.Build.0 = Debug|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Debug|x64.ActiveCfg = Debug|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Release Multithreaded|Win32.ActiveCfg = Release|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Release Multithreaded|Win32.Build.0 = Release|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Release Multithreaded|x64.ActiveCfg = Release|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Release Singlethreaded|Win32.ActiveCfg = Release|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Release Singlethreaded|Win32.Build.0 = Release|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Release Singlethreaded|x64.ActiveCfg = Release|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Release|Win32.ActiveCfg = Release|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Release|Win32.Build.0 = Release|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Release|x64.ActiveCfg = Release|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.ReleaseASC|Win32.ActiveCfg = Release|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.ReleaseASC|Win32.Build.0 = Release|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.ReleaseASC|x64.ActiveCfg = Release|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.ReleaseOpenSource|Win32.ActiveCfg = Release|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.ReleaseOpenSource|Win32.Build.0 = Release|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.ReleaseOpenSource|x64.ActiveCfg = Release|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Unicode Debug|x64.ActiveCfg = Unicode Debug|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 + {0588563C-F05C-428C-B21A-DD74756628B3}.Unicode Release|x64.ActiveCfg = Unicode Release|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Debug Multithreaded|Win32.Build.0 = Debug|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Debug Singlethreaded|Win32.ActiveCfg = Debug|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Debug Singlethreaded|Win32.Build.0 = Debug|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Debug Singlethreaded|x64.ActiveCfg = Debug|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Debug|Win32.ActiveCfg = Debug|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Debug|Win32.Build.0 = Debug|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Debug|x64.ActiveCfg = Debug|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Release Multithreaded|Win32.ActiveCfg = Release|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Release Multithreaded|Win32.Build.0 = Release|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Release Multithreaded|x64.ActiveCfg = Release|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Release Singlethreaded|Win32.ActiveCfg = Release|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Release Singlethreaded|Win32.Build.0 = Release|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Release Singlethreaded|x64.ActiveCfg = Release|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Release|Win32.ActiveCfg = Release|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Release|Win32.Build.0 = Release|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Release|x64.ActiveCfg = Release|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.ReleaseASC|Win32.ActiveCfg = Release|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.ReleaseASC|Win32.Build.0 = Release|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.ReleaseASC|x64.ActiveCfg = Release|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.ReleaseOpenSource|Win32.ActiveCfg = Release|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.ReleaseOpenSource|Win32.Build.0 = Release|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.ReleaseOpenSource|x64.ActiveCfg = Release|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Unicode Debug|x64.ActiveCfg = Unicode Debug|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 + {7B53D2C7-1B4A-4A53-A7D3-E25B92470B81}.Unicode Release|x64.ActiveCfg = Unicode Release|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Debug Multithreaded|Win32.Build.0 = Debug|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Debug Singlethreaded|Win32.ActiveCfg = Debug|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Debug Singlethreaded|Win32.Build.0 = Debug|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Debug Singlethreaded|x64.ActiveCfg = Debug|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Debug|Win32.ActiveCfg = Debug|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Debug|Win32.Build.0 = Debug|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Debug|x64.ActiveCfg = Debug|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Release Multithreaded|Win32.ActiveCfg = Release|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Release Multithreaded|Win32.Build.0 = Release|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Release Multithreaded|x64.ActiveCfg = Release|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Release Singlethreaded|Win32.ActiveCfg = Release|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Release Singlethreaded|Win32.Build.0 = Release|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Release Singlethreaded|x64.ActiveCfg = Release|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Release|Win32.ActiveCfg = Release|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Release|Win32.Build.0 = Release|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Release|x64.ActiveCfg = Release|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.ReleaseASC|Win32.ActiveCfg = Release|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.ReleaseASC|Win32.Build.0 = Release|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.ReleaseASC|x64.ActiveCfg = Release|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.ReleaseOpenSource|Win32.ActiveCfg = Release|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.ReleaseOpenSource|Win32.Build.0 = Release|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.ReleaseOpenSource|x64.ActiveCfg = Release|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Unicode Debug|x64.ActiveCfg = Unicode Debug|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 + {818753F2-DBB9-4D3B-898A-A604309BE470}.Unicode Release|x64.ActiveCfg = Unicode Release|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug Multithreaded|Win32.Build.0 = Debug|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug Singlethreaded|Win32.ActiveCfg = Debug|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug Singlethreaded|Win32.Build.0 = Debug|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug Singlethreaded|x64.ActiveCfg = Debug|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug|Win32.ActiveCfg = Debug|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug|Win32.Build.0 = Debug|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug|x64.ActiveCfg = Debug|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release Multithreaded|Win32.ActiveCfg = Release|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release Multithreaded|Win32.Build.0 = Release|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release Multithreaded|x64.ActiveCfg = Release|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release Singlethreaded|Win32.ActiveCfg = Release|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release Singlethreaded|Win32.Build.0 = Release|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release Singlethreaded|x64.ActiveCfg = Release|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release|Win32.ActiveCfg = Release|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release|Win32.Build.0 = Release|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release|x64.ActiveCfg = Release|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.ReleaseASC|Win32.ActiveCfg = Release|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.ReleaseASC|Win32.Build.0 = Release|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.ReleaseASC|x64.ActiveCfg = Release|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.ReleaseOpenSource|Win32.ActiveCfg = Release|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.ReleaseOpenSource|Win32.Build.0 = Release|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.ReleaseOpenSource|x64.ActiveCfg = Release|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Unicode Debug|x64.ActiveCfg = Unicode Debug|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 + {9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Unicode Release|x64.ActiveCfg = Unicode Release|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Debug Multithreaded|Win32.Build.0 = Debug|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Debug Singlethreaded|Win32.ActiveCfg = Debug|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Debug Singlethreaded|Win32.Build.0 = Debug|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Debug Singlethreaded|x64.ActiveCfg = Debug|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Debug|Win32.ActiveCfg = Debug|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Debug|Win32.Build.0 = Debug|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Debug|x64.ActiveCfg = Debug|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Release Multithreaded|Win32.ActiveCfg = Release|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Release Multithreaded|Win32.Build.0 = Release|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Release Multithreaded|x64.ActiveCfg = Release|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Release Singlethreaded|Win32.ActiveCfg = Release|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Release Singlethreaded|Win32.Build.0 = Release|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Release Singlethreaded|x64.ActiveCfg = Release|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Release|Win32.ActiveCfg = Release|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Release|Win32.Build.0 = Release|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Release|x64.ActiveCfg = Release|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.ReleaseASC|Win32.ActiveCfg = Release|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.ReleaseASC|Win32.Build.0 = Release|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.ReleaseASC|x64.ActiveCfg = Release|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.ReleaseOpenSource|Win32.ActiveCfg = Release|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.ReleaseOpenSource|Win32.Build.0 = Release|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.ReleaseOpenSource|x64.ActiveCfg = Release|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Unicode Debug|x64.ActiveCfg = Unicode Debug|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 + {DF861D33-9BC1-418C-82B1-581F590FE169}.Unicode Release|x64.ActiveCfg = Unicode Release|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug Multithreaded|Win32.Build.0 = Debug|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug Singlethreaded|Win32.ActiveCfg = Debug|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug Singlethreaded|Win32.Build.0 = Debug|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug Singlethreaded|x64.ActiveCfg = Debug|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug|Win32.ActiveCfg = Debug|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug|Win32.Build.0 = Debug|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug|x64.ActiveCfg = Debug|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release Multithreaded|Win32.ActiveCfg = Release|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release Multithreaded|Win32.Build.0 = Release|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release Multithreaded|x64.ActiveCfg = Release|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release Singlethreaded|Win32.ActiveCfg = Release|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release Singlethreaded|Win32.Build.0 = Release|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release Singlethreaded|x64.ActiveCfg = Release|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release|Win32.ActiveCfg = Release|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release|Win32.Build.0 = Release|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release|x64.ActiveCfg = Release|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.ReleaseASC|Win32.ActiveCfg = Release|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.ReleaseASC|Win32.Build.0 = Release|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.ReleaseASC|x64.ActiveCfg = Release|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.ReleaseOpenSource|Win32.ActiveCfg = Release|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.ReleaseOpenSource|Win32.Build.0 = Release|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.ReleaseOpenSource|x64.ActiveCfg = Release|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Unicode Debug|x64.ActiveCfg = Unicode Debug|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 + {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Unicode Release|x64.ActiveCfg = Unicode Release|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug Multithreaded|Win32.ActiveCfg = Debug|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug Multithreaded|Win32.Build.0 = Debug|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug Multithreaded|x64.ActiveCfg = Debug|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug Singlethreaded|Win32.ActiveCfg = Debug|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug Singlethreaded|Win32.Build.0 = Debug|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug Singlethreaded|x64.ActiveCfg = Debug|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug|Win32.ActiveCfg = Debug|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug|Win32.Build.0 = Debug|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug|x64.ActiveCfg = Debug|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release Multithreaded|Win32.ActiveCfg = Release|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release Multithreaded|Win32.Build.0 = Release|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release Multithreaded|x64.ActiveCfg = Release|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release Singlethreaded|Win32.ActiveCfg = Release|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release Singlethreaded|Win32.Build.0 = Release|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release Singlethreaded|x64.ActiveCfg = Release|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release|Win32.ActiveCfg = Release|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release|Win32.Build.0 = Release|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release|x64.ActiveCfg = Release|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.ReleaseASC|Win32.ActiveCfg = Release|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.ReleaseASC|Win32.Build.0 = Release|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.ReleaseASC|x64.ActiveCfg = Release|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.ReleaseOpenSource|Win32.ActiveCfg = Release|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.ReleaseOpenSource|Win32.Build.0 = Release|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.ReleaseOpenSource|x64.ActiveCfg = Release|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Unicode Debug|Win32.ActiveCfg = Debug|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Unicode Debug|Win32.Build.0 = Debug|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Unicode Debug|x64.ActiveCfg = Debug|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Unicode Release|Win32.ActiveCfg = Release|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Unicode Release|Win32.Build.0 = Release|Win32 + {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Unicode Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/ASCOfficeDocxFile2/BinWriter/BinEquationWriter.h b/ASCOfficeDocxFile2/BinWriter/BinEquationWriter.h index c5a887216a..92f5c3f4c4 100644 --- a/ASCOfficeDocxFile2/BinWriter/BinEquationWriter.h +++ b/ASCOfficeDocxFile2/BinWriter/BinEquationWriter.h @@ -173,11 +173,11 @@ namespace MathEquation { switch(uChar) { - case specialsymAlignment: str.Insert(0,0x0089); break; - case specialsymZeroSpace: str.Insert(0,0x200B); break; - case specialsymThinSpace: str.Insert(0,0x2009); break; break; - case specialsymThickSpace: str.Insert(0,0x2004); break; - case specialsymLargeSpace: str.Insert(0,0x2005); break; + case specialsymAlignment: str.Insert(0,0x0089); break; + case specialsymZeroSpace: str.Insert(0,0x200B); break; + case specialsymThinSpace: str.Insert(0,0x2009); break; break; + case specialsymThickSpace: str.Insert(0,0x2004); break; + case specialsymLargeSpace: str.Insert(0,0x2005); break; case specialsymOnePtSpace: str.Insert(0,0x2003); break; } } @@ -252,7 +252,7 @@ namespace MathEquation } virtual void BeginMatrix(uint8_t nVAlign, MMATRIXHORALIGN eHorAlign, MMATRIXVERALIGN eVerAlign, bool bEqualRows, bool bEqualCols, uint8_t nRows, uint8_t nCols, uint8_t* pVerBorders, uint8_t* pHorBorders) { - CMatrixCommand* pCommand = (CMatrixCommand*)PushCommand(commandMatrix); + CMatrixCommand* pCommand = (CMatrixCommand*)PushCommand(commandMatrix); pCommand->SetProps(nRows, nCols); int nCurPos = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::Matrix); @@ -412,7 +412,7 @@ namespace MathEquation int nCurPos1 = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::FPr); BYTE fracType; - switch(eType) + switch(eType) { case fractionRegular: fracType = SimpleTypes::fTypeBar; @@ -438,7 +438,7 @@ namespace MathEquation } virtual void BeginScript(MSCRIPTALIGN eAlign, bool bBase = false, bool bSup = false, bool bSub = false, bool bInline = true) { - CScriptCommand* pCommand = (CScriptCommand*)PushCommand(commandScript); + CScriptCommand* pCommand = (CScriptCommand*)PushCommand(commandScript); pCommand->SetProps(bInline, bBase, bSup, bSub); int nCurPos; @@ -514,7 +514,7 @@ namespace MathEquation WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::VertJc, vertJc); CString str; - switch(eType) + switch(eType) { case bartypeLine: str.Insert(0,0x0305);break; case bartypeDoubleLine: str.Insert(0,0x033F);break; @@ -560,7 +560,7 @@ namespace MathEquation WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::VertJc, vertJc); CString str; - switch(eType) + switch(eType) { case arrowtypeLeft: str.Insert(0,0x2190);break; case arrowtypeRight: str.Insert(0,0x2192);break; @@ -587,7 +587,7 @@ namespace MathEquation int nCurPos1 = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::NaryPr); CString str; - switch(eType) + switch(eType) { case integraltypeSingle: str.Insert(0,0x222B); @@ -789,7 +789,7 @@ namespace MathEquation } virtual void BeingNArray(MNARRAYTYPE eType) { - CNArrayCommand* pCommand = (CNArrayCommand*)PushCommand(commandNArray); + CNArrayCommand* pCommand = (CNArrayCommand*)PushCommand(commandNArray); pCommand->SetType(eType); int nCurPos = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::Nary); @@ -797,7 +797,7 @@ namespace MathEquation int nCurPos1 = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::NaryPr); CString str; - switch(eType) + switch(eType) { case narySumCSub: str.Insert(0,0x2211); @@ -956,8 +956,8 @@ namespace MathEquation } virtual void EndNArray () { - CNArrayCommand* pCommand = (CNArrayCommand*)TopCommand(); - MNARRAYTYPE eType = pCommand->GetType(); + CNArrayCommand* pCommand = (CNArrayCommand*)TopCommand(); + MNARRAYTYPE eType = pCommand->GetType(); PopCommand(); int nCurPos = m_aNArrayStack.top(); @@ -974,7 +974,7 @@ namespace MathEquation } virtual void BeginAngleBracketsWithSeparator(MANGLEBRACKETSWITHSEPARATORTYPE eType) { - CBracketsWithSeparatorCommand* pCommand = (CBracketsWithSeparatorCommand*)PushCommand(commandBracketsSep); + CBracketsWithSeparatorCommand* pCommand = (CBracketsWithSeparatorCommand*)PushCommand(commandBracketsSep); pCommand->SetType(eType); } virtual void EndAngleBracketsWithSeparator () @@ -982,13 +982,13 @@ namespace MathEquation PopCommand(); } - void AddFont(uint8_t nTypeFace, std::string sName, bool bBold, bool bItalic) - { - TMathFont aFont; - aFont.sName = sName; - aFont.bBold = bBold; - aFont.bItalic = bItalic; - m_mFonts[nTypeFace] = aFont; + void AddFont(uint8_t nTypeFace, std::string sName, bool bBold, bool bItalic) + { + TMathFont aFont; + aFont.sName = sName; + aFont.bBold = bBold; + aFont.bItalic = bItalic; + m_mFonts[nTypeFace] = aFont; } void WriteItemVal(BYTE name, BYTE val) { @@ -1855,7 +1855,7 @@ namespace MathEquation /*rRet += " "; rRet += sName; rRet += "=\""; - rRet += String::CreateFromInt32(nValue); + rRet += String::CreateFromInt32(nValue); rRet += "\"";*/ } diff --git a/ASCOfficeDocxFile2/DocWrapper/DocxSerializer.cpp b/ASCOfficeDocxFile2/DocWrapper/DocxSerializer.cpp index 4d79953b5e..5aeed98ea7 100644 --- a/ASCOfficeDocxFile2/DocWrapper/DocxSerializer.cpp +++ b/ASCOfficeDocxFile2/DocWrapper/DocxSerializer.cpp @@ -25,12 +25,13 @@ bool BinDocxRW::CDocxSerializer::saveToFile(CString& sSrcFileName, CString& sDst CString mediaDir = path.GetDirectory() + _T("media\\"); NSDirectory::CreateDirectory(string2std_string(mediaDir)); + DocWrapper::FontProcessor fp; + fp.setFontDir(m_sFontDir); NSBinPptxRW::CDrawingConverter oDrawingConverter; + oDrawingConverter.SetFontManager(fp.getFontManager2()); NSBinPptxRW::CBinaryFileWriter& oBufferedStream = *oDrawingConverter.m_pBinaryWriter; #ifdef _WIN32 - DocWrapper::FontProcessor fp; - fp.setFontDir(m_sFontDir); PPTXFile::IOfficeFontPicker* pFontPicker = NULL; CoCreateInstance(__uuidof(PPTXFile::COfficeFontPicker), NULL, CLSCTX_ALL, __uuidof(PPTXFile::IOfficeFontPicker), (void**)(&pFontPicker)); BSTR bstrFontDir1 = m_sFontDir.AllocSysString(); diff --git a/ASCOfficeDocxFile2/DocWrapper/FontProcessor.h b/ASCOfficeDocxFile2/DocWrapper/FontProcessor.h index 0fdfa381b4..dc1f584d82 100644 --- a/ASCOfficeDocxFile2/DocWrapper/FontProcessor.h +++ b/ASCOfficeDocxFile2/DocWrapper/FontProcessor.h @@ -47,6 +47,9 @@ namespace DocWrapper { ASCGraphics::IASCFontManager* getFontManager() { return fontManager; } + CFontManager* getFontManager2() { + return m_pFontManager; + } private: void initFontManager(); diff --git a/ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp b/ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp index 36f8b3f7c4..b857e85972 100644 --- a/ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp +++ b/ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp @@ -789,9 +789,7 @@ CDrawingConverter::CDrawingConverter() m_strFontDirectory = _T(""); m_lNextId = 1; m_lCurrentObjectTop = 0; -#ifdef AVS_USE_CONVERT_PPTX_TOCUSTOM_VML m_pOOXToVMLRenderer = NULL; -#endif m_bIsUseConvertion2007 = TRUE; m_pBinaryWriter = new NSBinPptxRW::CBinaryFileWriter(); m_pReader = new NSBinPptxRW::CBinaryFileReader(); @@ -802,10 +800,8 @@ CDrawingConverter::CDrawingConverter() } CDrawingConverter::~CDrawingConverter() { - Clear(); -#ifdef AVS_USE_CONVERT_PPTX_TOCUSTOM_VML - RELEASEINTERFACE(m_pOOXToVMLRenderer); -#endif + Clear(); + RELEASEOBJECT(m_pOOXToVMLRenderer); RELEASEOBJECT(m_pBinaryWriter); RELEASEOBJECT(m_pReader); RELEASEOBJECT(m_pImageManager); @@ -3175,10 +3171,8 @@ HRESULT CDrawingConverter::SaveObject(LONG lStart, LONG lLength, CString& bsMain #if defined(BUILD_CONFIG_FULL_VERSION) && defined(AVS_USE_CONVERT_PPTX_TOCUSTOM_VML) if (NULL == m_pOOXToVMLRenderer) - { - CoCreateInstance(__uuidof(CAVSOOXToVMLGeometry), NULL, CLSCTX_ALL, __uuidof(IASCRenderer), (void**)&m_pOOXToVMLRenderer); - } - m_pOOXToVMLRenderer->QueryInterface(__uuidof(IASCRenderer), (void**)(&(oXmlWriter.m_pOOXToVMLRenderer))); + m_pOOXToVMLRenderer = new COOXToVMLGeometry(); + oXmlWriter.m_pOOXToVMLRenderer = m_pOOXToVMLRenderer; #endif BOOL bIsNeedConvert2007 = FALSE; @@ -3910,4 +3904,9 @@ HRESULT CDrawingConverter::SetCurrentRelsPath() *m_pBinaryWriter->m_pCommonRels = pPair->m_value.smart_dynamic_cast(); return S_OK; +} +void CDrawingConverter::SetFontManager(CFontManager* pFontManager) +{ + if(NULL != m_pBinaryWriter && NULL != m_pBinaryWriter->m_pCommon && NULL != m_pBinaryWriter->m_pCommon->m_pImageManager) + m_pBinaryWriter->m_pCommon->m_pImageManager->SetFontManager(pFontManager); } \ No newline at end of file diff --git a/ASCOfficePPTXFile/ASCOfficeDrawingConverter.h b/ASCOfficePPTXFile/ASCOfficeDrawingConverter.h index fb6d2a4dd1..faaedbd109 100644 --- a/ASCOfficePPTXFile/ASCOfficeDrawingConverter.h +++ b/ASCOfficePPTXFile/ASCOfficeDrawingConverter.h @@ -7,9 +7,10 @@ #include "../Common/DocxFormat/Source/Base/Base.h" #include "../ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/PPTShape/PPTShapeEnum.h" -__interface IASCRenderer; +class IRenderer; class CShape; class CPPTShape; +class CFontManager; namespace XmlUtils { class CXmlNode; @@ -153,10 +154,7 @@ namespace NSBinPptxRW NSBinPptxRW::CImageManager2* m_pImageManager; NSBinPptxRW::CXmlWriter* m_pXmlWriter; int m_nCurrentIndexObject; - //todo -#ifdef AVS_USE_CONVERT_PPTX_TOCUSTOM_VML - IASCRenderer* m_pOOXToVMLRenderer; -#endif + IRenderer* m_pOOXToVMLRenderer; BOOL m_bIsUseConvertion2007; NSCommon::smart_ptr* m_pTheme; @@ -196,6 +194,8 @@ namespace NSBinPptxRW STDMETHOD(SetAdditionalParam)(CString& ParamName, VARIANT ParamValue); STDMETHOD(GetAdditionalParam)(CString& ParamName, VARIANT* ParamValue); + public: + void SetFontManager(CFontManager* pFontManager); protected: bool ParceObject(CString& strXml, CString** pMainProps); void SendMainProps(CString& strMainProps, CString**& pMainProps); diff --git a/ASCOfficePPTXFile/ASCOfficePPTXFile.h b/ASCOfficePPTXFile/ASCOfficePPTXFile.h index 14413452f1..80f5f454a6 100644 --- a/ASCOfficePPTXFile/ASCOfficePPTXFile.h +++ b/ASCOfficePPTXFile/ASCOfficePPTXFile.h @@ -12,7 +12,6 @@ typedef bool (*extract_to_directory)(void*, CString&, CString&); typedef bool (*compress_from_directory)(void*, CString&, CString&); typedef bool (*progress_operation)(void*, long, long); -class CGdiPlusInit; namespace PPTX { class Folder; @@ -35,7 +34,6 @@ private: CString m_strFolderThemes; - CGdiPlusInit* m_pInit; load_from_resource m_fCallbackResource; extract_to_directory m_fCallbackExtract; compress_from_directory m_fCallbackCompress; diff --git a/ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp b/ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp index c088ec50a8..88b5548aba 100644 --- a/ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp +++ b/ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp @@ -2,7 +2,6 @@ #include "ASCOfficePPTXFile.h" #include "PPTXFormat/PPTXEvent.h" -#include "../../../../Common/GdiPlusEx.h" #include #include @@ -39,13 +38,10 @@ CPPTXFile::CPPTXFile(load_from_resource fCallbackResource, extract_to_directory //if (S_OK != CoCreateInstance(__uuidof(OfficeUtils::COfficeUtils), NULL, CLSCTX_INPROC_SERVER, __uuidof(OfficeUtils::IOfficeUtils),(void**)&m_pOfficeUtils)) // return S_FALSE; - m_pInit = new CGdiPlusInit(); - m_pInit->Init(); } CPPTXFile::~CPPTXFile() { RELEASEOBJECT(m_pFolder); - RELEASEOBJECT(m_pInit); } HRESULT CPPTXFile::LoadFromFile(BSTR sSrcFileName, BSTR sDstPath, BSTR sXMLOptions) { diff --git a/ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.cpp b/ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.cpp index cfd7913792..4bd56afd7d 100644 --- a/ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.cpp +++ b/ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.cpp @@ -197,60 +197,32 @@ namespace NSBinPptxRW void CImageManager2::SaveImageAsPng(const CString& strFileSrc, const CString& strFileDst) { -#ifdef BUILD_CONFIG_FULL_VERSION - CString strLoadXml = _T(""); + NSFile::CFileBinary oFile; + if (!oFile.OpenFile(std::wstring(strFileSrc.GetString()))) + return; - ImageStudio::IImageTransforms* pTransform = NULL; - CoCreateInstance(ImageStudio::CLSID_ImageTransforms, NULL, CLSCTX_INPROC_SERVER, ImageStudio::IID_IImageTransforms, (void**)&pTransform); + CxImage img; - VARIANT_BOOL vbRes = VARIANT_FALSE; - BSTR bsLoad = strLoadXml.AllocSysString(); - pTransform->SetXml(bsLoad, &vbRes); - SysFreeString(bsLoad); - - pTransform->Transform(&vbRes); - RELEASEINTERFACE(pTransform); -#else - OfficeCore::IImageGdipFilePtr pImageFile; - pImageFile.CreateInstance(OfficeCore::CLSID_CImageGdipFile); - - BSTR bs1 = strFileSrc.AllocSysString(); - BSTR bs2 = strFileDst.AllocSysString(); - pImageFile->OpenFile(bs1); - pImageFile->SaveFile(bs2, 4); - SysFreeString(bs1); - SysFreeString(bs2); -#endif + if( img.Decode( oFile.GetFileNative(), 0 ) ) + { + img.Encode( oFile.GetFileNative(), _CXIMAGE_FORMAT_PNG ); + } + oFile.CloseFile(); } void CImageManager2::SaveImageAsJPG(const CString& strFileSrc, const CString& strFileDst) { -#ifdef BUILD_CONFIG_FULL_VERSION - CString strLoadXml = _T(""); + NSFile::CFileBinary oFile; + if (!oFile.OpenFile(std::wstring(strFileSrc.GetString()))) + return; - ImageStudio::IImageTransforms* pTransform = NULL; - CoCreateInstance(ImageStudio::CLSID_ImageTransforms, NULL, CLSCTX_INPROC_SERVER, ImageStudio::IID_IImageTransforms, (void**)&pTransform); + CxImage img; - VARIANT_BOOL vbRes = VARIANT_FALSE; - BSTR bsLoad = strLoadXml.AllocSysString(); - pTransform->SetXml(bsLoad, &vbRes); - SysFreeString(bsLoad); - - pTransform->Transform(&vbRes); - RELEASEINTERFACE(pTransform); -#else - OfficeCore::IImageGdipFilePtr pImageFile; - pImageFile.CreateInstance(OfficeCore::CLSID_CImageGdipFile); - - BSTR bs1 = strFileSrc.AllocSysString(); - BSTR bs2 = strFileDst.AllocSysString(); - pImageFile->OpenFile(bs1); - pImageFile->SaveFile(bs2, 3); - SysFreeString(bs1); - SysFreeString(bs2); -#endif + if( img.Decode( oFile.GetFileNative(), 0 ) ) + { + img.Encode( oFile.GetFileNative(), _CXIMAGE_FORMAT_JPG ); + } + oFile.CloseFile(); } bool CImageManager2::IsNeedDownload(const CString& strFile) diff --git a/ASCOfficePPTXFile/Editor/WMFToImageConverter.h b/ASCOfficePPTXFile/Editor/WMFToImageConverter.h index 4e4fb28fb3..e769e3ef71 100644 --- a/ASCOfficePPTXFile/Editor/WMFToImageConverter.h +++ b/ASCOfficePPTXFile/Editor/WMFToImageConverter.h @@ -1,5 +1,8 @@ #pragma once #include "../stdafx.h" +#include "../../DesktopEditor/graphics/IRenderer.h" +#include "../../ASCHTMLRenderer/ASCSVGWriter.h" +#include "../../ASCHTMLRenderer/CASCImage.h" #ifdef BUILD_CONFIG_FULL_VERSION @@ -8,20 +11,17 @@ namespace NSWMFToImageConverter class CImageExt { private: - IASCRenderer* m_pSVGRenderer; + NSHtmlRenderer::CASCSVGWriter* m_pSVGRenderer; void Init() { if (NULL != m_pSVGRenderer) { - VARIANT var; - var.vt = VT_I4; - var.lVal = 0; - m_pSVGRenderer->SetAdditionalParam(L"ReInit", var); + m_pSVGRenderer->ReInit(); } else { - CoCreateInstance( HtmlRenderer::CLSID_CASCSVGWriter, NULL, CLSCTX_ALL, __uuidof(IASCRenderer), (void**)(&m_pSVGRenderer) ); + m_pSVGRenderer = new NSHtmlRenderer::CASCSVGWriter(); } } @@ -32,7 +32,7 @@ namespace NSWMFToImageConverter } ~CImageExt() { - RELEASEINTERFACE(m_pSVGRenderer); + RELEASEOBJECT(m_pSVGRenderer); } public: @@ -90,7 +90,8 @@ namespace NSWMFToImageConverter return 0; } - void MetaDrawOnRenderer(IASCRenderer* pRenderer, BSTR strFile, double dW, double dH) + private: + void MetaDrawOnRenderer(IRenderer* pRenderer, BSTR strFile, double dW, double dH) { if (NULL == pRenderer) return; @@ -101,7 +102,7 @@ namespace NSWMFToImageConverter LONG brush_Color1 = 0; LONG brush_Color2 = 0; double brush_LinearAngle = 0; - BSTR brush_TexturePath = NULL; + std::wstring brush_TexturePath; LONG brush_TextureMode = 0; LONG brush_TextureAlpha = 0; LONG brush_Type = 0; @@ -116,8 +117,8 @@ namespace NSWMFToImageConverter pRenderer->get_BrushTexturePath( &brush_TexturePath ); pRenderer->get_BrushType( &brush_Type ); - BSTR font_Path = NULL; - BSTR font_Name = NULL; + std::wstring font_Path; + std::wstring font_Name; double font_Size = 0; LONG font_Style = 0; BOOL font_GID = 0; @@ -135,19 +136,17 @@ namespace NSWMFToImageConverter pRenderer->get_PenAlpha( &pen_Alpha ); pRenderer->get_PenColor( &pen_Color ); - ASCGraphics::IAVSImage *pImage = NULL; - CoCreateInstance( __uuidof(ASCGraphics::CAVSImage), NULL, CLSCTX_ALL, __uuidof(ASCGraphics::IAVSImage), (void**)(&pImage) ); + NSHtmlRenderer::CASCImage oASCImage; + oASCImage.put_FontManager(NULL); - pImage->put_FontManager(NULL); - - pImage->LoadFromFile( strFile ); + oASCImage.LoadFromFile( strFile ); if (dW <= 0 && dH <= 0) { LONG _lw = 0; LONG _lh = 0; - pImage->get_Width(&_lw); - pImage->get_Height(&_lh); + oASCImage.get_Width(&_lw); + oASCImage.get_Height(&_lh); LONG lMax = max(_lw, _lh); double dKoef = 1000.0 / lMax; @@ -159,9 +158,7 @@ namespace NSWMFToImageConverter m_pSVGRenderer->put_Height(dH); } - pImage->DrawOnRenderer( pRenderer, 0, 0, dW, dH ); - - RELEASEINTERFACE( pImage ); + oASCImage.DrawOnRenderer( pRenderer, 0, 0, dW, dH ); // Восстанавливаем параметры pRenderer->put_BrushAlpha1( brush_Alpha1 ); @@ -171,11 +168,11 @@ namespace NSWMFToImageConverter pRenderer->put_BrushLinearAngle( brush_LinearAngle ); pRenderer->put_BrushTextureMode( brush_TextureMode ); pRenderer->put_BrushTextureAlpha( brush_TextureAlpha ); - pRenderer->put_BrushTexturePath( brush_TexturePath ); if ( brush_TexturePath ) ::SysFreeString( brush_TexturePath ); + pRenderer->put_BrushTexturePath( brush_TexturePath ); pRenderer->put_BrushType( brush_Type ); - pRenderer->put_FontName( font_Name ); if ( font_Name ) ::SysFreeString( font_Name ); - pRenderer->put_FontPath( font_Path ); if ( font_Path ) ::SysFreeString( font_Path ); + pRenderer->put_FontName( font_Name ); + pRenderer->put_FontPath( font_Path ); pRenderer->put_FontSize( font_Size ); pRenderer->put_FontStyle( font_Style ); pRenderer->put_FontStringGID( font_GID ); @@ -187,7 +184,7 @@ namespace NSWMFToImageConverter // на всякий случай скидываем path pRenderer->PathCommandEnd(); } - + public: bool Convert(CString strPath, LONG lWidth, LONG lHeight, CString strDstPath) { Init(); @@ -199,16 +196,12 @@ namespace NSWMFToImageConverter MetaDrawOnRenderer(m_pSVGRenderer, bsFilePath, (double)lWidth, (double)lHeight); SysFreeString(bsFilePath); - VARIANT var; - m_pSVGRenderer->GetAdditionalParam(L"IsRaster", &var); - - if (VARIANT_TRUE == var.boolVal) + bool bIsRaster = false; + m_pSVGRenderer->IsRaster(&bIsRaster); + if (bIsRaster) return false; - var.vt = VT_BSTR; - var.bstrVal = strDstPath.AllocSysString(); - m_pSVGRenderer->SetAdditionalParam(L"SaveFile", var); - SysFreeString((var.bstrVal)); + m_pSVGRenderer->SaveFile(std::wstring(strDstPath.GetString())); return true; } diff --git a/ASCOfficePPTXFile/Editor/XmlWriter.h b/ASCOfficePPTXFile/Editor/XmlWriter.h index 8fbba2c4da..8904b2f772 100644 --- a/ASCOfficePPTXFile/Editor/XmlWriter.h +++ b/ASCOfficePPTXFile/Editor/XmlWriter.h @@ -1,6 +1,8 @@ #pragma once #include "../../Common/DocxFormat/Source/SystemUtility/File.h" #include "./BinReaderWriterDefines.h" +#include "../../DesktopEditor/graphics/IRenderer.h" +#include "../../ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/Common.h" namespace NSBinPptxRW { @@ -241,7 +243,7 @@ namespace NSBinPptxRW CString m_strStyleMain; CString m_strAttributesMain; CString m_strNodes; - IASCRenderer* m_pOOXToVMLRenderer; + IRenderer* m_pOOXToVMLRenderer; bool m_bIsTop; public: @@ -265,7 +267,6 @@ namespace NSBinPptxRW } ~CXmlWriter() { - RELEASEINTERFACE(m_pOOXToVMLRenderer); } AVSINLINE CString GetXmlString() diff --git a/ASCOfficePPTXFile/Editor/imagemanager.h b/ASCOfficePPTXFile/Editor/imagemanager.h index 3c3fa7d4ee..1cb1b34286 100644 --- a/ASCOfficePPTXFile/Editor/imagemanager.h +++ b/ASCOfficePPTXFile/Editor/imagemanager.h @@ -13,6 +13,9 @@ using namespace NSFontCutter; #include "../../ASCPresentationEditor/PPTXWriter/FileDownloader.h" #include "WMFToImageConverter.h" #include "../../Common/MediaFormatDefine.h" +#include "../../DesktopEditor/raster/ImageFileFormatChecker.h" +#include "../../DesktopEditor/raster/BgraFrame.h" +#include "../../DesktopEditor/graphics/Image.h" namespace NSShapeImageGen { @@ -210,11 +213,11 @@ namespace NSShapeImageGen } public: - CImageInfo WriteImage(IUnknown* punkImage, double& x, double& y, double& width, double& height) + CImageInfo WriteImage(CBgraFrame& punkImage, double& x, double& y, double& width, double& height) { CImageInfo info; - if (NULL == punkImage) - return info; + //if (NULL == punkImage) + // return info; if (height < 0) { @@ -274,190 +277,16 @@ namespace NSShapeImageGen return GenerateImageID(strFile, width, height); return GenerateImageID(strFile, max(1.0, width), max(1.0, height)); } - + void SetFontManager(CFontManager* pFontManager) + { + //todo + } protected: inline void CopyFile(CString& strFileSrc, CString& strFileDst) { _CopyFile(strFileSrc, strFileDst, NULL, NULL); } -#ifdef BUILD_CONFIG_OPENSOURCE_VERSION - static IUnknown* CreateEmptyImage(int nWidth, int nHeight, BOOL bFlipVertical = TRUE) - { - if (nWidth < 1 || nHeight < 1) - return NULL; - - MediaCore::IAVSUncompressedVideoFrame* pMediaData = NULL; - CoCreateInstance(MediaCore::CLSID_CAVSUncompressedVideoFrame, NULL, CLSCTX_ALL, MediaCore::IID_IAVSUncompressedVideoFrame, (void**)(&pMediaData)); - if (NULL == pMediaData) - return NULL; - - if (bFlipVertical) - pMediaData->put_ColorSpace(CSP_BGRA | CSP_VFLIP); - else - pMediaData->put_ColorSpace(CSP_BGRA); - - // specify settings - pMediaData->put_Width(nWidth); - pMediaData->put_Height(nHeight); - pMediaData->put_AspectRatioX(nWidth); - pMediaData->put_AspectRatioY(nHeight); - pMediaData->put_Interlaced(VARIANT_FALSE); - pMediaData->put_Stride(0, 4*nWidth); - pMediaData->AllocateBuffer(4*nWidth*nHeight); - - // allocate necesasry buffer - BYTE* pBufferPtr = 0; - long nCreatedBufferSize = 0; - pMediaData->get_Buffer(&pBufferPtr); - pMediaData->get_BufferSize(&nCreatedBufferSize); - pMediaData->put_Plane(0, pBufferPtr); - - // check for valid created buffer - if (!pBufferPtr || nCreatedBufferSize != 4*nWidth*nHeight) - { - RELEASEINTERFACE(pMediaData); - return NULL; - } - - // copy safearray's data to the buffer - memset(pBufferPtr, 0xFF, nCreatedBufferSize); - - // save interface - IUnknown* punkInterface = NULL; - pMediaData->QueryInterface(IID_IUnknown, (void**)&punkInterface); - - RELEASEINTERFACE(pMediaData); - return punkInterface; - } - - void SaveImage(CString& strFileSrc, CImageInfo& oInfo, LONG __width, LONG __height) - { - OfficeCore::IImageGdipFilePtr pImageFile; - pImageFile.CreateInstance(OfficeCore::CLSID_CImageGdipFile); - - BSTR bsSrc = strFileSrc.AllocSysString(); - pImageFile->OpenFile(bsSrc); - SysFreeString(bsSrc); - - IUnknown* punkFrame = NULL; - pImageFile->get_Frame(&punkFrame); - - if (NULL == punkFrame) - punkFrame = CreateEmptyImage(10, 10); - - MediaCore::IAVSUncompressedVideoFrame* pFrame = NULL; - punkFrame->QueryInterface(MediaCore::IID_IAVSUncompressedVideoFrame, (void**)&pFrame); - - RELEASEINTERFACE(punkFrame); - - LONG lWidth = 0; - LONG lHeight = 0; - pFrame->get_Width(&lWidth); - pFrame->get_Height(&lHeight); - - oInfo.m_eType = GetImageType(pFrame); - - RELEASEINTERFACE(pFrame); - - LONG lMaxSize = min(max(lWidth, lHeight), m_lMaxSizeImage); - - if ((lWidth > lMaxSize) || (lHeight > lMaxSize)) - { - LONG lW = 0; - LONG lH = 0; - double dAspect = (double)lWidth / lHeight; - - if (lWidth >= lHeight) - { - lW = lMaxSize; - lH = (LONG)((double)lW / dAspect); - } - else - { - lH = lMaxSize; - lW = (LONG)(dAspect * lH); - } - - pImageFile->Resize(lW, lH, 3); - } - - LONG lSaveType = 4; - CString strSaveItem = _T(""); - strSaveItem.Format(_T("\\image%d."), oInfo.m_lID); - if (itJPG == oInfo.m_eType) - { - strSaveItem = m_strDstMedia + strSaveItem + _T("jpg"); - lSaveType = 3; - } - else - { - strSaveItem = m_strDstMedia + strSaveItem + _T("png"); - } - BSTR bsDst = strSaveItem.AllocSysString(); - pImageFile->SaveFile(bsDst, lSaveType); - SysFreeString(bsDst); - } - void SaveImage(IUnknown* punkImage, CImageInfo& oInfo, LONG __width, LONG __height) - { - MediaCore::IAVSUncompressedVideoFrame* pFrame = NULL; - punkImage->QueryInterface(MediaCore::IID_IAVSUncompressedVideoFrame, (void**)&pFrame); - - if (NULL == pFrame) - return; - - LONG lWidth = 0; - LONG lHeight = 0; - pFrame->get_Width(&lWidth); - pFrame->get_Height(&lHeight); - - oInfo.m_eType = GetImageType(pFrame); - - RELEASEINTERFACE(pFrame); - - OfficeCore::IImageGdipFilePtr pImageFile; - pImageFile.CreateInstance(OfficeCore::CLSID_CImageGdipFile); - pImageFile->put_Frame(punkImage); - - LONG lMaxSize = min(max(lWidth, lHeight), m_lMaxSizeImage); - - if ((lWidth > lMaxSize) || (lHeight > lMaxSize)) - { - LONG lW = 0; - LONG lH = 0; - double dAspect = (double)lWidth / lHeight; - - if (lWidth >= lHeight) - { - lW = lMaxSize; - lH = (LONG)((double)lW / dAspect); - } - else - { - lH = lMaxSize; - lW = (LONG)(dAspect * lH); - } - - pImageFile->Resize(lW, lH, 3); - } - - LONG lSaveType = 4; - CString strSaveItem = _T(""); - strSaveItem.Format(_T("\\image%d."), oInfo.m_lID); - if (itJPG == oInfo.m_eType) - { - strSaveItem = m_strDstMedia + strSaveItem + _T("jpg"); - lSaveType = 3; - } - else - { - strSaveItem = m_strDstMedia + strSaveItem + _T("png"); - } - BSTR bsDst = strSaveItem.AllocSysString(); - pImageFile->SaveFile(bsDst, lSaveType); - SysFreeString(bsDst); - } -#else bool CheckImageSimpleCopy(CString& strFileSrc, CImageInfo& oInfo) { CFile oFile; @@ -504,68 +333,34 @@ namespace NSShapeImageGen if (CheckImageSimpleCopy(strFileSrc, oInfo)) return; - CString strLoadXml = _T(""); + CBgraFrame oBgraFrame; + oBgraFrame.OpenFile(std::wstring(strFileSrc.GetString())); - ImageStudio::IImageTransforms* pTransform = NULL; - CoCreateInstance(ImageStudio::CLSID_ImageTransforms, NULL, CLSCTX_INPROC_SERVER, ImageStudio::IID_IImageTransforms, (void**)&pTransform); + SaveImage(oBgraFrame, oInfo, __width, __height); + } + void SaveImage(CBgraFrame& oBgraFrame, CImageInfo& oInfo, LONG __width, LONG __height) + { + LONG lWidth = oBgraFrame.get_Width(); + LONG lHeight = oBgraFrame.get_Height(); - VARIANT_BOOL vbRes = VARIANT_FALSE; - BSTR bsLoad = strLoadXml.AllocSysString(); - pTransform->SetXml(bsLoad, &vbRes); - SysFreeString(bsLoad); - - pTransform->Transform(&vbRes); - - VARIANT var; - var.punkVal = NULL; - pTransform->GetResult(0, &var); - - if (NULL == var.punkVal) - { - RELEASEINTERFACE(pTransform); - return; - } - - MediaCore::IAVSUncompressedVideoFrame* pFrame = NULL; - var.punkVal->QueryInterface(MediaCore::IID_IAVSUncompressedVideoFrame, (void**)&pFrame); - - RELEASEINTERFACE((var.punkVal)); - - if (NULL == pFrame) - { - RELEASEINTERFACE(pTransform); - return; - } - - LONG lWidth = 0; - LONG lHeight = 0; - pFrame->get_Width(&lWidth); - pFrame->get_Height(&lHeight); - - oInfo.m_eType = GetImageType(pFrame); - - RELEASEINTERFACE(pFrame); + oInfo.m_eType = GetImageType(oBgraFrame); CString strSaveItem = _T(""); - strSaveItem.Format(_T("\\image%d."), oInfo.m_lID); + uint32_t nOutputFormat; if (itJPG == oInfo.m_eType) { - strSaveItem = _T(""); + strSaveItem.Format(_T("%s\\image%d.jpg"), m_strDstMedia, oInfo.m_lID); + nOutputFormat = _CXIMAGE_FORMAT_JPG; } else { - strSaveItem = _T(""); + strSaveItem.Format(_T("%s\\image%d.png"), m_strDstMedia, oInfo.m_lID); + nOutputFormat = _CXIMAGE_FORMAT_PNG; } - CString strXml = _T(""); - LONG lMaxSize = min(max(lWidth, lHeight), m_lMaxSizeImage); - if ((lWidth <= lMaxSize) && (lHeight <= lMaxSize)) - { - strXml = _T("") + strSaveItem + _T(""); - } - else + if (!((lWidth <= lMaxSize) && (lHeight <= lMaxSize))) { LONG lW = 0; LONG lH = 0; @@ -582,116 +377,23 @@ namespace NSShapeImageGen lW = (LONG)(dAspect * lH); } - CString strResize = _T(""); - strResize.Format(_T(""), lW, lH); - - strXml = _T("") + strResize + strSaveItem + _T(""); + oBgraFrame.Resize(lW, lH); } - - VARIANT_BOOL vbSuccess = VARIANT_FALSE; - BSTR bsXml = strXml.AllocSysString(); - pTransform->SetXml(bsXml, &vbSuccess); - SysFreeString(bsXml); - - pTransform->Transform(&vbSuccess); - - RELEASEINTERFACE(pTransform); + oBgraFrame.SaveFile(std::wstring(strSaveItem.GetString()), nOutputFormat); } - void SaveImage(IUnknown* punkImage, CImageInfo& oInfo, LONG __width, LONG __height) - { - MediaCore::IAVSUncompressedVideoFrame* pFrame = NULL; - punkImage->QueryInterface(MediaCore::IID_IAVSUncompressedVideoFrame, (void**)&pFrame); - if (NULL == pFrame) - return; - - LONG lWidth = 0; - LONG lHeight = 0; - pFrame->get_Width(&lWidth); - pFrame->get_Height(&lHeight); - - oInfo.m_eType = GetImageType(pFrame); - - RELEASEINTERFACE(pFrame); - - ImageStudio::IImageTransforms* pTransform = NULL; - CoCreateInstance(ImageStudio::CLSID_ImageTransforms, NULL ,CLSCTX_INPROC_SERVER, ImageStudio::IID_IImageTransforms, (void**)&pTransform); - - VARIANT var; - var.vt = VT_UNKNOWN; - var.punkVal = punkImage; - pTransform->SetSource(0, var); - - CString strSaveItem = _T(""); - strSaveItem.Format(_T("\\image%d."), oInfo.m_lID); - if (itJPG == oInfo.m_eType) - { - strSaveItem = _T(""); - } - else - { - strSaveItem = _T(""); - } - - LONG lMaxSize = min(max(__width, __height), m_lMaxSizeImage); - - CString strXml = _T(""); - if ((lWidth <= lMaxSize) && (lHeight <= lMaxSize)) - { - strXml = _T("") + strSaveItem + _T(""); - } - else - { - LONG lW = 0; - LONG lH = 0; - double dAspect = (double)lWidth / lHeight; - - if (lWidth >= lHeight) - { - lW = lMaxSize; - lH = (LONG)((double)lW / dAspect); - } - else - { - lH = lMaxSize; - lW = (LONG)(dAspect * lH); - } - - CString strResize = _T(""); - strResize.Format(_T(""), lW, lH); - - strXml = _T("") + strResize + strSaveItem + _T(""); - } - - VARIANT_BOOL vbSuccess = VARIANT_FALSE; - BSTR bsXml = strXml.AllocSysString(); - pTransform->SetXml(bsXml, &vbSuccess); - SysFreeString(bsXml); - - pTransform->Transform(&vbSuccess); - - RELEASEINTERFACE(pTransform); - } -#endif - - CImageInfo GenerateImageID(IUnknown* punkData, double dWidth, double dHeight) + CImageInfo GenerateImageID(CBgraFrame& punkData, double dWidth, double dHeight) { CImageInfo oInfo; - if (NULL == punkData) - return oInfo; + //if (NULL == punkData) + // return oInfo; LONG lWidth = (LONG)(dWidth * 96 / 25.4); LONG lHeight = (LONG)(dHeight * 96 / 25.4); - MediaCore::IAVSUncompressedVideoFrame* pFrame = NULL; - punkData->QueryInterface(MediaCore::IID_IAVSUncompressedVideoFrame, (void**)&pFrame); - - BYTE* pBuffer = NULL; - LONG lLen = 0; - - pFrame->get_Buffer(&pBuffer); - pFrame->get_BufferSize(&lLen); + BYTE* pBuffer = punkData.get_Data(); + LONG lLen = 4 * punkData.get_Width() * punkData.get_Height(); DWORD dwSum = m_oCRC.Calc(pBuffer, lLen); @@ -711,8 +413,6 @@ namespace NSShapeImageGen oInfo = pPair->m_value; } - RELEASEINTERFACE(pFrame); - return oInfo; } @@ -743,7 +443,7 @@ namespace NSShapeImageGen bool bIsSuccess = m_oExt.Convert(strFileName, LONG(dWidth * dKoef), LONG(dHeight * dKoef), strSaveItem + _T("svg")); if (bIsSuccess) { - if (itWMF == lImageType) + if (itWMF == oInfo.m_eType) { CDirectory::CopyFile(strFileName, strSaveItem + _T("wmf"), NULL, NULL); } @@ -758,8 +458,29 @@ namespace NSShapeImageGen } else { - --m_lNextIDImage; - oInfo.m_eType = itJPG; + //случай wmf/emf преобризованного в Bitmap или ошибки + NSHtmlRenderer::CASCImage oImage; + oImage.LoadFromFile(std::wstring(strFileName.GetString())); + Aggplus::CImage* pImage = oImage.get_BitmapImage(); + if(NULL != pImage) + { + CBgraFrame oBgraFrame; + oBgraFrame.put_Width(pImage->GetWidth()); + oBgraFrame.put_Height(pImage->GetHeight()); + oBgraFrame.put_Stride(pImage->GetStride()); + oBgraFrame.put_Data(pImage->GetData()); + SaveImage(oBgraFrame, oInfo, lWidth, lHeight); + //чтобы в деструкторе не удалялось + oBgraFrame.put_Data(NULL); + m_mapImagesFile.SetAt(strFileName, oInfo); + m_listImages.AddTail(oInfo); + return oInfo; + } + else + { + --m_lNextIDImage; + oInfo.m_eType = itJPG; + } } } #endif @@ -803,7 +524,7 @@ namespace NSShapeImageGen bool bIsSuccess = m_oExt.Convert(strFileName, LONG(dWidth * dKoef), LONG(dHeight * dKoef), strSaveItem + _T("svg")); if (bIsSuccess) { - if (itWMF == lImageType) + if (itWMF == oInfo.m_eType) { CDirectory::CopyFile(strFileName, strSaveItem + _T("wmf"), NULL, NULL); } @@ -834,18 +555,14 @@ namespace NSShapeImageGen return oInfo; } - ImageType GetImageType(MediaCore::IAVSUncompressedVideoFrame* pFrame) + ImageType GetImageType(CBgraFrame& pFrame) { if (2 == m_lDstFormat) return itJPG; - LONG lWidth = 0; - LONG lHeight = 0; - BYTE* pBuffer = NULL; - - pFrame->get_Width(&lWidth); - pFrame->get_Height(&lHeight); - pFrame->get_Buffer(&pBuffer); + LONG lWidth = pFrame.get_Width(); + LONG lHeight = pFrame.get_Height(); + BYTE* pBuffer = pFrame.get_Data(); BYTE* pBufferMem = pBuffer + 3; LONG lCountPix = lWidth * lHeight; @@ -857,36 +574,21 @@ namespace NSShapeImageGen } return itJPG; } - - void FlipY(IUnknown* punkImage) + void FlipY(CBgraFrame& punkImage) { - if (NULL == punkImage) - return; + //if (NULL == punkImage) + // return; - MediaCore::IAVSUncompressedVideoFrame* pFrame = NULL; - punkImage->QueryInterface(MediaCore::IID_IAVSUncompressedVideoFrame, (void**)&pFrame); - - if (NULL == pFrame) - return; - - BYTE* pBuffer = NULL; - LONG lWidth = 0; - LONG lHeight = 0; - LONG lStride = 0; - - pFrame->get_Buffer(&pBuffer); - pFrame->get_Width(&lWidth); - pFrame->get_Height(&lHeight); - pFrame->get_Stride(0, &lStride); + BYTE* pBuffer = punkImage.get_Data(); + LONG lWidth = punkImage.get_Width(); + LONG lHeight = punkImage.get_Height(); + LONG lStride = punkImage.get_Stride(); if (lStride < 0) lStride = -lStride; if ((lWidth * 4) != lStride) - { - RELEASEINTERFACE(pFrame); return; - } BYTE* pBufferMem = new BYTE[lStride]; @@ -905,36 +607,23 @@ namespace NSShapeImageGen } RELEASEARRAYOBJECTS(pBufferMem); - RELEASEINTERFACE(pFrame); } - void FlipX(IUnknown* punkImage) + void FlipX(CBgraFrame& punkImage) { - if (NULL == punkImage) - return; + //if (NULL == punkImage) + // return; - MediaCore::IAVSUncompressedVideoFrame* pFrame = NULL; - punkImage->QueryInterface(MediaCore::IID_IAVSUncompressedVideoFrame, (void**)&pFrame); - - if (NULL == pFrame) - return; - - BYTE* pBuffer = NULL; - LONG lWidth = 0; - LONG lHeight = 0; - LONG lStride = 0; - - pFrame->get_Buffer(&pBuffer); - pFrame->get_Width(&lWidth); - pFrame->get_Height(&lHeight); - pFrame->get_Stride(0, &lStride); + BYTE* pBuffer = punkImage.get_Data(); + LONG lWidth = punkImage.get_Width(); + LONG lHeight = punkImage.get_Height(); + LONG lStride = punkImage.get_Stride(); if (lStride < 0) lStride = -lStride; if ((lWidth * 4) != lStride) { - RELEASEINTERFACE(pFrame); return; } @@ -954,8 +643,6 @@ namespace NSShapeImageGen *pMem2-- = dwMem; } } - - RELEASEINTERFACE(pFrame); } }; } diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Geometry.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/Geometry.cpp index d80043c29a..d8044b92b9 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Geometry.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Geometry.cpp @@ -1,16 +1,17 @@ //#include "stdafx.h" -#ifdef AVS_USE_CONVERT_PPTX_TOCUSTOM_VML - #include "Geometry.h" #include "../../../ASCPresentationEditor/OfficeDrawing/Elements.h" +#include "../../../ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/Common.h" namespace PPTX { namespace Logic { - void Geometry::ConvertToCustomVML(IASCRenderer* pOOXToVMLRenderer, CString& strPath, CString& strRect, LONG& lWidth, LONG& lHeight) + void Geometry::ConvertToCustomVML(IRenderer* pOOXToVMLRenderer, CString& strPath, CString& strRect, LONG& lWidth, LONG& lHeight) { +#ifdef AVS_USE_CONVERT_PPTX_TOCUSTOM_VML + NSPresentationEditor::CShapeElement* lpShapeElement = NULL; if (this->is()) { @@ -56,9 +57,11 @@ namespace PPTX VARIANT var; var.vt = VT_I4; var.lVal = 0; - pOOXToVMLRenderer->SetAdditionalParam(L"NewShape", var); + COOXToVMLGeometry* pOOXToVMLGeometry = dynamic_cast(pOOXToVMLRenderer); + if(NULL != pOOXToVMLGeometry) + pOOXToVMLGeometry->NewShape(); - CGraphicPath oGrPath; + NSPresentationEditor::CGraphicPath oGrPath; CMetricInfo oMetricInfo; int nSize = oPath.m_arParts.GetSize(); @@ -75,9 +78,8 @@ namespace PPTX oGrPath.Draw(pOOXToVMLRenderer); } - - pOOXToVMLRenderer->GetAdditionalParam(L"ResultPath", &var); - strPath = (CString)var.bstrVal; + if(NULL != pOOXToVMLGeometry) + pOOXToVMLGeometry->ResultPath(&strPath); if (lpShapeElement->m_oShape.m_pShape->m_arTextRects.GetSize() <= 0) { @@ -103,7 +105,7 @@ namespace PPTX SysFreeString((var.bstrVal)); } +#endif } } -#endif \ No newline at end of file diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Geometry.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Geometry.h index 6d66200ddc..b3178cb05d 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Geometry.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Geometry.h @@ -340,9 +340,7 @@ namespace PPTX m_geometry->SetParentPointer(pParent); }; -#ifdef AVS_USE_CONVERT_PPTX_TOCUSTOM_VML - void ConvertToCustomVML(IASCRenderer* punkRenderer, CString& strPath, CString& strRect, LONG& lWidth, LONG& lHeight); -#endif + void ConvertToCustomVML(IRenderer* punkRenderer, CString& strPath, CString& strRect, LONG& lWidth, LONG& lHeight); }; } // namespace Logic } // namespace PPTX diff --git a/ASCOfficePPTXFile/PPTXLib/PPTXFormat.vcproj b/ASCOfficePPTXFile/PPTXLib/PPTXFormat.vcproj index 61e298e0cc..aa2a23fb66 100644 --- a/ASCOfficePPTXFile/PPTXLib/PPTXFormat.vcproj +++ b/ASCOfficePPTXFile/PPTXLib/PPTXFormat.vcproj @@ -41,8 +41,8 @@ - - @@ -194,10 +190,6 @@ RelativePath="..\..\Common\DocxFormat\Source\XML\libxml2\libxml2.h" > - - @@ -2890,14 +2882,34 @@ RelativePath="..\.\Editor\BinWriters.h" > + + + + + + + + + + diff --git a/ASCOfficePPTXFile/PPTXLib/stdafx.cpp b/ASCOfficePPTXFile/PPTXLib/stdafx.cpp deleted file mode 100644 index 75acf6adaa..0000000000 --- a/ASCOfficePPTXFile/PPTXLib/stdafx.cpp +++ /dev/null @@ -1,4 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" diff --git a/ASCOfficePPTXFile/PPTXLib/stdafx.h b/ASCOfficePPTXFile/PPTXLib/stdafx.h deleted file mode 100644 index f13219720e..0000000000 --- a/ASCOfficePPTXFile/PPTXLib/stdafx.h +++ /dev/null @@ -1,63 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, -// but are changed infrequently - -#pragma once -#define _CRT_SECURE_NO_DEPRECATE 1 -#define _CRT_NONSTDC_NO_DEPRECATE 1 - -#ifndef STRICT -#define STRICT -#endif - -// Modify the following defines if you have to target a platform prior to the ones specified below. -// Refer to MSDN for the latest info on corresponding values for different platforms. -#ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later. -#define WINVER 0x0501 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. -#endif - -#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later. -#define _WIN32_WINNT 0x0500 // Change this to the appropriate value to target Windows 2000 or later. -#endif - -#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. -#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. -#endif - -#ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later. -#define _WIN32_IE 0x0400 // Change this to the appropriate value to target IE 5.0 or later. -#endif - -#define _ATL_APARTMENT_THREADED -#define _ATL_NO_AUTOMATIC_NAMESPACE - -#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit - -// turns off ATL's hiding of some common and often safely ignored warning messages -#define _ATL_ALL_WARNINGS - -#include -#include -#include -#include -#include -#include -#include -#include "../../Common/atldefine.h" - -#define _USE_MATH_DEFINES -#include -#include - -#define NODOCX -#define PPTX_DEF - -#define PPT_DEF -#define ENABLE_PPT_TO_PPTX_CONVERT -#define _AVS_PPT_SHAPE_INCLUDE_ - -using namespace ATL; -#include "../../ASCImageStudio3/ASCGraphics/Interfaces/ASCRenderer.h" -#include "../../Common/Config.h" - -//#define AVS_USE_CONVERT_PPTX_TOCUSTOM_VML \ No newline at end of file diff --git a/ASCOfficePPTXFile/stdafx.h b/ASCOfficePPTXFile/stdafx.h index 1eda2e461d..fc7fb421c2 100644 --- a/ASCOfficePPTXFile/stdafx.h +++ b/ASCOfficePPTXFile/stdafx.h @@ -57,7 +57,7 @@ //#define _AVS_PPT_SHAPE_INCLUDE_ using namespace ATL; -#include "../ASCImageStudio3/ASCGraphics/Interfaces/ASCRenderer.h" +//#include "../ASCImageStudio3/ASCGraphics/Interfaces/ASCRenderer.h" #include "../Common/Config.h" #import "../Redist/ASCOfficeUtils.dll" named_guids raw_interfaces_only rename_namespace("OfficeUtils") @@ -86,11 +86,11 @@ namespace ASCGraphics //#define AVS_USE_CONVERT_PPTX_TOCUSTOM_VML -#import "../Redist/ASCMediaCore3.dll" named_guids raw_interfaces_only rename_namespace("MediaCore"), exclude("tagRECT") -#import "../Redist/ASCImageStudio3.dll" named_guids raw_interfaces_only rename_namespace("ImageStudio"), exclude("IASCRenderer") -#import "../Redist/ASCHTMLRenderer.dll" named_guids raw_interfaces_only rename_namespace("HtmlRenderer"), exclude("IASCRenderer") +//#import "../Redist/ASCMediaCore3.dll" named_guids raw_interfaces_only rename_namespace("MediaCore"), exclude("tagRECT") +//#import "../Redist/ASCImageStudio3.dll" named_guids raw_interfaces_only rename_namespace("ImageStudio"), exclude("IASCRenderer") +//#import "../Redist/ASCHTMLRenderer.dll" named_guids raw_interfaces_only rename_namespace("HtmlRenderer"), exclude("IASCRenderer") -#import "../Redist/ASCGraphics.dll" named_guids raw_interfaces_only rename_namespace("ASCGraphics"), exclude("IASCRenderer") +#import "../Redist/ASCGraphics.dll" named_guids raw_interfaces_only rename_namespace("ASCGraphics") #import "../Redist/ASCFontConverter.dll" named_guids raw_interfaces_only rename_namespace("Fonts") #endif \ No newline at end of file diff --git a/ASCPresentationEditor/OfficeDrawing/Attributes.h b/ASCPresentationEditor/OfficeDrawing/Attributes.h index 3c89866cc5..318d3bda2a 100644 --- a/ASCPresentationEditor/OfficeDrawing/Attributes.h +++ b/ASCPresentationEditor/OfficeDrawing/Attributes.h @@ -9,7 +9,8 @@ #include "Gdiplus.h" -#include "../../ASCImageStudio3/ASCGraphics/Interfaces/ASCRenderer.h" +#include "../../desktopeditor/graphics/IRenderer.h" +#include "../../desktopeditor/graphics/structures.h" namespace NSPresentationEditor { @@ -224,68 +225,6 @@ namespace NSPresentationEditor return str; } - - // pen ----------------------------------------------------------- - const long c_ag_LineCapFlat = 0; - const long c_ag_LineCapSquare = 1; - const long c_ag_LineCapTriangle = 3; - const long c_ag_LineCapNoAnchor = 16; - const long c_ag_LineCapSquareAnchor = 17; - const long c_ag_LineCapRoundAnchor = 18; - const long c_ag_LineCapDiamondAnchor = 19; - const long c_ag_LineCapArrowAnchor = 20; - const long c_ag_LineCapAnchorMask = 240; - const long c_ag_LineCapCustom = 255; - - const long c_ag_DashCapFlat = 0; - const long c_ag_DashCapRound = 2; - const long c_ag_DashCapTriangle = 3; - - const long c_ag_LineJoinMiter = 0; - const long c_ag_LineJoinBevel = 1; - const long c_ag_LineJoinRound = 2; - const long c_ag_LineJoinMiterClipped = 3; - - const long c_ag_PenAlignmentCenter = 0; - const long c_ag_PenAlignmentInset = 1; - const long c_ag_PenAlignmentOutset = 2; - const long c_ag_PenAlignmentLeft = 3; - const long c_ag_PenAlignmentRight = 4; - // -------------------------------------------------------------- - // brush -------------------------------------------------------- - // old constants for brush type - const long c_BrushTypeSolid_ = 0; - const long c_BrushTypeHorizontal_ = 1; - const long c_BrushTypeVertical_ = 2; - const long c_BrushTypeDiagonal1_ = 3; - const long c_BrushTypeDiagonal2_ = 4; - const long c_BrushTypeCenter_ = 5; - const long c_BrushTypePathGradient1_ = 6; - const long c_BrushTypePathGradient2_ = 7; - const long c_BrushTypeTexture_ = 8; - const long c_BrushTypeHatch1_ = 9; - const long c_BrushTypeHatch53_ = 61; - const long c_BrushTypeGradient1_ = 62; - const long c_BrushTypeGradient6_ = 70; - - const long c_BrushTypeSolid = 1000; - const long c_BrushTypeHorizontal = 2001; - const long c_BrushTypeVertical = 2002; - const long c_BrushTypeDiagonal1 = 2003; - const long c_BrushTypeDiagonal2 = 2004; - const long c_BrushTypeCenter = 2005; - const long c_BrushTypePathGradient1 = 2006; - const long c_BrushTypePathGradient2 = 2007; - const long c_BrushTypeCylinderHor = 2008; - const long c_BrushTypeCylinderVer = 2009; - const long c_BrushTypeTexture = 3008; - const long c_BrushTypeHatch1 = 4009; - const long c_BrushTypeHatch53 = 4061; - - const long c_BrushTextureModeStretch = 0; - const long c_BrushTextureModeTile = 1; - const long c_BrushTextureModeTileCenter = 2; - class CColor { public: @@ -528,7 +467,7 @@ namespace NSPresentationEditor (DashStyle == pPen->DashStyle) && (LineStartCap == pPen->LineStartCap) && (LineEndCap == pPen->LineEndCap) && (LineJoin == pPen->LineJoin)); } - void SetToRenderer(IASCRenderer *pRenderer) + void SetToRenderer(IRenderer *pRenderer) { if (-1 == Color.m_lSchemeIndex) pRenderer->put_PenColor(Color.GetLONG()); @@ -555,7 +494,7 @@ namespace NSPresentationEditor SAFEARRAY* pArray = SafeArrayCreate(VT_R8, 1, &rgsab); memcpy(pArray->pvData, DashPattern, Count * sizeof(double)); - pRenderer->PenDashPattern(pArray); + pRenderer->PenDashPattern(DashPattern, Count); RELEASEARRAY(pArray); pRenderer->put_PenDashOffset(DashOffset); @@ -844,7 +783,7 @@ namespace NSPresentationEditor (c_BrushTypeHatch1 <= Type && c_BrushTypeHatch53 >= Type)); } - void SetToRenderer(IASCRenderer *pRenderer) + void SetToRenderer(IRenderer *pRenderer) { Type = ConstantCompatible(Type); pRenderer->put_BrushType(Type); @@ -976,7 +915,7 @@ namespace NSPresentationEditor Underline = (byte)(0x7C & lStyle) >> 2; Strikeout = (byte)(0x0180 & lStyle) >> 7; } - void SetToRenderer(IASCRenderer *pRenderer) + void SetToRenderer(IRenderer *pRenderer) { BSTR bstrName = Name.AllocSysString(); pRenderer->put_FontName(bstrName); diff --git a/ASCPresentationEditor/OfficeDrawing/Elements.h b/ASCPresentationEditor/OfficeDrawing/Elements.h index eb3b1fa55c..92a89044b5 100644 --- a/ASCPresentationEditor/OfficeDrawing/Elements.h +++ b/ASCPresentationEditor/OfficeDrawing/Elements.h @@ -1,6 +1,7 @@ #pragma once #include "Theme.h" #include "Shapes\Shape.h" +#include "../../ASCHTMLRenderer/CASCSVGRenderer.h" #ifdef _PRESENTATION_WRITER_ #include "SVGConverter.h" @@ -554,26 +555,22 @@ namespace NSPresentationEditor #ifdef BUILD_CONFIG_OPENSOURCE_VERSION return _T(""); #else - ASCGraphics::IASCSVGRenderer* pSVG = NULL; - CoCreateInstance(ASCGraphics::CLSID_CASCSVGRenderer, NULL, CLSCTX_ALL, ASCGraphics::IID_IASCSVGRenderer, (void**)&pSVG); + NSHtmlRenderer::CASCSVGRenderer* pSVG = new NSHtmlRenderer::CASCSVGRenderer(); pSVG->put_Width(m_oMetric.m_lMillimetresHor); pSVG->put_Height(m_oMetric.m_lMillimetresVer); pSVG->CreateOfficeFile(L"", 0); - BSTR bsFileName = m_strFileName.AllocSysString(); - pSVG->DrawImageFromFile(bsFileName, m_rcBounds.left, m_rcBounds.top, m_rcBounds.right - m_rcBounds.left, m_rcBounds.bottom - m_rcBounds.top); - SysFreeString(bsFileName); + pSVG->DrawImageFromFile(std::wstring(m_strFileName.GetString()), m_rcBounds.left, m_rcBounds.top, m_rcBounds.right - m_rcBounds.left, m_rcBounds.bottom - m_rcBounds.top, 255); pSVG->CloseFile(0); - BSTR bsResult = NULL; + std::wstring bsResult; pSVG->get_Data(&bsResult); - CString strXml = (CString)bsResult; - SysFreeString(bsResult); - RELEASEINTERFACE(pSVG); + CString strXml = CString(bsResult.c_str()); + RELEASEOBJECT(pSVG); int nIndexStart = strXml.Find((TCHAR)'>'); int nIndexEnd = strXml.ReverseFind((TCHAR)'<'); @@ -966,8 +963,7 @@ namespace NSPresentationEditor CString strXml = _T(""); if (m_oShape.m_lDrawType & c_ShapeDrawType_Graphic) { - ASCGraphics::IASCSVGRenderer* pSVG = NULL; - CoCreateInstance(ASCGraphics::CLSID_CASCSVGRenderer, NULL, CLSCTX_ALL, ASCGraphics::IID_IASCSVGRenderer, (void**)&pSVG); + NSHtmlRenderer::CASCSVGRenderer* pSVG = new NSHtmlRenderer::CASCSVGRenderer(); pSVG->put_Width(m_oMetric.m_lMillimetresHor); pSVG->put_Height(m_oMetric.m_lMillimetresVer); @@ -987,17 +983,16 @@ namespace NSPresentationEditor //} //else { - m_oShape.ToRenderer((IASCRenderer*)pSVG, oInfo, m_oMetric, m_dStartTime, m_dEndTime); + m_oShape.ToRenderer((IRenderer*)pSVG, oInfo, m_oMetric, m_dStartTime, m_dEndTime); } pSVG->CloseFile(0); - BSTR bsResult = NULL; + std::wstring bsResult; pSVG->get_Data(&bsResult); - strXml = (CString)bsResult; - SysFreeString(bsResult); - RELEASEINTERFACE(pSVG); + strXml = CString(bsResult.c_str()); + RELEASEOBJECT(pSVG); int nIndexStart = strXml.Find((TCHAR)'>'); int nIndexEnd = strXml.ReverseFind((TCHAR)'<'); diff --git a/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/BaseShape.h b/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/BaseShape.h index 83c391aa36..85a1f0e530 100644 --- a/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/BaseShape.h +++ b/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/BaseShape.h @@ -78,7 +78,7 @@ namespace NSPresentationEditor virtual void ReCalculate() = 0; virtual CString ToXML(CGeomShapeInfo& GeomInfo, CMetricInfo& MetricInfo, double StartTime, double EndTime, CBrush& Brush, CPen& Pen) = 0; - virtual void ToRenderer(IASCRenderer* pRenderer, CGeomShapeInfo& pGeomInfo, double dStartTime, double dEndTime, CPen& pPen, CBrush& pFore, CMetricInfo& pInfo) + virtual void ToRenderer(IRenderer* pRenderer, CGeomShapeInfo& pGeomInfo, double dStartTime, double dEndTime, CPen& pPen, CBrush& pFore, CMetricInfo& pInfo) { m_oPath.ToRenderer(pRenderer, pGeomInfo, dStartTime, dEndTime, pPen, pFore, pInfo, GetClassType()); } diff --git a/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/Common.h b/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/Common.h index 1686725a70..7444ebec4d 100644 --- a/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/Common.h +++ b/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/Common.h @@ -3,8 +3,7 @@ #include #include #include "../../../../Common/atldefine.h" -#include "../../../../ASCImageStudio3/ASCGraphics/Interfaces/ASCRenderer.h" -#import "../../../../Redist/ASCGraphics.dll" named_guids raw_interfaces_only rename_namespace("ASCGraphics"), exclude("IASCRenderer") +#include "../../../../DesktopEditor/graphics/GraphicsPath.h" const double ShapeSize = 43200.0; const LONG ShapeSizeVML = 21600; @@ -390,15 +389,7 @@ namespace NSStringUtils #ifdef AVS_USE_CONVERT_PPTX_TOCUSTOM_VML -#include "../../../../ASCImageStudio3/ASCGraphics/Interfaces/ASCRenderer.h" - -#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA) -#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms." -#endif - -// CAVSOOXToVMLGeometry -[ coclass, default(IASCRenderer), threading(apartment), vi_progid("AVSPPTX.VMLShape"), progid("AVSPPTX.VMLShape.1"), version(1.0), uuid("3266F3E4-B6AB-4440-BC58-F38E78BBCCBD") ] -class ATL_NO_VTABLE CAVSOOXToVMLGeometry : public IASCRenderer +class COOXToVMLGeometry : public IRenderer { private: class _CStringWriter @@ -544,136 +535,129 @@ private: } }; -public: - DECLARE_PROTECT_FINAL_CONSTRUCT() - - CAVSOOXToVMLGeometry() - { - } - ~CAVSOOXToVMLGeometry() - { - } public: - // ------------------------------------ renderer -------------------------------------------- - STDMETHOD(get_Type)(LONG* lType) { return S_OK; } - //-------- Функции для работы со страницей -------------------------------------------------- - STDMETHOD(NewPage)() { return S_OK; } - STDMETHOD(get_Height)(double* dHeight) { return S_OK; } - STDMETHOD(put_Height)(double dHeight) + COOXToVMLGeometry() + { + m_bIsFillPart = FALSE; + m_bIsStrokePart = FALSE; + + m_dScaleX = 1.0; + m_dScaleY = 1.0; + + m_pSimpleGraphicsConverter = new Aggplus::CGraphicsPathSimpleConverter(); + m_pSimpleGraphicsConverter->SetRenderer(this); + + m_lCountPathCommands = 0; + } + ~COOXToVMLGeometry() + { + RELEASEOBJECT(m_pSimpleGraphicsConverter); + } +// тип рендерера----------------------------------------------------------------------------- + virtual HRESULT get_Type(LONG* lType){ return S_OK; } +//-------- Функции для работы со страницей -------------------------------------------------- + virtual HRESULT NewPage(){ return S_OK; } + virtual HRESULT get_Height(double* dHeight){ return S_OK; } + virtual HRESULT put_Height(const double& dHeight) { m_dScaleY = dHeight; - return S_OK; + return S_OK; } - STDMETHOD(get_Width)(double* dWidth) { return S_OK; } - STDMETHOD(put_Width)(double dWidth) + virtual HRESULT get_Width(double* dWidth){ return S_OK; } + virtual HRESULT put_Width(const double& dWidth) { m_dScaleX = dWidth; return S_OK; } + virtual HRESULT get_DpiX(double* dDpiX){ return S_OK; } + virtual HRESULT get_DpiY(double* dDpiY){ return S_OK; } - STDMETHOD(get_DpiX)(double* dDpiX) { return S_OK; } - STDMETHOD(get_DpiY)(double* dDpiY) { return S_OK; } // pen -------------------------------------------------------------------------------------- - STDMETHOD(SetPen)(BSTR bsXML) { return S_OK; } - STDMETHOD(get_PenColor)(LONG* lColor) { return S_OK; } - STDMETHOD(put_PenColor)(LONG lColor) { return S_OK; } - STDMETHOD(get_PenAlpha)(LONG* lAlpha) { return S_OK; } - STDMETHOD(put_PenAlpha)(LONG lAlpha) + virtual HRESULT get_PenColor(LONG* lColor){ return S_OK; } + virtual HRESULT put_PenColor(const LONG& lColor){ return S_OK; } + virtual HRESULT get_PenAlpha(LONG* lAlpha){ return S_OK; } + virtual HRESULT put_PenAlpha(const LONG& lAlpha) { m_bIsStrokePart = (0 != lAlpha) ? TRUE : FALSE; return S_OK; } - STDMETHOD(get_PenSize)(double* dSize) { return S_OK; } - STDMETHOD(put_PenSize)(double dSize) { return S_OK; } - STDMETHOD(get_PenDashStyle)(BYTE* val) { return S_OK; } - STDMETHOD(put_PenDashStyle)(BYTE val) { return S_OK; } - STDMETHOD(get_PenLineStartCap)(BYTE* val) { return S_OK; } - STDMETHOD(put_PenLineStartCap)(BYTE val) { return S_OK; } - STDMETHOD(get_PenLineEndCap)(BYTE* val) { return S_OK; } - STDMETHOD(put_PenLineEndCap)(BYTE val) { return S_OK; } - STDMETHOD(get_PenLineJoin)(BYTE* val) { return S_OK; } - STDMETHOD(put_PenLineJoin)(BYTE val) { return S_OK; } - STDMETHOD(get_PenDashOffset)(double* val) { return S_OK; } - STDMETHOD(put_PenDashOffset)(double val) { return S_OK; } - STDMETHOD(get_PenAlign)(LONG* val) { return S_OK; } - STDMETHOD(put_PenAlign)(LONG val) { return S_OK; } - STDMETHOD(get_PenMiterLimit)(double* val) { return S_OK; } - STDMETHOD(put_PenMiterLimit)(double val) { return S_OK; } - STDMETHOD(PenDashPattern)(SAFEARRAY* pPattern) { return S_OK; } + virtual HRESULT get_PenSize(double* dSize){ return S_OK; } + virtual HRESULT put_PenSize(const double& dSize){ return S_OK; } + virtual HRESULT get_PenDashStyle(BYTE* val){ return S_OK; } + virtual HRESULT put_PenDashStyle(const BYTE& val){ return S_OK; } + virtual HRESULT get_PenLineStartCap(BYTE* val){ return S_OK; } + virtual HRESULT put_PenLineStartCap(const BYTE& val){ return S_OK; } + virtual HRESULT get_PenLineEndCap(BYTE* val){ return S_OK; } + virtual HRESULT put_PenLineEndCap(const BYTE& val){ return S_OK; } + virtual HRESULT get_PenLineJoin(BYTE* val){ return S_OK; } + virtual HRESULT put_PenLineJoin(const BYTE& val){ return S_OK; } + virtual HRESULT get_PenDashOffset(double* dOffset){ return S_OK; } + virtual HRESULT put_PenDashOffset(const double& dOffset){ return S_OK; } + virtual HRESULT get_PenAlign(LONG* lAlign){ return S_OK; } + virtual HRESULT put_PenAlign(const LONG& lAlign){ return S_OK; } + virtual HRESULT get_PenMiterLimit(double* dOffset){ return S_OK; } + virtual HRESULT put_PenMiterLimit(const double& dOffset){ return S_OK; } + virtual HRESULT PenDashPattern(double* pPattern, LONG lCount){ return S_OK; } + // brush ------------------------------------------------------------------------------------ - STDMETHOD(SetBrush)(BSTR bsXML) { return S_OK; } - STDMETHOD(get_BrushType)(LONG* lType) { return S_OK; } - STDMETHOD(put_BrushType)(LONG lType) { return S_OK; } - STDMETHOD(get_BrushColor1)(LONG* lColor) { return S_OK; } - STDMETHOD(put_BrushColor1)(LONG lColor) { return S_OK; } - STDMETHOD(get_BrushAlpha1)(LONG* lAlpha) { return S_OK; } - STDMETHOD(put_BrushAlpha1)(LONG lAlpha) + virtual HRESULT get_BrushType(LONG* lType){ return S_OK; } + virtual HRESULT put_BrushType(const LONG& lType){ return S_OK; } + virtual HRESULT get_BrushColor1(LONG* lColor){ return S_OK; } + virtual HRESULT put_BrushColor1(const LONG& lColor){ return S_OK; } + virtual HRESULT get_BrushAlpha1(LONG* lAlpha) { m_bIsFillPart = (0 != lAlpha) ? TRUE : FALSE; return S_OK; } - STDMETHOD(get_BrushColor2)(LONG* lColor) { return S_OK; } - STDMETHOD(put_BrushColor2)(LONG lColor) { return S_OK; } - STDMETHOD(get_BrushAlpha2)(LONG* lAlpha) { return S_OK; } - STDMETHOD(put_BrushAlpha2)(LONG lAlpha) { return S_OK; } - STDMETHOD(get_BrushTexturePath)(BSTR* bsPath) { return S_OK; } - STDMETHOD(put_BrushTexturePath)(BSTR bsPath) { return S_OK; } - STDMETHOD(get_BrushTextureMode)(LONG* lMode) { return S_OK; } - STDMETHOD(put_BrushTextureMode)(LONG lMode) { return S_OK; } - STDMETHOD(get_BrushTextureAlpha)(LONG* lTxAlpha) { return S_OK; } - STDMETHOD(put_BrushTextureAlpha)(LONG lTxAlpha) { return S_OK; } - STDMETHOD(get_BrushLinearAngle)(double* dAngle) { return S_OK; } - STDMETHOD(put_BrushLinearAngle)(double dAngle) { return S_OK; } - STDMETHOD(BrushRect)(BOOL val, double left, double top, double width, double height) { return S_OK; } + virtual HRESULT put_BrushAlpha1(const LONG& lAlpha){ return S_OK; } + virtual HRESULT get_BrushColor2(LONG* lColor){ return S_OK; } + virtual HRESULT put_BrushColor2(const LONG& lColor){ return S_OK; } + virtual HRESULT get_BrushAlpha2(LONG* lAlpha){ return S_OK; } + virtual HRESULT put_BrushAlpha2(const LONG& lAlpha){ return S_OK; } + virtual HRESULT get_BrushTexturePath(std::wstring* bsPath){ return S_OK; } + virtual HRESULT put_BrushTexturePath(const std::wstring& bsPath){ return S_OK; } + virtual HRESULT get_BrushTextureMode(LONG* lMode){ return S_OK; } + virtual HRESULT put_BrushTextureMode(const LONG& lMode){ return S_OK; } + virtual HRESULT get_BrushTextureAlpha(LONG* lTxAlpha){ return S_OK; } + virtual HRESULT put_BrushTextureAlpha(const LONG& lTxAlpha){ return S_OK; } + virtual HRESULT get_BrushLinearAngle(double* dAngle){ return S_OK; } + virtual HRESULT put_BrushLinearAngle(const double& dAngle){ return S_OK; } + virtual HRESULT BrushRect(const INT& val, const double& left, const double& top, const double& width, const double& height){ return S_OK; } + virtual HRESULT BrushBounds(const double& left, const double& top, const double& width, const double& height){ return S_OK; } + + virtual HRESULT put_BrushGradientColors(LONG* lColors, double* pPositions, LONG nCount){ return S_OK; } + // font ------------------------------------------------------------------------------------- - STDMETHOD(SetFont)(BSTR bsXML) { return S_OK; } - STDMETHOD(get_FontName)(BSTR* bsName) { return S_OK; } - STDMETHOD(put_FontName)(BSTR bsName) { return S_OK; } - STDMETHOD(get_FontPath)(BSTR* bsName) { return S_OK; } - STDMETHOD(put_FontPath)(BSTR bsName) { return S_OK; } - STDMETHOD(get_FontSize)(double* dSize) { return S_OK; } - STDMETHOD(put_FontSize)(double dSize){ return S_OK; } - STDMETHOD(get_FontStyle)(LONG* lStyle) { return S_OK; } - STDMETHOD(put_FontStyle)(LONG lStyle) { return S_OK; } - STDMETHOD(get_FontStringGID)(BOOL* bGID) { return S_OK; } - STDMETHOD(put_FontStringGID)(BOOL bGID) { return S_OK; } - STDMETHOD(get_FontCharSpace)(double* dSpace) { return S_OK; } - STDMETHOD(put_FontCharSpace)(double dSpace) { return S_OK; } -// shadow ----------------------------------------------------------------------------------- - STDMETHOD(SetShadow)(BSTR bsXML) { return S_OK; } - STDMETHOD(get_ShadowDistanceX)(double* val) { return S_OK; } - STDMETHOD(put_ShadowDistanceX)(double val) { return S_OK; } - STDMETHOD(get_ShadowDistanceY)(double* val) { return S_OK; } - STDMETHOD(put_ShadowDistanceY)(double val) { return S_OK; } - STDMETHOD(get_ShadowBlurSize)(double* val) { return S_OK; } - STDMETHOD(put_ShadowBlurSize)(double val) { return S_OK; } - STDMETHOD(get_ShadowColor)(LONG* val) { return S_OK; } - STDMETHOD(put_ShadowColor)(LONG val) { return S_OK; } - STDMETHOD(get_ShadowAlpha)(LONG* val) { return S_OK; } - STDMETHOD(put_ShadowAlpha)(LONG val) { return S_OK; } - STDMETHOD(get_ShadowVisible)(BOOL* val) { return S_OK; } - STDMETHOD(put_ShadowVisible)(BOOL val) { return S_OK; } -// edge ------------------------------------------------------------------------------------- - STDMETHOD(SetEdgeText)(BSTR bsXML) { return S_OK; } - STDMETHOD(get_EdgeVisible)(LONG* val) { return S_OK; } - STDMETHOD(put_EdgeVisible)(LONG val) { return S_OK; } - STDMETHOD(get_EdgeColor)(LONG* val) { return S_OK; } - STDMETHOD(put_EdgeColor)(LONG val) { return S_OK; } - STDMETHOD(get_EdgeAlpha)(LONG* val) { return S_OK; } - STDMETHOD(put_EdgeAlpha)(LONG val) { return S_OK; } - STDMETHOD(get_EdgeDist)(double* val) { return S_OK; } - STDMETHOD(put_EdgeDist)(double val) { return S_OK; } + virtual HRESULT get_FontName(std::wstring* bsName){ return S_OK; } + virtual HRESULT put_FontName(const std::wstring& bsName){ return S_OK; } + virtual HRESULT get_FontPath(std::wstring* bsName){ return S_OK; } + virtual HRESULT put_FontPath(const std::wstring& bsName){ return S_OK; } + virtual HRESULT get_FontSize(double* dSize){ return S_OK; } + virtual HRESULT put_FontSize(const double& dSize){ return S_OK; } + virtual HRESULT get_FontStyle(LONG* lStyle){ return S_OK; } + virtual HRESULT put_FontStyle(const LONG& lStyle){ return S_OK; } + virtual HRESULT get_FontStringGID(INT* bGID){ return S_OK; } + virtual HRESULT put_FontStringGID(const INT& bGID){ return S_OK; } + virtual HRESULT get_FontCharSpace(double* dSpace){ return S_OK; } + virtual HRESULT put_FontCharSpace(const double& dSpace){ return S_OK; } + virtual HRESULT get_FontFaceIndex(int* lFaceIndex){ return S_OK; } + virtual HRESULT put_FontFaceIndex(const int& lFaceIndex){ return S_OK; } + //-------- Функции для вывода текста -------------------------------------------------------- - STDMETHOD(CommandDrawText)(BSTR bsText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset) { return S_OK; } - STDMETHOD(CommandDrawTextEx)(BSTR bsText, BSTR bsGidText, BSTR bsSourceCodeText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset, DWORD lFlags) { return S_OK; } + virtual HRESULT CommandDrawTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset){ return S_OK; } + virtual HRESULT CommandDrawText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset){ return S_OK; } + + virtual HRESULT CommandDrawTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags){ return S_OK; } + virtual HRESULT CommandDrawTextEx(const std::wstring& bsUnicodeText, const std::wstring& bsGidText, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags){ return S_OK; } + //-------- Маркеры для команд --------------------------------------------------------------- - STDMETHOD(BeginCommand)(DWORD lType) + virtual HRESULT BeginCommand(const DWORD& lType) { m_lCurrentCommandType = lType; return S_OK; } - STDMETHOD(EndCommand)(DWORD lType) + virtual HRESULT EndCommand(const DWORD& lType) { m_lCurrentCommandType = -1; @@ -695,61 +679,62 @@ public: return S_OK; } + //-------- Функции для работы с Graphics Path ----------------------------------------------- - STDMETHOD(PathCommandMoveTo)(double fX, double fY) + virtual HRESULT PathCommandMoveTo(const double& x, const double& y) { if (c_nSimpleGraphicType == m_lCurrentCommandType) { - MoveTo(fX * m_dScaleX, fY * m_dScaleY); + MoveTo(x * m_dScaleX, y * m_dScaleY); } else { - m_pSimpleGraphicsConverter->PathCommandMoveTo(fX, fY); + m_pSimpleGraphicsConverter->PathCommandMoveTo(x, y); } return S_OK; } - STDMETHOD(PathCommandLineTo)(double fX, double fY) + virtual HRESULT PathCommandLineTo(const double& x, const double& y) { if (c_nSimpleGraphicType == m_lCurrentCommandType) { - LineTo(fX * m_dScaleX, fY * m_dScaleY); + LineTo(x * m_dScaleX, y * m_dScaleY); } else { - m_pSimpleGraphicsConverter->PathCommandLineTo(fX, fY); + m_pSimpleGraphicsConverter->PathCommandLineTo(x, y); } return S_OK; } - STDMETHOD(PathCommandLinesTo)(SAFEARRAY* pPoints) + virtual HRESULT PathCommandLinesTo(double* points, const int& count) { - m_pSimpleGraphicsConverter->PathCommandLinesTo(pPoints); + m_pSimpleGraphicsConverter->PathCommandLinesTo(points, count); return S_OK; } - STDMETHOD(PathCommandCurveTo)(double fX1, double fY1, double fX2, double fY2, double fX3, double fY3) + virtual HRESULT PathCommandCurveTo(const double& x1, const double& y1, const double& x2, const double& y2, const double& x3, const double& y3) { if (c_nSimpleGraphicType == m_lCurrentCommandType) { - CurveTo(fX1 * m_dScaleX, fY1 * m_dScaleY, fX2 * m_dScaleX, fY2 * m_dScaleY, fX3 * m_dScaleX, fY3 * m_dScaleY); + CurveTo(x1 * m_dScaleX, y1 * m_dScaleY, x2 * m_dScaleX, y2 * m_dScaleY, x3 * m_dScaleX, y3 * m_dScaleY); } else { - m_pSimpleGraphicsConverter->PathCommandCurveTo(fX1, fY1, fX2, fY2, fX3, fY3); + m_pSimpleGraphicsConverter->PathCommandCurveTo(x1, y1, x2, y2, x3, y3); } return S_OK; } - STDMETHOD(PathCommandCurvesTo)(SAFEARRAY* pPoints) + virtual HRESULT PathCommandCurvesTo(double* points, const int& count) { - m_pSimpleGraphicsConverter->PathCommandCurvesTo(pPoints); + m_pSimpleGraphicsConverter->PathCommandCurvesTo(points, count); return S_OK; } - STDMETHOD(PathCommandArcTo)(double fX, double fY, double fWidth, double fHeight, double fStartAngle, double fSweepAngle) + virtual HRESULT PathCommandArcTo(const double& x, const double& y, const double& w, const double& h, const double& startAngle, const double& sweepAngle) { - m_pSimpleGraphicsConverter->PathCommandArcTo(fX, fY, fWidth, fHeight, fStartAngle, fSweepAngle); + m_pSimpleGraphicsConverter->PathCommandArcTo(x, y, w, h, startAngle, sweepAngle); return S_OK; } - STDMETHOD(PathCommandClose)() + virtual HRESULT PathCommandClose() { if (c_nSimpleGraphicType == m_lCurrentCommandType) { @@ -761,84 +746,55 @@ public: } return S_OK; } - STDMETHOD(PathCommandEnd)() { return S_OK; } - STDMETHOD(DrawPath)(long nType) { return S_OK; } - STDMETHOD(PathCommandStart)() { return S_OK; } - STDMETHOD(PathCommandGetCurrentPoint)(double* fX, double* fY) + virtual HRESULT PathCommandEnd(){ return S_OK; } + virtual HRESULT DrawPath(const LONG& nType){ return S_OK; } + virtual HRESULT PathCommandStart(){ return S_OK; } + virtual HRESULT PathCommandGetCurrentPoint(double* x, double* y) { if (NULL != m_pSimpleGraphicsConverter) - return m_pSimpleGraphicsConverter->PathCommandGetCurrentPoint(fX, fY); + return m_pSimpleGraphicsConverter->PathCommandGetCurrentPoint(x, y); return S_OK; } - STDMETHOD(PathCommandText)(BSTR bsText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset) { return S_OK; } - STDMETHOD(PathCommandTextEx)(BSTR bsText, BSTR bsGidText, BSTR bsSourceCodeText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset, DWORD lFlags) { return S_OK; } + + virtual HRESULT PathCommandTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset){ return S_OK; } + virtual HRESULT PathCommandText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset){ return S_OK; } + + virtual HRESULT PathCommandTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags){ return S_OK; } + virtual HRESULT PathCommandTextEx(const std::wstring& bsUnicodeText, const std::wstring& bsGidText, const double& x, const double& y, const double& w, const double& h, const double& baselineOffset, const DWORD& lFlags){ return S_OK; } + //-------- Функции для вывода изображений --------------------------------------------------- - STDMETHOD(DrawImage)(IUnknown* pInterface, double fX, double fY, double fWidth, double fHeight) { return S_OK; } - STDMETHOD(DrawImageFromFile)(BSTR bstrVal, double fX, double fY, double fWidth, double fHeight) { return S_OK; } + virtual HRESULT DrawImage(IGrObject* pImage, const double& x, const double& y, const double& w, const double& h){ return S_OK; } + virtual HRESULT DrawImageFromFile(const std::wstring&, const double& x, const double& y, const double& w, const double& h, const BYTE& lAlpha = 255){ return S_OK; } + // transform -------------------------------------------------------------------------------- - STDMETHOD(GetCommandParams)(double* dAngle, double* dLeft, double* dTop, double* dWidth, double* dHeight, DWORD* lFlags) { return S_OK; } - STDMETHOD(SetCommandParams)(double dAngle, double dLeft, double dTop, double dWidth, double dHeight, DWORD lFlags) { return S_OK; } - STDMETHOD(SetTransform)(double dA, double dB, double dC, double dD, double dE, double dF) { return S_OK; } - STDMETHOD(GetTransform)(double *pdA, double *pdB, double *pdC, double *pdD, double *pdE, double *pdF) { return S_OK; } - STDMETHOD(ResetTransform)(void) { return S_OK; } + virtual HRESULT SetTransform(const double& m1, const double& m2, const double& m3, const double& m4, const double& m5, const double& m6){ return S_OK; } + virtual HRESULT GetTransform(double *pdA, double *pdB, double *pdC, double *pdD, double *pdE, double *pdF){ return S_OK; } + virtual HRESULT ResetTransform(){ return S_OK; } + // ----------------------------------------------------------------------------------------- - STDMETHOD(get_ClipMode)(LONG* plMode) { return S_OK; } - STDMETHOD(put_ClipMode)(LONG lMode) { return S_OK; } + virtual HRESULT get_ClipMode(LONG* plMode){ return S_OK; } + virtual HRESULT put_ClipMode(const LONG& lMode){ return S_OK; } + // additiaonal params ---------------------------------------------------------------------- - STDMETHOD(SetAdditionalParam)(BSTR ParamName, VARIANT ParamValue) + virtual HRESULT CommandLong(const LONG& lType, const LONG& lCommand){ return S_OK; } + virtual HRESULT CommandDouble(const LONG& lType, const double& dCommand){ return S_OK; } + virtual HRESULT CommandString(const LONG& lType, const std::wstring& sCommand){ return S_OK; } + +// additiaonal params ---------------------------------------------------------------------- + HRESULT NewShape() { - CString name = (CString)ParamName; - if (name == _T("NewShape")) - { - m_pSimpleGraphicsConverter->PathCommandEnd(); - m_oWriter.ClearNoAttack(); - } - return S_OK; - } - STDMETHOD(GetAdditionalParam)(BSTR ParamName, VARIANT* ParamValue) - { - CString name = (CString)ParamName; - if (name == _T("ResultPath") && NULL != ParamValue) - { - BSTR bs = m_oWriter.GetData().AllocSysString(); - ParamValue->vt = VT_BSTR; - ParamValue->bstrVal = bs; - } - return S_OK; - } -// -------------------------------------------------------------------------------------------- - -public: - HRESULT FinalConstruct() - { - m_bIsFillPart = FALSE; - m_bIsStrokePart = FALSE; - - m_dScaleX = 1.0; - m_dScaleY = 1.0; - - m_pSimpleGraphicsConverter = NULL; - CoCreateInstance(ASCGraphics::CLSID_CASCGraphicSimpleComverter, NULL, CLSCTX_ALL, - ASCGraphics::IID_IASCGraphicSimpleComverter, (void**)&m_pSimpleGraphicsConverter); - - IUnknown* punkRenderer = NULL; - this->QueryInterface(IID_IUnknown, (void**)&punkRenderer); - - m_pSimpleGraphicsConverter->put_Renderer(punkRenderer); - RELEASEINTERFACE(punkRenderer); - - m_lCountPathCommands = 0; - + m_pSimpleGraphicsConverter->PathCommandEnd(); + m_oWriter.ClearNoAttack(); return S_OK; } - void FinalRelease() + HRESULT ResultPath(CString* bstrVal) { - RELEASEINTERFACE(m_pSimpleGraphicsConverter); + *bstrVal = m_oWriter.GetData(); + return S_OK; } - private: - ASCGraphics::IASCGraphicSimpleComverter* m_pSimpleGraphicsConverter; + Aggplus::CGraphicsPathSimpleConverter* m_pSimpleGraphicsConverter; BOOL m_bIsFillPart; BOOL m_bIsStrokePart; diff --git a/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/GraphicsPath.h b/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/GraphicsPath.h index 83715a0fa9..aa69291b46 100644 --- a/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/GraphicsPath.h +++ b/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/GraphicsPath.h @@ -1,5 +1,5 @@ #pragma once -#include "../../../../ASCImageStudio3/ASCGraphics/Interfaces/ASCRenderer.h" +#include "../../../../DesktopEditor/graphics/GraphicsPath.h" #include "..\..\Metric.h" #include "..\..\Attributes.h" @@ -142,7 +142,7 @@ namespace NSPresentationEditor InternalClear(); } - virtual void Draw(IASCRenderer* pRenderer) + virtual void Draw(IRenderer* pRenderer) { if (NULL == pRenderer) return; @@ -180,7 +180,7 @@ namespace NSPresentationEditor pRenderer->PathCommandEnd(); pRenderer->EndCommand(c_nPathType); } - void ConvertVector(IASCRenderer* pRenderer) + void ConvertVector(IRenderer* pRenderer) { pRenderer->SetCommandParams(m_dAngle, m_oBounds.left, m_oBounds.top, m_oBounds.GetWidth(), m_oBounds.GetHeight(), m_lFlags); @@ -300,7 +300,7 @@ namespace NSPresentationEditor }; } - void CheckLastPoint(IASCRenderer* pRenderer, CDoublePoint& pointCur) + void CheckLastPoint(IRenderer* pRenderer, CDoublePoint& pointCur) { if (NULL == pRenderer) return; @@ -445,7 +445,7 @@ namespace NSPresentationEditor } - void GetSafearrayPoints(IASCRenderer* pRenderer, SAFEARRAY** ppArray, CDoublePoint& pointCur, BOOL bR = FALSE) + void GetSafearrayPoints(IRenderer* pRenderer, SAFEARRAY** ppArray, CDoublePoint& pointCur, BOOL bR = FALSE) { if (NULL == ppArray) return; @@ -497,7 +497,7 @@ namespace NSPresentationEditor *ppArray = pArray; } - void Draw(IASCRenderer* pRenderer, CDoublePoint& pointCur) + void Draw(IRenderer* pRenderer, CDoublePoint& pointCur) { switch (m_eType) { @@ -518,7 +518,7 @@ namespace NSPresentationEditor if (NULL != pArray) { - pRenderer->PathCommandLinesTo(pArray); + pRenderer->PathCommandLinesTo((double*)pArray->pvData, m_arPoints.GetSize()); } RELEASEARRAY(pArray); @@ -531,7 +531,7 @@ namespace NSPresentationEditor if (NULL != pArray) { - pRenderer->PathCommandCurvesTo(pArray); + pRenderer->PathCommandCurvesTo((double*)pArray->pvData, m_arPoints.GetSize()); } RELEASEARRAY(pArray); @@ -561,7 +561,7 @@ namespace NSPresentationEditor if (NULL != pArray) { - pRenderer->PathCommandLinesTo(pArray); + pRenderer->PathCommandLinesTo((double*)pArray->pvData, m_arPoints.GetSize()); } RELEASEARRAY(pArray); @@ -576,7 +576,7 @@ namespace NSPresentationEditor if (NULL != pArray) { - pRenderer->PathCommandCurvesTo(pArray); + pRenderer->PathCommandCurvesTo((double*)pArray->pvData, m_arPoints.GetSize()); } RELEASEARRAY(pArray); @@ -779,7 +779,7 @@ namespace NSPresentationEditor if (NULL != pArray) { - pRenderer->PathCommandLinesTo(pArray); + pRenderer->PathCommandLinesTo((double*)pArray->pvData, m_arPoints.GetSize()); } RELEASEARRAY(pArray); @@ -791,7 +791,7 @@ namespace NSPresentationEditor }; } - inline void AddEllipticalQuadr(IASCRenderer*& pRenderer, bool& bIsX, double& x1, double& y1, double& x2, double& y2, double& dRadX, double& dRadY) + inline void AddEllipticalQuadr(IRenderer*& pRenderer, bool& bIsX, double& x1, double& y1, double& x2, double& y2, double& dRadX, double& dRadY) { if (bIsX) { diff --git a/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/PPTXShape/PPTXShape.h b/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/PPTXShape/PPTXShape.h index d4b9307630..79dcada33f 100644 --- a/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/PPTXShape/PPTXShape.h +++ b/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/PPTXShape/PPTXShape.h @@ -500,7 +500,7 @@ public: return m_oPath.ToXml(GeomInfo, StartTime, EndTime, Pen, Brush, MetricInfo, NSBaseShape::pptx); } - virtual void ToRenderer(IASCRenderer* pRenderer, CGeomShapeInfo& pGeomInfo, double dStartTime, double dEndTime, CPen& pPen, CBrush& pFore, CMetricInfo& pInfo) + virtual void ToRenderer(IRenderer* pRenderer, CGeomShapeInfo& pGeomInfo, double dStartTime, double dEndTime, CPen& pPen, CBrush& pFore, CMetricInfo& pInfo) { FManager.SetWidthHeight(pGeomInfo.m_dWidth, pGeomInfo.m_dHeight); ReCalculate(); diff --git a/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/Path.h b/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/Path.h index eb049b9b43..f4cb1b919d 100644 --- a/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/Path.h +++ b/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/Path.h @@ -1,5 +1,6 @@ #pragma once #include "GraphicsPath.h" +//#include "../../../../DesktopEditor/graphics/GraphicsPath.h" #if defined(PPTX_DEF) #include "PPTXShape/Formula.h" @@ -1946,7 +1947,7 @@ namespace NSPresentationEditor return strResult; } - void ToRenderer(IASCRenderer* pRenderer, CGeomShapeInfo& pGeomInfo, double dStartTime, + void ToRenderer(IRenderer* pRenderer, CGeomShapeInfo& pGeomInfo, double dStartTime, double dEndTime, CPen& pPen, CBrush& pFore, CMetricInfo& pInfo, NSBaseShape::ClassType ClassType) { CGraphicPath oPath; diff --git a/ASCPresentationEditor/OfficeDrawing/Shapes/Shape.h b/ASCPresentationEditor/OfficeDrawing/Shapes/Shape.h index ac2aee58a9..bad323384d 100644 --- a/ASCPresentationEditor/OfficeDrawing/Shapes/Shape.h +++ b/ASCPresentationEditor/OfficeDrawing/Shapes/Shape.h @@ -352,7 +352,7 @@ public: return strImageTransform; } - void ToRenderer(IASCRenderer* pRenderer, CGeomShapeInfo& oGeomInfo, CMetricInfo& pInfo, double dStartTime, double dEndTime) + void ToRenderer(IRenderer* pRenderer, CGeomShapeInfo& oGeomInfo, CMetricInfo& pInfo, double dStartTime, double dEndTime) { oGeomInfo.m_dLimoX = m_lLimoX; oGeomInfo.m_dLimoY = m_lLimoY; diff --git a/DesktopEditor/agg-2.4/agg_vs2005.vcproj b/DesktopEditor/agg-2.4/agg_vs2005.vcproj new file mode 100644 index 0000000000..e6b2165681 --- /dev/null +++ b/DesktopEditor/agg-2.4/agg_vs2005.vcproj @@ -0,0 +1,823 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DesktopEditor/common/File.h b/DesktopEditor/common/File.h index f45cd529f3..20971c2b6c 100644 --- a/DesktopEditor/common/File.h +++ b/DesktopEditor/common/File.h @@ -499,7 +499,7 @@ namespace NSFile size_t nCountWrite = fwrite((void*)pData, 1, nBytesCount, m_pFile); return true; } - void WriteStringUTF8(std::wstring& strXml, bool bIsBOM = false) + void WriteStringUTF8(const std::wstring& strXml, bool bIsBOM = false) { BYTE* pData = NULL; LONG lLen = 0; @@ -510,6 +510,14 @@ namespace NSFile RELEASEARRAYOBJECTS(pData); } + static bool SaveToFile(const std::wstring& strFileName, const std::wstring& strXml, bool bIsBOM = false) + { + CFileBinary oFile; + oFile.CreateFileW(strFileName); + oFile.WriteStringUTF8(strXml, bIsBOM); + oFile.CloseFile(); + return true; + } }; } diff --git a/DesktopEditor/cximage/CxImage/cximage_vs2005.vcproj b/DesktopEditor/cximage/CxImage/cximage_vs2005.vcproj new file mode 100644 index 0000000000..874de6088a --- /dev/null +++ b/DesktopEditor/cximage/CxImage/cximage_vs2005.vcproj @@ -0,0 +1,3169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DesktopEditor/cximage/jasper/jasper_vs2005.vcproj b/DesktopEditor/cximage/jasper/jasper_vs2005.vcproj new file mode 100644 index 0000000000..23cd88b728 --- /dev/null +++ b/DesktopEditor/cximage/jasper/jasper_vs2005.vcproj @@ -0,0 +1,4569 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DesktopEditor/cximage/jbig/jbig_vs2005.vcproj b/DesktopEditor/cximage/jbig/jbig_vs2005.vcproj new file mode 100644 index 0000000000..5745a7c6bd --- /dev/null +++ b/DesktopEditor/cximage/jbig/jbig_vs2005.vcproj @@ -0,0 +1,769 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DesktopEditor/cximage/jpeg/Jpeg_vs2005.vcproj b/DesktopEditor/cximage/jpeg/Jpeg_vs2005.vcproj new file mode 100644 index 0000000000..7a87b6f108 --- /dev/null +++ b/DesktopEditor/cximage/jpeg/Jpeg_vs2005.vcproj @@ -0,0 +1,3778 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DesktopEditor/cximage/libpsd/libpsd_vs2005.vcproj b/DesktopEditor/cximage/libpsd/libpsd_vs2005.vcproj new file mode 100644 index 0000000000..5aeb7cc03e --- /dev/null +++ b/DesktopEditor/cximage/libpsd/libpsd_vs2005.vcproj @@ -0,0 +1,4080 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DesktopEditor/cximage/mng/mng_vs2005.vcproj b/DesktopEditor/cximage/mng/mng_vs2005.vcproj new file mode 100644 index 0000000000..60f82e5160 --- /dev/null +++ b/DesktopEditor/cximage/mng/mng_vs2005.vcproj @@ -0,0 +1,2010 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DesktopEditor/cximage/png/png_vs2005.vcproj b/DesktopEditor/cximage/png/png_vs2005.vcproj new file mode 100644 index 0000000000..3fdde0bd71 --- /dev/null +++ b/DesktopEditor/cximage/png/png_vs2005.vcproj @@ -0,0 +1,1777 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DesktopEditor/cximage/raw/libdcr_vs2005.vcproj b/DesktopEditor/cximage/raw/libdcr_vs2005.vcproj new file mode 100644 index 0000000000..0eed029c60 --- /dev/null +++ b/DesktopEditor/cximage/raw/libdcr_vs2005.vcproj @@ -0,0 +1,701 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DesktopEditor/cximage/tiff/Tiff_vs2005.vcproj b/DesktopEditor/cximage/tiff/Tiff_vs2005.vcproj new file mode 100644 index 0000000000..b28cbaff61 --- /dev/null +++ b/DesktopEditor/cximage/tiff/Tiff_vs2005.vcproj @@ -0,0 +1,3262 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DesktopEditor/cximage/zlib/zlib_vs2005.vcproj b/DesktopEditor/cximage/zlib/zlib_vs2005.vcproj new file mode 100644 index 0000000000..ef1c634871 --- /dev/null +++ b/DesktopEditor/cximage/zlib/zlib_vs2005.vcproj @@ -0,0 +1,1413 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DesktopEditor/fontengine/FontManager.cpp b/DesktopEditor/fontengine/FontManager.cpp index beb822d0a6..d301648527 100644 --- a/DesktopEditor/fontengine/FontManager.cpp +++ b/DesktopEditor/fontengine/FontManager.cpp @@ -291,6 +291,47 @@ int CFontManager::GetKerning(UINT unPrevGID, UINT unGID) return m_pFont->GetKerning(unPrevGID, unGID); } +INT CFontManager::GetUnderline(float *pfStartX, float *pfStartY, float *pfEndX, float *pfEndY, float *pfSize) +{ + if ( m_oString.GetLength() <= 0 || !m_pFont ) + { + *pfStartX = 0; + *pfStartY = 0; + *pfEndX = 0; + *pfEndY = 0; + *pfSize = 0; + + return FALSE; + } + + float fStartX = m_oString.m_fX; + float fStartY = m_oString.m_fY; + float fEndX = m_oString.m_fEndX; + float fEndY = m_oString.m_fEndY; + + short shUnderlinePos = m_pFont->m_pFace->underline_position; + short shUnderlineSize = m_pFont->m_pFace->underline_thickness; + + float fKoef = (float)(m_pFont->m_dSize / 1000 * m_pFont->m_unVerDpi / 72.0f); + float fUnderlinePos = shUnderlinePos * fKoef; + float fUnderLineSize = shUnderlineSize * fKoef; + + fStartY -= fUnderlinePos; + fEndY -= fUnderlinePos; + + m_oString.Transform( &fStartX, &fStartY ); + m_oString.Transform( &fEndX, &fEndY ); + + *pfStartX = fStartX; + *pfStartY = fStartY; + + *pfEndX = fEndX; + *pfEndY = fEndY; + + *pfSize = fUnderLineSize; + + return TRUE; +} TBBox CFontManager::MeasureString() { TBBox oBox; @@ -392,6 +433,16 @@ void CFontManager::SetStringGID(const INT &bStringGID) m_pFont->SetStringGID(m_bStringGID); } +void CFontManager::SetCharSpacing(const double &dCharSpacing) +{ + m_fCharSpacing = dCharSpacing; + + if (NULL == m_pFont) + return; + + m_pFont->SetCharSpacing(m_fCharSpacing); +} + INT CFontManager::GetStringPath(ISimpleGraphicsPath* pInterface) { if (NULL == pInterface) diff --git a/DesktopEditor/fontengine/FontManager.h b/DesktopEditor/fontengine/FontManager.h index 9ff3543109..1202eb935c 100644 --- a/DesktopEditor/fontengine/FontManager.h +++ b/DesktopEditor/fontengine/FontManager.h @@ -116,6 +116,7 @@ public: INT LoadString2C(const LONG& wsBuffer, const float& fX, const float& fY); int GetKerning(UINT unPrevGID, UINT unGID); + INT GetUnderline(float *pfStartX, float *pfStartY, float *pfEndX, float *pfEndY, float *pfSize); TFontCacheSizes MeasureChar(const LONG& lUnicode); TBBox MeasureString(); @@ -126,6 +127,7 @@ public: INT SetTextMatrix(const double& fA, const double& fB, const double& fC, const double& fD, const double& fE, const double& fF); INT SetTextMatrix2(const double& fA, const double& fB, const double& fC, const double& fD, const double& fE, const double& fF); void SetStringGID(const INT& bStringGID); + void SetCharSpacing(const double &dCharSpacing); INT GetStringPath(ISimpleGraphicsPath* pPath); diff --git a/DesktopEditor/fontengine/font_engine_vs2005.sln b/DesktopEditor/fontengine/font_engine_vs2005.sln deleted file mode 100644 index 06963e8067..0000000000 --- a/DesktopEditor/fontengine/font_engine_vs2005.sln +++ /dev/null @@ -1,20 +0,0 @@ -п»ї -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "font_engine", "font_engine.vcproj", "{C739151F-5384-41DF-A1A6-F089E2C1AD56}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|Win32.ActiveCfg = Debug|Win32 - {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|Win32.Build.0 = Debug|Win32 - {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|Win32.ActiveCfg = Release|Win32 - {C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/DesktopEditor/graphics/GraphicsPath.cpp b/DesktopEditor/graphics/GraphicsPath.cpp index 6610ec8eb1..40366d84bf 100644 --- a/DesktopEditor/graphics/GraphicsPath.cpp +++ b/DesktopEditor/graphics/GraphicsPath.cpp @@ -809,7 +809,7 @@ namespace Aggplus m_agg_ps.last_vertex(fX, fY); return true; } - bool CGraphicsPathSimpleConverter::PathCommandText(std::wstring& bsText, CFontManager* pManager, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset) + bool CGraphicsPathSimpleConverter::PathCommandText(const std::wstring& bsText, CFontManager* pManager, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset) { return AddString(bsText, pManager, fX, fY + fBaseLineOffset); } @@ -951,7 +951,7 @@ namespace Aggplus return true; } - bool CGraphicsPathSimpleConverter::AddString(std::wstring& bstrText, CFontManager* pFont, double x, double y) + bool CGraphicsPathSimpleConverter::AddString(const std::wstring& bstrText, CFontManager* pFont, double x, double y) { if (NULL == pFont) return false; diff --git a/DesktopEditor/graphics/GraphicsPath.h b/DesktopEditor/graphics/GraphicsPath.h index 8e875e0b6f..8079274fe6 100644 --- a/DesktopEditor/graphics/GraphicsPath.h +++ b/DesktopEditor/graphics/GraphicsPath.h @@ -123,7 +123,7 @@ public: bool PathCommandEnd(); bool PathCommandStart(); bool PathCommandGetCurrentPoint(double* fX, double* fY); - bool PathCommandText(std::wstring& bsText, CFontManager* pManager, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset); + bool PathCommandText(const std::wstring& bsText, CFontManager* pManager, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset); bool PathCommandTextEx(std::wstring& bsText, std::wstring& bsGidText, CFontManager* pManager, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset, DWORD lFlags); bool PathCommandGetBounds(double& left, double& top, double& width, double &height); @@ -137,7 +137,7 @@ public: bool _Start(); protected: - bool AddString(std::wstring& bstrText, CFontManager* pFont, double x, double y); + bool AddString(const std::wstring& bstrText, CFontManager* pFont, double x, double y); int EllipseArc(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, INT bClockDirection); double AngToEllPrm(double fAngle, double fXRad, double fYRad); diff --git a/DesktopEditor/graphics/IRenderer.h b/DesktopEditor/graphics/IRenderer.h index b382d1192d..db66419da2 100644 --- a/DesktopEditor/graphics/IRenderer.h +++ b/DesktopEditor/graphics/IRenderer.h @@ -2,6 +2,7 @@ #define _BUILD_IRENDERER_H_ #include "../common/Types.h" +#include "Matrix.h" #include class IGrObject @@ -224,6 +225,40 @@ public: virtual HRESULT DrawImageFromFile(const std::wstring&, const double& x, const double& y, const double& w, const double& h, const BYTE& lAlpha = 255) = 0; // transform -------------------------------------------------------------------------------- + virtual HRESULT GetCommandParams(double* dAngle, double* dLeft, double* dTop, double* dWidth, double* dHeight, DWORD* lFlags) + { + return S_OK; + } + virtual HRESULT SetCommandParams(double dAngle, double dLeft, double dTop, double dWidth, double dHeight, DWORD lFlags) + { + if ((dWidth <= 1) || (dHeight <= 1)) + lFlags = 0; + + BOOL bFlipX = (0 != (c_nParamFlipX & lFlags)); + BOOL bFlipY = (0 != (c_nParamFlipY & lFlags)); + + REAL m11 = bFlipX ? -1.0f : 1.0f; + REAL m22 = bFlipY ? -1.0f : 1.0f; + + Aggplus::CMatrix oMatrix(1, 0, 0, 1, 0, 0); + + if ((0 != dAngle) || (0 != lFlags)) + { + REAL dCentreX = (REAL)(dLeft + dWidth / 2.0); + REAL dCentreY = (REAL)(dTop + dHeight / 2.0); + + oMatrix.Translate(-dCentreX, -dCentreY , Aggplus::MatrixOrderAppend); + + oMatrix.Rotate((REAL)dAngle , Aggplus::MatrixOrderAppend); + oMatrix.Scale(m11, m22 , Aggplus::MatrixOrderAppend); + + oMatrix.Translate(dCentreX, dCentreY , Aggplus::MatrixOrderAppend); + } + double mass[6]; + oMatrix.GetElements(mass); + SetTransform(mass[0], mass[1], mass[2], mass[3], mass[4], mass[5]); + return S_OK; + } virtual HRESULT SetTransform(const double& m1, const double& m2, const double& m3, const double& m4, const double& m5, const double& m6) = 0; virtual HRESULT GetTransform(double *pdA, double *pdB, double *pdC, double *pdD, double *pdE, double *pdF) = 0; virtual HRESULT ResetTransform() = 0; diff --git a/DesktopEditor/graphics/Image.cpp b/DesktopEditor/graphics/Image.cpp index 38509eeda4..c05e8add95 100644 --- a/DesktopEditor/graphics/Image.cpp +++ b/DesktopEditor/graphics/Image.cpp @@ -43,7 +43,29 @@ namespace Aggplus oFrame.ClearNoAttack(); } + void CImage::Create(BYTE* pImgData, const DWORD& dwWidth, const DWORD& dwHeight, const long& nStride) + { + m_pImgData = pImgData; + m_dwWidth = dwWidth; + m_dwHeight = dwHeight; + m_nStride = nStride; + m_bExternalBuffer = false; + m_Status = Ok; + } + + bool CImage::SaveFile(const std::wstring& strFileName, unsigned __int32 nFileType) + { + CBgraFrame oBgraFrame; + oBgraFrame.put_Width(m_dwWidth); + oBgraFrame.put_Height(m_dwHeight); + oBgraFrame.put_Stride(m_nStride); + oBgraFrame.put_Data(m_pImgData); + bool bRes = oBgraFrame.SaveFile(strFileName, nFileType); + //чтобы РЅРµ удалялся РЅР° destructor + oBgraFrame.put_Data(NULL); + return bRes; + } void CImage::Destroy() { if (NULL != m_pImgData) @@ -65,6 +87,8 @@ namespace Aggplus DWORD CImage::GetWidth() const { return(m_dwWidth); } DWORD CImage::GetHeight() const { return(m_dwHeight); } + long CImage::GetStride() const { return(m_nStride); } + BYTE* CImage::GetData() const { return(m_pImgData); } Status CImage::GetLastStatus() const { return(m_Status); } diff --git a/DesktopEditor/graphics/Image.h b/DesktopEditor/graphics/Image.h index a9c6b95e2c..03f4fad3a5 100644 --- a/DesktopEditor/graphics/Image.h +++ b/DesktopEditor/graphics/Image.h @@ -21,10 +21,14 @@ public: DWORD GetWidth() const; DWORD GetHeight() const; + long GetStride() const; + BYTE* GetData() const; Status GetLastStatus() const; void Create(const std::wstring& filename); + void Create(BYTE* pImgData, const DWORD& dwWidth, const DWORD& dwHeight, const long& nStride); + bool SaveFile(const std::wstring& strFileName, unsigned __int32 nFileType); void Destroy(); public: diff --git a/DesktopEditor/graphics/graphics_vs2005.vcproj b/DesktopEditor/graphics/graphics_vs2005.vcproj new file mode 100644 index 0000000000..36ed67723d --- /dev/null +++ b/DesktopEditor/graphics/graphics_vs2005.vcproj @@ -0,0 +1,282 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DesktopEditor/graphics/structures.h b/DesktopEditor/graphics/structures.h index e2840675b5..912740fd26 100644 --- a/DesktopEditor/graphics/structures.h +++ b/DesktopEditor/graphics/structures.h @@ -2,6 +2,7 @@ #define _BUILD_GRAPHICS_STRUCTURES_H_ #include "../common/Array.h" +#include "../graphics/aggplustypes.h" #include #include diff --git a/DesktopEditor/raster/BgraFrame.cpp b/DesktopEditor/raster/BgraFrame.cpp index 9f5fc58fde..959da87273 100644 --- a/DesktopEditor/raster/BgraFrame.cpp +++ b/DesktopEditor/raster/BgraFrame.cpp @@ -32,6 +32,19 @@ bool CBgraFrame::SaveFile(const std::wstring& strFileName, uint32_t nFileType) oFile.CloseFile(); return true; } +bool CBgraFrame::Resize(const long& nNewWidth, const long& nNewHeight) +{ + CxImage img; + if (!img.CreateFromArray(m_pData, m_lWidth, m_lHeight, 32, 4 * m_lWidth, (m_lStride >= 0) ? true : false)) + return false; + + CxImage imgDst; + if (!img.Resample( nNewWidth, nNewHeight, 2/*bicubic spline interpolation*/, &imgDst )) + return false; + + CxImageToMediaFrame( imgDst ); + return true; +} void CBgraFrame::CxImageToMediaFrame( CxImage& img ) { diff --git a/DesktopEditor/raster/BgraFrame.h b/DesktopEditor/raster/BgraFrame.h index 537197290e..c106318885 100644 --- a/DesktopEditor/raster/BgraFrame.h +++ b/DesktopEditor/raster/BgraFrame.h @@ -81,7 +81,7 @@ public: public: bool OpenFile(const std::wstring& strFileName); bool SaveFile(const std::wstring& strFileName, uint32_t nFileType); - + bool Resize(const long& nNewWidth, const long& nNewHeight); private: void CxImageToMediaFrame( CxImage& img ); diff --git a/DesktopEditor/raster/raster_vs2005.vcproj b/DesktopEditor/raster/raster_vs2005.vcproj new file mode 100644 index 0000000000..4c4d586e19 --- /dev/null +++ b/DesktopEditor/raster/raster_vs2005.vcproj @@ -0,0 +1,654 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +