Commit c47baee6 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

включение "новой" конвертилки Wmf/Emf в HtmlRenderer

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62146 954022d7-b5bf-4e40-9824-e11837661b57
parent 3fb9cc75
......@@ -415,64 +415,116 @@
</File>
</Filter>
<Filter
Name="WMF"
Name="MetaFile"
>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\RendererOutput.h"
RelativePath="..\DesktopEditor\raster\Metafile\Common.cpp"
>
</File>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\WmfCharsets.h"
RelativePath="..\DesktopEditor\raster\Metafile\Common.h"
>
</File>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\WmfCodePage1361.h"
RelativePath="..\DesktopEditor\raster\Metafile\MetaFile.cpp"
>
</File>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\WmfCodePage932.h"
RelativePath="..\DesktopEditor\raster\Metafile\MetaFile.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"
<Filter
Name="Wmf"
>
</File>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\WmfTypes.h"
<File
RelativePath="..\DesktopEditor\raster\Metafile\Wmf\RendererOutput.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Wmf\WmfCharsets.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Wmf\WmfCodePage1361.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Wmf\WmfCodePage932.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Wmf\WmfCodePage936.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Wmf\WmfCodePage949.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Wmf\WmfCodePage950.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Wmf\WmfColor.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Wmf\WmfFile.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Wmf\WmfMemory.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Wmf\WmfOutputDevice.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Wmf\WmfRegion.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Wmf\WmfTypes.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Wmf\WmfUtils.h"
>
</File>
</Filter>
<Filter
Name="Emf"
>
</File>
<File
RelativePath="..\ASCImageStudio3\ASCGraphics\Objects\Image\Wmf\WmfUtils.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Emf\EmfFile.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Emf\EmfObjects.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Emf\EmfOutputDevice.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Emf\EmfPlayer.cpp"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Emf\EmfPlayer.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Emf\EmfTypes.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Emf\RendererOutput.h"
>
</File>
</Filter>
</Filter>
</Files>
<Globals>
......
This diff is collapsed.
......@@ -22,9 +22,13 @@ const long c_lMetaSVG = 0x04;
const long c_ag_ImageTypeBitmap = 0;
const long c_ag_ImageTypeMetafile = 1;
namespace MetaFile
{
class CMetaFile;
};
class CFontManager;
class CWmfFile;
struct TWmfRectF;
namespace Aggplus
{
class CImage;
......@@ -60,9 +64,7 @@ namespace NSHtmlRenderer
{
private:
CWmfFile* m_pWmfFile;
TWmfRectF* m_pRect;
MetaFile::CMetaFile* m_pMetafile;
CString m_wsTempFilePath;
......
#include "Common.h"
#include "../../../raster/ImageFileFormatChecker.h"
#include "../../../raster/BgraFrame.h"
#include "../../raster/ImageFileFormatChecker.h"
#include "../../raster/BgraFrame.h"
namespace Metafile
namespace MetaFile
{
bool ReadImageCoreHeader(BYTE* pHeaderBuffer, unsigned long ulHeaderBufferLen, BYTE* pImageBuffer, unsigned long ulImageBufferLen, BYTE** ppDstBuffer, unsigned long* pulWidth, unsigned long* pulHeight)
{
......
......@@ -16,7 +16,7 @@ typedef unsigned char BYTE;
#include "Wmf/WmfUtils.h"
#include "Emf/EmfObjects.h"
namespace Metafile
namespace MetaFile
{
#define METAFILE_RGBA(r, g, b) ((DWORD)( ( (BYTE)(r) )| ( ( (BYTE)(g) ) << 8 ) | ( ( (BYTE)(b) ) << 16 ) | ( (BYTE)(0) << 24 ) ) )
......
......@@ -15,7 +15,11 @@
#include "../../../fontengine/FontManager.h"
#include <iostream>
namespace Metafile
#if !defined(ETO_PDY)
# define ETO_PDY 0x2000
#endif
namespace MetaFile
{
class CEmfFile
{
......@@ -556,6 +560,7 @@ namespace Metafile
m_pDC->SetTextColor(oColor);
}
void Read_EMR_EXTTEXTOUTW()
{
TEmfExtTextoutW oText;
......
......@@ -4,7 +4,7 @@
#include "EmfTypes.h"
#include "../Wmf/WmfTypes.h"
namespace Metafile
namespace MetaFile
{
typedef enum
{
......
......@@ -3,7 +3,7 @@
#include "../Wmf/WmfTypes.h"
namespace Metafile
namespace MetaFile
{
class CEmfOutputDevice
......
#include "EmfPlayer.h"
#include "EmfFile.h"
namespace Metafile
namespace MetaFile
{
CEmfPlayer::CEmfPlayer(CEmfFile* pFile)
{
......@@ -127,6 +127,8 @@ namespace Metafile
m_oTransform.Init();
m_oTextColor.Init();
m_pBrush = NULL;
m_pPen = NULL;
m_pFont = NULL;
}
CEmfDC::~CEmfDC()
{
......
......@@ -6,7 +6,7 @@
#include "EmfTypes.h"
#include "EmfObjects.h"
namespace Metafile
namespace MetaFile
{
class CEmfFile;
class CEmfDC;
......
#ifndef _EMF_TYPES_H
#define _EMF_TYPES_H
namespace Metafile
namespace MetaFile
{
struct TEmfColor
{
......
......@@ -11,7 +11,7 @@
#include "EmfOutputDevice.h"
#include "EmfFile.h"
namespace Metafile
namespace MetaFile
{
class CEmfRendererOutput : public CEmfOutputDevice
{
......
......@@ -5,7 +5,7 @@
#include "Emf/RendererOutput.h"
namespace Metafile
namespace MetaFile
{
CMetaFile::CMetaFile(CApplicationFonts *pAppFonts)
{
......@@ -18,12 +18,18 @@ namespace Metafile
m_pFontManager->SetOwnerCache(pMeasurerCache);
m_oWmfFile.SetFontManager(m_pFontManager);
m_oEmfFile.SetFontManager(m_pFontManager);
m_lType = 0;
}
CMetaFile::~CMetaFile()
{
Close();
RELEASEINTERFACE(m_pFontManager);
}
CFontManager* CMetaFile::get_FontManager()
{
return m_pFontManager;
}
bool CMetaFile::LoadFromFile(const wchar_t *wsFilePath)
{
// Wmf
......@@ -116,7 +122,14 @@ namespace Metafile
void CMetaFile::Close()
{
m_oWmfFile.Close();
//m_oEmfFile.Close();
m_lType = 0;
};
long CMetaFile::GetType()
{
return m_lType;
}
void CMetaFile::GetBounds(double* pdX, double* pdY, double* pdW, double* pdH)
{
if (c_lMetaWmf == m_lType)
......
......@@ -7,11 +7,12 @@
#include "Wmf/RendererOutput.h"
#include "Emf/EmfFile.h"
namespace Metafile
namespace MetaFile
{
const long c_lMetaWmf = 0x01;
const long c_lMetaEmf = 0x02;
const long c_lMetaSvg = 0x04;
const long c_lMetaSvg = 0x04;
// )
class CMetaFile
{
......@@ -23,7 +24,9 @@ namespace Metafile
bool DrawOnRenderer(IRenderer* pRenderer, double dX, double dY, double dWidth, double dHeight);
void Close();
void GetBounds(double* pdX, double* pdY, double* pdW, double* pdH);
long GetType();
void ConvertToRaster(const wchar_t* wsOutFilePath, unsigned int unFileType, int nWidth, int nHeight = -1);
CFontManager* get_FontManager();
private:
......
......@@ -1292,7 +1292,7 @@ private:
return L"";
wsText[nLen] = '\0';
#ifdef _WIN32
#if defined(_WIN32) || defined (_WIN64)
// Пытаемся воспользоваться системной функцией
if ( !OemToCharBuffW( sText, wsText, nLen ) )
{
......
......@@ -12,8 +12,10 @@
#include <math.h>
#include "../../../common/File.h"
#define UTF8_TO_U(val) NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)val, strlen(val))
#define U_TO_UTF8(val) NSFile::CUtf8Converter::GetUtf8StringFromUnicode2(val, wcslen(val))
static std::wstring ascii_to_unicode(const char *src)
{
size_t nSize = mbstowcs(0, src, 0);
......@@ -153,8 +155,8 @@ static void PolyPoly_To_PolyLine(TWmfPolyPoly *pPolyPoly, TWmfPolyLine *pPolyLin
static BOOL WmfOpenTempFile(std::wstring *pwsName, FILE **ppFile, wchar_t *wsMode, wchar_t *wsExt, wchar_t *wsFolder)
{
std::wstring wsTemp, wsFileName;
FILE *pTempFile;
#ifdef _WIN32
FILE *pTempFile = NULL;
#if defined(_WIN32) || defined (_WIN64)
wchar_t *wsTempDir;
if ((wsTempDir = _wgetenv(L"TEMP")) && (wsFolder == NULL))
{
......@@ -182,13 +184,15 @@ static BOOL WmfOpenTempFile(std::wstring *pwsName, FILE **ppFile, wchar_t *wsMod
for (int nIndex = 0; nIndex < 1000; ++nIndex)
{
wsFileName = wsTemp;
wsFileName.append(std::to_wstring(nTime + nIndex));
wchar_t buffer[24];
_itow(nTime + nIndex,buffer,10);
wsFileName.append(buffer);
if (wsExt)
{
wsFileName.append(wsExt);
}
#ifdef _WIN32
#if defined (_WIN32) || defined (_WIN64)
if (!(pTempFile = _wfopen(wsFileName.c_str(), L"r")))
{
if (!(pTempFile = _wfopen(wsFileName.c_str(), wsMode)))
......
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