diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-02-26 13:17:56 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-02-26 13:17:56 -0800 |
commit | 566b974287ce0e81a963138152b8898f22480f52 (patch) | |
tree | b85991aee92475549d84e8cb68702960b85d1252 | |
parent | 3b8fdd34bdf57ec45291b77008a43249f838efcb (diff) | |
download | pdfium-566b974287ce0e81a963138152b8898f22480f52.tar.xz |
Revert "Replace CPDF_Rect and CPDF_Point with CFX types."
This reverts commit 3b8fdd34bdf57ec45291b77008a43249f838efcb.
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1743753002 .
80 files changed, 1552 insertions, 1625 deletions
diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h index c57d9f20b9..9fa05c75ed 100644 --- a/core/include/fpdfapi/fpdf_parser.h +++ b/core/include/fpdfapi/fpdf_parser.h @@ -672,11 +672,26 @@ class CPDF_StandardCryptoHandler : public CPDF_CryptoHandler { FX_BOOL bEncrypt); uint8_t m_EncryptKey[32]; + int m_KeyLen; + int m_Cipher; + uint8_t* m_pAESContext; }; +class CPDF_Point { + public: + CPDF_Point(FX_FLOAT xx, FX_FLOAT yy) { + x = xx; + y = yy; + } + + FX_FLOAT x; + FX_FLOAT y; +}; + +#define CPDF_Rect CFX_FloatRect CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& orig); CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig); CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig); @@ -687,21 +702,23 @@ CFX_WideString PDF_DecodeText(const CFX_ByteString& bstr); CFX_ByteString PDF_EncodeText(const FX_WCHAR* pString, int len = -1); CFX_ByteString PDF_EncodeText(const CFX_WideString& str); +FX_FLOAT PDF_ClipFloat(FX_FLOAT f); class CFDF_Document : public CPDF_IndirectObjectHolder { public: static CFDF_Document* CreateNewDoc(); static CFDF_Document* ParseFile(IFX_FileRead* pFile, FX_BOOL bOwnFile = FALSE); static CFDF_Document* ParseMemory(const uint8_t* pData, FX_DWORD size); + ~CFDF_Document(); FX_BOOL WriteBuf(CFX_ByteTextBuf& buf) const; + CPDF_Dictionary* GetRoot() const { return m_pRootDict; } protected: CFDF_Document(); void ParseStream(IFX_FileRead* pFile, FX_BOOL bOwnFile); - CPDF_Dictionary* m_pRootDict; IFX_FileRead* m_pFile; FX_BOOL m_bOwnFile; diff --git a/core/include/fpdfdoc/fpdf_ap.h b/core/include/fpdfdoc/fpdf_ap.h index 5f2a3005ea..f9ade57d97 100644 --- a/core/include/fpdfdoc/fpdf_ap.h +++ b/core/include/fpdfdoc/fpdf_ap.h @@ -81,12 +81,12 @@ class CPVT_GenerateAP { static CFX_ByteString GenerateEditAP(IPVT_FontMap* pFontMap, IPDF_VariableText_Iterator* pIterator, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, FX_BOOL bContinuous, FX_WORD SubWord = 0, const CPVT_WordRange* pVisible = NULL); - static CFX_ByteString GenerateBorderAP(const CFX_FloatRect& rect, + static CFX_ByteString GenerateBorderAP(const CPDF_Rect& rect, FX_FLOAT fWidth, const CPVT_Color& color, const CPVT_Color& crLeftTop, diff --git a/core/include/fpdfdoc/fpdf_vt.h b/core/include/fpdfdoc/fpdf_vt.h index b2e64cd2ed..91a93884e8 100644 --- a/core/include/fpdfdoc/fpdf_vt.h +++ b/core/include/fpdfdoc/fpdf_vt.h @@ -226,7 +226,7 @@ struct CPVT_Word { CPVT_WordPlace WordPlace; - CFX_FloatPoint ptWord; + CPDF_Point ptWord; FX_FLOAT fAscent; @@ -248,7 +248,7 @@ struct CPVT_Line { CPVT_WordPlace lineEnd; - CFX_FloatPoint ptLine; + CPDF_Point ptLine; FX_FLOAT fLineWidth; @@ -259,7 +259,7 @@ struct CPVT_Line { struct CPVT_Section { CPVT_WordPlace secplace; - CFX_FloatRect rcSection; + CPDF_Rect rcSection; CPVT_SecProps SecProps; @@ -328,7 +328,7 @@ class IPDF_VariableText { virtual IPDF_VariableText_Iterator* GetIterator() = 0; - virtual void SetPlateRect(const CFX_FloatRect& rect) = 0; + virtual void SetPlateRect(const CPDF_Rect& rect) = 0; virtual void SetAlignment(int32_t nFormat = 0) = 0; @@ -395,9 +395,9 @@ class IPDF_VariableText { virtual CPVT_WordPlace BackSpaceWord(const CPVT_WordPlace& place) = 0; - virtual const CFX_FloatRect& GetPlateRect() const = 0; + virtual const CPDF_Rect& GetPlateRect() const = 0; - virtual CFX_FloatRect GetContentRect() const = 0; + virtual CPDF_Rect GetContentRect() const = 0; virtual int32_t GetTotalWords() const = 0; @@ -427,14 +427,13 @@ class IPDF_VariableText { virtual CPVT_WordPlace GetNextWordPlace( const CPVT_WordPlace& place) const = 0; - virtual CPVT_WordPlace SearchWordPlace(const CFX_FloatPoint& point) const = 0; + virtual CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const = 0; virtual CPVT_WordPlace GetUpWordPlace(const CPVT_WordPlace& place, - const CFX_FloatPoint& point) const = 0; + const CPDF_Point& point) const = 0; - virtual CPVT_WordPlace GetDownWordPlace( - const CPVT_WordPlace& place, - const CFX_FloatPoint& point) const = 0; + virtual CPVT_WordPlace GetDownWordPlace(const CPVT_WordPlace& place, + const CPDF_Point& point) const = 0; virtual CPVT_WordPlace GetLineBeginPlace( const CPVT_WordPlace& place) const = 0; diff --git a/core/include/fpdftext/fpdf_text.h b/core/include/fpdftext/fpdf_text.h index 7c1cde6051..498b6235c3 100644 --- a/core/include/fpdftext/fpdf_text.h +++ b/core/include/fpdftext/fpdf_text.h @@ -58,7 +58,7 @@ class IPDF_TextPage { virtual void GetRectArray(int start, int nCount, CFX_RectArray& rectArray) const = 0; - virtual int GetIndexAtPos(CFX_FloatPoint point, + virtual int GetIndexAtPos(CPDF_Point point, FX_FLOAT xTolerance, FX_FLOAT yTolerance) const = 0; virtual int GetIndexAtPos(FX_FLOAT x, diff --git a/core/include/fxcrt/fx_coordinates.h b/core/include/fxcrt/fx_coordinates.h index 4bafb63099..053d637689 100644 --- a/core/include/fxcrt/fx_coordinates.h +++ b/core/include/fxcrt/fx_coordinates.h @@ -415,15 +415,6 @@ struct FX_SMALL_RECT { int16_t Bottom; }; - -class CFX_FloatPoint { - public: - CFX_FloatPoint(FX_FLOAT xx, FX_FLOAT yy) : x(xx), y(xx) {} - - FX_FLOAT x; - FX_FLOAT y; -}; - class CFX_FloatRect { public: CFX_FloatRect() { left = right = bottom = top = 0; } diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp index 44492b1a54..de3a6572f2 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp @@ -6,8 +6,6 @@ #include "core/src/fpdfapi/fpdf_page/pageint.h" -#include <algorithm> - #include "core/include/fpdfapi/fpdf_module.h" #include "core/include/fpdfapi/fpdf_page.h" #include "core/include/fpdfapi/fpdf_pageobj.h" @@ -15,14 +13,6 @@ #include "core/src/fpdfapi/fpdf_render/render_int.h" #include "third_party/base/stl_util.h" -namespace { - -FX_FLOAT ClipFloat(FX_FLOAT f) { - return std::max(0.0f, std::min(1.0f, f)); -} - -} // namespace - void CPDF_GraphicStates::DefaultStates() { m_ColorState.New()->Default(); } @@ -95,21 +85,21 @@ void CPDF_ClipPathData::SetCount(int path_count, int text_count) { m_pTextList = FX_Alloc(CPDF_TextObject*, text_count); } } -CFX_FloatRect CPDF_ClipPath::GetClipBox() const { - CFX_FloatRect rect; +CPDF_Rect CPDF_ClipPath::GetClipBox() const { + CPDF_Rect rect; FX_BOOL bStarted = FALSE; int count = GetPathCount(); if (count) { rect = GetPath(0).GetBoundingBox(); for (int i = 1; i < count; i++) { - CFX_FloatRect path_rect = GetPath(i).GetBoundingBox(); + CPDF_Rect path_rect = GetPath(i).GetBoundingBox(); rect.Intersect(path_rect); } bStarted = TRUE; } count = GetTextCount(); if (count) { - CFX_FloatRect layer_rect; + CPDF_Rect layer_rect; FX_BOOL bLayerStarted = FALSE; for (int i = 0; i < count; i++) { CPDF_TextObject* pTextObj = GetText(i); @@ -138,9 +128,9 @@ void CPDF_ClipPath::AppendPath(CPDF_Path path, int type, FX_BOOL bAutoMerge) { if (pData->m_PathCount && bAutoMerge) { CPDF_Path old_path = pData->m_pPathList[pData->m_PathCount - 1]; if (old_path.IsRect()) { - CFX_FloatRect old_rect(old_path.GetPointX(0), old_path.GetPointY(0), - old_path.GetPointX(2), old_path.GetPointY(2)); - CFX_FloatRect new_rect = path.GetBoundingBox(); + CPDF_Rect old_rect(old_path.GetPointX(0), old_path.GetPointY(0), + old_path.GetPointX(2), old_path.GetPointY(2)); + CPDF_Rect new_rect = path.GetBoundingBox(); if (old_rect.Contains(new_rect)) { pData->m_PathCount--; pData->m_pPathList[pData->m_PathCount].SetNull(); @@ -544,10 +534,10 @@ void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS, } break; case FXBSTR_ID('C', 'A', 0, 0): - pGeneralState->m_StrokeAlpha = ClipFloat(pObject->GetNumber()); + pGeneralState->m_StrokeAlpha = PDF_ClipFloat(pObject->GetNumber()); break; case FXBSTR_ID('c', 'a', 0, 0): - pGeneralState->m_FillAlpha = ClipFloat(pObject->GetNumber()); + pGeneralState->m_FillAlpha = PDF_ClipFloat(pObject->GetNumber()); break; case FXBSTR_ID('O', 'P', 0, 0): pGeneralState->m_StrokeOP = pObject->GetInteger(); diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp index 1df4f3db37..c47fe8bd73 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp @@ -116,7 +116,7 @@ CPDF_StreamContentParser::CPDF_StreamContentParser( CFX_Matrix* pmtContentToUser, CPDF_PageObjectHolder* pObjHolder, CPDF_Dictionary* pResources, - CFX_FloatRect* pBBox, + CPDF_Rect* pBBox, CPDF_ParseOptions* pOptions, CPDF_AllStates* pStates, int level) diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp index 37b82dd564..d1a7231d45 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp @@ -363,6 +363,16 @@ CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& buf, const CPDF_Object* pObj) { return buf; } +FX_FLOAT PDF_ClipFloat(FX_FLOAT f) { + if (f < 0) { + return 0; + } + if (f > 1.0f) { + return 1.0f; + } + return f; +} + static CPDF_Object* SearchNumberNode(CPDF_Dictionary* pNode, int num) { CPDF_Array* pLimits = pNode->GetArrayBy("Limits"); if (pLimits && diff --git a/core/src/fpdfdoc/doc_annot.cpp b/core/src/fpdfdoc/doc_annot.cpp index dcd21be66e..4b0b2b54bc 100644 --- a/core/src/fpdfdoc/doc_annot.cpp +++ b/core/src/fpdfdoc/doc_annot.cpp @@ -77,7 +77,7 @@ void CPDF_AnnotList::DisplayPass(CPDF_Page* pPage, continue; } } - CFX_FloatRect annot_rect_f; + CPDF_Rect annot_rect_f; pAnnot->GetRect(annot_rect_f); CFX_Matrix matrix = *pMatrix; if (clip_rect) { @@ -132,7 +132,7 @@ CFX_ByteString CPDF_Annot::GetSubType() const { return m_sSubtype; } -void CPDF_Annot::GetRect(CFX_FloatRect& rect) const { +void CPDF_Annot::GetRect(CPDF_Rect& rect) const { if (!m_pAnnotDict) { return; } @@ -210,7 +210,7 @@ static CPDF_Form* FPDFDOC_Annot_GetMatrix(const CPDF_Page* pPage, CFX_FloatRect form_bbox = pForm->m_pFormDict->GetRectBy("BBox"); CFX_Matrix form_matrix = pForm->m_pFormDict->GetMatrixBy("Matrix"); form_matrix.TransformRect(form_bbox); - CFX_FloatRect arect; + CPDF_Rect arect; pAnnot->GetRect(arect); matrix.MatchRect(arect, form_bbox); matrix.Concat(*pUser2Device); diff --git a/core/src/fpdfdoc/doc_ap.cpp b/core/src/fpdfdoc/doc_ap.cpp index 7fe06e2b5d..3ccf4c44d1 100644 --- a/core/src/fpdfdoc/doc_ap.cpp +++ b/core/src/fpdfdoc/doc_ap.cpp @@ -327,33 +327,33 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, if (!pDefFont) { return FALSE; } - CFX_FloatRect rcAnnot = pAnnotDict->GetRectBy("Rect"); + CPDF_Rect rcAnnot = pAnnotDict->GetRectBy("Rect"); int32_t nRotate = 0; if (CPDF_Dictionary* pMKDict = pAnnotDict->GetDictBy("MK")) { nRotate = pMKDict->GetIntegerBy("R"); } - CFX_FloatRect rcBBox; + CPDF_Rect rcBBox; CFX_Matrix matrix; switch (nRotate % 360) { case 0: - rcBBox = CFX_FloatRect(0, 0, rcAnnot.right - rcAnnot.left, - rcAnnot.top - rcAnnot.bottom); + rcBBox = CPDF_Rect(0, 0, rcAnnot.right - rcAnnot.left, + rcAnnot.top - rcAnnot.bottom); break; case 90: matrix = CFX_Matrix(0, 1, -1, 0, rcAnnot.right - rcAnnot.left, 0); - rcBBox = CFX_FloatRect(0, 0, rcAnnot.top - rcAnnot.bottom, - rcAnnot.right - rcAnnot.left); + rcBBox = CPDF_Rect(0, 0, rcAnnot.top - rcAnnot.bottom, + rcAnnot.right - rcAnnot.left); break; case 180: matrix = CFX_Matrix(-1, 0, 0, -1, rcAnnot.right - rcAnnot.left, rcAnnot.top - rcAnnot.bottom); - rcBBox = CFX_FloatRect(0, 0, rcAnnot.right - rcAnnot.left, - rcAnnot.top - rcAnnot.bottom); + rcBBox = CPDF_Rect(0, 0, rcAnnot.right - rcAnnot.left, + rcAnnot.top - rcAnnot.bottom); break; case 270: matrix = CFX_Matrix(0, -1, 1, 0, 0, rcAnnot.top - rcAnnot.bottom); - rcBBox = CFX_FloatRect(0, 0, rcAnnot.top - rcAnnot.bottom, - rcAnnot.right - rcAnnot.left); + rcBBox = CPDF_Rect(0, 0, rcAnnot.top - rcAnnot.bottom, + rcAnnot.right - rcAnnot.left); break; } int32_t nBorderStyle = PBS_SOLID; @@ -414,9 +414,9 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, if (sBorderStream.GetLength() > 0) { sAppStream << "q\n" << sBorderStream << "Q\n"; } - CFX_FloatRect rcBody = - CFX_FloatRect(rcBBox.left + fBorderWidth, rcBBox.bottom + fBorderWidth, - rcBBox.right - fBorderWidth, rcBBox.top - fBorderWidth); + CPDF_Rect rcBody = + CPDF_Rect(rcBBox.left + fBorderWidth, rcBBox.bottom + fBorderWidth, + rcBBox.right - fBorderWidth, rcBBox.top - fBorderWidth); rcBody.Normalize(); CPDF_Dictionary* pAPDict = pAnnotDict->GetDictBy("AP"); if (!pAPDict) { @@ -496,11 +496,11 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, vt.Initialize(); vt.SetText(swValue.c_str()); vt.RearrangeAll(); - CFX_FloatRect rcContent = vt.GetContentRect(); - CFX_FloatPoint ptOffset(0.0f, 0.0f); + CPDF_Rect rcContent = vt.GetContentRect(); + CPDF_Point ptOffset(0.0f, 0.0f); if (!bMultiLine) { ptOffset = - CFX_FloatPoint(0.0f, (rcContent.Height() - rcBody.Height()) / 2.0f); + CPDF_Point(0.0f, (rcContent.Height() - rcBody.Height()) / 2.0f); } CFX_ByteString sBody = CPVT_GenerateAP::GenerateEditAP( &map, vt.GetIterator(), ptOffset, !bCharArray, subWord); @@ -529,10 +529,10 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, CPVT_Provider prd(&map); CPDF_VariableText vt; vt.SetProvider(&prd); - CFX_FloatRect rcButton = rcBody; + CPDF_Rect rcButton = rcBody; rcButton.left = rcButton.right - 13; rcButton.Normalize(); - CFX_FloatRect rcEdit = rcBody; + CPDF_Rect rcEdit = rcBody; rcEdit.right = rcButton.left; rcEdit.Normalize(); vt.SetPlateRect(rcEdit); @@ -544,9 +544,9 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, vt.Initialize(); vt.SetText(swValue.c_str()); vt.RearrangeAll(); - CFX_FloatRect rcContent = vt.GetContentRect(); - CFX_FloatPoint ptOffset = - CFX_FloatPoint(0.0f, (rcContent.Height() - rcEdit.Height()) / 2.0f); + CPDF_Rect rcContent = vt.GetContentRect(); + CPDF_Point ptOffset = + CPDF_Point(0.0f, (rcContent.Height() - rcEdit.Height()) / 2.0f); CFX_ByteString sEdit = CPVT_GenerateAP::GenerateEditAP( &map, vt.GetIterator(), ptOffset, TRUE, 0); if (sEdit.GetLength() > 0) { @@ -575,9 +575,8 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, if (sButtonBorder.GetLength() > 0) { sAppStream << "q\n" << sButtonBorder << "Q\n"; } - CFX_FloatPoint ptCenter = - CFX_FloatPoint((rcButton.left + rcButton.right) / 2, - (rcButton.top + rcButton.bottom) / 2); + CPDF_Point ptCenter = CPDF_Point((rcButton.left + rcButton.right) / 2, + (rcButton.top + rcButton.bottom) / 2); if (IsFloatBigger(rcButton.Width(), 6) && IsFloatBigger(rcButton.Height(), 6)) { sAppStream << "q\n" @@ -629,8 +628,7 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, } CPDF_VariableText vt; vt.SetProvider(&prd); - vt.SetPlateRect( - CFX_FloatRect(rcBody.left, 0.0f, rcBody.right, 0.0f)); + vt.SetPlateRect(CPDF_Rect(rcBody.left, 0.0f, rcBody.right, 0.0f)); if (IsFloatZero(fFontSize)) { vt.SetFontSize(12.0f); } else { @@ -641,8 +639,8 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, vt.RearrangeAll(); FX_FLOAT fItemHeight = vt.GetContentRect().Height(); if (bSelected) { - CFX_FloatRect rcItem = CFX_FloatRect( - rcBody.left, fy - fItemHeight, rcBody.right, fy); + CPDF_Rect rcItem = + CPDF_Rect(rcBody.left, fy - fItemHeight, rcBody.right, fy); sBody << "q\n" << CPVT_GenerateAP::GenerateColorAP( CPVT_Color(CPVT_Color::kRGB, 0, 51.0f / 255.0f, 113.0f / 255.0f), @@ -653,13 +651,13 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, sBody << "BT\n" << CPVT_GenerateAP::GenerateColorAP( CPVT_Color(CPVT_Color::kGray, 1), TRUE) << CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), - CFX_FloatPoint(0.0f, fy), + CPDF_Point(0.0f, fy), TRUE, 0) << "ET\n"; } else { sBody << "BT\n" << CPVT_GenerateAP::GenerateColorAP(crText, TRUE) << CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), - CFX_FloatPoint(0.0f, fy), + CPDF_Point(0.0f, fy), TRUE, 0) << "ET\n"; } @@ -716,12 +714,12 @@ FX_BOOL CPVT_GenerateAP::GenerateListBoxAP(CPDF_Document* pDoc, CFX_ByteString CPVT_GenerateAP::GenerateEditAP( IPVT_FontMap* pFontMap, IPDF_VariableText_Iterator* pIterator, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, FX_BOOL bContinuous, FX_WORD SubWord, const CPVT_WordRange* pVisible) { CFX_ByteTextBuf sEditStream, sLineStream, sWords; - CFX_FloatPoint ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f); + CPDF_Point ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f); int32_t nCurFontIndex = -1; if (pIterator) { if (pVisible) { @@ -745,13 +743,13 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP( } CPVT_Word word; if (pIterator->GetWord(word)) { - ptNew = CFX_FloatPoint(word.ptWord.x + ptOffset.x, - word.ptWord.y + ptOffset.y); + ptNew = CPDF_Point(word.ptWord.x + ptOffset.x, + word.ptWord.y + ptOffset.y); } else { CPVT_Line line; pIterator->GetLine(line); - ptNew = CFX_FloatPoint(line.ptLine.x + ptOffset.x, - line.ptLine.y + ptOffset.y); + ptNew = CPDF_Point(line.ptLine.x + ptOffset.x, + line.ptLine.y + ptOffset.y); } if (ptNew.x != ptOld.x || ptNew.y != ptOld.y) { sLineStream << ptNew.x - ptOld.x << " " << ptNew.y - ptOld.y @@ -777,8 +775,8 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP( } else { CPVT_Word word; if (pIterator->GetWord(word)) { - ptNew = CFX_FloatPoint(word.ptWord.x + ptOffset.x, - word.ptWord.y + ptOffset.y); + ptNew = CPDF_Point(word.ptWord.x + ptOffset.x, + word.ptWord.y + ptOffset.y); if (ptNew.x != ptOld.x || ptNew.y != ptOld.y) { sEditStream << ptNew.x - ptOld.x << " " << ptNew.y - ptOld.y << " Td\n"; @@ -803,7 +801,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP( return sEditStream.GetByteString(); } CFX_ByteString CPVT_GenerateAP::GenerateBorderAP( - const CFX_FloatRect& rect, + const CPDF_Rect& rect, FX_FLOAT fWidth, const CPVT_Color& color, const CPVT_Color& crLeftTop, diff --git a/core/src/fpdfdoc/doc_link.cpp b/core/src/fpdfdoc/doc_link.cpp index 7da29e0954..6617e85cd4 100644 --- a/core/src/fpdfdoc/doc_link.cpp +++ b/core/src/fpdfdoc/doc_link.cpp @@ -43,7 +43,7 @@ CPDF_Link CPDF_LinkList::GetLinkAtPoint(CPDF_Page* pPage, continue; CPDF_Link link(pAnnot); - CFX_FloatRect rect = link.GetRect(); + CPDF_Rect rect = link.GetRect(); if (!rect.Contains(pdf_x, pdf_y)) continue; @@ -68,7 +68,7 @@ void CPDF_LinkList::LoadPageLinks(CPDF_Page* pPage, } } -CFX_FloatRect CPDF_Link::GetRect() { +CPDF_Rect CPDF_Link::GetRect() { return m_pDict->GetRectBy("Rect"); } CPDF_Dest CPDF_Link::GetDest(CPDF_Document* pDoc) { diff --git a/core/src/fpdfdoc/doc_vt.cpp b/core/src/fpdfdoc/doc_vt.cpp index 477df25a14..0f8a4e5320 100644 --- a/core/src/fpdfdoc/doc_vt.cpp +++ b/core/src/fpdfdoc/doc_vt.cpp @@ -166,7 +166,7 @@ void CSection::UpdateWordPlace(CPVT_WordPlace& place) const { } } } -CPVT_WordPlace CSection::SearchWordPlace(const CFX_FloatPoint& point) const { +CPVT_WordPlace CSection::SearchWordPlace(const CPDF_Point& point) const { ASSERT(m_pVT); CPVT_WordPlace place = GetBeginWordPlace(); FX_BOOL bUp = TRUE; @@ -1135,8 +1135,8 @@ CPVT_WordPlace CPDF_VariableText::GetNextWordPlace( return place; } CPVT_WordPlace CPDF_VariableText::SearchWordPlace( - const CFX_FloatPoint& point) const { - CFX_FloatPoint pt = OutToIn(point); + const CPDF_Point& point) const { + CPDF_Point pt = OutToIn(point); CPVT_WordPlace place = GetBeginWordPlace(); int32_t nLeft = 0; int32_t nRight = m_SectionArray.GetSize() - 1; @@ -1161,8 +1161,8 @@ CPVT_WordPlace CPDF_VariableText::SearchWordPlace( continue; } else { place = pSection->SearchWordPlace( - CFX_FloatPoint(pt.x - pSection->m_SecInfo.rcSection.left, - pt.y - pSection->m_SecInfo.rcSection.top)); + CPDF_Point(pt.x - pSection->m_SecInfo.rcSection.left, + pt.y - pSection->m_SecInfo.rcSection.top)); place.nSecIndex = nMid; return place; } @@ -1180,10 +1180,10 @@ CPVT_WordPlace CPDF_VariableText::SearchWordPlace( } CPVT_WordPlace CPDF_VariableText::GetUpWordPlace( const CPVT_WordPlace& place, - const CFX_FloatPoint& point) const { + const CPDF_Point& point) const { if (CSection* pSection = m_SectionArray.GetAt(place.nSecIndex)) { CPVT_WordPlace temp = place; - CFX_FloatPoint pt = OutToIn(point); + CPDF_Point pt = OutToIn(point); if (temp.nLineIndex-- > 0) { return pSection->SearchWordPlace( pt.x - pSection->m_SecInfo.rcSection.left, temp); @@ -1200,10 +1200,10 @@ CPVT_WordPlace CPDF_VariableText::GetUpWordPlace( } CPVT_WordPlace CPDF_VariableText::GetDownWordPlace( const CPVT_WordPlace& place, - const CFX_FloatPoint& point) const { + const CPDF_Point& point) const { if (CSection* pSection = m_SectionArray.GetAt(place.nSecIndex)) { CPVT_WordPlace temp = place; - CFX_FloatPoint pt = OutToIn(point); + CPDF_Point pt = OutToIn(point); if (temp.nLineIndex++ < pSection->m_LineArray.GetSize() - 1) { return pSection->SearchWordPlace( pt.x - pSection->m_SecInfo.rcSection.left, temp); @@ -1333,7 +1333,7 @@ FX_BOOL CPDF_VariableText::GetSectionInfo(const CPVT_WordPlace& place, } return FALSE; } -CFX_FloatRect CPDF_VariableText::GetContentRect() const { +CPDF_Rect CPDF_VariableText::GetContentRect() const { return InToOut(CPVT_FloatRect(CPDF_EditContainer::GetContentRect())); } FX_FLOAT CPDF_VariableText::GetWordFontSize(const CPVT_WordInfo& WordInfo, @@ -1753,8 +1753,8 @@ FX_BOOL CPDF_VariableText_Iterator::GetWord(CPVT_Word& word) const { word.nCharset = pWord->nCharset; word.fWidth = m_pVT->GetWordWidth(*pWord); word.ptWord = m_pVT->InToOut( - CFX_FloatPoint(pWord->fWordX + pSection->m_SecInfo.rcSection.left, - pWord->fWordY + pSection->m_SecInfo.rcSection.top)); + CPDF_Point(pWord->fWordX + pSection->m_SecInfo.rcSection.left, + pWord->fWordY + pSection->m_SecInfo.rcSection.top)); word.fAscent = m_pVT->GetWordAscent(*pWord); word.fDescent = m_pVT->GetWordDescent(*pWord); if (pWord->pWordProps) { @@ -1785,7 +1785,7 @@ FX_BOOL CPDF_VariableText_Iterator::GetLine(CPVT_Line& line) const { line.lineplace = CPVT_WordPlace(m_CurPos.nSecIndex, m_CurPos.nLineIndex, -1); if (CSection* pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) { if (CLine* pLine = pSection->m_LineArray.GetAt(m_CurPos.nLineIndex)) { - line.ptLine = m_pVT->InToOut(CFX_FloatPoint( + line.ptLine = m_pVT->InToOut(CPDF_Point( pLine->m_LineInfo.fLineX + pSection->m_SecInfo.rcSection.left, pLine->m_LineInfo.fLineY + pSection->m_SecInfo.rcSection.top)); line.fLineWidth = pLine->m_LineInfo.fLineWidth; diff --git a/core/src/fpdfdoc/pdf_vt.h b/core/src/fpdfdoc/pdf_vt.h index 13ec71a125..286fad5772 100644 --- a/core/src/fpdfdoc/pdf_vt.h +++ b/core/src/fpdfdoc/pdf_vt.h @@ -44,7 +44,7 @@ class CPVT_FloatRect : public CFX_FloatRect { right = other_right; bottom = other_bottom; } - explicit CPVT_FloatRect(const CFX_FloatRect& rect) { + explicit CPVT_FloatRect(const CPDF_Rect& rect) { left = rect.left; top = rect.top; right = rect.right; @@ -257,7 +257,7 @@ class CSection { CPVT_WordPlace GetPrevWordPlace(const CPVT_WordPlace& place) const; CPVT_WordPlace GetNextWordPlace(const CPVT_WordPlace& place) const; void UpdateWordPlace(CPVT_WordPlace& place) const; - CPVT_WordPlace SearchWordPlace(const CFX_FloatPoint& point) const; + CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const; CPVT_WordPlace SearchWordPlace(FX_FLOAT fx, const CPVT_WordPlace& lineplace) const; CPVT_WordPlace SearchWordPlace(FX_FLOAT fx, @@ -296,46 +296,44 @@ class CPDF_EditContainer { public: CPDF_EditContainer() : m_rcPlate(0, 0, 0, 0), m_rcContent(0, 0, 0, 0) {} virtual ~CPDF_EditContainer() {} - virtual void SetPlateRect(const CFX_FloatRect& rect) { m_rcPlate = rect; } - virtual const CFX_FloatRect& GetPlateRect() const { return m_rcPlate; } + virtual void SetPlateRect(const CPDF_Rect& rect) { m_rcPlate = rect; } + virtual const CPDF_Rect& GetPlateRect() const { return m_rcPlate; } virtual void SetContentRect(const CPVT_FloatRect& rect) { m_rcContent = rect; } - virtual CFX_FloatRect GetContentRect() const { return m_rcContent; } + virtual CPDF_Rect GetContentRect() const { return m_rcContent; } FX_FLOAT GetPlateWidth() const { return m_rcPlate.right - m_rcPlate.left; } FX_FLOAT GetPlateHeight() const { return m_rcPlate.top - m_rcPlate.bottom; } CPVT_Size GetPlateSize() const { return CPVT_Size(GetPlateWidth(), GetPlateHeight()); } - CFX_FloatPoint GetBTPoint() const { - return CFX_FloatPoint(m_rcPlate.left, m_rcPlate.top); + CPDF_Point GetBTPoint() const { + return CPDF_Point(m_rcPlate.left, m_rcPlate.top); } - CFX_FloatPoint GetETPoint() const { - return CFX_FloatPoint(m_rcPlate.right, m_rcPlate.bottom); + CPDF_Point GetETPoint() const { + return CPDF_Point(m_rcPlate.right, m_rcPlate.bottom); } - inline CFX_FloatPoint InToOut(const CFX_FloatPoint& point) const { - return CFX_FloatPoint(point.x + GetBTPoint().x, GetBTPoint().y - point.y); + inline CPDF_Point InToOut(const CPDF_Point& point) const { + return CPDF_Point(point.x + GetBTPoint().x, GetBTPoint().y - point.y); } - inline CFX_FloatPoint OutToIn(const CFX_FloatPoint& point) const { - return CFX_FloatPoint(point.x - GetBTPoint().x, GetBTPoint().y - point.y); + inline CPDF_Point OutToIn(const CPDF_Point& point) const { + return CPDF_Point(point.x - GetBTPoint().x, GetBTPoint().y - point.y); } - inline CFX_FloatRect InToOut(const CPVT_FloatRect& rect) const { - CFX_FloatPoint ptLeftTop = InToOut(CFX_FloatPoint(rect.left, rect.top)); - CFX_FloatPoint ptRightBottom = - InToOut(CFX_FloatPoint(rect.right, rect.bottom)); - return CFX_FloatRect(ptLeftTop.x, ptRightBottom.y, ptRightBottom.x, - ptLeftTop.y); + inline CPDF_Rect InToOut(const CPVT_FloatRect& rect) const { + CPDF_Point ptLeftTop = InToOut(CPDF_Point(rect.left, rect.top)); + CPDF_Point ptRightBottom = InToOut(CPDF_Point(rect.right, rect.bottom)); + return CPDF_Rect(ptLeftTop.x, ptRightBottom.y, ptRightBottom.x, + ptLeftTop.y); } - inline CPVT_FloatRect OutToIn(const CFX_FloatRect& rect) const { - CFX_FloatPoint ptLeftTop = OutToIn(CFX_FloatPoint(rect.left, rect.top)); - CFX_FloatPoint ptRightBottom = - OutToIn(CFX_FloatPoint(rect.right, rect.bottom)); + inline CPVT_FloatRect OutToIn(const CPDF_Rect& rect) const { + CPDF_Point ptLeftTop = OutToIn(CPDF_Point(rect.left, rect.top)); + CPDF_Point ptRightBottom = OutToIn(CPDF_Point(rect.right, rect.bottom)); return CPVT_FloatRect(ptLeftTop.x, ptLeftTop.y, ptRightBottom.x, ptRightBottom.y); } private: - CFX_FloatRect m_rcPlate; + CPDF_Rect m_rcPlate; CPVT_FloatRect m_rcContent; }; @@ -352,7 +350,7 @@ class CPDF_VariableText : public IPDF_VariableText, private CPDF_EditContainer { IPDF_VariableText_Provider* SetProvider( IPDF_VariableText_Provider* pProvider) override; IPDF_VariableText_Iterator* GetIterator() override; - void SetPlateRect(const CFX_FloatRect& rect) override { + void SetPlateRect(const CPDF_Rect& rect) override { CPDF_EditContainer::SetPlateRect(rect); } void SetAlignment(int32_t nFormat = 0) override { m_nAlignment = nFormat; } @@ -409,10 +407,10 @@ class CPDF_VariableText : public IPDF_VariableText, private CPDF_EditContainer { CPVT_WordPlace DeleteWords(const CPVT_WordRange& PlaceRange) override; CPVT_WordPlace DeleteWord(const CPVT_WordPlace& place) override; CPVT_WordPlace BackSpaceWord(const CPVT_WordPlace& place) override; - const CFX_FloatRect& GetPlateRect() const override { + const CPDF_Rect& GetPlateRect() const override { return CPDF_EditContainer::GetPlateRect(); } - CFX_FloatRect GetContentRect() const override; + CPDF_Rect GetContentRect() const override; int32_t GetTotalWords() const override; FX_FLOAT GetFontSize() const override { return m_fFontSize; } int32_t GetAlignment() const override { return m_nAlignment; } @@ -426,11 +424,11 @@ class CPDF_VariableText : public IPDF_VariableText, private CPDF_EditContainer { CPVT_WordPlace GetEndWordPlace() const override; CPVT_WordPlace GetPrevWordPlace(const CPVT_WordPlace& place) const override; CPVT_WordPlace GetNextWordPlace(const CPVT_WordPlace& place) const override; - CPVT_WordPlace SearchWordPlace(const CFX_FloatPoint& point) const override; + CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const override; CPVT_WordPlace GetUpWordPlace(const CPVT_WordPlace& place, - const CFX_FloatPoint& point) const override; + const CPDF_Point& point) const override; CPVT_WordPlace GetDownWordPlace(const CPVT_WordPlace& place, - const CFX_FloatPoint& point) const override; + const CPDF_Point& point) const override; CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace& place) const override; CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace& place) const override; CPVT_WordPlace GetSectionBeginPlace( diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp index 77b610a7e8..8e2eae1251 100644 --- a/core/src/fpdftext/fpdf_text_int.cpp +++ b/core/src/fpdftext/fpdf_text_int.cpp @@ -301,7 +301,7 @@ void CPDF_TextPage::GetRectArray(int start, rectArray.Add(rect); } -int CPDF_TextPage::GetIndexAtPos(CFX_FloatPoint point, +int CPDF_TextPage::GetIndexAtPos(CPDF_Point point, FX_FLOAT xTolerance, FX_FLOAT yTolerance) const { if (!m_bIsParsed) @@ -424,7 +424,7 @@ int CPDF_TextPage::GetIndexAtPos(FX_FLOAT x, FX_FLOAT y, FX_FLOAT xTolerance, FX_FLOAT yTolerance) const { - CFX_FloatPoint point(x, y); + CPDF_Point point(x, y); return GetIndexAtPos(point, xTolerance, yTolerance); } diff --git a/core/src/fpdftext/text_int.h b/core/src/fpdftext/text_int.h index ef742a38be..113e1d1ac8 100644 --- a/core/src/fpdftext/text_int.h +++ b/core/src/fpdftext/text_int.h @@ -67,7 +67,7 @@ class CPDF_TextPage : public IPDF_TextPage { void GetRectArray(int start, int nCount, CFX_RectArray& rectArray) const override; - int GetIndexAtPos(CFX_FloatPoint point, + int GetIndexAtPos(CPDF_Point point, FX_FLOAT xTolerance, FX_FLOAT yTolerance) const override; int GetIndexAtPos(FX_FLOAT x, diff --git a/fpdfsdk/include/formfiller/FFL_CheckBox.h b/fpdfsdk/include/formfiller/FFL_CheckBox.h index 7536871f16..4ffb143734 100644 --- a/fpdfsdk/include/formfiller/FFL_CheckBox.h +++ b/fpdfsdk/include/formfiller/FFL_CheckBox.h @@ -24,7 +24,7 @@ class CFFL_CheckBox : public CFFL_Button { FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) override; + const CPDF_Point& point) override; FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView) override; void SaveData(CPDFSDK_PageView* pPageView) override; }; diff --git a/fpdfsdk/include/formfiller/FFL_FormFiller.h b/fpdfsdk/include/formfiller/FFL_FormFiller.h index 4ea8fdaa8b..cb14397be5 100644 --- a/fpdfsdk/include/formfiller/FFL_FormFiller.h +++ b/fpdfsdk/include/formfiller/FFL_FormFiller.h @@ -45,32 +45,32 @@ class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler { virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, @@ -106,19 +106,16 @@ class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler { CFX_Matrix GetCurMatrix(); - CFX_FloatRect FFLtoPWL(const CFX_FloatRect& rect); - CFX_FloatRect PWLtoFFL(const CFX_FloatRect& rect); - CFX_FloatPoint FFLtoPWL(const CFX_FloatPoint& point); - CFX_FloatPoint PWLtoFFL(const CFX_FloatPoint& point); + CPDF_Rect FFLtoPWL(const CPDF_Rect& rect); + CPDF_Rect PWLtoFFL(const CPDF_Rect& rect); + CPDF_Point FFLtoPWL(const CPDF_Point& point); + CPDF_Point PWLtoFFL(const CPDF_Point& point); - CFX_FloatPoint WndtoPWL(CPDFSDK_PageView* pPageView, - const CFX_FloatPoint& pt); - CFX_FloatRect FFLtoWnd(CPDFSDK_PageView* pPageView, - const CFX_FloatRect& rect); + CPDF_Point WndtoPWL(CPDFSDK_PageView* pPageView, const CPDF_Point& pt); + CPDF_Rect FFLtoWnd(CPDFSDK_PageView* pPageView, const CPDF_Rect& rect); - void SetWindowRect(CPDFSDK_PageView* pPageView, - const CFX_FloatRect& rcWindow); - CFX_FloatRect GetWindowRect(CPDFSDK_PageView* pPageView); + void SetWindowRect(CPDFSDK_PageView* pPageView, const CPDF_Rect& rcWindow); + CPDF_Rect GetWindowRect(CPDFSDK_PageView* pPageView); FX_BOOL CommitData(CPDFSDK_PageView* pPageView, FX_UINT nFlag); virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView); @@ -135,10 +132,10 @@ class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler { virtual PWL_CREATEPARAM GetCreateParam(); virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView) = 0; - virtual CFX_FloatRect GetFocusBox(CPDFSDK_PageView* pPageView); + virtual CPDF_Rect GetFocusBox(CPDFSDK_PageView* pPageView); FX_BOOL IsValid() const; - CFX_FloatRect GetPDFWindowRect() const; + CPDF_Rect GetPDFWindowRect() const; CPDFSDK_PageView* GetCurPageView(); void SetChangeMark(); @@ -159,7 +156,7 @@ class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler { FX_BOOL m_bValid; CFFL_PageView2PDFWindow m_Maps; - CFX_FloatPoint m_ptOldPos; + CPDF_Point m_ptOldPos; }; class CFFL_Button : public CFFL_FormFiller { @@ -174,15 +171,15 @@ class CFFL_Button : public CFFL_FormFiller { FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) override; + const CPDF_Point& point) override; FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) override; + const CPDF_Point& point) override; FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) override; + const CPDF_Point& point) override; void OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, diff --git a/fpdfsdk/include/formfiller/FFL_IFormFiller.h b/fpdfsdk/include/formfiller/FFL_IFormFiller.h index cea61bf20e..93e7505f9c 100644 --- a/fpdfsdk/include/formfiller/FFL_IFormFiller.h +++ b/fpdfsdk/include/formfiller/FFL_IFormFiller.h @@ -26,7 +26,7 @@ class CFFL_IFormFiller : public IPWL_Filler_Notify { virtual FX_BOOL Annot_HitTest(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, - CFX_FloatPoint point); + CPDF_Point point); virtual FX_RECT GetViewBBox(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot); virtual void OnDraw(CPDFSDK_PageView* pPageView, @@ -49,32 +49,32 @@ class CFFL_IFormFiller : public IPWL_Filler_Notify { virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, diff --git a/fpdfsdk/include/formfiller/FFL_RadioButton.h b/fpdfsdk/include/formfiller/FFL_RadioButton.h index dba2798e30..a4e7928e31 100644 --- a/fpdfsdk/include/formfiller/FFL_RadioButton.h +++ b/fpdfsdk/include/formfiller/FFL_RadioButton.h @@ -24,7 +24,7 @@ class CFFL_RadioButton : public CFFL_Button { FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) override; + const CPDF_Point& point) override; FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView) override; void SaveData(CPDFSDK_PageView* pPageView) override; }; diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h index fa2c8a2752..fb976a256f 100644 --- a/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h +++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h @@ -40,7 +40,7 @@ class CPDFXFA_Document : public IXFA_DocProvider { CPDFSDK_Document* GetSDKDocument(CPDFDoc_Environment* pFormFillEnv); - void FXRect2PDFRect(const CFX_RectF& fxRectF, CFX_FloatRect& pdfRect); + void FXRect2PDFRect(const CFX_RectF& fxRectF, CPDF_Rect& pdfRect); virtual void SetChangeMark(IXFA_Doc* hDoc); virtual FX_BOOL GetChangeMark(IXFA_Doc* hDoc); diff --git a/fpdfsdk/include/fsdk_annothandler.h b/fpdfsdk/include/fsdk_annothandler.h index 407e94d236..95b11d1823 100644 --- a/fpdfsdk/include/fsdk_annothandler.h +++ b/fpdfsdk/include/fsdk_annothandler.h @@ -23,7 +23,7 @@ class CPDFSDK_Annot; class CPDFSDK_PageView; class CPDF_Annot; class CFX_Matrix; -class CFX_FloatPoint; +class CPDF_Point; class IPDFSDK_AnnotHandler { public: @@ -47,12 +47,12 @@ class IPDFSDK_AnnotHandler { virtual void DeleteAnnot(CPDFSDK_Annot* pAnnot) = 0; - virtual CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot) = 0; + virtual CPDF_Rect GetViewBBox(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot) = 0; virtual FX_BOOL HitTest(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, - const CFX_FloatPoint& point) = 0; + const CPDF_Point& point) = 0; virtual void OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, @@ -64,7 +64,7 @@ class IPDFSDK_AnnotHandler { CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CFX_FloatRect& rcWindow, + const CPDF_Rect& rcWindow, FX_DWORD dwFlags) = 0; virtual void OnCreate(CPDFSDK_Annot* pAnnot) = 0; @@ -85,36 +85,36 @@ class IPDFSDK_AnnotHandler { virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) = 0; + const CPDF_Point& point) = 0; virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) = 0; + const CPDF_Point& point) = 0; virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) = 0; + const CPDF_Point& point) = 0; virtual FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) = 0; + const CPDF_Point& point) = 0; virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, - const CFX_FloatPoint& point) = 0; + const CPDF_Point& point) = 0; virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) = 0; + const CPDF_Point& point) = 0; virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) = 0; + const CPDF_Point& point) = 0; virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) = 0; + const CPDF_Point& point) = 0; // by wjm. virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, @@ -150,11 +150,11 @@ class CPDFSDK_BFAnnotHandler : public IPDFSDK_AnnotHandler { #endif // PDF_ENABLE_XFA void ReleaseAnnot(CPDFSDK_Annot* pAnnot) override; void DeleteAnnot(CPDFSDK_Annot* pAnnot) override {} - CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot) override; + CPDF_Rect GetViewBBox(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot) override; FX_BOOL HitTest(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, - const CFX_FloatPoint& point) override; + const CPDF_Point& point) override; void OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, @@ -164,7 +164,7 @@ class CPDFSDK_BFAnnotHandler : public IPDFSDK_AnnotHandler { CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CFX_FloatRect& rcWindow, + const CPDF_Rect& rcWindow, FX_DWORD dwFlags) override {} void OnCreate(CPDFSDK_Annot* pAnnot) override; void OnLoad(CPDFSDK_Annot* pAnnot) override; @@ -179,36 +179,36 @@ class CPDFSDK_BFAnnotHandler : public IPDFSDK_AnnotHandler { FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) override; + const CPDF_Point& point) override; FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) override; + const CPDF_Point& point) override; FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) override; + const CPDF_Point& point) override; FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) override; + const CPDF_Point& point) override; FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, - const CFX_FloatPoint& point) override; + const CPDF_Point& point) override; FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) override; + const CPDF_Point& point) override; FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) override; + const CPDF_Point& point) override; FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) override { + const CPDF_Point& point) override { return FALSE; } FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, @@ -258,12 +258,12 @@ class CPDFSDK_XFAAnnotHandler : public IPDFSDK_AnnotHandler { virtual void DeleteAnnot(CPDFSDK_Annot* pAnnot) {} - virtual CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot); + virtual CPDF_Rect GetViewBBox(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot); virtual FX_BOOL HitTest(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual void OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, @@ -275,7 +275,7 @@ class CPDFSDK_XFAAnnotHandler : public IPDFSDK_AnnotHandler { CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CFX_FloatRect& rcWindow, + const CPDF_Rect& rcWindow, FX_DWORD dwFlags) {} virtual void OnCreate(CPDFSDK_Annot* pAnnot) {} @@ -296,36 +296,36 @@ class CPDFSDK_XFAAnnotHandler : public IPDFSDK_AnnotHandler { virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); // by wjm. virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, @@ -390,33 +390,33 @@ class CPDFSDK_AnnotHandlerMgr { virtual FX_BOOL Annot_OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL Annot_OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL Annot_OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL Annot_OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL Annot_OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL Annot_OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL Annot_OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point); + const CPDF_Point& point); virtual FX_BOOL Annot_OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, @@ -434,11 +434,11 @@ class CPDFSDK_AnnotHandlerMgr { CPDFSDK_Annot* pKillAnnot); #endif // PDF_ENABLE_XFA - virtual CFX_FloatRect Annot_OnGetViewBBox(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot); + virtual CPDF_Rect Annot_OnGetViewBBox(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot); virtual FX_BOOL Annot_OnHitTest(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, - const CFX_FloatPoint& point); + const CPDF_Point& point); private: IPDFSDK_AnnotHandler* GetAnnotHandler(const CFX_ByteString& sType) const; diff --git a/fpdfsdk/include/fsdk_baseannot.h b/fpdfsdk/include/fsdk_baseannot.h index c0ed529782..49c25de284 100644 --- a/fpdfsdk/include/fsdk_baseannot.h +++ b/fpdfsdk/include/fsdk_baseannot.h @@ -89,8 +89,8 @@ class CPDFSDK_Annot { virtual CFX_ByteString GetType() const { return ""; } virtual CFX_ByteString GetSubType() const { return ""; } - virtual void SetRect(const CFX_FloatRect& rect) {} - virtual CFX_FloatRect GetRect() const { return CFX_FloatRect(); } + virtual void SetRect(const CPDF_Rect& rect) {} + virtual CPDF_Rect GetRect() const { return CPDF_Rect(); } virtual void Annot_OnDraw(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, @@ -130,8 +130,8 @@ class CPDFSDK_BAAnnot : public CPDFSDK_Annot { CFX_ByteString GetType() const override; CFX_ByteString GetSubType() const override; - void SetRect(const CFX_FloatRect& rect) override; - CFX_FloatRect GetRect() const override; + void SetRect(const CPDF_Rect& rect) override; + CPDF_Rect GetRect() const override; CPDF_Annot* GetPDFAnnot() const override; void Annot_OnDraw(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, @@ -207,7 +207,7 @@ class CPDFSDK_BAAnnot : public CPDFSDK_Annot { void ClearCachedAP(); void WriteAppearance(const CFX_ByteString& sAPType, - const CFX_FloatRect& rcBBox, + const CPDF_Rect& rcBBox, const CFX_Matrix& matrix, const CFX_ByteString& sContents, const CFX_ByteString& sAPState = ""); diff --git a/fpdfsdk/include/fsdk_baseform.h b/fpdfsdk/include/fsdk_baseform.h index ac34528d4d..44ba5726a4 100644 --- a/fpdfsdk/include/fsdk_baseform.h +++ b/fpdfsdk/include/fsdk_baseform.h @@ -187,8 +187,8 @@ class CPDFSDK_Widget : public CPDFSDK_BAAnnot { void ResetAppearance_ListBox(); void ResetAppearance_TextField(const FX_WCHAR* sValue); - CFX_FloatRect GetClientRect() const; - CFX_FloatRect GetRotatedRect() const; + CPDF_Rect GetClientRect() const; + CPDF_Rect GetRotatedRect() const; CFX_ByteString GetBackgroundAppStream() const; CFX_ByteString GetBorderAppStream() const; @@ -384,7 +384,7 @@ class CBA_AnnotIterator { private: void GenerateResults(); - static CFX_FloatRect GetAnnotRect(const CPDFSDK_Annot* pAnnot); + static CPDF_Rect GetAnnotRect(const CPDFSDK_Annot* pAnnot); // Function signature compatible with std::sort(). static bool CompareByLeftAscending(const CPDFSDK_Annot* p1, diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h index 4e9aab40bb..1e2620a192 100644 --- a/fpdfsdk/include/fsdk_mgr.h +++ b/fpdfsdk/include/fsdk_mgr.h @@ -603,20 +603,20 @@ class CPDFSDK_PageView final { CPDF_Document* GetPDFDocument(); CPDFSDK_Document* GetSDKDocument() { return m_pSDKDoc; } - FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_UINT nFlag); - FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_UINT nFlag); + FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_UINT nFlag); + FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_UINT nFlag); #ifdef PDF_ENABLE_XFA - FX_BOOL OnRButtonDown(const CFX_FloatPoint& point, FX_UINT nFlag); - FX_BOOL OnRButtonUp(const CFX_FloatPoint& point, FX_UINT nFlag); + FX_BOOL OnRButtonDown(const CPDF_Point& point, FX_UINT nFlag); + FX_BOOL OnRButtonUp(const CPDF_Point& point, FX_UINT nFlag); #endif // PDF_ENABLE_XFA FX_BOOL OnChar(int nChar, FX_UINT nFlag); FX_BOOL OnKeyDown(int nKeyCode, int nFlag); FX_BOOL OnKeyUp(int nKeyCode, int nFlag); - FX_BOOL OnMouseMove(const CFX_FloatPoint& point, int nFlag); + FX_BOOL OnMouseMove(const CPDF_Point& point, int nFlag); FX_BOOL OnMouseWheel(double deltaX, double deltaY, - const CFX_FloatPoint& point, + const CPDF_Point& point, int nFlag); bool IsValidAnnot(const CPDF_Annot* p) const; void GetCurrentMatrix(CFX_Matrix& matrix) { matrix = m_curMatrix; } diff --git a/fpdfsdk/include/fx_systemhandler.h b/fpdfsdk/include/fx_systemhandler.h index 4f64145844..6d186a7bab 100644 --- a/fpdfsdk/include/fx_systemhandler.h +++ b/fpdfsdk/include/fx_systemhandler.h @@ -50,7 +50,7 @@ class IFX_SystemHandler { public: virtual ~IFX_SystemHandler() {} virtual void InvalidateRect(FX_HWND hWnd, FX_RECT rect) = 0; - virtual void OutputSelectedRect(void* pFormFiller, CFX_FloatRect& rect) = 0; + virtual void OutputSelectedRect(void* pFormFiller, CPDF_Rect& rect) = 0; virtual FX_BOOL IsSelectionImplemented() = 0; diff --git a/fpdfsdk/include/fxedit/fx_edit.h b/fpdfsdk/include/fxedit/fx_edit.h index 089eecc1d9..5e1ac0f390 100644 --- a/fpdfsdk/include/fxedit/fx_edit.h +++ b/fpdfsdk/include/fxedit/fx_edit.h @@ -15,7 +15,7 @@ class CFX_RenderDevice; class CPDF_Font; class CFX_Matrix; class CPDF_PageObjectHolder; -class CFX_FloatPoint; +class CPDF_Point; class CPDF_TextObject; class IFX_Edit; class IFX_Edit_FontMap; @@ -92,17 +92,17 @@ class IFX_Edit_Notify { virtual void IOnSetScrollPosY(FX_FLOAT fy) = 0; // set the caret information. virtual void IOnSetCaret(FX_BOOL bVisible, - const CFX_FloatPoint& ptHead, - const CFX_FloatPoint& ptFoot, + const CPDF_Point& ptHead, + const CPDF_Point& ptFoot, const CPVT_WordPlace& place) = 0; // if the caret position is changed ,send the information of current postion // to user. virtual void IOnCaretChange(const CPVT_SecProps& secProps, const CPVT_WordProps& wordProps) = 0; // if the text area is changed, send the information to user. - virtual void IOnContentChange(const CFX_FloatRect& rcContent) = 0; + virtual void IOnContentChange(const CPDF_Rect& rcContent) = 0; // Invalidate the rectangle relative to the bounding box of edit. - virtual void IOnInvalidateRect(CFX_FloatRect* pRect) = 0; + virtual void IOnInvalidateRect(CPDF_Rect* pRect) = 0; }; class IFX_Edit_OprNotify { @@ -204,10 +204,9 @@ class IFX_Edit { virtual void Initialize() = 0; // set the bounding box of the text area. - virtual void SetPlateRect(const CFX_FloatRect& rect, - FX_BOOL bPaint = TRUE) = 0; + virtual void SetPlateRect(const CPDF_Rect& rect, FX_BOOL bPaint = TRUE) = 0; // set the scroll origin - virtual void SetScrollPos(const CFX_FloatPoint& point) = 0; + virtual void SetScrollPos(const CPDF_Point& point) = 0; // set the horizontal text alignment in text box, nFormat (0:left 1:middle // 2:right). @@ -297,11 +296,11 @@ class IFX_Edit { // query if any text is selected. virtual FX_BOOL IsSelected() const = 0; // get the scroll origin - virtual CFX_FloatPoint GetScrollPos() const = 0; + virtual CPDF_Point GetScrollPos() const = 0; // get the bounding box of the text area. - virtual CFX_FloatRect GetPlateRect() const = 0; + virtual CPDF_Rect GetPlateRect() const = 0; // get the fact area of the text. - virtual CFX_FloatRect GetContentRect() const = 0; + virtual CPDF_Rect GetContentRect() const = 0; // get the visible word range virtual CPVT_WordRange GetVisibleWordRange() const = 0; // get the whole word range @@ -311,11 +310,11 @@ class IFX_Edit { // send the mousedown message to edit for response. // if Shift key is hold, bShift is TRUE, is Ctrl key is hold, bCtrl is TRUE. - virtual void OnMouseDown(const CFX_FloatPoint& point, + virtual void OnMouseDown(const CPDF_Point& point, FX_BOOL bShift, FX_BOOL bCtrl) = 0; // send the mousemove message to edit when mouse down is TRUE. - virtual void OnMouseMove(const CFX_FloatPoint& point, + virtual void OnMouseMove(const CPDF_Point& point, FX_BOOL bShift, FX_BOOL bCtrl) = 0; // send the UP key message to edit. @@ -400,7 +399,7 @@ class IFX_Edit { const CPVT_WordPlace& place) const = 0; // search a wordplace form point - virtual CPVT_WordPlace SearchWordPlace(const CFX_FloatPoint& point) const = 0; + virtual CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const = 0; // get the font size of non_rich text or default font size of richtext. virtual FX_FLOAT GetFontSize() const = 0; @@ -427,21 +426,21 @@ class IFX_Edit { static CFX_ByteString GetEditAppearanceStream( IFX_Edit* pEdit, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange = NULL, FX_BOOL bContinuous = TRUE, FX_WORD SubWord = 0); static CFX_ByteString GetSelectAppearanceStream( IFX_Edit* pEdit, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange = NULL); static void DrawEdit(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF crTextFill, FX_COLORREF crTextStroke, - const CFX_FloatRect& rcClip, - const CFX_FloatPoint& ptOffset, + const CPDF_Rect& rcClip, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, IFX_SystemHandler* pSystemHandler, void* pFFLData); @@ -449,31 +448,31 @@ class IFX_Edit { CFX_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF color, - const CFX_FloatRect& rcClip, - const CFX_FloatPoint& ptOffset, + const CPDF_Rect& rcClip, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange); static void DrawRichEdit(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, IFX_Edit* pEdit, - const CFX_FloatRect& rcClip, - const CFX_FloatPoint& ptOffset, + const CPDF_Rect& rcClip, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange); static void GeneratePageObjects( CPDF_PageObjectHolder* pObjectHolder, IFX_Edit* pEdit, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF crText, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray); static void GenerateRichPageObjects( CPDF_PageObjectHolder* pObjectHolder, IFX_Edit* pEdit, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray); static void GenerateUnderlineObjects(CPDF_PageObjectHolder* pObjectHolder, IFX_Edit* pEdit, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF color); @@ -502,7 +501,7 @@ class IFX_List_Notify { // set the position of vertical scrollbar. virtual void IOnSetScrollPosY(FX_FLOAT fy) = 0; // Invalidate the rectangle relative to the bounding box of edit. - virtual void IOnInvalidateRect(CFX_FloatRect* pRect) = 0; + virtual void IOnInvalidateRect(CPDF_Rect* pRect) = 0; protected: virtual ~IFX_List_Notify() {} @@ -516,11 +515,11 @@ class IFX_List { virtual void SetFontMap(IFX_Edit_FontMap* pFontMap) = 0; virtual void SetNotify(IFX_List_Notify* pNotify) = 0; - virtual void SetPlateRect(const CFX_FloatRect& rect) = 0; + virtual void SetPlateRect(const CPDF_Rect& rect) = 0; virtual void SetFontSize(FX_FLOAT fFontSize) = 0; - virtual CFX_FloatRect GetPlateRect() const = 0; - virtual CFX_FloatRect GetContentRect() const = 0; + virtual CPDF_Rect GetPlateRect() const = 0; + virtual CPDF_Rect GetContentRect() const = 0; virtual FX_FLOAT GetFontSize() const = 0; virtual IFX_Edit* GetItemEdit(int32_t nIndex) const = 0; @@ -533,13 +532,13 @@ class IFX_List { virtual FX_BOOL IsValid(int32_t nItemIndex) const = 0; virtual int32_t FindNext(int32_t nIndex, FX_WCHAR nChar) const = 0; - virtual void SetScrollPos(const CFX_FloatPoint& point) = 0; + virtual void SetScrollPos(const CPDF_Point& point) = 0; virtual void ScrollToListItem(int32_t nItemIndex) = 0; - virtual CFX_FloatRect GetItemRect(int32_t nIndex) const = 0; + virtual CPDF_Rect GetItemRect(int32_t nIndex) const = 0; virtual int32_t GetCaret() const = 0; virtual int32_t GetSelect() const = 0; virtual int32_t GetTopItem() const = 0; - virtual int32_t GetItemIndex(const CFX_FloatPoint& point) const = 0; + virtual int32_t GetItemIndex(const CPDF_Point& point) const = 0; virtual int32_t GetFirstSelected() const = 0; virtual void AddString(const FX_WCHAR* string) = 0; @@ -550,10 +549,10 @@ class IFX_List { virtual void Cancel() = 0; virtual CFX_WideString GetText() const = 0; - virtual void OnMouseDown(const CFX_FloatPoint& point, + virtual void OnMouseDown(const CPDF_Point& point, FX_BOOL bShift, FX_BOOL bCtrl) = 0; - virtual void OnMouseMove(const CFX_FloatPoint& point, + virtual void OnMouseMove(const CPDF_Point& point, FX_BOOL bShift, FX_BOOL bCtrl) = 0; virtual void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) = 0; diff --git a/fpdfsdk/include/fxedit/fxet_edit.h b/fpdfsdk/include/fxedit/fxet_edit.h index 9809ac9f7d..d1df3812fc 100644 --- a/fpdfsdk/include/fxedit/fxet_edit.h +++ b/fpdfsdk/include/fxedit/fxet_edit.h @@ -41,7 +41,7 @@ enum EDIT_PROPS_E { }; struct CFX_Edit_LineRect { - CFX_Edit_LineRect(const CPVT_WordRange& wrLine, const CFX_FloatRect& rcLine) + CFX_Edit_LineRect(const CPVT_WordRange& wrLine, const CPDF_Rect& rcLine) : m_wrLine(wrLine), m_rcLine(rcLine) {} FX_BOOL operator!=(const CFX_Edit_LineRect& linerect) const { @@ -67,7 +67,7 @@ struct CFX_Edit_LineRect { } CPVT_WordRange m_wrLine; - CFX_FloatRect m_rcLine; + CPDF_Rect m_rcLine; }; class CFX_Edit_LineRectArray { @@ -93,7 +93,7 @@ class CFX_Edit_LineRectArray { rects.RemoveAll(); } - void Add(const CPVT_WordRange& wrLine, const CFX_FloatRect& rcLine) { + void Add(const CPVT_WordRange& wrLine, const CPDF_Rect& rcLine) { m_LineRects.Add(new CFX_Edit_LineRect(wrLine, rcLine)); } @@ -122,27 +122,27 @@ class CFX_Edit_RectArray { m_Rects.RemoveAll(); } - void Add(const CFX_FloatRect& rect) { + void Add(const CPDF_Rect& rect) { // check for overlapped area for (int32_t i = 0, sz = m_Rects.GetSize(); i < sz; i++) { - CFX_FloatRect* pRect = m_Rects.GetAt(i); + CPDF_Rect* pRect = m_Rects.GetAt(i); if (pRect && pRect->Contains(rect)) return; } - m_Rects.Add(new CFX_FloatRect(rect)); + m_Rects.Add(new CPDF_Rect(rect)); } int32_t GetSize() const { return m_Rects.GetSize(); } - CFX_FloatRect* GetAt(int32_t nIndex) const { + CPDF_Rect* GetAt(int32_t nIndex) const { if (nIndex < 0 || nIndex >= m_Rects.GetSize()) return NULL; return m_Rects.GetAt(nIndex); } - CFX_ArrayTemplate<CFX_FloatRect*> m_Rects; + CFX_ArrayTemplate<CPDF_Rect*> m_Rects; }; class CFX_Edit_Refresh { @@ -151,10 +151,10 @@ class CFX_Edit_Refresh { virtual ~CFX_Edit_Refresh(); void BeginRefresh(); - void Push(const CPVT_WordRange& linerange, const CFX_FloatRect& rect); + void Push(const CPVT_WordRange& linerange, const CPDF_Rect& rect); void NoAnalyse(); void Analyse(int32_t nAlignment); - void AddRefresh(const CFX_FloatRect& rect); + void AddRefresh(const CPDF_Rect& rect); const CFX_Edit_RectArray* GetRefreshRects() const; void EndRefresh(); @@ -533,8 +533,8 @@ class CFX_Edit : public IFX_Edit { IPDF_VariableText* GetVariableText() override; IFX_Edit_FontMap* GetFontMap() override; void Initialize() override; - void SetPlateRect(const CFX_FloatRect& rect, FX_BOOL bPaint = TRUE) override; - void SetScrollPos(const CFX_FloatPoint& point) override; + void SetPlateRect(const CPDF_Rect& rect, FX_BOOL bPaint = TRUE) override; + void SetScrollPos(const CPDF_Point& point) override; void SetAlignmentH(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) override; void SetAlignmentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) override; void SetPasswordChar(FX_WORD wSubWord = '*', FX_BOOL bPaint = TRUE) override; @@ -565,10 +565,10 @@ class CFX_Edit : public IFX_Edit { FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading) override; FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent) override; FX_BOOL SetRichTextAlignment(int32_t nAlignment) override; - void OnMouseDown(const CFX_FloatPoint& point, + void OnMouseDown(const CPDF_Point& point, FX_BOOL bShift, FX_BOOL bCtrl) override; - void OnMouseMove(const CFX_FloatPoint& point, + void OnMouseMove(const CPDF_Point& point, FX_BOOL bShift, FX_BOOL bCtrl) override; void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) override; @@ -602,17 +602,17 @@ class CFX_Edit : public IFX_Edit { CPVT_WordPlace GetSectionBeginPlace( const CPVT_WordPlace& place) const override; CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace& place) const override; - CPVT_WordPlace SearchWordPlace(const CFX_FloatPoint& point) const override; + CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const override; int32_t GetCaret() const override; CPVT_WordPlace GetCaretWordPlace() const override; CFX_WideString GetSelText() const override; CFX_WideString GetText() const override; FX_FLOAT GetFontSize() const override; FX_WORD GetPasswordChar() const override; - CFX_FloatPoint GetScrollPos() const override; + CPDF_Point GetScrollPos() const override; int32_t GetCharArray() const override; - CFX_FloatRect GetPlateRect() const override; - CFX_FloatRect GetContentRect() const override; + CPDF_Rect GetPlateRect() const override; + CPDF_Rect GetContentRect() const override; CFX_WideString GetRangeText(const CPVT_WordRange& range) const override; int32_t GetHorzScale() const override; FX_FLOAT GetCharSpace() const override; @@ -704,10 +704,10 @@ class CFX_Edit : public IFX_Edit { void PaintInsertText(const CPVT_WordPlace& wpOld, const CPVT_WordPlace& wpNew); - inline CFX_FloatPoint VTToEdit(const CFX_FloatPoint& point) const; - inline CFX_FloatPoint EditToVT(const CFX_FloatPoint& point) const; - inline CFX_FloatRect VTToEdit(const CFX_FloatRect& rect) const; - inline CFX_FloatRect EditToVT(const CFX_FloatRect& rect) const; + inline CPDF_Point VTToEdit(const CPDF_Point& point) const; + inline CPDF_Point EditToVT(const CPDF_Point& point) const; + inline CPDF_Rect VTToEdit(const CPDF_Rect& rect) const; + inline CPDF_Rect EditToVT(const CPDF_Rect& rect) const; void Refresh(REFRESH_PLAN_E ePlan, const CPVT_WordRange* pRange1 = NULL, @@ -731,7 +731,7 @@ class CFX_Edit : public IFX_Edit { void SetPageInfo(const CPVT_WordPlace& place); CPVT_WordPlace SearchPageEndPlace(const CPVT_WordPlace& wpPageBegin, - const CFX_FloatPoint& point) const; + const CPDF_Point& point) const; FX_FLOAT GetLineTop(const CPVT_WordPlace& place) const; FX_FLOAT GetLineBottom(const CPVT_WordPlace& place) const; @@ -745,18 +745,18 @@ class CFX_Edit : public IFX_Edit { CPVT_WordPlace m_wpOldCaret; CFX_Edit_Select m_SelState; - CFX_FloatPoint m_ptScrollPos; - CFX_FloatPoint m_ptRefreshScrollPos; + CPDF_Point m_ptScrollPos; + CPDF_Point m_ptRefreshScrollPos; FX_BOOL m_bEnableScroll; IFX_Edit_Iterator* m_pIterator; CFX_Edit_Refresh m_Refresh; - CFX_FloatPoint m_ptCaret; + CPDF_Point m_ptCaret; CFX_Edit_Undo m_Undo; int32_t m_nAlignment; FX_BOOL m_bNotifyFlag; FX_BOOL m_bEnableOverflow; FX_BOOL m_bEnableRefresh; - CFX_FloatRect m_rcOldContent; + CPDF_Rect m_rcOldContent; FX_BOOL m_bEnableUndo; FX_BOOL m_bNotify; FX_BOOL m_bOprNotify; diff --git a/fpdfsdk/include/fxedit/fxet_list.h b/fpdfsdk/include/fxedit/fxet_list.h index 88d57c4928..a2f9524b2e 100644 --- a/fpdfsdk/include/fxedit/fxet_list.h +++ b/fpdfsdk/include/fxedit/fxet_list.h @@ -7,7 +7,7 @@ #ifndef FPDFSDK_INCLUDE_FXEDIT_FXET_LIST_H_ #define FPDFSDK_INCLUDE_FXEDIT_FXET_LIST_H_ -#include "core/include/fpdfapi/fpdf_parser.h" // For CFX_FloatPoint. +#include "core/include/fpdfapi/fpdf_parser.h" // For CPDF_Point. #include "fpdfsdk/include/fxedit/fx_edit.h" class IFX_Edit; @@ -33,7 +33,7 @@ class CLST_Size { FX_FLOAT x, y; }; -class CLST_Rect : public CFX_FloatRect { +class CLST_Rect : public CPDF_Rect { public: CLST_Rect() { left = top = right = bottom = 0.0f; } @@ -47,7 +47,7 @@ class CLST_Rect : public CFX_FloatRect { bottom = other_bottom; } - CLST_Rect(const CFX_FloatRect& rect) { + CLST_Rect(const CPDF_Rect& rect) { left = rect.left; top = rect.top; right = rect.right; @@ -58,7 +58,7 @@ class CLST_Rect : public CFX_FloatRect { void Default() { left = top = right = bottom = 0.0f; } - const CLST_Rect operator=(const CFX_FloatRect& rect) { + const CLST_Rect operator=(const CPDF_Rect& rect) { left = rect.left; top = rect.top; right = rect.right; @@ -83,11 +83,11 @@ class CLST_Rect : public CFX_FloatRect { return bottom - top; } - CFX_FloatPoint LeftTop() const { return CFX_FloatPoint(left, top); } + CPDF_Point LeftTop() const { return CPDF_Point(left, top); } - CFX_FloatPoint RightBottom() const { return CFX_FloatPoint(right, bottom); } + CPDF_Point RightBottom() const { return CPDF_Point(right, bottom); } - const CLST_Rect operator+=(const CFX_FloatPoint& point) { + const CLST_Rect operator+=(const CPDF_Point& point) { left += point.x; right += point.x; top += point.y; @@ -96,7 +96,7 @@ class CLST_Rect : public CFX_FloatRect { return *this; } - const CLST_Rect operator-=(const CFX_FloatPoint& point) { + const CLST_Rect operator-=(const CPDF_Point& point) { left -= point.x; right -= point.x; top -= point.y; @@ -105,12 +105,12 @@ class CLST_Rect : public CFX_FloatRect { return *this; } - CLST_Rect operator+(const CFX_FloatPoint& point) const { + CLST_Rect operator+(const CPDF_Point& point) const { return CLST_Rect(left + point.x, top + point.y, right + point.x, bottom + point.y); } - CLST_Rect operator-(const CFX_FloatPoint& point) const { + CLST_Rect operator-(const CPDF_Point& point) const { return CLST_Rect(left - point.x, top - point.y, right - point.x, bottom - point.y); } @@ -152,43 +152,41 @@ class CFX_ListContainer { : m_rcPlate(0.0f, 0.0f, 0.0f, 0.0f), m_rcContent(0.0f, 0.0f, 0.0f, 0.0f) {} virtual ~CFX_ListContainer() {} - virtual void SetPlateRect(const CFX_FloatRect& rect) { m_rcPlate = rect; } - CFX_FloatRect GetPlateRect() const { return m_rcPlate; } + virtual void SetPlateRect(const CPDF_Rect& rect) { m_rcPlate = rect; } + CPDF_Rect GetPlateRect() const { return m_rcPlate; } void SetContentRect(const CLST_Rect& rect) { m_rcContent = rect; } CLST_Rect GetContentRect() const { return m_rcContent; } - CFX_FloatPoint GetBTPoint() const { - return CFX_FloatPoint(m_rcPlate.left, m_rcPlate.top); + CPDF_Point GetBTPoint() const { + return CPDF_Point(m_rcPlate.left, m_rcPlate.top); } - CFX_FloatPoint GetETPoint() const { - return CFX_FloatPoint(m_rcPlate.right, m_rcPlate.bottom); + CPDF_Point GetETPoint() const { + return CPDF_Point(m_rcPlate.right, m_rcPlate.bottom); } public: - CFX_FloatPoint InnerToOuter(const CFX_FloatPoint& point) const { - return CFX_FloatPoint(point.x + GetBTPoint().x, GetBTPoint().y - point.y); + CPDF_Point InnerToOuter(const CPDF_Point& point) const { + return CPDF_Point(point.x + GetBTPoint().x, GetBTPoint().y - point.y); } - CFX_FloatPoint OuterToInner(const CFX_FloatPoint& point) const { - return CFX_FloatPoint(point.x - GetBTPoint().x, GetBTPoint().y - point.y); + CPDF_Point OuterToInner(const CPDF_Point& point) const { + return CPDF_Point(point.x - GetBTPoint().x, GetBTPoint().y - point.y); } - CFX_FloatRect InnerToOuter(const CLST_Rect& rect) const { - CFX_FloatPoint ptLeftTop = - InnerToOuter(CFX_FloatPoint(rect.left, rect.top)); - CFX_FloatPoint ptRightBottom = - InnerToOuter(CFX_FloatPoint(rect.right, rect.bottom)); - return CFX_FloatRect(ptLeftTop.x, ptRightBottom.y, ptRightBottom.x, - ptLeftTop.y); + CPDF_Rect InnerToOuter(const CLST_Rect& rect) const { + CPDF_Point ptLeftTop = InnerToOuter(CPDF_Point(rect.left, rect.top)); + CPDF_Point ptRightBottom = + InnerToOuter(CPDF_Point(rect.right, rect.bottom)); + return CPDF_Rect(ptLeftTop.x, ptRightBottom.y, ptRightBottom.x, + ptLeftTop.y); } - CLST_Rect OuterToInner(const CFX_FloatRect& rect) const { - CFX_FloatPoint ptLeftTop = - OuterToInner(CFX_FloatPoint(rect.left, rect.top)); - CFX_FloatPoint ptRightBottom = - OuterToInner(CFX_FloatPoint(rect.right, rect.bottom)); + CLST_Rect OuterToInner(const CPDF_Rect& rect) const { + CPDF_Point ptLeftTop = OuterToInner(CPDF_Point(rect.left, rect.top)); + CPDF_Point ptRightBottom = + OuterToInner(CPDF_Point(rect.right, rect.bottom)); return CLST_Rect(ptLeftTop.x, ptLeftTop.y, ptRightBottom.x, ptRightBottom.y); } private: - CFX_FloatRect m_rcPlate; + CPDF_Rect m_rcPlate; CLST_Rect m_rcContent; // positive forever! }; @@ -215,8 +213,8 @@ class CFX_List : protected CFX_ListContainer, public IFX_List { // IFX_List: void SetFontMap(IFX_Edit_FontMap* pFontMap) override; void SetFontSize(FX_FLOAT fFontSize) override; - CFX_FloatRect GetPlateRect() const override; - CFX_FloatRect GetContentRect() const override; + CPDF_Rect GetPlateRect() const override; + CPDF_Rect GetContentRect() const override; FX_FLOAT GetFontSize() const override; IFX_Edit* GetItemEdit(int32_t nIndex) const override; int32_t GetCount() const override; @@ -227,8 +225,8 @@ class CFX_List : protected CFX_ListContainer, public IFX_List { FX_BOOL IsValid(int32_t nItemIndex) const override; int32_t FindNext(int32_t nIndex, FX_WCHAR nChar) const override; void Empty() override; - CFX_FloatRect GetItemRect(int32_t nIndex) const override; - int32_t GetItemIndex(const CFX_FloatPoint& point) const override; + CPDF_Rect GetItemRect(int32_t nIndex) const override; + int32_t GetItemIndex(const CPDF_Point& point) const override; int32_t GetFirstSelected() const override; protected: @@ -286,10 +284,10 @@ class CFX_ListCtrl : public CFX_List { // CFX_List void SetNotify(IFX_List_Notify* pNotify) override; - void OnMouseDown(const CFX_FloatPoint& point, + void OnMouseDown(const CPDF_Point& point, FX_BOOL bShift, FX_BOOL bCtrl) override; - void OnMouseMove(const CFX_FloatPoint& point, + void OnMouseMove(const CPDF_Point& point, FX_BOOL bShift, FX_BOOL bCtrl) override; void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) override; @@ -300,15 +298,15 @@ class CFX_ListCtrl : public CFX_List { void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) override; void OnVK(int32_t nItemIndex, FX_BOOL bShift, FX_BOOL bCtrl) override; FX_BOOL OnChar(FX_WORD nChar, FX_BOOL bShift, FX_BOOL bCtrl) override; - void SetPlateRect(const CFX_FloatRect& rect) override; - void SetScrollPos(const CFX_FloatPoint& point) override; + void SetPlateRect(const CPDF_Rect& rect) override; + void SetScrollPos(const CPDF_Point& point) override; void ScrollToListItem(int32_t nItemIndex) override; - CFX_FloatRect GetItemRect(int32_t nIndex) const override; + CPDF_Rect GetItemRect(int32_t nIndex) const override; int32_t GetCaret() const override { return m_nCaretIndex; } int32_t GetSelect() const override { return m_nSelItem; } int32_t GetTopItem() const override; - CFX_FloatRect GetContentRect() const override; - int32_t GetItemIndex(const CFX_FloatPoint& point) const override; + CPDF_Rect GetContentRect() const override; + int32_t GetItemIndex(const CPDF_Point& point) const override; void AddString(const FX_WCHAR* string) override; void SetTopItem(int32_t nIndex) override; void Select(int32_t nItemIndex) override; @@ -318,10 +316,10 @@ class CFX_ListCtrl : public CFX_List { CFX_WideString GetText() const override; void ReArrange(int32_t nItemIndex) override; - virtual CFX_FloatPoint InToOut(const CFX_FloatPoint& point) const; - virtual CFX_FloatPoint OutToIn(const CFX_FloatPoint& point) const; - virtual CFX_FloatRect InToOut(const CFX_FloatRect& rect) const; - virtual CFX_FloatRect OutToIn(const CFX_FloatRect& rect) const; + virtual CPDF_Point InToOut(const CPDF_Point& point) const; + virtual CPDF_Point OutToIn(const CPDF_Point& point) const; + virtual CPDF_Rect InToOut(const CPDF_Rect& rect) const; + virtual CPDF_Rect OutToIn(const CPDF_Rect& rect) const; private: void SetMultipleSelect(int32_t nItemIndex, FX_BOOL bSelected); @@ -335,7 +333,7 @@ class CFX_ListCtrl : public CFX_List { private: IFX_List_Notify* m_pNotify; FX_BOOL m_bNotifyFlag; - CFX_FloatPoint m_ptScrollPos; + CPDF_Point m_ptScrollPos; CPLST_Select m_aSelItems; // for multiple int32_t m_nSelItem; // for single int32_t m_nFootIndex; // for multiple diff --git a/fpdfsdk/include/pdfwindow/PWL_Button.h b/fpdfsdk/include/pdfwindow/PWL_Button.h index 603dc52ff4..5c65c78160 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Button.h +++ b/fpdfsdk/include/pdfwindow/PWL_Button.h @@ -17,8 +17,8 @@ class CPWL_Button : public CPWL_Wnd { // CPWL_Wnd CFX_ByteString GetClassName() const override; void OnCreate(PWL_CREATEPARAM& cp) override; - FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override; - FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override; protected: FX_BOOL m_bMouseDown; diff --git a/fpdfsdk/include/pdfwindow/PWL_Caret.h b/fpdfsdk/include/pdfwindow/PWL_Caret.h index 2459195acb..a1a5022b25 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Caret.h +++ b/fpdfsdk/include/pdfwindow/PWL_Caret.h @@ -14,8 +14,8 @@ struct PWL_CARET_INFO { PWL_CARET_INFO() : bVisible(FALSE), ptHead(0, 0), ptFoot(0, 0) {} FX_BOOL bVisible; - CFX_FloatPoint ptHead; - CFX_FloatPoint ptFoot; + CPDF_Point ptHead; + CPDF_Point ptFoot; }; class CPWL_Caret : public CPWL_Wnd { @@ -28,26 +28,26 @@ class CPWL_Caret : public CPWL_Wnd { void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override; void DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) override; - void InvalidateRect(CFX_FloatRect* pRect = NULL) override; + void InvalidateRect(CPDF_Rect* pRect = NULL) override; void SetVisible(FX_BOOL bVisible) override {} void TimerProc() override; void SetCaret(FX_BOOL bVisible, - const CFX_FloatPoint& ptHead, - const CFX_FloatPoint& ptFoot); - CFX_ByteString GetCaretAppearanceStream(const CFX_FloatPoint& ptOffset); - void SetInvalidRect(CFX_FloatRect rc) { m_rcInvalid = rc; } + const CPDF_Point& ptHead, + const CPDF_Point& ptFoot); + CFX_ByteString GetCaretAppearanceStream(const CPDF_Point& ptOffset); + void SetInvalidRect(CPDF_Rect rc) { m_rcInvalid = rc; } private: - void GetCaretApp(CFX_ByteTextBuf& sAppStream, const CFX_FloatPoint& ptOffset); - CFX_FloatRect GetCaretRect() const; + void GetCaretApp(CFX_ByteTextBuf& sAppStream, const CPDF_Point& ptOffset); + CPDF_Rect GetCaretRect() const; FX_BOOL m_bFlash; - CFX_FloatPoint m_ptHead; - CFX_FloatPoint m_ptFoot; + CPDF_Point m_ptHead; + CPDF_Point m_ptFoot; FX_FLOAT m_fWidth; int32_t m_nDelay; - CFX_FloatRect m_rcInvalid; + CPDF_Rect m_rcInvalid; }; #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_CARET_H_ diff --git a/fpdfsdk/include/pdfwindow/PWL_ComboBox.h b/fpdfsdk/include/pdfwindow/PWL_ComboBox.h index e5383009b9..a6f6a7b591 100644 --- a/fpdfsdk/include/pdfwindow/PWL_ComboBox.h +++ b/fpdfsdk/include/pdfwindow/PWL_ComboBox.h @@ -23,7 +23,7 @@ class CPWL_CBListBox : public CPWL_ListBox { ~CPWL_CBListBox() override {} // CPWL_ListBox - FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override; FX_BOOL OnKeyDownWithExit(FX_WORD nChar, FX_BOOL& bExit, FX_DWORD nFlag); FX_BOOL OnCharWithExit(FX_WORD nChar, FX_BOOL& bExit, FX_DWORD nFlag); @@ -40,8 +40,8 @@ class CPWL_CBButton : public CPWL_Wnd { void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override; void DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) override; - FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override; - FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override; }; class CPWL_ComboBox : public CPWL_Wnd { @@ -62,7 +62,7 @@ class CPWL_ComboBox : public CPWL_Wnd { intptr_t lParam = 0) override; void CreateChildWnd(const PWL_CREATEPARAM& cp) override; void RePosChildWnd() override; - CFX_FloatRect GetFocusRect() const override; + CPDF_Rect GetFocusRect() const override; void SetFocus() override; void KillFocus() override; @@ -95,7 +95,7 @@ class CPWL_ComboBox : public CPWL_Wnd { CPWL_CBButton* m_pButton; CPWL_CBListBox* m_pList; FX_BOOL m_bPopup; - CFX_FloatRect m_rcOldWindow; + CPDF_Rect m_rcOldWindow; int32_t m_nPopupWhere; int32_t m_nSelectItem; IPWL_Filler_Notify* m_pFillerNotify; diff --git a/fpdfsdk/include/pdfwindow/PWL_Edit.h b/fpdfsdk/include/pdfwindow/PWL_Edit.h index e93afaaa00..73528180d9 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Edit.h +++ b/fpdfsdk/include/pdfwindow/PWL_Edit.h @@ -52,19 +52,19 @@ class CPWL_Edit : public CPWL_EditCtrl, public IFX_Edit_OprNotify { void OnDestroy() override; void OnCreated() override; void RePosChildWnd() override; - CFX_FloatRect GetClientRect() const override; + CPDF_Rect GetClientRect() const override; void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override; void DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) override; - FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override; - FX_BOOL OnLButtonDblClk(const CFX_FloatPoint& point, FX_DWORD nFlag) override; - FX_BOOL OnRButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonDblClk(const CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnRButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override; FX_BOOL OnMouseWheel(short zDelta, - const CFX_FloatPoint& point, + const CPDF_Point& point, FX_DWORD nFlag) override; FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) override; FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag) override; - CFX_FloatRect GetFocusRect() const override; + CPDF_Rect GetFocusRect() const override; void OnSetFocus() override; void OnKillFocus() override; @@ -96,15 +96,14 @@ class CPWL_Edit : public CPWL_EditCtrl, public IFX_Edit_OprNotify { virtual void SetText(const FX_WCHAR* csText); void ReplaceSel(const FX_WCHAR* csText); - CFX_ByteString GetTextAppearanceStream(const CFX_FloatPoint& ptOffset) const; - CFX_ByteString GetCaretAppearanceStream(const CFX_FloatPoint& ptOffset) const; - CFX_ByteString GetSelectAppearanceStream( - const CFX_FloatPoint& ptOffset) const; + CFX_ByteString GetTextAppearanceStream(const CPDF_Point& ptOffset) const; + CFX_ByteString GetCaretAppearanceStream(const CPDF_Point& ptOffset) const; + CFX_ByteString GetSelectAppearanceStream(const CPDF_Point& ptOffset) const; FX_BOOL IsTextFull() const; static FX_FLOAT GetCharArrayAutoFontSize(CPDF_Font* pFont, - const CFX_FloatRect& rcPlate, + const CPDF_Rect& rcPlate, int32_t nCharArray); void SetFillerNotify(IPWL_Filler_Notify* pNotify) { @@ -112,10 +111,10 @@ class CPWL_Edit : public CPWL_EditCtrl, public IFX_Edit_OprNotify { } void GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray); void GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, - const CFX_FloatPoint& ptOffset); + const CPDF_Point& ptOffset); protected: // IFX_Edit_OprNotify @@ -142,11 +141,11 @@ class CPWL_Edit : public CPWL_EditCtrl, public IFX_Edit_OprNotify { void SetParamByFlag(); FX_FLOAT GetCharArrayAutoFontSize(int32_t nCharArray); - CFX_FloatPoint GetWordRightBottomPoint(const CPVT_WordPlace& wpWord); + CPDF_Point GetWordRightBottomPoint(const CPVT_WordPlace& wpWord); CPVT_WordRange CombineWordRange(const CPVT_WordRange& wr1, const CPVT_WordRange& wr2); - CPVT_WordRange GetLatinWordsRange(const CFX_FloatPoint& point) const; + CPVT_WordRange GetLatinWordsRange(const CPDF_Point& point) const; CPVT_WordRange GetLatinWordsRange(const CPVT_WordPlace& place) const; CPVT_WordRange GetArabicWordsRange(const CPVT_WordPlace& place) const; CPVT_WordRange GetSameWordsRange(const CPVT_WordPlace& place, @@ -160,7 +159,7 @@ class CPWL_Edit : public CPWL_EditCtrl, public IFX_Edit_OprNotify { IPWL_Filler_Notify* m_pFillerNotify; IPWL_SpellCheck* m_pSpellCheck; FX_BOOL m_bFocus; - CFX_FloatRect m_rcOldWindow; + CPDF_Rect m_rcOldWindow; public: void AttachFFLData(void* pData) { m_pFormFiller = pData; } diff --git a/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h b/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h index f80033081e..9bb40a7de1 100644 --- a/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h +++ b/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h @@ -27,7 +27,7 @@ class IPWL_Edit_Notify { virtual ~IPWL_Edit_Notify() {} // when the position of caret is changed in edit virtual void OnCaretMove(int32_t x1, int32_t y1, int32_t x2, int32_t y2) {} - virtual void OnContentChange(const CFX_FloatRect& rcContent) {} + virtual void OnContentChange(const CPDF_Rect& rcContent) {} // OprType: 0 InsertWord // 1 InsertReturn // 2 BackSpace @@ -59,13 +59,13 @@ class CPWL_EditCtrl : public CPWL_Wnd, public IFX_Edit_Notify { CPWL_EditCtrl(); ~CPWL_EditCtrl() override; - CFX_FloatRect GetContentRect() const; + CPDF_Rect GetContentRect() const; void GetCaretPos(int32_t& x, int32_t& y) const; CFX_WideString GetText() const; void SetSel(int32_t nStartChar, int32_t nEndChar); void GetSel(int32_t& nStartChar, int32_t& nEndChar) const; - void GetTextRange(const CFX_FloatRect& rect, + void GetTextRange(const CPDF_Rect& rect, int32_t& nStartChar, int32_t& nEndChar) const; CFX_WideString GetText(int32_t& nStartChar, int32_t& nEndChar) const; @@ -79,8 +79,8 @@ class CPWL_EditCtrl : public CPWL_Wnd, public IFX_Edit_Notify { void Paint(); void EnableRefresh(FX_BOOL bRefresh); - CFX_FloatPoint GetScrollPos() const; - void SetScrollPos(const CFX_FloatPoint& point); + CPDF_Point GetScrollPos() const; + void SetScrollPos(const CPDF_Point& point); void SetEditNotify(IPWL_Edit_Notify* pNotify) { m_pEditNotify = pNotify; } @@ -105,9 +105,9 @@ class CPWL_EditCtrl : public CPWL_Wnd, public IFX_Edit_Notify { void OnCreated() override; FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) override; FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag) override; - FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override; - FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override; - FX_BOOL OnMouseMove(const CFX_FloatPoint& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnMouseMove(const CPDF_Point& point, FX_DWORD nFlag) override; void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, @@ -135,13 +135,13 @@ class CPWL_EditCtrl : public CPWL_Wnd, public IFX_Edit_Notify { void IOnSetScrollPosX(FX_FLOAT fx) override {} void IOnSetScrollPosY(FX_FLOAT fy) override; void IOnSetCaret(FX_BOOL bVisible, - const CFX_FloatPoint& ptHead, - const CFX_FloatPoint& ptFoot, + const CPDF_Point& ptHead, + const CPDF_Point& ptFoot, const CPVT_WordPlace& place) override; void IOnCaretChange(const CPVT_SecProps& secProps, const CPVT_WordProps& wordProps) override; - void IOnContentChange(const CFX_FloatRect& rcContent) override; - void IOnInvalidateRect(CFX_FloatRect* pRect) override; + void IOnContentChange(const CPDF_Rect& rcContent) override; + void IOnInvalidateRect(CPDF_Rect* pRect) override; void InsertText(const FX_WCHAR* csText); void SetText(const FX_WCHAR* csText); @@ -157,10 +157,10 @@ class CPWL_EditCtrl : public CPWL_Wnd, public IFX_Edit_Notify { void Delete(); void Backspace(); - void GetCaretInfo(CFX_FloatPoint& ptHead, CFX_FloatPoint& ptFoot) const; + void GetCaretInfo(CPDF_Point& ptHead, CPDF_Point& ptFoot) const; void SetCaret(FX_BOOL bVisible, - const CFX_FloatPoint& ptHead, - const CFX_FloatPoint& ptFoot); + const CPDF_Point& ptHead, + const CPDF_Point& ptFoot); void SetEditCaret(FX_BOOL bVisible); diff --git a/fpdfsdk/include/pdfwindow/PWL_IconList.h b/fpdfsdk/include/pdfwindow/PWL_IconList.h index 71c9f4cb25..e4c18a8c03 100644 --- a/fpdfsdk/include/pdfwindow/PWL_IconList.h +++ b/fpdfsdk/include/pdfwindow/PWL_IconList.h @@ -75,15 +75,15 @@ class CPWL_IconList_Content : public CPWL_ListCtrl { protected: // CPWL_ListCtrl void CreateChildWnd(const PWL_CREATEPARAM& cp) override; - FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override; - FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override; - FX_BOOL OnMouseMove(const CFX_FloatPoint& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnMouseMove(const CPDF_Point& point, FX_DWORD nFlag) override; FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) override; private: CPWL_IconList_Item* GetListItem(int32_t nItemIndex) const; void SelectItem(int32_t nItemIndex, FX_BOOL bSelect); - int32_t FindItemIndex(const CFX_FloatPoint& point); + int32_t FindItemIndex(const CPDF_Point& point); int32_t m_nSelectIndex; IPWL_IconList_Notify* m_pNotify; @@ -111,7 +111,7 @@ class CPWL_IconList : public CPWL_Wnd { protected: // CPWL_Wnd FX_BOOL OnMouseWheel(short zDelta, - const CFX_FloatPoint& point, + const CPDF_Point& point, FX_DWORD nFlag) override; void OnCreated() override; void RePosChildWnd() override; diff --git a/fpdfsdk/include/pdfwindow/PWL_Label.h b/fpdfsdk/include/pdfwindow/PWL_Label.h index 5c3fa01933..bed519fe6d 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Label.h +++ b/fpdfsdk/include/pdfwindow/PWL_Label.h @@ -21,9 +21,9 @@ class CPWL_Label : public CPWL_Wnd { void SetLimitChar(int32_t nLimitChar); void SetHorzScale(int32_t nHorzScale); void SetCharSpace(FX_FLOAT fCharSpace); - CFX_FloatRect GetContentRect() const; + CPDF_Rect GetContentRect() const; int32_t GetTotalWords(); - CFX_ByteString GetTextAppearanceStream(const CFX_FloatPoint& ptOffset) const; + CFX_ByteString GetTextAppearanceStream(const CPDF_Point& ptOffset) const; protected: // CPWL_Wnd diff --git a/fpdfsdk/include/pdfwindow/PWL_ListBox.h b/fpdfsdk/include/pdfwindow/PWL_ListBox.h index c1d3bd7218..1f42d43fc6 100644 --- a/fpdfsdk/include/pdfwindow/PWL_ListBox.h +++ b/fpdfsdk/include/pdfwindow/PWL_ListBox.h @@ -35,11 +35,11 @@ class CPWL_List_Notify : public IFX_List_Notify { FX_FLOAT fBigStep) override; void IOnSetScrollPosX(FX_FLOAT fx) override {} void IOnSetScrollPosY(FX_FLOAT fy) override; - void IOnInvalidateRect(CFX_FloatRect* pRect) override; + void IOnInvalidateRect(CPDF_Rect* pRect) override; void IOnSetCaret(FX_BOOL bVisible, - const CFX_FloatPoint& ptHead, - const CFX_FloatPoint& ptFoot, + const CPDF_Point& ptHead, + const CPDF_Point& ptFoot, const CPVT_WordPlace& place); void IOnCaretChange(const CPVT_SecProps& secProps, const CPVT_WordProps& wordProps); @@ -62,11 +62,11 @@ class CPWL_ListBox : public CPWL_Wnd { CFX_Matrix* pUser2Device) override; FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) override; FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag) override; - FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override; - FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override; - FX_BOOL OnMouseMove(const CFX_FloatPoint& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnMouseMove(const CPDF_Point& point, FX_DWORD nFlag) override; FX_BOOL OnMouseWheel(short zDelta, - const CFX_FloatPoint& point, + const CPDF_Point& point, FX_DWORD nFlag) override; void KillFocus() override; void OnNotify(CPWL_Wnd* pWnd, @@ -74,7 +74,7 @@ class CPWL_ListBox : public CPWL_Wnd { intptr_t wParam = 0, intptr_t lParam = 0) override; void RePosChildWnd() override; - CFX_FloatRect GetFocusRect() const override; + CPDF_Rect GetFocusRect() const override; void SetFontSize(FX_FLOAT fFontSize) override; FX_FLOAT GetFontSize() const override; @@ -98,9 +98,9 @@ class CPWL_ListBox : public CPWL_Wnd { FX_BOOL IsItemSelected(int32_t nItemIndex) const; int32_t GetTopVisibleIndex() const; int32_t FindNext(int32_t nIndex, FX_WCHAR nChar) const; - CFX_FloatRect GetContentRect() const; + CPDF_Rect GetContentRect() const; FX_FLOAT GetFirstHeight() const; - CFX_FloatRect GetListRect() const; + CPDF_Rect GetListRect() const; void SetFillerNotify(IPWL_Filler_Notify* pNotify) { m_pFillerNotify = pNotify; diff --git a/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h b/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h index 0345d02dea..7b04a0cdb5 100644 --- a/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h +++ b/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h @@ -14,9 +14,9 @@ class CPWL_ListCtrl : public CPWL_Wnd { CPWL_ListCtrl(); ~CPWL_ListCtrl() override; - void SetScrollPos(const CFX_FloatPoint& point); - CFX_FloatPoint GetScrollPos() const; - CFX_FloatRect GetScrollArea() const; + void SetScrollPos(const CPDF_Point& point); + CPDF_Point GetScrollPos() const; + CPDF_Rect GetScrollArea() const; void SetItemSpace(FX_FLOAT fSpace); void SetTopSpace(FX_FLOAT fSpace); void SetBottomSpace(FX_FLOAT fSpace); @@ -24,10 +24,10 @@ class CPWL_ListCtrl : public CPWL_Wnd { void ResetContent(int32_t nStart); int32_t GetItemIndex(CPWL_Wnd* pItem); FX_FLOAT GetContentsHeight(FX_FLOAT fLimitWidth); - CFX_FloatPoint InToOut(const CFX_FloatPoint& point) const; - CFX_FloatPoint OutToIn(const CFX_FloatPoint& point) const; - CFX_FloatRect InToOut(const CFX_FloatRect& rect) const; - CFX_FloatRect OutToIn(const CFX_FloatRect& rect) const; + CPDF_Point InToOut(const CPDF_Point& point) const; + CPDF_Point OutToIn(const CPDF_Point& point) const; + CPDF_Rect InToOut(const CPDF_Rect& rect) const; + CPDF_Rect OutToIn(const CPDF_Rect& rect) const; protected: // CPWL_Wnd @@ -38,8 +38,8 @@ class CPWL_ListCtrl : public CPWL_Wnd { private: void ResetAll(FX_BOOL bMove, int32_t nStart); - CFX_FloatRect m_rcContent; - CFX_FloatPoint m_ptScroll; + CPDF_Rect m_rcContent; + CPDF_Point m_ptScroll; FX_FLOAT m_fItemSpace; FX_FLOAT m_fTopSpace; FX_FLOAT m_fBottomSpace; diff --git a/fpdfsdk/include/pdfwindow/PWL_Note.h b/fpdfsdk/include/pdfwindow/PWL_Note.h index 8087585cee..2d5b564a7f 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Note.h +++ b/fpdfsdk/include/pdfwindow/PWL_Note.h @@ -104,8 +104,8 @@ class CPWL_Note_CloseBox : public CPWL_Button { // CPWL_Button void DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) override; - FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override; - FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override; private: FX_BOOL m_bMouseDown; @@ -166,7 +166,7 @@ class CPWL_Note_Options : public CPWL_Wnd { CPWL_Note_Options(); ~CPWL_Note_Options() override; - CFX_FloatRect GetContentRect() const; + CPDF_Rect GetContentRect() const; void SetText(const CFX_WideString& sText); // CPWL_Wnd @@ -196,7 +196,7 @@ class CPWL_Note_Contents : public CPWL_ListCtrl { int32_t CountSubItems() const; IPWL_NoteItem* GetSubItems(int32_t index) const; - virtual IPWL_NoteItem* GetHitNoteItem(const CFX_FloatPoint& point); + virtual IPWL_NoteItem* GetHitNoteItem(const CPDF_Point& point); void EnableRead(FX_BOOL bEnabled); void EnableModify(FX_BOOL bEnabled); @@ -206,7 +206,7 @@ class CPWL_Note_Contents : public CPWL_ListCtrl { FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0) override; - FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override; void CreateChildWnd(const PWL_CREATEPARAM& cp) override; private: @@ -218,7 +218,7 @@ class CPWL_NoteItem : public CPWL_Wnd, public IPWL_NoteItem { CPWL_NoteItem(); ~CPWL_NoteItem() override; - virtual IPWL_NoteItem* GetHitNoteItem(const CFX_FloatPoint& point); + virtual IPWL_NoteItem* GetHitNoteItem(const CPDF_Point& point); virtual IPWL_NoteItem* GetFocusedNoteItem() const; virtual FX_BOOL IsTopItem() const { return FALSE; } @@ -253,8 +253,8 @@ class CPWL_NoteItem : public CPWL_Wnd, public IPWL_NoteItem { protected: // CPWL_Wnd - FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override; - FX_BOOL OnRButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnRButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override; CFX_ByteString GetClassName() const override; void RePosChildWnd() override; void CreateChildWnd(const PWL_CREATEPARAM& cp) override; @@ -270,7 +270,7 @@ class CPWL_NoteItem : public CPWL_Wnd, public IPWL_NoteItem { CPWL_NoteItem* GetParentNoteItem() const; void SetNoteFocus(FX_BOOL bLast); - void PopupNoteItemMenu(const CFX_FloatPoint& point); + void PopupNoteItemMenu(const CPDF_Point& point); virtual const CPWL_Note* GetNote() const; virtual IPWL_NoteNotify* GetNoteNotify() const; @@ -316,10 +316,10 @@ class CPWL_Note : public CPWL_NoteItem { FX_BOOL IsTopItem() const override { return TRUE; } const CPWL_Note* GetNote() const override; IPWL_NoteNotify* GetNoteNotify() const override; - FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override; - FX_BOOL OnRButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnRButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override; FX_BOOL OnMouseWheel(short zDelta, - const CFX_FloatPoint& point, + const CPDF_Point& point, FX_DWORD nFlag) override; void RePosChildWnd() override; void CreateChildWnd(const PWL_CREATEPARAM& cp) override; diff --git a/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h b/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h index a43ac91fcb..439bb65ed2 100644 --- a/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h +++ b/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h @@ -43,9 +43,9 @@ class CPWL_SBButton : public CPWL_Wnd { void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override; void DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) override; - FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override; - FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override; - FX_BOOL OnMouseMove(const CFX_FloatPoint& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnMouseMove(const CPDF_Point& point, FX_DWORD nFlag) override; protected: PWL_SCROLLBAR_TYPE m_eScrollBarType; @@ -101,8 +101,8 @@ class CPWL_ScrollBar : public CPWL_Wnd { void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override; void DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) override; - FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override; - FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override; void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, @@ -121,22 +121,22 @@ class CPWL_ScrollBar : public CPWL_Wnd { void MovePosButton(FX_BOOL bRefresh); void SetScrollStep(FX_FLOAT fBigStep, FX_FLOAT fSmallStep); void NotifyScrollWindow(); - CFX_FloatRect GetScrollArea() const; + CPDF_Rect GetScrollArea() const; private: void CreateButtons(const PWL_CREATEPARAM& cp); - void OnMinButtonLBDown(const CFX_FloatPoint& point); - void OnMinButtonLBUp(const CFX_FloatPoint& point); - void OnMinButtonMouseMove(const CFX_FloatPoint& point); + void OnMinButtonLBDown(const CPDF_Point& point); + void OnMinButtonLBUp(const CPDF_Point& point); + void OnMinButtonMouseMove(const CPDF_Point& point); - void OnMaxButtonLBDown(const CFX_FloatPoint& point); - void OnMaxButtonLBUp(const CFX_FloatPoint& point); - void OnMaxButtonMouseMove(const CFX_FloatPoint& point); + void OnMaxButtonLBDown(const CPDF_Point& point); + void OnMaxButtonLBUp(const CPDF_Point& point); + void OnMaxButtonMouseMove(const CPDF_Point& point); - void OnPosButtonLBDown(const CFX_FloatPoint& point); - void OnPosButtonLBUp(const CFX_FloatPoint& point); - void OnPosButtonMouseMove(const CFX_FloatPoint& point); + void OnPosButtonLBDown(const CPDF_Point& point); + void OnPosButtonLBUp(const CPDF_Point& point); + void OnPosButtonMouseMove(const CPDF_Point& point); FX_FLOAT TrueToFace(FX_FLOAT); FX_FLOAT FaceToTrue(FX_FLOAT); diff --git a/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h b/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h index 6135b87862..5d372e826f 100644 --- a/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h +++ b/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h @@ -16,7 +16,7 @@ class CPWL_PushButton : public CPWL_Button { // CPWL_Button CFX_ByteString GetClassName() const override; - CFX_FloatRect GetFocusRect() const override; + CPDF_Rect GetFocusRect() const override; }; class CPWL_CheckBox : public CPWL_Button { @@ -26,7 +26,7 @@ class CPWL_CheckBox : public CPWL_Button { // CPWL_Button CFX_ByteString GetClassName() const override; - FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override; FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag) override; void SetCheck(FX_BOOL bCheck); @@ -43,7 +43,7 @@ class CPWL_RadioButton : public CPWL_Button { // CPWL_Button CFX_ByteString GetClassName() const override; - FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override; FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag) override; void SetCheck(FX_BOOL bCheck); diff --git a/fpdfsdk/include/pdfwindow/PWL_Utils.h b/fpdfsdk/include/pdfwindow/PWL_Utils.h index 71a2b1baa3..cd033d7bc7 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Utils.h +++ b/fpdfsdk/include/pdfwindow/PWL_Utils.h @@ -7,7 +7,7 @@ #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_UTILS_H_ #define FPDFSDK_INCLUDE_PDFWINDOW_PWL_UTILS_H_ -#include "core/include/fpdfapi/fpdf_parser.h" // For CFX_FloatPoint. +#include "core/include/fpdfapi/fpdf_parser.h" // For CPDF_Point. #include "core/include/fpdfdoc/fpdf_vt.h" // For CPVT_WordRange. #include "fpdfsdk/include/fxedit/fx_edit.h" #include "fpdfsdk/include/pdfwindow/PWL_Wnd.h" @@ -74,11 +74,11 @@ T PWL_MAX(const T& i, const T& j) { #define PPBL_LABELLEFTICONRIGHT 5 #define PPBL_LABELOVERICON 6 -class CPWL_Point : public CFX_FloatPoint { +class CPWL_Point : public CPDF_Point { public: - CPWL_Point() : CFX_FloatPoint(0.0f, 0.0f) {} - CPWL_Point(FX_FLOAT fx, FX_FLOAT fy) : CFX_FloatPoint(fx, fy) {} - CPWL_Point(const CPWL_Point& point) : CFX_FloatPoint(point.x, point.y) {} + CPWL_Point() : CPDF_Point(0.0f, 0.0f) {} + CPWL_Point(FX_FLOAT fx, FX_FLOAT fy) : CPDF_Point(fx, fy) {} + CPWL_Point(const CPWL_Point& point) : CPDF_Point(point.x, point.y) {} }; enum PWL_PATHDATA_TYPE { @@ -104,28 +104,24 @@ class IPWL_SpellCheck; class CPWL_Utils { public: - static CFX_FloatRect InflateRect(const CFX_FloatRect& rcRect, FX_FLOAT fSize); - static CFX_FloatRect DeflateRect(const CFX_FloatRect& rcRect, FX_FLOAT fSize); - static FX_BOOL IntersectRect(const CFX_FloatRect& rect1, - const CFX_FloatRect& rect2); - static FX_BOOL ContainsRect(const CFX_FloatRect& rcParent, - const CFX_FloatRect& rcChild); - static CFX_FloatRect ScaleRect(const CFX_FloatRect& rcRect, FX_FLOAT fScale); + static CPDF_Rect InflateRect(const CPDF_Rect& rcRect, FX_FLOAT fSize); + static CPDF_Rect DeflateRect(const CPDF_Rect& rcRect, FX_FLOAT fSize); + static FX_BOOL IntersectRect(const CPDF_Rect& rect1, const CPDF_Rect& rect2); + static FX_BOOL ContainsRect(const CPDF_Rect& rcParent, + const CPDF_Rect& rcChild); + static CPDF_Rect ScaleRect(const CPDF_Rect& rcRect, FX_FLOAT fScale); static CPVT_WordRange OverlapWordRange(const CPVT_WordRange& wr1, const CPVT_WordRange& wr2); - static CFX_FloatRect GetCenterSquare(const CFX_FloatRect& rect); + static CPDF_Rect GetCenterSquare(const CPDF_Rect& rect); static CPWL_Color SubstractColor(const CPWL_Color& sColor, FX_FLOAT fColorSub); static CPWL_Color DevideColor(const CPWL_Color& sColor, FX_FLOAT fColorDevide); - static CFX_FloatRect MaxRect(const CFX_FloatRect& rect1, - const CFX_FloatRect& rect2); - static CFX_FloatRect OffsetRect(const CFX_FloatRect& rect, - FX_FLOAT x, - FX_FLOAT y); - static CFX_FloatPoint OffsetPoint(const CFX_FloatPoint& point, - FX_FLOAT x, - FX_FLOAT y); + static CPDF_Rect MaxRect(const CPDF_Rect& rect1, const CPDF_Rect& rect2); + static CPDF_Rect OffsetRect(const CPDF_Rect& rect, FX_FLOAT x, FX_FLOAT y); + static CPDF_Point OffsetPoint(const CPDF_Point& point, + FX_FLOAT x, + FX_FLOAT y); static FX_COLORREF PWLColorToFXColor(const CPWL_Color& color, int32_t nTransparancy = 255); static FX_BOOL IsBlackOrWhite(const CPWL_Color& color); @@ -133,7 +129,7 @@ class CPWL_Utils { static CFX_ByteString GetColorAppStream(const CPWL_Color& color, const FX_BOOL& bFillOrStroke = TRUE); - static CFX_ByteString GetBorderAppStream(const CFX_FloatRect& rect, + static CFX_ByteString GetBorderAppStream(const CPDF_Rect& rect, FX_FLOAT fWidth, const CPWL_Color& color, const CPWL_Color& crLeftTop, @@ -141,19 +137,19 @@ class CPWL_Utils { int32_t nStyle, const CPWL_Dash& dash); static CFX_ByteString GetCircleBorderAppStream( - const CFX_FloatRect& rect, + const CPDF_Rect& rect, FX_FLOAT fWidth, const CPWL_Color& color, const CPWL_Color& crLeftTop, const CPWL_Color& crRightBottom, int32_t nStyle, const CPWL_Dash& dash); - static CFX_ByteString GetRectFillAppStream(const CFX_FloatRect& rect, + static CFX_ByteString GetRectFillAppStream(const CPDF_Rect& rect, const CPWL_Color& color); - static CFX_ByteString GetCircleFillAppStream(const CFX_FloatRect& rect, + static CFX_ByteString GetCircleFillAppStream(const CPDF_Rect& rect, const CPWL_Color& color); - static CFX_ByteString GetPushButtonAppStream(const CFX_FloatRect& rcBBox, + static CFX_ByteString GetPushButtonAppStream(const CPDF_Rect& rcBBox, IFX_Edit_FontMap* pFontMap, CPDF_Stream* pIconStream, CPDF_IconFit& IconFit, @@ -161,28 +157,28 @@ class CPWL_Utils { const CPWL_Color& crText, FX_FLOAT fFontSize, int32_t nLayOut); - static CFX_ByteString GetCheckBoxAppStream(const CFX_FloatRect& rcBBox, + static CFX_ByteString GetCheckBoxAppStream(const CPDF_Rect& rcBBox, int32_t nStyle, const CPWL_Color& crText); - static CFX_ByteString GetRadioButtonAppStream(const CFX_FloatRect& rcBBox, + static CFX_ByteString GetRadioButtonAppStream(const CPDF_Rect& rcBBox, int32_t nStyle, const CPWL_Color& crText); static CFX_ByteString GetEditAppStream(IFX_Edit* pEdit, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange = NULL, FX_BOOL bContinuous = TRUE, FX_WORD SubWord = 0); static CFX_ByteString GetEditSelAppStream( IFX_Edit* pEdit, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange = NULL); static CFX_ByteString GetSpellCheckAppStream( IFX_Edit* pEdit, IPWL_SpellCheck* pSpellCheck, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange = NULL); - static CFX_ByteString GetTextAppStream(const CFX_FloatRect& rcBBox, + static CFX_ByteString GetTextAppStream(const CPDF_Rect& rcBBox, IFX_Edit_FontMap* pFontMap, const CFX_WideString& sText, int32_t nAlignmentH, @@ -191,31 +187,31 @@ class CPWL_Utils { FX_BOOL bMultiLine, FX_BOOL bAutoReturn, const CPWL_Color& crText); - static CFX_ByteString GetDropButtonAppStream(const CFX_FloatRect& rcBBox); + static CFX_ByteString GetDropButtonAppStream(const CPDF_Rect& rcBBox); static void DrawFillRect(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CFX_FloatRect& rect, + const CPDF_Rect& rect, const CPWL_Color& color, int32_t nTransparancy); static void DrawFillRect(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CFX_FloatRect& rect, + const CPDF_Rect& rect, const FX_COLORREF& color); static void DrawStrokeRect(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CFX_FloatRect& rect, + const CPDF_Rect& rect, const FX_COLORREF& color, FX_FLOAT fWidth); static void DrawStrokeLine(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CFX_FloatPoint& ptMoveTo, - const CFX_FloatPoint& ptLineTo, + const CPDF_Point& ptMoveTo, + const CPDF_Point& ptLineTo, const FX_COLORREF& color, FX_FLOAT fWidth); static void DrawBorder(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CFX_FloatRect& rect, + const CPDF_Rect& rect, FX_FLOAT fWidth, const CPWL_Color& color, const CPWL_Color& crLeftTop, @@ -224,22 +220,22 @@ class CPWL_Utils { int32_t nTransparancy); static void DrawFillArea(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CFX_FloatPoint* pPts, + const CPDF_Point* pPts, int32_t nCount, const FX_COLORREF& color); static void DrawShadow(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, FX_BOOL bVertical, FX_BOOL bHorizontal, - CFX_FloatRect rect, + CPDF_Rect rect, int32_t nTransparancy, int32_t nStartGray, int32_t nEndGray); static void DrawEditSpellCheck(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, IFX_Edit* pEdit, - const CFX_FloatRect& rcClip, - const CFX_FloatPoint& ptOffset, + const CPDF_Rect& rcClip, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, IPWL_SpellCheck* pSpellCheck); @@ -288,13 +284,13 @@ class CPWL_Utils { public: static CFX_ByteString GetIconAppStream( int32_t nType, - const CFX_FloatRect& rect, + const CPDF_Rect& rect, const CPWL_Color& crFill, const CPWL_Color& crStroke = PWL_DEFAULT_BLACKCOLOR); static void DrawIconAppStream(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, int32_t nType, - const CFX_FloatRect& rect, + const CPDF_Rect& rect, const CPWL_Color& crFill, const CPWL_Color& crStroke, const int32_t nTransparancy); @@ -306,107 +302,107 @@ class CPWL_Utils { const CPWL_PathData* pPathData, int32_t nCount); - static CFX_ByteString GetAppStream_Check(const CFX_FloatRect& rcBBox, + static CFX_ByteString GetAppStream_Check(const CPDF_Rect& rcBBox, const CPWL_Color& crText); - static CFX_ByteString GetAppStream_Circle(const CFX_FloatRect& rcBBox, + static CFX_ByteString GetAppStream_Circle(const CPDF_Rect& rcBBox, const CPWL_Color& crText); - static CFX_ByteString GetAppStream_Cross(const CFX_FloatRect& rcBBox, + static CFX_ByteString GetAppStream_Cross(const CPDF_Rect& rcBBox, const CPWL_Color& crText); - static CFX_ByteString GetAppStream_Diamond(const CFX_FloatRect& rcBBox, + static CFX_ByteString GetAppStream_Diamond(const CPDF_Rect& rcBBox, const CPWL_Color& crText); - static CFX_ByteString GetAppStream_Square(const CFX_FloatRect& rcBBox, + static CFX_ByteString GetAppStream_Square(const CPDF_Rect& rcBBox, const CPWL_Color& crText); - static CFX_ByteString GetAppStream_Star(const CFX_FloatRect& rcBBox, + static CFX_ByteString GetAppStream_Star(const CPDF_Rect& rcBBox, const CPWL_Color& crText); - static CFX_ByteString GetAP_Check(const CFX_FloatRect& crBBox); - static CFX_ByteString GetAP_Circle(const CFX_FloatRect& crBBox); - static CFX_ByteString GetAP_Cross(const CFX_FloatRect& crBBox); - static CFX_ByteString GetAP_Diamond(const CFX_FloatRect& crBBox); - static CFX_ByteString GetAP_Square(const CFX_FloatRect& crBBox); - static CFX_ByteString GetAP_Star(const CFX_FloatRect& crBBox); - static CFX_ByteString GetAP_HalfCircle(const CFX_FloatRect& crBBox, + static CFX_ByteString GetAP_Check(const CPDF_Rect& crBBox); + static CFX_ByteString GetAP_Circle(const CPDF_Rect& crBBox); + static CFX_ByteString GetAP_Cross(const CPDF_Rect& crBBox); + static CFX_ByteString GetAP_Diamond(const CPDF_Rect& crBBox); + static CFX_ByteString GetAP_Square(const CPDF_Rect& crBBox); + static CFX_ByteString GetAP_Star(const CPDF_Rect& crBBox); + static CFX_ByteString GetAP_HalfCircle(const CPDF_Rect& crBBox, FX_FLOAT fRotate); static void GetGraphics_Checkmark(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Circle(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Comment(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Cross(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Help(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_InsertText(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Key(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_NewParagraph(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_TextNote(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Paragraph(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_RightArrow(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_RightPointer(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Star(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_UpArrow(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_UpLeftArrow(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Graph(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Paperclip(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Attachment(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Tag(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Foxit(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type); }; diff --git a/fpdfsdk/include/pdfwindow/PWL_Wnd.h b/fpdfsdk/include/pdfwindow/PWL_Wnd.h index 19046e6c9c..1bc5023c98 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Wnd.h +++ b/fpdfsdk/include/pdfwindow/PWL_Wnd.h @@ -228,7 +228,7 @@ struct PWL_CREATEPARAM { eCursorType(FXCT_ARROW), mtChild(1, 0, 0, 1, 0, 0) {} - CFX_FloatRect rcRectWnd; // required + CPDF_Rect rcRectWnd; // required IFX_SystemHandler* pSystemHandler; // required IFX_Edit_FontMap* pFontMap; // required for text window IPWL_Provider* pProvider; // required for self coordinate @@ -293,25 +293,25 @@ class CPWL_Wnd : public CPWL_TimerHandler { void InvalidateFocusHandler(IPWL_FocusHandler* handler); void InvalidateProvider(IPWL_Provider* provider); void Destroy(); - void Move(const CFX_FloatRect& rcNew, FX_BOOL bReset, FX_BOOL bRefresh); - virtual void InvalidateRect(CFX_FloatRect* pRect = NULL); + void Move(const CPDF_Rect& rcNew, FX_BOOL bReset, FX_BOOL bRefresh); + virtual void InvalidateRect(CPDF_Rect* pRect = NULL); void DrawAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device); virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag); virtual FX_BOOL OnKeyUp(FX_WORD nChar, FX_DWORD nFlag); virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag); - virtual FX_BOOL OnLButtonDblClk(const CFX_FloatPoint& point, FX_DWORD nFlag); - virtual FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag); - virtual FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag); - virtual FX_BOOL OnMButtonDblClk(const CFX_FloatPoint& point, FX_DWORD nFlag); - virtual FX_BOOL OnMButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag); - virtual FX_BOOL OnMButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag); - virtual FX_BOOL OnRButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag); - virtual FX_BOOL OnRButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag); - virtual FX_BOOL OnMouseMove(const CFX_FloatPoint& point, FX_DWORD nFlag); + virtual FX_BOOL OnLButtonDblClk(const CPDF_Point& point, FX_DWORD nFlag); + virtual FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag); + virtual FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag); + virtual FX_BOOL OnMButtonDblClk(const CPDF_Point& point, FX_DWORD nFlag); + virtual FX_BOOL OnMButtonDown(const CPDF_Point& point, FX_DWORD nFlag); + virtual FX_BOOL OnMButtonUp(const CPDF_Point& point, FX_DWORD nFlag); + virtual FX_BOOL OnRButtonDown(const CPDF_Point& point, FX_DWORD nFlag); + virtual FX_BOOL OnRButtonUp(const CPDF_Point& point, FX_DWORD nFlag); + virtual FX_BOOL OnMouseMove(const CPDF_Point& point, FX_DWORD nFlag); virtual FX_BOOL OnMouseWheel(short zDelta, - const CFX_FloatPoint& point, + const CPDF_Point& point, FX_DWORD nFlag); virtual void SetFocus(); @@ -327,7 +327,7 @@ class CPWL_Wnd : public CPWL_TimerHandler { virtual void SetTextStrokeColor(const CPWL_Color& color); virtual void SetVisible(FX_BOOL bVisible); - virtual CFX_FloatRect GetFocusRect() const; + virtual CPDF_Rect GetFocusRect() const; virtual CPWL_Color GetBackgroundColor() const; virtual CPWL_Color GetBorderColor() const; virtual CPWL_Color GetTextColor() const; @@ -340,25 +340,25 @@ class CPWL_Wnd : public CPWL_TimerHandler { virtual void SetFontSize(FX_FLOAT fFontSize); void SetBackgroundColor(const CPWL_Color& color); - void SetClipRect(const CFX_FloatRect& rect); + void SetClipRect(const CPDF_Rect& rect); void SetBorderStyle(int32_t eBorderStyle); - virtual CFX_FloatRect GetWindowRect() const; - virtual CFX_FloatRect GetClientRect() const; - CFX_FloatPoint GetCenterPoint() const; + virtual CPDF_Rect GetWindowRect() const; + virtual CPDF_Rect GetClientRect() const; + CPDF_Point GetCenterPoint() const; int32_t GetBorderWidth() const; FX_BOOL IsVisible() const { return m_bVisible; } FX_BOOL HasFlag(FX_DWORD dwFlags) const; void AddFlag(FX_DWORD dwFlags); void RemoveFlag(FX_DWORD dwFlags); - const CFX_FloatRect& GetClipRect() const; + const CPDF_Rect& GetClipRect() const; CPWL_Wnd* GetParentWindow() const; int32_t GetBorderStyle() const; const CPWL_Dash& GetBorderDash() const; void* GetAttachedData() const; - FX_BOOL WndHitTest(const CFX_FloatPoint& point) const; - FX_BOOL ClientHitTest(const CFX_FloatPoint& point) const; + FX_BOOL WndHitTest(const CPDF_Point& point) const; + FX_BOOL ClientHitTest(const CPDF_Point& point) const; FX_BOOL IsCaptureMouse() const; const CPWL_Wnd* GetFocused() const; @@ -378,10 +378,10 @@ class CPWL_Wnd : public CPWL_TimerHandler { void SetChildMatrix(const CFX_Matrix& mt); CFX_Matrix GetWindowMatrix() const; - virtual CFX_FloatPoint ChildToParent(const CFX_FloatPoint& point) const; - virtual CFX_FloatRect ChildToParent(const CFX_FloatRect& rect) const; - virtual CFX_FloatPoint ParentToChild(const CFX_FloatPoint& point) const; - virtual CFX_FloatRect ParentToChild(const CFX_FloatRect& rect) const; + virtual CPDF_Point ChildToParent(const CPDF_Point& point) const; + virtual CPDF_Rect ChildToParent(const CPDF_Rect& rect) const; + virtual CPDF_Point ParentToChild(const CPDF_Point& point) const; + virtual CPDF_Rect ParentToChild(const CPDF_Rect& rect) const; // those methods only implemented by listctrl item virtual FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth) { return 0; } @@ -423,11 +423,10 @@ class CPWL_Wnd : public CPWL_TimerHandler { const PWL_CREATEPARAM& GetCreationParam() const; FX_BOOL IsNotifying() const { return m_bNotifying; } - void InvalidateRectMove(const CFX_FloatRect& rcOld, - const CFX_FloatRect& rcNew); + void InvalidateRectMove(const CPDF_Rect& rcOld, const CPDF_Rect& rcNew); - void PWLtoWnd(const CFX_FloatPoint& point, int32_t& x, int32_t& y) const; - FX_RECT PWLtoWnd(const CFX_FloatRect& rect) const; + void PWLtoWnd(const CPDF_Point& point, int32_t& x, int32_t& y) const; + FX_RECT PWLtoWnd(const CPDF_Rect& rect) const; FX_HWND GetAttachedHWnd() const; FX_BOOL IsWndCaptureMouse(const CPWL_Wnd* pWnd) const; @@ -460,8 +459,8 @@ class CPWL_Wnd : public CPWL_TimerHandler { CPWL_ScrollBar* m_pVScrollBar; - CFX_FloatRect m_rcWindow; - CFX_FloatRect m_rcClip; + CPDF_Rect m_rcWindow; + CPDF_Rect m_rcClip; FX_BOOL m_bCreated; FX_BOOL m_bVisible; diff --git a/fpdfsdk/src/formfiller/FFL_CheckBox.cpp b/fpdfsdk/src/formfiller/FFL_CheckBox.cpp index 78a689af64..f76613ed3f 100644 --- a/fpdfsdk/src/formfiller/FFL_CheckBox.cpp +++ b/fpdfsdk/src/formfiller/FFL_CheckBox.cpp @@ -73,7 +73,7 @@ FX_BOOL CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot, FX_BOOL CFFL_CheckBox::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { CFFL_Button::OnLButtonUp(pPageView, pAnnot, nFlags, point); if (IsValid()) { diff --git a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp index e596ba08ba..ce73f7d4cb 100644 --- a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp +++ b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp @@ -36,18 +36,18 @@ CFFL_FormFiller::~CFFL_FormFiller() { } void CFFL_FormFiller::SetWindowRect(CPDFSDK_PageView* pPageView, - const CFX_FloatRect& rcWindow) { + const CPDF_Rect& rcWindow) { if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { - pWnd->Move(CFX_FloatRect(rcWindow), TRUE, FALSE); + pWnd->Move(CPDF_Rect(rcWindow), TRUE, FALSE); } } -CFX_FloatRect CFFL_FormFiller::GetWindowRect(CPDFSDK_PageView* pPageView) { +CPDF_Rect CFFL_FormFiller::GetWindowRect(CPDFSDK_PageView* pPageView) { if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { return pWnd->GetWindowRect(); } - return CFX_FloatRect(0, 0, 0, 0); + return CPDF_Rect(0, 0, 0, 0); } FX_RECT CFFL_FormFiller::GetViewBBox(CPDFSDK_PageView* pPageView, @@ -55,20 +55,20 @@ FX_RECT CFFL_FormFiller::GetViewBBox(CPDFSDK_PageView* pPageView, ASSERT(pPageView); ASSERT(pAnnot); - CFX_FloatRect rcAnnot = m_pWidget->GetRect(); + CPDF_Rect rcAnnot = m_pWidget->GetRect(); if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { - CFX_FloatRect rcWindow = pWnd->GetWindowRect(); + CPDF_Rect rcWindow = pWnd->GetWindowRect(); rcAnnot = PWLtoFFL(rcWindow); } - CFX_FloatRect rcWin = rcAnnot; + CPDF_Rect rcWin = rcAnnot; - CFX_FloatRect rcFocus = GetFocusBox(pPageView); + CPDF_Rect rcFocus = GetFocusBox(pPageView); if (!rcFocus.IsEmpty()) rcWin.Union(rcFocus); - CFX_FloatRect rect = CPWL_Utils::InflateRect(rcWin, 1); + CPDF_Rect rect = CPWL_Utils::InflateRect(rcWin, 1); return rect.GetOutterRect(); } @@ -118,7 +118,7 @@ void CFFL_FormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, FX_BOOL CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE)) { m_bValid = TRUE; FX_RECT rect = GetViewBBox(pPageView, pAnnot); @@ -136,7 +136,7 @@ FX_BOOL CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, FX_BOOL CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { FX_RECT rcFFL = GetViewBBox(pPageView, pAnnot); InvalidateRect(rcFFL.left, rcFFL.top, rcFFL.right, rcFFL.bottom); @@ -150,7 +150,7 @@ FX_BOOL CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, FX_BOOL CFFL_FormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { pWnd->OnLButtonDblClk(WndtoPWL(pPageView, point), nFlags); return TRUE; @@ -162,7 +162,7 @@ FX_BOOL CFFL_FormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView, FX_BOOL CFFL_FormFiller::OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { if ((m_ptOldPos.x != point.x) || (m_ptOldPos.y != point.y)) { m_ptOldPos = point; } @@ -179,7 +179,7 @@ FX_BOOL CFFL_FormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { if (!IsValid()) return FALSE; @@ -193,7 +193,7 @@ FX_BOOL CFFL_FormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView, FX_BOOL CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE)) { pWnd->OnRButtonDown(WndtoPWL(pPageView, point), nFlags); return TRUE; @@ -205,7 +205,7 @@ FX_BOOL CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView, FX_BOOL CFFL_FormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { pWnd->OnRButtonUp(WndtoPWL(pPageView, point), nFlags); return TRUE; @@ -420,7 +420,7 @@ CFX_Matrix CFFL_FormFiller::GetWindowMatrix(void* pAttachedData) { CFX_Matrix CFFL_FormFiller::GetCurMatrix() { CFX_Matrix mt; - CFX_FloatRect rcDA; + CPDF_Rect rcDA; m_pWidget->GetPDFAnnot()->GetRect(rcDA); switch (m_pWidget->GetRotate()) { @@ -451,16 +451,16 @@ CFX_WideString CFFL_FormFiller::LoadPopupMenuString(int nIndex) { return L""; } -CFX_FloatRect CFFL_FormFiller::GetPDFWindowRect() const { - CFX_FloatRect rectAnnot; +CPDF_Rect CFFL_FormFiller::GetPDFWindowRect() const { + CPDF_Rect rectAnnot; m_pWidget->GetPDFAnnot()->GetRect(rectAnnot); FX_FLOAT fWidth = rectAnnot.right - rectAnnot.left; FX_FLOAT fHeight = rectAnnot.top - rectAnnot.bottom; if ((m_pWidget->GetRotate() / 90) & 0x01) - return CFX_FloatRect(0, 0, fHeight, fWidth); + return CPDF_Rect(0, 0, fHeight, fWidth); - return CFX_FloatRect(0, 0, fWidth, fHeight); + return CPDF_Rect(0, 0, fWidth, fHeight); } CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView() { @@ -469,61 +469,61 @@ CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView() { return pSDKDoc ? pSDKDoc->GetPageView(pPage) : nullptr; } -CFX_FloatRect CFFL_FormFiller::GetFocusBox(CPDFSDK_PageView* pPageView) { +CPDF_Rect CFFL_FormFiller::GetFocusBox(CPDFSDK_PageView* pPageView) { if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { - CFX_FloatRect rcFocus = FFLtoWnd(pPageView, PWLtoFFL(pWnd->GetFocusRect())); - CFX_FloatRect rcPage = pPageView->GetPDFPage()->GetPageBBox(); + CPDF_Rect rcFocus = FFLtoWnd(pPageView, PWLtoFFL(pWnd->GetFocusRect())); + CPDF_Rect rcPage = pPageView->GetPDFPage()->GetPageBBox(); if (rcPage.Contains(rcFocus)) return rcFocus; } - return CFX_FloatRect(0, 0, 0, 0); + return CPDF_Rect(0, 0, 0, 0); } -CFX_FloatRect CFFL_FormFiller::FFLtoPWL(const CFX_FloatRect& rect) { +CPDF_Rect CFFL_FormFiller::FFLtoPWL(const CPDF_Rect& rect) { CFX_Matrix mt; mt.SetReverse(GetCurMatrix()); - CFX_FloatRect temp = rect; + CPDF_Rect temp = rect; mt.TransformRect(temp); return temp; } -CFX_FloatRect CFFL_FormFiller::PWLtoFFL(const CFX_FloatRect& rect) { +CPDF_Rect CFFL_FormFiller::PWLtoFFL(const CPDF_Rect& rect) { CFX_Matrix mt = GetCurMatrix(); - CFX_FloatRect temp = rect; + CPDF_Rect temp = rect; mt.TransformRect(temp); return temp; } -CFX_FloatPoint CFFL_FormFiller::FFLtoPWL(const CFX_FloatPoint& point) { +CPDF_Point CFFL_FormFiller::FFLtoPWL(const CPDF_Point& point) { CFX_Matrix mt; mt.SetReverse(GetCurMatrix()); - CFX_FloatPoint pt = point; + CPDF_Point pt = point; mt.Transform(pt.x, pt.y); return pt; } -CFX_FloatPoint CFFL_FormFiller::PWLtoFFL(const CFX_FloatPoint& point) { +CPDF_Point CFFL_FormFiller::PWLtoFFL(const CPDF_Point& point) { CFX_Matrix mt = GetCurMatrix(); - CFX_FloatPoint pt = point; + CPDF_Point pt = point; mt.Transform(pt.x, pt.y); return pt; } -CFX_FloatPoint CFFL_FormFiller::WndtoPWL(CPDFSDK_PageView* pPageView, - const CFX_FloatPoint& pt) { +CPDF_Point CFFL_FormFiller::WndtoPWL(CPDFSDK_PageView* pPageView, + const CPDF_Point& pt) { return FFLtoPWL(pt); } -CFX_FloatRect CFFL_FormFiller::FFLtoWnd(CPDFSDK_PageView* pPageView, - const CFX_FloatRect& rect) { +CPDF_Rect CFFL_FormFiller::FFLtoWnd(CPDFSDK_PageView* pPageView, + const CPDF_Rect& rect) { return rect; } @@ -650,8 +650,8 @@ void CFFL_Button::OnMouseExit(CPDFSDK_PageView* pPageView, FX_BOOL CFFL_Button::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) { - CFX_FloatRect rcAnnot = pAnnot->GetRect(); + const CPDF_Point& point) { + CPDF_Rect rcAnnot = pAnnot->GetRect(); if (!rcAnnot.Contains(point.x, point.y)) return FALSE; @@ -665,8 +665,8 @@ FX_BOOL CFFL_Button::OnLButtonDown(CPDFSDK_PageView* pPageView, FX_BOOL CFFL_Button::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) { - CFX_FloatRect rcAnnot = pAnnot->GetRect(); + const CPDF_Point& point) { + CPDF_Rect rcAnnot = pAnnot->GetRect(); if (!rcAnnot.Contains(point.x, point.y)) return FALSE; @@ -681,7 +681,7 @@ FX_BOOL CFFL_Button::OnLButtonUp(CPDFSDK_PageView* pPageView, FX_BOOL CFFL_Button::OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { ASSERT(m_pApp); return TRUE; diff --git a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp index 21a4bb6ab2..a5100f6904 100644 --- a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp +++ b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp @@ -29,8 +29,8 @@ CFFL_IFormFiller::~CFFL_IFormFiller() { FX_BOOL CFFL_IFormFiller::Annot_HitTest(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, - CFX_FloatPoint point) { - CFX_FloatRect rc = pAnnot->GetRect(); + CPDF_Point point) { + CPDF_Rect rc = pAnnot->GetRect(); if (rc.Contains(point.x, point.y)) return TRUE; return FALSE; @@ -44,10 +44,10 @@ FX_RECT CFFL_IFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView, ASSERT(pPageView); CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); - CFX_FloatRect rcAnnot; + CPDF_Rect rcAnnot; pPDFAnnot->GetRect(rcAnnot); - CFX_FloatRect rcWin = CPWL_Utils::InflateRect(rcAnnot, 1); + CPDF_Rect rcWin = CPWL_Utils::InflateRect(rcAnnot, 1); return rcWin.GetOutterRect(); } @@ -67,7 +67,7 @@ void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Document* pDocument = m_pApp->GetSDKDocument(); if (pDocument->GetFocusAnnot() == pAnnot) { - CFX_FloatRect rcFocus = pFormFiller->GetFocusBox(pPageView); + CPDF_Rect rcFocus = pFormFiller->GetFocusBox(pPageView); if (!rcFocus.IsEmpty()) { CFX_PathData path; path.SetPointCount(5); @@ -196,7 +196,7 @@ void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); if (!m_bNotifying) { @@ -238,7 +238,7 @@ FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, FX_BOOL CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; CPDFSDK_Document* pDocument = m_pApp->GetSDKDocument(); @@ -318,7 +318,7 @@ void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget, FX_BOOL CFFL_IFormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { @@ -331,7 +331,7 @@ FX_BOOL CFFL_IFormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView, FX_BOOL CFFL_IFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); // change cursor @@ -346,7 +346,7 @@ FX_BOOL CFFL_IFormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { @@ -359,7 +359,7 @@ FX_BOOL CFFL_IFormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView, FX_BOOL CFFL_IFormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { @@ -372,7 +372,7 @@ FX_BOOL CFFL_IFormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView, FX_BOOL CFFL_IFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { @@ -570,12 +570,12 @@ void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData, FX_FLOAT& fPopupRet) { CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; - CFX_FloatRect rcPageView(0, 0, 0, 0); + CPDF_Rect rcPageView(0, 0, 0, 0); rcPageView.right = pData->pWidget->GetPDFPage()->GetPageWidth(); rcPageView.bottom = pData->pWidget->GetPDFPage()->GetPageHeight(); rcPageView.Normalize(); - CFX_FloatRect rcAnnot = pData->pWidget->GetRect(); + CPDF_Rect rcAnnot = pData->pWidget->GetRect(); FX_FLOAT fTop = 0.0f; FX_FLOAT fBottom = 0.0f; diff --git a/fpdfsdk/src/formfiller/FFL_RadioButton.cpp b/fpdfsdk/src/formfiller/FFL_RadioButton.cpp index 845df115ca..2a742c0a85 100644 --- a/fpdfsdk/src/formfiller/FFL_RadioButton.cpp +++ b/fpdfsdk/src/formfiller/FFL_RadioButton.cpp @@ -74,7 +74,7 @@ FX_BOOL CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot, FX_BOOL CFFL_RadioButton::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { CFFL_Button::OnLButtonUp(pPageView, pAnnot, nFlags, point); if (IsValid()) { diff --git a/fpdfsdk/src/formfiller/FFL_TextField.cpp b/fpdfsdk/src/formfiller/FFL_TextField.cpp index 42f2aad48f..ca4e07be4d 100644 --- a/fpdfsdk/src/formfiller/FFL_TextField.cpp +++ b/fpdfsdk/src/formfiller/FFL_TextField.cpp @@ -112,7 +112,7 @@ FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, CPDFSDK_PageView* pPageView = GetCurPageView(); ASSERT(pPageView); m_bValid = !m_bValid; - CFX_FloatRect rcAnnot = pAnnot->GetRect(); + CPDF_Rect rcAnnot = pAnnot->GetRect(); m_pApp->FFI_Invalidate(pAnnot->GetUnderlyingPage(), rcAnnot.left, rcAnnot.top, rcAnnot.right, rcAnnot.bottom); diff --git a/fpdfsdk/src/fpdf_flatten.cpp b/fpdfsdk/src/fpdf_flatten.cpp index 759f758e5e..9aee35f760 100644 --- a/fpdfsdk/src/fpdf_flatten.cpp +++ b/fpdfsdk/src/fpdf_flatten.cpp @@ -11,12 +11,12 @@ #include "fpdfsdk/include/fsdk_define.h" typedef CFX_ArrayTemplate<CPDF_Dictionary*> CPDF_ObjectArray; -typedef CFX_ArrayTemplate<CFX_FloatRect> CPDF_RectArray; +typedef CFX_ArrayTemplate<CPDF_Rect> CPDF_RectArray; enum FPDF_TYPE { MAX, MIN }; enum FPDF_VALUE { TOP, LEFT, RIGHT, BOTTOM }; -FX_BOOL IsValiableRect(CFX_FloatRect rect, CFX_FloatRect rcPage) { +FX_BOOL IsValiableRect(CPDF_Rect rect, CPDF_Rect rcPage) { if (rect.left - rect.right > 0.000001f || rect.bottom - rect.top > 0.000001f) return FALSE; @@ -46,7 +46,7 @@ void GetContentsRect(CPDF_Document* pDoc, if (!pPageObject) continue; - CFX_FloatRect rc; + CPDF_Rect rc; rc.left = pPageObject->m_Left; rc.right = pPageObject->m_Right; rc.bottom = pPageObject->m_Bottom; @@ -62,7 +62,7 @@ void ParserStream(CPDF_Dictionary* pPageDic, CPDF_ObjectArray* pObjectArray) { if (!pStream) return; - CFX_FloatRect rect; + CPDF_Rect rect; if (pStream->KeyExist("Rect")) rect = pStream->GetRectBy("Rect"); else if (pStream->KeyExist("BBox")) @@ -127,25 +127,25 @@ FX_FLOAT GetMinMaxValue(CPDF_RectArray& array, switch (value) { case LEFT: { for (int i = 0; i < nRects; i++) - pArray[i] = CFX_FloatRect(array.GetAt(i)).left; + pArray[i] = CPDF_Rect(array.GetAt(i)).left; break; } case TOP: { for (int i = 0; i < nRects; i++) - pArray[i] = CFX_FloatRect(array.GetAt(i)).top; + pArray[i] = CPDF_Rect(array.GetAt(i)).top; break; } case RIGHT: { for (int i = 0; i < nRects; i++) - pArray[i] = CFX_FloatRect(array.GetAt(i)).right; + pArray[i] = CPDF_Rect(array.GetAt(i)).right; break; } case BOTTOM: { for (int i = 0; i < nRects; i++) - pArray[i] = CFX_FloatRect(array.GetAt(i)).bottom; + pArray[i] = CPDF_Rect(array.GetAt(i)).bottom; break; } @@ -166,8 +166,8 @@ FX_FLOAT GetMinMaxValue(CPDF_RectArray& array, return fRet; } -CFX_FloatRect CalculateRect(CPDF_RectArray* pRectArray) { - CFX_FloatRect rcRet; +CPDF_Rect CalculateRect(CPDF_RectArray* pRectArray) { + CPDF_Rect rcRet; rcRet.left = GetMinMaxValue(*pRectArray, MIN, LEFT); rcRet.top = GetMinMaxValue(*pRectArray, MAX, TOP); @@ -245,8 +245,8 @@ void SetPageContents(CFX_ByteString key, } } -CFX_Matrix GetMatrix(CFX_FloatRect rcAnnot, - CFX_FloatRect rcStream, +CFX_Matrix GetMatrix(CPDF_Rect rcAnnot, + CPDF_Rect rcStream, const CFX_Matrix& matrix) { if (rcStream.IsEmpty()) return CFX_Matrix(); @@ -266,8 +266,8 @@ void GetOffset(FX_FLOAT& fa, FX_FLOAT& fd, FX_FLOAT& fe, FX_FLOAT& ff, - CFX_FloatRect rcAnnot, - CFX_FloatRect rcStream, + CPDF_Rect rcAnnot, + CPDF_Rect rcStream, const CFX_Matrix& matrix) { FX_FLOAT fStreamWidth = 0.0f; FX_FLOAT fStreamHeight = 0.0f; @@ -323,15 +323,15 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) { if (iRet == FLATTEN_NOTHINGTODO || iRet == FLATTEN_FAIL) return iRet; - CFX_FloatRect rcOriginalCB; - CFX_FloatRect rcMerger = CalculateRect(&RectArray); - CFX_FloatRect rcOriginalMB = pPageDict->GetRectBy("MediaBox"); + CPDF_Rect rcOriginalCB; + CPDF_Rect rcMerger = CalculateRect(&RectArray); + CPDF_Rect rcOriginalMB = pPageDict->GetRectBy("MediaBox"); if (pPageDict->KeyExist("CropBox")) rcOriginalMB = pPageDict->GetRectBy("CropBox"); if (rcOriginalMB.IsEmpty()) { - rcOriginalMB = CFX_FloatRect(0.0f, 0.0f, 612.0f, 792.0f); + rcOriginalMB = CPDF_Rect(0.0f, 0.0f, 612.0f, 792.0f); } rcMerger.left = @@ -407,7 +407,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) { pNewOXbjectDic->SetAtName("Subtype", "Form"); pNewOXbjectDic->SetAtInteger("FormType", 1); pNewOXbjectDic->SetAtName("Name", "FRM"); - CFX_FloatRect rcBBox = pPageDict->GetRectBy("ArtBox"); + CPDF_Rect rcBBox = pPageDict->GetRectBy("ArtBox"); pNewOXbjectDic->SetAtRect("BBox", rcBBox); } @@ -416,7 +416,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) { if (!pAnnotDic) continue; - CFX_FloatRect rcAnnot = pAnnotDic->GetRectBy("Rect"); + CPDF_Rect rcAnnot = pAnnotDic->GetRectBy("Rect"); rcAnnot.Normalize(); CFX_ByteString sAnnotState = pAnnotDic->GetStringBy("AS"); @@ -452,7 +452,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) { CPDF_Dictionary* pAPDic = pAPStream->GetDict(); CFX_Matrix matrix = pAPDic->GetMatrixBy("Matrix"); - CFX_FloatRect rcStream; + CPDF_Rect rcStream; if (pAPDic->KeyExist("Rect")) rcStream = pAPDic->GetRectBy("Rect"); else if (pAPDic->KeyExist("BBox")) diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp index c88dccd86a..4a4e1de0fe 100644 --- a/fpdfsdk/src/fpdfdoc.cpp +++ b/fpdfsdk/src/fpdfdoc.cpp @@ -288,7 +288,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, return FALSE; CPDF_Dictionary* pAnnotDict = ToDictionary(static_cast<CPDF_Object*>(linkAnnot)); - CFX_FloatRect rt = pAnnotDict->GetRectBy("Rect"); + CPDF_Rect rt = pAnnotDict->GetRectBy("Rect"); rect->left = rt.left; rect->bottom = rt.bottom; rect->right = rt.right; diff --git a/fpdfsdk/src/fpdfeditpage.cpp b/fpdfsdk/src/fpdfeditpage.cpp index 46026b593d..b833a61c02 100644 --- a/fpdfsdk/src/fpdfeditpage.cpp +++ b/fpdfsdk/src/fpdfeditpage.cpp @@ -277,7 +277,7 @@ DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page, for (size_t i = 0; i < AnnotList.Count(); ++i) { CPDF_Annot* pAnnot = AnnotList.GetAt(i); // transformAnnots Rectangle - CFX_FloatRect rect; + CPDF_Rect rect; pAnnot->GetRect(rect); CFX_Matrix matrix((FX_FLOAT)a, (FX_FLOAT)b, (FX_FLOAT)c, (FX_FLOAT)d, (FX_FLOAT)e, (FX_FLOAT)f); diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp index a14c66fbc6..c1f332bd74 100644 --- a/fpdfsdk/src/fpdfformfill.cpp +++ b/fpdfsdk/src/fpdfformfill.cpp @@ -187,7 +187,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, if (!pPageView) return FALSE; - CFX_FloatPoint pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); + CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); return pPageView->OnMouseMove(pt, modifier); } @@ -200,7 +200,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle, if (!pPageView) return FALSE; - CFX_FloatPoint pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); + CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); return pPageView->OnLButtonDown(pt, modifier); } @@ -213,7 +213,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle, if (!pPageView) return FALSE; - CFX_FloatPoint pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); + CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); return pPageView->OnLButtonUp(pt, modifier); } @@ -227,7 +227,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonDown(FPDF_FORMHANDLE hHandle, if (!pPageView) return FALSE; - CFX_FloatPoint pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); + CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); return pPageView->OnRButtonDown(pt, modifier); } @@ -240,7 +240,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle, if (!pPageView) return FALSE; - CFX_FloatPoint pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); + CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); return pPageView->OnRButtonUp(pt, modifier); } #endif // PDF_ENABLE_XFA diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp index f9bf170554..2baef4c21b 100644 --- a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp +++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp @@ -192,7 +192,7 @@ CPDFSDK_Document* CPDFXFA_Document::GetSDKDocument( } void CPDFXFA_Document::FXRect2PDFRect(const CFX_RectF& fxRectF, - CFX_FloatRect& pdfRect) { + CPDF_Rect& pdfRect) { pdfRect.left = fxRectF.left; pdfRect.top = fxRectF.bottom(); pdfRect.right = fxRectF.right(); @@ -220,7 +220,7 @@ void CPDFXFA_Document::InvalidateRect(IXFA_PageView* pPageView, if (m_iDocType != DOCTYPE_DYNAMIC_XFA) return; - CFX_FloatRect rcPage; + CPDF_Rect rcPage; FXRect2PDFRect(rt, rcPage); CPDFXFA_Page* pPage = GetPage(pPageView); @@ -285,7 +285,7 @@ void CPDFXFA_Document::DisplayCaret(IXFA_Widget* hWidget, if (pPage == NULL) return; - CFX_FloatRect rcCaret; + CPDF_Rect rcCaret; FXRect2PDFRect(*pRtAnchor, rcCaret); CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); @@ -327,7 +327,7 @@ FX_BOOL CPDFXFA_Document::GetPopupPos(IXFA_Widget* hWidget, FS_RECTF pageViewRect; pEnv->FFI_GetPageViewRect(pPage, pageViewRect); - CFX_FloatRect rcAnchor; + CPDF_Rect rcAnchor; rcAnchor.left = rtAnchor.left; rcAnchor.top = rtAnchor.bottom(); diff --git a/fpdfsdk/src/fsdk_annothandler.cpp b/fpdfsdk/src/fsdk_annothandler.cpp index 28b8114ed6..661eaef1a1 100644 --- a/fpdfsdk/src/fsdk_annothandler.cpp +++ b/fpdfsdk/src/fsdk_annothandler.cpp @@ -156,7 +156,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown( CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { ASSERT(pAnnot); if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { @@ -164,11 +164,10 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown( } return FALSE; } -FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonUp( - CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlags, - const CFX_FloatPoint& point) { +FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonUp(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot, + FX_DWORD nFlags, + const CPDF_Point& point) { ASSERT(pAnnot); if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { @@ -180,7 +179,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDblClk( CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { ASSERT(pAnnot); if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { @@ -188,11 +187,10 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDblClk( } return FALSE; } -FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseMove( - CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlags, - const CFX_FloatPoint& point) { +FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseMove(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot, + FX_DWORD nFlags, + const CPDF_Point& point) { ASSERT(pAnnot); if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { @@ -200,12 +198,11 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseMove( } return FALSE; } -FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseWheel( - CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlags, - short zDelta, - const CFX_FloatPoint& point) { +FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseWheel(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot, + FX_DWORD nFlags, + short zDelta, + const CPDF_Point& point) { ASSERT(pAnnot); if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { @@ -218,7 +215,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonDown( CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { ASSERT(pAnnot); if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { @@ -226,11 +223,10 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonDown( } return FALSE; } -FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonUp( - CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlags, - const CFX_FloatPoint& point) { +FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonUp(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot, + FX_DWORD nFlags, + const CPDF_Point& point) { ASSERT(pAnnot); if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { @@ -335,7 +331,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnChangeFocus( } #endif // PDF_ENABLE_XFA -CFX_FloatRect CPDFSDK_AnnotHandlerMgr::Annot_OnGetViewBBox( +CPDF_Rect CPDFSDK_AnnotHandlerMgr::Annot_OnGetViewBBox( CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) { ASSERT(pAnnot); @@ -347,7 +343,7 @@ CFX_FloatRect CPDFSDK_AnnotHandlerMgr::Annot_OnGetViewBBox( FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnHitTest(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { ASSERT(pAnnot); if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { if (pAnnotHandler->CanAnswer(pAnnot)) @@ -497,7 +493,7 @@ void CPDFSDK_BFAnnotHandler::OnMouseExit(CPDFSDK_PageView* pPageView, FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { CFX_ByteString sSubType = pAnnot->GetSubType(); if (sSubType == BFFT_SIGNATURE) { @@ -512,7 +508,7 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView, FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { CFX_ByteString sSubType = pAnnot->GetSubType(); if (sSubType == BFFT_SIGNATURE) { @@ -527,7 +523,7 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView, FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { CFX_ByteString sSubType = pAnnot->GetSubType(); if (sSubType == BFFT_SIGNATURE) { @@ -542,7 +538,7 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView, FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { CFX_ByteString sSubType = pAnnot->GetSubType(); if (sSubType == BFFT_SIGNATURE) { @@ -558,7 +554,7 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { CFX_ByteString sSubType = pAnnot->GetSubType(); if (sSubType == BFFT_SIGNATURE) { @@ -574,7 +570,7 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView, FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { CFX_ByteString sSubType = pAnnot->GetSubType(); if (sSubType == BFFT_SIGNATURE) { @@ -588,7 +584,7 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView, FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { CFX_ByteString sSubType = pAnnot->GetSubType(); if (sSubType == BFFT_SIGNATURE) { @@ -698,8 +694,8 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, return TRUE; } -CFX_FloatRect CPDFSDK_BFAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot) { +CPDF_Rect CPDFSDK_BFAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot) { CFX_ByteString sSubType = pAnnot->GetSubType(); if (sSubType == BFFT_SIGNATURE) { @@ -708,16 +704,16 @@ CFX_FloatRect CPDFSDK_BFAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView, return m_pFormFiller->GetViewBBox(pPageView, pAnnot); } - return CFX_FloatRect(0, 0, 0, 0); + return CPDF_Rect(0, 0, 0, 0); } FX_BOOL CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { ASSERT(pPageView); ASSERT(pAnnot); - CFX_FloatRect rect = GetViewBBox(pPageView, pAnnot); + CPDF_Rect rect = GetViewBBox(pPageView, pAnnot); return rect.Contains(point.x, point.y); } @@ -781,8 +777,8 @@ void CPDFSDK_XFAAnnotHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot) { delete pWidget; } -CFX_FloatRect CPDFSDK_XFAAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot) { +CPDF_Rect CPDFSDK_XFAAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot) { ASSERT(pAnnot); IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); @@ -807,7 +803,7 @@ CFX_FloatRect CPDFSDK_XFAAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView, FX_BOOL CPDFSDK_XFAAnnotHandler::HitTest(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { if (!pPageView || !pAnnot) return FALSE; @@ -854,7 +850,7 @@ void CPDFSDK_XFAAnnotHandler::OnMouseExit(CPDFSDK_PageView* pPageView, FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { if (!pPageView || !pAnnot) return FALSE; @@ -866,7 +862,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView, FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { if (!pPageView || !pAnnot) return FALSE; @@ -878,7 +874,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView, FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { if (!pPageView || !pAnnot) return FALSE; @@ -890,7 +886,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView, FX_BOOL CPDFSDK_XFAAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { if (!pPageView || !pAnnot) return FALSE; @@ -903,7 +899,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { if (!pPageView || !pAnnot) return FALSE; @@ -915,7 +911,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView, FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { if (!pPageView || !pAnnot) return FALSE; @@ -927,7 +923,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView, FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { if (!pPageView || !pAnnot) return FALSE; @@ -939,7 +935,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView, FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CFX_FloatPoint& point) { + const CPDF_Point& point) { if (!pPageView || !pAnnot) return FALSE; diff --git a/fpdfsdk/src/fsdk_baseannot.cpp b/fpdfsdk/src/fsdk_baseannot.cpp index 705205f1e2..79418d972e 100644 --- a/fpdfsdk/src/fsdk_baseannot.cpp +++ b/fpdfsdk/src/fsdk_baseannot.cpp @@ -537,15 +537,15 @@ CPDF_Dictionary* CPDFSDK_BAAnnot::GetAnnotDict() const { return m_pAnnot->GetAnnotDict(); } -void CPDFSDK_BAAnnot::SetRect(const CFX_FloatRect& rect) { +void CPDFSDK_BAAnnot::SetRect(const CPDF_Rect& rect) { ASSERT(rect.right - rect.left >= GetMinWidth()); ASSERT(rect.top - rect.bottom >= GetMinHeight()); m_pAnnot->GetAnnotDict()->SetAtRect("Rect", rect); } -CFX_FloatRect CPDFSDK_BAAnnot::GetRect() const { - CFX_FloatRect rect; +CPDF_Rect CPDFSDK_BAAnnot::GetRect() const { + CPDF_Rect rect; m_pAnnot->GetRect(rect); return rect; } @@ -835,7 +835,7 @@ FX_BOOL CPDFSDK_BAAnnot::GetColor(FX_COLORREF& color) const { } void CPDFSDK_BAAnnot::WriteAppearance(const CFX_ByteString& sAPType, - const CFX_FloatRect& rcBBox, + const CPDF_Rect& rcBBox, const CFX_Matrix& matrix, const CFX_ByteString& sContents, const CFX_ByteString& sAPState) { diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp index 0359c0bc9f..1bae4dd5a1 100644 --- a/fpdfsdk/src/fsdk_baseform.cpp +++ b/fpdfsdk/src/fsdk_baseform.cpp @@ -816,7 +816,7 @@ void CPDFSDK_Widget::DrawAppearance(CFX_RenderDevice* pDevice, !IsWidgetAppearanceValid(CPDF_Annot::Normal)) { CFX_PathData pathData; - CFX_FloatRect rcAnnot = GetRect(); + CPDF_Rect rcAnnot = GetRect(); pathData.AppendRect(rcAnnot.left, rcAnnot.bottom, rcAnnot.right, rcAnnot.top); @@ -841,7 +841,7 @@ void CPDFSDK_Widget::DrawShadow(CFX_RenderDevice* pDevice, CPDFSDK_PageView* pPageView) { int nFieldType = GetFieldType(); if (m_pInterForm->IsNeedHighLight(nFieldType)) { - CFX_FloatRect rc = GetRect(); + CPDF_Rect rc = GetRect(); FX_COLORREF color = m_pInterForm->GetHighlightColor(nFieldType); uint8_t alpha = m_pInterForm->GetHighlightAlpha(); @@ -868,7 +868,7 @@ void CPDFSDK_Widget::DrawShadow(CFX_RenderDevice* pDevice, void CPDFSDK_Widget::ResetAppearance_PushButton() { CPDF_FormControl* pControl = GetFormControl(); - CFX_FloatRect rcWindow = GetRotatedRect(); + CPDF_Rect rcWindow = GetRotatedRect(); int32_t nLayout = 0; switch (pControl->GetTextPosition()) { case TEXTPOS_ICON: @@ -937,7 +937,7 @@ void CPDFSDK_Widget::ResetAppearance_PushButton() { break; } - CFX_FloatRect rcClient = CPWL_Utils::DeflateRect(rcWindow, fBorderWidth); + CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow, fBorderWidth); CPWL_Color crText(COLORTYPE_GRAY, 0); @@ -1125,8 +1125,8 @@ void CPDFSDK_Widget::ResetAppearance_CheckBox() { break; } - CFX_FloatRect rcWindow = GetRotatedRect(); - CFX_FloatRect rcClient = CPWL_Utils::DeflateRect(rcWindow, fBorderWidth); + CPDF_Rect rcWindow = GetRotatedRect(); + CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow, fBorderWidth); CPDF_DefaultAppearance da = pControl->GetDefaultAppearance(); if (da.HasColor()) { @@ -1251,8 +1251,8 @@ void CPDFSDK_Widget::ResetAppearance_RadioButton() { break; } - CFX_FloatRect rcWindow = GetRotatedRect(); - CFX_FloatRect rcClient = CPWL_Utils::DeflateRect(rcWindow, fBorderWidth); + CPDF_Rect rcWindow = GetRotatedRect(); + CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow, fBorderWidth); CPDF_DefaultAppearance da = pControl->GetDefaultAppearance(); if (da.HasColor()) { @@ -1290,7 +1290,7 @@ void CPDFSDK_Widget::ResetAppearance_RadioButton() { CFX_ByteString csAP_N_ON; - CFX_FloatRect rcCenter = + CPDF_Rect rcCenter = CPWL_Utils::DeflateRect(CPWL_Utils::GetCenterSquare(rcWindow), 1.0f); if (nStyle == PCS_CIRCLE) { @@ -1375,8 +1375,8 @@ void CPDFSDK_Widget::ResetAppearance_ComboBox(const FX_WCHAR* sValue) { CPDF_FormField* pField = pControl->GetField(); CFX_ByteTextBuf sBody, sLines; - CFX_FloatRect rcClient = GetClientRect(); - CFX_FloatRect rcButton = rcClient; + CPDF_Rect rcClient = GetClientRect(); + CPDF_Rect rcButton = rcClient; rcButton.left = rcButton.right - 13; rcButton.Normalize(); @@ -1388,7 +1388,7 @@ void CPDFSDK_Widget::ResetAppearance_ComboBox(const FX_WCHAR* sValue) { CBA_FontMap font_map(this, pEnv->GetSysHandler()); pEdit->SetFontMap(&font_map); - CFX_FloatRect rcEdit = rcClient; + CPDF_Rect rcEdit = rcClient; rcEdit.right = rcButton.left; rcEdit.Normalize(); @@ -1414,10 +1414,10 @@ void CPDFSDK_Widget::ResetAppearance_ComboBox(const FX_WCHAR* sValue) { pEdit->SetText(pField->GetOptionLabel(nCurSel).c_str()); } - CFX_FloatRect rcContent = pEdit->GetContentRect(); + CPDF_Rect rcContent = pEdit->GetContentRect(); CFX_ByteString sEdit = - CPWL_Utils::GetEditAppStream(pEdit, CFX_FloatPoint(0.0f, 0.0f)); + CPWL_Utils::GetEditAppStream(pEdit, CPDF_Point(0.0f, 0.0f)); if (sEdit.GetLength() > 0) { sBody << "/Tx BMC\n" << "q\n"; @@ -1447,7 +1447,7 @@ void CPDFSDK_Widget::ResetAppearance_ComboBox(const FX_WCHAR* sValue) { void CPDFSDK_Widget::ResetAppearance_ListBox() { CPDF_FormControl* pControl = GetFormControl(); CPDF_FormField* pField = pControl->GetField(); - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); CFX_ByteTextBuf sBody, sLines; if (IFX_Edit* pEdit = IFX_Edit::NewEdit()) { @@ -1459,8 +1459,7 @@ void CPDFSDK_Widget::ResetAppearance_ListBox() { CBA_FontMap font_map(this, pEnv->GetSysHandler()); pEdit->SetFontMap(&font_map); - pEdit->SetPlateRect( - CFX_FloatRect(rcClient.left, 0.0f, rcClient.right, 0.0f)); + pEdit->SetPlateRect(CPDF_Rect(rcClient.left, 0.0f, rcClient.right, 0.0f)); FX_FLOAT fFontSize = GetFontSize(); @@ -1489,12 +1488,12 @@ void CPDFSDK_Widget::ResetAppearance_ListBox() { pEdit->SetText(pField->GetOptionLabel(i).c_str()); - CFX_FloatRect rcContent = pEdit->GetContentRect(); + CPDF_Rect rcContent = pEdit->GetContentRect(); FX_FLOAT fItemHeight = rcContent.Height(); if (bSelected) { - CFX_FloatRect rcItem = - CFX_FloatRect(rcClient.left, fy - fItemHeight, rcClient.right, fy); + CPDF_Rect rcItem = + CPDF_Rect(rcClient.left, fy - fItemHeight, rcClient.right, fy); sList << "q\n" << CPWL_Utils::GetColorAppStream( CPWL_Color(COLORTYPE_RGB, 0, 51.0f / 255.0f, 113.0f / 255.0f), @@ -1505,12 +1504,12 @@ void CPDFSDK_Widget::ResetAppearance_ListBox() { sList << "BT\n" << CPWL_Utils::GetColorAppStream( CPWL_Color(COLORTYPE_GRAY, 1), TRUE) - << CPWL_Utils::GetEditAppStream(pEdit, CFX_FloatPoint(0.0f, fy)) + << CPWL_Utils::GetEditAppStream(pEdit, CPDF_Point(0.0f, fy)) << "ET\n"; } else { CPWL_Color crText = GetTextPWLColor(); sList << "BT\n" << CPWL_Utils::GetColorAppStream(crText, TRUE) - << CPWL_Utils::GetEditAppStream(pEdit, CFX_FloatPoint(0.0f, fy)) + << CPWL_Utils::GetEditAppStream(pEdit, CPDF_Point(0.0f, fy)) << "ET\n"; } @@ -1547,7 +1546,7 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue) { CBA_FontMap font_map(this, pEnv->GetSysHandler()); pEdit->SetFontMap(&font_map); - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); pEdit->SetPlateRect(rcClient); pEdit->SetAlignmentH(pControl->GetControlAlignment()); @@ -1606,10 +1605,10 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue) { else pEdit->SetText(pField->GetValue().c_str()); - CFX_FloatRect rcContent = pEdit->GetContentRect(); + CPDF_Rect rcContent = pEdit->GetContentRect(); CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream( - pEdit, CFX_FloatPoint(0.0f, 0.0f), NULL, !bCharArray, subWord); + pEdit, CPDF_Point(0.0f, 0.0f), NULL, !bCharArray, subWord); if (sEdit.GetLength() > 0) { sBody << "/Tx BMC\n" @@ -1681,8 +1680,8 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue) { WriteAppearance("N", GetRotatedRect(), GetMatrix(), sAP); } -CFX_FloatRect CPDFSDK_Widget::GetClientRect() const { - CFX_FloatRect rcWindow = GetRotatedRect(); +CPDF_Rect CPDFSDK_Widget::GetClientRect() const { + CPDF_Rect rcWindow = GetRotatedRect(); FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth(); switch (GetBorderStyle()) { case BBS_BEVELED: @@ -1694,22 +1693,22 @@ CFX_FloatRect CPDFSDK_Widget::GetClientRect() const { return CPWL_Utils::DeflateRect(rcWindow, fBorderWidth); } -CFX_FloatRect CPDFSDK_Widget::GetRotatedRect() const { - CFX_FloatRect rectAnnot = GetRect(); +CPDF_Rect CPDFSDK_Widget::GetRotatedRect() const { + CPDF_Rect rectAnnot = GetRect(); FX_FLOAT fWidth = rectAnnot.right - rectAnnot.left; FX_FLOAT fHeight = rectAnnot.top - rectAnnot.bottom; CPDF_FormControl* pControl = GetFormControl(); - CFX_FloatRect rcPDFWindow; + CPDF_Rect rcPDFWindow; switch (abs(pControl->GetRotation() % 360)) { case 0: case 180: default: - rcPDFWindow = CFX_FloatRect(0, 0, fWidth, fHeight); + rcPDFWindow = CPDF_Rect(0, 0, fWidth, fHeight); break; case 90: case 270: - rcPDFWindow = CFX_FloatRect(0, 0, fHeight, fWidth); + rcPDFWindow = CPDF_Rect(0, 0, fHeight, fWidth); break; } @@ -1725,7 +1724,7 @@ CFX_ByteString CPDFSDK_Widget::GetBackgroundAppStream() const { } CFX_ByteString CPDFSDK_Widget::GetBorderAppStream() const { - CFX_FloatRect rcWindow = GetRotatedRect(); + CPDF_Rect rcWindow = GetRotatedRect(); CPWL_Color crBorder = GetBorderPWLColor(); CPWL_Color crBackground = GetFillPWLColor(); CPWL_Color crLeftTop, crRightBottom; @@ -1767,7 +1766,7 @@ CFX_ByteString CPDFSDK_Widget::GetBorderAppStream() const { CFX_Matrix CPDFSDK_Widget::GetMatrix() const { CFX_Matrix mt; CPDF_FormControl* pControl = GetFormControl(); - CFX_FloatRect rcAnnot = GetRect(); + CPDF_Rect rcAnnot = GetRect(); FX_FLOAT fWidth = rcAnnot.right - rcAnnot.left; FX_FLOAT fHeight = rcAnnot.top - rcAnnot.bottom; @@ -2786,7 +2785,7 @@ void CBA_AnnotIterator::GenerateResults() { int nLeftTopIndex = -1; FX_FLOAT fTop = 0.0f; for (int i = sa.size() - 1; i >= 0; i--) { - CFX_FloatRect rcAnnot = GetAnnotRect(sa[i]); + CPDF_Rect rcAnnot = GetAnnotRect(sa[i]); if (rcAnnot.top > fTop) { nLeftTopIndex = i; fTop = rcAnnot.top; @@ -2794,13 +2793,13 @@ void CBA_AnnotIterator::GenerateResults() { } if (nLeftTopIndex >= 0) { CPDFSDK_Annot* pLeftTopAnnot = sa[nLeftTopIndex]; - CFX_FloatRect rcLeftTop = GetAnnotRect(pLeftTopAnnot); + CPDF_Rect rcLeftTop = GetAnnotRect(pLeftTopAnnot); m_Annots.push_back(pLeftTopAnnot); sa.erase(sa.begin() + nLeftTopIndex); std::vector<int> aSelect; for (int i = 0; i < sa.size(); ++i) { - CFX_FloatRect rcAnnot = GetAnnotRect(sa[i]); + CPDF_Rect rcAnnot = GetAnnotRect(sa[i]); FX_FLOAT fCenterY = (rcAnnot.top + rcAnnot.bottom) / 2.0f; if (fCenterY > rcLeftTop.bottom && fCenterY < rcLeftTop.top) aSelect.push_back(i); @@ -2826,7 +2825,7 @@ void CBA_AnnotIterator::GenerateResults() { int nLeftTopIndex = -1; FX_FLOAT fLeft = -1.0f; for (int i = sa.size() - 1; i >= 0; --i) { - CFX_FloatRect rcAnnot = GetAnnotRect(sa[i]); + CPDF_Rect rcAnnot = GetAnnotRect(sa[i]); if (fLeft < 0) { nLeftTopIndex = 0; fLeft = rcAnnot.left; @@ -2838,13 +2837,13 @@ void CBA_AnnotIterator::GenerateResults() { if (nLeftTopIndex >= 0) { CPDFSDK_Annot* pLeftTopAnnot = sa[nLeftTopIndex]; - CFX_FloatRect rcLeftTop = GetAnnotRect(pLeftTopAnnot); + CPDF_Rect rcLeftTop = GetAnnotRect(pLeftTopAnnot); m_Annots.push_back(pLeftTopAnnot); sa.erase(sa.begin() + nLeftTopIndex); std::vector<int> aSelect; for (int i = 0; i < sa.size(); ++i) { - CFX_FloatRect rcAnnot = GetAnnotRect(sa[i]); + CPDF_Rect rcAnnot = GetAnnotRect(sa[i]); FX_FLOAT fCenterX = (rcAnnot.left + rcAnnot.right) / 2.0f; if (fCenterX > rcLeftTop.left && fCenterX < rcLeftTop.right) aSelect.push_back(i); @@ -2861,8 +2860,8 @@ void CBA_AnnotIterator::GenerateResults() { } } -CFX_FloatRect CBA_AnnotIterator::GetAnnotRect(const CPDFSDK_Annot* pAnnot) { - CFX_FloatRect rcAnnot; +CPDF_Rect CBA_AnnotIterator::GetAnnotRect(const CPDFSDK_Annot* pAnnot) { + CPDF_Rect rcAnnot; pAnnot->GetPDFAnnot()->GetRect(rcAnnot); return rcAnnot; } diff --git a/fpdfsdk/src/fsdk_baseform_embeddertest.cpp b/fpdfsdk/src/fsdk_baseform_embeddertest.cpp index 4fd3bb785c..109b22f3b5 100644 --- a/fpdfsdk/src/fsdk_baseform_embeddertest.cpp +++ b/fpdfsdk/src/fsdk_baseform_embeddertest.cpp @@ -13,7 +13,7 @@ namespace { -void CheckRect(const CFX_FloatRect& actual, const CFX_FloatRect& expected) { +void CheckRect(const CPDF_Rect& actual, const CPDF_Rect& expected) { EXPECT_EQ(expected.left, actual.left); EXPECT_EQ(expected.bottom, actual.bottom); EXPECT_EQ(expected.right, actual.right); @@ -30,10 +30,10 @@ TEST_F(FSDKBaseFormEmbeddertest, CBA_AnnotIterator) { EXPECT_TRUE(LoadPage(1)); EXPECT_TRUE(LoadPage(2)); - CFX_FloatRect LeftBottom(200, 200, 220, 220); - CFX_FloatRect RightBottom(400, 201, 420, 221); - CFX_FloatRect LeftTop(201, 400, 221, 420); - CFX_FloatRect RightTop(401, 401, 421, 421); + CPDF_Rect LeftBottom(200, 200, 220, 220); + CPDF_Rect RightBottom(400, 201, 420, 221); + CPDF_Rect LeftTop(201, 400, 221, 420); + CPDF_Rect RightTop(401, 401, 421, 421); CPDFSDK_Document* pSDKDoc = CPDFSDK_Document::FromFPDFFormHandle(form_handle()); diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp index 933f451538..9e627167fe 100644 --- a/fpdfsdk/src/fsdk_mgr.cpp +++ b/fpdfsdk/src/fsdk_mgr.cpp @@ -58,7 +58,7 @@ class CFX_SystemHandler : public IFX_SystemHandler { public: // IFX_SystemHandler void InvalidateRect(FX_HWND hWnd, FX_RECT rect) override; - void OutputSelectedRect(void* pFormFiller, CFX_FloatRect& rect) override; + void OutputSelectedRect(void* pFormFiller, CPDF_Rect& rect) override; FX_BOOL IsSelectionImplemented() override; CFX_WideString GetClipboardText(FX_HWND hWnd) override { return L""; } FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString string) override { @@ -132,20 +132,19 @@ void CFX_SystemHandler::InvalidateRect(FX_HWND hWnd, FX_RECT rect) { device2page.Transform((FX_FLOAT)rect.left, (FX_FLOAT)rect.top, left, top); device2page.Transform((FX_FLOAT)rect.right, (FX_FLOAT)rect.bottom, right, bottom); - CFX_FloatRect rcPDF(left, bottom, right, top); + CPDF_Rect rcPDF(left, bottom, right, top); rcPDF.Normalize(); m_pEnv->FFI_Invalidate(pPage, rcPDF.left, rcPDF.top, rcPDF.right, rcPDF.bottom); } -void CFX_SystemHandler::OutputSelectedRect(void* pFormFiller, - CFX_FloatRect& rect) { +void CFX_SystemHandler::OutputSelectedRect(void* pFormFiller, CPDF_Rect& rect) { CFFL_FormFiller* pFFL = (CFFL_FormFiller*)pFormFiller; if (pFFL) { - CFX_FloatPoint leftbottom = CFX_FloatPoint(rect.left, rect.bottom); - CFX_FloatPoint righttop = CFX_FloatPoint(rect.right, rect.top); - CFX_FloatPoint ptA = pFFL->PWLtoFFL(leftbottom); - CFX_FloatPoint ptB = pFFL->PWLtoFFL(righttop); + CPDF_Point leftbottom = CPDF_Point(rect.left, rect.bottom); + CPDF_Point righttop = CPDF_Point(rect.right, rect.top); + CPDF_Point ptA = pFFL->PWLtoFFL(leftbottom); + CPDF_Point ptB = pFFL->PWLtoFFL(righttop); CPDFSDK_Annot* pAnnot = pFFL->GetSDKAnnot(); UnderlyingPageType* pPage = pAnnot->GetUnderlyingPage(); ASSERT(pPage); @@ -759,7 +758,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetFXAnnotAtPoint(FX_FLOAT pageX, CPDFSDK_AnnotHandlerMgr* pAnnotMgr = pEnv->GetAnnotHandlerMgr(); CPDFSDK_AnnotIterator annotIterator(this, false); while (CPDFSDK_Annot* pSDKAnnot = annotIterator.Next()) { - CFX_FloatRect rc = pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot); + CPDF_Rect rc = pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot); if (rc.Contains(pageX, pageY)) return pSDKAnnot; } @@ -779,7 +778,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetFXWidgetAtPoint(FX_FLOAT pageX, #endif // PDF_ENABLE_XFA if (bHitTest) { pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot); - CFX_FloatPoint point(pageX, pageY); + CPDF_Point point(pageX, pageY); if (pAnnotMgr->Annot_OnHitTest(this, pSDKAnnot, point)) return pSDKAnnot; } @@ -915,7 +914,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetAnnotByXFAWidget(IXFA_Widget* hWidget) { } #endif // PDF_ENABLE_XFA -FX_BOOL CPDFSDK_PageView::OnLButtonDown(const CFX_FloatPoint& point, +FX_BOOL CPDFSDK_PageView::OnLButtonDown(const CPDF_Point& point, FX_UINT nFlag) { CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); ASSERT(pEnv); @@ -934,7 +933,7 @@ FX_BOOL CPDFSDK_PageView::OnLButtonDown(const CFX_FloatPoint& point, } #ifdef PDF_ENABLE_XFA -FX_BOOL CPDFSDK_PageView::OnRButtonDown(const CFX_FloatPoint& point, +FX_BOOL CPDFSDK_PageView::OnRButtonDown(const CPDF_Point& point, FX_UINT nFlag) { CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); ASSERT(pEnv); @@ -954,8 +953,7 @@ FX_BOOL CPDFSDK_PageView::OnRButtonDown(const CFX_FloatPoint& point, return TRUE; } -FX_BOOL CPDFSDK_PageView::OnRButtonUp(const CFX_FloatPoint& point, - FX_UINT nFlag) { +FX_BOOL CPDFSDK_PageView::OnRButtonUp(const CPDF_Point& point, FX_UINT nFlag) { CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); ASSERT(pEnv); CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr(); @@ -974,8 +972,7 @@ FX_BOOL CPDFSDK_PageView::OnRButtonUp(const CFX_FloatPoint& point, } #endif // PDF_ENABLE_XFA -FX_BOOL CPDFSDK_PageView::OnLButtonUp(const CFX_FloatPoint& point, - FX_UINT nFlag) { +FX_BOOL CPDFSDK_PageView::OnLButtonUp(const CPDF_Point& point, FX_UINT nFlag) { CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); ASSERT(pEnv); CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr(); @@ -991,7 +988,7 @@ FX_BOOL CPDFSDK_PageView::OnLButtonUp(const CFX_FloatPoint& point, return bRet; } -FX_BOOL CPDFSDK_PageView::OnMouseMove(const CFX_FloatPoint& point, int nFlag) { +FX_BOOL CPDFSDK_PageView::OnMouseMove(const CPDF_Point& point, int nFlag) { CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr(); if (CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y)) { @@ -1024,7 +1021,7 @@ FX_BOOL CPDFSDK_PageView::OnMouseMove(const CFX_FloatPoint& point, int nFlag) { FX_BOOL CPDFSDK_PageView::OnMouseWheel(double deltaX, double deltaY, - const CFX_FloatPoint& point, + const CPDF_Point& point, int nFlag) { if (CPDFSDK_Annot* pAnnot = GetFXWidgetAtPoint(point.x, point.y)) { CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); @@ -1149,14 +1146,14 @@ void CPDFSDK_PageView::ClearFXAnnots() { void CPDFSDK_PageView::UpdateRects(CFX_RectArray& rects) { for (int i = 0; i < rects.GetSize(); i++) { - CFX_FloatRect rc = rects.GetAt(i); + CPDF_Rect rc = rects.GetAt(i); CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); pEnv->FFI_Invalidate(m_page, rc.left, rc.top, rc.right, rc.bottom); } } void CPDFSDK_PageView::UpdateView(CPDFSDK_Annot* pAnnot) { - CFX_FloatRect rcWindow = pAnnot->GetRect(); + CPDF_Rect rcWindow = pAnnot->GetRect(); CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); pEnv->FFI_Invalidate(m_page, rcWindow.left, rcWindow.top, rcWindow.right, rcWindow.bottom); diff --git a/fpdfsdk/src/fxedit/fxet_ap.cpp b/fpdfsdk/src/fxedit/fxet_ap.cpp index 562f566edb..2803b60d72 100644 --- a/fpdfsdk/src/fxedit/fxet_ap.cpp +++ b/fpdfsdk/src/fxedit/fxet_ap.cpp @@ -60,13 +60,13 @@ static CFX_ByteString GetFontSetString(IFX_Edit_FontMap* pFontMap, CFX_ByteString IFX_Edit::GetEditAppearanceStream( IFX_Edit* pEdit, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange /* = NULL*/, FX_BOOL bContinuous /* = TRUE*/, FX_WORD SubWord /* = 0*/) { CFX_ByteTextBuf sEditStream, sWords; - CFX_FloatPoint ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f); + CPDF_Point ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f); int32_t nCurFontIndex = -1; if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator()) { @@ -92,13 +92,13 @@ CFX_ByteString IFX_Edit::GetEditAppearanceStream( CPVT_Word word; if (pIterator->GetWord(word)) { - ptNew = CFX_FloatPoint(word.ptWord.x + ptOffset.x, - word.ptWord.y + ptOffset.y); + ptNew = CPDF_Point(word.ptWord.x + ptOffset.x, + word.ptWord.y + ptOffset.y); } else { CPVT_Line line; pIterator->GetLine(line); - ptNew = CFX_FloatPoint(line.ptLine.x + ptOffset.x, - line.ptLine.y + ptOffset.y); + ptNew = CPDF_Point(line.ptLine.x + ptOffset.x, + line.ptLine.y + ptOffset.y); } if (ptNew.x != ptOld.x || ptNew.y != ptOld.y) { @@ -129,8 +129,8 @@ CFX_ByteString IFX_Edit::GetEditAppearanceStream( } else { CPVT_Word word; if (pIterator->GetWord(word)) { - ptNew = CFX_FloatPoint(word.ptWord.x + ptOffset.x, - word.ptWord.y + ptOffset.y); + ptNew = CPDF_Point(word.ptWord.x + ptOffset.x, + word.ptWord.y + ptOffset.y); if (ptNew.x != ptOld.x || ptNew.y != ptOld.y) { sEditStream << ptNew.x - ptOld.x << " " << ptNew.y - ptOld.y @@ -176,7 +176,7 @@ CFX_ByteString IFX_Edit::GetEditAppearanceStream( CFX_ByteString IFX_Edit::GetSelectAppearanceStream( IFX_Edit* pEdit, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange) { CFX_ByteTextBuf sRet; diff --git a/fpdfsdk/src/fxedit/fxet_edit.cpp b/fpdfsdk/src/fxedit/fxet_edit.cpp index 1b68dc0510..0e66b0e3b5 100644 --- a/fpdfsdk/src/fxedit/fxet_edit.cpp +++ b/fpdfsdk/src/fxedit/fxet_edit.cpp @@ -155,7 +155,7 @@ void CFX_Edit_Refresh::BeginRefresh() { } void CFX_Edit_Refresh::Push(const CPVT_WordRange& linerange, - const CFX_FloatRect& rect) { + const CPDF_Rect& rect) { m_NewLineRects.Add(linerange, rect); } @@ -175,7 +175,7 @@ void CFX_Edit_Refresh::NoAnalyse() { void CFX_Edit_Refresh::Analyse(int32_t nAlignment) { FX_BOOL bLineTopChanged = FALSE; - CFX_FloatRect rcResult; + CPDF_Rect rcResult; FX_FLOAT fWidthDiff; int32_t szMax = std::max(m_OldLineRects.GetSize(), m_NewLineRects.GetSize()); @@ -240,7 +240,7 @@ void CFX_Edit_Refresh::Analyse(int32_t nAlignment) { } } -void CFX_Edit_Refresh::AddRefresh(const CFX_FloatRect& rect) { +void CFX_Edit_Refresh::AddRefresh(const CPDF_Rect& rect) { m_RefreshRects.Add(rect); } @@ -814,9 +814,9 @@ IFX_Edit_FontMap* CFX_Edit::GetFontMap() { return NULL; } -void CFX_Edit::SetPlateRect(const CFX_FloatRect& rect, FX_BOOL bPaint) { +void CFX_Edit::SetPlateRect(const CPDF_Rect& rect, FX_BOOL bPaint) { m_pVT->SetPlateRect(rect); - m_ptScrollPos = CFX_FloatPoint(rect.left, rect.top); + m_ptScrollPos = CPDF_Point(rect.left, rect.top); if (bPaint) Paint(); } @@ -1631,11 +1631,11 @@ int32_t CFX_Edit::GetCharArray() const { return m_pVT->GetCharArray(); } -CFX_FloatRect CFX_Edit::GetPlateRect() const { +CPDF_Rect CFX_Edit::GetPlateRect() const { return m_pVT->GetPlateRect(); } -CFX_FloatRect CFX_Edit::GetContentRect() const { +CPDF_Rect CFX_Edit::GetContentRect() const { return VTToEdit(m_pVT->GetContentRect()); } @@ -1659,12 +1659,12 @@ CPVT_WordRange CFX_Edit::GetVisibleWordRange() const { return GetWholeWordRange(); if (m_pVT->IsValid()) { - CFX_FloatRect rcPlate = m_pVT->GetPlateRect(); + CPDF_Rect rcPlate = m_pVT->GetPlateRect(); - CPVT_WordPlace place1 = m_pVT->SearchWordPlace( - EditToVT(CFX_FloatPoint(rcPlate.left, rcPlate.top))); + CPVT_WordPlace place1 = + m_pVT->SearchWordPlace(EditToVT(CPDF_Point(rcPlate.left, rcPlate.top))); CPVT_WordPlace place2 = m_pVT->SearchWordPlace( - EditToVT(CFX_FloatPoint(rcPlate.right, rcPlate.bottom))); + EditToVT(CPDF_Point(rcPlate.right, rcPlate.bottom))); return CPVT_WordRange(place1, place2); } @@ -1672,7 +1672,7 @@ CPVT_WordRange CFX_Edit::GetVisibleWordRange() const { return CPVT_WordRange(); } -CPVT_WordPlace CFX_Edit::SearchWordPlace(const CFX_FloatPoint& point) const { +CPVT_WordPlace CFX_Edit::SearchWordPlace(const CPDF_Point& point) const { if (m_pVT->IsValid()) { return m_pVT->SearchWordPlace(EditToVT(point)); } @@ -1712,7 +1712,7 @@ void CFX_Edit::RearrangePart(const CPVT_WordRange& range) { void CFX_Edit::SetContentChanged() { if (m_bNotify && m_pNotify) { - CFX_FloatRect rcContent = m_pVT->GetContentRect(); + CPDF_Rect rcContent = m_pVT->GetContentRect(); if (rcContent.Width() != m_rcOldContent.Width() || rcContent.Height() != m_rcOldContent.Height()) { if (!m_bNotifyFlag) { @@ -1751,9 +1751,9 @@ FX_BOOL CFX_Edit::IsSelected() const { return m_SelState.IsExist(); } -CFX_FloatPoint CFX_Edit::VTToEdit(const CFX_FloatPoint& point) const { - CFX_FloatRect rcContent = m_pVT->GetContentRect(); - CFX_FloatRect rcPlate = m_pVT->GetPlateRect(); +CPDF_Point CFX_Edit::VTToEdit(const CPDF_Point& point) const { + CPDF_Rect rcContent = m_pVT->GetContentRect(); + CPDF_Rect rcPlate = m_pVT->GetPlateRect(); FX_FLOAT fPadding = 0.0f; @@ -1769,13 +1769,13 @@ CFX_FloatPoint CFX_Edit::VTToEdit(const CFX_FloatPoint& point) const { break; } - return CFX_FloatPoint(point.x - (m_ptScrollPos.x - rcPlate.left), - point.y - (m_ptScrollPos.y + fPadding - rcPlate.top)); + return CPDF_Point(point.x - (m_ptScrollPos.x - rcPlate.left), + point.y - (m_ptScrollPos.y + fPadding - rcPlate.top)); } -CFX_FloatPoint CFX_Edit::EditToVT(const CFX_FloatPoint& point) const { - CFX_FloatRect rcContent = m_pVT->GetContentRect(); - CFX_FloatRect rcPlate = m_pVT->GetPlateRect(); +CPDF_Point CFX_Edit::EditToVT(const CPDF_Point& point) const { + CPDF_Rect rcContent = m_pVT->GetContentRect(); + CPDF_Rect rcPlate = m_pVT->GetPlateRect(); FX_FLOAT fPadding = 0.0f; @@ -1791,32 +1791,28 @@ CFX_FloatPoint CFX_Edit::EditToVT(const CFX_FloatPoint& point) const { break; } - return CFX_FloatPoint(point.x + (m_ptScrollPos.x - rcPlate.left), - point.y + (m_ptScrollPos.y + fPadding - rcPlate.top)); + return CPDF_Point(point.x + (m_ptScrollPos.x - rcPlate.left), + point.y + (m_ptScrollPos.y + fPadding - rcPlate.top)); } -CFX_FloatRect CFX_Edit::VTToEdit(const CFX_FloatRect& rect) const { - CFX_FloatPoint ptLeftBottom = - VTToEdit(CFX_FloatPoint(rect.left, rect.bottom)); - CFX_FloatPoint ptRightTop = VTToEdit(CFX_FloatPoint(rect.right, rect.top)); +CPDF_Rect CFX_Edit::VTToEdit(const CPDF_Rect& rect) const { + CPDF_Point ptLeftBottom = VTToEdit(CPDF_Point(rect.left, rect.bottom)); + CPDF_Point ptRightTop = VTToEdit(CPDF_Point(rect.right, rect.top)); - return CFX_FloatRect(ptLeftBottom.x, ptLeftBottom.y, ptRightTop.x, - ptRightTop.y); + return CPDF_Rect(ptLeftBottom.x, ptLeftBottom.y, ptRightTop.x, ptRightTop.y); } -CFX_FloatRect CFX_Edit::EditToVT(const CFX_FloatRect& rect) const { - CFX_FloatPoint ptLeftBottom = - EditToVT(CFX_FloatPoint(rect.left, rect.bottom)); - CFX_FloatPoint ptRightTop = EditToVT(CFX_FloatPoint(rect.right, rect.top)); +CPDF_Rect CFX_Edit::EditToVT(const CPDF_Rect& rect) const { + CPDF_Point ptLeftBottom = EditToVT(CPDF_Point(rect.left, rect.bottom)); + CPDF_Point ptRightTop = EditToVT(CPDF_Point(rect.right, rect.top)); - return CFX_FloatRect(ptLeftBottom.x, ptLeftBottom.y, ptRightTop.x, - ptRightTop.y); + return CPDF_Rect(ptLeftBottom.x, ptLeftBottom.y, ptRightTop.x, ptRightTop.y); } void CFX_Edit::SetScrollInfo() { if (m_bNotify && m_pNotify) { - CFX_FloatRect rcPlate = m_pVT->GetPlateRect(); - CFX_FloatRect rcContent = m_pVT->GetContentRect(); + CPDF_Rect rcPlate = m_pVT->GetPlateRect(); + CPDF_Rect rcContent = m_pVT->GetContentRect(); if (!m_bNotifyFlag) { m_bNotifyFlag = TRUE; @@ -1872,21 +1868,21 @@ void CFX_Edit::SetScrollPosY(FX_FLOAT fy) { } } -void CFX_Edit::SetScrollPos(const CFX_FloatPoint& point) { +void CFX_Edit::SetScrollPos(const CPDF_Point& point) { SetScrollPosX(point.x); SetScrollPosY(point.y); SetScrollLimit(); SetCaretInfo(); } -CFX_FloatPoint CFX_Edit::GetScrollPos() const { +CPDF_Point CFX_Edit::GetScrollPos() const { return m_ptScrollPos; } void CFX_Edit::SetScrollLimit() { if (m_pVT->IsValid()) { - CFX_FloatRect rcContent = m_pVT->GetContentRect(); - CFX_FloatRect rcPlate = m_pVT->GetPlateRect(); + CPDF_Rect rcContent = m_pVT->GetContentRect(); + CPDF_Rect rcPlate = m_pVT->GetPlateRect(); if (rcPlate.Width() > rcContent.Width()) { SetScrollPosX(rcPlate.left); @@ -1916,8 +1912,8 @@ void CFX_Edit::ScrollToCaret() { SetScrollLimit(); if (m_pVT->IsValid()) { - CFX_FloatPoint ptHead(0, 0); - CFX_FloatPoint ptFoot(0, 0); + CPDF_Point ptHead(0, 0); + CPDF_Point ptFoot(0, 0); if (IPDF_VariableText_Iterator* pIterator = m_pVT->GetIterator()) { pIterator->SetAt(m_wpCaret); @@ -1937,10 +1933,10 @@ void CFX_Edit::ScrollToCaret() { } } - CFX_FloatPoint ptHeadEdit = VTToEdit(ptHead); - CFX_FloatPoint ptFootEdit = VTToEdit(ptFoot); + CPDF_Point ptHeadEdit = VTToEdit(ptHead); + CPDF_Point ptFootEdit = VTToEdit(ptFoot); - CFX_FloatRect rcPlate = m_pVT->GetPlateRect(); + CPDF_Rect rcPlate = m_pVT->GetPlateRect(); if (!FX_EDIT_IsFloatEqual(rcPlate.left, rcPlate.right)) { if (FX_EDIT_IsFloatSmaller(ptHeadEdit.x, rcPlate.left) || @@ -2007,10 +2003,10 @@ void CFX_Edit::RefreshPushLineRects(const CPVT_WordRange& wr) { if (lineinfo.lineplace.LineCmp(wpEnd) > 0) break; - CFX_FloatRect rcLine(lineinfo.ptLine.x, - lineinfo.ptLine.y + lineinfo.fLineDescent, - lineinfo.ptLine.x + lineinfo.fLineWidth, - lineinfo.ptLine.y + lineinfo.fLineAscent); + CPDF_Rect rcLine(lineinfo.ptLine.x, + lineinfo.ptLine.y + lineinfo.fLineDescent, + lineinfo.ptLine.x + lineinfo.fLineWidth, + lineinfo.ptLine.y + lineinfo.fLineAscent); m_Refresh.Push(CPVT_WordRange(lineinfo.lineplace, lineinfo.lineEnd), VTToEdit(rcLine)); @@ -2042,17 +2038,17 @@ void CFX_Edit::RefreshPushRandomRects(const CPVT_WordRange& wr) { if (place.LineCmp(wrTemp.BeginPos) == 0 || place.LineCmp(wrTemp.EndPos) == 0) { - CFX_FloatRect rcWord(wordinfo.ptWord.x, - lineinfo.ptLine.y + lineinfo.fLineDescent, - wordinfo.ptWord.x + wordinfo.fWidth, - lineinfo.ptLine.y + lineinfo.fLineAscent); + CPDF_Rect rcWord(wordinfo.ptWord.x, + lineinfo.ptLine.y + lineinfo.fLineDescent, + wordinfo.ptWord.x + wordinfo.fWidth, + lineinfo.ptLine.y + lineinfo.fLineAscent); m_Refresh.AddRefresh(VTToEdit(rcWord)); } else { - CFX_FloatRect rcLine(lineinfo.ptLine.x, - lineinfo.ptLine.y + lineinfo.fLineDescent, - lineinfo.ptLine.x + lineinfo.fLineWidth, - lineinfo.ptLine.y + lineinfo.fLineAscent); + CPDF_Rect rcLine(lineinfo.ptLine.x, + lineinfo.ptLine.y + lineinfo.fLineDescent, + lineinfo.ptLine.x + lineinfo.fLineWidth, + lineinfo.ptLine.y + lineinfo.fLineAscent); m_Refresh.AddRefresh(VTToEdit(rcLine)); @@ -2085,29 +2081,29 @@ void CFX_Edit::RefreshWordRange(const CPVT_WordRange& wr) { if (place.LineCmp(wrTemp.BeginPos) == 0 || place.LineCmp(wrTemp.EndPos) == 0) { - CFX_FloatRect rcWord(wordinfo.ptWord.x, - lineinfo.ptLine.y + lineinfo.fLineDescent, - wordinfo.ptWord.x + wordinfo.fWidth, - lineinfo.ptLine.y + lineinfo.fLineAscent); + CPDF_Rect rcWord(wordinfo.ptWord.x, + lineinfo.ptLine.y + lineinfo.fLineDescent, + wordinfo.ptWord.x + wordinfo.fWidth, + lineinfo.ptLine.y + lineinfo.fLineAscent); if (m_bNotify && m_pNotify) { if (!m_bNotifyFlag) { m_bNotifyFlag = TRUE; - CFX_FloatRect rcRefresh = VTToEdit(rcWord); + CPDF_Rect rcRefresh = VTToEdit(rcWord); m_pNotify->IOnInvalidateRect(&rcRefresh); m_bNotifyFlag = FALSE; } } } else { - CFX_FloatRect rcLine(lineinfo.ptLine.x, - lineinfo.ptLine.y + lineinfo.fLineDescent, - lineinfo.ptLine.x + lineinfo.fLineWidth, - lineinfo.ptLine.y + lineinfo.fLineAscent); + CPDF_Rect rcLine(lineinfo.ptLine.x, + lineinfo.ptLine.y + lineinfo.fLineDescent, + lineinfo.ptLine.x + lineinfo.fLineWidth, + lineinfo.ptLine.y + lineinfo.fLineAscent); if (m_bNotify && m_pNotify) { if (!m_bNotifyFlag) { m_bNotifyFlag = TRUE; - CFX_FloatRect rcRefresh = VTToEdit(rcLine); + CPDF_Rect rcRefresh = VTToEdit(rcLine); m_pNotify->IOnInvalidateRect(&rcRefresh); m_bNotifyFlag = FALSE; } @@ -2127,7 +2123,7 @@ void CFX_Edit::SetCaret(const CPVT_WordPlace& place) { void CFX_Edit::SetCaretInfo() { if (m_bNotify && m_pNotify) { if (!m_bNotifyFlag) { - CFX_FloatPoint ptHead(0.0f, 0.0f), ptFoot(0.0f, 0.0f); + CPDF_Point ptHead(0.0f, 0.0f), ptFoot(0.0f, 0.0f); if (IPDF_VariableText_Iterator* pIterator = m_pVT->GetIterator()) { pIterator->SetAt(m_wpCaret); @@ -2199,7 +2195,7 @@ void CFX_Edit::SetCaret(int32_t nPos) { } } -void CFX_Edit::OnMouseDown(const CFX_FloatPoint& point, +void CFX_Edit::OnMouseDown(const CPDF_Point& point, FX_BOOL bShift, FX_BOOL bCtrl) { if (m_pVT->IsValid()) { @@ -2213,7 +2209,7 @@ void CFX_Edit::OnMouseDown(const CFX_FloatPoint& point, } } -void CFX_Edit::OnMouseMove(const CFX_FloatPoint& point, +void CFX_Edit::OnMouseMove(const CPDF_Point& point, FX_BOOL bShift, FX_BOOL bCtrl) { if (m_pVT->IsValid()) { @@ -2857,8 +2853,8 @@ FX_BOOL CFX_Edit::IsTextFull() const { FX_BOOL CFX_Edit::IsTextOverflow() const { if (!m_bEnableScroll && !m_bEnableOverflow) { - CFX_FloatRect rcPlate = m_pVT->GetPlateRect(); - CFX_FloatRect rcContent = m_pVT->GetContentRect(); + CPDF_Rect rcPlate = m_pVT->GetPlateRect(); + CPDF_Rect rcContent = m_pVT->GetContentRect(); if (m_pVT->IsMultiLine() && GetTotalLines() > 1) { if (FX_EDIT_IsFloatBigger(rcContent.Height(), rcPlate.Height())) diff --git a/fpdfsdk/src/fxedit/fxet_list.cpp b/fpdfsdk/src/fxedit/fxet_list.cpp index 313cc481b3..4e8ae0cb8e 100644 --- a/fpdfsdk/src/fxedit/fxet_list.cpp +++ b/fpdfsdk/src/fxedit/fxet_list.cpp @@ -155,11 +155,11 @@ int32_t CFX_List::GetCount() const { return m_aListItems.GetSize(); } -CFX_FloatRect CFX_List::GetPlateRect() const { +CPDF_Rect CFX_List::GetPlateRect() const { return CFX_ListContainer::GetPlateRect(); } -CFX_FloatRect CFX_List::GetContentRect() const { +CPDF_Rect CFX_List::GetContentRect() const { return InnerToOuter(CFX_ListContainer::GetContentRect()); } @@ -167,8 +167,8 @@ FX_FLOAT CFX_List::GetFontSize() const { return m_fFontSize; } -int32_t CFX_List::GetItemIndex(const CFX_FloatPoint& point) const { - CFX_FloatPoint pt = OuterToInner(point); +int32_t CFX_List::GetItemIndex(const CPDF_Point& point) const { + CPDF_Point pt = OuterToInner(point); FX_BOOL bFirst = TRUE; FX_BOOL bLast = TRUE; @@ -250,15 +250,15 @@ int32_t CFX_List::FindNext(int32_t nIndex, FX_WCHAR nChar) const { return nCircleIndex; } -CFX_FloatRect CFX_List::GetItemRect(int32_t nIndex) const { +CPDF_Rect CFX_List::GetItemRect(int32_t nIndex) const { if (CFX_ListItem* pListItem = m_aListItems.GetAt(nIndex)) { - CFX_FloatRect rcItem = pListItem->GetRect(); + CPDF_Rect rcItem = pListItem->GetRect(); rcItem.left = 0.0f; rcItem.right = GetPlateRect().Width(); return InnerToOuter(rcItem); } - return CFX_FloatRect(); + return CPDF_Rect(); } FX_BOOL CFX_List::IsItemSelected(int32_t nIndex) const { @@ -423,37 +423,35 @@ void CFX_ListCtrl::SetNotify(IFX_List_Notify* pNotify) { m_pNotify = pNotify; } -CFX_FloatPoint CFX_ListCtrl::InToOut(const CFX_FloatPoint& point) const { - CFX_FloatRect rcPlate = GetPlateRect(); +CPDF_Point CFX_ListCtrl::InToOut(const CPDF_Point& point) const { + CPDF_Rect rcPlate = GetPlateRect(); - return CFX_FloatPoint(point.x - (m_ptScrollPos.x - rcPlate.left), - point.y - (m_ptScrollPos.y - rcPlate.top)); + return CPDF_Point(point.x - (m_ptScrollPos.x - rcPlate.left), + point.y - (m_ptScrollPos.y - rcPlate.top)); } -CFX_FloatPoint CFX_ListCtrl::OutToIn(const CFX_FloatPoint& point) const { - CFX_FloatRect rcPlate = GetPlateRect(); +CPDF_Point CFX_ListCtrl::OutToIn(const CPDF_Point& point) const { + CPDF_Rect rcPlate = GetPlateRect(); - return CFX_FloatPoint(point.x + (m_ptScrollPos.x - rcPlate.left), - point.y + (m_ptScrollPos.y - rcPlate.top)); + return CPDF_Point(point.x + (m_ptScrollPos.x - rcPlate.left), + point.y + (m_ptScrollPos.y - rcPlate.top)); } -CFX_FloatRect CFX_ListCtrl::InToOut(const CFX_FloatRect& rect) const { - CFX_FloatPoint ptLeftBottom = InToOut(CFX_FloatPoint(rect.left, rect.bottom)); - CFX_FloatPoint ptRightTop = InToOut(CFX_FloatPoint(rect.right, rect.top)); +CPDF_Rect CFX_ListCtrl::InToOut(const CPDF_Rect& rect) const { + CPDF_Point ptLeftBottom = InToOut(CPDF_Point(rect.left, rect.bottom)); + CPDF_Point ptRightTop = InToOut(CPDF_Point(rect.right, rect.top)); - return CFX_FloatRect(ptLeftBottom.x, ptLeftBottom.y, ptRightTop.x, - ptRightTop.y); + return CPDF_Rect(ptLeftBottom.x, ptLeftBottom.y, ptRightTop.x, ptRightTop.y); } -CFX_FloatRect CFX_ListCtrl::OutToIn(const CFX_FloatRect& rect) const { - CFX_FloatPoint ptLeftBottom = OutToIn(CFX_FloatPoint(rect.left, rect.bottom)); - CFX_FloatPoint ptRightTop = OutToIn(CFX_FloatPoint(rect.right, rect.top)); +CPDF_Rect CFX_ListCtrl::OutToIn(const CPDF_Rect& rect) const { + CPDF_Point ptLeftBottom = OutToIn(CPDF_Point(rect.left, rect.bottom)); + CPDF_Point ptRightTop = OutToIn(CPDF_Point(rect.right, rect.top)); - return CFX_FloatRect(ptLeftBottom.x, ptLeftBottom.y, ptRightTop.x, - ptRightTop.y); + return CPDF_Rect(ptLeftBottom.x, ptLeftBottom.y, ptRightTop.x, ptRightTop.y); } -void CFX_ListCtrl::OnMouseDown(const CFX_FloatPoint& point, +void CFX_ListCtrl::OnMouseDown(const CPDF_Point& point, FX_BOOL bShift, FX_BOOL bCtrl) { int32_t nHitIndex = GetItemIndex(point); @@ -492,7 +490,7 @@ void CFX_ListCtrl::OnMouseDown(const CFX_FloatPoint& point, ScrollToListItem(nHitIndex); } -void CFX_ListCtrl::OnMouseMove(const CFX_FloatPoint& point, +void CFX_ListCtrl::OnMouseMove(const CPDF_Point& point, FX_BOOL bShift, FX_BOOL bCtrl) { int32_t nHitIndex = GetItemIndex(point); @@ -580,15 +578,15 @@ FX_BOOL CFX_ListCtrl::OnChar(FX_WORD nChar, FX_BOOL bShift, FX_BOOL bCtrl) { return FALSE; } -void CFX_ListCtrl::SetPlateRect(const CFX_FloatRect& rect) { +void CFX_ListCtrl::SetPlateRect(const CPDF_Rect& rect) { CFX_ListContainer::SetPlateRect(rect); m_ptScrollPos.x = rect.left; - SetScrollPos(CFX_FloatPoint(rect.left, rect.top)); + SetScrollPos(CPDF_Point(rect.left, rect.top)); ReArrange(0); InvalidateItem(-1); } -CFX_FloatRect CFX_ListCtrl::GetItemRect(int32_t nIndex) const { +CPDF_Rect CFX_ListCtrl::GetItemRect(int32_t nIndex) const { return InToOut(CFX_List::GetItemRect(nIndex)); } @@ -652,14 +650,14 @@ void CFX_ListCtrl::InvalidateItem(int32_t nItemIndex) { if (nItemIndex == -1) { if (!m_bNotifyFlag) { m_bNotifyFlag = TRUE; - CFX_FloatRect rcRefresh = GetPlateRect(); + CPDF_Rect rcRefresh = GetPlateRect(); m_pNotify->IOnInvalidateRect(&rcRefresh); m_bNotifyFlag = FALSE; } } else { if (!m_bNotifyFlag) { m_bNotifyFlag = TRUE; - CFX_FloatRect rcRefresh = GetItemRect(nItemIndex); + CPDF_Rect rcRefresh = GetItemRect(nItemIndex); rcRefresh.left -= 1.0f; rcRefresh.right += 1.0f; rcRefresh.bottom -= 1.0f; @@ -703,8 +701,8 @@ void CFX_ListCtrl::Select(int32_t nItemIndex) { } FX_BOOL CFX_ListCtrl::IsItemVisible(int32_t nItemIndex) const { - CFX_FloatRect rcPlate = GetPlateRect(); - CFX_FloatRect rcItem = GetItemRect(nItemIndex); + CPDF_Rect rcPlate = GetPlateRect(); + CPDF_Rect rcItem = GetItemRect(nItemIndex); return rcItem.bottom >= rcPlate.bottom && rcItem.top <= rcPlate.top; } @@ -713,9 +711,9 @@ void CFX_ListCtrl::ScrollToListItem(int32_t nItemIndex) { if (!IsValid(nItemIndex)) return; - CFX_FloatRect rcPlate = GetPlateRect(); - CFX_FloatRect rcItem = CFX_List::GetItemRect(nItemIndex); - CFX_FloatRect rcItemCtrl = GetItemRect(nItemIndex); + CPDF_Rect rcPlate = GetPlateRect(); + CPDF_Rect rcItem = CFX_List::GetItemRect(nItemIndex); + CPDF_Rect rcItemCtrl = GetItemRect(nItemIndex); if (FX_EDIT_IsFloatSmaller(rcItemCtrl.bottom, rcPlate.bottom)) { if (FX_EDIT_IsFloatSmaller(rcItemCtrl.top, rcPlate.top)) { @@ -730,8 +728,8 @@ void CFX_ListCtrl::ScrollToListItem(int32_t nItemIndex) { void CFX_ListCtrl::SetScrollInfo() { if (m_pNotify) { - CFX_FloatRect rcPlate = GetPlateRect(); - CFX_FloatRect rcContent = CFX_List::GetContentRect(); + CPDF_Rect rcPlate = GetPlateRect(); + CPDF_Rect rcContent = CFX_List::GetContentRect(); if (!m_bNotifyFlag) { m_bNotifyFlag = TRUE; @@ -743,14 +741,14 @@ void CFX_ListCtrl::SetScrollInfo() { } } -void CFX_ListCtrl::SetScrollPos(const CFX_FloatPoint& point) { +void CFX_ListCtrl::SetScrollPos(const CPDF_Point& point) { SetScrollPosY(point.y); } void CFX_ListCtrl::SetScrollPosY(FX_FLOAT fy) { if (!FX_EDIT_IsFloatEqual(m_ptScrollPos.y, fy)) { - CFX_FloatRect rcPlate = GetPlateRect(); - CFX_FloatRect rcContent = CFX_List::GetContentRect(); + CPDF_Rect rcPlate = GetPlateRect(); + CPDF_Rect rcContent = CFX_List::GetContentRect(); if (rcPlate.Height() > rcContent.Height()) { fy = rcPlate.top; @@ -775,7 +773,7 @@ void CFX_ListCtrl::SetScrollPosY(FX_FLOAT fy) { } } -CFX_FloatRect CFX_ListCtrl::GetContentRect() const { +CPDF_Rect CFX_ListCtrl::GetContentRect() const { return InToOut(CFX_List::GetContentRect()); } @@ -787,7 +785,7 @@ void CFX_ListCtrl::ReArrange(int32_t nItemIndex) { void CFX_ListCtrl::SetTopItem(int32_t nIndex) { if (IsValid(nIndex)) { GetPlateRect(); - CFX_FloatRect rcItem = CFX_List::GetItemRect(nIndex); + CPDF_Rect rcItem = CFX_List::GetItemRect(nIndex); SetScrollPosY(rcItem.top); } } @@ -810,7 +808,7 @@ void CFX_ListCtrl::Cancel() { m_aSelItems.DeselectAll(); } -int32_t CFX_ListCtrl::GetItemIndex(const CFX_FloatPoint& point) const { +int32_t CFX_ListCtrl::GetItemIndex(const CPDF_Point& point) const { return CFX_List::GetItemIndex(OutToIn(point)); } diff --git a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp index 752e537099..ed96b96654 100644 --- a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp +++ b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp @@ -13,22 +13,22 @@ #define FX_EDIT_UNDERLINEHALFWIDTH 0.5f #define FX_EDIT_CROSSOUTHALFWIDTH 0.5f -CFX_FloatRect GetUnderLineRect(const CPVT_Word& word) { - return CFX_FloatRect(word.ptWord.x, word.ptWord.y + word.fDescent * 0.5f, - word.ptWord.x + word.fWidth, - word.ptWord.y + word.fDescent * 0.25f); +CPDF_Rect GetUnderLineRect(const CPVT_Word& word) { + return CPDF_Rect(word.ptWord.x, word.ptWord.y + word.fDescent * 0.5f, + word.ptWord.x + word.fWidth, + word.ptWord.y + word.fDescent * 0.25f); } -CFX_FloatRect GetCrossoutRect(const CPVT_Word& word) { - return CFX_FloatRect(word.ptWord.x, - word.ptWord.y + (word.fAscent + word.fDescent) * 0.5f + - word.fDescent * 0.25f, - word.ptWord.x + word.fWidth, - word.ptWord.y + (word.fAscent + word.fDescent) * 0.5f); +CPDF_Rect GetCrossoutRect(const CPVT_Word& word) { + return CPDF_Rect(word.ptWord.x, + word.ptWord.y + (word.fAscent + word.fDescent) * 0.5f + + word.fDescent * 0.25f, + word.ptWord.x + word.fWidth, + word.ptWord.y + (word.fAscent + word.fDescent) * 0.5f); } static void DrawTextString(CFX_RenderDevice* pDevice, - const CFX_FloatPoint& pt, + const CPDF_Point& pt, CPDF_Font* pFont, FX_FLOAT fFontSize, CFX_Matrix* pUser2Device, @@ -49,7 +49,7 @@ static void DrawTextString(CFX_RenderDevice* pDevice, ro.m_ColorMode = RENDER_COLOR_NORMAL; if (crTextStroke != 0) { - CFX_FloatPoint pt1(0, 0), pt2(1, 0); + CPDF_Point pt1(0, 0), pt2(1, 0); pUser2Device->Transform(pt1.x, pt1.y); pUser2Device->Transform(pt2.x, pt2.y); CFX_GraphStateData gsd; @@ -69,7 +69,7 @@ static void DrawTextString(CFX_RenderDevice* pDevice, ro.m_ColorMode = RENDER_COLOR_NORMAL; if (crTextStroke != 0) { - CFX_FloatPoint pt1(0, 0), pt2(1, 0); + CPDF_Point pt1(0, 0), pt2(1, 0); pUser2Device->Transform(pt1.x, pt1.y); pUser2Device->Transform(pt2.x, pt2.y); CFX_GraphStateData gsd; @@ -92,13 +92,13 @@ void IFX_Edit::DrawUnderline(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF color, - const CFX_FloatRect& rcClip, - const CFX_FloatPoint& ptOffset, + const CPDF_Rect& rcClip, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange) { pDevice->SaveState(); if (!rcClip.IsEmpty()) { - CFX_FloatRect rcTemp = rcClip; + CPDF_Rect rcTemp = rcClip; pUser2Device->TransformRect(rcTemp); FX_RECT rcDevClip; rcDevClip.left = (int32_t)rcTemp.left; @@ -123,7 +123,7 @@ void IFX_Edit::DrawUnderline(CFX_RenderDevice* pDevice, CPVT_Word word; if (pIterator->GetWord(word)) { CFX_PathData pathUnderline; - CFX_FloatRect rcUnderline = GetUnderLineRect(word); + CPDF_Rect rcUnderline = GetUnderLineRect(word); rcUnderline.left += ptOffset.x; rcUnderline.right += ptOffset.x; rcUnderline.top += ptOffset.y; @@ -146,8 +146,8 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, IFX_Edit* pEdit, FX_COLORREF crTextFill, FX_COLORREF crTextStroke, - const CFX_FloatRect& rcClip, - const CFX_FloatPoint& ptOffset, + const CPDF_Rect& rcClip, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, IFX_SystemHandler* pSystemHandler, void* pFFLData) { @@ -169,12 +169,12 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, CFX_ByteTextBuf sTextBuf; int32_t nFontIndex = -1; - CFX_FloatPoint ptBT(0.0f, 0.0f); + CPDF_Point ptBT(0.0f, 0.0f); pDevice->SaveState(); if (!rcClip.IsEmpty()) { - CFX_FloatRect rcTemp = rcClip; + CPDF_Rect rcTemp = rcClip; pUser2Device->TransformRect(rcTemp); FX_RECT rcDevClip; rcDevClip.left = (int32_t)rcTemp.left; @@ -218,9 +218,9 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, pIterator->GetLine(line); if (pSystemHandler && pSystemHandler->IsSelectionImplemented()) { - CFX_FloatRect rc(word.ptWord.x, line.ptLine.y + line.fLineDescent, - word.ptWord.x + word.fWidth, - line.ptLine.y + line.fLineAscent); + CPDF_Rect rc(word.ptWord.x, line.ptLine.y + line.fLineDescent, + word.ptWord.x + word.fWidth, + line.ptLine.y + line.fLineAscent); rc.Intersect(rcClip); pSystemHandler->OutputSelectedRect(pFFLData, rc); } else { @@ -239,8 +239,8 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, if (place.LineCmp(oldplace) != 0 || word.nFontIndex != nFontIndex || crOldFill != crCurFill) { if (sTextBuf.GetLength() > 0) { - DrawTextString(pDevice, CFX_FloatPoint(ptBT.x + ptOffset.x, - ptBT.y + ptOffset.y), + DrawTextString(pDevice, CPDF_Point(ptBT.x + ptOffset.x, + ptBT.y + ptOffset.y), pFontMap->GetPDFFont(nFontIndex), fFontSize, pUser2Device, sTextBuf.GetByteString(), crOldFill, crTextStroke, nHorzScale); @@ -256,8 +256,8 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, SubWord); } else { DrawTextString( - pDevice, CFX_FloatPoint(word.ptWord.x + ptOffset.x, - word.ptWord.y + ptOffset.y), + pDevice, CPDF_Point(word.ptWord.x + ptOffset.x, + word.ptWord.y + ptOffset.y), pFontMap->GetPDFFont(word.nFontIndex), fFontSize, pUser2Device, GetPDFWordString(pFontMap, word.nFontIndex, word.Word, SubWord), crCurFill, crTextStroke, nHorzScale); @@ -268,7 +268,7 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, if (sTextBuf.GetLength() > 0) { DrawTextString( - pDevice, CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), + pDevice, CPDF_Point(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), pFontMap->GetPDFFont(nFontIndex), fFontSize, pUser2Device, sTextBuf.GetByteString(), crOldFill, crTextStroke, nHorzScale); } @@ -281,8 +281,8 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, IFX_Edit* pEdit, - const CFX_FloatRect& rcClip, - const CFX_FloatPoint& ptOffset, + const CPDF_Rect& rcClip, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange) { CPVT_WordRange wrSelect = pEdit->GetSelectWordRange(); @@ -294,12 +294,12 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, CFX_ByteTextBuf sTextBuf; CPVT_WordProps wp; - CFX_FloatPoint ptBT(0.0f, 0.0f); + CPDF_Point ptBT(0.0f, 0.0f); pDevice->SaveState(); if (!rcClip.IsEmpty()) { - CFX_FloatRect rcTemp = rcClip; + CPDF_Rect rcTemp = rcClip; pUser2Device->TransformRect(rcTemp); FX_RECT rcDevClip; rcDevClip.left = (int32_t)rcTemp.left; @@ -357,11 +357,11 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, FXSYS_memcmp(&word.WordProps, &wp, sizeof(CPVT_WordProps)) != 0 || crOld != crCurText) { if (sTextBuf.GetLength() > 0) { - DrawTextString(pDevice, CFX_FloatPoint(ptBT.x + ptOffset.x, - ptBT.y + ptOffset.y), - pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, - pUser2Device, sTextBuf.GetByteString(), crOld, 0, - wp.nHorzScale); + DrawTextString( + pDevice, CPDF_Point(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), + pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, + pUser2Device, sTextBuf.GetByteString(), crOld, 0, + wp.nHorzScale); sTextBuf.Clear(); } @@ -375,7 +375,7 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, if (word.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) { CFX_PathData pathUnderline; - CFX_FloatRect rcUnderline = GetUnderLineRect(word); + CPDF_Rect rcUnderline = GetUnderLineRect(word); pathUnderline.AppendRect(rcUnderline.left, rcUnderline.bottom, rcUnderline.right, rcUnderline.top); @@ -385,7 +385,7 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, if (word.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) { CFX_PathData pathCrossout; - CFX_FloatRect rcCrossout = GetCrossoutRect(word); + CPDF_Rect rcCrossout = GetCrossoutRect(word); pathCrossout.AppendRect(rcCrossout.left, rcCrossout.bottom, rcCrossout.right, rcCrossout.top); @@ -399,7 +399,7 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, if (sTextBuf.GetLength() > 0) { DrawTextString( - pDevice, CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), + pDevice, CPDF_Point(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, pUser2Device, sTextBuf.GetByteString(), crOld, 0, wp.nHorzScale); } @@ -411,7 +411,7 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, static void AddRectToPageObjects(CPDF_PageObjectHolder* pObjectHolder, FX_COLORREF crFill, - const CFX_FloatRect& rcFill) { + const CPDF_Rect& rcFill) { std::unique_ptr<CPDF_PathObject> pPathObj(new CPDF_PathObject); CFX_PathData* pPathData = pPathObj->m_Path.GetModify(); pPathData->AppendRect(rcFill.left, rcFill.bottom, rcFill.right, rcFill.top); @@ -435,7 +435,7 @@ static CPDF_TextObject* AddTextObjToPageObjects( FX_FLOAT fFontSize, FX_FLOAT fCharSpace, int32_t nHorzScale, - const CFX_FloatPoint& point, + const CPDF_Point& point, const CFX_ByteString& text) { std::unique_ptr<CPDF_TextObject> pTxtObj(new CPDF_TextObject); CPDF_TextStateData* pTextStateData = pTxtObj->m_TextState.GetModify(); @@ -469,7 +469,7 @@ static CPDF_TextObject* AddTextObjToPageObjects( void IFX_Edit::GeneratePageObjects( CPDF_PageObjectHolder* pObjectHolder, IFX_Edit* pEdit, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF crText, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray) { @@ -478,7 +478,7 @@ void IFX_Edit::GeneratePageObjects( int32_t nOldFontIndex = -1; CFX_ByteTextBuf sTextBuf; - CFX_FloatPoint ptBT(0.0f, 0.0f); + CPDF_Point ptBT(0.0f, 0.0f); ObjArray.RemoveAll(); @@ -504,7 +504,7 @@ void IFX_Edit::GeneratePageObjects( ObjArray.Add(AddTextObjToPageObjects( pObjectHolder, crText, pFontMap->GetPDFFont(nOldFontIndex), fFontSize, 0.0f, 100, - CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), + CPDF_Point(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), sTextBuf.GetByteString())); sTextBuf.Clear(); @@ -523,7 +523,7 @@ void IFX_Edit::GeneratePageObjects( ObjArray.Add(AddTextObjToPageObjects( pObjectHolder, crText, pFontMap->GetPDFFont(nOldFontIndex), fFontSize, 0.0f, 100, - CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), + CPDF_Point(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), sTextBuf.GetByteString())); } } @@ -533,7 +533,7 @@ void IFX_Edit::GeneratePageObjects( void IFX_Edit::GenerateRichPageObjects( CPDF_PageObjectHolder* pObjectHolder, IFX_Edit* pEdit, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray) { FX_COLORREF crCurText = ArgbEncode(255, 0, 0, 0); @@ -541,7 +541,7 @@ void IFX_Edit::GenerateRichPageObjects( CFX_ByteTextBuf sTextBuf; CPVT_WordProps wp; - CFX_FloatPoint ptBT(0.0f, 0.0f); + CPDF_Point ptBT(0.0f, 0.0f); ObjArray.RemoveAll(); @@ -574,7 +574,7 @@ void IFX_Edit::GenerateRichPageObjects( ObjArray.Add(AddTextObjToPageObjects( pObjectHolder, crOld, pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, wp.fCharSpace, wp.nHorzScale, - CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), + CPDF_Point(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), sTextBuf.GetByteString())); sTextBuf.Clear(); @@ -589,7 +589,7 @@ void IFX_Edit::GenerateRichPageObjects( word.Word, 0); if (word.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) { - CFX_FloatRect rcUnderline = GetUnderLineRect(word); + CPDF_Rect rcUnderline = GetUnderLineRect(word); rcUnderline.left += ptOffset.x; rcUnderline.right += ptOffset.x; rcUnderline.top += ptOffset.y; @@ -599,7 +599,7 @@ void IFX_Edit::GenerateRichPageObjects( } if (word.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) { - CFX_FloatRect rcCrossout = GetCrossoutRect(word); + CPDF_Rect rcCrossout = GetCrossoutRect(word); rcCrossout.left += ptOffset.x; rcCrossout.right += ptOffset.x; rcCrossout.top += ptOffset.y; @@ -616,7 +616,7 @@ void IFX_Edit::GenerateRichPageObjects( ObjArray.Add(AddTextObjToPageObjects( pObjectHolder, crOld, pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, wp.fCharSpace, wp.nHorzScale, - CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), + CPDF_Point(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), sTextBuf.GetByteString())); } } @@ -625,7 +625,7 @@ void IFX_Edit::GenerateRichPageObjects( void IFX_Edit::GenerateUnderlineObjects(CPDF_PageObjectHolder* pObjectHolder, IFX_Edit* pEdit, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF color) { if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator()) { @@ -644,7 +644,7 @@ void IFX_Edit::GenerateUnderlineObjects(CPDF_PageObjectHolder* pObjectHolder, CPVT_Word word; if (pIterator->GetWord(word)) { - CFX_FloatRect rcUnderline = GetUnderLineRect(word); + CPDF_Rect rcUnderline = GetUnderLineRect(word); rcUnderline.left += ptOffset.x; rcUnderline.right += ptOffset.x; rcUnderline.top += ptOffset.y; diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp index 8b2b315ae8..c49524d02f 100644 --- a/fpdfsdk/src/javascript/Document.cpp +++ b/fpdfsdk/src/javascript/Document.cpp @@ -494,7 +494,7 @@ FX_BOOL Document::removeField(IJS_Context* cc, return TRUE; for (CPDFSDK_Widget* pWidget : widgets) { - CFX_FloatRect rcAnnot = pWidget->GetRect(); + CPDF_Rect rcAnnot = pWidget->GetRect(); --rcAnnot.left; --rcAnnot.bottom; ++rcAnnot.right; diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp index 9b6a7facba..82187c2453 100644 --- a/fpdfsdk/src/javascript/Field.cpp +++ b/fpdfsdk/src/javascript/Field.cpp @@ -2095,7 +2095,7 @@ FX_BOOL Field::rect(IJS_Context* cc, pArray[2] = (FX_FLOAT)Lower_Rightx.ToInt(); pArray[3] = (FX_FLOAT)Upper_Lefty.ToInt(); - CFX_FloatRect crRect(pArray); + CPDF_Rect crRect(pArray); if (m_bDelay) { AddDelay_Rect(FP_RECT, crRect); } else { @@ -2133,7 +2133,7 @@ FX_BOOL Field::rect(IJS_Context* cc, void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, - const CFX_FloatRect& rect) { + const CPDF_Rect& rect) { CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm(); std::vector<CPDF_FormField*> FieldArray = @@ -2146,13 +2146,13 @@ void Field::SetRect(CPDFSDK_Document* pDocument, ASSERT(pFormControl); if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) { - CFX_FloatRect crRect = rect; + CPDF_Rect crRect = rect; CPDF_Page* pPDFPage = pWidget->GetPDFPage(); crRect.Intersect(pPDFPage->GetPageBBox()); if (!crRect.IsEmpty()) { - CFX_FloatRect rcOld = pWidget->GetRect(); + CPDF_Rect rcOld = pWidget->GetRect(); if (crRect.left != rcOld.left || crRect.right != rcOld.right || crRect.top != rcOld.top || crRect.bottom != rcOld.bottom) { pWidget->SetRect(crRect); @@ -2170,13 +2170,13 @@ void Field::SetRect(CPDFSDK_Document* pDocument, if (CPDF_FormControl* pFormControl = pFormField->GetControl(nControlIndex)) { if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) { - CFX_FloatRect crRect = rect; + CPDF_Rect crRect = rect; CPDF_Page* pPDFPage = pWidget->GetPDFPage(); crRect.Intersect(pPDFPage->GetPageBBox()); if (!crRect.IsEmpty()) { - CFX_FloatRect rcOld = pWidget->GetRect(); + CPDF_Rect rcOld = pWidget->GetRect(); if (crRect.left != rcOld.left || crRect.right != rcOld.right || crRect.top != rcOld.top || crRect.bottom != rcOld.bottom) { pWidget->SetRect(crRect); @@ -3402,7 +3402,7 @@ void Field::AddDelay_WideString(enum FIELD_PROP prop, m_pJSDoc->AddDelayData(pNewData); } -void Field::AddDelay_Rect(enum FIELD_PROP prop, const CFX_FloatRect& rect) { +void Field::AddDelay_Rect(enum FIELD_PROP prop, const CPDF_Rect& rect) { CJS_DelayData* pNewData = new CJS_DelayData; pNewData->sFieldName = m_FieldName; pNewData->nControlIndex = m_nFormControlIndex; @@ -3592,6 +3592,6 @@ void Field::AddField(CPDFSDK_Document* pDocument, int nPageIndex, int nFieldType, const CFX_WideString& sName, - const CFX_FloatRect& rcCoords) { + const CPDF_Rect& rcCoords) { // Not supported. } diff --git a/fpdfsdk/src/javascript/Field.h b/fpdfsdk/src/javascript/Field.h index 4fba1ddfa1..21552c4ec7 100644 --- a/fpdfsdk/src/javascript/Field.h +++ b/fpdfsdk/src/javascript/Field.h @@ -81,7 +81,7 @@ struct CJS_DelayData { bool b; CFX_ByteString string; CFX_WideString widestring; - CFX_FloatRect rect; + CPDF_Rect rect; CPWL_Color color; CFX_DWordArray wordarray; CJS_WideStringArray widestringarray; @@ -390,7 +390,7 @@ class Field : public CJS_EmbedObj { static void SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, - const CFX_FloatRect& rect); + const CPDF_Rect& rect); static void SetRichText(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, @@ -435,7 +435,7 @@ class Field : public CJS_EmbedObj { int nPageIndex, int nFieldType, const CFX_WideString& sName, - const CFX_FloatRect& rcCoords); + const CPDF_Rect& rcCoords); static void UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, @@ -473,7 +473,7 @@ class Field : public CJS_EmbedObj { void AddDelay_Bool(enum FIELD_PROP prop, bool b); void AddDelay_String(enum FIELD_PROP prop, const CFX_ByteString& string); void AddDelay_WideString(enum FIELD_PROP prop, const CFX_WideString& string); - void AddDelay_Rect(enum FIELD_PROP prop, const CFX_FloatRect& rect); + void AddDelay_Rect(enum FIELD_PROP prop, const CPDF_Rect& rect); void AddDelay_Color(enum FIELD_PROP prop, const CPWL_Color& color); void AddDelay_WordArray(enum FIELD_PROP prop, const CFX_DWordArray& array); void AddDelay_WideStringArray(enum FIELD_PROP prop, diff --git a/fpdfsdk/src/pdfwindow/PWL_Button.cpp b/fpdfsdk/src/pdfwindow/PWL_Button.cpp index 2c6c36c047..5c78383380 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Button.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Button.cpp @@ -21,8 +21,7 @@ void CPWL_Button::OnCreate(PWL_CREATEPARAM& cp) { cp.eCursorType = FXCT_HAND; } -FX_BOOL CPWL_Button::OnLButtonDown(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_Button::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonDown(point, nFlag); m_bMouseDown = TRUE; @@ -31,7 +30,7 @@ FX_BOOL CPWL_Button::OnLButtonDown(const CFX_FloatPoint& point, return TRUE; } -FX_BOOL CPWL_Button::OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) { +FX_BOOL CPWL_Button::OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonUp(point, nFlag); ReleaseCapture(); diff --git a/fpdfsdk/src/pdfwindow/PWL_Caret.cpp b/fpdfsdk/src/pdfwindow/PWL_Caret.cpp index 320b2bf62f..75c951068a 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Caret.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Caret.cpp @@ -24,14 +24,14 @@ CFX_ByteString CPWL_Caret::GetClassName() const { } void CPWL_Caret::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { - GetCaretApp(sAppStream, CFX_FloatPoint(0.0f, 0.0f)); + GetCaretApp(sAppStream, CPDF_Point(0.0f, 0.0f)); } void CPWL_Caret::DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) { if (IsVisible() && m_bFlash) { - CFX_FloatRect rcRect = GetCaretRect(); - CFX_FloatRect rcClip = GetClipRect(); + CPDF_Rect rcRect = GetCaretRect(); + CPDF_Rect rcClip = GetClipRect(); CFX_PathData path; @@ -65,12 +65,12 @@ void CPWL_Caret::DrawThisAppearance(CFX_RenderDevice* pDevice, } void CPWL_Caret::GetCaretApp(CFX_ByteTextBuf& sAppStream, - const CFX_FloatPoint& ptOffset) { + const CPDF_Point& ptOffset) { if (IsVisible() && m_bFlash) { CFX_ByteTextBuf sCaret; - CFX_FloatRect rcRect = GetCaretRect(); - CFX_FloatRect rcClip = GetClipRect(); + CPDF_Rect rcRect = GetCaretRect(); + CPDF_Rect rcClip = GetClipRect(); rcRect = CPWL_Utils::OffsetRect(rcRect, ptOffset.x, ptOffset.y); rcClip = CPWL_Utils::OffsetRect(rcClip, ptOffset.x, ptOffset.y); @@ -90,7 +90,7 @@ void CPWL_Caret::GetCaretApp(CFX_ByteTextBuf& sAppStream, } CFX_ByteString CPWL_Caret::GetCaretAppearanceStream( - const CFX_FloatPoint& ptOffset) { + const CPDF_Point& ptOffset) { CFX_ByteTextBuf sCaret; GetCaretApp(sCaret, ptOffset); return sCaret.GetByteString(); @@ -105,14 +105,13 @@ void CPWL_Caret::TimerProc() { } } -CFX_FloatRect CPWL_Caret::GetCaretRect() const { - return CFX_FloatRect(m_ptFoot.x, m_ptFoot.y, m_ptHead.x + m_fWidth, - m_ptHead.y); +CPDF_Rect CPWL_Caret::GetCaretRect() const { + return CPDF_Rect(m_ptFoot.x, m_ptFoot.y, m_ptHead.x + m_fWidth, m_ptHead.y); } void CPWL_Caret::SetCaret(FX_BOOL bVisible, - const CFX_FloatPoint& ptHead, - const CFX_FloatPoint& ptFoot) { + const CPDF_Point& ptHead, + const CPDF_Point& ptFoot) { if (bVisible) { if (IsVisible()) { if (m_ptHead.x != ptHead.x || m_ptHead.y != ptHead.y || @@ -136,8 +135,8 @@ void CPWL_Caret::SetCaret(FX_BOOL bVisible, Move(m_rcInvalid, FALSE, TRUE); } } else { - m_ptHead = CFX_FloatPoint(0, 0); - m_ptFoot = CFX_FloatPoint(0, 0); + m_ptHead = CPDF_Point(0, 0); + m_ptFoot = CPDF_Point(0, 0); m_bFlash = FALSE; if (IsVisible()) { @@ -147,9 +146,9 @@ void CPWL_Caret::SetCaret(FX_BOOL bVisible, } } -void CPWL_Caret::InvalidateRect(CFX_FloatRect* pRect) { +void CPWL_Caret::InvalidateRect(CPDF_Rect* pRect) { if (pRect) { - CFX_FloatRect rcRefresh = CPWL_Utils::InflateRect(*pRect, 0.5f); + CPDF_Rect rcRefresh = CPWL_Utils::InflateRect(*pRect, 0.5f); rcRefresh.top += 1; rcRefresh.bottom -= 1; diff --git a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp index bdc6724f65..7582ae412b 100644 --- a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp @@ -20,8 +20,7 @@ #define IsFloatSmaller(fa, fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb))) #define IsFloatEqual(fa, fb) IsFloatZero((fa) - (fb)) -FX_BOOL CPWL_CBListBox::OnLButtonUp(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_CBListBox::OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonUp(point, nFlag); if (m_bMouseDown) { @@ -111,19 +110,19 @@ FX_BOOL CPWL_CBListBox::OnCharWithExit(FX_WORD nChar, void CPWL_CBButton::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { CPWL_Wnd::GetThisAppearanceStream(sAppStream); - CFX_FloatRect rectWnd = CPWL_Wnd::GetWindowRect(); + CPDF_Rect rectWnd = CPWL_Wnd::GetWindowRect(); if (IsVisible() && !rectWnd.IsEmpty()) { CFX_ByteTextBuf sButton; - CFX_FloatPoint ptCenter = GetCenterPoint(); + CPDF_Point ptCenter = GetCenterPoint(); - CFX_FloatPoint pt1(ptCenter.x - PWL_CBBUTTON_TRIANGLE_HALFLEN, - ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); - CFX_FloatPoint pt2(ptCenter.x + PWL_CBBUTTON_TRIANGLE_HALFLEN, - ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); - CFX_FloatPoint pt3(ptCenter.x, - ptCenter.y - PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); + CPDF_Point pt1(ptCenter.x - PWL_CBBUTTON_TRIANGLE_HALFLEN, + ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); + CPDF_Point pt2(ptCenter.x + PWL_CBBUTTON_TRIANGLE_HALFLEN, + ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); + CPDF_Point pt3(ptCenter.x, + ptCenter.y - PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); if (IsFloatBigger(rectWnd.right - rectWnd.left, PWL_CBBUTTON_TRIANGLE_HALFLEN * 2) && @@ -144,17 +143,17 @@ void CPWL_CBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) { CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device); - CFX_FloatRect rectWnd = CPWL_Wnd::GetWindowRect(); + CPDF_Rect rectWnd = CPWL_Wnd::GetWindowRect(); if (IsVisible() && !rectWnd.IsEmpty()) { - CFX_FloatPoint ptCenter = GetCenterPoint(); + CPDF_Point ptCenter = GetCenterPoint(); - CFX_FloatPoint pt1(ptCenter.x - PWL_CBBUTTON_TRIANGLE_HALFLEN, - ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); - CFX_FloatPoint pt2(ptCenter.x + PWL_CBBUTTON_TRIANGLE_HALFLEN, - ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); - CFX_FloatPoint pt3(ptCenter.x, - ptCenter.y - PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); + CPDF_Point pt1(ptCenter.x - PWL_CBBUTTON_TRIANGLE_HALFLEN, + ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); + CPDF_Point pt2(ptCenter.x + PWL_CBBUTTON_TRIANGLE_HALFLEN, + ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); + CPDF_Point pt3(ptCenter.x, + ptCenter.y - PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); if (IsFloatBigger(rectWnd.right - rectWnd.left, PWL_CBBUTTON_TRIANGLE_HALFLEN * 2) && @@ -176,8 +175,7 @@ void CPWL_CBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, } } -FX_BOOL CPWL_CBButton::OnLButtonDown(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_CBButton::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonDown(point, nFlag); SetCapture(); @@ -190,8 +188,7 @@ FX_BOOL CPWL_CBButton::OnLButtonDown(const CFX_FloatPoint& point, return TRUE; } -FX_BOOL CPWL_CBButton::OnLButtonUp(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_CBButton::OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonUp(point, nFlag); ReleaseCapture(); @@ -300,7 +297,7 @@ void CPWL_ComboBox::CreateEdit(const PWL_CREATEPARAM& cp) { if (!HasFlag(PCBS_ALLOWCUSTOMTEXT)) ecp.dwFlags |= PWS_READONLY; - ecp.rcRectWnd = CFX_FloatRect(0, 0, 0, 0); + ecp.rcRectWnd = CPDF_Rect(0, 0, 0, 0); ecp.dwBorderWidth = 0; ecp.nBorderStyle = PBS_SOLID; @@ -336,7 +333,7 @@ void CPWL_ComboBox::CreateListBox(const PWL_CREATEPARAM& cp) { lcp.nBorderStyle = PBS_SOLID; lcp.dwBorderWidth = 1; lcp.eCursorType = FXCT_ARROW; - lcp.rcRectWnd = CFX_FloatRect(0, 0, 0, 0); + lcp.rcRectWnd = CPDF_Rect(0, 0, 0, 0); if (cp.dwFlags & PWS_AUTOFONTSIZE) lcp.fFontSize = PWLCB_DEFAULTFONTSIZE; @@ -354,13 +351,13 @@ void CPWL_ComboBox::CreateListBox(const PWL_CREATEPARAM& cp) { } void CPWL_ComboBox::RePosChildWnd() { - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); if (m_bPopup) { - CFX_FloatRect rclient = GetClientRect(); - CFX_FloatRect rcButton = rclient; - CFX_FloatRect rcEdit = rcClient; - CFX_FloatRect rcList = CPWL_Wnd::GetWindowRect(); + CPDF_Rect rclient = GetClientRect(); + CPDF_Rect rcButton = rclient; + CPDF_Rect rcEdit = rcClient; + CPDF_Rect rcList = CPWL_Wnd::GetWindowRect(); FX_FLOAT fOldWindowHeight = m_rcOldWindow.Height(); FX_FLOAT fOldClientHeight = fOldWindowHeight - GetBorderWidth() * 2; @@ -422,7 +419,7 @@ void CPWL_ComboBox::RePosChildWnd() { m_pList->ScrollToListItem(m_nSelectItem); } } else { - CFX_FloatRect rcButton = rcClient; + CPDF_Rect rcButton = rcClient; rcButton.left = rcButton.right - PWL_COMBOBOX_BUTTON_WIDTH; @@ -432,7 +429,7 @@ void CPWL_ComboBox::RePosChildWnd() { if (m_pButton) m_pButton->Move(rcButton, TRUE, FALSE); - CFX_FloatRect rcEdit = rcClient; + CPDF_Rect rcEdit = rcClient; rcEdit.right = rcButton.left - 1.0f; if (rcEdit.left < rcClient.left) @@ -454,8 +451,8 @@ void CPWL_ComboBox::SelectAll() { m_pEdit->SelectAll(); } -CFX_FloatRect CPWL_ComboBox::GetFocusRect() const { - return CFX_FloatRect(); +CPDF_Rect CPWL_ComboBox::GetFocusRect() const { + return CPDF_Rect(); } void CPWL_ComboBox::SetPopup(FX_BOOL bPopup) { @@ -488,7 +485,7 @@ void CPWL_ComboBox::SetPopup(FX_BOOL bPopup) { if (IsFloatBigger(fPopupRet, 0.0f)) { m_bPopup = bPopup; - CFX_FloatRect rcWindow = CPWL_Wnd::GetWindowRect(); + CPDF_Rect rcWindow = CPWL_Wnd::GetWindowRect(); m_rcOldWindow = rcWindow; switch (nWhere) { default: diff --git a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp index 0b3887b413..7834473ded 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp @@ -73,10 +73,10 @@ void CPWL_Edit::SetText(const FX_WCHAR* csText) { void CPWL_Edit::RePosChildWnd() { if (CPWL_ScrollBar* pVSB = GetVScrollBar()) { - CFX_FloatRect rcWindow = m_rcOldWindow; - CFX_FloatRect rcVScroll = - CFX_FloatRect(rcWindow.right, rcWindow.bottom, - rcWindow.right + PWL_SCROLLBAR_WIDTH, rcWindow.top); + CPDF_Rect rcWindow = m_rcOldWindow; + CPDF_Rect rcVScroll = + CPDF_Rect(rcWindow.right, rcWindow.bottom, + rcWindow.right + PWL_SCROLLBAR_WIDTH, rcWindow.top); pVSB->Move(rcVScroll, TRUE, FALSE); } @@ -87,8 +87,8 @@ void CPWL_Edit::RePosChildWnd() { CPWL_EditCtrl::RePosChildWnd(); } -CFX_FloatRect CPWL_Edit::GetClientRect() const { - CFX_FloatRect rcClient = CPWL_Utils::DeflateRect( +CPDF_Rect CPWL_Edit::GetClientRect() const { + CPDF_Rect rcClient = CPWL_Utils::DeflateRect( GetWindowRect(), (FX_FLOAT)(GetBorderWidth() + GetInnerBorderWidth())); if (CPWL_ScrollBar* pVSB = GetVScrollBar()) { @@ -234,7 +234,7 @@ void CPWL_Edit::SetParamByFlag() { m_pEdit->EnableUndo(HasFlag(PES_UNDO)); if (HasFlag(PES_TEXTOVERFLOW)) { - SetClipRect(CFX_FloatRect(0.0f, 0.0f, 0.0f, 0.0f)); + SetClipRect(CPDF_Rect(0.0f, 0.0f, 0.0f, 0.0f)); m_pEdit->SetTextOverflow(TRUE, FALSE); } else { if (m_pEditCaret) { @@ -251,7 +251,7 @@ void CPWL_Edit::SetParamByFlag() { void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { CPWL_Wnd::GetThisAppearanceStream(sAppStream); - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); CFX_ByteTextBuf sLine; int32_t nCharArray = m_pEdit->GetCharArray(); @@ -299,7 +299,7 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { CFX_ByteTextBuf sText; - CFX_FloatPoint ptOffset = CFX_FloatPoint(0.0f, 0.0f); + CPDF_Point ptOffset = CPDF_Point(0.0f, 0.0f); CPVT_WordRange wrWhole = m_pEdit->GetWholeWordRange(); CPVT_WordRange wrSelect = GetSelectWordRange(); @@ -355,7 +355,7 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { } if (sText.GetLength() > 0) { - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); sAppStream << "q\n/Tx BMC\n"; if (!HasFlag(PES_TEXTOVERFLOW)) @@ -373,7 +373,7 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) { CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device); - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); CFX_ByteTextBuf sLine; int32_t nCharArray = m_pEdit->GetCharArray(); @@ -441,7 +441,7 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice, } } - CFX_FloatRect rcClip; + CPDF_Rect rcClip; CPVT_WordRange wrRange = m_pEdit->GetVisibleWordRange(); CPVT_WordRange* pRange = NULL; @@ -454,16 +454,16 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice, pDevice, pUser2Device, m_pEdit, CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor(), GetTransparency()), - rcClip, CFX_FloatPoint(0.0f, 0.0f), pRange, pSysHandler, m_pFormFiller); + rcClip, CPDF_Point(0.0f, 0.0f), pRange, pSysHandler, m_pFormFiller); if (HasFlag(PES_SPELLCHECK)) { CPWL_Utils::DrawEditSpellCheck(pDevice, pUser2Device, m_pEdit, rcClip, - CFX_FloatPoint(0.0f, 0.0f), pRange, + CPDF_Point(0.0f, 0.0f), pRange, GetCreationParam().pSpellCheck); } } -FX_BOOL CPWL_Edit::OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) { +FX_BOOL CPWL_Edit::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonDown(point, nFlag); if (HasFlag(PES_TEXTOVERFLOW) || ClientHitTest(point)) { @@ -479,8 +479,7 @@ FX_BOOL CPWL_Edit::OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) { return TRUE; } -FX_BOOL CPWL_Edit::OnLButtonDblClk(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_Edit::OnLButtonDblClk(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonDblClk(point, nFlag); if (HasFlag(PES_TEXTOVERFLOW) || ClientHitTest(point)) { @@ -499,7 +498,7 @@ FX_BOOL CPWL_Edit::OnLButtonDblClk(const CFX_FloatPoint& point, #define WM_PWLEDIT_SELECTALL 0x07 #define WM_PWLEDIT_SUGGEST 0x08 -FX_BOOL CPWL_Edit::OnRButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) { +FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point& point, FX_DWORD nFlag) { if (m_bMouseDown) return FALSE; @@ -522,7 +521,7 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) { return FALSE; std::vector<CFX_ByteString> sSuggestWords; - CFX_FloatPoint ptPopup = point; + CPDF_Point ptPopup = point; if (!IsReadOnly()) { if (HasFlag(PES_SPELLCHECK) && !swLatin.IsEmpty()) { @@ -685,7 +684,7 @@ void CPWL_Edit::OnKillFocus() { ShowVScrollBar(FALSE); m_pEdit->SelectNone(); - SetCaret(FALSE, CFX_FloatPoint(0.0f, 0.0f), CFX_FloatPoint(0.0f, 0.0f)); + SetCaret(FALSE, CPDF_Point(0.0f, 0.0f), CPDF_Point(0.0f, 0.0f)); SetCharSet(0); @@ -711,7 +710,7 @@ void CPWL_Edit::SetLineLeading(FX_FLOAT fLineLeading, } CFX_ByteString CPWL_Edit::GetSelectAppearanceStream( - const CFX_FloatPoint& ptOffset) const { + const CPDF_Point& ptOffset) const { CPVT_WordRange wr = GetSelectWordRange(); return CPWL_Utils::GetEditSelAppStream(m_pEdit, ptOffset, &wr); } @@ -733,7 +732,7 @@ CPVT_WordRange CPWL_Edit::GetSelectWordRange() const { } CFX_ByteString CPWL_Edit::GetTextAppearanceStream( - const CFX_FloatPoint& ptOffset) const { + const CPDF_Point& ptOffset) const { CFX_ByteTextBuf sRet; CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset); @@ -746,24 +745,23 @@ CFX_ByteString CPWL_Edit::GetTextAppearanceStream( } CFX_ByteString CPWL_Edit::GetCaretAppearanceStream( - const CFX_FloatPoint& ptOffset) const { + const CPDF_Point& ptOffset) const { if (m_pEditCaret) return m_pEditCaret->GetCaretAppearanceStream(ptOffset); return CFX_ByteString(); } -CFX_FloatPoint CPWL_Edit::GetWordRightBottomPoint( - const CPVT_WordPlace& wpWord) { - CFX_FloatPoint pt(0.0f, 0.0f); +CPDF_Point CPWL_Edit::GetWordRightBottomPoint(const CPVT_WordPlace& wpWord) { + CPDF_Point pt(0.0f, 0.0f); if (IFX_Edit_Iterator* pIterator = m_pEdit->GetIterator()) { CPVT_WordPlace wpOld = pIterator->GetAt(); pIterator->SetAt(wpWord); CPVT_Word word; if (pIterator->GetWord(word)) { - pt = CFX_FloatPoint(word.ptWord.x + word.fWidth, - word.ptWord.y + word.fDescent); + pt = CPDF_Point(word.ptWord.x + word.fWidth, + word.ptWord.y + word.fDescent); } pIterator->SetAt(wpOld); @@ -777,13 +775,13 @@ FX_BOOL CPWL_Edit::IsTextFull() const { } FX_FLOAT CPWL_Edit::GetCharArrayAutoFontSize(CPDF_Font* pFont, - const CFX_FloatRect& rcPlate, + const CPDF_Rect& rcPlate, int32_t nCharArray) { if (pFont && !pFont->IsStandardFont()) { FX_RECT rcBBox; pFont->GetFontBBox(rcBBox); - CFX_FloatRect rcCell = rcPlate; + CPDF_Rect rcCell = rcPlate; FX_FLOAT xdiv = rcCell.Width() / nCharArray * 1000.0f / rcBBox.Width(); FX_FLOAT ydiv = -rcCell.Height() * 1000.0f / rcBBox.Height(); @@ -820,8 +818,8 @@ void CPWL_Edit::ReplaceSel(const FX_WCHAR* csText) { m_pEdit->InsertText(csText); } -CFX_FloatRect CPWL_Edit::GetFocusRect() const { - return CFX_FloatRect(); +CPDF_Rect CPWL_Edit::GetFocusRect() const { + return CPDF_Rect(); } void CPWL_Edit::ShowVScrollBar(FX_BOOL bShow) { @@ -829,7 +827,7 @@ void CPWL_Edit::ShowVScrollBar(FX_BOOL bShow) { if (bShow) { if (!pScroll->IsVisible()) { pScroll->SetVisible(TRUE); - CFX_FloatRect rcWindow = GetWindowRect(); + CPDF_Rect rcWindow = GetWindowRect(); m_rcOldWindow = rcWindow; rcWindow.right += PWL_SCROLLBAR_WIDTH; Move(rcWindow, TRUE, TRUE); @@ -978,10 +976,10 @@ FX_BOOL CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag) { } FX_BOOL CPWL_Edit::OnMouseWheel(short zDelta, - const CFX_FloatPoint& point, + const CPDF_Point& point, FX_DWORD nFlag) { if (HasFlag(PES_MULTILINE)) { - CFX_FloatPoint ptScroll = GetScrollPos(); + CPDF_Point ptScroll = GetScrollPos(); if (zDelta > 0) { ptScroll.y += GetFontSize(); @@ -1096,8 +1094,7 @@ CPVT_WordRange CPWL_Edit::CombineWordRange(const CPVT_WordRange& wr1, return wrRet; } -CPVT_WordRange CPWL_Edit::GetLatinWordsRange( - const CFX_FloatPoint& point) const { +CPVT_WordRange CPWL_Edit::GetLatinWordsRange(const CPDF_Point& point) const { return GetSameWordsRange(m_pEdit->SearchWordPlace(point), TRUE, FALSE); } @@ -1170,7 +1167,7 @@ CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace& place, void CPWL_Edit::GeneratePageObjects( CPDF_PageObjectHolder* pObjectHolder, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray) { IFX_Edit::GeneratePageObjects( pObjectHolder, m_pEdit, ptOffset, NULL, @@ -1179,7 +1176,7 @@ void CPWL_Edit::GeneratePageObjects( } void CPWL_Edit::GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, - const CFX_FloatPoint& ptOffset) { + const CPDF_Point& ptOffset) { CFX_ArrayTemplate<CPDF_TextObject*> ObjArray; IFX_Edit::GeneratePageObjects( pObjectHolder, m_pEdit, ptOffset, NULL, diff --git a/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp index 10b5d6c04f..c505c7e780 100644 --- a/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp @@ -47,8 +47,8 @@ void CPWL_EditCtrl::OnCreated() { FX_BOOL CPWL_EditCtrl::IsWndHorV() { CFX_Matrix mt = GetWindowMatrix(); - CFX_FloatPoint point1(0, 1); - CFX_FloatPoint point2(1, 1); + CPDF_Point point1(0, 1); + CPDF_Point point2(1, 1); mt.Transform(point1.x, point1.y); mt.Transform(point2.x, point2.y); @@ -100,8 +100,7 @@ void CPWL_EditCtrl::OnNotify(CPWL_Wnd* pWnd, FX_FLOAT fPos = *(FX_FLOAT*)lParam; switch (wParam) { case SBT_VSCROLL: - m_pEdit->SetScrollPos( - CFX_FloatPoint(m_pEdit->GetScrollPos().x, fPos)); + m_pEdit->SetScrollPos(CPDF_Point(m_pEdit->GetScrollPos().x, fPos)); break; } } break; @@ -128,7 +127,7 @@ void CPWL_EditCtrl::CreateEditCaret(const PWL_CREATEPARAM& cp) { ecp.dwFlags = PWS_CHILD | PWS_NOREFRESHCLIP; ecp.dwBorderWidth = 0; ecp.nBorderStyle = PBS_SOLID; - ecp.rcRectWnd = CFX_FloatRect(0, 0, 0, 0); + ecp.rcRectWnd = CPDF_Rect(0, 0, 0, 0); m_pEditCaret->Create(ecp); } @@ -291,8 +290,7 @@ FX_BOOL CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag) { return TRUE; } -FX_BOOL CPWL_EditCtrl::OnLButtonDown(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_EditCtrl::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonDown(point, nFlag); if (ClientHitTest(point)) { @@ -308,8 +306,7 @@ FX_BOOL CPWL_EditCtrl::OnLButtonDown(const CFX_FloatPoint& point, return TRUE; } -FX_BOOL CPWL_EditCtrl::OnLButtonUp(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_EditCtrl::OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonUp(point, nFlag); if (m_bMouseDown) { @@ -324,8 +321,7 @@ FX_BOOL CPWL_EditCtrl::OnLButtonUp(const CFX_FloatPoint& point, return TRUE; } -FX_BOOL CPWL_EditCtrl::OnMouseMove(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_EditCtrl::OnMouseMove(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnMouseMove(point, nFlag); if (m_bMouseDown) @@ -334,12 +330,12 @@ FX_BOOL CPWL_EditCtrl::OnMouseMove(const CFX_FloatPoint& point, return TRUE; } -CFX_FloatRect CPWL_EditCtrl::GetContentRect() const { +CPDF_Rect CPWL_EditCtrl::GetContentRect() const { return m_pEdit->GetContentRect(); } void CPWL_EditCtrl::SetEditCaret(FX_BOOL bVisible) { - CFX_FloatPoint ptHead(0, 0), ptFoot(0, 0); + CPDF_Point ptHead(0, 0), ptFoot(0, 0); if (bVisible) { GetCaretInfo(ptHead, ptFoot); @@ -349,8 +345,7 @@ void CPWL_EditCtrl::SetEditCaret(FX_BOOL bVisible) { IOnSetCaret(bVisible, ptHead, ptFoot, wpTemp); } -void CPWL_EditCtrl::GetCaretInfo(CFX_FloatPoint& ptHead, - CFX_FloatPoint& ptFoot) const { +void CPWL_EditCtrl::GetCaretInfo(CPDF_Point& ptHead, CPDF_Point& ptFoot) const { if (IFX_Edit_Iterator* pIterator = m_pEdit->GetIterator()) { pIterator->SetAt(m_pEdit->GetCaret()); CPVT_Word word; @@ -370,7 +365,7 @@ void CPWL_EditCtrl::GetCaretInfo(CFX_FloatPoint& ptHead, } void CPWL_EditCtrl::GetCaretPos(int32_t& x, int32_t& y) const { - CFX_FloatPoint ptHead(0, 0), ptFoot(0, 0); + CPDF_Point ptHead(0, 0), ptFoot(0, 0); GetCaretInfo(ptHead, ptFoot); @@ -378,8 +373,8 @@ void CPWL_EditCtrl::GetCaretPos(int32_t& x, int32_t& y) const { } void CPWL_EditCtrl::SetCaret(FX_BOOL bVisible, - const CFX_FloatPoint& ptHead, - const CFX_FloatPoint& ptFoot) { + const CPDF_Point& ptHead, + const CPDF_Point& ptFoot) { if (m_pEditCaret) { if (!IsFocused() || m_pEdit->IsSelected()) bVisible = FALSE; @@ -438,16 +433,16 @@ int32_t CPWL_EditCtrl::GetTotalWords() const { return 0; } -void CPWL_EditCtrl::SetScrollPos(const CFX_FloatPoint& point) { +void CPWL_EditCtrl::SetScrollPos(const CPDF_Point& point) { if (m_pEdit) m_pEdit->SetScrollPos(point); } -CFX_FloatPoint CPWL_EditCtrl::GetScrollPos() const { +CPDF_Point CPWL_EditCtrl::GetScrollPos() const { if (m_pEdit) return m_pEdit->GetScrollPos(); - return CFX_FloatPoint(0.0f, 0.0f); + return CPDF_Point(0.0f, 0.0f); } CPDF_Font* CPWL_EditCtrl::GetCaretFont() const { @@ -575,8 +570,8 @@ void CPWL_EditCtrl::IOnSetScrollPosY(FX_FLOAT fy) { } void CPWL_EditCtrl::IOnSetCaret(FX_BOOL bVisible, - const CFX_FloatPoint& ptHead, - const CFX_FloatPoint& ptFoot, + const CPDF_Point& ptHead, + const CPDF_Point& ptFoot, const CPVT_WordPlace& place) { PWL_CARET_INFO cInfo; cInfo.bVisible = bVisible; @@ -589,7 +584,7 @@ void CPWL_EditCtrl::IOnSetCaret(FX_BOOL bVisible, void CPWL_EditCtrl::IOnCaretChange(const CPVT_SecProps& secProps, const CPVT_WordProps& wordProps) {} -void CPWL_EditCtrl::IOnContentChange(const CFX_FloatRect& rcContent) { +void CPWL_EditCtrl::IOnContentChange(const CPDF_Rect& rcContent) { if (IsValid()) { if (m_pEditNotify) { m_pEditNotify->OnContentChange(rcContent); @@ -597,7 +592,7 @@ void CPWL_EditCtrl::IOnContentChange(const CFX_FloatRect& rcContent) { } } -void CPWL_EditCtrl::IOnInvalidateRect(CFX_FloatRect* pRect) { +void CPWL_EditCtrl::IOnInvalidateRect(CPDF_Rect* pRect) { InvalidateRect(pRect); } @@ -605,13 +600,13 @@ int32_t CPWL_EditCtrl::GetCharSet() const { return m_nCharSet < 0 ? DEFAULT_CHARSET : m_nCharSet; } -void CPWL_EditCtrl::GetTextRange(const CFX_FloatRect& rect, +void CPWL_EditCtrl::GetTextRange(const CPDF_Rect& rect, int32_t& nStartChar, int32_t& nEndChar) const { nStartChar = m_pEdit->WordPlaceToWordIndex( - m_pEdit->SearchWordPlace(CFX_FloatPoint(rect.left, rect.top))); + m_pEdit->SearchWordPlace(CPDF_Point(rect.left, rect.top))); nEndChar = m_pEdit->WordPlaceToWordIndex( - m_pEdit->SearchWordPlace(CFX_FloatPoint(rect.right, rect.bottom))); + m_pEdit->SearchWordPlace(CPDF_Point(rect.right, rect.bottom))); } CFX_WideString CPWL_EditCtrl::GetText(int32_t& nStartChar, diff --git a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp index 1bfa1a6d3a..56c22d1bbd 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp @@ -16,7 +16,7 @@ CFX_ByteString CPWL_Image::GetImageAppStream() { CFX_ByteTextBuf sAppStream; CFX_ByteString sAlias = GetImageAlias(); - CFX_FloatRect rcPlate = GetClientRect(); + CPDF_Rect rcPlate = GetClientRect(); CFX_Matrix mt; mt.SetReverse(GetImageMatrix()); @@ -60,7 +60,7 @@ void CPWL_Image::GetImageSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight) { if (m_pPDFStream) { if (CPDF_Dictionary* pDict = m_pPDFStream->GetDict()) { - CFX_FloatRect rect = pDict->GetRectBy("BBox"); + CPDF_Rect rect = pDict->GetRectBy("BBox"); fWidth = rect.right - rect.left; fHeight = rect.top - rect.bottom; @@ -157,7 +157,7 @@ void CPWL_Icon::GetScale(FX_FLOAT& fHScale, FX_FLOAT& fVScale) { FX_FLOAT fImageWidth, fImageHeight; FX_FLOAT fPlateWidth, fPlateHeight; - CFX_FloatRect rcPlate = GetClientRect(); + CPDF_Rect rcPlate = GetClientRect(); fPlateWidth = rcPlate.right - rcPlate.left; fPlateHeight = rcPlate.top - rcPlate.bottom; @@ -213,7 +213,7 @@ void CPWL_Icon::GetImageOffset(FX_FLOAT& x, FX_FLOAT& y) { FX_FLOAT fImageFactHeight = fImageHeight * fVScale; FX_FLOAT fPlateWidth, fPlateHeight; - CFX_FloatRect rcPlate = GetClientRect(); + CPDF_Rect rcPlate = GetClientRect(); fPlateWidth = rcPlate.right - rcPlate.left; fPlateHeight = rcPlate.top - rcPlate.bottom; diff --git a/fpdfsdk/src/pdfwindow/PWL_IconList.cpp b/fpdfsdk/src/pdfwindow/PWL_IconList.cpp index 7dc8ba9f44..c6849d0683 100644 --- a/fpdfsdk/src/pdfwindow/PWL_IconList.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_IconList.cpp @@ -33,7 +33,7 @@ FX_FLOAT CPWL_IconList_Item::GetItemHeight(FX_FLOAT fLimitWidth) { void CPWL_IconList_Item::DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) { - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); if (m_bSelected) { if (IsEnabled()) { @@ -49,7 +49,7 @@ void CPWL_IconList_Item::DrawThisAppearance(CFX_RenderDevice* pDevice, } } - CFX_FloatRect rcIcon = rcClient; + CPDF_Rect rcIcon = rcClient; rcIcon.left += PWL_IconList_ITEM_ICON_LEFTMARGIN; rcIcon.right = rcIcon.left + PWL_IconList_ITEM_WIDTH; @@ -99,7 +99,7 @@ CFX_WideString CPWL_IconList_Item::GetText() const { } void CPWL_IconList_Item::RePosChildWnd() { - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); rcClient.left += (PWL_IconList_ITEM_ICON_LEFTMARGIN + PWL_IconList_ITEM_WIDTH + @@ -150,7 +150,7 @@ void CPWL_IconList_Content::CreateChildWnd(const PWL_CREATEPARAM& cp) { ResetContent(0); if (CPWL_Wnd* pParent = GetParentWindow()) { - CFX_FloatRect rcScroll = GetScrollArea(); + CPDF_Rect rcScroll = GetScrollArea(); GetScrollPos(); PWL_SCROLL_INFO sInfo; @@ -164,7 +164,7 @@ void CPWL_IconList_Content::CreateChildWnd(const PWL_CREATEPARAM& cp) { } } -FX_BOOL CPWL_IconList_Content::OnLButtonDown(const CFX_FloatPoint& point, +FX_BOOL CPWL_IconList_Content::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) { SetFocus(); @@ -178,7 +178,7 @@ FX_BOOL CPWL_IconList_Content::OnLButtonDown(const CFX_FloatPoint& point, return TRUE; } -FX_BOOL CPWL_IconList_Content::OnLButtonUp(const CFX_FloatPoint& point, +FX_BOOL CPWL_IconList_Content::OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) { m_bMouseDown = FALSE; ReleaseCapture(); @@ -186,7 +186,7 @@ FX_BOOL CPWL_IconList_Content::OnLButtonUp(const CFX_FloatPoint& point, return TRUE; } -FX_BOOL CPWL_IconList_Content::OnMouseMove(const CFX_FloatPoint& point, +FX_BOOL CPWL_IconList_Content::OnMouseMove(const CPDF_Point& point, FX_DWORD nFlag) { if (m_bMouseDown) { int32_t nItemIndex = FindItemIndex(point); @@ -218,11 +218,11 @@ FX_BOOL CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) { return FALSE; } -int32_t CPWL_IconList_Content::FindItemIndex(const CFX_FloatPoint& point) { +int32_t CPWL_IconList_Content::FindItemIndex(const CPDF_Point& point) { int32_t nIndex = 0; for (int32_t i = 0, sz = m_aChildren.GetSize(); i < sz; i++) { if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) { - CFX_FloatRect rcWnd = pChild->ChildToParent(pChild->GetWindowRect()); + CPDF_Rect rcWnd = pChild->ChildToParent(pChild->GetWindowRect()); if (point.y < rcWnd.top) { nIndex = i; @@ -234,14 +234,14 @@ int32_t CPWL_IconList_Content::FindItemIndex(const CFX_FloatPoint& point) { } void CPWL_IconList_Content::ScrollToItem(int32_t nItemIndex) { - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) { - CFX_FloatRect rcOrigin = pItem->GetWindowRect(); - CFX_FloatRect rcWnd = pItem->ChildToParent(rcOrigin); + CPDF_Rect rcOrigin = pItem->GetWindowRect(); + CPDF_Rect rcWnd = pItem->ChildToParent(rcOrigin); if (!(rcWnd.bottom > rcClient.bottom && rcWnd.top < rcClient.top)) { - CFX_FloatPoint ptScroll = GetScrollPos(); + CPDF_Point ptScroll = GetScrollPos(); if (rcWnd.top > rcClient.top) { ptScroll.y = rcOrigin.top; @@ -398,7 +398,7 @@ void CPWL_IconList::OnNotify(CPWL_Wnd* pWnd, } if (m_pListContent) - m_pListContent->SetScrollPos(CFX_FloatPoint(0.0f, 0.0f)); + m_pListContent->SetScrollPos(CPDF_Point(0.0f, 0.0f)); } pScrollBar->OnNotify(pWnd, PNM_SETSCROLLINFO, wParam, lParam); @@ -407,8 +407,7 @@ void CPWL_IconList::OnNotify(CPWL_Wnd* pWnd, return; case PNM_SCROLLWINDOW: if (m_pListContent) { - m_pListContent->SetScrollPos( - CFX_FloatPoint(0.0f, *(FX_FLOAT*)lParam)); + m_pListContent->SetScrollPos(CPDF_Point(0.0f, *(FX_FLOAT*)lParam)); m_pListContent->ResetFace(); m_pListContent->InvalidateRect(NULL); } @@ -463,14 +462,14 @@ void CPWL_IconList::SetIconFillColor(const CPWL_Color& color) { } FX_BOOL CPWL_IconList::OnMouseWheel(short zDelta, - const CFX_FloatPoint& point, + const CPDF_Point& point, FX_DWORD nFlag) { - CFX_FloatPoint ptScroll = m_pListContent->GetScrollPos(); - CFX_FloatRect rcScroll = m_pListContent->GetScrollArea(); - CFX_FloatRect rcContents = m_pListContent->GetClientRect(); + CPDF_Point ptScroll = m_pListContent->GetScrollPos(); + CPDF_Rect rcScroll = m_pListContent->GetScrollArea(); + CPDF_Rect rcContents = m_pListContent->GetClientRect(); if (rcScroll.top - rcScroll.bottom > rcContents.Height()) { - CFX_FloatPoint ptNew = ptScroll; + CPDF_Point ptNew = ptScroll; if (zDelta > 0) ptNew.y += 30; diff --git a/fpdfsdk/src/pdfwindow/PWL_Label.cpp b/fpdfsdk/src/pdfwindow/PWL_Label.cpp index 5f8d2d8685..4f8a0dd8ed 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Label.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Label.cpp @@ -29,7 +29,7 @@ void CPWL_Label::OnCreated() { m_pEdit->Initialize(); if (HasFlag(PES_TEXTOVERFLOW)) { - SetClipRect(CFX_FloatRect(0.0f, 0.0f, 0.0f, 0.0f)); + SetClipRect(CPDF_Rect(0.0f, 0.0f, 0.0f, 0.0f)); m_pEdit->SetTextOverflow(TRUE); } } @@ -87,7 +87,7 @@ void CPWL_Label::DrawThisAppearance(CFX_RenderDevice* pDevice, GetClientRect(); - CFX_FloatRect rcClip; + CPDF_Rect rcClip; CPVT_WordRange wrRange = m_pEdit->GetVisibleWordRange(); CPVT_WordRange* pRange = NULL; @@ -100,7 +100,7 @@ void CPWL_Label::DrawThisAppearance(CFX_RenderDevice* pDevice, pDevice, pUser2Device, m_pEdit, CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor(), GetTransparency()), - rcClip, CFX_FloatPoint(0.0f, 0.0f), pRange, pSysHandler, NULL); + rcClip, CPDF_Point(0.0f, 0.0f), pRange, pSysHandler, NULL); } void CPWL_Label::SetHorzScale(int32_t nHorzScale) { @@ -111,18 +111,18 @@ void CPWL_Label::SetCharSpace(FX_FLOAT fCharSpace) { m_pEdit->SetCharSpace(fCharSpace); } -CFX_FloatRect CPWL_Label::GetContentRect() const { +CPDF_Rect CPWL_Label::GetContentRect() const { return m_pEdit->GetContentRect(); } void CPWL_Label::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { CPWL_Wnd::GetThisAppearanceStream(sAppStream); - sAppStream << GetTextAppearanceStream(CFX_FloatPoint(0.0f, 0.0f)); + sAppStream << GetTextAppearanceStream(CPDF_Point(0.0f, 0.0f)); } CFX_ByteString CPWL_Label::GetTextAppearanceStream( - const CFX_FloatPoint& ptOffset) const { + const CPDF_Point& ptOffset) const { CFX_ByteTextBuf sRet; CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset); diff --git a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp index c8e738a7ca..e3e83f9c7a 100644 --- a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp @@ -60,7 +60,7 @@ void CPWL_List_Notify::IOnSetScrollPosY(FX_FLOAT fy) { m_pList->OnNotify(m_pList, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&fy); } -void CPWL_List_Notify::IOnInvalidateRect(CFX_FloatRect* pRect) { +void CPWL_List_Notify::IOnInvalidateRect(CPDF_Rect* pRect) { m_pList->InvalidateRect(pRect); } @@ -109,14 +109,14 @@ void CPWL_ListBox::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { CFX_ByteTextBuf sListItems; if (m_pList) { - CFX_FloatRect rcPlate = m_pList->GetPlateRect(); + CPDF_Rect rcPlate = m_pList->GetPlateRect(); for (int32_t i = 0, sz = m_pList->GetCount(); i < sz; i++) { - CFX_FloatRect rcItem = m_pList->GetItemRect(i); + CPDF_Rect rcItem = m_pList->GetItemRect(i); if (rcItem.bottom > rcPlate.top || rcItem.top < rcPlate.bottom) continue; - CFX_FloatPoint ptOffset(rcItem.left, (rcItem.top + rcItem.bottom) * 0.5f); + CPDF_Point ptOffset(rcItem.left, (rcItem.top + rcItem.bottom) * 0.5f); if (m_pList->IsItemSelected(i)) { sListItems << CPWL_Utils::GetRectFillAppStream( rcItem, PWL_DEFAULT_SELBACKCOLOR); @@ -140,7 +140,7 @@ void CPWL_ListBox::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { if (sListItems.GetLength() > 0) { CFX_ByteTextBuf sClip; - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); sClip << "q\n"; sClip << rcClient.left << " " << rcClient.bottom << " " @@ -158,18 +158,18 @@ void CPWL_ListBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device); if (m_pList) { - CFX_FloatRect rcPlate = m_pList->GetPlateRect(); - CFX_FloatRect rcList = GetListRect(); - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcPlate = m_pList->GetPlateRect(); + CPDF_Rect rcList = GetListRect(); + CPDF_Rect rcClient = GetClientRect(); for (int32_t i = 0, sz = m_pList->GetCount(); i < sz; i++) { - CFX_FloatRect rcItem = m_pList->GetItemRect(i); + CPDF_Rect rcItem = m_pList->GetItemRect(i); if (rcItem.bottom > rcPlate.top || rcItem.top < rcPlate.bottom) continue; - CFX_FloatPoint ptOffset(rcItem.left, (rcItem.top + rcItem.bottom) * 0.5f); + CPDF_Point ptOffset(rcItem.left, (rcItem.top + rcItem.bottom) * 0.5f); if (IFX_Edit* pEdit = m_pList->GetItemEdit(i)) { - CFX_FloatRect rcContent = pEdit->GetContentRect(); + CPDF_Rect rcContent = pEdit->GetContentRect(); if (rcContent.Width() > rcClient.Width()) rcItem.Intersect(rcList); else @@ -265,8 +265,7 @@ FX_BOOL CPWL_ListBox::OnChar(FX_WORD nChar, FX_DWORD nFlag) { return TRUE; } -FX_BOOL CPWL_ListBox::OnLButtonDown(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_ListBox::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonDown(point, nFlag); if (ClientHitTest(point)) { @@ -281,7 +280,7 @@ FX_BOOL CPWL_ListBox::OnLButtonDown(const CFX_FloatPoint& point, return TRUE; } -FX_BOOL CPWL_ListBox::OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) { +FX_BOOL CPWL_ListBox::OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonUp(point, nFlag); if (m_bMouseDown) { @@ -299,7 +298,7 @@ void CPWL_ListBox::SetHoverSel(FX_BOOL bHoverSel) { m_bHoverSel = bHoverSel; } -FX_BOOL CPWL_ListBox::OnMouseMove(const CFX_FloatPoint& point, FX_DWORD nFlag) { +FX_BOOL CPWL_ListBox::OnMouseMove(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnMouseMove(point, nFlag); if (m_bHoverSel && !IsCaptureMouse() && ClientHitTest(point)) { @@ -347,7 +346,7 @@ void CPWL_ListBox::OnNotify(CPWL_Wnd* pWnd, switch (wParam) { case SBT_VSCROLL: if (m_pList) - m_pList->SetScrollPos(CFX_FloatPoint(0, fPos)); + m_pList->SetScrollPos(CPDF_Point(0, fPos)); break; } break; @@ -381,9 +380,9 @@ void CPWL_ListBox::OnNotifySelChanged(FX_BOOL bKeyDown, nFlag); } -CFX_FloatRect CPWL_ListBox::GetFocusRect() const { +CPDF_Rect CPWL_ListBox::GetFocusRect() const { if (m_pList && m_pList->IsMultipleSel()) { - CFX_FloatRect rcCaret = m_pList->GetItemRect(m_pList->GetCaret()); + CPDF_Rect rcCaret = m_pList->GetItemRect(m_pList->GetCaret()); rcCaret.Intersect(GetClientRect()); return rcCaret; } @@ -496,11 +495,11 @@ int32_t CPWL_ListBox::FindNext(int32_t nIndex, FX_WCHAR nChar) const { return nIndex; } -CFX_FloatRect CPWL_ListBox::GetContentRect() const { +CPDF_Rect CPWL_ListBox::GetContentRect() const { if (m_pList) return m_pList->GetContentRect(); - return CFX_FloatRect(); + return CPDF_Rect(); } FX_FLOAT CPWL_ListBox::GetFirstHeight() const { @@ -510,13 +509,13 @@ FX_FLOAT CPWL_ListBox::GetFirstHeight() const { return 0.0f; } -CFX_FloatRect CPWL_ListBox::GetListRect() const { +CPDF_Rect CPWL_ListBox::GetListRect() const { return CPWL_Utils::DeflateRect( GetWindowRect(), (FX_FLOAT)(GetBorderWidth() + GetInnerBorderWidth())); } FX_BOOL CPWL_ListBox::OnMouseWheel(short zDelta, - const CFX_FloatPoint& point, + const CPDF_Point& point, FX_DWORD nFlag) { if (!m_pList) return FALSE; diff --git a/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp b/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp index 1c32ceb251..6d9627b08a 100644 --- a/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp @@ -16,7 +16,7 @@ CPWL_ListCtrl::CPWL_ListCtrl() CPWL_ListCtrl::~CPWL_ListCtrl() {} -void CPWL_ListCtrl::SetScrollPos(const CFX_FloatPoint& point) { +void CPWL_ListCtrl::SetScrollPos(const CPDF_Point& point) { m_ptScroll = point; if (m_ptScroll.x < m_rcContent.left) @@ -32,11 +32,11 @@ void CPWL_ListCtrl::SetScrollPos(const CFX_FloatPoint& point) { m_ptScroll.y = m_rcContent.bottom; } -CFX_FloatPoint CPWL_ListCtrl::GetScrollPos() const { +CPDF_Point CPWL_ListCtrl::GetScrollPos() const { return m_ptScroll; } -CFX_FloatRect CPWL_ListCtrl::GetScrollArea() const { +CPDF_Rect CPWL_ListCtrl::GetScrollArea() const { return m_rcContent; } @@ -77,7 +77,7 @@ FX_FLOAT CPWL_ListCtrl::GetContentsHeight(FX_FLOAT fLimitWidth) { } void CPWL_ListCtrl::ResetAll(FX_BOOL bMove, int32_t nStart) { - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); FX_FLOAT fWidth = rcClient.Width(); @@ -98,9 +98,8 @@ void CPWL_ListCtrl::ResetAll(FX_BOOL bMove, int32_t nStart) { if (bMove) { FX_FLOAT fItemHeight = pChild->GetItemHeight(fWidth - fLeft - fRight); - pChild->Move( - CFX_FloatRect(fLeft, fy - fItemHeight, fWidth - fRight, fy), TRUE, - FALSE); + pChild->Move(CPDF_Rect(fLeft, fy - fItemHeight, fWidth - fRight, fy), + TRUE, FALSE); fy -= fItemHeight; fy -= m_fItemSpace; } @@ -138,8 +137,8 @@ void CPWL_ListCtrl::RePosChildWnd() { void CPWL_ListCtrl::DrawChildAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) { pDevice->SaveState(); - CFX_FloatRect rcClient = GetClientRect(); - CFX_FloatRect rcTemp = rcClient; + CPDF_Rect rcClient = GetClientRect(); + CPDF_Rect rcTemp = rcClient; pUser2Device->TransformRect(rcTemp); FX_RECT rcClip((int32_t)rcTemp.left, (int32_t)rcTemp.bottom, (int32_t)rcTemp.right, (int32_t)rcTemp.top); @@ -148,7 +147,7 @@ void CPWL_ListCtrl::DrawChildAppearance(CFX_RenderDevice* pDevice, for (int32_t i = 0, sz = m_aChildren.GetSize(); i < sz; i++) { if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) { - CFX_FloatRect rcChild = pChild->ChildToParent(pChild->GetWindowRect()); + CPDF_Rect rcChild = pChild->ChildToParent(pChild->GetWindowRect()); if (!(rcChild.top < rcClient.bottom || rcChild.bottom > rcClient.top)) { CFX_Matrix mt = pChild->GetChildMatrix(); if (mt.IsIdentity()) { @@ -173,34 +172,34 @@ int32_t CPWL_ListCtrl::GetItemIndex(CPWL_Wnd* pItem) { return -1; } -CFX_FloatPoint CPWL_ListCtrl::InToOut(const CFX_FloatPoint& point) const { - CFX_FloatRect rcClient = GetClientRect(); +CPDF_Point CPWL_ListCtrl::InToOut(const CPDF_Point& point) const { + CPDF_Rect rcClient = GetClientRect(); - return CFX_FloatPoint(point.x + rcClient.left - m_ptScroll.x, - point.y + rcClient.top - m_ptScroll.y); + return CPDF_Point(point.x + rcClient.left - m_ptScroll.x, + point.y + rcClient.top - m_ptScroll.y); } -CFX_FloatPoint CPWL_ListCtrl::OutToIn(const CFX_FloatPoint& point) const { - CFX_FloatRect rcClient = GetClientRect(); +CPDF_Point CPWL_ListCtrl::OutToIn(const CPDF_Point& point) const { + CPDF_Rect rcClient = GetClientRect(); - return CFX_FloatPoint(point.x - rcClient.left + m_ptScroll.x, - point.y - rcClient.top + m_ptScroll.y); + return CPDF_Point(point.x - rcClient.left + m_ptScroll.x, + point.y - rcClient.top + m_ptScroll.y); } -CFX_FloatRect CPWL_ListCtrl::InToOut(const CFX_FloatRect& rect) const { - CFX_FloatRect rcClient = GetClientRect(); +CPDF_Rect CPWL_ListCtrl::InToOut(const CPDF_Rect& rect) const { + CPDF_Rect rcClient = GetClientRect(); - return CFX_FloatRect(rect.left + rcClient.left - m_ptScroll.x, - rect.bottom + rcClient.top - m_ptScroll.y, - rect.right + rcClient.left - m_ptScroll.x, - rect.top + rcClient.top - m_ptScroll.y); + return CPDF_Rect(rect.left + rcClient.left - m_ptScroll.x, + rect.bottom + rcClient.top - m_ptScroll.y, + rect.right + rcClient.left - m_ptScroll.x, + rect.top + rcClient.top - m_ptScroll.y); } -CFX_FloatRect CPWL_ListCtrl::OutToIn(const CFX_FloatRect& rect) const { - CFX_FloatRect rcClient = GetClientRect(); +CPDF_Rect CPWL_ListCtrl::OutToIn(const CPDF_Rect& rect) const { + CPDF_Rect rcClient = GetClientRect(); - return CFX_FloatRect(rect.left - rcClient.left + m_ptScroll.x, - rect.bottom - rcClient.top + m_ptScroll.y, - rect.right - rcClient.left + m_ptScroll.x, - rect.top - rcClient.top + m_ptScroll.y); + return CPDF_Rect(rect.left - rcClient.left + m_ptScroll.x, + rect.bottom - rcClient.top + m_ptScroll.y, + rect.right - rcClient.left + m_ptScroll.x, + rect.top - rcClient.top + m_ptScroll.y); } diff --git a/fpdfsdk/src/pdfwindow/PWL_Note.cpp b/fpdfsdk/src/pdfwindow/PWL_Note.cpp index 1933d564f4..760967b6a2 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Note.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Note.cpp @@ -42,14 +42,14 @@ void CPWL_Note_Options::SetTextColor(const CPWL_Color& color) { void CPWL_Note_Options::RePosChildWnd() { if (IsValid()) { - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); if (rcClient.Width() > 15.0f) { rcClient.right -= 15.0f; m_pText->Move(rcClient, TRUE, FALSE); m_pText->SetVisible(TRUE); } else { - m_pText->Move(CFX_FloatRect(0, 0, 0, 0), TRUE, FALSE); + m_pText->Move(CPDF_Rect(0, 0, 0, 0), TRUE, FALSE); m_pText->SetVisible(FALSE); } } @@ -71,16 +71,15 @@ void CPWL_Note_Options::DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) { CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device); - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); rcClient.left = rcClient.right - 15.0f; - CFX_FloatPoint ptCenter = - CFX_FloatPoint((rcClient.left + rcClient.right) * 0.5f, - (rcClient.top + rcClient.bottom) * 0.5f); + CPDF_Point ptCenter = CPDF_Point((rcClient.left + rcClient.right) * 0.5f, + (rcClient.top + rcClient.bottom) * 0.5f); - CFX_FloatPoint pt1(ptCenter.x - 2.0f, ptCenter.y + 2.0f * 0.5f); - CFX_FloatPoint pt2(ptCenter.x + 2.0f, ptCenter.y + 2.0f * 0.5f); - CFX_FloatPoint pt3(ptCenter.x, ptCenter.y - 3.0f * 0.5f); + CPDF_Point pt1(ptCenter.x - 2.0f, ptCenter.y + 2.0f * 0.5f); + CPDF_Point pt2(ptCenter.x + 2.0f, ptCenter.y + 2.0f * 0.5f); + CPDF_Point pt3(ptCenter.x, ptCenter.y - 3.0f * 0.5f); CFX_PathData path; @@ -96,8 +95,8 @@ void CPWL_Note_Options::DrawThisAppearance(CFX_RenderDevice* pDevice, FXFILL_ALTERNATE); } -CFX_FloatRect CPWL_Note_Options::GetContentRect() const { - CFX_FloatRect rcText = m_pText->GetContentRect(); +CPDF_Rect CPWL_Note_Options::GetContentRect() const { + CPDF_Rect rcText = m_pText->GetContentRect(); rcText.right += 15.0f; return rcText; } @@ -206,7 +205,7 @@ FX_FLOAT CPWL_Note_Edit::GetItemHeight(FX_FLOAT fLimitWidth) { EnableRefresh(FALSE); m_pEdit->EnableNotify(FALSE); - Move(CFX_FloatRect(0, 0, fLimitWidth, 0), TRUE, FALSE); + Move(CPDF_Rect(0, 0, fLimitWidth, 0), TRUE, FALSE); FX_FLOAT fRet = GetContentRect().Height(); m_pEdit->EnableNotify(TRUE); @@ -233,7 +232,7 @@ CPWL_Note_LBBox::~CPWL_Note_LBBox() {} void CPWL_Note_LBBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) { - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); CFX_GraphStateData gsd; gsd.m_LineWidth = 1.0f; @@ -260,7 +259,7 @@ CPWL_Note_RBBox::~CPWL_Note_RBBox() {} void CPWL_Note_RBBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) { - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); CFX_GraphStateData gsd; gsd.m_LineWidth = 1.0f; @@ -304,7 +303,7 @@ void CPWL_Note_CloseBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) { CPWL_Button::DrawThisAppearance(pDevice, pUser2Device); - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); rcClient = CPWL_Utils::DeflateRect(rcClient, 2.0f); CFX_GraphStateData gsd; @@ -331,7 +330,7 @@ void CPWL_Note_CloseBox::DrawThisAppearance(CFX_RenderDevice* pDevice, FXFILL_ALTERNATE); } -FX_BOOL CPWL_Note_CloseBox::OnLButtonDown(const CFX_FloatPoint& point, +FX_BOOL CPWL_Note_CloseBox::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) { SetBorderStyle(PBS_INSET); InvalidateRect(NULL); @@ -341,7 +340,7 @@ FX_BOOL CPWL_Note_CloseBox::OnLButtonDown(const CFX_FloatPoint& point, return CPWL_Button::OnLButtonDown(point, nFlag); } -FX_BOOL CPWL_Note_CloseBox::OnLButtonUp(const CFX_FloatPoint& point, +FX_BOOL CPWL_Note_CloseBox::OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) { m_bMouseDown = FALSE; @@ -449,8 +448,8 @@ void CPWL_Note_Contents::DeleteSubItem(IPWL_NoteItem* pNoteItem) { } } -IPWL_NoteItem* CPWL_Note_Contents::GetHitNoteItem(const CFX_FloatPoint& point) { - CFX_FloatPoint pt = ParentToChild(point); +IPWL_NoteItem* CPWL_Note_Contents::GetHitNoteItem(const CPDF_Point& point) { + CPDF_Point pt = ParentToChild(point); for (int32_t i = 0, sz = m_aChildren.GetSize(); i < sz; i++) { if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) { @@ -489,7 +488,7 @@ void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, } return; case PNM_SCROLLWINDOW: - SetScrollPos(CFX_FloatPoint(0.0f, *(FX_FLOAT*)lParam)); + SetScrollPos(CPDF_Point(0.0f, *(FX_FLOAT*)lParam)); ResetFace(); InvalidateRect(NULL); return; @@ -525,7 +524,7 @@ void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam); } -FX_BOOL CPWL_Note_Contents::OnLButtonDown(const CFX_FloatPoint& point, +FX_BOOL CPWL_Note_Contents::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) { if (CPWL_Wnd::OnLButtonDown(point, nFlag)) return TRUE; @@ -632,9 +631,9 @@ void CPWL_NoteItem::CreateChildWnd(const PWL_CREATEPARAM& cp) { void CPWL_NoteItem::RePosChildWnd() { if (IsValid()) { - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); - CFX_FloatRect rcSubject = rcClient; + CPDF_Rect rcSubject = rcClient; rcSubject.left += POPUP_ITEM_TEXT_INDENT; rcSubject.top = rcClient.top; rcSubject.right = @@ -645,7 +644,7 @@ void CPWL_NoteItem::RePosChildWnd() { m_pSubject->Move(rcSubject, TRUE, FALSE); m_pSubject->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcSubject)); - CFX_FloatRect rcDate = rcClient; + CPDF_Rect rcDate = rcClient; rcDate.right -= POPUP_ITEM_TEXT_INDENT; rcDate.left = PWL_MAX(rcDate.right - m_pDateTime->GetContentRect().Width() - 1.0f, @@ -655,7 +654,7 @@ void CPWL_NoteItem::RePosChildWnd() { m_pDateTime->Move(rcDate, TRUE, FALSE); m_pDateTime->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcDate)); - CFX_FloatRect rcContents = rcClient; + CPDF_Rect rcContents = rcClient; rcContents.left += 1.0f; rcContents.right -= 1.0f; rcContents.top = rcDate.bottom - POPUP_ITEM_HEAD_BOTTOM; @@ -851,8 +850,8 @@ void CPWL_NoteItem::DeleteSubItem(IPWL_NoteItem* pNoteItem) { m_pContents->DeleteSubItem(pNoteItem); } -IPWL_NoteItem* CPWL_NoteItem::GetHitNoteItem(const CFX_FloatPoint& point) { - CFX_FloatPoint pt = ParentToChild(point); +IPWL_NoteItem* CPWL_NoteItem::GetHitNoteItem(const CPDF_Point& point) { + CPDF_Point pt = ParentToChild(point); if (WndHitTest(pt)) { if (m_pContents) { @@ -910,8 +909,7 @@ FX_FLOAT CPWL_NoteItem::GetItemRightMargin() { return POPUP_ITEM_SIDEMARGIN; } -FX_BOOL CPWL_NoteItem::OnLButtonDown(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_NoteItem::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) { if (!m_pContents->WndHitTest(m_pContents->ParentToChild(point))) { SetNoteFocus(FALSE); } @@ -921,8 +919,7 @@ FX_BOOL CPWL_NoteItem::OnLButtonDown(const CFX_FloatPoint& point, return TRUE; } -FX_BOOL CPWL_NoteItem::OnRButtonUp(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_NoteItem::OnRButtonUp(const CPDF_Point& point, FX_DWORD nFlag) { if (!m_pContents->WndHitTest(m_pContents->ParentToChild(point))) { SetNoteFocus(FALSE); PopupNoteItemMenu(point); @@ -967,7 +964,7 @@ void CPWL_NoteItem::OnNotify(CPWL_Wnd* pWnd, CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam); } -void CPWL_NoteItem::PopupNoteItemMenu(const CFX_FloatPoint& point) { +void CPWL_NoteItem::PopupNoteItemMenu(const CPDF_Point& point) { if (IPWL_NoteNotify* pNotify = GetNoteNotify()) { int32_t x, y; PWLtoWnd(point, x, y); @@ -1080,13 +1077,13 @@ FX_BOOL CPWL_Note::ResetScrollBar() { } if (bScrollChanged) { - CFX_FloatRect rcNote = GetClientRect(); - CFX_FloatRect rcContents = m_pContents->GetWindowRect(); + CPDF_Rect rcNote = GetClientRect(); + CPDF_Rect rcContents = m_pContents->GetWindowRect(); rcContents.right = rcNote.right - 3.0f; if (m_pContentsBar->IsVisible()) rcContents.right -= PWL_SCROLLBAR_WIDTH; m_pContents->Move(rcContents, TRUE, TRUE); - m_pContents->SetScrollPos(CFX_FloatPoint(0.0f, 0.0f)); + m_pContents->SetScrollPos(CPDF_Point(0.0f, 0.0f)); m_pContents->InvalidateRect(NULL); } @@ -1094,8 +1091,8 @@ FX_BOOL CPWL_Note::ResetScrollBar() { } FX_BOOL CPWL_Note::ScrollBarShouldVisible() { - CFX_FloatRect rcContentsFact = m_pContents->GetScrollArea(); - CFX_FloatRect rcContentsClient = m_pContents->GetClientRect(); + CPDF_Rect rcContentsFact = m_pContents->GetScrollArea(); + CPDF_Rect rcContentsClient = m_pContents->GetClientRect(); return rcContentsFact.Height() > rcContentsClient.Height(); } @@ -1114,9 +1111,9 @@ void CPWL_Note::RePosNoteChildren() { m_bResizing = TRUE; if (IsValid()) { - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); - CFX_FloatRect rcIcon = rcClient; + CPDF_Rect rcIcon = rcClient; rcIcon.top -= 2.0f; rcIcon.right = rcIcon.left + 14.0f; rcIcon.bottom = rcIcon.top - 14.0f; @@ -1124,7 +1121,7 @@ void CPWL_Note::RePosNoteChildren() { m_pIcon->Move(rcIcon, TRUE, FALSE); m_pIcon->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcIcon)); - CFX_FloatRect rcCloseBox = rcClient; + CPDF_Rect rcCloseBox = rcClient; rcCloseBox.right -= 1.0f; rcCloseBox.top -= 1.0f; rcCloseBox.left = rcCloseBox.right - 14.0f; @@ -1133,7 +1130,7 @@ void CPWL_Note::RePosNoteChildren() { m_pCloseBox->Move(rcCloseBox, TRUE, FALSE); m_pCloseBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcCloseBox)); - CFX_FloatRect rcDate = rcClient; + CPDF_Rect rcDate = rcClient; rcDate.right = rcCloseBox.left - POPUP_ITEM_TEXT_INDENT; rcDate.left = PWL_MAX(rcDate.right - m_pDateTime->GetContentRect().Width() - 1.0f, @@ -1144,7 +1141,7 @@ void CPWL_Note::RePosNoteChildren() { m_pDateTime->Move(rcDate, TRUE, FALSE); m_pDateTime->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcDate)); - CFX_FloatRect rcSubject = rcClient; + CPDF_Rect rcSubject = rcClient; rcSubject.top = rcClient.top - 2.0f; rcSubject.left = rcIcon.right + POPUP_ITEM_TEXT_INDENT; rcSubject.right = @@ -1155,7 +1152,7 @@ void CPWL_Note::RePosNoteChildren() { m_pSubject->Move(rcSubject, TRUE, FALSE); m_pSubject->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcSubject)); - CFX_FloatRect rcOptions = rcClient; + CPDF_Rect rcOptions = rcClient; rcOptions.left = PWL_MAX(rcOptions.right - m_pOptions->GetContentRect().Width(), rcIcon.right + 1.0f); @@ -1165,7 +1162,7 @@ void CPWL_Note::RePosNoteChildren() { m_pOptions->Move(rcOptions, TRUE, FALSE); m_pOptions->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcOptions)); - CFX_FloatRect rcAuthor = rcClient; + CPDF_Rect rcAuthor = rcClient; rcAuthor.top = rcSubject.bottom - 4.0f; rcAuthor.left = rcSubject.left; rcAuthor.right = @@ -1176,21 +1173,21 @@ void CPWL_Note::RePosNoteChildren() { m_pAuthor->Move(rcAuthor, TRUE, FALSE); m_pAuthor->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcAuthor)); - CFX_FloatRect rcLBBox = rcClient; + CPDF_Rect rcLBBox = rcClient; rcLBBox.top = rcLBBox.bottom + 7.0f; rcLBBox.right = rcLBBox.left + 7.0f; rcLBBox.Normalize(); m_pLBBox->Move(rcLBBox, TRUE, FALSE); m_pLBBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcLBBox)); - CFX_FloatRect rcRBBox = rcClient; + CPDF_Rect rcRBBox = rcClient; rcRBBox.top = rcRBBox.bottom + 7.0f; rcRBBox.left = rcRBBox.right - 7.0f; rcRBBox.Normalize(); m_pRBBox->Move(rcRBBox, TRUE, FALSE); m_pRBBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcRBBox)); - CFX_FloatRect rcContents = rcClient; + CPDF_Rect rcContents = rcClient; rcContents.top = rcAuthor.bottom - POPUP_ITEM_HEAD_BOTTOM; rcContents.left += 3.0f; rcContents.right -= 3.0f; @@ -1201,7 +1198,7 @@ void CPWL_Note::RePosNoteChildren() { m_pContents->Move(rcContents, FALSE, FALSE); m_pContents->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcContents)); - CFX_FloatRect rcContentsBar = rcContents; + CPDF_Rect rcContentsBar = rcContents; rcContentsBar.right = rcClient.right - 3.0f; rcContentsBar.left = rcContentsBar.right - PWL_SCROLLBAR_WIDTH; rcContentsBar.Normalize(); @@ -1300,14 +1297,14 @@ CFX_WideString CPWL_Note::GetAuthorName() const { } FX_BOOL CPWL_Note::OnMouseWheel(short zDelta, - const CFX_FloatPoint& point, + const CPDF_Point& point, FX_DWORD nFlag) { - CFX_FloatPoint ptScroll = m_pContents->GetScrollPos(); - CFX_FloatRect rcScroll = m_pContents->GetScrollArea(); - CFX_FloatRect rcContents = m_pContents->GetClientRect(); + CPDF_Point ptScroll = m_pContents->GetScrollPos(); + CPDF_Rect rcScroll = m_pContents->GetScrollArea(); + CPDF_Rect rcContents = m_pContents->GetClientRect(); if (rcScroll.top - rcScroll.bottom > rcContents.Height()) { - CFX_FloatPoint ptNew = ptScroll; + CPDF_Point ptNew = ptScroll; if (zDelta > 0) ptNew.y += 30; @@ -1341,7 +1338,7 @@ void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, intptr_t lParam) { switch (msg) { case PNM_NOTEEDITCHANGED: { - CFX_FloatRect rcScroll = m_pContents->GetScrollArea(); + CPDF_Rect rcScroll = m_pContents->GetScrollArea(); PWL_SCROLL_INFO sInfo; sInfo.fContentMin = rcScroll.bottom; @@ -1369,8 +1366,8 @@ void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, (intptr_t)&sInfo); m_OldScrollInfo = sInfo; - CFX_FloatPoint ptScroll = m_pContents->GetScrollPos(); - CFX_FloatPoint ptOld = ptScroll; + CPDF_Point ptScroll = m_pContents->GetScrollPos(); + CPDF_Point ptOld = ptScroll; if (ptScroll.y > sInfo.fContentMax) ptScroll.y = sInfo.fContentMax; @@ -1407,13 +1404,13 @@ void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, if (msg == PNM_SETCARETINFO && IsValid()) { if (PWL_CARET_INFO* pInfo = (PWL_CARET_INFO*)wParam) { if (m_pContents) { - CFX_FloatRect rcClient = m_pContents->GetClientRect(); + CPDF_Rect rcClient = m_pContents->GetClientRect(); if (pInfo->ptHead.y > rcClient.top) { - CFX_FloatPoint pt = m_pContents->OutToIn(pInfo->ptHead); + CPDF_Point pt = m_pContents->OutToIn(pInfo->ptHead); m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (intptr_t)&pt.y); - CFX_FloatPoint ptScroll = m_pContents->GetScrollPos(); + CPDF_Point ptScroll = m_pContents->GetScrollPos(); m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&ptScroll.y); @@ -1421,12 +1418,12 @@ void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, } if (pInfo->ptFoot.y < rcClient.bottom) { - CFX_FloatPoint pt = m_pContents->OutToIn(pInfo->ptFoot); + CPDF_Point pt = m_pContents->OutToIn(pInfo->ptFoot); pt.y += rcClient.Height(); m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (intptr_t)&pt.y); - CFX_FloatPoint ptScroll = m_pContents->GetScrollPos(); + CPDF_Point ptScroll = m_pContents->GetScrollPos(); m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&ptScroll.y); @@ -1461,7 +1458,7 @@ void CPWL_Note::SetBkColor(const CPWL_Color& color) { m_pRBBox->SetTextColor(sTextColor); } -FX_BOOL CPWL_Note::OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) { +FX_BOOL CPWL_Note::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) { if (m_pOptions->WndHitTest(m_pOptions->ParentToChild(point))) { if (IPWL_NoteNotify* pNotify = GetNoteNotify()) { int32_t x, y; @@ -1478,7 +1475,7 @@ FX_BOOL CPWL_Note::OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) { return CPWL_Wnd::OnLButtonDown(point, nFlag); } -FX_BOOL CPWL_Note::OnRButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) { +FX_BOOL CPWL_Note::OnRButtonUp(const CPDF_Point& point, FX_DWORD nFlag) { return CPWL_Wnd::OnRButtonUp(point, nFlag); } diff --git a/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp b/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp index 03bf3238fa..c48052da9a 100644 --- a/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp @@ -132,25 +132,24 @@ void CPWL_SBButton::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { CFX_ByteTextBuf sButton; - CFX_FloatRect rectWnd = GetWindowRect(); + CPDF_Rect rectWnd = GetWindowRect(); if (rectWnd.IsEmpty()) return; sAppStream << "q\n"; - CFX_FloatPoint ptCenter = GetCenterPoint(); + CPDF_Point ptCenter = GetCenterPoint(); switch (m_eScrollBarType) { case SBT_HSCROLL: switch (m_eSBButtonType) { case PSBT_MIN: { - CFX_FloatPoint pt1(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f, - ptCenter.y); - CFX_FloatPoint pt2(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f, - ptCenter.y + PWL_TRIANGLE_HALFLEN); - CFX_FloatPoint pt3(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f, - ptCenter.y - PWL_TRIANGLE_HALFLEN); + CPDF_Point pt1(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f, ptCenter.y); + CPDF_Point pt2(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f, + ptCenter.y + PWL_TRIANGLE_HALFLEN); + CPDF_Point pt3(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f, + ptCenter.y - PWL_TRIANGLE_HALFLEN); if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 && rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN) { @@ -164,12 +163,11 @@ void CPWL_SBButton::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { } } break; case PSBT_MAX: { - CFX_FloatPoint pt1(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f, - ptCenter.y); - CFX_FloatPoint pt2(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f, - ptCenter.y + PWL_TRIANGLE_HALFLEN); - CFX_FloatPoint pt3(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f, - ptCenter.y - PWL_TRIANGLE_HALFLEN); + CPDF_Point pt1(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f, ptCenter.y); + CPDF_Point pt2(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f, + ptCenter.y + PWL_TRIANGLE_HALFLEN); + CPDF_Point pt3(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f, + ptCenter.y - PWL_TRIANGLE_HALFLEN); if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 && rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN) { @@ -189,12 +187,11 @@ void CPWL_SBButton::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { case SBT_VSCROLL: switch (m_eSBButtonType) { case PSBT_MIN: { - CFX_FloatPoint pt1(ptCenter.x - PWL_TRIANGLE_HALFLEN, - ptCenter.y - PWL_TRIANGLE_HALFLEN * 0.5f); - CFX_FloatPoint pt2(ptCenter.x + PWL_TRIANGLE_HALFLEN, - ptCenter.y - PWL_TRIANGLE_HALFLEN * 0.5f); - CFX_FloatPoint pt3(ptCenter.x, - ptCenter.y + PWL_TRIANGLE_HALFLEN * 0.5f); + CPDF_Point pt1(ptCenter.x - PWL_TRIANGLE_HALFLEN, + ptCenter.y - PWL_TRIANGLE_HALFLEN * 0.5f); + CPDF_Point pt2(ptCenter.x + PWL_TRIANGLE_HALFLEN, + ptCenter.y - PWL_TRIANGLE_HALFLEN * 0.5f); + CPDF_Point pt3(ptCenter.x, ptCenter.y + PWL_TRIANGLE_HALFLEN * 0.5f); if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 && rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN) { @@ -208,12 +205,11 @@ void CPWL_SBButton::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { } } break; case PSBT_MAX: { - CFX_FloatPoint pt1(ptCenter.x - PWL_TRIANGLE_HALFLEN, - ptCenter.y + PWL_TRIANGLE_HALFLEN * 0.5f); - CFX_FloatPoint pt2(ptCenter.x + PWL_TRIANGLE_HALFLEN, - ptCenter.y + PWL_TRIANGLE_HALFLEN * 0.5f); - CFX_FloatPoint pt3(ptCenter.x, - ptCenter.y - PWL_TRIANGLE_HALFLEN * 0.5f); + CPDF_Point pt1(ptCenter.x - PWL_TRIANGLE_HALFLEN, + ptCenter.y + PWL_TRIANGLE_HALFLEN * 0.5f); + CPDF_Point pt2(ptCenter.x + PWL_TRIANGLE_HALFLEN, + ptCenter.y + PWL_TRIANGLE_HALFLEN * 0.5f); + CPDF_Point pt3(ptCenter.x, ptCenter.y - PWL_TRIANGLE_HALFLEN * 0.5f); if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 && rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN) { @@ -242,11 +238,11 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, if (!IsVisible()) return; - CFX_FloatRect rectWnd = GetWindowRect(); + CPDF_Rect rectWnd = GetWindowRect(); if (rectWnd.IsEmpty()) return; - CFX_FloatPoint ptCenter = GetCenterPoint(); + CPDF_Point ptCenter = GetCenterPoint(); int32_t nTransparancy = GetTransparency(); switch (m_eScrollBarType) { @@ -254,12 +250,11 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device); switch (m_eSBButtonType) { case PSBT_MIN: { - CFX_FloatPoint pt1(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f, - ptCenter.y); - CFX_FloatPoint pt2(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f, - ptCenter.y + PWL_TRIANGLE_HALFLEN); - CFX_FloatPoint pt3(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f, - ptCenter.y - PWL_TRIANGLE_HALFLEN); + CPDF_Point pt1(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f, ptCenter.y); + CPDF_Point pt2(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f, + ptCenter.y + PWL_TRIANGLE_HALFLEN); + CPDF_Point pt3(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f, + ptCenter.y - PWL_TRIANGLE_HALFLEN); if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 && rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN) { @@ -278,12 +273,11 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, } } break; case PSBT_MAX: { - CFX_FloatPoint pt1(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f, - ptCenter.y); - CFX_FloatPoint pt2(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f, - ptCenter.y + PWL_TRIANGLE_HALFLEN); - CFX_FloatPoint pt3(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f, - ptCenter.y - PWL_TRIANGLE_HALFLEN); + CPDF_Point pt1(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f, ptCenter.y); + CPDF_Point pt2(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f, + ptCenter.y + PWL_TRIANGLE_HALFLEN); + CPDF_Point pt3(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f, + ptCenter.y - PWL_TRIANGLE_HALFLEN); if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 && rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN) { @@ -309,7 +303,7 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, switch (m_eSBButtonType) { case PSBT_MIN: { // draw border - CFX_FloatRect rcDraw = rectWnd; + CPDF_Rect rcDraw = rectWnd; CPWL_Utils::DrawStrokeRect(pDevice, pUser2Device, rcDraw, ArgbEncode(nTransparancy, 100, 100, 100), 0.0f); @@ -336,13 +330,13 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, if (rectWnd.top - rectWnd.bottom > 6.0f) { FX_FLOAT fX = rectWnd.left + 1.5f; FX_FLOAT fY = rectWnd.bottom; - CFX_FloatPoint pts[7] = {CFX_FloatPoint(fX + 2.5f, fY + 4.0f), - CFX_FloatPoint(fX + 2.5f, fY + 3.0f), - CFX_FloatPoint(fX + 4.5f, fY + 5.0f), - CFX_FloatPoint(fX + 6.5f, fY + 3.0f), - CFX_FloatPoint(fX + 6.5f, fY + 4.0f), - CFX_FloatPoint(fX + 4.5f, fY + 6.0f), - CFX_FloatPoint(fX + 2.5f, fY + 4.0f)}; + CPDF_Point pts[7] = {CPDF_Point(fX + 2.5f, fY + 4.0f), + CPDF_Point(fX + 2.5f, fY + 3.0f), + CPDF_Point(fX + 4.5f, fY + 5.0f), + CPDF_Point(fX + 6.5f, fY + 3.0f), + CPDF_Point(fX + 6.5f, fY + 4.0f), + CPDF_Point(fX + 4.5f, fY + 6.0f), + CPDF_Point(fX + 2.5f, fY + 4.0f)}; if (IsEnabled()) CPWL_Utils::DrawFillArea( @@ -356,7 +350,7 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, } break; case PSBT_MAX: { // draw border - CFX_FloatRect rcDraw = rectWnd; + CPDF_Rect rcDraw = rectWnd; CPWL_Utils::DrawStrokeRect(pDevice, pUser2Device, rcDraw, ArgbEncode(nTransparancy, 100, 100, 100), 0.0f); @@ -382,13 +376,13 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, FX_FLOAT fX = rectWnd.left + 1.5f; FX_FLOAT fY = rectWnd.bottom; - CFX_FloatPoint pts[7] = {CFX_FloatPoint(fX + 2.5f, fY + 5.0f), - CFX_FloatPoint(fX + 2.5f, fY + 6.0f), - CFX_FloatPoint(fX + 4.5f, fY + 4.0f), - CFX_FloatPoint(fX + 6.5f, fY + 6.0f), - CFX_FloatPoint(fX + 6.5f, fY + 5.0f), - CFX_FloatPoint(fX + 4.5f, fY + 3.0f), - CFX_FloatPoint(fX + 2.5f, fY + 5.0f)}; + CPDF_Point pts[7] = {CPDF_Point(fX + 2.5f, fY + 5.0f), + CPDF_Point(fX + 2.5f, fY + 6.0f), + CPDF_Point(fX + 4.5f, fY + 4.0f), + CPDF_Point(fX + 6.5f, fY + 6.0f), + CPDF_Point(fX + 6.5f, fY + 5.0f), + CPDF_Point(fX + 4.5f, fY + 3.0f), + CPDF_Point(fX + 2.5f, fY + 5.0f)}; if (IsEnabled()) CPWL_Utils::DrawFillArea( @@ -402,7 +396,7 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, } break; case PSBT_POS: { // draw border - CFX_FloatRect rcDraw = rectWnd; + CPDF_Rect rcDraw = rectWnd; CPWL_Utils::DrawStrokeRect(pDevice, pUser2Device, rcDraw, ArgbEncode(nTransparancy, 100, 100, 100), 0.0f); @@ -416,10 +410,9 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, if (IsEnabled()) { // draw shadow effect - CFX_FloatPoint ptTop = - CFX_FloatPoint(rectWnd.left, rectWnd.top - 1.0f); - CFX_FloatPoint ptBottom = - CFX_FloatPoint(rectWnd.left, rectWnd.bottom + 1.0f); + CPDF_Point ptTop = CPDF_Point(rectWnd.left, rectWnd.top - 1.0f); + CPDF_Point ptBottom = + CPDF_Point(rectWnd.left, rectWnd.bottom + 1.0f); ptTop.x += 1.5f; ptBottom.x += 1.5f; @@ -506,12 +499,12 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, FX_FLOAT nFrictionWidth = 5.0f; FX_FLOAT nFrictionHeight = 5.5f; - CFX_FloatPoint ptLeft = - CFX_FloatPoint(ptCenter.x - nFrictionWidth / 2.0f, - ptCenter.y - nFrictionHeight / 2.0f + 0.5f); - CFX_FloatPoint ptRight = - CFX_FloatPoint(ptCenter.x + nFrictionWidth / 2.0f, - ptCenter.y - nFrictionHeight / 2.0f + 0.5f); + CPDF_Point ptLeft = + CPDF_Point(ptCenter.x - nFrictionWidth / 2.0f, + ptCenter.y - nFrictionHeight / 2.0f + 0.5f); + CPDF_Point ptRight = + CPDF_Point(ptCenter.x + nFrictionWidth / 2.0f, + ptCenter.y - nFrictionHeight / 2.0f + 0.5f); CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptLeft, ptRight, crStroke, 1.0f); @@ -538,8 +531,7 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, } } -FX_BOOL CPWL_SBButton::OnLButtonDown(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_SBButton::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonDown(point, nFlag); if (CPWL_Wnd* pParent = GetParentWindow()) @@ -551,8 +543,7 @@ FX_BOOL CPWL_SBButton::OnLButtonDown(const CFX_FloatPoint& point, return TRUE; } -FX_BOOL CPWL_SBButton::OnLButtonUp(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_SBButton::OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonUp(point, nFlag); if (CPWL_Wnd* pParent = GetParentWindow()) @@ -564,8 +555,7 @@ FX_BOOL CPWL_SBButton::OnLButtonUp(const CFX_FloatPoint& point, return TRUE; } -FX_BOOL CPWL_SBButton::OnMouseMove(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_SBButton::OnMouseMove(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnMouseMove(point, nFlag); if (CPWL_Wnd* pParent = GetParentWindow()) { @@ -595,8 +585,8 @@ void CPWL_ScrollBar::OnCreate(PWL_CREATEPARAM& cp) { } void CPWL_ScrollBar::RePosChildWnd() { - CFX_FloatRect rcClient = GetClientRect(); - CFX_FloatRect rcMinButton, rcMaxButton; + CPDF_Rect rcClient = GetClientRect(); + CPDF_Rect rcMinButton, rcMaxButton; FX_FLOAT fBWidth = 0; switch (m_sbType) { @@ -604,22 +594,21 @@ void CPWL_ScrollBar::RePosChildWnd() { if (rcClient.right - rcClient.left > PWL_SCROLLBAR_BUTTON_WIDTH * 2 + PWL_SCROLLBAR_POSBUTTON_MINWIDTH + 2) { - rcMinButton = CFX_FloatRect(rcClient.left, rcClient.bottom, - rcClient.left + PWL_SCROLLBAR_BUTTON_WIDTH, - rcClient.top); - rcMaxButton = - CFX_FloatRect(rcClient.right - PWL_SCROLLBAR_BUTTON_WIDTH, - rcClient.bottom, rcClient.right, rcClient.top); + rcMinButton = + CPDF_Rect(rcClient.left, rcClient.bottom, + rcClient.left + PWL_SCROLLBAR_BUTTON_WIDTH, rcClient.top); + rcMaxButton = CPDF_Rect(rcClient.right - PWL_SCROLLBAR_BUTTON_WIDTH, + rcClient.bottom, rcClient.right, rcClient.top); } else { fBWidth = (rcClient.right - rcClient.left - PWL_SCROLLBAR_POSBUTTON_MINWIDTH - 2) / 2; if (fBWidth > 0) { - rcMinButton = CFX_FloatRect(rcClient.left, rcClient.bottom, - rcClient.left + fBWidth, rcClient.top); - rcMaxButton = CFX_FloatRect(rcClient.right - fBWidth, rcClient.bottom, - rcClient.right, rcClient.top); + rcMinButton = CPDF_Rect(rcClient.left, rcClient.bottom, + rcClient.left + fBWidth, rcClient.top); + rcMaxButton = CPDF_Rect(rcClient.right - fBWidth, rcClient.bottom, + rcClient.right, rcClient.top); } else { SetVisible(FALSE); } @@ -629,23 +618,21 @@ void CPWL_ScrollBar::RePosChildWnd() { if (IsFloatBigger(rcClient.top - rcClient.bottom, PWL_SCROLLBAR_BUTTON_WIDTH * 2 + PWL_SCROLLBAR_POSBUTTON_MINWIDTH + 2)) { - rcMinButton = CFX_FloatRect(rcClient.left, - rcClient.top - PWL_SCROLLBAR_BUTTON_WIDTH, - rcClient.right, rcClient.top); - rcMaxButton = - CFX_FloatRect(rcClient.left, rcClient.bottom, rcClient.right, - rcClient.bottom + PWL_SCROLLBAR_BUTTON_WIDTH); + rcMinButton = + CPDF_Rect(rcClient.left, rcClient.top - PWL_SCROLLBAR_BUTTON_WIDTH, + rcClient.right, rcClient.top); + rcMaxButton = CPDF_Rect(rcClient.left, rcClient.bottom, rcClient.right, + rcClient.bottom + PWL_SCROLLBAR_BUTTON_WIDTH); } else { fBWidth = (rcClient.top - rcClient.bottom - PWL_SCROLLBAR_POSBUTTON_MINWIDTH - 2) / 2; if (IsFloatBigger(fBWidth, 0)) { - rcMinButton = CFX_FloatRect(rcClient.left, rcClient.top - fBWidth, - rcClient.right, rcClient.top); - rcMaxButton = - CFX_FloatRect(rcClient.left, rcClient.bottom, rcClient.right, - rcClient.bottom + fBWidth); + rcMinButton = CPDF_Rect(rcClient.left, rcClient.top - fBWidth, + rcClient.right, rcClient.top); + rcMaxButton = CPDF_Rect(rcClient.left, rcClient.bottom, + rcClient.right, rcClient.bottom + fBWidth); } else { SetVisible(FALSE); } @@ -661,7 +648,7 @@ void CPWL_ScrollBar::RePosChildWnd() { } void CPWL_ScrollBar::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { - CFX_FloatRect rectWnd = GetWindowRect(); + CPDF_Rect rectWnd = GetWindowRect(); if (IsVisible() && !rectWnd.IsEmpty()) { CFX_ByteTextBuf sButton; @@ -679,7 +666,7 @@ void CPWL_ScrollBar::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { void CPWL_ScrollBar::DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) { - CFX_FloatRect rectWnd = GetWindowRect(); + CPDF_Rect rectWnd = GetWindowRect(); if (IsVisible() && !rectWnd.IsEmpty()) { CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rectWnd, @@ -687,20 +674,19 @@ void CPWL_ScrollBar::DrawThisAppearance(CFX_RenderDevice* pDevice, CPWL_Utils::DrawStrokeLine( pDevice, pUser2Device, - CFX_FloatPoint(rectWnd.left + 2.0f, rectWnd.top - 2.0f), - CFX_FloatPoint(rectWnd.left + 2.0f, rectWnd.bottom + 2.0f), + CPDF_Point(rectWnd.left + 2.0f, rectWnd.top - 2.0f), + CPDF_Point(rectWnd.left + 2.0f, rectWnd.bottom + 2.0f), ArgbEncode(GetTransparency(), 100, 100, 100), 1.0f); CPWL_Utils::DrawStrokeLine( pDevice, pUser2Device, - CFX_FloatPoint(rectWnd.right - 2.0f, rectWnd.top - 2.0f), - CFX_FloatPoint(rectWnd.right - 2.0f, rectWnd.bottom + 2.0f), + CPDF_Point(rectWnd.right - 2.0f, rectWnd.top - 2.0f), + CPDF_Point(rectWnd.right - 2.0f, rectWnd.bottom + 2.0f), ArgbEncode(GetTransparency(), 100, 100, 100), 1.0f); } } -FX_BOOL CPWL_ScrollBar::OnLButtonDown(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_ScrollBar::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonDown(point, nFlag); if (HasFlag(PWS_AUTOTRANSPARENT)) { @@ -710,29 +696,27 @@ FX_BOOL CPWL_ScrollBar::OnLButtonDown(const CFX_FloatPoint& point, } } - CFX_FloatRect rcMinArea, rcMaxArea; + CPDF_Rect rcMinArea, rcMaxArea; if (m_pPosButton && m_pPosButton->IsVisible()) { - CFX_FloatRect rcClient = GetClientRect(); - CFX_FloatRect rcPosButton = m_pPosButton->GetWindowRect(); + CPDF_Rect rcClient = GetClientRect(); + CPDF_Rect rcPosButton = m_pPosButton->GetWindowRect(); switch (m_sbType) { case SBT_HSCROLL: - rcMinArea = - CFX_FloatRect(rcClient.left + PWL_SCROLLBAR_BUTTON_WIDTH, - rcClient.bottom, rcPosButton.left, rcClient.top); - rcMaxArea = CFX_FloatRect(rcPosButton.right, rcClient.bottom, - rcClient.right - PWL_SCROLLBAR_BUTTON_WIDTH, - rcClient.top); + rcMinArea = CPDF_Rect(rcClient.left + PWL_SCROLLBAR_BUTTON_WIDTH, + rcClient.bottom, rcPosButton.left, rcClient.top); + rcMaxArea = CPDF_Rect(rcPosButton.right, rcClient.bottom, + rcClient.right - PWL_SCROLLBAR_BUTTON_WIDTH, + rcClient.top); break; case SBT_VSCROLL: - rcMinArea = - CFX_FloatRect(rcClient.left, rcPosButton.top, rcClient.right, - rcClient.top - PWL_SCROLLBAR_BUTTON_WIDTH); - rcMaxArea = CFX_FloatRect(rcClient.left, - rcClient.bottom + PWL_SCROLLBAR_BUTTON_WIDTH, - rcClient.right, rcPosButton.bottom); + rcMinArea = CPDF_Rect(rcClient.left, rcPosButton.top, rcClient.right, + rcClient.top - PWL_SCROLLBAR_BUTTON_WIDTH); + rcMaxArea = CPDF_Rect(rcClient.left, + rcClient.bottom + PWL_SCROLLBAR_BUTTON_WIDTH, + rcClient.right, rcPosButton.bottom); break; } @@ -755,8 +739,7 @@ FX_BOOL CPWL_ScrollBar::OnLButtonDown(const CFX_FloatPoint& point, return TRUE; } -FX_BOOL CPWL_ScrollBar::OnLButtonUp(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_ScrollBar::OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonUp(point, nFlag); if (HasFlag(PWS_AUTOTRANSPARENT)) { @@ -781,41 +764,41 @@ void CPWL_ScrollBar::OnNotify(CPWL_Wnd* pWnd, switch (msg) { case PNM_LBUTTONDOWN: if (pWnd == m_pMinButton) { - OnMinButtonLBDown(*(CFX_FloatPoint*)lParam); + OnMinButtonLBDown(*(CPDF_Point*)lParam); } if (pWnd == m_pMaxButton) { - OnMaxButtonLBDown(*(CFX_FloatPoint*)lParam); + OnMaxButtonLBDown(*(CPDF_Point*)lParam); } if (pWnd == m_pPosButton) { - OnPosButtonLBDown(*(CFX_FloatPoint*)lParam); + OnPosButtonLBDown(*(CPDF_Point*)lParam); } break; case PNM_LBUTTONUP: if (pWnd == m_pMinButton) { - OnMinButtonLBUp(*(CFX_FloatPoint*)lParam); + OnMinButtonLBUp(*(CPDF_Point*)lParam); } if (pWnd == m_pMaxButton) { - OnMaxButtonLBUp(*(CFX_FloatPoint*)lParam); + OnMaxButtonLBUp(*(CPDF_Point*)lParam); } if (pWnd == m_pPosButton) { - OnPosButtonLBUp(*(CFX_FloatPoint*)lParam); + OnPosButtonLBUp(*(CPDF_Point*)lParam); } break; case PNM_MOUSEMOVE: if (pWnd == m_pMinButton) { - OnMinButtonMouseMove(*(CFX_FloatPoint*)lParam); + OnMinButtonMouseMove(*(CPDF_Point*)lParam); } if (pWnd == m_pMaxButton) { - OnMaxButtonMouseMove(*(CFX_FloatPoint*)lParam); + OnMaxButtonMouseMove(*(CPDF_Point*)lParam); } if (pWnd == m_pPosButton) { - OnPosButtonMouseMove(*(CFX_FloatPoint*)lParam); + OnPosButtonMouseMove(*(CPDF_Point*)lParam); } break; case PNM_SETSCROLLINFO: { @@ -913,8 +896,8 @@ void CPWL_ScrollBar::MovePosButton(FX_BOOL bRefresh) { ASSERT(m_pMaxButton); if (m_pPosButton->IsVisible()) { - CFX_FloatRect rcClient; - CFX_FloatRect rcPosArea, rcPosButton; + CPDF_Rect rcClient; + CPDF_Rect rcPosArea, rcPosButton; rcClient = GetClientRect(); rcPosArea = GetScrollArea(); @@ -934,8 +917,7 @@ void CPWL_ScrollBar::MovePosButton(FX_BOOL bRefresh) { fLeft = fRight - PWL_SCROLLBAR_POSBUTTON_MINWIDTH; } - rcPosButton = - CFX_FloatRect(fLeft, rcPosArea.bottom, fRight, rcPosArea.top); + rcPosButton = CPDF_Rect(fLeft, rcPosArea.bottom, fRight, rcPosArea.top); break; case SBT_VSCROLL: @@ -950,8 +932,7 @@ void CPWL_ScrollBar::MovePosButton(FX_BOOL bRefresh) { fTop = fBottom + PWL_SCROLLBAR_POSBUTTON_MINWIDTH; } - rcPosButton = - CFX_FloatRect(rcPosArea.left, fBottom, rcPosArea.right, fTop); + rcPosButton = CPDF_Rect(rcPosArea.left, fBottom, rcPosArea.right, fTop); break; } @@ -960,7 +941,7 @@ void CPWL_ScrollBar::MovePosButton(FX_BOOL bRefresh) { } } -void CPWL_ScrollBar::OnMinButtonLBDown(const CFX_FloatPoint& point) { +void CPWL_ScrollBar::OnMinButtonLBDown(const CPDF_Point& point) { m_sData.SubSmall(); MovePosButton(TRUE); NotifyScrollWindow(); @@ -971,11 +952,11 @@ void CPWL_ScrollBar::OnMinButtonLBDown(const CFX_FloatPoint& point) { BeginTimer(100); } -void CPWL_ScrollBar::OnMinButtonLBUp(const CFX_FloatPoint& point) {} +void CPWL_ScrollBar::OnMinButtonLBUp(const CPDF_Point& point) {} -void CPWL_ScrollBar::OnMinButtonMouseMove(const CFX_FloatPoint& point) {} +void CPWL_ScrollBar::OnMinButtonMouseMove(const CPDF_Point& point) {} -void CPWL_ScrollBar::OnMaxButtonLBDown(const CFX_FloatPoint& point) { +void CPWL_ScrollBar::OnMaxButtonLBDown(const CPDF_Point& point) { m_sData.AddSmall(); MovePosButton(TRUE); NotifyScrollWindow(); @@ -986,15 +967,15 @@ void CPWL_ScrollBar::OnMaxButtonLBDown(const CFX_FloatPoint& point) { BeginTimer(100); } -void CPWL_ScrollBar::OnMaxButtonLBUp(const CFX_FloatPoint& point) {} +void CPWL_ScrollBar::OnMaxButtonLBUp(const CPDF_Point& point) {} -void CPWL_ScrollBar::OnMaxButtonMouseMove(const CFX_FloatPoint& point) {} +void CPWL_ScrollBar::OnMaxButtonMouseMove(const CPDF_Point& point) {} -void CPWL_ScrollBar::OnPosButtonLBDown(const CFX_FloatPoint& point) { +void CPWL_ScrollBar::OnPosButtonLBDown(const CPDF_Point& point) { m_bMouseDown = TRUE; if (m_pPosButton) { - CFX_FloatRect rcPosButton = m_pPosButton->GetWindowRect(); + CPDF_Rect rcPosButton = m_pPosButton->GetWindowRect(); switch (m_sbType) { case SBT_HSCROLL: @@ -1009,7 +990,7 @@ void CPWL_ScrollBar::OnPosButtonLBDown(const CFX_FloatPoint& point) { } } -void CPWL_ScrollBar::OnPosButtonLBUp(const CFX_FloatPoint& point) { +void CPWL_ScrollBar::OnPosButtonLBUp(const CPDF_Point& point) { if (m_bMouseDown) { if (!m_bNotifyForever) NotifyScrollWindow(); @@ -1017,7 +998,7 @@ void CPWL_ScrollBar::OnPosButtonLBUp(const CFX_FloatPoint& point) { m_bMouseDown = FALSE; } -void CPWL_ScrollBar::OnPosButtonMouseMove(const CFX_FloatPoint& point) { +void CPWL_ScrollBar::OnPosButtonMouseMove(const CPDF_Point& point) { FX_FLOAT fOldScrollPos = m_sData.fScrollPos; FX_FLOAT fNewPos = 0; @@ -1090,15 +1071,15 @@ void CPWL_ScrollBar::NotifyScrollWindow() { } } -CFX_FloatRect CPWL_ScrollBar::GetScrollArea() const { - CFX_FloatRect rcClient = GetClientRect(); - CFX_FloatRect rcArea; +CPDF_Rect CPWL_ScrollBar::GetScrollArea() const { + CPDF_Rect rcClient = GetClientRect(); + CPDF_Rect rcArea; if (!m_pMinButton || !m_pMaxButton) return rcClient; - CFX_FloatRect rcMin = m_pMinButton->GetWindowRect(); - CFX_FloatRect rcMax = m_pMaxButton->GetWindowRect(); + CPDF_Rect rcMin = m_pMinButton->GetWindowRect(); + CPDF_Rect rcMax = m_pMaxButton->GetWindowRect(); FX_FLOAT fMinWidth = rcMin.right - rcMin.left; FX_FLOAT fMinHeight = rcMin.top - rcMin.bottom; @@ -1108,21 +1089,20 @@ CFX_FloatRect CPWL_ScrollBar::GetScrollArea() const { switch (m_sbType) { case SBT_HSCROLL: if (rcClient.right - rcClient.left > fMinWidth + fMaxWidth + 2) { - rcArea = CFX_FloatRect(rcClient.left + fMinWidth + 1, rcClient.bottom, - rcClient.right - fMaxWidth - 1, rcClient.top); + rcArea = CPDF_Rect(rcClient.left + fMinWidth + 1, rcClient.bottom, + rcClient.right - fMaxWidth - 1, rcClient.top); } else { - rcArea = CFX_FloatRect(rcClient.left + fMinWidth + 1, rcClient.bottom, - rcClient.left + fMinWidth + 1, rcClient.top); + rcArea = CPDF_Rect(rcClient.left + fMinWidth + 1, rcClient.bottom, + rcClient.left + fMinWidth + 1, rcClient.top); } break; case SBT_VSCROLL: if (rcClient.top - rcClient.bottom > fMinHeight + fMaxHeight + 2) { - rcArea = CFX_FloatRect(rcClient.left, rcClient.bottom + fMinHeight + 1, - rcClient.right, rcClient.top - fMaxHeight - 1); + rcArea = CPDF_Rect(rcClient.left, rcClient.bottom + fMinHeight + 1, + rcClient.right, rcClient.top - fMaxHeight - 1); } else { - rcArea = - CFX_FloatRect(rcClient.left, rcClient.bottom + fMinHeight + 1, - rcClient.right, rcClient.bottom + fMinHeight + 1); + rcArea = CPDF_Rect(rcClient.left, rcClient.bottom + fMinHeight + 1, + rcClient.right, rcClient.bottom + fMinHeight + 1); } break; } @@ -1133,7 +1113,7 @@ CFX_FloatRect CPWL_ScrollBar::GetScrollArea() const { } FX_FLOAT CPWL_ScrollBar::TrueToFace(FX_FLOAT fTrue) { - CFX_FloatRect rcPosArea; + CPDF_Rect rcPosArea; rcPosArea = GetScrollArea(); FX_FLOAT fFactWidth = m_sData.ScrollRange.GetWidth() + m_sData.fClientWidth; @@ -1156,7 +1136,7 @@ FX_FLOAT CPWL_ScrollBar::TrueToFace(FX_FLOAT fTrue) { } FX_FLOAT CPWL_ScrollBar::FaceToTrue(FX_FLOAT fFace) { - CFX_FloatRect rcPosArea; + CPDF_Rect rcPosArea; rcPosArea = GetScrollArea(); FX_FLOAT fFactWidth = m_sData.ScrollRange.GetWidth() + m_sData.fClientWidth; diff --git a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp index 6b3940de28..f7c73d0a7d 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp @@ -27,7 +27,7 @@ void CPWL_Signature_Image::DrawThisAppearance(CFX_RenderDevice* pDevice, CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device); if (m_pImage) { - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); FX_FLOAT x, y; pUser2Device->Transform(rcClient.left, rcClient.top, x, y); @@ -48,7 +48,7 @@ void CPWL_Signature_Image::GetScale(FX_FLOAT& fHScale, FX_FLOAT& fVScale) { GetImageSize(fImageW, fImageH); - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); fHScale = rcClient.Width() / fImageW; fVScale = rcClient.Height() / fImageH; @@ -107,10 +107,10 @@ void CPWL_Signature::SetImageStream(CPDF_Stream* pStream, } void CPWL_Signature::RePosChildWnd() { - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); - CFX_FloatRect rcText = rcClient; - CFX_FloatRect rcDescription = rcClient; + CPDF_Rect rcText = rcClient; + CPDF_Rect rcDescription = rcClient; FX_BOOL bTextVisible = m_bTextExist && m_pText->GetText().GetLength() > 0; diff --git a/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp b/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp index 44c3ec8a94..52f25fcd84 100644 --- a/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp @@ -17,7 +17,7 @@ CFX_ByteString CPWL_PushButton::GetClassName() const { return "CPWL_PushButton"; } -CFX_FloatRect CPWL_PushButton::GetFocusRect() const { +CPDF_Rect CPWL_PushButton::GetFocusRect() const { return CPWL_Utils::DeflateRect(GetWindowRect(), (FX_FLOAT)GetBorderWidth()); } @@ -37,8 +37,7 @@ FX_BOOL CPWL_CheckBox::IsChecked() const { return m_bChecked; } -FX_BOOL CPWL_CheckBox::OnLButtonUp(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_CheckBox::OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) { if (IsReadOnly()) return FALSE; @@ -59,8 +58,7 @@ CFX_ByteString CPWL_RadioButton::GetClassName() const { return "CPWL_RadioButton"; } -FX_BOOL CPWL_RadioButton::OnLButtonUp(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_RadioButton::OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) { if (IsReadOnly()) return FALSE; diff --git a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp index 6cd5786e2e..64ba43dd6b 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp @@ -69,9 +69,8 @@ void CPWL_Utils::GetPathDataFromArray(CFX_PathData& path, } } -CFX_FloatRect CPWL_Utils::MaxRect(const CFX_FloatRect& rect1, - const CFX_FloatRect& rect2) { - CFX_FloatRect rcRet; +CPDF_Rect CPWL_Utils::MaxRect(const CPDF_Rect& rect1, const CPDF_Rect& rect2) { + CPDF_Rect rcRet; rcRet.left = PWL_MIN(rect1.left, rect2.left); rcRet.bottom = PWL_MIN(rect1.bottom, rect2.bottom); @@ -81,21 +80,21 @@ CFX_FloatRect CPWL_Utils::MaxRect(const CFX_FloatRect& rect1, return rcRet; } -CFX_FloatRect CPWL_Utils::OffsetRect(const CFX_FloatRect& rect, - FX_FLOAT x, - FX_FLOAT y) { - return CFX_FloatRect(rect.left + x, rect.bottom + y, rect.right + x, - rect.top + y); +CPDF_Rect CPWL_Utils::OffsetRect(const CPDF_Rect& rect, + FX_FLOAT x, + FX_FLOAT y) { + return CPDF_Rect(rect.left + x, rect.bottom + y, rect.right + x, + rect.top + y); } -FX_BOOL CPWL_Utils::ContainsRect(const CFX_FloatRect& rcParent, - const CFX_FloatRect& rcChild) { +FX_BOOL CPWL_Utils::ContainsRect(const CPDF_Rect& rcParent, + const CPDF_Rect& rcChild) { return rcChild.left >= rcParent.left && rcChild.bottom >= rcParent.bottom && rcChild.right <= rcParent.right && rcChild.top <= rcParent.top; } -FX_BOOL CPWL_Utils::IntersectRect(const CFX_FloatRect& rect1, - const CFX_FloatRect& rect2) { +FX_BOOL CPWL_Utils::IntersectRect(const CPDF_Rect& rect1, + const CPDF_Rect& rect2) { FX_FLOAT left = rect1.left > rect2.left ? rect1.left : rect2.left; FX_FLOAT right = rect1.right < rect2.right ? rect1.right : rect2.right; FX_FLOAT bottom = rect1.bottom > rect2.bottom ? rect1.bottom : rect2.bottom; @@ -104,10 +103,10 @@ FX_BOOL CPWL_Utils::IntersectRect(const CFX_FloatRect& rect1, return left < right && bottom < top; } -CFX_FloatPoint CPWL_Utils::OffsetPoint(const CFX_FloatPoint& point, - FX_FLOAT x, - FX_FLOAT y) { - return CFX_FloatPoint(point.x + x, point.y + y); +CPDF_Point CPWL_Utils::OffsetPoint(const CPDF_Point& point, + FX_FLOAT x, + FX_FLOAT y) { + return CPDF_Point(point.x + x, point.y + y); } CPVT_WordRange CPWL_Utils::OverlapWordRange(const CPVT_WordRange& wr1, @@ -136,7 +135,7 @@ CPVT_WordRange CPWL_Utils::OverlapWordRange(const CPVT_WordRange& wr1, return wrRet; } -CFX_ByteString CPWL_Utils::GetAP_Check(const CFX_FloatRect& crBBox) { +CFX_ByteString CPWL_Utils::GetAP_Check(const CPDF_Rect& crBBox) { const FX_FLOAT fWidth = crBBox.right - crBBox.left; const FX_FLOAT fHeight = crBBox.top - crBBox.bottom; @@ -185,16 +184,16 @@ CFX_ByteString CPWL_Utils::GetAP_Check(const CFX_FloatRect& crBBox) { return csAP.GetByteString(); } -CFX_ByteString CPWL_Utils::GetAP_Circle(const CFX_FloatRect& crBBox) { +CFX_ByteString CPWL_Utils::GetAP_Circle(const CPDF_Rect& crBBox) { CFX_ByteTextBuf csAP; FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; - CFX_FloatPoint pt1(crBBox.left, crBBox.bottom + fHeight / 2); - CFX_FloatPoint pt2(crBBox.left + fWidth / 2, crBBox.top); - CFX_FloatPoint pt3(crBBox.right, crBBox.bottom + fHeight / 2); - CFX_FloatPoint pt4(crBBox.left + fWidth / 2, crBBox.bottom); + CPDF_Point pt1(crBBox.left, crBBox.bottom + fHeight / 2); + CPDF_Point pt2(crBBox.left + fWidth / 2, crBBox.top); + CPDF_Point pt3(crBBox.right, crBBox.bottom + fHeight / 2); + CPDF_Point pt4(crBBox.left + fWidth / 2, crBBox.bottom); csAP << pt1.x << " " << pt1.y << " m\n"; @@ -227,7 +226,7 @@ CFX_ByteString CPWL_Utils::GetAP_Circle(const CFX_FloatRect& crBBox) { return csAP.GetByteString(); } -CFX_ByteString CPWL_Utils::GetAP_Cross(const CFX_FloatRect& crBBox) { +CFX_ByteString CPWL_Utils::GetAP_Cross(const CPDF_Rect& crBBox) { CFX_ByteTextBuf csAP; csAP << crBBox.left << " " << crBBox.top << " m\n"; @@ -238,16 +237,16 @@ CFX_ByteString CPWL_Utils::GetAP_Cross(const CFX_FloatRect& crBBox) { return csAP.GetByteString(); } -CFX_ByteString CPWL_Utils::GetAP_Diamond(const CFX_FloatRect& crBBox) { +CFX_ByteString CPWL_Utils::GetAP_Diamond(const CPDF_Rect& crBBox) { CFX_ByteTextBuf csAP; FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; - CFX_FloatPoint pt1(crBBox.left, crBBox.bottom + fHeight / 2); - CFX_FloatPoint pt2(crBBox.left + fWidth / 2, crBBox.top); - CFX_FloatPoint pt3(crBBox.right, crBBox.bottom + fHeight / 2); - CFX_FloatPoint pt4(crBBox.left + fWidth / 2, crBBox.bottom); + CPDF_Point pt1(crBBox.left, crBBox.bottom + fHeight / 2); + CPDF_Point pt2(crBBox.left + fWidth / 2, crBBox.top); + CPDF_Point pt3(crBBox.right, crBBox.bottom + fHeight / 2); + CPDF_Point pt4(crBBox.left + fWidth / 2, crBBox.bottom); csAP << pt1.x << " " << pt1.y << " m\n"; csAP << pt2.x << " " << pt2.y << " l\n"; @@ -258,7 +257,7 @@ CFX_ByteString CPWL_Utils::GetAP_Diamond(const CFX_FloatRect& crBBox) { return csAP.GetByteString(); } -CFX_ByteString CPWL_Utils::GetAP_Square(const CFX_FloatRect& crBBox) { +CFX_ByteString CPWL_Utils::GetAP_Square(const CPDF_Rect& crBBox) { CFX_ByteTextBuf csAP; csAP << crBBox.left << " " << crBBox.top << " m\n"; @@ -270,13 +269,13 @@ CFX_ByteString CPWL_Utils::GetAP_Square(const CFX_FloatRect& crBBox) { return csAP.GetByteString(); } -CFX_ByteString CPWL_Utils::GetAP_Star(const CFX_FloatRect& crBBox) { +CFX_ByteString CPWL_Utils::GetAP_Star(const CPDF_Rect& crBBox) { CFX_ByteTextBuf csAP; FX_FLOAT fRadius = (crBBox.top - crBBox.bottom) / (1 + (FX_FLOAT)cos(FX_PI / 5.0f)); - CFX_FloatPoint ptCenter = CFX_FloatPoint((crBBox.left + crBBox.right) / 2.0f, - (crBBox.top + crBBox.bottom) / 2.0f); + CPDF_Point ptCenter = CPDF_Point((crBBox.left + crBBox.right) / 2.0f, + (crBBox.top + crBBox.bottom) / 2.0f); FX_FLOAT px[5], py[5]; @@ -302,16 +301,16 @@ CFX_ByteString CPWL_Utils::GetAP_Star(const CFX_FloatRect& crBBox) { return csAP.GetByteString(); } -CFX_ByteString CPWL_Utils::GetAP_HalfCircle(const CFX_FloatRect& crBBox, +CFX_ByteString CPWL_Utils::GetAP_HalfCircle(const CPDF_Rect& crBBox, FX_FLOAT fRotate) { CFX_ByteTextBuf csAP; FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; - CFX_FloatPoint pt1(-fWidth / 2, 0); - CFX_FloatPoint pt2(0, fHeight / 2); - CFX_FloatPoint pt3(fWidth / 2, 0); + CPDF_Point pt1(-fWidth / 2, 0); + CPDF_Point pt2(0, fHeight / 2); + CPDF_Point pt3(fWidth / 2, 0); FX_FLOAT px, py; @@ -337,42 +336,39 @@ CFX_ByteString CPWL_Utils::GetAP_HalfCircle(const CFX_FloatRect& crBBox, return csAP.GetByteString(); } -CFX_FloatRect CPWL_Utils::InflateRect(const CFX_FloatRect& rcRect, - FX_FLOAT fSize) { +CPDF_Rect CPWL_Utils::InflateRect(const CPDF_Rect& rcRect, FX_FLOAT fSize) { if (rcRect.IsEmpty()) return rcRect; - CFX_FloatRect rcNew(rcRect.left - fSize, rcRect.bottom - fSize, - rcRect.right + fSize, rcRect.top + fSize); + CPDF_Rect rcNew(rcRect.left - fSize, rcRect.bottom - fSize, + rcRect.right + fSize, rcRect.top + fSize); rcNew.Normalize(); return rcNew; } -CFX_FloatRect CPWL_Utils::DeflateRect(const CFX_FloatRect& rcRect, - FX_FLOAT fSize) { +CPDF_Rect CPWL_Utils::DeflateRect(const CPDF_Rect& rcRect, FX_FLOAT fSize) { if (rcRect.IsEmpty()) return rcRect; - CFX_FloatRect rcNew(rcRect.left + fSize, rcRect.bottom + fSize, - rcRect.right - fSize, rcRect.top - fSize); + CPDF_Rect rcNew(rcRect.left + fSize, rcRect.bottom + fSize, + rcRect.right - fSize, rcRect.top - fSize); rcNew.Normalize(); return rcNew; } -CFX_FloatRect CPWL_Utils::ScaleRect(const CFX_FloatRect& rcRect, - FX_FLOAT fScale) { +CPDF_Rect CPWL_Utils::ScaleRect(const CPDF_Rect& rcRect, FX_FLOAT fScale) { FX_FLOAT fHalfWidth = (rcRect.right - rcRect.left) / 2.0f; FX_FLOAT fHalfHeight = (rcRect.top - rcRect.bottom) / 2.0f; - CFX_FloatPoint ptCenter = CFX_FloatPoint((rcRect.left + rcRect.right) / 2, - (rcRect.top + rcRect.bottom) / 2); + CPDF_Point ptCenter = CPDF_Point((rcRect.left + rcRect.right) / 2, + (rcRect.top + rcRect.bottom) / 2); - return CFX_FloatRect( + return CPDF_Rect( ptCenter.x - fHalfWidth * fScale, ptCenter.y - fHalfHeight * fScale, ptCenter.x + fHalfWidth * fScale, ptCenter.y + fHalfHeight * fScale); } -CFX_ByteString CPWL_Utils::GetRectFillAppStream(const CFX_FloatRect& rect, +CFX_ByteString CPWL_Utils::GetRectFillAppStream(const CPDF_Rect& rect, const CPWL_Color& color) { CFX_ByteTextBuf sAppStream; @@ -387,7 +383,7 @@ CFX_ByteString CPWL_Utils::GetRectFillAppStream(const CFX_FloatRect& rect, return sAppStream.GetByteString(); } -CFX_ByteString CPWL_Utils::GetCircleFillAppStream(const CFX_FloatRect& rect, +CFX_ByteString CPWL_Utils::GetCircleFillAppStream(const CPDF_Rect& rect, const CPWL_Color& color) { CFX_ByteTextBuf sAppStream; @@ -399,7 +395,7 @@ CFX_ByteString CPWL_Utils::GetCircleFillAppStream(const CFX_FloatRect& rect, return sAppStream.GetByteString(); } -CFX_FloatRect CPWL_Utils::GetCenterSquare(const CFX_FloatRect& rect) { +CPDF_Rect CPWL_Utils::GetCenterSquare(const CPDF_Rect& rect) { FX_FLOAT fWidth = rect.right - rect.left; FX_FLOAT fHeight = rect.top - rect.bottom; @@ -408,12 +404,12 @@ CFX_FloatRect CPWL_Utils::GetCenterSquare(const CFX_FloatRect& rect) { FX_FLOAT fRadius = (fWidth > fHeight) ? fHeight / 2 : fWidth / 2; - return CFX_FloatRect(fCenterX - fRadius, fCenterY - fRadius, - fCenterX + fRadius, fCenterY + fRadius); + return CPDF_Rect(fCenterX - fRadius, fCenterY - fRadius, fCenterX + fRadius, + fCenterY + fRadius); } CFX_ByteString CPWL_Utils::GetEditAppStream(IFX_Edit* pEdit, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, FX_BOOL bContinuous, FX_WORD SubWord) { @@ -422,7 +418,7 @@ CFX_ByteString CPWL_Utils::GetEditAppStream(IFX_Edit* pEdit, } CFX_ByteString CPWL_Utils::GetEditSelAppStream(IFX_Edit* pEdit, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange) { return IFX_Edit::GetSelectAppearanceStream(pEdit, ptOffset, pRange); } @@ -449,7 +445,7 @@ static CFX_ByteString GetSquigglyAppearanceStream(FX_FLOAT fStartX, static CFX_ByteString GetWordSpellCheckAppearanceStream( IFX_Edit_Iterator* pIterator, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, const CPVT_WordRange& wrWord) { CFX_ByteTextBuf sRet; @@ -508,7 +504,7 @@ static CFX_ByteString GetWordSpellCheckAppearanceStream( CFX_ByteString CPWL_Utils::GetSpellCheckAppStream( IFX_Edit* pEdit, IPWL_SpellCheck* pSpellCheck, - const CFX_FloatPoint& ptOffset, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange) { CFX_ByteTextBuf sRet; @@ -573,7 +569,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream( return sRet.GetByteString(); } -CFX_ByteString CPWL_Utils::GetTextAppStream(const CFX_FloatRect& rcBBox, +CFX_ByteString CPWL_Utils::GetTextAppStream(const CPDF_Rect& rcBBox, IFX_Edit_FontMap* pFontMap, const CFX_WideString& sText, int32_t nAlignmentH, @@ -600,7 +596,7 @@ CFX_ByteString CPWL_Utils::GetTextAppStream(const CFX_FloatRect& rcBBox, pEdit->SetText(sText.c_str()); CFX_ByteString sEdit = - CPWL_Utils::GetEditAppStream(pEdit, CFX_FloatPoint(0.0f, 0.0f)); + CPWL_Utils::GetEditAppStream(pEdit, CPDF_Point(0.0f, 0.0f)); if (sEdit.GetLength() > 0) { sRet << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit << "ET\n"; @@ -611,7 +607,7 @@ CFX_ByteString CPWL_Utils::GetTextAppStream(const CFX_FloatRect& rcBBox, return sRet.GetByteString(); } -CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox, +CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect& rcBBox, IFX_Edit_FontMap* pFontMap, CPDF_Stream* pIconStream, CPDF_IconFit& IconFit, @@ -635,7 +631,7 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox, pEdit->Initialize(); pEdit->SetText(sLabel.c_str()); - CFX_FloatRect rcLabelContent = pEdit->GetContentRect(); + CPDF_Rect rcLabelContent = pEdit->GetContentRect(); CPWL_Icon Icon; PWL_CREATEPARAM cp; cp.dwFlags = PWS_VISIBLE; @@ -643,45 +639,45 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox, Icon.SetIconFit(&IconFit); Icon.SetPDFStream(pIconStream); - CFX_FloatRect rcLabel = CFX_FloatRect(0, 0, 0, 0); - CFX_FloatRect rcIcon = CFX_FloatRect(0, 0, 0, 0); + CPDF_Rect rcLabel = CPDF_Rect(0, 0, 0, 0); + CPDF_Rect rcIcon = CPDF_Rect(0, 0, 0, 0); FX_FLOAT fWidth = 0.0f; FX_FLOAT fHeight = 0.0f; switch (nLayOut) { case PPBL_LABEL: rcLabel = rcBBox; - rcIcon = CFX_FloatRect(0, 0, 0, 0); + rcIcon = CPDF_Rect(0, 0, 0, 0); break; case PPBL_ICON: rcIcon = rcBBox; - rcLabel = CFX_FloatRect(0, 0, 0, 0); + rcLabel = CPDF_Rect(0, 0, 0, 0); break; case PPBL_ICONTOPLABELBOTTOM: if (pIconStream) { if (IsFloatZero(fFontSize)) { fHeight = rcBBox.top - rcBBox.bottom; - rcLabel = CFX_FloatRect(rcBBox.left, rcBBox.bottom, rcBBox.right, - rcBBox.bottom + fHeight * fAutoFontScale); - rcIcon = CFX_FloatRect(rcBBox.left, rcLabel.top, rcBBox.right, - rcBBox.top); + rcLabel = CPDF_Rect(rcBBox.left, rcBBox.bottom, rcBBox.right, + rcBBox.bottom + fHeight * fAutoFontScale); + rcIcon = + CPDF_Rect(rcBBox.left, rcLabel.top, rcBBox.right, rcBBox.top); } else { fHeight = rcLabelContent.Height(); if (rcBBox.bottom + fHeight > rcBBox.top) { - rcIcon = CFX_FloatRect(0, 0, 0, 0); + rcIcon = CPDF_Rect(0, 0, 0, 0); rcLabel = rcBBox; } else { - rcLabel = CFX_FloatRect(rcBBox.left, rcBBox.bottom, rcBBox.right, - rcBBox.bottom + fHeight); - rcIcon = CFX_FloatRect(rcBBox.left, rcLabel.top, rcBBox.right, - rcBBox.top); + rcLabel = CPDF_Rect(rcBBox.left, rcBBox.bottom, rcBBox.right, + rcBBox.bottom + fHeight); + rcIcon = + CPDF_Rect(rcBBox.left, rcLabel.top, rcBBox.right, rcBBox.top); } } } else { rcLabel = rcBBox; - rcIcon = CFX_FloatRect(0, 0, 0, 0); + rcIcon = CPDF_Rect(0, 0, 0, 0); } break; @@ -690,27 +686,27 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox, if (pIconStream) { if (IsFloatZero(fFontSize)) { fHeight = rcBBox.top - rcBBox.bottom; - rcLabel = CFX_FloatRect(rcBBox.left, - rcBBox.top - fHeight * fAutoFontScale, - rcBBox.right, rcBBox.top); - rcIcon = CFX_FloatRect(rcBBox.left, rcBBox.bottom, rcBBox.right, - rcLabel.bottom); + rcLabel = + CPDF_Rect(rcBBox.left, rcBBox.top - fHeight * fAutoFontScale, + rcBBox.right, rcBBox.top); + rcIcon = CPDF_Rect(rcBBox.left, rcBBox.bottom, rcBBox.right, + rcLabel.bottom); } else { fHeight = rcLabelContent.Height(); if (rcBBox.bottom + fHeight > rcBBox.top) { - rcIcon = CFX_FloatRect(0, 0, 0, 0); + rcIcon = CPDF_Rect(0, 0, 0, 0); rcLabel = rcBBox; } else { - rcLabel = CFX_FloatRect(rcBBox.left, rcBBox.top - fHeight, - rcBBox.right, rcBBox.top); - rcIcon = CFX_FloatRect(rcBBox.left, rcBBox.bottom, rcBBox.right, - rcLabel.bottom); + rcLabel = CPDF_Rect(rcBBox.left, rcBBox.top - fHeight, + rcBBox.right, rcBBox.top); + rcIcon = CPDF_Rect(rcBBox.left, rcBBox.bottom, rcBBox.right, + rcLabel.bottom); } } } else { rcLabel = rcBBox; - rcIcon = CFX_FloatRect(0, 0, 0, 0); + rcIcon = CPDF_Rect(0, 0, 0, 0); } break; @@ -719,22 +715,21 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox, if (pIconStream) { if (IsFloatZero(fFontSize)) { fWidth = rcBBox.right - rcBBox.left; - rcLabel = CFX_FloatRect(rcBBox.right - fWidth * fAutoFontScale, - rcBBox.bottom, rcBBox.right, rcBBox.top); - rcIcon = CFX_FloatRect(rcBBox.left, rcBBox.bottom, rcLabel.left, - rcBBox.top); + rcLabel = CPDF_Rect(rcBBox.right - fWidth * fAutoFontScale, + rcBBox.bottom, rcBBox.right, rcBBox.top); + rcIcon = + CPDF_Rect(rcBBox.left, rcBBox.bottom, rcLabel.left, rcBBox.top); if (rcLabelContent.Width() < fWidth * fAutoFontScale) { } else { if (rcLabelContent.Width() < fWidth) { - rcLabel = - CFX_FloatRect(rcBBox.right - rcLabelContent.Width(), - rcBBox.bottom, rcBBox.right, rcBBox.top); - rcIcon = CFX_FloatRect(rcBBox.left, rcBBox.bottom, rcLabel.left, - rcBBox.top); + rcLabel = CPDF_Rect(rcBBox.right - rcLabelContent.Width(), + rcBBox.bottom, rcBBox.right, rcBBox.top); + rcIcon = CPDF_Rect(rcBBox.left, rcBBox.bottom, rcLabel.left, + rcBBox.top); } else { rcLabel = rcBBox; - rcIcon = CFX_FloatRect(0, 0, 0, 0); + rcIcon = CPDF_Rect(0, 0, 0, 0); } } } else { @@ -742,17 +737,17 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox, if (rcBBox.left + fWidth > rcBBox.right) { rcLabel = rcBBox; - rcIcon = CFX_FloatRect(0, 0, 0, 0); + rcIcon = CPDF_Rect(0, 0, 0, 0); } else { - rcLabel = CFX_FloatRect(rcBBox.right - fWidth, rcBBox.bottom, - rcBBox.right, rcBBox.top); - rcIcon = CFX_FloatRect(rcBBox.left, rcBBox.bottom, rcLabel.left, - rcBBox.top); + rcLabel = CPDF_Rect(rcBBox.right - fWidth, rcBBox.bottom, + rcBBox.right, rcBBox.top); + rcIcon = CPDF_Rect(rcBBox.left, rcBBox.bottom, rcLabel.left, + rcBBox.top); } } } else { rcLabel = rcBBox; - rcIcon = CFX_FloatRect(0, 0, 0, 0); + rcIcon = CPDF_Rect(0, 0, 0, 0); } break; @@ -761,23 +756,23 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox, if (pIconStream) { if (IsFloatZero(fFontSize)) { fWidth = rcBBox.right - rcBBox.left; - rcLabel = CFX_FloatRect(rcBBox.left, rcBBox.bottom, - rcBBox.left + fWidth * fAutoFontScale, - rcBBox.top); - rcIcon = CFX_FloatRect(rcLabel.right, rcBBox.bottom, rcBBox.right, - rcBBox.top); + rcLabel = + CPDF_Rect(rcBBox.left, rcBBox.bottom, + rcBBox.left + fWidth * fAutoFontScale, rcBBox.top); + rcIcon = CPDF_Rect(rcLabel.right, rcBBox.bottom, rcBBox.right, + rcBBox.top); if (rcLabelContent.Width() < fWidth * fAutoFontScale) { } else { if (rcLabelContent.Width() < fWidth) { - rcLabel = CFX_FloatRect(rcBBox.left, rcBBox.bottom, - rcBBox.left + rcLabelContent.Width(), - rcBBox.top); - rcIcon = CFX_FloatRect(rcLabel.right, rcBBox.bottom, - rcBBox.right, rcBBox.top); + rcLabel = + CPDF_Rect(rcBBox.left, rcBBox.bottom, + rcBBox.left + rcLabelContent.Width(), rcBBox.top); + rcIcon = CPDF_Rect(rcLabel.right, rcBBox.bottom, rcBBox.right, + rcBBox.top); } else { rcLabel = rcBBox; - rcIcon = CFX_FloatRect(0, 0, 0, 0); + rcIcon = CPDF_Rect(0, 0, 0, 0); } } } else { @@ -785,17 +780,17 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox, if (rcBBox.left + fWidth > rcBBox.right) { rcLabel = rcBBox; - rcIcon = CFX_FloatRect(0, 0, 0, 0); + rcIcon = CPDF_Rect(0, 0, 0, 0); } else { - rcLabel = CFX_FloatRect(rcBBox.left, rcBBox.bottom, - rcBBox.left + fWidth, rcBBox.top); - rcIcon = CFX_FloatRect(rcLabel.right, rcBBox.bottom, rcBBox.right, - rcBBox.top); + rcLabel = CPDF_Rect(rcBBox.left, rcBBox.bottom, + rcBBox.left + fWidth, rcBBox.top); + rcIcon = CPDF_Rect(rcLabel.right, rcBBox.bottom, rcBBox.right, + rcBBox.top); } } } else { rcLabel = rcBBox; - rcIcon = CFX_FloatRect(0, 0, 0, 0); + rcIcon = CPDF_Rect(0, 0, 0, 0); } break; @@ -817,7 +812,7 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox, if (!rcLabel.IsEmpty()) { pEdit->SetPlateRect(rcLabel); CFX_ByteString sEdit = - CPWL_Utils::GetEditAppStream(pEdit, CFX_FloatPoint(0.0f, 0.0f)); + CPWL_Utils::GetEditAppStream(pEdit, CPDF_Point(0.0f, 0.0f)); if (sEdit.GetLength() > 0) { sTemp << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit << "ET\n"; @@ -863,7 +858,7 @@ CFX_ByteString CPWL_Utils::GetColorAppStream(const CPWL_Color& color, return sColorStream.GetByteString(); } -CFX_ByteString CPWL_Utils::GetBorderAppStream(const CFX_FloatRect& rect, +CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect& rect, FX_FLOAT fWidth, const CPWL_Color& color, const CPWL_Color& crLeftTop, @@ -980,7 +975,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CFX_FloatRect& rect, } CFX_ByteString CPWL_Utils::GetCircleBorderAppStream( - const CFX_FloatRect& rect, + const CPDF_Rect& rect, FX_FLOAT fWidth, const CPWL_Color& color, const CPWL_Color& crLeftTop, @@ -1129,7 +1124,7 @@ CPWL_Color CPWL_Utils::DevideColor(const CPWL_Color& sColor, return sRet; } -CFX_ByteString CPWL_Utils::GetAppStream_Check(const CFX_FloatRect& rcBBox, +CFX_ByteString CPWL_Utils::GetAppStream_Check(const CPDF_Rect& rcBBox, const CPWL_Color& crText) { CFX_ByteTextBuf sAP; sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText, TRUE) @@ -1137,7 +1132,7 @@ CFX_ByteString CPWL_Utils::GetAppStream_Check(const CFX_FloatRect& rcBBox, return sAP.GetByteString(); } -CFX_ByteString CPWL_Utils::GetAppStream_Circle(const CFX_FloatRect& rcBBox, +CFX_ByteString CPWL_Utils::GetAppStream_Circle(const CPDF_Rect& rcBBox, const CPWL_Color& crText) { CFX_ByteTextBuf sAP; sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText, TRUE) @@ -1145,7 +1140,7 @@ CFX_ByteString CPWL_Utils::GetAppStream_Circle(const CFX_FloatRect& rcBBox, return sAP.GetByteString(); } -CFX_ByteString CPWL_Utils::GetAppStream_Cross(const CFX_FloatRect& rcBBox, +CFX_ByteString CPWL_Utils::GetAppStream_Cross(const CPDF_Rect& rcBBox, const CPWL_Color& crText) { CFX_ByteTextBuf sAP; sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText, FALSE) @@ -1153,7 +1148,7 @@ CFX_ByteString CPWL_Utils::GetAppStream_Cross(const CFX_FloatRect& rcBBox, return sAP.GetByteString(); } -CFX_ByteString CPWL_Utils::GetAppStream_Diamond(const CFX_FloatRect& rcBBox, +CFX_ByteString CPWL_Utils::GetAppStream_Diamond(const CPDF_Rect& rcBBox, const CPWL_Color& crText) { CFX_ByteTextBuf sAP; sAP << "q\n1 w\n" << CPWL_Utils::GetColorAppStream(crText, TRUE) @@ -1161,7 +1156,7 @@ CFX_ByteString CPWL_Utils::GetAppStream_Diamond(const CFX_FloatRect& rcBBox, return sAP.GetByteString(); } -CFX_ByteString CPWL_Utils::GetAppStream_Square(const CFX_FloatRect& rcBBox, +CFX_ByteString CPWL_Utils::GetAppStream_Square(const CPDF_Rect& rcBBox, const CPWL_Color& crText) { CFX_ByteTextBuf sAP; sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText, TRUE) @@ -1169,7 +1164,7 @@ CFX_ByteString CPWL_Utils::GetAppStream_Square(const CFX_FloatRect& rcBBox, return sAP.GetByteString(); } -CFX_ByteString CPWL_Utils::GetAppStream_Star(const CFX_FloatRect& rcBBox, +CFX_ByteString CPWL_Utils::GetAppStream_Star(const CPDF_Rect& rcBBox, const CPWL_Color& crText) { CFX_ByteTextBuf sAP; sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText, TRUE) @@ -1177,10 +1172,10 @@ CFX_ByteString CPWL_Utils::GetAppStream_Star(const CFX_FloatRect& rcBBox, return sAP.GetByteString(); } -CFX_ByteString CPWL_Utils::GetCheckBoxAppStream(const CFX_FloatRect& rcBBox, +CFX_ByteString CPWL_Utils::GetCheckBoxAppStream(const CPDF_Rect& rcBBox, int32_t nStyle, const CPWL_Color& crText) { - CFX_FloatRect rcCenter = GetCenterSquare(rcBBox); + CPDF_Rect rcCenter = GetCenterSquare(rcBBox); switch (nStyle) { default: case PCS_CHECK: @@ -1198,10 +1193,10 @@ CFX_ByteString CPWL_Utils::GetCheckBoxAppStream(const CFX_FloatRect& rcBBox, } } -CFX_ByteString CPWL_Utils::GetRadioButtonAppStream(const CFX_FloatRect& rcBBox, +CFX_ByteString CPWL_Utils::GetRadioButtonAppStream(const CPDF_Rect& rcBBox, int32_t nStyle, const CPWL_Color& crText) { - CFX_FloatRect rcCenter = GetCenterSquare(rcBBox); + CPDF_Rect rcCenter = GetCenterSquare(rcBBox); switch (nStyle) { default: case PCS_CHECK: @@ -1219,7 +1214,7 @@ CFX_ByteString CPWL_Utils::GetRadioButtonAppStream(const CFX_FloatRect& rcBBox, } } -CFX_ByteString CPWL_Utils::GetDropButtonAppStream(const CFX_FloatRect& rcBBox) { +CFX_ByteString CPWL_Utils::GetDropButtonAppStream(const CPDF_Rect& rcBBox) { CFX_ByteTextBuf sAppStream; if (!rcBBox.IsEmpty()) { @@ -1239,8 +1234,8 @@ CFX_ByteString CPWL_Utils::GetDropButtonAppStream(const CFX_FloatRect& rcBBox) { CPWL_Dash(3, 0, 0)) << "Q\n"; - CFX_FloatPoint ptCenter = CFX_FloatPoint((rcBBox.left + rcBBox.right) / 2, - (rcBBox.top + rcBBox.bottom) / 2); + CPDF_Point ptCenter = CPDF_Point((rcBBox.left + rcBBox.right) / 2, + (rcBBox.top + rcBBox.bottom) / 2); if (IsFloatBigger(rcBBox.right - rcBBox.left, 6) && IsFloatBigger(rcBBox.top - rcBBox.bottom, 6)) { sAppStream << "q\n" @@ -1370,17 +1365,17 @@ FX_COLORREF CPWL_Utils::PWLColorToFXColor(const CPWL_Color& color, void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CFX_FloatRect& rect, + const CPDF_Rect& rect, const FX_COLORREF& color) { CFX_PathData path; - CFX_FloatRect rcTemp(rect); + CPDF_Rect rcTemp(rect); path.AppendRect(rcTemp.left, rcTemp.bottom, rcTemp.right, rcTemp.top); pDevice->DrawPath(&path, pUser2Device, NULL, color, 0, FXFILL_WINDING); } void CPWL_Utils::DrawFillArea(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CFX_FloatPoint* pPts, + const CPDF_Point* pPts, int32_t nCount, const FX_COLORREF& color) { CFX_PathData path; @@ -1395,11 +1390,11 @@ void CPWL_Utils::DrawFillArea(CFX_RenderDevice* pDevice, void CPWL_Utils::DrawStrokeRect(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CFX_FloatRect& rect, + const CPDF_Rect& rect, const FX_COLORREF& color, FX_FLOAT fWidth) { CFX_PathData path; - CFX_FloatRect rcTemp(rect); + CPDF_Rect rcTemp(rect); path.AppendRect(rcTemp.left, rcTemp.bottom, rcTemp.right, rcTemp.top); CFX_GraphStateData gsd; @@ -1410,8 +1405,8 @@ void CPWL_Utils::DrawStrokeRect(CFX_RenderDevice* pDevice, void CPWL_Utils::DrawStrokeLine(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CFX_FloatPoint& ptMoveTo, - const CFX_FloatPoint& ptLineTo, + const CPDF_Point& ptMoveTo, + const CPDF_Point& ptLineTo, const FX_COLORREF& color, FX_FLOAT fWidth) { CFX_PathData path; @@ -1427,7 +1422,7 @@ void CPWL_Utils::DrawStrokeLine(CFX_RenderDevice* pDevice, void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CFX_FloatRect& rect, + const CPDF_Rect& rect, const CPWL_Color& color, int32_t nTransparancy) { CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rect, @@ -1438,7 +1433,7 @@ void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, FX_BOOL bVertical, FX_BOOL bHorizontal, - CFX_FloatRect rect, + CPDF_Rect rect, int32_t nTransparancy, int32_t nStartGray, int32_t nEndGray) { @@ -1450,8 +1445,8 @@ void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice, for (FX_FLOAT fy = rect.bottom + 0.5f; fy <= rect.top - 0.5f; fy += 1.0f) { int32_t nGray = nStartGray + (int32_t)(fStepGray * (fy - rect.bottom)); CPWL_Utils::DrawStrokeLine( - pDevice, pUser2Device, CFX_FloatPoint(rect.left, fy), - CFX_FloatPoint(rect.right, fy), + pDevice, pUser2Device, CPDF_Point(rect.left, fy), + CPDF_Point(rect.right, fy), ArgbEncode(nTransparancy, nGray, nGray, nGray), 1.5f); } } @@ -1462,8 +1457,8 @@ void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice, for (FX_FLOAT fx = rect.left + 0.5f; fx <= rect.right - 0.5f; fx += 1.0f) { int32_t nGray = nStartGray + (int32_t)(fStepGray * (fx - rect.left)); CPWL_Utils::DrawStrokeLine( - pDevice, pUser2Device, CFX_FloatPoint(fx, rect.bottom), - CFX_FloatPoint(fx, rect.top), + pDevice, pUser2Device, CPDF_Point(fx, rect.bottom), + CPDF_Point(fx, rect.top), ArgbEncode(nTransparancy, nGray, nGray, nGray), 1.5f); } } @@ -1471,7 +1466,7 @@ void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice, void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CFX_FloatRect& rect, + const CPDF_Rect& rect, FX_FLOAT fWidth, const CPWL_Color& color, const CPWL_Color& crLeftTop, @@ -1678,8 +1673,8 @@ static void AddSpellCheckObj(CFX_PathData& PathData, void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, IFX_Edit* pEdit, - const CFX_FloatRect& rcClip, - const CFX_FloatPoint& ptOffset, + const CPDF_Rect& rcClip, + const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, IPWL_SpellCheck* pSpellCheck) { const FX_COLORREF crSpell = ArgbEncode(255, 255, 0, 0); @@ -1694,7 +1689,7 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, pDevice->SaveState(); if (!rcClip.IsEmpty()) { - CFX_FloatRect rcTemp = rcClip; + CPDF_Rect rcTemp = rcClip; pUser2Device->TransformRect(rcTemp); FX_RECT rcDevClip; rcDevClip.left = (int32_t)rcTemp.left; @@ -1817,7 +1812,7 @@ CPWL_Color CPWL_Utils::GetReverseColor(const CPWL_Color& color) { } CFX_ByteString CPWL_Utils::GetIconAppStream(int32_t nType, - const CFX_FloatRect& rect, + const CPDF_Rect& rect, const CPWL_Color& crFill, const CPWL_Color& crStroke) { CFX_ByteString sAppStream = CPWL_Utils::GetColorAppStream(crStroke, FALSE); @@ -1901,7 +1896,7 @@ CFX_ByteString CPWL_Utils::GetIconAppStream(int32_t nType, void CPWL_Utils::DrawIconAppStream(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, int32_t nType, - const CFX_FloatRect& rect, + const CPDF_Rect& rect, const CPWL_Color& crFill, const CPWL_Color& crStroke, const int32_t nTransparancy) { @@ -1983,7 +1978,7 @@ void CPWL_Utils::DrawIconAppStream(CFX_RenderDevice* pDevice, void CPWL_Utils::GetGraphics_Checkmark(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; @@ -2070,7 +2065,7 @@ void CPWL_Utils::GetGraphics_Checkmark(CFX_ByteString& sPathData, void CPWL_Utils::GetGraphics_Circle(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; @@ -2193,7 +2188,7 @@ void CPWL_Utils::GetGraphics_Circle(CFX_ByteString& sPathData, void CPWL_Utils::GetGraphics_Comment(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; @@ -2312,7 +2307,7 @@ void CPWL_Utils::GetGraphics_Comment(CFX_ByteString& sPathData, void CPWL_Utils::GetGraphics_Cross(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; @@ -2369,7 +2364,7 @@ void CPWL_Utils::GetGraphics_Cross(CFX_ByteString& sPathData, void CPWL_Utils::GetGraphics_Help(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; @@ -2599,7 +2594,7 @@ void CPWL_Utils::GetGraphics_Help(CFX_ByteString& sPathData, void CPWL_Utils::GetGraphics_InsertText(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; @@ -2626,7 +2621,7 @@ void CPWL_Utils::GetGraphics_InsertText(CFX_ByteString& sPathData, void CPWL_Utils::GetGraphics_Key(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; @@ -2757,7 +2752,7 @@ void CPWL_Utils::GetGraphics_Key(CFX_ByteString& sPathData, void CPWL_Utils::GetGraphics_NewParagraph(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; @@ -2861,7 +2856,7 @@ void CPWL_Utils::GetGraphics_NewParagraph(CFX_ByteString& sPathData, void CPWL_Utils::GetGraphics_TextNote(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; @@ -2927,7 +2922,7 @@ void CPWL_Utils::GetGraphics_TextNote(CFX_ByteString& sPathData, void CPWL_Utils::GetGraphics_Paragraph(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; @@ -2978,7 +2973,7 @@ void CPWL_Utils::GetGraphics_Paragraph(CFX_ByteString& sPathData, void CPWL_Utils::GetGraphics_RightArrow(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; @@ -3023,7 +3018,7 @@ void CPWL_Utils::GetGraphics_RightArrow(CFX_ByteString& sPathData, void CPWL_Utils::GetGraphics_RightPointer(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; @@ -3053,14 +3048,14 @@ void CPWL_Utils::GetGraphics_RightPointer(CFX_ByteString& sPathData, void CPWL_Utils::GetGraphics_Star(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fLongRadius = (crBBox.top - crBBox.bottom) / (1 + (FX_FLOAT)cos(FX_PI / 5.0f)); fLongRadius = fLongRadius * 0.7f; FX_FLOAT fShortRadius = fLongRadius * 0.55f; - CFX_FloatPoint ptCenter = CFX_FloatPoint((crBBox.left + crBBox.right) / 2.0f, - (crBBox.top + crBBox.bottom) / 2.0f); + CPDF_Point ptCenter = CPDF_Point((crBBox.left + crBBox.right) / 2.0f, + (crBBox.top + crBBox.bottom) / 2.0f); FX_FLOAT px1[5], py1[5]; FX_FLOAT px2[5], py2[5]; @@ -3104,7 +3099,7 @@ void CPWL_Utils::GetGraphics_Star(CFX_ByteString& sPathData, void CPWL_Utils::GetGraphics_UpArrow(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; @@ -3143,7 +3138,7 @@ void CPWL_Utils::GetGraphics_UpArrow(CFX_ByteString& sPathData, void CPWL_Utils::GetGraphics_UpLeftArrow(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; @@ -3198,7 +3193,7 @@ void CPWL_Utils::GetGraphics_UpLeftArrow(CFX_ByteString& sPathData, void CPWL_Utils::GetGraphics_Graph(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; @@ -3276,7 +3271,7 @@ void CPWL_Utils::GetGraphics_Graph(CFX_ByteString& sPathData, void CPWL_Utils::GetGraphics_Paperclip(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; @@ -3419,7 +3414,7 @@ void CPWL_Utils::GetGraphics_Paperclip(CFX_ByteString& sPathData, void CPWL_Utils::GetGraphics_Attachment(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; @@ -3515,7 +3510,7 @@ void CPWL_Utils::GetGraphics_Attachment(CFX_ByteString& sPathData, void CPWL_Utils::GetGraphics_Tag(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; @@ -3566,12 +3561,12 @@ void CPWL_Utils::GetGraphics_Tag(CFX_ByteString& sPathData, void CPWL_Utils::GetGraphics_Foxit(CFX_ByteString& sPathData, CFX_PathData& path, - const CFX_FloatRect& crBBox, + const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) { FX_FLOAT fOutWidth = crBBox.right - crBBox.left; FX_FLOAT fOutHeight = crBBox.top - crBBox.bottom; - CFX_FloatRect crInBox = crBBox; + CPDF_Rect crInBox = crBBox; crInBox.left = crBBox.left + fOutWidth * 0.08f; crInBox.right = crBBox.right - fOutWidth * 0.08f; crInBox.top = crBBox.top - fOutHeight * 0.08f; diff --git a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp index 28bd0e04ed..d0aaa78ea4 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp @@ -273,11 +273,9 @@ void CPWL_Wnd::Destroy() { m_pVScrollBar = NULL; } -void CPWL_Wnd::Move(const CFX_FloatRect& rcNew, - FX_BOOL bReset, - FX_BOOL bRefresh) { +void CPWL_Wnd::Move(const CPDF_Rect& rcNew, FX_BOOL bReset, FX_BOOL bRefresh) { if (IsValid()) { - CFX_FloatRect rcOld = GetWindowRect(); + CPDF_Rect rcOld = GetWindowRect(); m_rcWindow = rcNew; m_rcWindow.Normalize(); @@ -296,9 +294,9 @@ void CPWL_Wnd::Move(const CFX_FloatRect& rcNew, } } -void CPWL_Wnd::InvalidateRectMove(const CFX_FloatRect& rcOld, - const CFX_FloatRect& rcNew) { - CFX_FloatRect rcUnion = rcOld; +void CPWL_Wnd::InvalidateRectMove(const CPDF_Rect& rcOld, + const CPDF_Rect& rcNew) { + CPDF_Rect rcUnion = rcOld; rcUnion.Union(rcNew); InvalidateRect(&rcUnion); @@ -313,7 +311,7 @@ void CPWL_Wnd::GetAppearanceStream(CFX_ByteTextBuf& sAppStream) { // if don't set,Get default apperance stream void CPWL_Wnd::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { - CFX_FloatRect rectWnd = GetWindowRect(); + CPDF_Rect rectWnd = GetWindowRect(); if (!rectWnd.IsEmpty()) { CFX_ByteTextBuf sThis; @@ -350,10 +348,10 @@ void CPWL_Wnd::DrawAppearance(CFX_RenderDevice* pDevice, void CPWL_Wnd::DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) { - CFX_FloatRect rectWnd = GetWindowRect(); + CPDF_Rect rectWnd = GetWindowRect(); if (!rectWnd.IsEmpty()) { if (HasFlag(PWS_BACKGROUND)) { - CFX_FloatRect rcClient = CPWL_Utils::DeflateRect( + CPDF_Rect rcClient = CPWL_Utils::DeflateRect( rectWnd, (FX_FLOAT)(GetBorderWidth() + GetInnerBorderWidth())); CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcClient, GetBackgroundColor(), GetTransparency()); @@ -383,12 +381,12 @@ void CPWL_Wnd::DrawChildAppearance(CFX_RenderDevice* pDevice, } } -void CPWL_Wnd::InvalidateRect(CFX_FloatRect* pRect) { +void CPWL_Wnd::InvalidateRect(CPDF_Rect* pRect) { if (IsValid()) { - CFX_FloatRect rcRefresh = pRect ? *pRect : GetWindowRect(); + CPDF_Rect rcRefresh = pRect ? *pRect : GetWindowRect(); if (!HasFlag(PWS_NOREFRESHCLIP)) { - CFX_FloatRect rcClip = GetClipRect(); + CPDF_Rect rcClip = GetClipRect(); if (!rcClip.IsEmpty()) { rcRefresh.Intersect(rcClip); } @@ -425,7 +423,7 @@ void CPWL_Wnd::InvalidateRect(CFX_FloatRect* pRect) { } #define PWL_IMPLEMENT_MOUSE_METHOD(mouse_method_name) \ - FX_BOOL CPWL_Wnd::mouse_method_name(const CFX_FloatPoint& point, \ + FX_BOOL CPWL_Wnd::mouse_method_name(const CPDF_Point& point, \ FX_DWORD nFlag) { \ if (IsValid() && IsVisible() && IsEnabled()) { \ if (IsWndCaptureMouse(this)) { \ @@ -469,7 +467,7 @@ PWL_IMPLEMENT_MOUSE_METHOD(OnRButtonUp) PWL_IMPLEMENT_MOUSE_METHOD(OnMouseMove) FX_BOOL CPWL_Wnd::OnMouseWheel(short zDelta, - const CFX_FloatPoint& point, + const CPDF_Point& point, FX_DWORD nFlag) { if (IsValid() && IsVisible() && IsEnabled()) { SetCursor(); @@ -530,25 +528,25 @@ CPWL_Wnd* CPWL_Wnd::GetParentWindow() const { return m_sPrivateParam.pParentWnd; } -CFX_FloatRect CPWL_Wnd::GetWindowRect() const { +CPDF_Rect CPWL_Wnd::GetWindowRect() const { return m_rcWindow; } -CFX_FloatRect CPWL_Wnd::GetClientRect() const { - CFX_FloatRect rcWindow = GetWindowRect(); - CFX_FloatRect rcClient = CPWL_Utils::DeflateRect( +CPDF_Rect CPWL_Wnd::GetClientRect() const { + CPDF_Rect rcWindow = GetWindowRect(); + CPDF_Rect rcClient = CPWL_Utils::DeflateRect( rcWindow, (FX_FLOAT)(GetBorderWidth() + GetInnerBorderWidth())); if (CPWL_ScrollBar* pVSB = GetVScrollBar()) rcClient.right -= pVSB->GetScrollBarWidth(); rcClient.Normalize(); - return rcWindow.Contains(rcClient) ? rcClient : CFX_FloatRect(); + return rcWindow.Contains(rcClient) ? rcClient : CPDF_Rect(); } -CFX_FloatPoint CPWL_Wnd::GetCenterPoint() const { - CFX_FloatRect rcClient = GetClientRect(); - return CFX_FloatPoint((rcClient.left + rcClient.right) * 0.5f, - (rcClient.top + rcClient.bottom) * 0.5f); +CPDF_Point CPWL_Wnd::GetCenterPoint() const { + CPDF_Rect rcClient = GetClientRect(); + return CPDF_Point((rcClient.left + rcClient.right) * 0.5f, + (rcClient.top + rcClient.bottom) * 0.5f); } FX_BOOL CPWL_Wnd::HasFlag(FX_DWORD dwFlags) const { @@ -684,11 +682,11 @@ void CPWL_Wnd::OnSetFocus() {} void CPWL_Wnd::OnKillFocus() {} -FX_BOOL CPWL_Wnd::WndHitTest(const CFX_FloatPoint& point) const { +FX_BOOL CPWL_Wnd::WndHitTest(const CPDF_Point& point) const { return IsValid() && IsVisible() && GetWindowRect().Contains(point.x, point.y); } -FX_BOOL CPWL_Wnd::ClientHitTest(const CFX_FloatPoint& point) const { +FX_BOOL CPWL_Wnd::ClientHitTest(const CPDF_Point& point) const { return IsValid() && IsVisible() && GetClientRect().Contains(point.x, point.y); } @@ -715,12 +713,12 @@ void CPWL_Wnd::SetVisible(FX_BOOL bVisible) { } } -void CPWL_Wnd::SetClipRect(const CFX_FloatRect& rect) { +void CPWL_Wnd::SetClipRect(const CPDF_Rect& rect) { m_rcClip = rect; m_rcClip.Normalize(); } -const CFX_FloatRect& CPWL_Wnd::GetClipRect() const { +const CPDF_Rect& CPWL_Wnd::GetClipRect() const { return m_rcClip; } @@ -729,14 +727,14 @@ FX_BOOL CPWL_Wnd::IsReadOnly() const { } void CPWL_Wnd::RePosChildWnd() { - CFX_FloatRect rcContent = CPWL_Utils::DeflateRect( + CPDF_Rect rcContent = CPWL_Utils::DeflateRect( GetWindowRect(), (FX_FLOAT)(GetBorderWidth() + GetInnerBorderWidth())); CPWL_ScrollBar* pVSB = GetVScrollBar(); - CFX_FloatRect rcVScroll = - CFX_FloatRect(rcContent.right - PWL_SCROLLBAR_WIDTH, rcContent.bottom, - rcContent.right - 1.0f, rcContent.top); + CPDF_Rect rcVScroll = + CPDF_Rect(rcContent.right - PWL_SCROLLBAR_WIDTH, rcContent.bottom, + rcContent.right - 1.0f, rcContent.top); if (pVSB) pVSB->Move(rcVScroll, TRUE, FALSE); @@ -793,7 +791,7 @@ FX_BOOL CPWL_Wnd::IsFocused() const { return FALSE; } -CFX_FloatRect CPWL_Wnd::GetFocusRect() const { +CPDF_Rect CPWL_Wnd::GetFocusRect() const { return CPWL_Utils::InflateRect(GetWindowRect(), 1); } @@ -888,18 +886,16 @@ CFX_Matrix CPWL_Wnd::GetWindowMatrix() const { return mt; } -void CPWL_Wnd::PWLtoWnd(const CFX_FloatPoint& point, - int32_t& x, - int32_t& y) const { +void CPWL_Wnd::PWLtoWnd(const CPDF_Point& point, int32_t& x, int32_t& y) const { CFX_Matrix mt = GetWindowMatrix(); - CFX_FloatPoint pt = point; + CPDF_Point pt = point; mt.Transform(pt.x, pt.y); x = (int32_t)(pt.x + 0.5); y = (int32_t)(pt.y + 0.5); } -FX_RECT CPWL_Wnd::PWLtoWnd(const CFX_FloatRect& rect) const { - CFX_FloatRect rcTemp = rect; +FX_RECT CPWL_Wnd::PWLtoWnd(const CPDF_Rect& rect) const { + CPDF_Rect rcTemp = rect; CFX_Matrix mt = GetWindowMatrix(); mt.TransformRect(rcTemp); return FX_RECT((int32_t)(rcTemp.left + 0.5), (int32_t)(rcTemp.bottom + 0.5), @@ -910,44 +906,44 @@ FX_HWND CPWL_Wnd::GetAttachedHWnd() const { return m_sPrivateParam.hAttachedWnd; } -CFX_FloatPoint CPWL_Wnd::ChildToParent(const CFX_FloatPoint& point) const { +CPDF_Point CPWL_Wnd::ChildToParent(const CPDF_Point& point) const { CFX_Matrix mt = GetChildMatrix(); if (mt.IsIdentity()) return point; - CFX_FloatPoint pt = point; + CPDF_Point pt = point; mt.Transform(pt.x, pt.y); return pt; } -CFX_FloatRect CPWL_Wnd::ChildToParent(const CFX_FloatRect& rect) const { +CPDF_Rect CPWL_Wnd::ChildToParent(const CPDF_Rect& rect) const { CFX_Matrix mt = GetChildMatrix(); if (mt.IsIdentity()) return rect; - CFX_FloatRect rc = rect; + CPDF_Rect rc = rect; mt.TransformRect(rc); return rc; } -CFX_FloatPoint CPWL_Wnd::ParentToChild(const CFX_FloatPoint& point) const { +CPDF_Point CPWL_Wnd::ParentToChild(const CPDF_Point& point) const { CFX_Matrix mt = GetChildMatrix(); if (mt.IsIdentity()) return point; mt.SetReverse(mt); - CFX_FloatPoint pt = point; + CPDF_Point pt = point; mt.Transform(pt.x, pt.y); return pt; } -CFX_FloatRect CPWL_Wnd::ParentToChild(const CFX_FloatRect& rect) const { +CPDF_Rect CPWL_Wnd::ParentToChild(const CPDF_Rect& rect) const { CFX_Matrix mt = GetChildMatrix(); if (mt.IsIdentity()) return rect; mt.SetReverse(mt); - CFX_FloatRect rc = rect; + CPDF_Rect rc = rect; mt.TransformRect(rc); return rc; } |