Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1215)

Unified Diff: xfa/fwl/lightwidget/cfwl_widget.cpp

Issue 1921853006: More FWL interface cleanup. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fwl/lightwidget/cfwl_tooltip.cpp ('k') | xfa/fwl/theme/cfwl_widgettp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/lightwidget/cfwl_widget.cpp
diff --git a/xfa/fwl/lightwidget/cfwl_widget.cpp b/xfa/fwl/lightwidget/cfwl_widget.cpp
index 5fbe9357675c91c2d28f60460fb89d4515876d9f..98a5a22f4398c91ba1937a17d8547ea052d783ea 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);
« no previous file with comments | « xfa/fwl/lightwidget/cfwl_tooltip.cpp ('k') | xfa/fwl/theme/cfwl_widgettp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698