summaryrefslogtreecommitdiff
path: root/fpdfsdk/include/fxedit
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-02-26 13:17:56 -0800
committerTom Sepez <tsepez@chromium.org>2016-02-26 13:17:56 -0800
commit566b974287ce0e81a963138152b8898f22480f52 (patch)
treeb85991aee92475549d84e8cb68702960b85d1252 /fpdfsdk/include/fxedit
parent3b8fdd34bdf57ec45291b77008a43249f838efcb (diff)
downloadpdfium-566b974287ce0e81a963138152b8898f22480f52.tar.xz
Revert "Replace CPDF_Rect and CPDF_Point with CFX types."
This reverts commit 3b8fdd34bdf57ec45291b77008a43249f838efcb. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1743753002 .
Diffstat (limited to 'fpdfsdk/include/fxedit')
-rw-r--r--fpdfsdk/include/fxedit/fx_edit.h67
-rw-r--r--fpdfsdk/include/fxedit/fxet_edit.h54
-rw-r--r--fpdfsdk/include/fxedit/fxet_list.h96
3 files changed, 107 insertions, 110 deletions
diff --git a/fpdfsdk/include/fxedit/fx_edit.h b/fpdfsdk/include/fxedit/fx_edit.h
index 089eecc1d9..5e1ac0f390 100644
--- a/fpdfsdk/include/fxedit/fx_edit.h
+++ b/fpdfsdk/include/fxedit/fx_edit.h
@@ -15,7 +15,7 @@ class CFX_RenderDevice;
class CPDF_Font;
class CFX_Matrix;
class CPDF_PageObjectHolder;
-class CFX_FloatPoint;
+class CPDF_Point;
class CPDF_TextObject;
class IFX_Edit;
class IFX_Edit_FontMap;
@@ -92,17 +92,17 @@ class IFX_Edit_Notify {
virtual void IOnSetScrollPosY(FX_FLOAT fy) = 0;
// set the caret information.
virtual void IOnSetCaret(FX_BOOL bVisible,
- const CFX_FloatPoint& ptHead,
- const CFX_FloatPoint& ptFoot,
+ const CPDF_Point& ptHead,
+ const CPDF_Point& ptFoot,
const CPVT_WordPlace& place) = 0;
// if the caret position is changed ,send the information of current postion
// to user.
virtual void IOnCaretChange(const CPVT_SecProps& secProps,
const CPVT_WordProps& wordProps) = 0;
// if the text area is changed, send the information to user.
- virtual void IOnContentChange(const CFX_FloatRect& rcContent) = 0;
+ virtual void IOnContentChange(const CPDF_Rect& rcContent) = 0;
// Invalidate the rectangle relative to the bounding box of edit.
- virtual void IOnInvalidateRect(CFX_FloatRect* pRect) = 0;
+ virtual void IOnInvalidateRect(CPDF_Rect* pRect) = 0;
};
class IFX_Edit_OprNotify {
@@ -204,10 +204,9 @@ class IFX_Edit {
virtual void Initialize() = 0;
// set the bounding box of the text area.
- virtual void SetPlateRect(const CFX_FloatRect& rect,
- FX_BOOL bPaint = TRUE) = 0;
+ virtual void SetPlateRect(const CPDF_Rect& rect, FX_BOOL bPaint = TRUE) = 0;
// set the scroll origin
- virtual void SetScrollPos(const CFX_FloatPoint& point) = 0;
+ virtual void SetScrollPos(const CPDF_Point& point) = 0;
// set the horizontal text alignment in text box, nFormat (0:left 1:middle
// 2:right).
@@ -297,11 +296,11 @@ class IFX_Edit {
// query if any text is selected.
virtual FX_BOOL IsSelected() const = 0;
// get the scroll origin
- virtual CFX_FloatPoint GetScrollPos() const = 0;
+ virtual CPDF_Point GetScrollPos() const = 0;
// get the bounding box of the text area.
- virtual CFX_FloatRect GetPlateRect() const = 0;
+ virtual CPDF_Rect GetPlateRect() const = 0;
// get the fact area of the text.
- virtual CFX_FloatRect GetContentRect() const = 0;
+ virtual CPDF_Rect GetContentRect() const = 0;
// get the visible word range
virtual CPVT_WordRange GetVisibleWordRange() const = 0;
// get the whole word range
@@ -311,11 +310,11 @@ class IFX_Edit {
// send the mousedown message to edit for response.
// if Shift key is hold, bShift is TRUE, is Ctrl key is hold, bCtrl is TRUE.
- virtual void OnMouseDown(const CFX_FloatPoint& point,
+ virtual void OnMouseDown(const CPDF_Point& point,
FX_BOOL bShift,
FX_BOOL bCtrl) = 0;
// send the mousemove message to edit when mouse down is TRUE.
- virtual void OnMouseMove(const CFX_FloatPoint& point,
+ virtual void OnMouseMove(const CPDF_Point& point,
FX_BOOL bShift,
FX_BOOL bCtrl) = 0;
// send the UP key message to edit.
@@ -400,7 +399,7 @@ class IFX_Edit {
const CPVT_WordPlace& place) const = 0;
// search a wordplace form point
- virtual CPVT_WordPlace SearchWordPlace(const CFX_FloatPoint& point) const = 0;
+ virtual CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const = 0;
// get the font size of non_rich text or default font size of richtext.
virtual FX_FLOAT GetFontSize() const = 0;
@@ -427,21 +426,21 @@ class IFX_Edit {
static CFX_ByteString GetEditAppearanceStream(
IFX_Edit* pEdit,
- const CFX_FloatPoint& ptOffset,
+ const CPDF_Point& ptOffset,
const CPVT_WordRange* pRange = NULL,
FX_BOOL bContinuous = TRUE,
FX_WORD SubWord = 0);
static CFX_ByteString GetSelectAppearanceStream(
IFX_Edit* pEdit,
- const CFX_FloatPoint& ptOffset,
+ const CPDF_Point& ptOffset,
const CPVT_WordRange* pRange = NULL);
static void DrawEdit(CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device,
IFX_Edit* pEdit,
FX_COLORREF crTextFill,
FX_COLORREF crTextStroke,
- const CFX_FloatRect& rcClip,
- const CFX_FloatPoint& ptOffset,
+ const CPDF_Rect& rcClip,
+ const CPDF_Point& ptOffset,
const CPVT_WordRange* pRange,
IFX_SystemHandler* pSystemHandler,
void* pFFLData);
@@ -449,31 +448,31 @@ class IFX_Edit {
CFX_Matrix* pUser2Device,
IFX_Edit* pEdit,
FX_COLORREF color,
- const CFX_FloatRect& rcClip,
- const CFX_FloatPoint& ptOffset,
+ const CPDF_Rect& rcClip,
+ const CPDF_Point& ptOffset,
const CPVT_WordRange* pRange);
static void DrawRichEdit(CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device,
IFX_Edit* pEdit,
- const CFX_FloatRect& rcClip,
- const CFX_FloatPoint& ptOffset,
+ const CPDF_Rect& rcClip,
+ const CPDF_Point& ptOffset,
const CPVT_WordRange* pRange);
static void GeneratePageObjects(
CPDF_PageObjectHolder* pObjectHolder,
IFX_Edit* pEdit,
- const CFX_FloatPoint& ptOffset,
+ const CPDF_Point& ptOffset,
const CPVT_WordRange* pRange,
FX_COLORREF crText,
CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray);
static void GenerateRichPageObjects(
CPDF_PageObjectHolder* pObjectHolder,
IFX_Edit* pEdit,
- const CFX_FloatPoint& ptOffset,
+ const CPDF_Point& ptOffset,
const CPVT_WordRange* pRange,
CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray);
static void GenerateUnderlineObjects(CPDF_PageObjectHolder* pObjectHolder,
IFX_Edit* pEdit,
- const CFX_FloatPoint& ptOffset,
+ const CPDF_Point& ptOffset,
const CPVT_WordRange* pRange,
FX_COLORREF color);
@@ -502,7 +501,7 @@ class IFX_List_Notify {
// set the position of vertical scrollbar.
virtual void IOnSetScrollPosY(FX_FLOAT fy) = 0;
// Invalidate the rectangle relative to the bounding box of edit.
- virtual void IOnInvalidateRect(CFX_FloatRect* pRect) = 0;
+ virtual void IOnInvalidateRect(CPDF_Rect* pRect) = 0;
protected:
virtual ~IFX_List_Notify() {}
@@ -516,11 +515,11 @@ class IFX_List {
virtual void SetFontMap(IFX_Edit_FontMap* pFontMap) = 0;
virtual void SetNotify(IFX_List_Notify* pNotify) = 0;
- virtual void SetPlateRect(const CFX_FloatRect& rect) = 0;
+ virtual void SetPlateRect(const CPDF_Rect& rect) = 0;
virtual void SetFontSize(FX_FLOAT fFontSize) = 0;
- virtual CFX_FloatRect GetPlateRect() const = 0;
- virtual CFX_FloatRect GetContentRect() const = 0;
+ virtual CPDF_Rect GetPlateRect() const = 0;
+ virtual CPDF_Rect GetContentRect() const = 0;
virtual FX_FLOAT GetFontSize() const = 0;
virtual IFX_Edit* GetItemEdit(int32_t nIndex) const = 0;
@@ -533,13 +532,13 @@ class IFX_List {
virtual FX_BOOL IsValid(int32_t nItemIndex) const = 0;
virtual int32_t FindNext(int32_t nIndex, FX_WCHAR nChar) const = 0;
- virtual void SetScrollPos(const CFX_FloatPoint& point) = 0;
+ virtual void SetScrollPos(const CPDF_Point& point) = 0;
virtual void ScrollToListItem(int32_t nItemIndex) = 0;
- virtual CFX_FloatRect GetItemRect(int32_t nIndex) const = 0;
+ virtual CPDF_Rect GetItemRect(int32_t nIndex) const = 0;
virtual int32_t GetCaret() const = 0;
virtual int32_t GetSelect() const = 0;
virtual int32_t GetTopItem() const = 0;
- virtual int32_t GetItemIndex(const CFX_FloatPoint& point) const = 0;
+ virtual int32_t GetItemIndex(const CPDF_Point& point) const = 0;
virtual int32_t GetFirstSelected() const = 0;
virtual void AddString(const FX_WCHAR* string) = 0;
@@ -550,10 +549,10 @@ class IFX_List {
virtual void Cancel() = 0;
virtual CFX_WideString GetText() const = 0;
- virtual void OnMouseDown(const CFX_FloatPoint& point,
+ virtual void OnMouseDown(const CPDF_Point& point,
FX_BOOL bShift,
FX_BOOL bCtrl) = 0;
- virtual void OnMouseMove(const CFX_FloatPoint& point,
+ virtual void OnMouseMove(const CPDF_Point& point,
FX_BOOL bShift,
FX_BOOL bCtrl) = 0;
virtual void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) = 0;
diff --git a/fpdfsdk/include/fxedit/fxet_edit.h b/fpdfsdk/include/fxedit/fxet_edit.h
index 9809ac9f7d..d1df3812fc 100644
--- a/fpdfsdk/include/fxedit/fxet_edit.h
+++ b/fpdfsdk/include/fxedit/fxet_edit.h
@@ -41,7 +41,7 @@ enum EDIT_PROPS_E {
};
struct CFX_Edit_LineRect {
- CFX_Edit_LineRect(const CPVT_WordRange& wrLine, const CFX_FloatRect& rcLine)
+ CFX_Edit_LineRect(const CPVT_WordRange& wrLine, const CPDF_Rect& rcLine)
: m_wrLine(wrLine), m_rcLine(rcLine) {}
FX_BOOL operator!=(const CFX_Edit_LineRect& linerect) const {
@@ -67,7 +67,7 @@ struct CFX_Edit_LineRect {
}
CPVT_WordRange m_wrLine;
- CFX_FloatRect m_rcLine;
+ CPDF_Rect m_rcLine;
};
class CFX_Edit_LineRectArray {
@@ -93,7 +93,7 @@ class CFX_Edit_LineRectArray {
rects.RemoveAll();
}
- void Add(const CPVT_WordRange& wrLine, const CFX_FloatRect& rcLine) {
+ void Add(const CPVT_WordRange& wrLine, const CPDF_Rect& rcLine) {
m_LineRects.Add(new CFX_Edit_LineRect(wrLine, rcLine));
}
@@ -122,27 +122,27 @@ class CFX_Edit_RectArray {
m_Rects.RemoveAll();
}
- void Add(const CFX_FloatRect& rect) {
+ void Add(const CPDF_Rect& rect) {
// check for overlapped area
for (int32_t i = 0, sz = m_Rects.GetSize(); i < sz; i++) {
- CFX_FloatRect* pRect = m_Rects.GetAt(i);
+ CPDF_Rect* pRect = m_Rects.GetAt(i);
if (pRect && pRect->Contains(rect))
return;
}
- m_Rects.Add(new CFX_FloatRect(rect));
+ m_Rects.Add(new CPDF_Rect(rect));
}
int32_t GetSize() const { return m_Rects.GetSize(); }
- CFX_FloatRect* GetAt(int32_t nIndex) const {
+ CPDF_Rect* GetAt(int32_t nIndex) const {
if (nIndex < 0 || nIndex >= m_Rects.GetSize())
return NULL;
return m_Rects.GetAt(nIndex);
}
- CFX_ArrayTemplate<CFX_FloatRect*> m_Rects;
+ CFX_ArrayTemplate<CPDF_Rect*> m_Rects;
};
class CFX_Edit_Refresh {
@@ -151,10 +151,10 @@ class CFX_Edit_Refresh {
virtual ~CFX_Edit_Refresh();
void BeginRefresh();
- void Push(const CPVT_WordRange& linerange, const CFX_FloatRect& rect);
+ void Push(const CPVT_WordRange& linerange, const CPDF_Rect& rect);
void NoAnalyse();
void Analyse(int32_t nAlignment);
- void AddRefresh(const CFX_FloatRect& rect);
+ void AddRefresh(const CPDF_Rect& rect);
const CFX_Edit_RectArray* GetRefreshRects() const;
void EndRefresh();
@@ -533,8 +533,8 @@ class CFX_Edit : public IFX_Edit {
IPDF_VariableText* GetVariableText() override;
IFX_Edit_FontMap* GetFontMap() override;
void Initialize() override;
- void SetPlateRect(const CFX_FloatRect& rect, FX_BOOL bPaint = TRUE) override;
- void SetScrollPos(const CFX_FloatPoint& point) override;
+ void SetPlateRect(const CPDF_Rect& rect, FX_BOOL bPaint = TRUE) override;
+ void SetScrollPos(const CPDF_Point& point) override;
void SetAlignmentH(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) override;
void SetAlignmentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) override;
void SetPasswordChar(FX_WORD wSubWord = '*', FX_BOOL bPaint = TRUE) override;
@@ -565,10 +565,10 @@ class CFX_Edit : public IFX_Edit {
FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading) override;
FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent) override;
FX_BOOL SetRichTextAlignment(int32_t nAlignment) override;
- void OnMouseDown(const CFX_FloatPoint& point,
+ void OnMouseDown(const CPDF_Point& point,
FX_BOOL bShift,
FX_BOOL bCtrl) override;
- void OnMouseMove(const CFX_FloatPoint& point,
+ void OnMouseMove(const CPDF_Point& point,
FX_BOOL bShift,
FX_BOOL bCtrl) override;
void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) override;
@@ -602,17 +602,17 @@ class CFX_Edit : public IFX_Edit {
CPVT_WordPlace GetSectionBeginPlace(
const CPVT_WordPlace& place) const override;
CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace& place) const override;
- CPVT_WordPlace SearchWordPlace(const CFX_FloatPoint& point) const override;
+ CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const override;
int32_t GetCaret() const override;
CPVT_WordPlace GetCaretWordPlace() const override;
CFX_WideString GetSelText() const override;
CFX_WideString GetText() const override;
FX_FLOAT GetFontSize() const override;
FX_WORD GetPasswordChar() const override;
- CFX_FloatPoint GetScrollPos() const override;
+ CPDF_Point GetScrollPos() const override;
int32_t GetCharArray() const override;
- CFX_FloatRect GetPlateRect() const override;
- CFX_FloatRect GetContentRect() const override;
+ CPDF_Rect GetPlateRect() const override;
+ CPDF_Rect GetContentRect() const override;
CFX_WideString GetRangeText(const CPVT_WordRange& range) const override;
int32_t GetHorzScale() const override;
FX_FLOAT GetCharSpace() const override;
@@ -704,10 +704,10 @@ class CFX_Edit : public IFX_Edit {
void PaintInsertText(const CPVT_WordPlace& wpOld,
const CPVT_WordPlace& wpNew);
- inline CFX_FloatPoint VTToEdit(const CFX_FloatPoint& point) const;
- inline CFX_FloatPoint EditToVT(const CFX_FloatPoint& point) const;
- inline CFX_FloatRect VTToEdit(const CFX_FloatRect& rect) const;
- inline CFX_FloatRect EditToVT(const CFX_FloatRect& rect) const;
+ inline CPDF_Point VTToEdit(const CPDF_Point& point) const;
+ inline CPDF_Point EditToVT(const CPDF_Point& point) const;
+ inline CPDF_Rect VTToEdit(const CPDF_Rect& rect) const;
+ inline CPDF_Rect EditToVT(const CPDF_Rect& rect) const;
void Refresh(REFRESH_PLAN_E ePlan,
const CPVT_WordRange* pRange1 = NULL,
@@ -731,7 +731,7 @@ class CFX_Edit : public IFX_Edit {
void SetPageInfo(const CPVT_WordPlace& place);
CPVT_WordPlace SearchPageEndPlace(const CPVT_WordPlace& wpPageBegin,
- const CFX_FloatPoint& point) const;
+ const CPDF_Point& point) const;
FX_FLOAT GetLineTop(const CPVT_WordPlace& place) const;
FX_FLOAT GetLineBottom(const CPVT_WordPlace& place) const;
@@ -745,18 +745,18 @@ class CFX_Edit : public IFX_Edit {
CPVT_WordPlace m_wpOldCaret;
CFX_Edit_Select m_SelState;
- CFX_FloatPoint m_ptScrollPos;
- CFX_FloatPoint m_ptRefreshScrollPos;
+ CPDF_Point m_ptScrollPos;
+ CPDF_Point m_ptRefreshScrollPos;
FX_BOOL m_bEnableScroll;
IFX_Edit_Iterator* m_pIterator;
CFX_Edit_Refresh m_Refresh;
- CFX_FloatPoint m_ptCaret;
+ CPDF_Point m_ptCaret;
CFX_Edit_Undo m_Undo;
int32_t m_nAlignment;
FX_BOOL m_bNotifyFlag;
FX_BOOL m_bEnableOverflow;
FX_BOOL m_bEnableRefresh;
- CFX_FloatRect m_rcOldContent;
+ CPDF_Rect m_rcOldContent;
FX_BOOL m_bEnableUndo;
FX_BOOL m_bNotify;
FX_BOOL m_bOprNotify;
diff --git a/fpdfsdk/include/fxedit/fxet_list.h b/fpdfsdk/include/fxedit/fxet_list.h
index 88d57c4928..a2f9524b2e 100644
--- a/fpdfsdk/include/fxedit/fxet_list.h
+++ b/fpdfsdk/include/fxedit/fxet_list.h
@@ -7,7 +7,7 @@
#ifndef FPDFSDK_INCLUDE_FXEDIT_FXET_LIST_H_
#define FPDFSDK_INCLUDE_FXEDIT_FXET_LIST_H_
-#include "core/include/fpdfapi/fpdf_parser.h" // For CFX_FloatPoint.
+#include "core/include/fpdfapi/fpdf_parser.h" // For CPDF_Point.
#include "fpdfsdk/include/fxedit/fx_edit.h"
class IFX_Edit;
@@ -33,7 +33,7 @@ class CLST_Size {
FX_FLOAT x, y;
};
-class CLST_Rect : public CFX_FloatRect {
+class CLST_Rect : public CPDF_Rect {
public:
CLST_Rect() { left = top = right = bottom = 0.0f; }
@@ -47,7 +47,7 @@ class CLST_Rect : public CFX_FloatRect {
bottom = other_bottom;
}
- CLST_Rect(const CFX_FloatRect& rect) {
+ CLST_Rect(const CPDF_Rect& rect) {
left = rect.left;
top = rect.top;
right = rect.right;
@@ -58,7 +58,7 @@ class CLST_Rect : public CFX_FloatRect {
void Default() { left = top = right = bottom = 0.0f; }
- const CLST_Rect operator=(const CFX_FloatRect& rect) {
+ const CLST_Rect operator=(const CPDF_Rect& rect) {
left = rect.left;
top = rect.top;
right = rect.right;
@@ -83,11 +83,11 @@ class CLST_Rect : public CFX_FloatRect {
return bottom - top;
}
- CFX_FloatPoint LeftTop() const { return CFX_FloatPoint(left, top); }
+ CPDF_Point LeftTop() const { return CPDF_Point(left, top); }
- CFX_FloatPoint RightBottom() const { return CFX_FloatPoint(right, bottom); }
+ CPDF_Point RightBottom() const { return CPDF_Point(right, bottom); }
- const CLST_Rect operator+=(const CFX_FloatPoint& point) {
+ const CLST_Rect operator+=(const CPDF_Point& point) {
left += point.x;
right += point.x;
top += point.y;
@@ -96,7 +96,7 @@ class CLST_Rect : public CFX_FloatRect {
return *this;
}
- const CLST_Rect operator-=(const CFX_FloatPoint& point) {
+ const CLST_Rect operator-=(const CPDF_Point& point) {
left -= point.x;
right -= point.x;
top -= point.y;
@@ -105,12 +105,12 @@ class CLST_Rect : public CFX_FloatRect {
return *this;
}
- CLST_Rect operator+(const CFX_FloatPoint& point) const {
+ CLST_Rect operator+(const CPDF_Point& point) const {
return CLST_Rect(left + point.x, top + point.y, right + point.x,
bottom + point.y);
}
- CLST_Rect operator-(const CFX_FloatPoint& point) const {
+ CLST_Rect operator-(const CPDF_Point& point) const {
return CLST_Rect(left - point.x, top - point.y, right - point.x,
bottom - point.y);
}
@@ -152,43 +152,41 @@ class CFX_ListContainer {
: m_rcPlate(0.0f, 0.0f, 0.0f, 0.0f),
m_rcContent(0.0f, 0.0f, 0.0f, 0.0f) {}
virtual ~CFX_ListContainer() {}
- virtual void SetPlateRect(const CFX_FloatRect& rect) { m_rcPlate = rect; }
- CFX_FloatRect GetPlateRect() const { return m_rcPlate; }
+ virtual void SetPlateRect(const CPDF_Rect& rect) { m_rcPlate = rect; }
+ CPDF_Rect GetPlateRect() const { return m_rcPlate; }
void SetContentRect(const CLST_Rect& rect) { m_rcContent = rect; }
CLST_Rect GetContentRect() const { return m_rcContent; }
- CFX_FloatPoint GetBTPoint() const {
- return CFX_FloatPoint(m_rcPlate.left, m_rcPlate.top);
+ CPDF_Point GetBTPoint() const {
+ return CPDF_Point(m_rcPlate.left, m_rcPlate.top);
}
- CFX_FloatPoint GetETPoint() const {
- return CFX_FloatPoint(m_rcPlate.right, m_rcPlate.bottom);
+ CPDF_Point GetETPoint() const {
+ return CPDF_Point(m_rcPlate.right, m_rcPlate.bottom);
}
public:
- CFX_FloatPoint InnerToOuter(const CFX_FloatPoint& point) const {
- return CFX_FloatPoint(point.x + GetBTPoint().x, GetBTPoint().y - point.y);
+ CPDF_Point InnerToOuter(const CPDF_Point& point) const {
+ return CPDF_Point(point.x + GetBTPoint().x, GetBTPoint().y - point.y);
}
- CFX_FloatPoint OuterToInner(const CFX_FloatPoint& point) const {
- return CFX_FloatPoint(point.x - GetBTPoint().x, GetBTPoint().y - point.y);
+ CPDF_Point OuterToInner(const CPDF_Point& point) const {
+ return CPDF_Point(point.x - GetBTPoint().x, GetBTPoint().y - point.y);
}
- CFX_FloatRect InnerToOuter(const CLST_Rect& rect) const {
- CFX_FloatPoint ptLeftTop =
- InnerToOuter(CFX_FloatPoint(rect.left, rect.top));
- CFX_FloatPoint ptRightBottom =
- InnerToOuter(CFX_FloatPoint(rect.right, rect.bottom));
- return CFX_FloatRect(ptLeftTop.x, ptRightBottom.y, ptRightBottom.x,
- ptLeftTop.y);
+ CPDF_Rect InnerToOuter(const CLST_Rect& rect) const {
+ CPDF_Point ptLeftTop = InnerToOuter(CPDF_Point(rect.left, rect.top));
+ CPDF_Point ptRightBottom =
+ InnerToOuter(CPDF_Point(rect.right, rect.bottom));
+ return CPDF_Rect(ptLeftTop.x, ptRightBottom.y, ptRightBottom.x,
+ ptLeftTop.y);
}
- CLST_Rect OuterToInner(const CFX_FloatRect& rect) const {
- CFX_FloatPoint ptLeftTop =
- OuterToInner(CFX_FloatPoint(rect.left, rect.top));
- CFX_FloatPoint ptRightBottom =
- OuterToInner(CFX_FloatPoint(rect.right, rect.bottom));
+ CLST_Rect OuterToInner(const CPDF_Rect& rect) const {
+ CPDF_Point ptLeftTop = OuterToInner(CPDF_Point(rect.left, rect.top));
+ CPDF_Point ptRightBottom =
+ OuterToInner(CPDF_Point(rect.right, rect.bottom));
return CLST_Rect(ptLeftTop.x, ptLeftTop.y, ptRightBottom.x,
ptRightBottom.y);
}
private:
- CFX_FloatRect m_rcPlate;
+ CPDF_Rect m_rcPlate;
CLST_Rect m_rcContent; // positive forever!
};
@@ -215,8 +213,8 @@ class CFX_List : protected CFX_ListContainer, public IFX_List {
// IFX_List:
void SetFontMap(IFX_Edit_FontMap* pFontMap) override;
void SetFontSize(FX_FLOAT fFontSize) override;
- CFX_FloatRect GetPlateRect() const override;
- CFX_FloatRect GetContentRect() const override;
+ CPDF_Rect GetPlateRect() const override;
+ CPDF_Rect GetContentRect() const override;
FX_FLOAT GetFontSize() const override;
IFX_Edit* GetItemEdit(int32_t nIndex) const override;
int32_t GetCount() const override;
@@ -227,8 +225,8 @@ class CFX_List : protected CFX_ListContainer, public IFX_List {
FX_BOOL IsValid(int32_t nItemIndex) const override;
int32_t FindNext(int32_t nIndex, FX_WCHAR nChar) const override;
void Empty() override;
- CFX_FloatRect GetItemRect(int32_t nIndex) const override;
- int32_t GetItemIndex(const CFX_FloatPoint& point) const override;
+ CPDF_Rect GetItemRect(int32_t nIndex) const override;
+ int32_t GetItemIndex(const CPDF_Point& point) const override;
int32_t GetFirstSelected() const override;
protected:
@@ -286,10 +284,10 @@ class CFX_ListCtrl : public CFX_List {
// CFX_List
void SetNotify(IFX_List_Notify* pNotify) override;
- void OnMouseDown(const CFX_FloatPoint& point,
+ void OnMouseDown(const CPDF_Point& point,
FX_BOOL bShift,
FX_BOOL bCtrl) override;
- void OnMouseMove(const CFX_FloatPoint& point,
+ void OnMouseMove(const CPDF_Point& point,
FX_BOOL bShift,
FX_BOOL bCtrl) override;
void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) override;
@@ -300,15 +298,15 @@ class CFX_ListCtrl : public CFX_List {
void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) override;
void OnVK(int32_t nItemIndex, FX_BOOL bShift, FX_BOOL bCtrl) override;
FX_BOOL OnChar(FX_WORD nChar, FX_BOOL bShift, FX_BOOL bCtrl) override;
- void SetPlateRect(const CFX_FloatRect& rect) override;
- void SetScrollPos(const CFX_FloatPoint& point) override;
+ void SetPlateRect(const CPDF_Rect& rect) override;
+ void SetScrollPos(const CPDF_Point& point) override;
void ScrollToListItem(int32_t nItemIndex) override;
- CFX_FloatRect GetItemRect(int32_t nIndex) const override;
+ CPDF_Rect GetItemRect(int32_t nIndex) const override;
int32_t GetCaret() const override { return m_nCaretIndex; }
int32_t GetSelect() const override { return m_nSelItem; }
int32_t GetTopItem() const override;
- CFX_FloatRect GetContentRect() const override;
- int32_t GetItemIndex(const CFX_FloatPoint& point) const override;
+ CPDF_Rect GetContentRect() const override;
+ int32_t GetItemIndex(const CPDF_Point& point) const override;
void AddString(const FX_WCHAR* string) override;
void SetTopItem(int32_t nIndex) override;
void Select(int32_t nItemIndex) override;
@@ -318,10 +316,10 @@ class CFX_ListCtrl : public CFX_List {
CFX_WideString GetText() const override;
void ReArrange(int32_t nItemIndex) override;
- virtual CFX_FloatPoint InToOut(const CFX_FloatPoint& point) const;
- virtual CFX_FloatPoint OutToIn(const CFX_FloatPoint& point) const;
- virtual CFX_FloatRect InToOut(const CFX_FloatRect& rect) const;
- virtual CFX_FloatRect OutToIn(const CFX_FloatRect& rect) const;
+ virtual CPDF_Point InToOut(const CPDF_Point& point) const;
+ virtual CPDF_Point OutToIn(const CPDF_Point& point) const;
+ virtual CPDF_Rect InToOut(const CPDF_Rect& rect) const;
+ virtual CPDF_Rect OutToIn(const CPDF_Rect& rect) const;
private:
void SetMultipleSelect(int32_t nItemIndex, FX_BOOL bSelected);
@@ -335,7 +333,7 @@ class CFX_ListCtrl : public CFX_List {
private:
IFX_List_Notify* m_pNotify;
FX_BOOL m_bNotifyFlag;
- CFX_FloatPoint m_ptScrollPos;
+ CPDF_Point m_ptScrollPos;
CPLST_Select m_aSelItems; // for multiple
int32_t m_nSelItem; // for single
int32_t m_nFootIndex; // for multiple