diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-02-26 13:09:42 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-02-26 13:09:42 -0800 |
commit | 3b8fdd34bdf57ec45291b77008a43249f838efcb (patch) | |
tree | b65090a7c1fbedcda6499c3be4ffcaf8453e9e11 /fpdfsdk/include | |
parent | 8ba5b59356d506d3b9e976e7422e69bbd5bec8d6 (diff) | |
download | pdfium-3b8fdd34bdf57ec45291b77008a43249f838efcb.tar.xz |
Replace CPDF_Rect and CPDF_Point with CFX types.
Too many rectangle types. Remove CPDF_Rect #define, and
make an equivalent point type in CFX, but stop short of
consolidating the N different forms of rectangles in CFX.
Also banish PDF_ClipFloat to the one .cpp file that needs it,
since it was in the vicinity of the .h file changes.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1740923003 .
Diffstat (limited to 'fpdfsdk/include')
27 files changed, 422 insertions, 410 deletions
diff --git a/fpdfsdk/include/formfiller/FFL_CheckBox.h b/fpdfsdk/include/formfiller/FFL_CheckBox.h index 4ffb143734..7536871f16 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 CPDF_Point& point) override; + const CFX_FloatPoint& 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 cb14397be5..4ea8fdaa8b 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 CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, @@ -106,16 +106,19 @@ class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler { CFX_Matrix GetCurMatrix(); - 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_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_Point WndtoPWL(CPDFSDK_PageView* pPageView, const CPDF_Point& pt); - CPDF_Rect FFLtoWnd(CPDFSDK_PageView* pPageView, const CPDF_Rect& rect); + CFX_FloatPoint WndtoPWL(CPDFSDK_PageView* pPageView, + const CFX_FloatPoint& pt); + CFX_FloatRect FFLtoWnd(CPDFSDK_PageView* pPageView, + const CFX_FloatRect& rect); - void SetWindowRect(CPDFSDK_PageView* pPageView, const CPDF_Rect& rcWindow); - CPDF_Rect GetWindowRect(CPDFSDK_PageView* pPageView); + void SetWindowRect(CPDFSDK_PageView* pPageView, + const CFX_FloatRect& rcWindow); + CFX_FloatRect GetWindowRect(CPDFSDK_PageView* pPageView); FX_BOOL CommitData(CPDFSDK_PageView* pPageView, FX_UINT nFlag); virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView); @@ -132,10 +135,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 CPDF_Rect GetFocusBox(CPDFSDK_PageView* pPageView); + virtual CFX_FloatRect GetFocusBox(CPDFSDK_PageView* pPageView); FX_BOOL IsValid() const; - CPDF_Rect GetPDFWindowRect() const; + CFX_FloatRect GetPDFWindowRect() const; CPDFSDK_PageView* GetCurPageView(); void SetChangeMark(); @@ -156,7 +159,7 @@ class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler { FX_BOOL m_bValid; CFFL_PageView2PDFWindow m_Maps; - CPDF_Point m_ptOldPos; + CFX_FloatPoint m_ptOldPos; }; class CFFL_Button : public CFFL_FormFiller { @@ -171,15 +174,15 @@ class CFFL_Button : public CFFL_FormFiller { FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CPDF_Point& point) override; + const CFX_FloatPoint& point) override; FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CPDF_Point& point) override; + const CFX_FloatPoint& point) override; FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CPDF_Point& point) override; + const CFX_FloatPoint& 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 93e7505f9c..cea61bf20e 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, - CPDF_Point point); + CFX_FloatPoint 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 CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& 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 a4e7928e31..dba2798e30 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 CPDF_Point& point) override; + const CFX_FloatPoint& 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 fb976a256f..fa2c8a2752 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, CPDF_Rect& pdfRect); + void FXRect2PDFRect(const CFX_RectF& fxRectF, CFX_FloatRect& 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 95b11d1823..407e94d236 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 CPDF_Point; +class CFX_FloatPoint; class IPDFSDK_AnnotHandler { public: @@ -47,12 +47,12 @@ class IPDFSDK_AnnotHandler { virtual void DeleteAnnot(CPDFSDK_Annot* pAnnot) = 0; - virtual CPDF_Rect GetViewBBox(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot) = 0; + virtual CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot) = 0; virtual FX_BOOL HitTest(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, - const CPDF_Point& point) = 0; + const CFX_FloatPoint& 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 CPDF_Rect& rcWindow, + const CFX_FloatRect& 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 CPDF_Point& point) = 0; + const CFX_FloatPoint& point) = 0; virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point) = 0; + const CFX_FloatPoint& point) = 0; virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point) = 0; + const CFX_FloatPoint& point) = 0; virtual FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point) = 0; + const CFX_FloatPoint& point) = 0; virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, - const CPDF_Point& point) = 0; + const CFX_FloatPoint& point) = 0; virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point) = 0; + const CFX_FloatPoint& point) = 0; virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point) = 0; + const CFX_FloatPoint& point) = 0; virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point) = 0; + const CFX_FloatPoint& 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 {} - CPDF_Rect GetViewBBox(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot) override; + CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot) override; FX_BOOL HitTest(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, - const CPDF_Point& point) override; + const CFX_FloatPoint& 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 CPDF_Rect& rcWindow, + const CFX_FloatRect& 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 CPDF_Point& point) override; + const CFX_FloatPoint& point) override; FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point) override; + const CFX_FloatPoint& point) override; FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point) override; + const CFX_FloatPoint& point) override; FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point) override; + const CFX_FloatPoint& point) override; FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, - const CPDF_Point& point) override; + const CFX_FloatPoint& point) override; FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point) override; + const CFX_FloatPoint& point) override; FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point) override; + const CFX_FloatPoint& point) override; FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point) override { + const CFX_FloatPoint& 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 CPDF_Rect GetViewBBox(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot); + virtual CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot); virtual FX_BOOL HitTest(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, - const CPDF_Point& point); + const CFX_FloatPoint& 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 CPDF_Rect& rcWindow, + const CFX_FloatRect& 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 CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& 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 CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL Annot_OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL Annot_OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL Annot_OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL Annot_OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL Annot_OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& point); virtual FX_BOOL Annot_OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point); + const CFX_FloatPoint& 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 CPDF_Rect Annot_OnGetViewBBox(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot); + virtual CFX_FloatRect Annot_OnGetViewBBox(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot); virtual FX_BOOL Annot_OnHitTest(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, - const CPDF_Point& point); + const CFX_FloatPoint& 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 49c25de284..c0ed529782 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 CPDF_Rect& rect) {} - virtual CPDF_Rect GetRect() const { return CPDF_Rect(); } + virtual void SetRect(const CFX_FloatRect& rect) {} + virtual CFX_FloatRect GetRect() const { return CFX_FloatRect(); } 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 CPDF_Rect& rect) override; - CPDF_Rect GetRect() const override; + void SetRect(const CFX_FloatRect& rect) override; + CFX_FloatRect 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 CPDF_Rect& rcBBox, + const CFX_FloatRect& 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 44ba5726a4..ac34528d4d 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); - CPDF_Rect GetClientRect() const; - CPDF_Rect GetRotatedRect() const; + CFX_FloatRect GetClientRect() const; + CFX_FloatRect GetRotatedRect() const; CFX_ByteString GetBackgroundAppStream() const; CFX_ByteString GetBorderAppStream() const; @@ -384,7 +384,7 @@ class CBA_AnnotIterator { private: void GenerateResults(); - static CPDF_Rect GetAnnotRect(const CPDFSDK_Annot* pAnnot); + static CFX_FloatRect 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 1e2620a192..4e9aab40bb 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 CPDF_Point& point, FX_UINT nFlag); - FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_UINT nFlag); + FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_UINT nFlag); + FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_UINT nFlag); #ifdef PDF_ENABLE_XFA - FX_BOOL OnRButtonDown(const CPDF_Point& point, FX_UINT nFlag); - FX_BOOL OnRButtonUp(const CPDF_Point& point, FX_UINT nFlag); + FX_BOOL OnRButtonDown(const CFX_FloatPoint& point, FX_UINT nFlag); + FX_BOOL OnRButtonUp(const CFX_FloatPoint& 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 CPDF_Point& point, int nFlag); + FX_BOOL OnMouseMove(const CFX_FloatPoint& point, int nFlag); FX_BOOL OnMouseWheel(double deltaX, double deltaY, - const CPDF_Point& point, + const CFX_FloatPoint& 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 6d186a7bab..4f64145844 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, CPDF_Rect& rect) = 0; + virtual void OutputSelectedRect(void* pFormFiller, CFX_FloatRect& rect) = 0; virtual FX_BOOL IsSelectionImplemented() = 0; diff --git a/fpdfsdk/include/fxedit/fx_edit.h b/fpdfsdk/include/fxedit/fx_edit.h index 5e1ac0f390..089eecc1d9 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 CPDF_Point; +class CFX_FloatPoint; 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 CPDF_Point& ptHead, - const CPDF_Point& ptFoot, + const CFX_FloatPoint& ptHead, + const CFX_FloatPoint& 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 CPDF_Rect& rcContent) = 0; + virtual void IOnContentChange(const CFX_FloatRect& rcContent) = 0; // Invalidate the rectangle relative to the bounding box of edit. - virtual void IOnInvalidateRect(CPDF_Rect* pRect) = 0; + virtual void IOnInvalidateRect(CFX_FloatRect* pRect) = 0; }; class IFX_Edit_OprNotify { @@ -204,9 +204,10 @@ class IFX_Edit { virtual void Initialize() = 0; // set the bounding box of the text area. - virtual void SetPlateRect(const CPDF_Rect& rect, FX_BOOL bPaint = TRUE) = 0; + virtual void SetPlateRect(const CFX_FloatRect& rect, + FX_BOOL bPaint = TRUE) = 0; // set the scroll origin - virtual void SetScrollPos(const CPDF_Point& point) = 0; + virtual void SetScrollPos(const CFX_FloatPoint& point) = 0; // set the horizontal text alignment in text box, nFormat (0:left 1:middle // 2:right). @@ -296,11 +297,11 @@ class IFX_Edit { // query if any text is selected. virtual FX_BOOL IsSelected() const = 0; // get the scroll origin - virtual CPDF_Point GetScrollPos() const = 0; + virtual CFX_FloatPoint GetScrollPos() const = 0; // get the bounding box of the text area. - virtual CPDF_Rect GetPlateRect() const = 0; + virtual CFX_FloatRect GetPlateRect() const = 0; // get the fact area of the text. - virtual CPDF_Rect GetContentRect() const = 0; + virtual CFX_FloatRect GetContentRect() const = 0; // get the visible word range virtual CPVT_WordRange GetVisibleWordRange() const = 0; // get the whole word range @@ -310,11 +311,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 CPDF_Point& point, + virtual void OnMouseDown(const CFX_FloatPoint& point, FX_BOOL bShift, FX_BOOL bCtrl) = 0; // send the mousemove message to edit when mouse down is TRUE. - virtual void OnMouseMove(const CPDF_Point& point, + virtual void OnMouseMove(const CFX_FloatPoint& point, FX_BOOL bShift, FX_BOOL bCtrl) = 0; // send the UP key message to edit. @@ -399,7 +400,7 @@ class IFX_Edit { const CPVT_WordPlace& place) const = 0; // search a wordplace form point - virtual CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const = 0; + virtual CPVT_WordPlace SearchWordPlace(const CFX_FloatPoint& point) const = 0; // get the font size of non_rich text or default font size of richtext. virtual FX_FLOAT GetFontSize() const = 0; @@ -426,21 +427,21 @@ class IFX_Edit { static CFX_ByteString GetEditAppearanceStream( IFX_Edit* pEdit, - const CPDF_Point& ptOffset, + const CFX_FloatPoint& ptOffset, const CPVT_WordRange* pRange = NULL, FX_BOOL bContinuous = TRUE, FX_WORD SubWord = 0); static CFX_ByteString GetSelectAppearanceStream( IFX_Edit* pEdit, - const CPDF_Point& ptOffset, + const CFX_FloatPoint& 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 CPDF_Rect& rcClip, - const CPDF_Point& ptOffset, + const CFX_FloatRect& rcClip, + const CFX_FloatPoint& ptOffset, const CPVT_WordRange* pRange, IFX_SystemHandler* pSystemHandler, void* pFFLData); @@ -448,31 +449,31 @@ class IFX_Edit { CFX_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF color, - const CPDF_Rect& rcClip, - const CPDF_Point& ptOffset, + const CFX_FloatRect& rcClip, + const CFX_FloatPoint& ptOffset, const CPVT_WordRange* pRange); static void DrawRichEdit(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, IFX_Edit* pEdit, - const CPDF_Rect& rcClip, - const CPDF_Point& ptOffset, + const CFX_FloatRect& rcClip, + const CFX_FloatPoint& ptOffset, const CPVT_WordRange* pRange); static void GeneratePageObjects( CPDF_PageObjectHolder* pObjectHolder, IFX_Edit* pEdit, - const CPDF_Point& ptOffset, + const CFX_FloatPoint& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF crText, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray); static void GenerateRichPageObjects( CPDF_PageObjectHolder* pObjectHolder, IFX_Edit* pEdit, - const CPDF_Point& ptOffset, + const CFX_FloatPoint& ptOffset, const CPVT_WordRange* pRange, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray); static void GenerateUnderlineObjects(CPDF_PageObjectHolder* pObjectHolder, IFX_Edit* pEdit, - const CPDF_Point& ptOffset, + const CFX_FloatPoint& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF color); @@ -501,7 +502,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(CPDF_Rect* pRect) = 0; + virtual void IOnInvalidateRect(CFX_FloatRect* pRect) = 0; protected: virtual ~IFX_List_Notify() {} @@ -515,11 +516,11 @@ class IFX_List { virtual void SetFontMap(IFX_Edit_FontMap* pFontMap) = 0; virtual void SetNotify(IFX_List_Notify* pNotify) = 0; - virtual void SetPlateRect(const CPDF_Rect& rect) = 0; + virtual void SetPlateRect(const CFX_FloatRect& rect) = 0; virtual void SetFontSize(FX_FLOAT fFontSize) = 0; - virtual CPDF_Rect GetPlateRect() const = 0; - virtual CPDF_Rect GetContentRect() const = 0; + virtual CFX_FloatRect GetPlateRect() const = 0; + virtual CFX_FloatRect GetContentRect() const = 0; virtual FX_FLOAT GetFontSize() const = 0; virtual IFX_Edit* GetItemEdit(int32_t nIndex) const = 0; @@ -532,13 +533,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 CPDF_Point& point) = 0; + virtual void SetScrollPos(const CFX_FloatPoint& point) = 0; virtual void ScrollToListItem(int32_t nItemIndex) = 0; - virtual CPDF_Rect GetItemRect(int32_t nIndex) const = 0; + virtual CFX_FloatRect 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 CPDF_Point& point) const = 0; + virtual int32_t GetItemIndex(const CFX_FloatPoint& point) const = 0; virtual int32_t GetFirstSelected() const = 0; virtual void AddString(const FX_WCHAR* string) = 0; @@ -549,10 +550,10 @@ class IFX_List { virtual void Cancel() = 0; virtual CFX_WideString GetText() const = 0; - virtual void OnMouseDown(const CPDF_Point& point, + virtual void OnMouseDown(const CFX_FloatPoint& point, FX_BOOL bShift, FX_BOOL bCtrl) = 0; - virtual void OnMouseMove(const CPDF_Point& point, + virtual void OnMouseMove(const CFX_FloatPoint& 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 d1df3812fc..9809ac9f7d 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 CPDF_Rect& rcLine) + CFX_Edit_LineRect(const CPVT_WordRange& wrLine, const CFX_FloatRect& 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; - CPDF_Rect m_rcLine; + CFX_FloatRect m_rcLine; }; class CFX_Edit_LineRectArray { @@ -93,7 +93,7 @@ class CFX_Edit_LineRectArray { rects.RemoveAll(); } - void Add(const CPVT_WordRange& wrLine, const CPDF_Rect& rcLine) { + void Add(const CPVT_WordRange& wrLine, const CFX_FloatRect& rcLine) { m_LineRects.Add(new CFX_Edit_LineRect(wrLine, rcLine)); } @@ -122,27 +122,27 @@ class CFX_Edit_RectArray { m_Rects.RemoveAll(); } - void Add(const CPDF_Rect& rect) { + void Add(const CFX_FloatRect& rect) { // check for overlapped area for (int32_t i = 0, sz = m_Rects.GetSize(); i < sz; i++) { - CPDF_Rect* pRect = m_Rects.GetAt(i); + CFX_FloatRect* pRect = m_Rects.GetAt(i); if (pRect && pRect->Contains(rect)) return; } - m_Rects.Add(new CPDF_Rect(rect)); + m_Rects.Add(new CFX_FloatRect(rect)); } int32_t GetSize() const { return m_Rects.GetSize(); } - CPDF_Rect* GetAt(int32_t nIndex) const { + CFX_FloatRect* GetAt(int32_t nIndex) const { if (nIndex < 0 || nIndex >= m_Rects.GetSize()) return NULL; return m_Rects.GetAt(nIndex); } - CFX_ArrayTemplate<CPDF_Rect*> m_Rects; + CFX_ArrayTemplate<CFX_FloatRect*> 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 CPDF_Rect& rect); + void Push(const CPVT_WordRange& linerange, const CFX_FloatRect& rect); void NoAnalyse(); void Analyse(int32_t nAlignment); - void AddRefresh(const CPDF_Rect& rect); + void AddRefresh(const CFX_FloatRect& 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 CPDF_Rect& rect, FX_BOOL bPaint = TRUE) override; - void SetScrollPos(const CPDF_Point& point) override; + void SetPlateRect(const CFX_FloatRect& rect, FX_BOOL bPaint = TRUE) override; + void SetScrollPos(const CFX_FloatPoint& 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 CPDF_Point& point, + void OnMouseDown(const CFX_FloatPoint& point, FX_BOOL bShift, FX_BOOL bCtrl) override; - void OnMouseMove(const CPDF_Point& point, + void OnMouseMove(const CFX_FloatPoint& 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 CPDF_Point& point) const override; + CPVT_WordPlace SearchWordPlace(const CFX_FloatPoint& 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; - CPDF_Point GetScrollPos() const override; + CFX_FloatPoint GetScrollPos() const override; int32_t GetCharArray() const override; - CPDF_Rect GetPlateRect() const override; - CPDF_Rect GetContentRect() const override; + CFX_FloatRect GetPlateRect() const override; + CFX_FloatRect 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 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; + 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; 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 CPDF_Point& point) const; + const CFX_FloatPoint& 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; - CPDF_Point m_ptScrollPos; - CPDF_Point m_ptRefreshScrollPos; + CFX_FloatPoint m_ptScrollPos; + CFX_FloatPoint m_ptRefreshScrollPos; FX_BOOL m_bEnableScroll; IFX_Edit_Iterator* m_pIterator; CFX_Edit_Refresh m_Refresh; - CPDF_Point m_ptCaret; + CFX_FloatPoint m_ptCaret; CFX_Edit_Undo m_Undo; int32_t m_nAlignment; FX_BOOL m_bNotifyFlag; FX_BOOL m_bEnableOverflow; FX_BOOL m_bEnableRefresh; - CPDF_Rect m_rcOldContent; + CFX_FloatRect 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 a2f9524b2e..88d57c4928 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 CPDF_Point. +#include "core/include/fpdfapi/fpdf_parser.h" // For CFX_FloatPoint. #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 CPDF_Rect { +class CLST_Rect : public CFX_FloatRect { public: CLST_Rect() { left = top = right = bottom = 0.0f; } @@ -47,7 +47,7 @@ class CLST_Rect : public CPDF_Rect { bottom = other_bottom; } - CLST_Rect(const CPDF_Rect& rect) { + CLST_Rect(const CFX_FloatRect& rect) { left = rect.left; top = rect.top; right = rect.right; @@ -58,7 +58,7 @@ class CLST_Rect : public CPDF_Rect { void Default() { left = top = right = bottom = 0.0f; } - const CLST_Rect operator=(const CPDF_Rect& rect) { + const CLST_Rect operator=(const CFX_FloatRect& rect) { left = rect.left; top = rect.top; right = rect.right; @@ -83,11 +83,11 @@ class CLST_Rect : public CPDF_Rect { return bottom - top; } - CPDF_Point LeftTop() const { return CPDF_Point(left, top); } + CFX_FloatPoint LeftTop() const { return CFX_FloatPoint(left, top); } - CPDF_Point RightBottom() const { return CPDF_Point(right, bottom); } + CFX_FloatPoint RightBottom() const { return CFX_FloatPoint(right, bottom); } - const CLST_Rect operator+=(const CPDF_Point& point) { + const CLST_Rect operator+=(const CFX_FloatPoint& point) { left += point.x; right += point.x; top += point.y; @@ -96,7 +96,7 @@ class CLST_Rect : public CPDF_Rect { return *this; } - const CLST_Rect operator-=(const CPDF_Point& point) { + const CLST_Rect operator-=(const CFX_FloatPoint& point) { left -= point.x; right -= point.x; top -= point.y; @@ -105,12 +105,12 @@ class CLST_Rect : public CPDF_Rect { return *this; } - CLST_Rect operator+(const CPDF_Point& point) const { + CLST_Rect operator+(const CFX_FloatPoint& point) const { return CLST_Rect(left + point.x, top + point.y, right + point.x, bottom + point.y); } - CLST_Rect operator-(const CPDF_Point& point) const { + CLST_Rect operator-(const CFX_FloatPoint& point) const { return CLST_Rect(left - point.x, top - point.y, right - point.x, bottom - point.y); } @@ -152,41 +152,43 @@ 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 CPDF_Rect& rect) { m_rcPlate = rect; } - CPDF_Rect GetPlateRect() const { return m_rcPlate; } + virtual void SetPlateRect(const CFX_FloatRect& rect) { m_rcPlate = rect; } + CFX_FloatRect GetPlateRect() const { return m_rcPlate; } void SetContentRect(const CLST_Rect& rect) { m_rcContent = rect; } CLST_Rect GetContentRect() const { return m_rcContent; } - CPDF_Point GetBTPoint() const { - return CPDF_Point(m_rcPlate.left, m_rcPlate.top); + CFX_FloatPoint GetBTPoint() const { + return CFX_FloatPoint(m_rcPlate.left, m_rcPlate.top); } - CPDF_Point GetETPoint() const { - return CPDF_Point(m_rcPlate.right, m_rcPlate.bottom); + CFX_FloatPoint GetETPoint() const { + return CFX_FloatPoint(m_rcPlate.right, m_rcPlate.bottom); } public: - CPDF_Point InnerToOuter(const CPDF_Point& point) const { - return CPDF_Point(point.x + GetBTPoint().x, GetBTPoint().y - point.y); + CFX_FloatPoint InnerToOuter(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_FloatPoint OuterToInner(const CFX_FloatPoint& point) const { + return CFX_FloatPoint(point.x - GetBTPoint().x, GetBTPoint().y - point.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); + 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); } - 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)); + 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)); return CLST_Rect(ptLeftTop.x, ptLeftTop.y, ptRightBottom.x, ptRightBottom.y); } private: - CPDF_Rect m_rcPlate; + CFX_FloatRect m_rcPlate; CLST_Rect m_rcContent; // positive forever! }; @@ -213,8 +215,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; - CPDF_Rect GetPlateRect() const override; - CPDF_Rect GetContentRect() const override; + CFX_FloatRect GetPlateRect() const override; + CFX_FloatRect GetContentRect() const override; FX_FLOAT GetFontSize() const override; IFX_Edit* GetItemEdit(int32_t nIndex) const override; int32_t GetCount() const override; @@ -225,8 +227,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; - CPDF_Rect GetItemRect(int32_t nIndex) const override; - int32_t GetItemIndex(const CPDF_Point& point) const override; + CFX_FloatRect GetItemRect(int32_t nIndex) const override; + int32_t GetItemIndex(const CFX_FloatPoint& point) const override; int32_t GetFirstSelected() const override; protected: @@ -284,10 +286,10 @@ class CFX_ListCtrl : public CFX_List { // CFX_List void SetNotify(IFX_List_Notify* pNotify) override; - void OnMouseDown(const CPDF_Point& point, + void OnMouseDown(const CFX_FloatPoint& point, FX_BOOL bShift, FX_BOOL bCtrl) override; - void OnMouseMove(const CPDF_Point& point, + void OnMouseMove(const CFX_FloatPoint& point, FX_BOOL bShift, FX_BOOL bCtrl) override; void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) override; @@ -298,15 +300,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 CPDF_Rect& rect) override; - void SetScrollPos(const CPDF_Point& point) override; + void SetPlateRect(const CFX_FloatRect& rect) override; + void SetScrollPos(const CFX_FloatPoint& point) override; void ScrollToListItem(int32_t nItemIndex) override; - CPDF_Rect GetItemRect(int32_t nIndex) const override; + CFX_FloatRect 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; - CPDF_Rect GetContentRect() const override; - int32_t GetItemIndex(const CPDF_Point& point) const override; + CFX_FloatRect GetContentRect() const override; + int32_t GetItemIndex(const CFX_FloatPoint& point) const override; void AddString(const FX_WCHAR* string) override; void SetTopItem(int32_t nIndex) override; void Select(int32_t nItemIndex) override; @@ -316,10 +318,10 @@ class CFX_ListCtrl : public CFX_List { CFX_WideString GetText() const override; void ReArrange(int32_t nItemIndex) override; - 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; + 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; private: void SetMultipleSelect(int32_t nItemIndex, FX_BOOL bSelected); @@ -333,7 +335,7 @@ class CFX_ListCtrl : public CFX_List { private: IFX_List_Notify* m_pNotify; FX_BOOL m_bNotifyFlag; - CPDF_Point m_ptScrollPos; + CFX_FloatPoint 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 5c65c78160..603dc52ff4 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 CPDF_Point& point, FX_DWORD nFlag) override; - FX_BOOL OnLButtonUp(const CPDF_Point& point, 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; protected: FX_BOOL m_bMouseDown; diff --git a/fpdfsdk/include/pdfwindow/PWL_Caret.h b/fpdfsdk/include/pdfwindow/PWL_Caret.h index a1a5022b25..2459195acb 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; - CPDF_Point ptHead; - CPDF_Point ptFoot; + CFX_FloatPoint ptHead; + CFX_FloatPoint 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(CPDF_Rect* pRect = NULL) override; + void InvalidateRect(CFX_FloatRect* pRect = NULL) override; void SetVisible(FX_BOOL bVisible) override {} void TimerProc() override; void SetCaret(FX_BOOL bVisible, - const CPDF_Point& ptHead, - const CPDF_Point& ptFoot); - CFX_ByteString GetCaretAppearanceStream(const CPDF_Point& ptOffset); - void SetInvalidRect(CPDF_Rect rc) { m_rcInvalid = rc; } + const CFX_FloatPoint& ptHead, + const CFX_FloatPoint& ptFoot); + CFX_ByteString GetCaretAppearanceStream(const CFX_FloatPoint& ptOffset); + void SetInvalidRect(CFX_FloatRect rc) { m_rcInvalid = rc; } private: - void GetCaretApp(CFX_ByteTextBuf& sAppStream, const CPDF_Point& ptOffset); - CPDF_Rect GetCaretRect() const; + void GetCaretApp(CFX_ByteTextBuf& sAppStream, const CFX_FloatPoint& ptOffset); + CFX_FloatRect GetCaretRect() const; FX_BOOL m_bFlash; - CPDF_Point m_ptHead; - CPDF_Point m_ptFoot; + CFX_FloatPoint m_ptHead; + CFX_FloatPoint m_ptFoot; FX_FLOAT m_fWidth; int32_t m_nDelay; - CPDF_Rect m_rcInvalid; + CFX_FloatRect 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 a6f6a7b591..e5383009b9 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 CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonUp(const CFX_FloatPoint& 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 CPDF_Point& point, FX_DWORD nFlag) override; - FX_BOOL OnLButtonUp(const CPDF_Point& point, 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; }; 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; - CPDF_Rect GetFocusRect() const override; + CFX_FloatRect 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; - CPDF_Rect m_rcOldWindow; + CFX_FloatRect 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 73528180d9..e93afaaa00 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; - CPDF_Rect GetClientRect() const override; + CFX_FloatRect GetClientRect() const override; void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override; void DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) 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 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 OnMouseWheel(short zDelta, - const CPDF_Point& point, + const CFX_FloatPoint& 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; - CPDF_Rect GetFocusRect() const override; + CFX_FloatRect GetFocusRect() const override; void OnSetFocus() override; void OnKillFocus() override; @@ -96,14 +96,15 @@ 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 CPDF_Point& ptOffset) const; - CFX_ByteString GetCaretAppearanceStream(const CPDF_Point& ptOffset) const; - CFX_ByteString GetSelectAppearanceStream(const CPDF_Point& ptOffset) const; + CFX_ByteString GetTextAppearanceStream(const CFX_FloatPoint& ptOffset) const; + CFX_ByteString GetCaretAppearanceStream(const CFX_FloatPoint& ptOffset) const; + CFX_ByteString GetSelectAppearanceStream( + const CFX_FloatPoint& ptOffset) const; FX_BOOL IsTextFull() const; static FX_FLOAT GetCharArrayAutoFontSize(CPDF_Font* pFont, - const CPDF_Rect& rcPlate, + const CFX_FloatRect& rcPlate, int32_t nCharArray); void SetFillerNotify(IPWL_Filler_Notify* pNotify) { @@ -111,10 +112,10 @@ class CPWL_Edit : public CPWL_EditCtrl, public IFX_Edit_OprNotify { } void GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, - const CPDF_Point& ptOffset, + const CFX_FloatPoint& ptOffset, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray); void GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, - const CPDF_Point& ptOffset); + const CFX_FloatPoint& ptOffset); protected: // IFX_Edit_OprNotify @@ -141,11 +142,11 @@ class CPWL_Edit : public CPWL_EditCtrl, public IFX_Edit_OprNotify { void SetParamByFlag(); FX_FLOAT GetCharArrayAutoFontSize(int32_t nCharArray); - CPDF_Point GetWordRightBottomPoint(const CPVT_WordPlace& wpWord); + CFX_FloatPoint GetWordRightBottomPoint(const CPVT_WordPlace& wpWord); CPVT_WordRange CombineWordRange(const CPVT_WordRange& wr1, const CPVT_WordRange& wr2); - CPVT_WordRange GetLatinWordsRange(const CPDF_Point& point) const; + CPVT_WordRange GetLatinWordsRange(const CFX_FloatPoint& 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, @@ -159,7 +160,7 @@ class CPWL_Edit : public CPWL_EditCtrl, public IFX_Edit_OprNotify { IPWL_Filler_Notify* m_pFillerNotify; IPWL_SpellCheck* m_pSpellCheck; FX_BOOL m_bFocus; - CPDF_Rect m_rcOldWindow; + CFX_FloatRect 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 9bb40a7de1..f80033081e 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 CPDF_Rect& rcContent) {} + virtual void OnContentChange(const CFX_FloatRect& 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; - CPDF_Rect GetContentRect() const; + CFX_FloatRect 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 CPDF_Rect& rect, + void GetTextRange(const CFX_FloatRect& 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); - CPDF_Point GetScrollPos() const; - void SetScrollPos(const CPDF_Point& point); + CFX_FloatPoint GetScrollPos() const; + void SetScrollPos(const CFX_FloatPoint& 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 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 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; 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 CPDF_Point& ptHead, - const CPDF_Point& ptFoot, + const CFX_FloatPoint& ptHead, + const CFX_FloatPoint& ptFoot, const CPVT_WordPlace& place) override; void IOnCaretChange(const CPVT_SecProps& secProps, const CPVT_WordProps& wordProps) override; - void IOnContentChange(const CPDF_Rect& rcContent) override; - void IOnInvalidateRect(CPDF_Rect* pRect) override; + void IOnContentChange(const CFX_FloatRect& rcContent) override; + void IOnInvalidateRect(CFX_FloatRect* 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(CPDF_Point& ptHead, CPDF_Point& ptFoot) const; + void GetCaretInfo(CFX_FloatPoint& ptHead, CFX_FloatPoint& ptFoot) const; void SetCaret(FX_BOOL bVisible, - const CPDF_Point& ptHead, - const CPDF_Point& ptFoot); + const CFX_FloatPoint& ptHead, + const CFX_FloatPoint& ptFoot); void SetEditCaret(FX_BOOL bVisible); diff --git a/fpdfsdk/include/pdfwindow/PWL_IconList.h b/fpdfsdk/include/pdfwindow/PWL_IconList.h index e4c18a8c03..71c9f4cb25 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 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 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 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 CPDF_Point& point); + int32_t FindItemIndex(const CFX_FloatPoint& 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 CPDF_Point& point, + const CFX_FloatPoint& 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 bed519fe6d..5c3fa01933 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); - CPDF_Rect GetContentRect() const; + CFX_FloatRect GetContentRect() const; int32_t GetTotalWords(); - CFX_ByteString GetTextAppearanceStream(const CPDF_Point& ptOffset) const; + CFX_ByteString GetTextAppearanceStream(const CFX_FloatPoint& ptOffset) const; protected: // CPWL_Wnd diff --git a/fpdfsdk/include/pdfwindow/PWL_ListBox.h b/fpdfsdk/include/pdfwindow/PWL_ListBox.h index 1f42d43fc6..c1d3bd7218 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(CPDF_Rect* pRect) override; + void IOnInvalidateRect(CFX_FloatRect* pRect) override; void IOnSetCaret(FX_BOOL bVisible, - const CPDF_Point& ptHead, - const CPDF_Point& ptFoot, + const CFX_FloatPoint& ptHead, + const CFX_FloatPoint& 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 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 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 OnMouseWheel(short zDelta, - const CPDF_Point& point, + const CFX_FloatPoint& 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; - CPDF_Rect GetFocusRect() const override; + CFX_FloatRect 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; - CPDF_Rect GetContentRect() const; + CFX_FloatRect GetContentRect() const; FX_FLOAT GetFirstHeight() const; - CPDF_Rect GetListRect() const; + CFX_FloatRect 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 7b04a0cdb5..0345d02dea 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 CPDF_Point& point); - CPDF_Point GetScrollPos() const; - CPDF_Rect GetScrollArea() const; + void SetScrollPos(const CFX_FloatPoint& point); + CFX_FloatPoint GetScrollPos() const; + CFX_FloatRect 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); - 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; + 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; protected: // CPWL_Wnd @@ -38,8 +38,8 @@ class CPWL_ListCtrl : public CPWL_Wnd { private: void ResetAll(FX_BOOL bMove, int32_t nStart); - CPDF_Rect m_rcContent; - CPDF_Point m_ptScroll; + CFX_FloatRect m_rcContent; + CFX_FloatPoint 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 2d5b564a7f..8087585cee 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 CPDF_Point& point, FX_DWORD nFlag) override; - FX_BOOL OnLButtonUp(const CPDF_Point& point, 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; private: FX_BOOL m_bMouseDown; @@ -166,7 +166,7 @@ class CPWL_Note_Options : public CPWL_Wnd { CPWL_Note_Options(); ~CPWL_Note_Options() override; - CPDF_Rect GetContentRect() const; + CFX_FloatRect 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 CPDF_Point& point); + virtual IPWL_NoteItem* GetHitNoteItem(const CFX_FloatPoint& 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 CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonDown(const CFX_FloatPoint& 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 CPDF_Point& point); + virtual IPWL_NoteItem* GetHitNoteItem(const CFX_FloatPoint& 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 CPDF_Point& point, FX_DWORD nFlag) override; - FX_BOOL OnRButtonUp(const CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override; + FX_BOOL OnRButtonUp(const CFX_FloatPoint& 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 CPDF_Point& point); + void PopupNoteItemMenu(const CFX_FloatPoint& 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 CPDF_Point& point, FX_DWORD nFlag) override; - FX_BOOL OnRButtonUp(const CPDF_Point& point, FX_DWORD nFlag) 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 OnMouseWheel(short zDelta, - const CPDF_Point& point, + const CFX_FloatPoint& 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 439bb65ed2..a43ac91fcb 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 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 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; 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 CPDF_Point& point, FX_DWORD nFlag) override; - FX_BOOL OnLButtonUp(const CPDF_Point& point, 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; 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(); - CPDF_Rect GetScrollArea() const; + CFX_FloatRect GetScrollArea() const; private: void CreateButtons(const PWL_CREATEPARAM& cp); - void OnMinButtonLBDown(const CPDF_Point& point); - void OnMinButtonLBUp(const CPDF_Point& point); - void OnMinButtonMouseMove(const CPDF_Point& point); + void OnMinButtonLBDown(const CFX_FloatPoint& point); + void OnMinButtonLBUp(const CFX_FloatPoint& point); + void OnMinButtonMouseMove(const CFX_FloatPoint& point); - void OnMaxButtonLBDown(const CPDF_Point& point); - void OnMaxButtonLBUp(const CPDF_Point& point); - void OnMaxButtonMouseMove(const CPDF_Point& point); + void OnMaxButtonLBDown(const CFX_FloatPoint& point); + void OnMaxButtonLBUp(const CFX_FloatPoint& point); + void OnMaxButtonMouseMove(const CFX_FloatPoint& point); - void OnPosButtonLBDown(const CPDF_Point& point); - void OnPosButtonLBUp(const CPDF_Point& point); - void OnPosButtonMouseMove(const CPDF_Point& point); + void OnPosButtonLBDown(const CFX_FloatPoint& point); + void OnPosButtonLBUp(const CFX_FloatPoint& point); + void OnPosButtonMouseMove(const CFX_FloatPoint& 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 5d372e826f..6135b87862 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; - CPDF_Rect GetFocusRect() const override; + CFX_FloatRect 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 CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonUp(const CFX_FloatPoint& 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 CPDF_Point& point, FX_DWORD nFlag) override; + FX_BOOL OnLButtonUp(const CFX_FloatPoint& 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 cd033d7bc7..71a2b1baa3 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 CPDF_Point. +#include "core/include/fpdfapi/fpdf_parser.h" // For CFX_FloatPoint. #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 CPDF_Point { +class CPWL_Point : public CFX_FloatPoint { public: - 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) {} + 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) {} }; enum PWL_PATHDATA_TYPE { @@ -104,24 +104,28 @@ class IPWL_SpellCheck; class CPWL_Utils { public: - 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 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 CPVT_WordRange OverlapWordRange(const CPVT_WordRange& wr1, const CPVT_WordRange& wr2); - static CPDF_Rect GetCenterSquare(const CPDF_Rect& rect); + static CFX_FloatRect GetCenterSquare(const CFX_FloatRect& rect); static CPWL_Color SubstractColor(const CPWL_Color& sColor, FX_FLOAT fColorSub); static CPWL_Color DevideColor(const CPWL_Color& sColor, FX_FLOAT fColorDevide); - 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 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 FX_COLORREF PWLColorToFXColor(const CPWL_Color& color, int32_t nTransparancy = 255); static FX_BOOL IsBlackOrWhite(const CPWL_Color& color); @@ -129,7 +133,7 @@ class CPWL_Utils { static CFX_ByteString GetColorAppStream(const CPWL_Color& color, const FX_BOOL& bFillOrStroke = TRUE); - static CFX_ByteString GetBorderAppStream(const CPDF_Rect& rect, + static CFX_ByteString GetBorderAppStream(const CFX_FloatRect& rect, FX_FLOAT fWidth, const CPWL_Color& color, const CPWL_Color& crLeftTop, @@ -137,19 +141,19 @@ class CPWL_Utils { int32_t nStyle, const CPWL_Dash& dash); static CFX_ByteString GetCircleBorderAppStream( - const CPDF_Rect& rect, + const CFX_FloatRect& 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 CPDF_Rect& rect, + static CFX_ByteString GetRectFillAppStream(const CFX_FloatRect& rect, const CPWL_Color& color); - static CFX_ByteString GetCircleFillAppStream(const CPDF_Rect& rect, + static CFX_ByteString GetCircleFillAppStream(const CFX_FloatRect& rect, const CPWL_Color& color); - static CFX_ByteString GetPushButtonAppStream(const CPDF_Rect& rcBBox, + static CFX_ByteString GetPushButtonAppStream(const CFX_FloatRect& rcBBox, IFX_Edit_FontMap* pFontMap, CPDF_Stream* pIconStream, CPDF_IconFit& IconFit, @@ -157,28 +161,28 @@ class CPWL_Utils { const CPWL_Color& crText, FX_FLOAT fFontSize, int32_t nLayOut); - static CFX_ByteString GetCheckBoxAppStream(const CPDF_Rect& rcBBox, + static CFX_ByteString GetCheckBoxAppStream(const CFX_FloatRect& rcBBox, int32_t nStyle, const CPWL_Color& crText); - static CFX_ByteString GetRadioButtonAppStream(const CPDF_Rect& rcBBox, + static CFX_ByteString GetRadioButtonAppStream(const CFX_FloatRect& rcBBox, int32_t nStyle, const CPWL_Color& crText); static CFX_ByteString GetEditAppStream(IFX_Edit* pEdit, - const CPDF_Point& ptOffset, + const CFX_FloatPoint& ptOffset, const CPVT_WordRange* pRange = NULL, FX_BOOL bContinuous = TRUE, FX_WORD SubWord = 0); static CFX_ByteString GetEditSelAppStream( IFX_Edit* pEdit, - const CPDF_Point& ptOffset, + const CFX_FloatPoint& ptOffset, const CPVT_WordRange* pRange = NULL); static CFX_ByteString GetSpellCheckAppStream( IFX_Edit* pEdit, IPWL_SpellCheck* pSpellCheck, - const CPDF_Point& ptOffset, + const CFX_FloatPoint& ptOffset, const CPVT_WordRange* pRange = NULL); - static CFX_ByteString GetTextAppStream(const CPDF_Rect& rcBBox, + static CFX_ByteString GetTextAppStream(const CFX_FloatRect& rcBBox, IFX_Edit_FontMap* pFontMap, const CFX_WideString& sText, int32_t nAlignmentH, @@ -187,31 +191,31 @@ class CPWL_Utils { FX_BOOL bMultiLine, FX_BOOL bAutoReturn, const CPWL_Color& crText); - static CFX_ByteString GetDropButtonAppStream(const CPDF_Rect& rcBBox); + static CFX_ByteString GetDropButtonAppStream(const CFX_FloatRect& rcBBox); static void DrawFillRect(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CPDF_Rect& rect, + const CFX_FloatRect& rect, const CPWL_Color& color, int32_t nTransparancy); static void DrawFillRect(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CPDF_Rect& rect, + const CFX_FloatRect& rect, const FX_COLORREF& color); static void DrawStrokeRect(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CPDF_Rect& rect, + const CFX_FloatRect& rect, const FX_COLORREF& color, FX_FLOAT fWidth); static void DrawStrokeLine(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CPDF_Point& ptMoveTo, - const CPDF_Point& ptLineTo, + const CFX_FloatPoint& ptMoveTo, + const CFX_FloatPoint& ptLineTo, const FX_COLORREF& color, FX_FLOAT fWidth); static void DrawBorder(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CPDF_Rect& rect, + const CFX_FloatRect& rect, FX_FLOAT fWidth, const CPWL_Color& color, const CPWL_Color& crLeftTop, @@ -220,22 +224,22 @@ class CPWL_Utils { int32_t nTransparancy); static void DrawFillArea(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, - const CPDF_Point* pPts, + const CFX_FloatPoint* pPts, int32_t nCount, const FX_COLORREF& color); static void DrawShadow(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, FX_BOOL bVertical, FX_BOOL bHorizontal, - CPDF_Rect rect, + CFX_FloatRect rect, int32_t nTransparancy, int32_t nStartGray, int32_t nEndGray); static void DrawEditSpellCheck(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, IFX_Edit* pEdit, - const CPDF_Rect& rcClip, - const CPDF_Point& ptOffset, + const CFX_FloatRect& rcClip, + const CFX_FloatPoint& ptOffset, const CPVT_WordRange* pRange, IPWL_SpellCheck* pSpellCheck); @@ -284,13 +288,13 @@ class CPWL_Utils { public: static CFX_ByteString GetIconAppStream( int32_t nType, - const CPDF_Rect& rect, + const CFX_FloatRect& 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 CPDF_Rect& rect, + const CFX_FloatRect& rect, const CPWL_Color& crFill, const CPWL_Color& crStroke, const int32_t nTransparancy); @@ -302,107 +306,107 @@ class CPWL_Utils { const CPWL_PathData* pPathData, int32_t nCount); - static CFX_ByteString GetAppStream_Check(const CPDF_Rect& rcBBox, + static CFX_ByteString GetAppStream_Check(const CFX_FloatRect& rcBBox, const CPWL_Color& crText); - static CFX_ByteString GetAppStream_Circle(const CPDF_Rect& rcBBox, + static CFX_ByteString GetAppStream_Circle(const CFX_FloatRect& rcBBox, const CPWL_Color& crText); - static CFX_ByteString GetAppStream_Cross(const CPDF_Rect& rcBBox, + static CFX_ByteString GetAppStream_Cross(const CFX_FloatRect& rcBBox, const CPWL_Color& crText); - static CFX_ByteString GetAppStream_Diamond(const CPDF_Rect& rcBBox, + static CFX_ByteString GetAppStream_Diamond(const CFX_FloatRect& rcBBox, const CPWL_Color& crText); - static CFX_ByteString GetAppStream_Square(const CPDF_Rect& rcBBox, + static CFX_ByteString GetAppStream_Square(const CFX_FloatRect& rcBBox, const CPWL_Color& crText); - static CFX_ByteString GetAppStream_Star(const CPDF_Rect& rcBBox, + static CFX_ByteString GetAppStream_Star(const CFX_FloatRect& rcBBox, const CPWL_Color& crText); - 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, + 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, FX_FLOAT fRotate); static void GetGraphics_Checkmark(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Circle(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Comment(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Cross(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Help(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_InsertText(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Key(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_NewParagraph(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_TextNote(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Paragraph(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_RightArrow(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_RightPointer(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Star(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_UpArrow(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_UpLeftArrow(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Graph(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Paperclip(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Attachment(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Tag(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); static void GetGraphics_Foxit(CFX_ByteString& sPathData, CFX_PathData& path, - const CPDF_Rect& crBBox, + const CFX_FloatRect& crBBox, const PWL_PATH_TYPE type); }; diff --git a/fpdfsdk/include/pdfwindow/PWL_Wnd.h b/fpdfsdk/include/pdfwindow/PWL_Wnd.h index 1bc5023c98..19046e6c9c 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) {} - CPDF_Rect rcRectWnd; // required + CFX_FloatRect 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 CPDF_Rect& rcNew, FX_BOOL bReset, FX_BOOL bRefresh); - virtual void InvalidateRect(CPDF_Rect* pRect = NULL); + void Move(const CFX_FloatRect& rcNew, FX_BOOL bReset, FX_BOOL bRefresh); + virtual void InvalidateRect(CFX_FloatRect* 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 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 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 OnMouseWheel(short zDelta, - const CPDF_Point& point, + const CFX_FloatPoint& 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 CPDF_Rect GetFocusRect() const; + virtual CFX_FloatRect 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 CPDF_Rect& rect); + void SetClipRect(const CFX_FloatRect& rect); void SetBorderStyle(int32_t eBorderStyle); - virtual CPDF_Rect GetWindowRect() const; - virtual CPDF_Rect GetClientRect() const; - CPDF_Point GetCenterPoint() const; + virtual CFX_FloatRect GetWindowRect() const; + virtual CFX_FloatRect GetClientRect() const; + CFX_FloatPoint 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 CPDF_Rect& GetClipRect() const; + const CFX_FloatRect& GetClipRect() const; CPWL_Wnd* GetParentWindow() const; int32_t GetBorderStyle() const; const CPWL_Dash& GetBorderDash() const; void* GetAttachedData() const; - FX_BOOL WndHitTest(const CPDF_Point& point) const; - FX_BOOL ClientHitTest(const CPDF_Point& point) const; + FX_BOOL WndHitTest(const CFX_FloatPoint& point) const; + FX_BOOL ClientHitTest(const CFX_FloatPoint& 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 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; + 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; // those methods only implemented by listctrl item virtual FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth) { return 0; } @@ -423,10 +423,11 @@ class CPWL_Wnd : public CPWL_TimerHandler { const PWL_CREATEPARAM& GetCreationParam() const; FX_BOOL IsNotifying() const { return m_bNotifying; } - void InvalidateRectMove(const CPDF_Rect& rcOld, const CPDF_Rect& rcNew); + void InvalidateRectMove(const CFX_FloatRect& rcOld, + const CFX_FloatRect& rcNew); - void PWLtoWnd(const CPDF_Point& point, int32_t& x, int32_t& y) const; - FX_RECT PWLtoWnd(const CPDF_Rect& rect) const; + void PWLtoWnd(const CFX_FloatPoint& point, int32_t& x, int32_t& y) const; + FX_RECT PWLtoWnd(const CFX_FloatRect& rect) const; FX_HWND GetAttachedHWnd() const; FX_BOOL IsWndCaptureMouse(const CPWL_Wnd* pWnd) const; @@ -459,8 +460,8 @@ class CPWL_Wnd : public CPWL_TimerHandler { CPWL_ScrollBar* m_pVScrollBar; - CPDF_Rect m_rcWindow; - CPDF_Rect m_rcClip; + CFX_FloatRect m_rcWindow; + CFX_FloatRect m_rcClip; FX_BOOL m_bCreated; FX_BOOL m_bVisible; |