From 242b95e2a9df3b57dd9aa28adea58ad51f84a221 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Wed, 16 Nov 2016 14:25:01 -0800 Subject: Move the message definitions to their own files. Currently the CFWL messages are created by a macro in the CFWL_Message header file. This Cl splits out the class to their own files and writes them directly instead of using the macro. Review-Url: https://codereview.chromium.org/2510823003 --- xfa/fwl/core/fwl_noteimp.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'xfa/fwl/core/fwl_noteimp.cpp') diff --git a/xfa/fwl/core/fwl_noteimp.cpp b/xfa/fwl/core/fwl_noteimp.cpp index 1e2b7bf479..857fdfbac6 100644 --- a/xfa/fwl/core/fwl_noteimp.cpp +++ b/xfa/fwl/core/fwl_noteimp.cpp @@ -9,7 +9,11 @@ #include "core/fxcrt/fx_ext.h" #include "third_party/base/ptr_util.h" #include "third_party/base/stl_util.h" -#include "xfa/fwl/core/cfwl_message.h" +#include "xfa/fwl/core/cfwl_msgkey.h" +#include "xfa/fwl/core/cfwl_msgkillfocus.h" +#include "xfa/fwl/core/cfwl_msgmouse.h" +#include "xfa/fwl/core/cfwl_msgmousewheel.h" +#include "xfa/fwl/core/cfwl_msgsetfocus.h" #include "xfa/fwl/core/cfwl_widgetmgr.h" #include "xfa/fwl/core/ifwl_app.h" #include "xfa/fwl/core/ifwl_tooltip.h" @@ -182,23 +186,21 @@ void CFWL_NoteDriver::UnRegisterForm(IFWL_Widget* pForm) { m_forms.RemoveAt(nIndex); } -void CFWL_NoteDriver::QueueMessage(CFWL_Message* pMessage) { - pMessage->Retain(); - m_noteQueue.Add(pMessage); +void CFWL_NoteDriver::QueueMessage(std::unique_ptr pMessage) { + m_noteQueue.push_back(std::move(pMessage)); } void CFWL_NoteDriver::UnqueueMessage(CFWL_NoteLoop* pNoteLoop) { - if (m_noteQueue.GetSize() < 1) + if (m_noteQueue.empty()) return; - CFWL_Message* pMessage = m_noteQueue[0]; - m_noteQueue.RemoveAt(0); - if (!IsValidMessage(pMessage)) { - pMessage->Release(); + std::unique_ptr pMessage = std::move(m_noteQueue[0]); + m_noteQueue.pop_front(); + + if (!IsValidMessage(pMessage.get())) return; - } - ProcessMessage(pMessage); - pMessage->Release(); + + ProcessMessage(pMessage.get()); } CFWL_NoteLoop* CFWL_NoteDriver::GetTopLoop() const { -- cgit v1.2.3