diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-02-26 14:24:28 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-02-26 14:24:28 -0800 |
commit | 281a9eadff15b167e2ee3032e21b83190ad49125 (patch) | |
tree | f02f7d0842f59d8e69bda011b3e62547ffb1acde /fpdfsdk/include/pdfwindow | |
parent | 566b974287ce0e81a963138152b8898f22480f52 (diff) | |
download | pdfium-281a9eadff15b167e2ee3032e21b83190ad49125.tar.xz |
Re-land "Replace CPDF_Rect and CPDF_Point with CFX types."
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1737593006 .
Diffstat (limited to 'fpdfsdk/include/pdfwindow')
-rw-r--r-- | fpdfsdk/include/pdfwindow/PWL_Button.h | 4 | ||||
-rw-r--r-- | fpdfsdk/include/pdfwindow/PWL_Caret.h | 24 | ||||
-rw-r--r-- | fpdfsdk/include/pdfwindow/PWL_ComboBox.h | 10 | ||||
-rw-r--r-- | fpdfsdk/include/pdfwindow/PWL_Edit.h | 31 | ||||
-rw-r--r-- | fpdfsdk/include/pdfwindow/PWL_EditCtrl.h | 30 | ||||
-rw-r--r-- | fpdfsdk/include/pdfwindow/PWL_IconList.h | 10 | ||||
-rw-r--r-- | fpdfsdk/include/pdfwindow/PWL_Label.h | 4 | ||||
-rw-r--r-- | fpdfsdk/include/pdfwindow/PWL_ListBox.h | 20 | ||||
-rw-r--r-- | fpdfsdk/include/pdfwindow/PWL_ListCtrl.h | 18 | ||||
-rw-r--r-- | fpdfsdk/include/pdfwindow/PWL_Note.h | 24 | ||||
-rw-r--r-- | fpdfsdk/include/pdfwindow/PWL_ScrollBar.h | 30 | ||||
-rw-r--r-- | fpdfsdk/include/pdfwindow/PWL_SpecialButton.h | 6 | ||||
-rw-r--r-- | fpdfsdk/include/pdfwindow/PWL_Utils.h | 152 | ||||
-rw-r--r-- | fpdfsdk/include/pdfwindow/PWL_Wnd.h | 61 |
14 files changed, 215 insertions, 209 deletions
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; |