summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-06-15 11:21:33 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-15 11:21:33 -0700
commit625ad667d0c0c17d5bc11d505f04861d90b45078 (patch)
treeefd014e752072adf726a0e34383555399342dcb2 /fpdfsdk/pdfwindow
parent29b8ad0b130ec6ed4f72ebd0c0a4f9e6a5b03467 (diff)
downloadpdfium-625ad667d0c0c17d5bc11d505f04861d90b45078.tar.xz
Make code compile with clang_use_chrome_plugin (part IV)
This change mainly contains files in fpdfsdk/ directory. This is part of the efforts to make PDFium code compilable by Clang chromium style plugins. The changes are mainly the following: -- move inline constructor/destructor of complex class/struct out-of-line; -- add constructor/destructor of complex class/struct if not explicitly defined; -- add explicit out-of-line copy constructor when needed; -- move inline virtual functions out-of-line; -- Properly mark virtual functions with 'override'; -- some minor cleanups plus removing an unused file and splitting cxfa_eventparam out from fxfa.h BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2062313002
Diffstat (limited to 'fpdfsdk/pdfwindow')
-rw-r--r--fpdfsdk/pdfwindow/PWL_Icon.cpp4
-rw-r--r--fpdfsdk/pdfwindow/PWL_Icon.h2
-rw-r--r--fpdfsdk/pdfwindow/PWL_Wnd.cpp37
-rw-r--r--fpdfsdk/pdfwindow/PWL_Wnd.h31
4 files changed, 48 insertions, 26 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_Icon.cpp b/fpdfsdk/pdfwindow/PWL_Icon.cpp
index 9c2e5cbf69..6689aa644e 100644
--- a/fpdfsdk/pdfwindow/PWL_Icon.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Icon.cpp
@@ -112,6 +112,10 @@ CPWL_Icon::CPWL_Icon() : m_pIconFit(nullptr) {}
CPWL_Icon::~CPWL_Icon() {}
+CPDF_IconFit* CPWL_Icon::GetIconFit() {
+ return m_pIconFit;
+}
+
int32_t CPWL_Icon::GetScaleMethod() {
if (m_pIconFit)
return m_pIconFit->GetScaleMethod();
diff --git a/fpdfsdk/pdfwindow/PWL_Icon.h b/fpdfsdk/pdfwindow/PWL_Icon.h
index a5bd907012..04d13a1411 100644
--- a/fpdfsdk/pdfwindow/PWL_Icon.h
+++ b/fpdfsdk/pdfwindow/PWL_Icon.h
@@ -38,7 +38,7 @@ class CPWL_Icon : public CPWL_Image {
CPWL_Icon();
~CPWL_Icon() override;
- virtual CPDF_IconFit* GetIconFit() { return m_pIconFit; }
+ virtual CPDF_IconFit* GetIconFit();
// CPWL_Image
void GetScale(FX_FLOAT& fHScale, FX_FLOAT& fVScale) override;
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
index 2a0a0aabbb..e680652bb3 100644
--- a/fpdfsdk/pdfwindow/PWL_Wnd.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
@@ -16,6 +16,31 @@ static std::map<int32_t, CPWL_Timer*>& GetPWLTimeMap() {
return *timeMap;
}
+PWL_CREATEPARAM::PWL_CREATEPARAM()
+ : rcRectWnd(0, 0, 0, 0),
+ pSystemHandler(nullptr),
+ pFontMap(nullptr),
+ pProvider(nullptr),
+ pFocusHandler(nullptr),
+ dwFlags(0),
+ sBackgroundColor(),
+ hAttachedWnd(nullptr),
+ nBorderStyle(BorderStyle::SOLID),
+ dwBorderWidth(1),
+ sBorderColor(),
+ sTextColor(),
+ sTextStrokeColor(),
+ nTransparency(255),
+ fFontSize(PWL_DEFAULT_FONTSIZE),
+ sDash(3, 0, 0),
+ pAttachedData(nullptr),
+ pParentWnd(nullptr),
+ pMsgControl(nullptr),
+ eCursorType(FXCT_ARROW),
+ mtChild(1, 0, 0, 1, 0, 0) {}
+
+PWL_CREATEPARAM::PWL_CREATEPARAM(const PWL_CREATEPARAM& other) = default;
+
CPWL_Timer::CPWL_Timer(CPWL_TimerHandler* pAttached,
CFX_SystemHandler* pSystemHandler)
: m_nTimerID(0), m_pAttached(pAttached), m_pSystemHandler(pSystemHandler) {
@@ -930,6 +955,18 @@ CFX_FloatRect CPWL_Wnd::ParentToChild(const CFX_FloatRect& rect) const {
return rc;
}
+FX_FLOAT CPWL_Wnd::GetItemHeight(FX_FLOAT fLimitWidth) {
+ return 0;
+}
+
+FX_FLOAT CPWL_Wnd::GetItemLeftMargin() {
+ return 0;
+}
+
+FX_FLOAT CPWL_Wnd::GetItemRightMargin() {
+ return 0;
+}
+
CFX_Matrix CPWL_Wnd::GetChildToRoot() const {
CFX_Matrix mt(1, 0, 0, 1, 0, 0);
if (HasFlag(PWS_CHILD)) {
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.h b/fpdfsdk/pdfwindow/PWL_Wnd.h
index c393d2730e..197bdf0023 100644
--- a/fpdfsdk/pdfwindow/PWL_Wnd.h
+++ b/fpdfsdk/pdfwindow/PWL_Wnd.h
@@ -85,6 +85,7 @@ class IPWL_Provider;
#define PWL_CLASSNAME_EDIT "CPWL_Edit"
struct CPWL_Dash {
+ CPWL_Dash() : nDash(0), nGap(0), nPhase(0) {}
CPWL_Dash(int32_t dash, int32_t gap, int32_t phase)
: nDash(dash), nGap(gap), nPhase(phase) {}
@@ -186,28 +187,8 @@ class IPWL_FocusHandler {
struct PWL_CREATEPARAM {
public:
- PWL_CREATEPARAM()
- : rcRectWnd(0, 0, 0, 0),
- pSystemHandler(nullptr),
- pFontMap(nullptr),
- pProvider(nullptr),
- pFocusHandler(nullptr),
- dwFlags(0),
- sBackgroundColor(),
- hAttachedWnd(nullptr),
- nBorderStyle(BorderStyle::SOLID),
- dwBorderWidth(1),
- sBorderColor(),
- sTextColor(),
- sTextStrokeColor(),
- nTransparency(255),
- fFontSize(PWL_DEFAULT_FONTSIZE),
- sDash(3, 0, 0),
- pAttachedData(nullptr),
- pParentWnd(nullptr),
- pMsgControl(nullptr),
- eCursorType(FXCT_ARROW),
- mtChild(1, 0, 0, 1, 0, 0) {}
+ PWL_CREATEPARAM();
+ PWL_CREATEPARAM(const PWL_CREATEPARAM& other);
CFX_FloatRect rcRectWnd; // required
CFX_SystemHandler* pSystemHandler; // required
@@ -364,9 +345,9 @@ class CPWL_Wnd : public CPWL_TimerHandler {
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; }
- virtual FX_FLOAT GetItemLeftMargin() { return 0; }
- virtual FX_FLOAT GetItemRightMargin() { return 0; }
+ virtual FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth);
+ virtual FX_FLOAT GetItemLeftMargin();
+ virtual FX_FLOAT GetItemRightMargin();
void EnableWindow(FX_BOOL bEnable);
FX_BOOL IsEnabled();