summaryrefslogtreecommitdiff
path: root/core/include
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-02-26 14:24:28 -0800
committerTom Sepez <tsepez@chromium.org>2016-02-26 14:24:28 -0800
commit281a9eadff15b167e2ee3032e21b83190ad49125 (patch)
treef02f7d0842f59d8e69bda011b3e62547ffb1acde /core/include
parent566b974287ce0e81a963138152b8898f22480f52 (diff)
downloadpdfium-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 'core/include')
-rw-r--r--core/include/fpdfapi/fpdf_parser.h19
-rw-r--r--core/include/fpdfdoc/fpdf_ap.h4
-rw-r--r--core/include/fpdfdoc/fpdf_vt.h21
-rw-r--r--core/include/fpdftext/fpdf_text.h2
-rw-r--r--core/include/fxcrt/fx_coordinates.h9
5 files changed, 24 insertions, 31 deletions
diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h
index 9fa05c75ed..c57d9f20b9 100644
--- a/core/include/fpdfapi/fpdf_parser.h
+++ b/core/include/fpdfapi/fpdf_parser.h
@@ -672,26 +672,11 @@ class CPDF_StandardCryptoHandler : public CPDF_CryptoHandler {
FX_BOOL bEncrypt);
uint8_t m_EncryptKey[32];
-
int m_KeyLen;
-
int m_Cipher;
-
uint8_t* m_pAESContext;
};
-class CPDF_Point {
- public:
- CPDF_Point(FX_FLOAT xx, FX_FLOAT yy) {
- x = xx;
- y = yy;
- }
-
- FX_FLOAT x;
- FX_FLOAT y;
-};
-
-#define CPDF_Rect CFX_FloatRect
CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& orig);
CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig);
CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig);
@@ -702,23 +687,21 @@ CFX_WideString PDF_DecodeText(const CFX_ByteString& bstr);
CFX_ByteString PDF_EncodeText(const FX_WCHAR* pString, int len = -1);
CFX_ByteString PDF_EncodeText(const CFX_WideString& str);
-FX_FLOAT PDF_ClipFloat(FX_FLOAT f);
class CFDF_Document : public CPDF_IndirectObjectHolder {
public:
static CFDF_Document* CreateNewDoc();
static CFDF_Document* ParseFile(IFX_FileRead* pFile,
FX_BOOL bOwnFile = FALSE);
static CFDF_Document* ParseMemory(const uint8_t* pData, FX_DWORD size);
-
~CFDF_Document();
FX_BOOL WriteBuf(CFX_ByteTextBuf& buf) const;
-
CPDF_Dictionary* GetRoot() const { return m_pRootDict; }
protected:
CFDF_Document();
void ParseStream(IFX_FileRead* pFile, FX_BOOL bOwnFile);
+
CPDF_Dictionary* m_pRootDict;
IFX_FileRead* m_pFile;
FX_BOOL m_bOwnFile;
diff --git a/core/include/fpdfdoc/fpdf_ap.h b/core/include/fpdfdoc/fpdf_ap.h
index f9ade57d97..5f2a3005ea 100644
--- a/core/include/fpdfdoc/fpdf_ap.h
+++ b/core/include/fpdfdoc/fpdf_ap.h
@@ -81,12 +81,12 @@ class CPVT_GenerateAP {
static CFX_ByteString GenerateEditAP(IPVT_FontMap* pFontMap,
IPDF_VariableText_Iterator* pIterator,
- const CPDF_Point& ptOffset,
+ const CFX_FloatPoint& ptOffset,
FX_BOOL bContinuous,
FX_WORD SubWord = 0,
const CPVT_WordRange* pVisible = NULL);
- static CFX_ByteString GenerateBorderAP(const CPDF_Rect& rect,
+ static CFX_ByteString GenerateBorderAP(const CFX_FloatRect& rect,
FX_FLOAT fWidth,
const CPVT_Color& color,
const CPVT_Color& crLeftTop,
diff --git a/core/include/fpdfdoc/fpdf_vt.h b/core/include/fpdfdoc/fpdf_vt.h
index 91a93884e8..b2e64cd2ed 100644
--- a/core/include/fpdfdoc/fpdf_vt.h
+++ b/core/include/fpdfdoc/fpdf_vt.h
@@ -226,7 +226,7 @@ struct CPVT_Word {
CPVT_WordPlace WordPlace;
- CPDF_Point ptWord;
+ CFX_FloatPoint ptWord;
FX_FLOAT fAscent;
@@ -248,7 +248,7 @@ struct CPVT_Line {
CPVT_WordPlace lineEnd;
- CPDF_Point ptLine;
+ CFX_FloatPoint ptLine;
FX_FLOAT fLineWidth;
@@ -259,7 +259,7 @@ struct CPVT_Line {
struct CPVT_Section {
CPVT_WordPlace secplace;
- CPDF_Rect rcSection;
+ CFX_FloatRect rcSection;
CPVT_SecProps SecProps;
@@ -328,7 +328,7 @@ class IPDF_VariableText {
virtual IPDF_VariableText_Iterator* GetIterator() = 0;
- virtual void SetPlateRect(const CPDF_Rect& rect) = 0;
+ virtual void SetPlateRect(const CFX_FloatRect& rect) = 0;
virtual void SetAlignment(int32_t nFormat = 0) = 0;
@@ -395,9 +395,9 @@ class IPDF_VariableText {
virtual CPVT_WordPlace BackSpaceWord(const CPVT_WordPlace& place) = 0;
- virtual const CPDF_Rect& GetPlateRect() const = 0;
+ virtual const CFX_FloatRect& GetPlateRect() const = 0;
- virtual CPDF_Rect GetContentRect() const = 0;
+ virtual CFX_FloatRect GetContentRect() const = 0;
virtual int32_t GetTotalWords() const = 0;
@@ -427,13 +427,14 @@ class IPDF_VariableText {
virtual CPVT_WordPlace GetNextWordPlace(
const CPVT_WordPlace& place) const = 0;
- virtual CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const = 0;
+ virtual CPVT_WordPlace SearchWordPlace(const CFX_FloatPoint& point) const = 0;
virtual CPVT_WordPlace GetUpWordPlace(const CPVT_WordPlace& place,
- const CPDF_Point& point) const = 0;
+ const CFX_FloatPoint& point) const = 0;
- virtual CPVT_WordPlace GetDownWordPlace(const CPVT_WordPlace& place,
- const CPDF_Point& point) const = 0;
+ virtual CPVT_WordPlace GetDownWordPlace(
+ const CPVT_WordPlace& place,
+ const CFX_FloatPoint& point) const = 0;
virtual CPVT_WordPlace GetLineBeginPlace(
const CPVT_WordPlace& place) const = 0;
diff --git a/core/include/fpdftext/fpdf_text.h b/core/include/fpdftext/fpdf_text.h
index 498b6235c3..7c1cde6051 100644
--- a/core/include/fpdftext/fpdf_text.h
+++ b/core/include/fpdftext/fpdf_text.h
@@ -58,7 +58,7 @@ class IPDF_TextPage {
virtual void GetRectArray(int start,
int nCount,
CFX_RectArray& rectArray) const = 0;
- virtual int GetIndexAtPos(CPDF_Point point,
+ virtual int GetIndexAtPos(CFX_FloatPoint point,
FX_FLOAT xTolerance,
FX_FLOAT yTolerance) const = 0;
virtual int GetIndexAtPos(FX_FLOAT x,
diff --git a/core/include/fxcrt/fx_coordinates.h b/core/include/fxcrt/fx_coordinates.h
index 053d637689..30770309a0 100644
--- a/core/include/fxcrt/fx_coordinates.h
+++ b/core/include/fxcrt/fx_coordinates.h
@@ -415,6 +415,15 @@ struct FX_SMALL_RECT {
int16_t Bottom;
};
+
+class CFX_FloatPoint {
+ public:
+ CFX_FloatPoint(FX_FLOAT xx, FX_FLOAT yy) : x(xx), y(yy) {}
+
+ FX_FLOAT x;
+ FX_FLOAT y;
+};
+
class CFX_FloatRect {
public:
CFX_FloatRect() { left = right = bottom = top = 0; }