summaryrefslogtreecommitdiff
path: root/xfa/fwl/lightwidget/cfwl_widget.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/lightwidget/cfwl_widget.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/lightwidget/cfwl_widget.cpp')
-rw-r--r--xfa/fwl/lightwidget/cfwl_widget.cpp38
1 files changed, 23 insertions, 15 deletions
diff --git a/xfa/fwl/lightwidget/cfwl_widget.cpp b/xfa/fwl/lightwidget/cfwl_widget.cpp
index 5fbe935767..98a5a22f43 100644
--- a/xfa/fwl/lightwidget/cfwl_widget.cpp
+++ b/xfa/fwl/lightwidget/cfwl_widget.cpp
@@ -10,11 +10,10 @@
#include "xfa/fwl/core/cfwl_themetext.h"
#include "xfa/fwl/core/fwl_noteimp.h"
#include "xfa/fwl/core/fwl_noteimp.h"
-#include "xfa/fwl/core/fwl_targetimp.h"
#include "xfa/fwl/core/fwl_widgetimp.h"
#include "xfa/fwl/core/fwl_widgetmgrimp.h"
+#include "xfa/fwl/core/ifwl_app.h"
#include "xfa/fwl/core/ifwl_themeprovider.h"
-#include "xfa/fwl/core/ifwl_thread.h"
IFWL_Widget* CFWL_Widget::GetWidget() {
return m_pIface;
@@ -215,7 +214,7 @@ CFWL_Widget::CFWL_Widget()
: m_pIface(NULL), m_pDelegate(NULL), m_pProperties(NULL) {
m_pProperties = new CFWL_WidgetProperties;
m_pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr());
- ASSERT(m_pWidgetMgr != NULL);
+ ASSERT(m_pWidgetMgr);
}
CFWL_Widget::~CFWL_Widget() {
@@ -242,12 +241,15 @@ FWL_ERR CFWL_Widget::Repaint(const CFX_RectF* pRect) {
FWL_ERR CFWL_Widget::SetFocus(FX_BOOL bFocus) {
if (!m_pIface)
return FWL_ERR_Indefinite;
- IFWL_Thread* pThread = m_pIface->GetOwnerThread();
- if (!pThread)
+
+ IFWL_App* pApp = m_pIface->GetOwnerApp();
+ if (!pApp)
return FWL_ERR_Indefinite;
- IFWL_NoteDriver* pDriver = pThread->GetNoteDriver();
+
+ CFWL_NoteDriver* pDriver = pApp->GetNoteDriver();
if (!pDriver)
return FWL_ERR_Indefinite;
+
if (bFocus) {
pDriver->SetFocus(m_pIface);
} else {
@@ -261,12 +263,15 @@ FWL_ERR CFWL_Widget::SetFocus(FX_BOOL bFocus) {
FWL_ERR CFWL_Widget::SetGrab(FX_BOOL bSet) {
if (!m_pIface)
return FWL_ERR_Indefinite;
- IFWL_Thread* pThread = m_pIface->GetOwnerThread();
- if (!pThread)
+
+ IFWL_App* pApp = m_pIface->GetOwnerApp();
+ if (!pApp)
return FWL_ERR_Indefinite;
- IFWL_NoteDriver* pDriver = pThread->GetNoteDriver();
+
+ CFWL_NoteDriver* pDriver = pApp->GetNoteDriver();
if (!pDriver)
return FWL_ERR_Indefinite;
+
pDriver->SetGrab(m_pIface, bSet);
return FWL_ERR_Succeeded;
}
@@ -275,12 +280,15 @@ void CFWL_Widget::RegisterEventTarget(CFWL_Widget* pEventSource,
uint32_t dwFilter) {
if (!m_pIface)
return;
- IFWL_Thread* pThread = m_pIface->GetOwnerThread();
- if (!pThread)
+
+ IFWL_App* pApp = m_pIface->GetOwnerApp();
+ if (!pApp)
return;
- IFWL_NoteDriver* pNoteDriver = pThread->GetNoteDriver();
+
+ CFWL_NoteDriver* pNoteDriver = pApp->GetNoteDriver();
if (!pNoteDriver)
return;
+
IFWL_Widget* pEventSourceImp =
!pEventSource ? NULL : pEventSource->GetWidget();
pNoteDriver->RegisterEventTarget(GetWidget(), pEventSourceImp, dwFilter);
@@ -292,10 +300,10 @@ void CFWL_Widget::DispatchEvent(CFWL_Event* pEvent) {
if (m_pIface->GetOuter()) {
return;
}
- IFWL_Thread* pThread = m_pIface->GetOwnerThread();
- if (!pThread)
+ IFWL_App* pApp = m_pIface->GetOwnerApp();
+ if (!pApp)
return;
- IFWL_NoteDriver* pNoteDriver = pThread->GetNoteDriver();
+ CFWL_NoteDriver* pNoteDriver = pApp->GetNoteDriver();
if (!pNoteDriver)
return;
pNoteDriver->SendEvent(pEvent);