Commit 27a51bca authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander Trofimov

переход от IASCRenderer к IRenderer из DesktopEditor; отказ от импорта длл...

переход от IASCRenderer к IRenderer из DesktopEditor; отказ от импорта длл ASCImageStudio3 ASCHTMLRenderer; от AscGraphics только FontPicker и FontManager.

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58742 954022d7-b5bf-4e40-9824-e11837661b57
parent 6924d8a8
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="ASCHTMLRenderer"
ProjectGUID="{DC24710E-8DF2-4A7A-B7C3-2313E294143C}"
RootNamespace="ASCHTMLRenderer"
Keyword="AtlProj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="4"
UseOfMFC="0"
UseOfATL="1"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/ASCHTMLRenderer.tlb"
HeaderFileName="HTMLRenderer.h"
DLLDataFileName=""
InterfaceIdentifierFileName="ASCHTMLRenderer_i.c"
ProxyFileName="ASCHTMLRenderer_p.c"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;../DesktopEditor/freetype-2.5.2/include&quot;;&quot;../DesktopEditor/agg-2.4/include&quot;"
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES;DESKTOP_EDITOR_GRAPHICS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1049"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="4"
UseOfATL="1"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="..\Redist\VersionControl.exe $(ProjectDir)version.h"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/ASCSHTMLRenderer.tlb"
HeaderFileName="HTMLRenderer.h"
DLLDataFileName=""
InterfaceIdentifierFileName="ASCHTMLRenderer_i.c"
ProxyFileName="ASCHTMLRenderer_p.c"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;../DesktopEditor/freetype-2.5.2/include&quot;;&quot;../DesktopEditor/agg-2.4/include&quot;"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES;DESKTOP_EDITOR_GRAPHICS"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1049"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description=""
CommandLine=""
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\ASCSVGWriter.cpp"
>
</File>
<File
RelativePath=".\CASCImage.cpp"
>
</File>
<File
RelativePath=".\CASCSVGRenderer.cpp"
>
</File>
<File
RelativePath=".\CMetafile.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\ASCSVGWriter.h"
>
</File>
<File
RelativePath=".\CASCImage.h"
>
</File>
<File
RelativePath=".\CASCSVGRenderer.h"
>
</File>
<File
RelativePath=".\CMetafile.h"
>
</File>
<File
RelativePath=".\Writer\Common.h"
>
</File>
<File
RelativePath=".\Writer\Const.h"
>
</File>
<File
RelativePath="..\DesktopEditor\editor\DibPainter.h"
>
</File>
<File
RelativePath=".\IBaseMatrixUpdater.h"
>
</File>
<File
RelativePath=".\Writer\TextItem.h"
>
</File>
</Filter>
<Filter
Name="Writer"
>
<File
RelativePath=".\Writer\CanvasWriter.h"
>
</File>
<File
RelativePath=".\Writer\StringWriter.h"
>
</File>
<File
RelativePath=".\Writer\SVGWriter.h"
>
</File>
<File
RelativePath=".\Writer\VectorGraphicsWriter2.h"
>
</File>
<File
RelativePath=".\Writer\VMLWriter.h"
>
</File>
</Filter>
<Filter
Name="WMF"
>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\RendererOutput.h"
>
</File>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\WmfCharsets.h"
>
</File>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\WmfCodePage1361.h"
>
</File>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\WmfCodePage932.h"
>
</File>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\WmfCodePage936.h"
>
</File>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\WmfCodePage949.h"
>
</File>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\WmfCodePage950.h"
>
</File>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\WmfColor.h"
>
</File>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\WmfFile.h"
>
</File>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\WmfMemory.h"
>
</File>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\WmfOutputDevice.h"
>
</File>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\WmfRegion.h"
>
</File>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\WmfTypes.h"
>
</File>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\WmfUtils.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef C_IMAGE_RENDERER
#define C_IMAGE_RENDERER
#ifdef _WIN32
#include <atlbase.h>
#include <atlstr.h>
#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
This diff is collapsed.
This diff is collapsed.
#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
#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
#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
......@@ -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;
......
#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;
......
#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:
......
......@@ -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:
......
#pragma once
#include "..\stdafx.h"
#include "StringWriter.h"
#include <atlbase.h>
#include <atlcoll.h>
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;
......
#pragma once
#include "..\stdafx.h"
#include "File.h"
#include "../../DesktopEditor/common/File.h"
#include "TextItem.h"
#include "Common.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;
......
#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;
......
......@@ -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"
#ifndef _WMF_TYPES_H_
#define _WMF_TYPES_H_
#ifdef DESKTOP_EDITOR_GRAPHICS
// freetype
#include <ft2build.h>
#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
//---------------------------------------------------------------------------------------------------
//
......
This diff is collapsed.
......@@ -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();
......
......@@ -47,6 +47,9 @@ namespace DocWrapper {
ASCGraphics::IASCFontManager* getFontManager() {
return fontManager;
}
CFontManager* getFontManager2() {
return m_pFontManager;
}
private:
void initFontManager();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -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
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment