summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-09-15 12:41:50 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-15 12:41:50 -0700
commit8faac627c4562098c62f8497e56a44500c3c199b (patch)
tree1eeca4146f5376e4416b39c52a091a6d60d93d54 /fpdfsdk/pdfwindow
parent4935e606c632e38af8fca1729f8688fa0d152b90 (diff)
downloadpdfium-8faac627c4562098c62f8497e56a44500c3c199b.tar.xz
Cleanup CFX_SystemHandler.
This CL cleans up signatures and code in CFX_SystemHandler. Review-Url: https://codereview.chromium.org/2341693003
Diffstat (limited to 'fpdfsdk/pdfwindow')
-rw-r--r--fpdfsdk/pdfwindow/PWL_ComboBox.h5
-rw-r--r--fpdfsdk/pdfwindow/PWL_Edit.h4
-rw-r--r--fpdfsdk/pdfwindow/PWL_ListBox.h7
-rw-r--r--fpdfsdk/pdfwindow/PWL_Wnd.cpp11
-rw-r--r--fpdfsdk/pdfwindow/PWL_Wnd.h4
5 files changed, 12 insertions, 19 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_ComboBox.h b/fpdfsdk/pdfwindow/PWL_ComboBox.h
index df9eb5546e..91b833c77f 100644
--- a/fpdfsdk/pdfwindow/PWL_ComboBox.h
+++ b/fpdfsdk/pdfwindow/PWL_ComboBox.h
@@ -82,7 +82,7 @@ class CPWL_ComboBox : public CPWL_Wnd {
void SetSelectText();
- void AttachFFLData(void* pData) { m_pFormFiller = pData; }
+ void AttachFFLData(CFFL_FormFiller* pData) { m_pFormFiller = pData; }
private:
void CreateEdit(const PWL_CREATEPARAM& cp);
@@ -98,8 +98,7 @@ class CPWL_ComboBox : public CPWL_Wnd {
int32_t m_nPopupWhere;
int32_t m_nSelectItem;
IPWL_Filler_Notify* m_pFillerNotify;
-
- void* m_pFormFiller;
+ CFFL_FormFiller* m_pFormFiller; // Not owned.
};
#endif // FPDFSDK_PDFWINDOW_PWL_COMBOBOX_H_
diff --git a/fpdfsdk/pdfwindow/PWL_Edit.h b/fpdfsdk/pdfwindow/PWL_Edit.h
index 568f4805a9..e6993bd16b 100644
--- a/fpdfsdk/pdfwindow/PWL_Edit.h
+++ b/fpdfsdk/pdfwindow/PWL_Edit.h
@@ -110,7 +110,7 @@ class CPWL_Edit : public CPWL_EditCtrl {
const CFX_FloatPoint& ptOffset);
FX_BOOL IsProceedtoOnChar(uint16_t nKeyCode, uint32_t nFlag);
- void AttachFFLData(void* pData) { m_pFormFiller = pData; }
+ void AttachFFLData(CFFL_FormFiller* pData) { m_pFormFiller = pData; }
void OnInsertWord(const CPVT_WordPlace& place,
const CPVT_WordPlace& oldplace);
@@ -142,7 +142,7 @@ class CPWL_Edit : public CPWL_EditCtrl {
IPWL_Filler_Notify* m_pFillerNotify;
FX_BOOL m_bFocus;
CFX_FloatRect m_rcOldWindow;
- void* m_pFormFiller;
+ CFFL_FormFiller* m_pFormFiller; // Not owned.
};
#endif // FPDFSDK_PDFWINDOW_PWL_EDIT_H_
diff --git a/fpdfsdk/pdfwindow/PWL_ListBox.h b/fpdfsdk/pdfwindow/PWL_ListBox.h
index e42ca24ab4..294414a85f 100644
--- a/fpdfsdk/pdfwindow/PWL_ListBox.h
+++ b/fpdfsdk/pdfwindow/PWL_ListBox.h
@@ -99,6 +99,8 @@ class CPWL_ListBox : public CPWL_Wnd {
m_pFillerNotify = pNotify;
}
+ void AttachFFLData(CFFL_FormFiller* pData) { m_pFormFiller = pData; }
+
protected:
std::unique_ptr<CFX_ListCtrl> m_pList;
std::unique_ptr<CPWL_List_Notify> m_pListNotify;
@@ -106,11 +108,8 @@ class CPWL_ListBox : public CPWL_Wnd {
FX_BOOL m_bHoverSel;
IPWL_Filler_Notify* m_pFillerNotify;
- public:
- void AttachFFLData(void* pData) { m_pFormFiller = pData; }
-
private:
- void* m_pFormFiller;
+ CFFL_FormFiller* m_pFormFiller; // Not owned.
};
#endif // FPDFSDK_PDFWINDOW_PWL_LISTBOX_H_
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
index 4a479de0dc..adda0bbbc9 100644
--- a/fpdfsdk/pdfwindow/PWL_Wnd.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
@@ -24,7 +24,7 @@ PWL_CREATEPARAM::PWL_CREATEPARAM()
pFocusHandler(nullptr),
dwFlags(0),
sBackgroundColor(),
- hAttachedWnd(nullptr),
+ pAttachedWidget(nullptr),
nBorderStyle(BorderStyle::SOLID),
dwBorderWidth(1),
sBorderColor(),
@@ -422,9 +422,8 @@ void CPWL_Wnd::InvalidateRect(CFX_FloatRect* pRect) {
rcWin.bottom += PWL_INVALIDATE_INFLATE;
if (CFX_SystemHandler* pSH = GetSystemHandler()) {
- if (FX_HWND hWnd = GetAttachedHWnd()) {
- pSH->InvalidateRect(hWnd, rcWin);
- }
+ if (CPDFSDK_Widget* widget = m_sPrivateParam.pAttachedWidget)
+ pSH->InvalidateRect(widget, rcWin);
}
}
}
@@ -907,10 +906,6 @@ FX_RECT CPWL_Wnd::PWLtoWnd(const CFX_FloatRect& rect) const {
(int32_t)(rcTemp.right + 0.5), (int32_t)(rcTemp.top + 0.5));
}
-FX_HWND CPWL_Wnd::GetAttachedHWnd() const {
- return m_sPrivateParam.hAttachedWnd;
-}
-
CFX_FloatPoint CPWL_Wnd::ChildToParent(const CFX_FloatPoint& point) const {
CFX_Matrix mt = GetChildMatrix();
if (mt.IsIdentity())
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.h b/fpdfsdk/pdfwindow/PWL_Wnd.h
index de48a8c82d..ca2b4c77da 100644
--- a/fpdfsdk/pdfwindow/PWL_Wnd.h
+++ b/fpdfsdk/pdfwindow/PWL_Wnd.h
@@ -14,6 +14,7 @@
#include "core/fxcrt/include/fx_basic.h"
#include "fpdfsdk/cfx_systemhandler.h"
+class CPDFSDK_Widget;
class CPWL_MsgControl;
class CPWL_ScrollBar;
class CPWL_Timer;
@@ -197,7 +198,7 @@ struct PWL_CREATEPARAM {
IPWL_FocusHandler* pFocusHandler; // optional
uint32_t dwFlags; // optional
CPWL_Color sBackgroundColor; // optional
- FX_HWND hAttachedWnd; // required for no-reader framework
+ CPDFSDK_Widget* pAttachedWidget; // required for no-reader framework
BorderStyle nBorderStyle; // optional
int32_t dwBorderWidth; // optional
CPWL_Color sBorderColor; // optional
@@ -389,7 +390,6 @@ class CPWL_Wnd : public CPWL_TimerHandler {
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;
FX_BOOL IsWndCaptureKeyboard(const CPWL_Wnd* pWnd) const;