mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
Refactoring
This commit is contained in:
@ -304,6 +304,11 @@ core_ios {
|
||||
CONFIG(iphonesimulator, iphoneos|iphonesimulator): {
|
||||
message("iphonesimulator")
|
||||
CORE_BUILDS_PLATFORM_PREFIX = ios_simulator
|
||||
|
||||
QMAKE_CFLAGS += -fembed-bitcode
|
||||
QMAKE_CXXFLAGS += -fembed-bitcode
|
||||
QMAKE_LFLAGS += -fembed-bitcode
|
||||
QMAKE_CXXFLAGS += -fobjc-arc
|
||||
} else {
|
||||
|
||||
QMAKE_IOS_DEPLOYMENT_TARGET = 11.0
|
||||
|
||||
@ -38,6 +38,8 @@
|
||||
#include <libkern/OSAtomic.h>
|
||||
#endif
|
||||
|
||||
#define UNUSED_VARIABLE(x) (void)((x))
|
||||
|
||||
class IGrObject
|
||||
{
|
||||
protected:
|
||||
|
||||
@ -45,7 +45,9 @@
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifndef _ARM_ALIGN_
|
||||
#define _ARM_ALIGN_
|
||||
#endif
|
||||
|
||||
static void LOGGING(const std::string& strFile, const std::wstring& strMessage)
|
||||
{
|
||||
|
||||
@ -164,13 +164,13 @@ namespace Aggplus { class CImage; }
|
||||
class IRenderer : public IGrObject
|
||||
{
|
||||
public:
|
||||
bool m_bUseTransformCoordsToIdentity;
|
||||
bool m_bUseTransformCoordsToIdentity;
|
||||
|
||||
public:
|
||||
IRenderer()
|
||||
{
|
||||
m_bUseTransformCoordsToIdentity = false;
|
||||
}
|
||||
IRenderer()
|
||||
{
|
||||
m_bUseTransformCoordsToIdentity = false;
|
||||
}
|
||||
|
||||
public:
|
||||
// тип рендерера-----------------------------------------------------------------------------
|
||||
@ -261,6 +261,7 @@ public:
|
||||
|
||||
virtual HRESULT CommandDrawTextCHAR2(unsigned int* codepoints, const unsigned int& codepointscount, const unsigned int& gid, const double& x, const double& y, const double& w, const double& h)
|
||||
{
|
||||
UNUSED_VARIABLE(codepointscount);
|
||||
LONG c = (NULL == codepoints) ? 32 : codepoints[0];
|
||||
return CommandDrawTextExCHAR(c, (LONG)gid, x, y, w, h);
|
||||
}
|
||||
@ -295,6 +296,12 @@ public:
|
||||
// transform --------------------------------------------------------------------------------
|
||||
virtual HRESULT GetCommandParams(double* dAngle, double* dLeft, double* dTop, double* dWidth, double* dHeight, DWORD* lFlags)
|
||||
{
|
||||
UNUSED_VARIABLE(dAngle);
|
||||
UNUSED_VARIABLE(dLeft);
|
||||
UNUSED_VARIABLE(dTop);
|
||||
UNUSED_VARIABLE(dWidth);
|
||||
UNUSED_VARIABLE(dHeight);
|
||||
UNUSED_VARIABLE(lFlags);
|
||||
return S_OK;
|
||||
}
|
||||
virtual HRESULT SetCommandParams(double dAngle, double dLeft, double dTop, double dWidth, double dHeight, DWORD lFlags)
|
||||
@ -327,7 +334,16 @@ public:
|
||||
SetTransform(mass[0], mass[1], mass[2], mass[3], mass[4], mass[5]);
|
||||
return S_OK;
|
||||
}
|
||||
virtual HRESULT SetBaseTransform(const double& m1, const double& m2, const double& m3, const double& m4, const double& m5, const double& m6) { return S_OK; };
|
||||
virtual HRESULT SetBaseTransform(const double& m1, const double& m2, const double& m3, const double& m4, const double& m5, const double& m6)
|
||||
{
|
||||
UNUSED_VARIABLE(m1);
|
||||
UNUSED_VARIABLE(m2);
|
||||
UNUSED_VARIABLE(m3);
|
||||
UNUSED_VARIABLE(m4);
|
||||
UNUSED_VARIABLE(m5);
|
||||
UNUSED_VARIABLE(m6);
|
||||
return S_OK;
|
||||
};
|
||||
virtual HRESULT SetTransform(const double& m1, const double& m2, const double& m3, const double& m4, const double& m5, const double& m6) = 0;
|
||||
virtual HRESULT GetTransform(double *pdA, double *pdB, double *pdC, double *pdD, double *pdE, double *pdF) = 0;
|
||||
virtual HRESULT ResetTransform() = 0;
|
||||
@ -352,29 +368,50 @@ public:
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
virtual HRESULT IsExistAdditionalParam(const int& type) {return S_FALSE;}
|
||||
virtual HRESULT GetAdditionalParam(const int& type, std::string& result) {return S_FALSE;}
|
||||
virtual HRESULT IsExistAdditionalParam(const int& type)
|
||||
{
|
||||
UNUSED_VARIABLE(type);
|
||||
return S_FALSE;
|
||||
}
|
||||
virtual HRESULT GetAdditionalParam(const int& type, std::string& result)
|
||||
{
|
||||
UNUSED_VARIABLE(type);
|
||||
UNUSED_VARIABLE(result);
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
virtual HRESULT IsSupportAdvancedCommand(const IAdvancedCommand::AdvancedCommandType& type) { return S_FALSE; }
|
||||
virtual HRESULT AdvancedCommand(IAdvancedCommand* command) { return S_FALSE; }
|
||||
virtual HRESULT IsSupportAdvancedCommand(const IAdvancedCommand::AdvancedCommandType& type)
|
||||
{
|
||||
UNUSED_VARIABLE(type);
|
||||
return S_FALSE;
|
||||
}
|
||||
virtual HRESULT AdvancedCommand(IAdvancedCommand* command)
|
||||
{
|
||||
UNUSED_VARIABLE(command);
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
// graphics layer settings
|
||||
virtual HRESULT put_LayerOpacity(double dValue) { return S_FALSE; }
|
||||
virtual HRESULT put_LayerOpacity(double dValue)
|
||||
{
|
||||
UNUSED_VARIABLE(dValue);
|
||||
return S_FALSE;
|
||||
}
|
||||
};
|
||||
|
||||
#define PROPERTY_RENDERER(NameBase, Name, Type) \
|
||||
STDMETHOD(get_##NameBase##Name)(Type* pVal) \
|
||||
{ \
|
||||
if (NULL == pVal) \
|
||||
return S_FALSE; \
|
||||
*pVal = m_o##NameBase.##Name; \
|
||||
return S_OK; \
|
||||
} \
|
||||
STDMETHOD(put_##NameBase##Name)(Type Val) \
|
||||
{ \
|
||||
m_o##NameBase.##Name = Val; \
|
||||
return S_OK; \
|
||||
}
|
||||
STDMETHOD(get_##NameBase##Name)(Type* pVal) \
|
||||
{ \
|
||||
if (NULL == pVal) \
|
||||
return S_FALSE; \
|
||||
*pVal = m_o##NameBase.##Name; \
|
||||
return S_OK; \
|
||||
} \
|
||||
STDMETHOD(put_##NameBase##Name)(Type Val) \
|
||||
{ \
|
||||
m_o##NameBase.##Name = Val; \
|
||||
return S_OK; \
|
||||
}
|
||||
|
||||
// exapmle:
|
||||
// PROPERTY_RENDERER(Pen, Color, LONG)
|
||||
|
||||
@ -96,7 +96,7 @@ namespace Aggplus
|
||||
}
|
||||
}
|
||||
|
||||
void CMatrix::TransformVectors(PointF* pts, int count)
|
||||
void CMatrix::TransformVectors(PointF* pts, int count) const
|
||||
{
|
||||
// Store matrix to an array [6] of double
|
||||
double M[6]; m_internal->m_agg_mtx.store_to(M);
|
||||
@ -111,7 +111,7 @@ namespace Aggplus
|
||||
}
|
||||
}
|
||||
|
||||
void CMatrix::TransformPoints(PointF* pts, int count)
|
||||
void CMatrix::TransformPoints(PointF* pts, int count) const
|
||||
{
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
@ -123,7 +123,7 @@ namespace Aggplus
|
||||
}
|
||||
}
|
||||
|
||||
void CMatrix::TransformPoint(double& x, double& y)
|
||||
void CMatrix::TransformPoint(double& x, double& y) const
|
||||
{
|
||||
m_internal->m_agg_mtx.transform(&x, &y);
|
||||
}
|
||||
@ -281,7 +281,7 @@ namespace Aggplus
|
||||
return agg::rad2deg(m_internal->m_agg_mtx.rotation());
|
||||
}
|
||||
|
||||
void CMatrix::TransformPoints( PointF* dst, const PointF* src, int count )
|
||||
void CMatrix::TransformPoints( PointF* dst, const PointF* src, int count ) const
|
||||
{
|
||||
agg::trans_affine& m = m_internal->m_agg_mtx;
|
||||
for(int i = 0; i < count; ++i)
|
||||
|
||||
@ -52,10 +52,10 @@ namespace Aggplus
|
||||
void Shear(double shearX, double shearY, MatrixOrder order = MatrixOrderPrepend);
|
||||
double Determinant() const;
|
||||
|
||||
void TransformVectors(PointF* pts, int count);
|
||||
void TransformPoints(PointF* pts, int count);
|
||||
void TransformPoint(double& x, double& y);
|
||||
void TransformPoints(PointF* dst, const PointF* src, int count);
|
||||
void TransformVectors(PointF* pts, int count) const;
|
||||
void TransformPoints(PointF* pts, int count) const;
|
||||
void TransformPoint(double& x, double& y) const;
|
||||
void TransformPoints(PointF* dst, const PointF* src, int count) const;
|
||||
|
||||
void Rotate(double angle, MatrixOrder order = MatrixOrderPrepend);
|
||||
void RotateAt(double angle, const PointF ¢er, MatrixOrder order = MatrixOrderPrepend);
|
||||
|
||||
Reference in New Issue
Block a user