summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/fwl_widgetimp.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-21 13:12:06 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-21 13:12:06 -0700
commit5d9da0c1255a75dd9b7b2005f8b7d6ae4948feaf (patch)
treedf40bedc2582cab695e7bf4b2056bfddd4969908 /xfa/fwl/core/fwl_widgetimp.cpp
parent0f6425fff33e4096b4e1fbfb954edae1349c0145 (diff)
downloadpdfium-5d9da0c1255a75dd9b7b2005f8b7d6ae4948feaf.tar.xz
Remove CFWL_Note.
This CL removes the CFWL_Note class. The two subclasses, CFWL_Event and CFWL_Message are distinct types and should not be related by the subclass. The code has been updated to pass the correct types as needed. The various FWL_EVTHASH and FWL_MSGHASH defines have all been removed and turned into an FWL_EventType and FWL_MessageType enum classes. BUG=pdfium:474 Review URL: https://codereview.chromium.org/1901183002
Diffstat (limited to 'xfa/fwl/core/fwl_widgetimp.cpp')
-rw-r--r--xfa/fwl/core/fwl_widgetimp.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/xfa/fwl/core/fwl_widgetimp.cpp b/xfa/fwl/core/fwl_widgetimp.cpp
index b11530eab5..f6be8cac5e 100644
--- a/xfa/fwl/core/fwl_widgetimp.cpp
+++ b/xfa/fwl/core/fwl_widgetimp.cpp
@@ -853,7 +853,7 @@ void CFWL_WidgetImp::DispatchEvent(CFWL_Event* pEvent) {
IFWL_NoteDriver* pNoteDriver = pThread->GetNoteDriver();
if (!pNoteDriver)
return;
- pNoteDriver->SendNote(pEvent);
+ pNoteDriver->SendEvent(pEvent);
}
void CFWL_WidgetImp::Repaint(const CFX_RectF* pRect) {
if (pRect) {
@@ -952,15 +952,18 @@ FX_BOOL CFWL_WidgetImp::IsParent(IFWL_Widget* pParent) {
}
return FALSE;
}
+
CFWL_WidgetImpDelegate::CFWL_WidgetImpDelegate() {}
+
int32_t CFWL_WidgetImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
if (!pMessage->m_pDstTarget)
return 0;
+
CFWL_WidgetImp* pWidget =
static_cast<CFWL_WidgetImp*>(pMessage->m_pDstTarget->GetImpl());
- uint32_t dwMsgCode = pMessage->GetClassID();
+ CFWL_MessageType dwMsgCode = pMessage->GetClassID();
switch (dwMsgCode) {
- case FWL_MSGHASH_Mouse: {
+ case CFWL_MessageType::Mouse: {
CFWL_MsgMouse* pMsgMouse = static_cast<CFWL_MsgMouse*>(pMessage);
CFWL_EvtMouse evt;
evt.m_pSrcTarget = pWidget->m_pInterface;
@@ -972,7 +975,7 @@ int32_t CFWL_WidgetImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
pWidget->DispatchEvent(&evt);
break;
}
- case FWL_MSGHASH_MouseWheel: {
+ case CFWL_MessageType::MouseWheel: {
CFWL_MsgMouseWheel* pMsgMouseWheel =
static_cast<CFWL_MsgMouseWheel*>(pMessage);
CFWL_EvtMouseWheel evt;
@@ -986,7 +989,7 @@ int32_t CFWL_WidgetImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
pWidget->DispatchEvent(&evt);
break;
}
- case FWL_MSGHASH_Key: {
+ case CFWL_MessageType::Key: {
CFWL_MsgKey* pMsgKey = static_cast<CFWL_MsgKey*>(pMessage);
CFWL_EvtKey evt;
evt.m_pSrcTarget = pWidget->m_pInterface;
@@ -997,7 +1000,7 @@ int32_t CFWL_WidgetImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
pWidget->DispatchEvent(&evt);
break;
}
- case FWL_MSGHASH_SetFocus: {
+ case CFWL_MessageType::SetFocus: {
CFWL_MsgSetFocus* pMsgSetFocus = static_cast<CFWL_MsgSetFocus*>(pMessage);
CFWL_EvtSetFocus evt;
evt.m_pSrcTarget = pMsgSetFocus->m_pDstTarget;
@@ -1006,7 +1009,7 @@ int32_t CFWL_WidgetImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
pWidget->DispatchEvent(&evt);
break;
}
- case FWL_MSGHASH_KillFocus: {
+ case CFWL_MessageType::KillFocus: {
CFWL_MsgKillFocus* pMsgKillFocus =
static_cast<CFWL_MsgKillFocus*>(pMessage);
CFWL_EvtKillFocus evt;
@@ -1016,13 +1019,16 @@ int32_t CFWL_WidgetImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
pWidget->DispatchEvent(&evt);
break;
}
- default: {}
+ default:
+ break;
}
return 1;
}
+
FWL_ERR CFWL_WidgetImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {
return FWL_ERR_Succeeded;
}
+
FWL_ERR CFWL_WidgetImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix) {
CFWL_EvtDraw evt;