Commit 1f0ea9dc authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

(1.0.0.25) ASC version (full & opensource)

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@52625 954022d7-b5bf-4e40-9824-e11837661b57
parent 12e1cbcd
......@@ -10,15 +10,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeXPSFile", "ASCOffi
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XPSLib", "XPSLib\XPSLib.vcproj", "{75098926-FDF3-4728-831A-6C3060A5D530}"
ProjectSection(ProjectDependencies) = postProject
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
EndProjectSection
ProjectSection(WebsiteProperties) = preProject
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.Debug = "False"
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "agg2d", "..\..\..\..\AVSImageStudio3\AVSGraphics\agg\agg2d.vcproj", "{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}"
ProjectSection(WebsiteProperties) = preProject
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.Debug = "False"
......@@ -67,19 +58,6 @@ Global
{75098926-FDF3-4728-831A-6C3060A5D530}.ReleaseASC|Mixed Platforms.Build.0 = ReleaseASC|Win32
{75098926-FDF3-4728-831A-6C3060A5D530}.ReleaseASC|Win32.ActiveCfg = Release|Win32
{75098926-FDF3-4728-831A-6C3060A5D530}.ReleaseASC|Win32.Build.0 = Release|Win32
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|Any CPU.ActiveCfg = Debug|Win32
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|Win32.ActiveCfg = Debug|Win32
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|Any CPU.ActiveCfg = Release|Win32
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|Mixed Platforms.Build.0 = Release|Win32
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|Win32.ActiveCfg = Release|Win32
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.ReleaseASC|Any CPU.ActiveCfg = ReleaseASC|Win32
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.ReleaseASC|Mixed Platforms.ActiveCfg = ReleaseASC|Win32
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.ReleaseASC|Mixed Platforms.Build.0 = ReleaseASC|Win32
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.ReleaseASC|Win32.ActiveCfg = Release|Win32
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.ReleaseASC|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
......@@ -126,7 +126,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="..\..\..\..\..\Redist\VersionControl.exe $(ProjectDir)version.h"
CommandLine="..\Redist\VersionControl.exe $(ProjectDir)version.h"
/>
<Tool
Name="VCCustomBuildTool"
......
......@@ -90,8 +90,8 @@ STDMETHODIMP CXPSFile::DrawPage(int nPage, IUnknown* punkRenderer, BOOL* pBreak)
{
if(m_pFolder != NULL)
{
AVSGraphics::IAVSRenderer* pRenderer = NULL;
punkRenderer->QueryInterface(AVSGraphics::IID_IAVSRenderer, (void**)&pRenderer);
ASCGraphics::IASCRenderer* pRenderer = NULL;
punkRenderer->QueryInterface(ASCGraphics::IID_IASCRenderer, (void**)&pRenderer);
if(pRenderer != NULL)
{
m_pFolder->DrawPage(nPage, pRenderer, pBreak);
......
#pragma once
#include "resource.h" // main symbols
#include <string>
#include ".\..\Common\OfficeFileTemplate.h"
#include ".\..\Common\OfficeFileErrorDescription.h"
#include ".\..\Common\OfficeDefines.h"
//#include "XmlUtils.h"
#include "..\..\..\..\AVSImageStudio3\AVSGraphics\Interfaces\XmlUtils.h"
#include "..\Common\ASCUtils.h"
#include "./../Common/OfficeFileTemplate.h"
#include "./../Common/OfficeFileErrorDescription.h"
#include "./../Common/OfficeDefines.h"
#include "../Common/XmlUtils.h"
#include "../Common/ASCUtils.h"
#include "XPS.h"
#include "OfficeUtilsEvents.h"
#include "File.h"
#include "TemporaryCS.h"
#import "..\Redist\ASCOfficeUtils.dll" raw_interfaces_only rename_namespace("ASCOfficeUtils")
//using namespace AVSOfficeUtils;
//#pragma comment( lib, "XPSLib.lib")
#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
......@@ -64,7 +60,7 @@ class ATL_NO_VTABLE CXPSFile: public IXPSFile, public IAVSOfficePages
{
private:
CString m_strTempDirectory;
AVSGraphics::IAVSDocumentRenderer* m_pDocumentRenderer;
ASCGraphics::IASCDocumentRenderer* m_pDocumentRenderer;
CRITICAL_SECTION m_oCS;
......@@ -82,13 +78,13 @@ public:
(*ppRenderer) = NULL;
if( NULL == m_pDocumentRenderer )
return S_OK;
return m_pDocumentRenderer->QueryInterface(__uuidof(AVSGraphics::IAVSDocumentRenderer), (void**)ppRenderer);
return m_pDocumentRenderer->QueryInterface(__uuidof(ASCGraphics::IASCDocumentRenderer), (void**)ppRenderer);
}
STDMETHOD(put_DocumentRenderer)(IUnknown* pRenderer)
{
RELEASEINTERFACE( m_pDocumentRenderer );
if( NULL != pRenderer )
pRenderer->QueryInterface(__uuidof(AVSGraphics::IAVSDocumentRenderer), (void**)&m_pDocumentRenderer);
pRenderer->QueryInterface(__uuidof(ASCGraphics::IASCDocumentRenderer), (void**)&m_pDocumentRenderer);
return S_OK;
}
STDMETHOD(get_TempDirectory)(BSTR* pbsPath)
......
......@@ -7,7 +7,7 @@ namespace XPS
: m_CurrentTransform(1.0, 0.0, 0.0, 1.0, 0.0, 0.0)
{
//HRESULT res;
/*res = */CoCreateInstance( __uuidof(AVSGraphics::CAVSFontManager), NULL, CLSCTX_INPROC_SERVER, __uuidof(AVSGraphics::IAVSFontManager), (void **)&(m_FontManager));
/*res = */CoCreateInstance( __uuidof(ASCGraphics::CASCFontManager), NULL, CLSCTX_INPROC_SERVER, __uuidof(ASCGraphics::IASCFontManager), (void **)&(m_FontManager));
//assert(res == S_OK);
_bstr_t options(L"");
......
......@@ -2,8 +2,8 @@
#ifndef XPS_DRAWPAGEPROPERTIES_INCLUDE_H_
#define XPS_DRAWPAGEPROPERTIES_INCLUDE_H_
#import "..\..\..\..\..\..\..\Redist\AVSGraphics.dll" named_guids raw_interfaces_only rename_namespace("AVSGraphics")
#include "..\..\..\..\..\..\AVSImageStudio3\AVSGraphics\agg\AVSWrapper\Matrix.h"
#import "../../../Redist/ASCGraphics.dll" named_guids raw_interfaces_only rename_namespace("ASCGraphics")
#include "../../../ASCImageStudio3/ASCGraphics/agg/ASCWrapper\Matrix.h"
#include <list>
namespace XPS
......@@ -11,7 +11,7 @@ namespace XPS
class DrawPageProperties
{
public:
AVSGraphics::IAVSFontManager* m_FontManager;
ASCGraphics::IASCFontManager* m_FontManager;
Aggplus::CMatrix m_CurrentTransform;
std::list<Aggplus::CMatrix> m_TransformStack;
......
......@@ -8,6 +8,7 @@ namespace XPS
, m_lDrawingPages(0)
{
InitializeCriticalSection(&m_oFontCS);
m_fontMap = new CAtlMap<CString, bool>();
}
Folder::~Folder()
......@@ -29,8 +30,8 @@ namespace XPS
m_path = Path;
m_pages.erase(m_pages.begin(), m_pages.end());
m_fontMap.reset(new std::set<CString>);//->erase(m_fontMap->begin(), m_fontMap->end());
m_fontMap->RemoveAll();
//XmlUtils::CXmlNodes nodes;
//XmlUtils::CXmlNode node;
......@@ -114,7 +115,7 @@ namespace XPS
int Folder::GetPageCount()const
{
return m_pages.size();
return (int)m_pages.size();
}
void Folder::GetPageSize(int Number, int& w, int& h)
......@@ -129,7 +130,7 @@ namespace XPS
m_lDrawingPages--;
}
void Folder::DrawPage(int Number, AVSGraphics::IAVSRenderer* pRenderer, BOOL* pBreak)
void Folder::DrawPage(int Number, ASCGraphics::IASCRenderer* pRenderer, BOOL* pBreak)
{
if(m_bIsClosed)
return;
......
......@@ -4,6 +4,7 @@
#include "Page.h"
#include <map>
#include "../../../Common/DocxFormat/Source/Base/SmartPtr.h";
namespace XPS
{
......@@ -17,7 +18,7 @@ namespace XPS
XmlUtils::CXmlNodes m_nodes;
std::map<int, XPS::Page*> m_pages;
boost::shared_ptr<std::set<CString> > m_fontMap;
NSCommon::smart_ptr<CAtlMap<CString, bool>> m_fontMap;
CRITICAL_SECTION m_oFontCS;
......@@ -32,7 +33,7 @@ namespace XPS
void ReadFromPath(const CString& Path);
int GetPageCount()const;
void GetPageSize(int Number, int& w, int& h);
void DrawPage(int Number, AVSGraphics::IAVSRenderer* pRenderer, BOOL* pBreak);
void DrawPage(int Number, ASCGraphics::IASCRenderer* pRenderer, BOOL* pBreak);
void Close();
};
} // namespace XPS
......
......@@ -13,7 +13,7 @@ namespace XPS
//#define xpsUnitToMM(x) (x)
#define xpsUnitToMM(x) ((x)*cdk)
Page::Page(const CString& File, const CString& Path, boost::shared_ptr<std::set<CString> > fontMap, CRITICAL_SECTION* fontCS)
Page::Page(const CString& File, const CString& Path, NSCommon::smart_ptr<CAtlMap<CString, bool>> fontMap, CRITICAL_SECTION* fontCS)
: m_strFilename(File)
, m_strPath(Path)
, m_fontMap(fontMap)
......@@ -98,7 +98,7 @@ namespace XPS
}
bool Page::VmlToRenderer(CString& str, AVSGraphics::IAVSRenderer* pRenderer)
bool Page::VmlToRenderer(CString& str, ASCGraphics::IASCRenderer* pRenderer)
{
bool result = false;
double x_cur = 0.0, y_cur = 0.0;
......@@ -108,7 +108,7 @@ namespace XPS
std::vector<CString> dest;
PrepareVML(str);
DelimString(str, dest, _T(" ,"));
int elems = dest.size();
int elems = (int)dest.size();
for(int i = 0; i < elems; i++)
{
if(dest[i] == _T("F"))
......@@ -837,7 +837,7 @@ namespace XPS
}
void Page::TransformToRenderer(CString& str, AVSGraphics::IAVSRenderer* pRenderer, DrawPageProperties* pProps)const
void Page::TransformToRenderer(CString& str, ASCGraphics::IASCRenderer* pRenderer, DrawPageProperties* pProps)const
{
std::vector<CString> dest;
DelimString(str, dest, _T(','));
......@@ -854,7 +854,7 @@ namespace XPS
}
void Page::ResetTransform(AVSGraphics::IAVSRenderer* pRenderer, DrawPageProperties* pProps)const
void Page::ResetTransform(ASCGraphics::IASCRenderer* pRenderer, DrawPageProperties* pProps)const
{
pProps->m_TransformStack.pop_back();
pProps->m_CurrentTransform = pProps->m_TransformStack.back();
......@@ -875,7 +875,7 @@ namespace XPS
}
void Page::Draw(AVSGraphics::IAVSRenderer* pRenderer, BOOL* pBreak)const
void Page::Draw(ASCGraphics::IASCRenderer* pRenderer, BOOL* pBreak)const
{
XmlUtils::CXmlNode lNode;
......@@ -944,7 +944,7 @@ namespace XPS
}
void Page::DrawCanvas(XmlUtils::CXmlNode& canvas, AVSGraphics::IAVSRenderer* pRenderer, DrawPageProperties* pProps, BOOL* pBreak)const
void Page::DrawCanvas(XmlUtils::CXmlNode& canvas, ASCGraphics::IASCRenderer* pRenderer, DrawPageProperties* pProps, BOOL* pBreak)const
{
bool isClipped = false;
bool isTransformed = false;
......@@ -1017,7 +1017,7 @@ namespace XPS
}
void Page::DrawGlyph(XmlUtils::CXmlNode& node, AVSGraphics::IAVSRenderer* pRenderer, DrawPageProperties* pProps)const
void Page::DrawGlyph(XmlUtils::CXmlNode& node, ASCGraphics::IASCRenderer* pRenderer, DrawPageProperties* pProps)const
{
//CString font = m_Path + node.GetAttribute(_T("FontUri"));
//font.Replace(_T("\\/"), _T("\\"));
......@@ -1046,15 +1046,15 @@ namespace XPS
EnterCriticalSection(m_pFontCS);
fname.MakeLower();
if(m_fontMap->find(fname) == m_fontMap->end())
if (NULL != m_fontMap->Lookup(fname))
{
if(m_fontMap->insert(fname).second)
if (m_fontMap->SetAt(fname, true))
{
unsigned char key[16];
GetFontKey(fname, key);
CFile fontFile;
HRESULT res = fontFile.OpenFileRW(font);
assert(res == S_OK);
//assert(res == S_OK);
unsigned char fontData[32];
fontFile.ReadFile(fontData, 32);
for(int i = 0; i < 32; i++)
......@@ -1174,7 +1174,7 @@ namespace XPS
}
void Page::DrawPath(XmlUtils::CXmlNode& node, AVSGraphics::IAVSRenderer* pRenderer, DrawPageProperties* pProps)const
void Page::DrawPath(XmlUtils::CXmlNode& node, ASCGraphics::IASCRenderer* pRenderer, DrawPageProperties* pProps)const
{
CString transform = node.GetAttribute(_T("RenderTransform"), _T(""));
bool isTransformed = false;
......@@ -1265,7 +1265,7 @@ namespace XPS
}
void Page::CanvasTransform(XmlUtils::CXmlNode& node, AVSGraphics::IAVSRenderer* pRenderer, DrawPageProperties* pProps)const
void Page::CanvasTransform(XmlUtils::CXmlNode& node, ASCGraphics::IASCRenderer* pRenderer, DrawPageProperties* pProps)const
{
XmlUtils::CXmlNode transform;
node.GetNode(_T("MatrixTransform"), transform);
......@@ -1274,7 +1274,7 @@ namespace XPS
}
void Page::FillToRenderer(XmlUtils::CXmlNode& node, AVSGraphics::IAVSRenderer* pRenderer)const
void Page::FillToRenderer(XmlUtils::CXmlNode& node, ASCGraphics::IASCRenderer* pRenderer)const
{
XmlUtils::CXmlNode brush;
if(node.GetNode(_T("SolidColorBrush"), brush))
......
......@@ -2,9 +2,8 @@
#ifndef XPS_PAGE_INCLUDE_H_
#define XPS_PAGE_INCLUDE_H_
#include "..\..\..\..\..\..\AVSImageStudio3\AVSGraphics\Interfaces\XmlUtils.h"
#include <set>
#include <boost/shared_ptr.hpp>
#include "../../../Common/XmlUtils.h"
#include "../../../Common/DocxFormat/Source/Base/SmartPtr.h";
#include "Utils.h"
#include "DrawPageProperties.h"
......@@ -15,27 +14,27 @@ namespace XPS
private:
CString m_strFilename;
CString m_strPath;
boost::shared_ptr<std::set<CString> > m_fontMap;
mutable NSCommon::smart_ptr<CAtlMap<CString, bool>> m_fontMap;
void DrawCanvas(XmlUtils::CXmlNode& canvas, AVSGraphics::IAVSRenderer* pRenderer, DrawPageProperties* pProps, BOOL* pBreak)const;
void DrawGlyph(XmlUtils::CXmlNode& node, AVSGraphics::IAVSRenderer* pRenderer, DrawPageProperties* pProps)const;
void DrawPath(XmlUtils::CXmlNode& node, AVSGraphics::IAVSRenderer* pRenderer, DrawPageProperties* pProps)const;
void CanvasTransform(XmlUtils::CXmlNode& node, AVSGraphics::IAVSRenderer* pRenderer, DrawPageProperties* pProps)const;
void FillToRenderer(XmlUtils::CXmlNode& node, AVSGraphics::IAVSRenderer* pRenderer)const;
void DrawCanvas(XmlUtils::CXmlNode& canvas, ASCGraphics::IASCRenderer* pRenderer, DrawPageProperties* pProps, BOOL* pBreak)const;
void DrawGlyph(XmlUtils::CXmlNode& node, ASCGraphics::IASCRenderer* pRenderer, DrawPageProperties* pProps)const;
void DrawPath(XmlUtils::CXmlNode& node, ASCGraphics::IASCRenderer* pRenderer, DrawPageProperties* pProps)const;
void CanvasTransform(XmlUtils::CXmlNode& node, ASCGraphics::IASCRenderer* pRenderer, DrawPageProperties* pProps)const;
void FillToRenderer(XmlUtils::CXmlNode& node, ASCGraphics::IASCRenderer* pRenderer)const;
static bool VmlToRenderer(CString& str, AVSGraphics::IAVSRenderer* pRenderer);
static bool VmlToRenderer(CString& str, ASCGraphics::IASCRenderer* pRenderer);
static void GetDataFromNode(CString& str, XmlUtils::CXmlNode& node);
void TransformToRenderer(CString& str, AVSGraphics::IAVSRenderer* pRenderer, DrawPageProperties* pProps)const;
void ResetTransform(AVSGraphics::IAVSRenderer* pRenderer, DrawPageProperties* pProps)const;
void TransformToRenderer(CString& str, ASCGraphics::IASCRenderer* pRenderer, DrawPageProperties* pProps)const;
void ResetTransform(ASCGraphics::IASCRenderer* pRenderer, DrawPageProperties* pProps)const;
CRITICAL_SECTION* m_pFontCS;
public:
Page(const CString& File, const CString& Path, boost::shared_ptr<std::set<CString> > fontMap, CRITICAL_SECTION* fontCS);
Page(const CString& File, const CString& Path, NSCommon::smart_ptr<CAtlMap<CString, bool>> fontMap, CRITICAL_SECTION* fontCS);
~Page();
void GetSize(int& w, int& h)const;
void Draw(AVSGraphics::IAVSRenderer* pRenderer, BOOL* pBreak)const;
void Draw(ASCGraphics::IASCRenderer* pRenderer, BOOL* pBreak)const;
};
} // namespace XPS
......
......@@ -89,6 +89,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
......@@ -139,6 +140,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine=""
/>
</Configuration>
</Configurations>
......
......@@ -43,4 +43,4 @@
using namespace ATL;
//#import "..\..\..\Redist\AVSGraphics.dll" named_guids raw_interfaces_only rename_namespace("AVSGraphics")
#import "../Redist/ASCOfficeUtils.dll" named_guids raw_interfaces_only rename_namespace("ASCOfficeUtils")
......@@ -2,6 +2,6 @@
//1
//0
//0
//23
#define INTVER 1,0,0,23
#define STRVER "1,0,0,23\0"
//25
#define INTVER 1,0,0,25
#define STRVER "1,0,0,25\0"
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