summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/fwl_noteimp.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-28 10:51:13 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-28 10:51:13 -0700
commit7322343b9322b93d97077575f95a00dcca3f0451 (patch)
tree36337e0a2aff2147a9067477f982496129f0f7a1 /xfa/fwl/core/fwl_noteimp.cpp
parente6ebf7af7ea94d48091be300cec84b499d3b8ae0 (diff)
downloadpdfium-7322343b9322b93d97077575f95a00dcca3f0451.tar.xz
More FWL interface cleanup.
This CL merges the IFWL_Target class into IFWL_Widget and IFWL_Thread into IFWL_App. The IFWL_WidgetMgrDelegate, IFWL_NoteDriver and IFWL_NotThread are removed in favour of their concrete classes. Review-Url: https://codereview.chromium.org/1921853006
Diffstat (limited to 'xfa/fwl/core/fwl_noteimp.cpp')
-rw-r--r--xfa/fwl/core/fwl_noteimp.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/xfa/fwl/core/fwl_noteimp.cpp b/xfa/fwl/core/fwl_noteimp.cpp
index cc548a5728..267b2ca2ee 100644
--- a/xfa/fwl/core/fwl_noteimp.cpp
+++ b/xfa/fwl/core/fwl_noteimp.cpp
@@ -12,8 +12,6 @@
#include "xfa/fwl/core/cfwl_message.h"
#include "xfa/fwl/core/fwl_appimp.h"
#include "xfa/fwl/core/fwl_formimp.h"
-#include "xfa/fwl/core/fwl_targetimp.h"
-#include "xfa/fwl/core/fwl_threadimp.h"
#include "xfa/fwl/core/fwl_widgetimp.h"
#include "xfa/fwl/core/fwl_widgetmgrimp.h"
#include "xfa/fwl/core/ifwl_adapterwidgetmgr.h"
@@ -31,7 +29,7 @@ FWL_ERR CFWL_NoteLoop::Idle(int32_t count) {
IFWL_App* pApp = FWL_GetApp();
if (!pApp)
return FWL_ERR_Indefinite;
- IFWL_NoteDriver* pDriver = pApp->GetNoteDriver();
+ CFWL_NoteDriver* pDriver = pApp->GetNoteDriver();
if (!pDriver)
return FWL_ERR_Indefinite;
pDriver->SendEvent(&ev);
@@ -63,12 +61,14 @@ FWL_ERR CFWL_NoteLoop::SetMainForm(CFWL_WidgetImp* pForm) {
void CFWL_NoteLoop::GenerateCommondEvent(uint32_t dwCommand) {
CFWL_EvtMenuCommand ev;
ev.m_iCommand = dwCommand;
- IFWL_Thread* pThread = m_pForm->GetOwnerThread();
- if (!pThread)
+ IFWL_App* pApp = m_pForm->GetOwnerApp();
+ if (!pApp)
return;
- IFWL_NoteDriver* pDriver = pThread->GetNoteDriver();
+
+ CFWL_NoteDriver* pDriver = pApp->GetNoteDriver();
if (!pDriver)
return;
+
pDriver->SendEvent(&ev);
}
CFWL_NoteDriver::CFWL_NoteDriver()
@@ -153,18 +153,19 @@ FWL_ERR CFWL_NoteDriver::UnregisterEventTarget(IFWL_Widget* pListener) {
void CFWL_NoteDriver::ClearEventTargets(FX_BOOL bRemoveAll) {
ClearInvalidEventTargets(bRemoveAll);
}
-IFWL_Thread* CFWL_NoteDriver::GetOwnerThread() const {
+IFWL_App* CFWL_NoteDriver::GetOwnerApp() const {
return FWL_GetApp();
}
-FWL_ERR CFWL_NoteDriver::PushNoteLoop(IFWL_NoteLoop* pNoteLoop) {
+FWL_ERR CFWL_NoteDriver::PushNoteLoop(CFWL_NoteLoop* pNoteLoop) {
m_noteLoopQueue.Add(pNoteLoop);
return FWL_ERR_Succeeded;
}
-IFWL_NoteLoop* CFWL_NoteDriver::PopNoteLoop() {
+CFWL_NoteLoop* CFWL_NoteDriver::PopNoteLoop() {
int32_t pos = m_noteLoopQueue.GetSize();
if (pos <= 0)
- return NULL;
- IFWL_NoteLoop* p = m_noteLoopQueue.GetAt(pos - 1);
+ return nullptr;
+
+ CFWL_NoteLoop* p = m_noteLoopQueue.GetAt(pos - 1);
m_noteLoopQueue.RemoveAt(pos - 1);
return p;
}