Commit 33caeb0f authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander Trofimov

Реализована поддержка Opacity, реализована поддержка разных способов задания...

Реализована поддержка Opacity, реализована поддержка разных способов задания матрица преобразования и клипа.

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@63449 954022d7-b5bf-4e40-9824-e11837661b57
parent bc3999af
...@@ -6,15 +6,34 @@ ...@@ -6,15 +6,34 @@
namespace XPS namespace XPS
{ {
CContextState::CContextState(IRenderer* pRenderer) : m_oCurrentTransform(1.0, 0.0, 0.0, 1.0, 0.0, 0.0), m_pRenderer(pRenderer) CContextState::CContextState(IRenderer* pRenderer) : m_oCurrentTransform(1.0, 0.0, 0.0, 1.0, 0.0, 0.0), m_pRenderer(pRenderer), m_dCurOpacity(1.0)
{ {
m_lTransformStack.push_back(m_oCurrentTransform); m_lTransformStack.push_back(m_oCurrentTransform);
m_vOpacity.push_back(m_dCurOpacity);
} }
CContextState::~CContextState() CContextState::~CContextState()
{ {
m_vClipStack.clear(); m_vClipStack.clear();
m_lTransformStack.clear(); m_lTransformStack.clear();
m_vOpacity.clear();
} }
void CContextState::PushOpacity(const double& dOpacity)
{
m_dCurOpacity *= dOpacity;
m_vOpacity.push_back(m_dCurOpacity);
}
void CContextState::PopOpacity()
{
m_vOpacity.pop_back();
if (m_vOpacity.size())
m_dCurOpacity = m_vOpacity.at(m_vOpacity.size() - 1);
else
m_dCurOpacity = 1;
}
double CContextState::GetCurrentOpacity()
{
return m_dCurOpacity;
}
void CContextState::PushTransform(const double arrTransform[6]) void CContextState::PushTransform(const double arrTransform[6])
{ {
Aggplus::CMatrix oTransform(arrTransform[0], arrTransform[1], arrTransform[2], arrTransform[3], arrTransform[4], arrTransform[5]); Aggplus::CMatrix oTransform(arrTransform[0], arrTransform[1], arrTransform[2], arrTransform[3], arrTransform[4], arrTransform[5]);
......
...@@ -18,6 +18,9 @@ namespace XPS ...@@ -18,6 +18,9 @@ namespace XPS
CContextState(IRenderer* pRenderer); CContextState(IRenderer* pRenderer);
~CContextState(); ~CContextState();
void PushOpacity(const double& dOpacity);
void PopOpacity();
double GetCurrentOpacity();
void PushClip(const CWString& wsClip); void PushClip(const CWString& wsClip);
void PopClip(); void PopClip();
void PushTransform(const double arrTransform[6]); void PushTransform(const double arrTransform[6]);
...@@ -35,6 +38,8 @@ namespace XPS ...@@ -35,6 +38,8 @@ namespace XPS
std::list<Aggplus::CMatrix> m_lTransformStack; std::list<Aggplus::CMatrix> m_lTransformStack;
std::vector<CWString> m_vClipStack; std::vector<CWString> m_vClipStack;
IRenderer* m_pRenderer; IRenderer* m_pRenderer;
std::vector<double> m_vOpacity;
double m_dCurOpacity;
}; };
} }
......
This diff is collapsed.
...@@ -38,6 +38,9 @@ namespace XPS ...@@ -38,6 +38,9 @@ namespace XPS
bool ClipToRenderer (const wchar_t* wsString, CContextState* pState); bool ClipToRenderer (const wchar_t* wsString, CContextState* pState);
bool TransformToRenderer(const wchar_t* wsString, CContextState* pState); bool TransformToRenderer(const wchar_t* wsString, CContextState* pState);
CWString ReadMatrixTransform(XmlUtils::CXmlLiteReader& oReader);
CWString ReadClip (XmlUtils::CXmlLiteReader& oReader);
private: private:
std::wstring m_wsPagePath; std::wstring m_wsPagePath;
......
...@@ -626,6 +626,30 @@ namespace XPS ...@@ -626,6 +626,30 @@ namespace XPS
oReader.MoveToElement(); oReader.MoveToElement();
} }
void ReadAttribute(XmlUtils::CXmlLiteReader& oReader, const wchar_t* wsAttrName, CWString& wsAttr)
{
if (oReader.GetAttributesCount() <= 0)
return;
if (!oReader.MoveToFirstAttribute())
return;
CWString wsName = oReader.GetName();
while (!wsName.empty())
{
if (wsName == wsAttrName)
{
wsAttr.create(oReader.GetText(), true);
break;
}
if (!oReader.MoveToNextAttribute())
break;
wsName = oReader.GetName();
}
oReader.MoveToElement();
}
bool VmlToRenderer(const wchar_t* wsString, IRenderer* pRenderer) bool VmlToRenderer(const wchar_t* wsString, IRenderer* pRenderer)
{ {
bool bWinding = false; bool bWinding = false;
......
...@@ -60,6 +60,7 @@ namespace XPS ...@@ -60,6 +60,7 @@ namespace XPS
std::vector<std::vector<std::wstring>> Split(const std::wstring& wsString, wchar_t wDelim1, wchar_t wDelim2); std::vector<std::vector<std::wstring>> Split(const std::wstring& wsString, wchar_t wDelim1, wchar_t wDelim2);
void ReadAttribute(XmlUtils::CXmlLiteReader& oReader, const wchar_t* wsAttrName, std::wstring& wsAttr); void ReadAttribute(XmlUtils::CXmlLiteReader& oReader, const wchar_t* wsAttrName, std::wstring& wsAttr);
void ReadAttribute(XmlUtils::CXmlLiteReader& oReader, const wchar_t* wsAttrName, CWString& wsAttr);
bool VmlToRenderer(const wchar_t* wsString, IRenderer* pRenderer); bool VmlToRenderer(const wchar_t* wsString, IRenderer* pRenderer);
} }
......
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