summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/ifwl_caret.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-10-31 07:29:34 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-31 07:29:34 -0700
commit20855384b8149a631c3c1d229551523c12eb767b (patch)
treee3cef278e322742bea6c4b48f40ed580754ebd80 /xfa/fwl/core/ifwl_caret.cpp
parent747dcf775c5cb661e96a639f73322cc489d8590f (diff)
downloadpdfium-20855384b8149a631c3c1d229551523c12eb767b.tar.xz
Remove FWL globals.
This CL removes the FWL_GetApp, FWL_SetApp and FWL_GetWidgetAdapter methods. In the process it changes the various Initialize methods to return void. Review-Url: https://codereview.chromium.org/2436103002
Diffstat (limited to 'xfa/fwl/core/ifwl_caret.cpp')
-rw-r--r--xfa/fwl/core/ifwl_caret.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/xfa/fwl/core/ifwl_caret.cpp b/xfa/fwl/core/ifwl_caret.cpp
index 52269049e2..b6f799633b 100644
--- a/xfa/fwl/core/ifwl_caret.cpp
+++ b/xfa/fwl/core/ifwl_caret.cpp
@@ -12,10 +12,11 @@
#include "xfa/fwl/core/ifwl_caret.h"
#include "xfa/fwl/core/ifwl_themeprovider.h"
-IFWL_Caret::IFWL_Caret(const CFWL_WidgetImpProperties& properties,
+IFWL_Caret::IFWL_Caret(const IFWL_App* app,
+ const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter)
- : IFWL_Widget(properties, pOuter),
- m_pTimer(new CFWL_CaretTimer(this)),
+ : IFWL_Widget(app, properties, pOuter),
+ m_pTimer(new IFWL_Caret::Timer(this)),
m_pTimerInfo(nullptr),
m_dwElapse(400),
m_bSetColor(FALSE) {
@@ -28,12 +29,9 @@ FWL_Type IFWL_Caret::GetClassID() const {
return FWL_Type::Caret;
}
-FWL_Error IFWL_Caret::Initialize() {
- if (IFWL_Widget::Initialize() != FWL_Error::Succeeded)
- return FWL_Error::Indefinite;
-
+void IFWL_Caret::Initialize() {
+ IFWL_Widget::Initialize();
m_pDelegate = new CFWL_CaretImpDelegate(this);
- return FWL_Error::Succeeded;
}
void IFWL_Caret::Finalize() {
@@ -109,17 +107,17 @@ void IFWL_Caret::DrawCaretBK(CFX_Graphics* pGraphics,
pTheme->DrawBackground(&param);
}
-IFWL_Caret::CFWL_CaretTimer::CFWL_CaretTimer(IFWL_Caret* pCaret)
- : m_pCaret(pCaret) {}
+IFWL_Caret::Timer::Timer(IFWL_Caret* pCaret) : IFWL_Timer(pCaret) {}
-void IFWL_Caret::CFWL_CaretTimer::Run(IFWL_TimerInfo* pTimerInfo) {
- bool toggle = !(m_pCaret->GetStates() & FWL_STATE_CAT_HightLight);
- m_pCaret->SetStates(FWL_STATE_CAT_HightLight, toggle);
+void IFWL_Caret::Timer::Run(IFWL_TimerInfo* pTimerInfo) {
+ IFWL_Caret* pCaret = static_cast<IFWL_Caret*>(m_pWidget);
+ bool toggle = !(pCaret->GetStates() & FWL_STATE_CAT_HightLight);
+ pCaret->SetStates(FWL_STATE_CAT_HightLight, toggle);
CFX_RectF rt;
- m_pCaret->GetWidgetRect(rt);
+ pCaret->GetWidgetRect(rt);
rt.Set(0, 0, rt.width + 1, rt.height);
- m_pCaret->Repaint(&rt);
+ pCaret->Repaint(&rt);
}
CFWL_CaretImpDelegate::CFWL_CaretImpDelegate(IFWL_Caret* pOwner)