Files
Yajbir Singh f1b860b25c
Some checks failed
check / markdownlint (push) Has been cancelled
check / spellchecker (push) Has been cancelled
updated
2025-12-11 19:03:17 +05:30

79 lines
1.8 KiB
C++

#ifndef CTRLOBJELEMENT_H
#define CTRLOBJELEMENT_H
#include "CtrlCommon.h"
namespace HWP
{
struct TMatrix
{
double m_dM11; // e1
double m_dM12; // e2
double m_dM21; // e3
double m_dM22; // e4
double m_dDX; // e5
double m_dDY; // e6
TMatrix();
TMatrix(double dM11, double dM12, double dM21, double dM22, double dDX, double dDY);
void Multiply(const TMatrix& oMatrix);
void ApplyToPoint(double& dX, double& dY) const;
void ApplyToPoint(int& nX, int &nY) const;
void ApplyToSize(double& dW, double& dH) const;
};
class CCtrlObjElement : public CCtrlCommon
{
int m_nXGrpOffset;
int m_nYGrpOffset;
short m_shNGrp;
short m_shVer;
int m_nOrgWidth;
int m_nOrgHeight;
int m_nCurWidth;
int m_nCurHeight;
bool m_bHorzFlip;
bool m_bVerFlip;
short m_shRotat;
int m_nXCenter;
int m_nYCenter;
short m_shMatCnt;
VECTOR<TMatrix> m_arMatrixs;
void ParseRotationInfo(CXMLReader& oReader, EHanType eType);
void ParseRenderingInfo(CXMLReader& oReader, EHanType eType);
void ParseHWPXChildren(CXMLReader& oReader);
void ParseHWPMLElement(CXMLReader& oReader);
public:
CCtrlObjElement();
CCtrlObjElement(const HWP_STRING& sCtrlID);
CCtrlObjElement(const CCtrlObjElement& oObjElement);
CCtrlObjElement(const HWP_STRING& sCtrlID, int nSize, CHWPStream& oBuffer, int nOff, int nVersion);
CCtrlObjElement(const HWP_STRING& sCtrlID, CXMLReader& oReader, EHanType eType);
void ParseChildren(CXMLReader& oReader, EHanType eType);
int GetCurWidth() const;
int GetCurHeight() const;
int GetOrgWidth() const;
int GetOrgHeight() const;
int GetFinalWidth() const;
int GetFinalHeight() const;
short GetGroupLevel() const;
TMatrix GetFinalMatrix() const;
bool HorzFlip() const;
bool VertFlip() const;
static int ParseCtrl(CCtrlObjElement& oObj, int nSize, CHWPStream& oBuffer, int nOff, int nVersion);
};
}
#endif // CTRLOBJELEMENT_H