Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(581)

Unified Diff: xfa/fwl/core/fwl_noteimp.cpp

Issue 2004213002: Remove IWFL_WidgetMgr in favor of CFWL_WidgetMgr (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: xfa/fwl/core/fwl_noteimp.cpp
diff --git a/xfa/fwl/core/fwl_noteimp.cpp b/xfa/fwl/core/fwl_noteimp.cpp
index 4db2d6bb5f6e72c21039ccf4425fd3777fd8f697..7d6f6c8109c7ae05a4e5799f4bb5fca31b02aa77 100644
--- a/xfa/fwl/core/fwl_noteimp.cpp
+++ b/xfa/fwl/core/fwl_noteimp.cpp
@@ -172,8 +172,8 @@ FX_BOOL CFWL_NoteDriver::SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify) {
}
}
if (pFocus) {
- IFWL_Widget* pWidget =
- FWL_GetWidgetMgr()->GetWidget(pFocus, FWL_WGTRELATION_SystemForm);
+ IFWL_Widget* pWidget = IFWL_WidgetMgr::GetInstance()->GetWidget(
+ pFocus, FWL_WGTRELATION_SystemForm);
CFWL_FormImp* pForm =
pWidget ? static_cast<CFWL_FormImp*>(pWidget->GetImpl()) : nullptr;
if (pForm) {
@@ -194,7 +194,8 @@ FX_BOOL CFWL_NoteDriver::SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify) {
return TRUE;
}
FWL_Error CFWL_NoteDriver::Run() {
- CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr());
+ CFWL_WidgetMgr* pWidgetMgr =
+ static_cast<CFWL_WidgetMgr*>(IFWL_WidgetMgr::GetInstance());
if (!pWidgetMgr)
return FWL_Error::Indefinite;
@@ -319,7 +320,8 @@ int32_t CFWL_NoteDriver::CountLoop() {
}
FX_BOOL CFWL_NoteDriver::ProcessMessage(CFWL_Message* pMessage) {
- CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr());
+ CFWL_WidgetMgr* pWidgetMgr =
+ static_cast<CFWL_WidgetMgr*>(IFWL_WidgetMgr::GetInstance());
IFWL_Widget* pMessageForm = pWidgetMgr->IsFormDisabled()
? pMessage->m_pDstTarget
: GetMessageForm(pMessage->m_pDstTarget);
@@ -436,7 +438,8 @@ FX_BOOL CFWL_NoteDriver::DoDeactivate(CFWL_MsgDeactivate* pMsg,
}
FX_BOOL CFWL_NoteDriver::DoSetFocus(CFWL_MsgSetFocus* pMsg,
IFWL_Widget* pMessageForm) {
- CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr());
+ CFWL_WidgetMgr* pWidgetMgr =
+ static_cast<CFWL_WidgetMgr*>(IFWL_WidgetMgr::GetInstance());
if (pWidgetMgr->IsFormDisabled()) {
m_pFocus = pMsg->m_pDstTarget;
return TRUE;
@@ -459,7 +462,8 @@ FX_BOOL CFWL_NoteDriver::DoSetFocus(CFWL_MsgSetFocus* pMsg,
}
FX_BOOL CFWL_NoteDriver::DoKillFocus(CFWL_MsgKillFocus* pMsg,
IFWL_Widget* pMessageForm) {
- CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr());
+ CFWL_WidgetMgr* pWidgetMgr =
+ static_cast<CFWL_WidgetMgr*>(IFWL_WidgetMgr::GetInstance());
if (pWidgetMgr->IsFormDisabled()) {
if (m_pFocus == pMsg->m_pDstTarget) {
m_pFocus = NULL;
@@ -486,7 +490,7 @@ FX_BOOL CFWL_NoteDriver::DoKey(CFWL_MsgKey* pMsg, IFWL_Widget* pMessageForm) {
if (pMsg->m_dwCmd == FWL_KeyCommand::KeyDown &&
pMsg->m_dwKeyCode == FWL_VKEY_Tab) {
CFWL_WidgetMgr* pWidgetMgr =
- static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr());
+ static_cast<CFWL_WidgetMgr*>(IFWL_WidgetMgr::GetInstance());
IFWL_Widget* pForm = GetMessageForm(pMsg->m_pDstTarget);
IFWL_Widget* pFocus = m_pFocus;
if (m_pFocus) {
@@ -514,7 +518,7 @@ FX_BOOL CFWL_NoteDriver::DoKey(CFWL_MsgKey* pMsg, IFWL_Widget* pMessageForm) {
if (pMsg->m_dwCmd == FWL_KeyCommand::KeyDown &&
pMsg->m_dwKeyCode == FWL_VKEY_Return) {
CFWL_WidgetMgr* pWidgetMgr =
- static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr());
+ static_cast<CFWL_WidgetMgr*>(IFWL_WidgetMgr::GetInstance());
IFWL_Widget* defButton = pWidgetMgr->GetDefaultButton(pMessageForm);
if (defButton) {
pMsg->m_pDstTarget = defButton;
@@ -543,7 +547,8 @@ FX_BOOL CFWL_NoteDriver::DoMouse(CFWL_MsgMouse* pMsg,
}
FX_BOOL CFWL_NoteDriver::DoWheel(CFWL_MsgMouseWheel* pMsg,
IFWL_Widget* pMessageForm) {
- CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr());
+ CFWL_WidgetMgr* pWidgetMgr =
+ static_cast<CFWL_WidgetMgr*>(IFWL_WidgetMgr::GetInstance());
if (!pWidgetMgr)
return FALSE;
@@ -557,7 +562,8 @@ FX_BOOL CFWL_NoteDriver::DoWheel(CFWL_MsgMouseWheel* pMsg,
return TRUE;
}
FX_BOOL CFWL_NoteDriver::DoSize(CFWL_MsgSize* pMsg) {
- CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr());
+ CFWL_WidgetMgr* pWidgetMgr =
+ static_cast<CFWL_WidgetMgr*>(IFWL_WidgetMgr::GetInstance());
if (!pWidgetMgr)
return FALSE;
pWidgetMgr->NotifySizeChanged(pMsg->m_pDstTarget, (FX_FLOAT)pMsg->m_iWidth,
@@ -574,7 +580,8 @@ FX_BOOL CFWL_NoteDriver::DoDragFiles(CFWL_MsgDropFiles* pMsg,
}
FX_BOOL CFWL_NoteDriver::DoMouseEx(CFWL_MsgMouse* pMsg,
IFWL_Widget* pMessageForm) {
- CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr());
+ CFWL_WidgetMgr* pWidgetMgr =
+ static_cast<CFWL_WidgetMgr*>(IFWL_WidgetMgr::GetInstance());
if (!pWidgetMgr)
return FALSE;
IFWL_Widget* pTarget = NULL;
@@ -656,7 +663,7 @@ IFWL_Widget* CFWL_NoteDriver::GetMessageForm(IFWL_Widget* pDstTarget) {
}
if (!pMessageForm && pDstTarget) {
CFWL_WidgetMgr* pWidgetMgr =
- static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr());
+ static_cast<CFWL_WidgetMgr*>(IFWL_WidgetMgr::GetInstance());
if (!pWidgetMgr)
return nullptr;
pMessageForm =

Powered by Google App Engine
This is Rietveld 408576698