Commit 15bb295c authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

теперь ServerComponents/HtmlRenderer

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@63668 954022d7-b5bf-4e40-9824-e11837661b57
parent 831ab545
......@@ -18,12 +18,6 @@ ASCHTMLRenderer/Resources/imgtrackbar/b_r.gif svn_mime_002dtype=application%2Foc
ASCHTMLRenderer/lib svnc_tsvn_003alogminsize=5
ASCHTMLRenderer/lib/include svnc_tsvn_003alogminsize=5
ASCHTMLRenderer/lib/src svnc_tsvn_003alogminsize=5
/ASCHTMLRenderer2 svnc_tsvn_003alogminsize=5
ASCHTMLRenderer2/Resources svnc_tsvn_003alogminsize=5
ASCHTMLRenderer2/lib svnc_tsvn_003alogminsize=5
ASCHTMLRenderer2/lib/include svnc_tsvn_003alogminsize=5
ASCHTMLRenderer2/lib/src svnc_tsvn_003alogminsize=5
ASCHTMLRenderer2/lib/test svnc_tsvn_003alogminsize=5
ASCImageStudio3/ASCGraphics/Expat/lib/libexpat.lib svn_mime_002dtype=application%2Foctet-stream
ASCImageStudio3/ASCGraphics/Objects/Font/FreeType/freetype242_vs2005.lib svn_mime_002dtype=application%2Foctet-stream
ASCImageStudio3/ASCGraphics/OfficeSvmFile/zlibstat.lib svn_mime_002dtype=application%2Foctet-stream
// ASCHTMLRenderer.cpp : Implementation of DLL Exports.
#include "stdafx.h"
#include "resource.h"
#include "HTMLRenderer.h"
#include "HTMLRenderer2.h"
#include "HTMLRenderer3.h"
// The module attribute causes DllMain, DllRegisterServer and DllUnregisterServer to be automatically implemented for you
[ module(dll, uuid = "{08DC1F03-6867-4585-B939-422C9078F5FD}",
name = "ASCHTMLRenderer",
helpstring = "ASCHTMLRenderer 1.0 Type Library",
resource_name = "IDR_ASCHTMLRENDERER") ]
class CASCHTMLRendererModule
{
public:
// Override CAtlDllModuleT members
};
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define COMPONENT_NAME "HTMLRenderer"
#include "../Common/FileInfo.h"
#include "version.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Russian resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
#ifdef _WIN32
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
#pragma code_page(1251)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // Russian resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION INTVER
PRODUCTVERSION INTVER
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", COMPANY_NAME
VALUE "FileDescription", FILE_DESCRIPTION_ACTIVEX
VALUE "FileVersion", STRVER
VALUE "InternalName", COMPONENT_FILE_NAME_DLL
VALUE "LegalCopyright", LEGAL_COPYRIGHT
VALUE "OriginalFilename", COMPONENT_FILE_NAME_DLL
VALUE "ProductName", FILE_DESCRIPTION_ACTIVEX
VALUE "ProductVersion", STRVER
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
/////////////////////////////////////////////////////////////////////////////
//
// REGISTRY
//
IDR_ASCHTMLRENDERER REGISTRY "ASCHTMLRenderer.rgs"
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_PROJNAME "ASCHTMLRenderer"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
HKCR
{
NoRemove AppID
{
'%APPID%' = s 'ASCHTMLRenderer'
'ASCHTMLRenderer.DLL'
{
val AppID = s '%APPID%'
}
}
}

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCHTMLRenderer", "ASCHTMLRenderer.vcxproj", "{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
ReleaseASC|Win32 = ReleaseASC|Win32
ReleaseASC|x64 = ReleaseASC|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{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|x64
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Debug|x64.Build.0 = Debug|x64
{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|x64
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Release|x64.Build.0 = Release|x64
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.ReleaseASC|Win32.ActiveCfg = Release|Win32
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.ReleaseASC|Win32.Build.0 = Release|Win32
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.ReleaseASC|x64.ActiveCfg = Release|x64
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.ReleaseASC|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
EndGlobalSection
EndGlobal
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="ASCHTMLRenderer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="HTMLRenderer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="HTMLRenderer2.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="HTMLRenderer3.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="HTMLRenderer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="HTMLRenderer2.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="HTMLRenderer3.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="version.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ASCHTMLRenderer.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<None Include="ASCHTMLRenderer.rgs">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
</Project>
\ No newline at end of file
This diff is collapsed.
#pragma once
#include "stdafx.h"
#include "resource.h" // main symbols
#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
// IASCHTMLRenderer
[ object, uuid("064C9A71-7852-4fd7-A5AF-16C3D601DCD2"), dual, pointer_default(unique) ]
__interface IASCHTMLRenderer: IASCRenderer
{
[id(5003), propget] HRESULT Mode([out, retval] LONG* plMode);
[id(5003), propput] HRESULT Mode([in] LONG lMode);
[id(5000)] HRESULT CreateOfficeFile([in] BSTR bsFileName);
[id(5001)] HRESULT CloseFile();
};
// _IASCHTMLRendererEvents
[uuid("B838358D-E3F5-40e0-A4DD-E8A95115E83C"), dispinterface]
__interface _IASCHTMLRendererEvents
{
};
// CASCHTMLRenderer
[ coclass, default(IASCHTMLRenderer), threading(apartment), event_source(com), vi_progid("AVSHTMLRend.Rend"), progid("AVSHTMLRend.Rend.1"), version(1.0), uuid("BEB6C6D1-EF98-42e7-AC2C-571E4301ECD6") ]
class ATL_NO_VTABLE CASCHTMLRenderer :
public IASCHTMLRenderer
{
private:
public:
__event __interface _IASCHTMLRendererEvents;
public:
DECLARE_PROTECT_FINAL_CONSTRUCT()
CASCHTMLRenderer();
~CASCHTMLRenderer()
{
}
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);
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);
STDMETHOD(get_Mode)(LONG* plMode);
STDMETHOD(put_Mode)(LONG lMode);
// --------------------------------------------------------------------------------------------
// file
STDMETHOD(CreateOfficeFile)(BSTR bsFilePath);
STDMETHOD(CloseFile)();
public:
HRESULT FinalConstruct();
void FinalRelease();
};
\ No newline at end of file
This diff is collapsed.
#pragma once
#include "stdafx.h"
#include "resource.h" // main symbols
#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
// IASCHTMLRenderer
[ object, uuid("7E973D3E-34ED-45ea-90A4-775E70AEBE0B"), dual, pointer_default(unique) ]
__interface IASCHTMLRenderer2: IASCRenderer
{
[id(5003), propget] HRESULT Mode([out, retval] LONG* plMode);
[id(5003), propput] HRESULT Mode([in] LONG lMode);
[id(5000)] HRESULT CreateOfficeFile([in] BSTR bsFileName);
[id(5001)] HRESULT CloseFile();
};
// _IASCHTMLRendererEvents
[uuid("9B423367-F5BD-4bfa-8858-EC34049EC248"), dispinterface]
__interface _IASCHTMLRenderer2Events
{
};
// CASCHTMLRenderer
[ coclass, default(IASCHTMLRenderer2), threading(apartment), event_source(com), vi_progid("AVSHTMLRend.Rend2"), progid("AVSHTMLRend.Rend2.1"), version(1.0), uuid("310AD7B8-4A70-47d6-815E-A20A71B2AE59") ]
class ATL_NO_VTABLE CASCHTMLRenderer2 :
public IASCHTMLRenderer2
{
private:
public:
__event __interface _IASCHTMLRenderer2Events;
public:
DECLARE_PROTECT_FINAL_CONSTRUCT()
CASCHTMLRenderer2()
{
}
~CASCHTMLRenderer2()
{
}
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);
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);
STDMETHOD(get_Mode)(LONG* plMode);
STDMETHOD(put_Mode)(LONG lMode);
// --------------------------------------------------------------------------------------------
// file
STDMETHOD(CreateOfficeFile)(BSTR bsFilePath);
STDMETHOD(CloseFile)();
public:
HRESULT FinalConstruct();
void FinalRelease();
};
\ No newline at end of file
This diff is collapsed.
#pragma once
#include "stdafx.h"
#include "resource.h" // main symbols
#include "HtmlRenderer2.h"
#include "lib\include\HTMLRenderer3.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
// CASCHTMLRenderer
[ coclass, default(IASCHTMLRenderer2), threading(apartment), event_source(com), vi_progid("AVSHTMLRend.Rend3"), progid("AVSHTMLRend.Rend3.1"), version(1.0), uuid("6B2D3D65-16FE-41c1-AF76-E2D3F6754B90") ]
class ATL_NO_VTABLE CASCHTMLRenderer3 :
public IASCHTMLRenderer2
{
private:
NSHtmlRenderer::CASCHTMLRenderer3 m_oRenderer;
public:
__event __interface _IASCHTMLRenderer2Events;
public:
DECLARE_PROTECT_FINAL_CONSTRUCT()
CASCHTMLRenderer3() : m_oRenderer()
{
}
~CASCHTMLRenderer3()
{
}
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);
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);
STDMETHOD(get_Mode)(LONG* plMode);
STDMETHOD(put_Mode)(LONG lMode);
// --------------------------------------------------------------------------------------------
// file
STDMETHOD(CreateOfficeFile)(BSTR bsFilePath);
STDMETHOD(CloseFile)();
public:
HRESULT FinalConstruct();
void FinalRelease();
};
\ No newline at end of file
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by ASCHTMLRenderer.rc
//
#define IDS_PROJNAME 100
#define IDR_ASCHTMLRENDERER 101
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 401
#define _APS_NEXT_COMMAND_VALUE 32768
#define _APS_NEXT_CONTROL_VALUE 201
#define _APS_NEXT_SYMED_VALUE 102
#endif
#endif
/*********************************************************
DllData file -- generated by MIDL compiler
DO NOT ALTER THIS FILE
This file is regenerated by MIDL on every IDL file compile.
To completely reconstruct this file, delete it and rerun MIDL
on all the IDL files in this DLL, specifying this file for the
/dlldata command line option
*********************************************************/
#define PROXY_DELEGATION
#include <rpcproxy.h>
#ifdef __cplusplus
extern "C" {
#endif
EXTERN_PROXY_FILE( _ASCHTMLRenderer )
PROXYFILE_LIST_START
/* Start of list */
REFERENCE_PROXY_FILE( _ASCHTMLRenderer ),
/* End of list */
PROXYFILE_LIST_END
DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
#ifdef __cplusplus
} /*extern "C" */
#endif
/* end of generated dlldata file */
#-------------------------------------------------
#
# Project created by QtCreator 2015-01-19T10:22:14
#
#-------------------------------------------------
QT -= core
QT -= gui
TARGET = aschtmlrenderer
TEMPLATE = lib
CONFIG += staticlib
QMAKE_CXXFLAGS += -std=c++11
#################### WINDOWS #####################
win32 {
DEFINES += \
WIN32
CONFIG(debug, debug|release) {
LIBS += -L../../../DesktopEditor/Qt_build/graphics/Debug/debug -lgraphics
} else {
LIBS += -L../../../DesktopEditor/Qt_build/graphics/Release/release -lgraphics
}
}
##################################################
################### LINUX ########################
linux-g++ | linux-g++-64 | linux-g++-32 {
DEFINES += \
LINUX \
_LINUX \
_LINUX_QT \
LIBS += -L../../../DesktopEditor/Qt_build/graphics/Release -lgraphics
}
linux-g++:contains(QMAKE_HOST.arch, x86_64):{
message(linux64)
}
linux-g++:!contains(QMAKE_HOST.arch, x86_64):{
message(linux32)
}
##################################################
INCLUDEPATH += \
../../DesktopEditor/agg-2.4/include \
../../DesktopEditor/freetype-2.5.2/include
SOURCES += \
src/HTMLRenderer3.cpp
HEADERS += \
src/CanvasWriter.h \
src/Common.h \
src/Document.h \
src/FontManager.h \
src/FontManagerBase.h \
src/SVGWriter.h \
src/SVGWriter2.h \
src/Text.h \
src/VectorGraphicsWriter.h \
src/VectorGraphicsWriter2.h \
src/VMLWriter.h \
src/Writer.h \
include/HTMLRenderer3.h
unix {
target.path = /usr/lib
INSTALLS += target
}
#ifndef _ASC_HTMLRENDERER1_H_
#define _ASC_HTMLRENDERER1_H_
#include "../../../DesktopEditor/graphics/IRenderer.h"
class CASCHTMLRenderer_Private;
class CASCHTMLRenderer : public IRenderer
{
public:
CASCHTMLRenderer();
~CASCHTMLRenderer();
public:
// тип рендерера-----------------------------------------------------------------------------
virtual HRESULT get_Type(LONG* lType);
//-------- Функции для работы со страницей --------------------------------------------------
virtual HRESULT NewPage();
virtual HRESULT get_Height(double* dHeight);
virtual HRESULT put_Height(const double& dHeight);
virtual HRESULT get_Width(double* dWidth);
virtual HRESULT put_Width(const double& dWidth);
virtual HRESULT get_DpiX(double* dDpiX);
virtual HRESULT get_DpiY(double* dDpiY);
// pen --------------------------------------------------------------------------------------
virtual HRESULT get_PenColor(LONG* lColor);
virtual HRESULT put_PenColor(const LONG& lColor);
virtual HRESULT get_PenAlpha(LONG* lAlpha);
virtual HRESULT put_PenAlpha(const LONG& lAlpha);
virtual HRESULT get_PenSize(double* dSize);
virtual HRESULT put_PenSize(const double& dSize);
virtual HRESULT get_PenDashStyle(BYTE* val);
virtual HRESULT put_PenDashStyle(const BYTE& val);
virtual HRESULT get_PenLineStartCap(BYTE* val);
virtual HRESULT put_PenLineStartCap(const BYTE& val);
virtual HRESULT get_PenLineEndCap(BYTE* val);
virtual HRESULT put_PenLineEndCap(const BYTE& val);
virtual HRESULT get_PenLineJoin(BYTE* val);
virtual HRESULT put_PenLineJoin(const BYTE& val);
virtual HRESULT get_PenDashOffset(double* dOffset);
virtual HRESULT put_PenDashOffset(const double& dOffset);
virtual HRESULT get_PenAlign(LONG* lAlign);
virtual HRESULT put_PenAlign(const LONG& lAlign);
virtual HRESULT get_PenMiterLimit(double* dOffset);
virtual HRESULT put_PenMiterLimit(const double& dOffset);
virtual HRESULT PenDashPattern(double* pPattern, LONG lCount);
// brush ------------------------------------------------------------------------------------
virtual HRESULT get_BrushType(LONG* lType);
virtual HRESULT put_BrushType(const LONG& lType);
virtual HRESULT get_BrushColor1(LONG* lColor);
virtual HRESULT put_BrushColor1(const LONG& lColor);
virtual HRESULT get_BrushAlpha1(LONG* lAlpha);
virtual HRESULT put_BrushAlpha1(const LONG& lAlpha);
virtual HRESULT get_BrushColor2(LONG* lColor);
virtual HRESULT put_BrushColor2(const LONG& lColor);
virtual HRESULT get_BrushAlpha2(LONG* lAlpha);
virtual HRESULT put_BrushAlpha2(const LONG& lAlpha);
virtual HRESULT get_BrushTexturePath(std::wstring* bsPath);
virtual HRESULT put_BrushTexturePath(const std::wstring& bsPath);
virtual HRESULT get_BrushTextureMode(LONG* lMode);
virtual HRESULT put_BrushTextureMode(const LONG& lMode);
virtual HRESULT get_BrushTextureAlpha(LONG* lTxAlpha);
virtual HRESULT put_BrushTextureAlpha(const LONG& lTxAlpha);
virtual HRESULT get_BrushLinearAngle(double* dAngle);
virtual HRESULT put_BrushLinearAngle(const double& dAngle);
virtual HRESULT BrushRect(const INT& val, const double& left, const double& top, const double& width, const double& height);
virtual HRESULT BrushBounds(const double& left, const double& top, const double& width, const double& height);
virtual HRESULT put_BrushGradientColors(LONG* lColors, double* pPositions, LONG nCount);
// font -------------------------------------------------------------------------------------
virtual HRESULT get_FontName(std::wstring* bsName);
virtual HRESULT put_FontName(const std::wstring& bsName);
virtual HRESULT get_FontPath(std::wstring* bsName);
virtual HRESULT put_FontPath(const std::wstring& bsName);
virtual HRESULT get_FontSize(double* dSize);
virtual HRESULT put_FontSize(const double& dSize);
virtual HRESULT get_FontStyle(LONG* lStyle);
virtual HRESULT put_FontStyle(const LONG& lStyle);
virtual HRESULT get_FontStringGID(INT* bGID);
virtual HRESULT put_FontStringGID(const INT& bGID);
virtual HRESULT get_FontCharSpace(double* dSpace);
virtual HRESULT put_FontCharSpace(const double& dSpace);
virtual HRESULT get_FontFaceIndex(int* lFaceIndex);
virtual HRESULT put_FontFaceIndex(const int& lFaceIndex);
//-------- Функции для вывода текста --------------------------------------------------------
virtual HRESULT CommandDrawTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT CommandDrawText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT CommandDrawTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT CommandDrawTextEx(const std::wstring& bsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h);
//-------- Маркеры для команд ---------------------------------------------------------------
virtual HRESULT BeginCommand(const DWORD& lType);
virtual HRESULT EndCommand(const DWORD& lType);
//-------- Функции для работы с Graphics Path -----------------------------------------------
virtual HRESULT PathCommandMoveTo(const double& x, const double& y);
virtual HRESULT PathCommandLineTo(const double& x, const double& y);
virtual HRESULT PathCommandLinesTo(double* points, const int& count);
virtual HRESULT PathCommandCurveTo(const double& x1, const double& y1, const double& x2, const double& y2, const double& x3, const double& y3);
virtual HRESULT PathCommandCurvesTo(double* points, const int& count);
virtual HRESULT PathCommandArcTo(const double& x, const double& y, const double& w, const double& h, const double& startAngle, const double& sweepAngle);
virtual HRESULT PathCommandClose();
virtual HRESULT PathCommandEnd();
virtual HRESULT DrawPath(const LONG& nType);
virtual HRESULT PathCommandStart();
virtual HRESULT PathCommandGetCurrentPoint(double* x, double* y);
virtual HRESULT PathCommandTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT PathCommandText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT PathCommandTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT PathCommandTextEx(const std::wstring& bsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h);
//-------- Функции для вывода изображений ---------------------------------------------------
virtual HRESULT DrawImage(IGrObject* pImage, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT DrawImageFromFile(const std::wstring&, const double& x, const double& y, const double& w, const double& h, const BYTE& lAlpha = 255);
// transform --------------------------------------------------------------------------------
virtual HRESULT SetTransform(const double& m1, const double& m2, const double& m3, const double& m4, const double& m5, const double& m6);
virtual HRESULT GetTransform(double *pdA, double *pdB, double *pdC, double *pdD, double *pdE, double *pdF);
virtual HRESULT ResetTransform();
// -----------------------------------------------------------------------------------------
virtual HRESULT get_ClipMode(LONG* plMode);
virtual HRESULT put_ClipMode(const LONG& lMode);
// additiaonal params ----------------------------------------------------------------------
virtual HRESULT CommandLong(const LONG& lType, const LONG& lCommand);
virtual HRESULT CommandDouble(const LONG& lType, const double& dCommand);
virtual HRESULT CommandString(const LONG& lType, const std::wstring& sCommand);
// owner params ----------------------------------------------------------------------
virtual HRESULT get_Mode(LONG *plMode);
virtual HRESULT put_Mode(LONG lMode);
virtual HRESULT CreateOfficeFile(std::wstring bsFileName);
virtual HRESULT CloseFile();
virtual HRESULT SetAdditionalParam(std::string sParamName, int nValue);
protected:
CASCHTMLRenderer_Private* m_pInternal;
};
#endif // _ASC_HTMLRENDERER1_H_
#ifndef _ASC_HTMLRENDERER2_H_
#define _ASC_HTMLRENDERER2_H_
#include "../../../DesktopEditor/graphics/IRenderer.h"
class CASCHTMLRenderer2_Private;
class CASCHTMLRenderer2 : public IRenderer
{
public:
// тип рендерера-----------------------------------------------------------------------------
virtual HRESULT get_Type(LONG* lType);
//-------- Функции для работы со страницей --------------------------------------------------
virtual HRESULT NewPage();
virtual HRESULT get_Height(double* dHeight);
virtual HRESULT put_Height(const double& dHeight);
virtual HRESULT get_Width(double* dWidth);
virtual HRESULT put_Width(const double& dWidth);
virtual HRESULT get_DpiX(double* dDpiX);
virtual HRESULT get_DpiY(double* dDpiY);
// pen --------------------------------------------------------------------------------------
virtual HRESULT get_PenColor(LONG* lColor);
virtual HRESULT put_PenColor(const LONG& lColor);
virtual HRESULT get_PenAlpha(LONG* lAlpha);
virtual HRESULT put_PenAlpha(const LONG& lAlpha);
virtual HRESULT get_PenSize(double* dSize);
virtual HRESULT put_PenSize(const double& dSize);
virtual HRESULT get_PenDashStyle(BYTE* val);
virtual HRESULT put_PenDashStyle(const BYTE& val);
virtual HRESULT get_PenLineStartCap(BYTE* val);
virtual HRESULT put_PenLineStartCap(const BYTE& val);
virtual HRESULT get_PenLineEndCap(BYTE* val);
virtual HRESULT put_PenLineEndCap(const BYTE& val);
virtual HRESULT get_PenLineJoin(BYTE* val);
virtual HRESULT put_PenLineJoin(const BYTE& val);
virtual HRESULT get_PenDashOffset(double* dOffset);
virtual HRESULT put_PenDashOffset(const double& dOffset);
virtual HRESULT get_PenAlign(LONG* lAlign);
virtual HRESULT put_PenAlign(const LONG& lAlign);
virtual HRESULT get_PenMiterLimit(double* dOffset);
virtual HRESULT put_PenMiterLimit(const double& dOffset);
virtual HRESULT PenDashPattern(double* pPattern, LONG lCount);
// brush ------------------------------------------------------------------------------------
virtual HRESULT get_BrushType(LONG* lType);
virtual HRESULT put_BrushType(const LONG& lType);
virtual HRESULT get_BrushColor1(LONG* lColor);
virtual HRESULT put_BrushColor1(const LONG& lColor);
virtual HRESULT get_BrushAlpha1(LONG* lAlpha);
virtual HRESULT put_BrushAlpha1(const LONG& lAlpha);
virtual HRESULT get_BrushColor2(LONG* lColor);
virtual HRESULT put_BrushColor2(const LONG& lColor);
virtual HRESULT get_BrushAlpha2(LONG* lAlpha);
virtual HRESULT put_BrushAlpha2(const LONG& lAlpha);
virtual HRESULT get_BrushTexturePath(std::wstring* bsPath);
virtual HRESULT put_BrushTexturePath(const std::wstring& bsPath);
virtual HRESULT get_BrushTextureMode(LONG* lMode);
virtual HRESULT put_BrushTextureMode(const LONG& lMode);
virtual HRESULT get_BrushTextureAlpha(LONG* lTxAlpha);
virtual HRESULT put_BrushTextureAlpha(const LONG& lTxAlpha);
virtual HRESULT get_BrushLinearAngle(double* dAngle);
virtual HRESULT put_BrushLinearAngle(const double& dAngle);
virtual HRESULT BrushRect(const INT& val, const double& left, const double& top, const double& width, const double& height);
virtual HRESULT BrushBounds(const double& left, const double& top, const double& width, const double& height);
virtual HRESULT put_BrushGradientColors(LONG* lColors, double* pPositions, LONG nCount);
// font -------------------------------------------------------------------------------------
virtual HRESULT get_FontName(std::wstring* bsName);
virtual HRESULT put_FontName(const std::wstring& bsName);
virtual HRESULT get_FontPath(std::wstring* bsName);
virtual HRESULT put_FontPath(const std::wstring& bsName);
virtual HRESULT get_FontSize(double* dSize);
virtual HRESULT put_FontSize(const double& dSize);
virtual HRESULT get_FontStyle(LONG* lStyle);
virtual HRESULT put_FontStyle(const LONG& lStyle);
virtual HRESULT get_FontStringGID(INT* bGID);
virtual HRESULT put_FontStringGID(const INT& bGID);
virtual HRESULT get_FontCharSpace(double* dSpace);
virtual HRESULT put_FontCharSpace(const double& dSpace);
virtual HRESULT get_FontFaceIndex(int* lFaceIndex);
virtual HRESULT put_FontFaceIndex(const int& lFaceIndex);
//-------- Функции для вывода текста --------------------------------------------------------
virtual HRESULT CommandDrawTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT CommandDrawText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT CommandDrawTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT CommandDrawTextEx(const std::wstring& bsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h);
//-------- Маркеры для команд ---------------------------------------------------------------
virtual HRESULT BeginCommand(const DWORD& lType);
virtual HRESULT EndCommand(const DWORD& lType);
//-------- Функции для работы с Graphics Path -----------------------------------------------
virtual HRESULT PathCommandMoveTo(const double& x, const double& y);
virtual HRESULT PathCommandLineTo(const double& x, const double& y);
virtual HRESULT PathCommandLinesTo(double* points, const int& count);
virtual HRESULT PathCommandCurveTo(const double& x1, const double& y1, const double& x2, const double& y2, const double& x3, const double& y3);
virtual HRESULT PathCommandCurvesTo(double* points, const int& count);
virtual HRESULT PathCommandArcTo(const double& x, const double& y, const double& w, const double& h, const double& startAngle, const double& sweepAngle);
virtual HRESULT PathCommandClose();
virtual HRESULT PathCommandEnd();
virtual HRESULT DrawPath(const LONG& nType);
virtual HRESULT PathCommandStart();
virtual HRESULT PathCommandGetCurrentPoint(double* x, double* y);
virtual HRESULT PathCommandTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT PathCommandText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT PathCommandTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT PathCommandTextEx(const std::wstring& bsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h);
//-------- Функции для вывода изображений ---------------------------------------------------
virtual HRESULT DrawImage(IGrObject* pImage, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT DrawImageFromFile(const std::wstring&, const double& x, const double& y, const double& w, const double& h, const BYTE& lAlpha = 255);
// transform --------------------------------------------------------------------------------
virtual HRESULT SetTransform(const double& m1, const double& m2, const double& m3, const double& m4, const double& m5, const double& m6);
virtual HRESULT GetTransform(double *pdA, double *pdB, double *pdC, double *pdD, double *pdE, double *pdF);
virtual HRESULT ResetTransform();
// -----------------------------------------------------------------------------------------
virtual HRESULT get_ClipMode(LONG* plMode);
virtual HRESULT put_ClipMode(const LONG& lMode);
// additiaonal params ----------------------------------------------------------------------
virtual HRESULT CommandLong(const LONG& lType, const LONG& lCommand);
virtual HRESULT CommandDouble(const LONG& lType, const double& dCommand);
virtual HRESULT CommandString(const LONG& lType, const std::wstring& sCommand);
// owner params ----------------------------------------------------------------------
virtual HRESULT get_Mode(LONG *plMode);
virtual HRESULT put_Mode(LONG lMode);
virtual HRESULT CreateOfficeFile(std::wstring bsFileName);
virtual HRESULT CloseFile();
virtual HRESULT SetAdditionalParam(std::string sParamName, int nValue);
protected:
CASCHTMLRenderer2_Private* m_pInternal;
};
#endif // _ASC_HTMLRENDERER2_H_
#ifndef _ASC_HTMLRENDERER3_H_
#define _ASC_HTMLRENDERER3_H_
#include "../../../DesktopEditor/graphics/IRenderer.h"
namespace NSHtmlRenderer
{
class CASCHTMLRenderer3_Private;
class CASCHTMLRenderer3 : public IRenderer
{
public:
CASCHTMLRenderer3();
virtual ~CASCHTMLRenderer3();
public:
// тип рендерера-----------------------------------------------------------------------------
virtual HRESULT get_Type(LONG* lType);
//-------- Функции для работы со страницей --------------------------------------------------
virtual HRESULT NewPage();
virtual HRESULT get_Height(double* dHeight);
virtual HRESULT put_Height(const double& dHeight);
virtual HRESULT get_Width(double* dWidth);
virtual HRESULT put_Width(const double& dWidth);
virtual HRESULT get_DpiX(double* dDpiX);
virtual HRESULT get_DpiY(double* dDpiY);
// pen --------------------------------------------------------------------------------------
virtual HRESULT get_PenColor(LONG* lColor);
virtual HRESULT put_PenColor(const LONG& lColor);
virtual HRESULT get_PenAlpha(LONG* lAlpha);
virtual HRESULT put_PenAlpha(const LONG& lAlpha);
virtual HRESULT get_PenSize(double* dSize);
virtual HRESULT put_PenSize(const double& dSize);
virtual HRESULT get_PenDashStyle(BYTE* val);
virtual HRESULT put_PenDashStyle(const BYTE& val);
virtual HRESULT get_PenLineStartCap(BYTE* val);
virtual HRESULT put_PenLineStartCap(const BYTE& val);
virtual HRESULT get_PenLineEndCap(BYTE* val);
virtual HRESULT put_PenLineEndCap(const BYTE& val);
virtual HRESULT get_PenLineJoin(BYTE* val);
virtual HRESULT put_PenLineJoin(const BYTE& val);
virtual HRESULT get_PenDashOffset(double* dOffset);
virtual HRESULT put_PenDashOffset(const double& dOffset);
virtual HRESULT get_PenAlign(LONG* lAlign);
virtual HRESULT put_PenAlign(const LONG& lAlign);
virtual HRESULT get_PenMiterLimit(double* dOffset);
virtual HRESULT put_PenMiterLimit(const double& dOffset);
virtual HRESULT PenDashPattern(double* pPattern, LONG lCount);
// brush ------------------------------------------------------------------------------------
virtual HRESULT get_BrushType(LONG* lType);
virtual HRESULT put_BrushType(const LONG& lType);
virtual HRESULT get_BrushColor1(LONG* lColor);
virtual HRESULT put_BrushColor1(const LONG& lColor);
virtual HRESULT get_BrushAlpha1(LONG* lAlpha);
virtual HRESULT put_BrushAlpha1(const LONG& lAlpha);
virtual HRESULT get_BrushColor2(LONG* lColor);
virtual HRESULT put_BrushColor2(const LONG& lColor);
virtual HRESULT get_BrushAlpha2(LONG* lAlpha);
virtual HRESULT put_BrushAlpha2(const LONG& lAlpha);
virtual HRESULT get_BrushTexturePath(std::wstring* bsPath);
virtual HRESULT put_BrushTexturePath(const std::wstring& bsPath);
virtual HRESULT get_BrushTextureMode(LONG* lMode);
virtual HRESULT put_BrushTextureMode(const LONG& lMode);
virtual HRESULT get_BrushTextureAlpha(LONG* lTxAlpha);
virtual HRESULT put_BrushTextureAlpha(const LONG& lTxAlpha);
virtual HRESULT get_BrushLinearAngle(double* dAngle);
virtual HRESULT put_BrushLinearAngle(const double& dAngle);
virtual HRESULT BrushRect(const INT& val, const double& left, const double& top, const double& width, const double& height);
virtual HRESULT BrushBounds(const double& left, const double& top, const double& width, const double& height);
virtual HRESULT put_BrushGradientColors(LONG* lColors, double* pPositions, LONG nCount);
// font -------------------------------------------------------------------------------------
virtual HRESULT get_FontName(std::wstring* bsName);
virtual HRESULT put_FontName(const std::wstring& bsName);
virtual HRESULT get_FontPath(std::wstring* bsName);
virtual HRESULT put_FontPath(const std::wstring& bsName);
virtual HRESULT get_FontSize(double* dSize);
virtual HRESULT put_FontSize(const double& dSize);
virtual HRESULT get_FontStyle(LONG* lStyle);
virtual HRESULT put_FontStyle(const LONG& lStyle);
virtual HRESULT get_FontStringGID(INT* bGID);
virtual HRESULT put_FontStringGID(const INT& bGID);
virtual HRESULT get_FontCharSpace(double* dSpace);
virtual HRESULT put_FontCharSpace(const double& dSpace);
virtual HRESULT get_FontFaceIndex(int* lFaceIndex);
virtual HRESULT put_FontFaceIndex(const int& lFaceIndex);
//-------- Функции для вывода текста --------------------------------------------------------
virtual HRESULT CommandDrawTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT CommandDrawText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT CommandDrawTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT CommandDrawTextEx(const std::wstring& bsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h);
//-------- Маркеры для команд ---------------------------------------------------------------
virtual HRESULT BeginCommand(const DWORD& lType);
virtual HRESULT EndCommand(const DWORD& lType);
//-------- Функции для работы с Graphics Path -----------------------------------------------
virtual HRESULT PathCommandMoveTo(const double& x, const double& y);
virtual HRESULT PathCommandLineTo(const double& x, const double& y);
virtual HRESULT PathCommandLinesTo(double* points, const int& count);
virtual HRESULT PathCommandCurveTo(const double& x1, const double& y1, const double& x2, const double& y2, const double& x3, const double& y3);
virtual HRESULT PathCommandCurvesTo(double* points, const int& count);
virtual HRESULT PathCommandArcTo(const double& x, const double& y, const double& w, const double& h, const double& startAngle, const double& sweepAngle);
virtual HRESULT PathCommandClose();
virtual HRESULT PathCommandEnd();
virtual HRESULT DrawPath(const LONG& nType);
virtual HRESULT PathCommandStart();
virtual HRESULT PathCommandGetCurrentPoint(double* x, double* y);
virtual HRESULT PathCommandTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT PathCommandText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT PathCommandTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT PathCommandTextEx(const std::wstring& bsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h);
//-------- Функции для вывода изображений ---------------------------------------------------
virtual HRESULT DrawImage(IGrObject* pImage, const double& x, const double& y, const double& w, const double& h);
virtual HRESULT DrawImageFromFile(const std::wstring&, const double& x, const double& y, const double& w, const double& h, const BYTE& lAlpha = 255);
// transform --------------------------------------------------------------------------------
virtual HRESULT SetTransform(const double& m1, const double& m2, const double& m3, const double& m4, const double& m5, const double& m6);
virtual HRESULT GetTransform(double *pdA, double *pdB, double *pdC, double *pdD, double *pdE, double *pdF);
virtual HRESULT ResetTransform();
// -----------------------------------------------------------------------------------------
virtual HRESULT get_ClipMode(LONG* plMode);
virtual HRESULT put_ClipMode(const LONG& lMode);
// additiaonal params ----------------------------------------------------------------------
virtual HRESULT CommandLong(const LONG& lType, const LONG& lCommand);
virtual HRESULT CommandDouble(const LONG& lType, const double& dCommand);
virtual HRESULT CommandString(const LONG& lType, const std::wstring& sCommand);
// owner params ----------------------------------------------------------------------
virtual HRESULT get_Mode(LONG *plMode);
virtual HRESULT put_Mode(LONG lMode);
virtual HRESULT CreateOfficeFile(std::wstring bsFileName);
virtual HRESULT CloseFile();
virtual HRESULT SetAdditionalParam(std::string sParamName, int nValue);
virtual HRESULT SetAdditionalParam(std::string sParamName, const std::wstring& sParam);
protected:
CASCHTMLRenderer3_Private* m_pInternal;
};
}
#endif // _ASC_HTMLRENDERER3_H_
#ifndef _ASC_HTMLRENDERER_CANVASWRITER_H_
#define _ASC_HTMLRENDERER_CANVASWRITER_H_
#include "Common.h"
#include "../../../DesktopEditor/graphics/GraphicsPath.h"
namespace NSHtmlRenderer
{
class CCanvasWriter
{
public:
NSStringUtils::CStringBuilder m_oPath;
NSStringUtils::CStringBuilder m_oDocument;
LONG m_lCurDocumentID;
LONG m_lClippingPath;
bool m_bIsClipping;
LONG m_lClipMode;
bool m_bIsMoveTo;
NSStructures::CPen* m_pPen;
NSStructures::CBrush* m_pBrush;
double m_lWidth;
double m_lHeight;
double m_dDpiX;
double m_dDpiY;
public:
CCanvasWriter() : m_oPath(), m_oDocument()
{
m_lCurDocumentID = 0;
m_lClippingPath = 0;
m_pPen = NULL;
m_pBrush = NULL;
m_dDpiX = 96;
m_dDpiY = 96;
m_lClipMode = c_nWindingFillMode;
m_bIsClipping = false;
m_bIsMoveTo = false;
}
void SetSettings(NSStructures::CPen* pPen, NSStructures::CBrush* pBrush)
{
m_pPen = pPen;
m_pBrush = pBrush;
}
void CloseFile(std::wstring strFile = L"")
{
if (!strFile.empty())
{
NSFile::CFileBinary::SaveToFile(strFile, m_oDocument.GetData());
}
m_oDocument.ClearNoAttack();
m_oPath.ClearNoAttack();
}
void NewDocument(double& dWidth, double& dHeigth)
{
CloseFile(L"");
m_lWidth = (int)dWidth;
m_lHeight = (int)dHeigth;
}
public:
inline void WritePathEnd()
{
}
inline void WritePathStart()
{
m_bIsMoveTo = false;
m_oDocument.WriteString(L"b(c);\n", 6);
}
void WritePathClose()
{
m_oDocument.WriteString(L"x(c);\n", 6);
}
void WritePathMoveTo(double& x, double& y)
{
m_oDocument.WriteString(L"m(c,", 4);
WriteIntsToStringBuilder(round(x), round(y), &m_oDocument);
m_oDocument.WriteString(L");\n", 3);
m_bIsMoveTo = true;
}
void WritePathLineTo(double& x, double& y)
{
if (false == m_bIsMoveTo)
WritePathMoveTo(x, y);
m_oDocument.WriteString(L"l(c,", 4);
WriteIntsToStringBuilder(round(x), round(y), &m_oDocument);
m_oDocument.WriteString(L");\n", 3);
}
void WritePathCurveTo(double& x1, double& y1, double& x2, double& y2, double& x3, double& y3)
{
if (false == m_bIsMoveTo)
WritePathMoveTo(x1, y1);
m_oDocument.WriteString(L"cu(c,", 5);
WriteIntsToStringBuilder(round(x1), round(y1), round(x2), round(y2), round(x3), round(y3), &m_oDocument);
m_oDocument.WriteString(L");\n", 3);
}
void WriteDrawPath(LONG lType, Aggplus::CMatrix* pTransform, Aggplus::CGraphicsPathSimpleConverter* pConverter, LONG lTxId)
{
bool bStroke = false;
if (m_pPen->Alpha == 0)
lType &= 0xFF00;
if ((-1 == lTxId) && (0 == m_pBrush->Alpha1))
lType &= 0xFF;
if ((lType & 0x01) == 0x01)
{
SetStrokeColor(m_pPen->Color, m_pPen->Alpha, &m_oDocument);
bStroke = true;
}
if (lType > 0x01)
{
if (-1 != lTxId)
{
// текстура!
double x = 0;
double y = 0;
double w = 0;
double h = 0;
pConverter->PathCommandGetBounds(x, y, w, h);
double r = x + w;
double b = y + h;
pTransform->TransformPoint(x, y);
pTransform->TransformPoint(r, b);
w = r - x;
h = b - y;
m_oDocument.WriteString(L"img", 3);
m_oDocument.AddInt(lTxId);
m_oDocument.WriteString(L".src = \"media\\\\image", 20);
m_oDocument.AddInt(lTxId);
m_oDocument.WriteString(L".jpg\";img", 9);
m_oDocument.AddInt(lTxId);
m_oDocument.WriteString(L".onload = function(){c.drawImage(img", 36);
WriteIntsToStringBuilder(lTxId, round(x), round(y), round(w), round(h), &m_oDocument);
m_oDocument.WriteString(L");drawpage", 10);
m_oDocument.AddInt(m_lCurDocumentID);
m_oDocument.AddCharSafe('_');
m_oDocument.AddInt(lTxId);
m_oDocument.WriteString(L"(c);};\n}\nfunction drawpage", 26);
m_oDocument.AddInt(m_lCurDocumentID);
m_oDocument.AddCharSafe('_');
m_oDocument.AddInt(lTxId);
m_oDocument.WriteString(L"(c)\n{\n", 6);
}
else
{
SetFillColor(m_pBrush->Color1, m_pBrush->Alpha1, &m_oDocument);
m_oDocument.WriteString(L"f(c);\n", 6);
}
}
if (bStroke)
{
m_oDocument.WriteString(L"s(c);\n", 6);
}
}
void WritePathClip()
{
m_bIsClipping = true;
++m_lClippingPath;
}
void WritePathClipEnd()
{
if (!m_bIsClipping)
{
m_oDocument.WriteString(L"c.save();\n", 10);
}
m_bIsClipping = true;
m_oDocument.WriteString(L"c.clip();\n", 10);
}
void WritePathResetClip()
{
if (m_bIsClipping)
{
m_oDocument.WriteString(L"c.restore();\n", 13);
}
m_bIsClipping = false;
}
inline void WriteStyleClip()
{
}
};
}
#endif // _ASC_HTMLRENDERER_CANVASWRITER_H_
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#include "../include/HTMLRenderer2.h"
#include "./Common.h"
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.
#include <QCoreApplication>
#include "../../../PdfReader/PdfReader.h"
#include "../include/HTMLRenderer3.h"
#include "../../../DesktopEditor/fontengine/ApplicationFonts.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
//std::wstring sFile = L"\\\\KIRILLOV8\\_Office\\PDF\\Android intro(2p).pdf";
std::wstring sFile = L"\\\\kirillov8\\_Office\\PDF\\Main Window(15p).pdf";
CApplicationFonts oFonts;
oFonts.Initialize();
PdfReader::CPdfReader oReader(&oFonts);
oReader.SetTempFolder(L"D:\\test\\Document");
bool bResult = oReader.LoadFromFile(sFile.c_str());
NSHtmlRenderer::CASCHTMLRenderer3 oHtmlRenderer;
oHtmlRenderer.CreateOfficeFile(L"D:\\test\\Document");
int nPagesCount = oReader.GetPagesCount();
for (int i = 0; i < nPagesCount; ++i)
{
oReader.DrawPageOnRenderer(&oHtmlRenderer, i, NULL);
}
oHtmlRenderer.CloseFile();
return a.exec();
}
This diff is collapsed.
// stdafx.cpp : source file that includes just the standard includes
// ASCHTMLRenderer.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
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