summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/fwl_noteimp.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-16 14:25:01 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-16 14:25:01 -0800
commit242b95e2a9df3b57dd9aa28adea58ad51f84a221 (patch)
tree001948a117ff48e77af6351c505a9e41951d7a4e /xfa/fwl/core/fwl_noteimp.cpp
parent058d2d6b7851b77a371bb4d37d5da1148794397a (diff)
downloadpdfium-242b95e2a9df3b57dd9aa28adea58ad51f84a221.tar.xz
Move the message definitions to their own files.chromium/2923
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
Diffstat (limited to 'xfa/fwl/core/fwl_noteimp.cpp')
-rw-r--r--xfa/fwl/core/fwl_noteimp.cpp26
1 files changed, 14 insertions, 12 deletions
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<CFWL_Message> 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<CFWL_Message> 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 {