summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/cfx_systemhandler.cpp1
-rw-r--r--fpdfsdk/formfiller/cffl_iformfiller.cpp77
-rw-r--r--fpdfsdk/fpdf_progressive.cpp1
-rw-r--r--fpdfsdk/fpdf_sysfontinfo.cpp2
-rw-r--r--fpdfsdk/fpdfformfill.cpp1
-rw-r--r--fpdfsdk/fpdfview.cpp5
-rw-r--r--fpdfsdk/fsdk_baseform.cpp1
-rw-r--r--fpdfsdk/fsdk_rendercontext.cpp1
-rw-r--r--fpdfsdk/include/fsdk_define.h35
9 files changed, 68 insertions, 56 deletions
diff --git a/fpdfsdk/cfx_systemhandler.cpp b/fpdfsdk/cfx_systemhandler.cpp
index c5f53341e1..c0fd140c9b 100644
--- a/fpdfsdk/cfx_systemhandler.cpp
+++ b/fpdfsdk/cfx_systemhandler.cpp
@@ -6,6 +6,7 @@
#include "fpdfsdk/cfx_systemhandler.h"
+#include "core/fxge/include/fx_ge.h"
#include "fpdfsdk/formfiller/cffl_formfiller.h"
#include "fpdfsdk/include/fsdk_mgr.h"
diff --git a/fpdfsdk/formfiller/cffl_iformfiller.cpp b/fpdfsdk/formfiller/cffl_iformfiller.cpp
index 75e57512df..06f24182ce 100644
--- a/fpdfsdk/formfiller/cffl_iformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_iformfiller.cpp
@@ -8,6 +8,7 @@
#include "core/fpdfapi/fpdf_page/include/cpdf_page.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
+#include "core/fxge/include/fx_ge.h"
#include "fpdfsdk/formfiller/cffl_checkbox.h"
#include "fpdfsdk/formfiller/cffl_combobox.h"
#include "fpdfsdk/formfiller/cffl_formfiller.h"
@@ -33,9 +34,7 @@ FX_BOOL CFFL_IFormFiller::Annot_HitTest(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
CFX_FloatPoint point) {
CFX_FloatRect rc = pAnnot->GetRect();
- if (rc.Contains(point.x, point.y))
- return TRUE;
- return FALSE;
+ return rc.Contains(point.x, point.y);
}
FX_RECT CFFL_IFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView,
@@ -61,46 +60,48 @@ void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView,
ASSERT(pPageView);
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
- if (IsVisible(pWidget)) {
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
- if (pFormFiller->IsValid()) {
- pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
- pAnnot->GetPDFPage();
-
- CPDFSDK_Document* pDocument = m_pApp->GetSDKDocument();
- if (pDocument->GetFocusAnnot() == pAnnot) {
- CFX_FloatRect rcFocus = pFormFiller->GetFocusBox(pPageView);
- if (!rcFocus.IsEmpty()) {
- CFX_PathData path;
- path.SetPointCount(5);
- path.SetPoint(0, rcFocus.left, rcFocus.top, FXPT_MOVETO);
- path.SetPoint(1, rcFocus.left, rcFocus.bottom, FXPT_LINETO);
- path.SetPoint(2, rcFocus.right, rcFocus.bottom, FXPT_LINETO);
- path.SetPoint(3, rcFocus.right, rcFocus.top, FXPT_LINETO);
- path.SetPoint(4, rcFocus.left, rcFocus.top, FXPT_LINETO);
-
- CFX_GraphStateData gsd;
- gsd.SetDashCount(1);
- gsd.m_DashArray[0] = 1.0f;
- gsd.m_DashPhase = 0;
- gsd.m_LineWidth = 1.0f;
- pDevice->DrawPath(&path, pUser2Device, &gsd, 0,
- ArgbEncode(255, 0, 0, 0), FXFILL_ALTERNATE);
- }
+ if (!IsVisible(pWidget))
+ return;
+
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
+ if (pFormFiller->IsValid()) {
+ pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
+ pAnnot->GetPDFPage();
+
+ CPDFSDK_Document* pDocument = m_pApp->GetSDKDocument();
+ if (pDocument->GetFocusAnnot() == pAnnot) {
+ CFX_FloatRect rcFocus = pFormFiller->GetFocusBox(pPageView);
+ if (!rcFocus.IsEmpty()) {
+ CFX_PathData path;
+ path.SetPointCount(5);
+ path.SetPoint(0, rcFocus.left, rcFocus.top, FXPT_MOVETO);
+ path.SetPoint(1, rcFocus.left, rcFocus.bottom, FXPT_LINETO);
+ path.SetPoint(2, rcFocus.right, rcFocus.bottom, FXPT_LINETO);
+ path.SetPoint(3, rcFocus.right, rcFocus.top, FXPT_LINETO);
+ path.SetPoint(4, rcFocus.left, rcFocus.top, FXPT_LINETO);
+
+ CFX_GraphStateData gsd;
+ gsd.SetDashCount(1);
+ gsd.m_DashArray[0] = 1.0f;
+ gsd.m_DashPhase = 0;
+ gsd.m_LineWidth = 1.0f;
+ pDevice->DrawPath(&path, pUser2Device, &gsd, 0,
+ ArgbEncode(255, 0, 0, 0), FXFILL_ALTERNATE);
}
- return;
}
+ return;
}
+ }
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- pFormFiller->OnDrawDeactive(pPageView, pAnnot, pDevice, pUser2Device,
- dwFlags);
- else
- pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
-
- if (!IsReadOnly(pWidget) && IsFillingAllowed(pWidget))
- pWidget->DrawShadow(pDevice, pPageView);
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
+ pFormFiller->OnDrawDeactive(pPageView, pAnnot, pDevice, pUser2Device,
+ dwFlags);
+ } else {
+ pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
}
+
+ if (!IsReadOnly(pWidget) && IsFillingAllowed(pWidget))
+ pWidget->DrawShadow(pDevice, pPageView);
}
void CFFL_IFormFiller::OnCreate(CPDFSDK_Annot* pAnnot) {
diff --git a/fpdfsdk/fpdf_progressive.cpp b/fpdfsdk/fpdf_progressive.cpp
index 90e8402bf8..411ae17af4 100644
--- a/fpdfsdk/fpdf_progressive.cpp
+++ b/fpdfsdk/fpdf_progressive.cpp
@@ -8,6 +8,7 @@
#include "core/fpdfapi/fpdf_page/include/cpdf_page.h"
#include "core/fpdfapi/fpdf_render/include/cpdf_progressiverenderer.h"
+#include "core/fxge/include/fx_ge.h"
#include "fpdfsdk/include/fsdk_define.h"
#include "fpdfsdk/include/fsdk_rendercontext.h"
#include "public/fpdfview.h"
diff --git a/fpdfsdk/fpdf_sysfontinfo.cpp b/fpdfsdk/fpdf_sysfontinfo.cpp
index d5ee7d186f..18b01341ee 100644
--- a/fpdfsdk/fpdf_sysfontinfo.cpp
+++ b/fpdfsdk/fpdf_sysfontinfo.cpp
@@ -6,6 +6,8 @@
#include "public/fpdf_sysfontinfo.h"
+#include "core/fxge/include/fx_font.h"
+#include "core/fxge/include/fx_ge.h"
#include "fpdfsdk/include/fsdk_define.h"
#include "fpdfsdk/pdfwindow/PWL_FontMap.h"
diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp
index 81c5dd7a12..b1c729b8dc 100644
--- a/fpdfsdk/fpdfformfill.cpp
+++ b/fpdfsdk/fpdfformfill.cpp
@@ -12,6 +12,7 @@
#include "core/fpdfapi/fpdf_page/include/cpdf_page.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
#include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h"
+#include "core/fxge/include/fx_ge.h"
#include "fpdfsdk/include/fsdk_define.h"
#include "fpdfsdk/include/fsdk_mgr.h"
#include "public/fpdfview.h"
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index f483f7e4d5..0040c090f4 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -15,6 +15,7 @@
#include "core/fpdfapi/include/cpdf_modulemgr.h"
#include "core/fxcodec/include/fx_codec.h"
#include "core/fxcrt/include/fx_safe_types.h"
+#include "core/fxge/include/fx_ge.h"
#include "fpdfsdk/include/fsdk_define.h"
#include "fpdfsdk/include/fsdk_mgr.h"
#include "fpdfsdk/include/fsdk_rendercontext.h"
@@ -31,6 +32,10 @@
#include "public/fpdf_formfill.h"
#endif // PDF_ENABLE_XFA
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+#include "core/fxge/include/fx_ge_win32.h"
+#endif
+
UnderlyingDocumentType* UnderlyingFromFPDFDocument(FPDF_DOCUMENT doc) {
return static_cast<UnderlyingDocumentType*>(doc);
}
diff --git a/fpdfsdk/fsdk_baseform.cpp b/fpdfsdk/fsdk_baseform.cpp
index 6461221552..ea21511b8e 100644
--- a/fpdfsdk/fsdk_baseform.cpp
+++ b/fpdfsdk/fsdk_baseform.cpp
@@ -16,6 +16,7 @@
#include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h"
+#include "core/fxge/include/fx_ge.h"
#include "fpdfsdk/formfiller/cffl_formfiller.h"
#include "fpdfsdk/include/fsdk_actionhandler.h"
#include "fpdfsdk/include/fsdk_baseannot.h"
diff --git a/fpdfsdk/fsdk_rendercontext.cpp b/fpdfsdk/fsdk_rendercontext.cpp
index 9232d83edd..eb630dd60f 100644
--- a/fpdfsdk/fsdk_rendercontext.cpp
+++ b/fpdfsdk/fsdk_rendercontext.cpp
@@ -7,6 +7,7 @@
#include "fpdfsdk/include/fsdk_rendercontext.h"
#include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h"
+#include "core/fxge/include/fx_ge.h"
void CRenderContext::Clear() {
m_pDevice = NULL;
diff --git a/fpdfsdk/include/fsdk_define.h b/fpdfsdk/include/fsdk_define.h
index 536e35886f..a8a02d665e 100644
--- a/fpdfsdk/include/fsdk_define.h
+++ b/fpdfsdk/include/fsdk_define.h
@@ -9,8 +9,6 @@
#include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h"
#include "core/fpdfdoc/include/fpdf_doc.h"
-#include "core/fxge/include/fx_ge.h"
-#include "core/fxge/include/fx_ge_win32.h"
#include "public/fpdfview.h"
#ifdef PDF_ENABLE_XFA
@@ -63,22 +61,23 @@ class CPDF_CustomAccess final : public IFX_FileRead {
#ifdef PDF_ENABLE_XFA
class CFPDF_FileStream : public IFX_FileStream {
public:
- CFPDF_FileStream(FPDF_FILEHANDLER* pFS);
- virtual ~CFPDF_FileStream() {}
-
- virtual IFX_FileStream* Retain();
- virtual void Release();
-
- virtual FX_FILESIZE GetSize();
- virtual FX_BOOL IsEOF();
- virtual FX_FILESIZE GetPosition() { return m_nCurPos; }
- virtual void SetPosition(FX_FILESIZE pos) { m_nCurPos = pos; }
- virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size);
- virtual size_t ReadBlock(void* buffer, size_t size);
- virtual FX_BOOL WriteBlock(const void* buffer,
- FX_FILESIZE offset,
- size_t size);
- virtual FX_BOOL Flush();
+ explicit CFPDF_FileStream(FPDF_FILEHANDLER* pFS);
+ ~CFPDF_FileStream() override {}
+
+ // IFX_FileStream:
+ IFX_FileStream* Retain() override;
+ void Release() override;
+ FX_FILESIZE GetSize() override;
+ FX_BOOL IsEOF() override;
+ FX_FILESIZE GetPosition() override { return m_nCurPos; }
+ FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override;
+ size_t ReadBlock(void* buffer, size_t size) override;
+ FX_BOOL WriteBlock(const void* buffer,
+ FX_FILESIZE offset,
+ size_t size) override;
+ FX_BOOL Flush() override;
+
+ void SetPosition(FX_FILESIZE pos) { m_nCurPos = pos; }
protected:
FPDF_FILEHANDLER* m_pFS;