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

Side by Side Diff: xfa/fwl/core/fwl_widgetmgrimp.cpp

Issue 1921853006: More FWL interface cleanup. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « xfa/fwl/core/fwl_widgetmgrimp.h ('k') | xfa/fwl/core/ifwl_adapternative.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fwl/core/fwl_widgetmgrimp.h" 7 #include "xfa/fwl/core/fwl_widgetmgrimp.h"
8 8
9 #include "xfa/fwl/core/cfwl_message.h" 9 #include "xfa/fwl/core/cfwl_message.h"
10 #include "xfa/fwl/core/fwl_appimp.h" 10 #include "xfa/fwl/core/fwl_appimp.h"
11 #include "xfa/fwl/core/fwl_noteimp.h" 11 #include "xfa/fwl/core/fwl_noteimp.h"
12 #include "xfa/fwl/core/fwl_targetimp.h"
13 #include "xfa/fwl/core/fwl_threadimp.h"
14 #include "xfa/fwl/core/fwl_widgetimp.h" 12 #include "xfa/fwl/core/fwl_widgetimp.h"
15 #include "xfa/fwl/core/ifwl_adapternative.h" 13 #include "xfa/fwl/core/ifwl_adapternative.h"
16 #include "xfa/fwl/core/ifwl_adapterwidgetmgr.h" 14 #include "xfa/fwl/core/ifwl_adapterwidgetmgr.h"
17 #include "xfa/fwl/core/ifwl_app.h" 15 #include "xfa/fwl/core/ifwl_app.h"
18 #include "xfa/fwl/core/ifwl_form.h" 16 #include "xfa/fwl/core/ifwl_form.h"
19 17
20 FX_BOOL FWL_UseOffscreen(IFWL_Widget* pWidget) { 18 FX_BOOL FWL_UseOffscreen(IFWL_Widget* pWidget) {
21 #if (_FX_OS_ == _FX_MACOSX_) 19 #if (_FX_OS_ == _FX_MACOSX_)
22 return FALSE; 20 return FALSE;
23 #else 21 #else
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 : m_pWidgetMgr(pWidgetMgr) {} 686 : m_pWidgetMgr(pWidgetMgr) {}
689 FWL_ERR CFWL_WidgetMgrDelegate::OnSetCapability(uint32_t dwCapability) { 687 FWL_ERR CFWL_WidgetMgrDelegate::OnSetCapability(uint32_t dwCapability) {
690 m_pWidgetMgr->m_dwCapability = dwCapability; 688 m_pWidgetMgr->m_dwCapability = dwCapability;
691 return FWL_ERR_Succeeded; 689 return FWL_ERR_Succeeded;
692 } 690 }
693 int32_t CFWL_WidgetMgrDelegate::OnProcessMessageToForm(CFWL_Message* pMessage) { 691 int32_t CFWL_WidgetMgrDelegate::OnProcessMessageToForm(CFWL_Message* pMessage) {
694 if (!pMessage) 692 if (!pMessage)
695 return 0; 693 return 0;
696 if (!pMessage->m_pDstTarget) 694 if (!pMessage->m_pDstTarget)
697 return 0; 695 return 0;
696
698 IFWL_Widget* pDstWidget = pMessage->m_pDstTarget; 697 IFWL_Widget* pDstWidget = pMessage->m_pDstTarget;
699 IFWL_Thread* pThread = pDstWidget->GetOwnerThread(); 698 IFWL_App* pApp = pDstWidget->GetOwnerApp();
700 if (!pThread) 699 if (!pApp)
701 return 0; 700 return 0;
701
702 CFWL_NoteDriver* pNoteDriver = 702 CFWL_NoteDriver* pNoteDriver =
703 static_cast<CFWL_NoteDriver*>(pThread->GetNoteDriver()); 703 static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver());
704 if (!pNoteDriver) 704 if (!pNoteDriver)
705 return 0; 705 return 0;
706 if (m_pWidgetMgr->IsThreadEnabled()) { 706
707 if (m_pWidgetMgr->IsThreadEnabled())
707 pMessage = static_cast<CFWL_Message*>(pMessage->Clone()); 708 pMessage = static_cast<CFWL_Message*>(pMessage->Clone());
708 } 709 if (m_pWidgetMgr->IsFormDisabled())
709 if (m_pWidgetMgr->IsFormDisabled()) {
710 pNoteDriver->ProcessMessage(pMessage); 710 pNoteDriver->ProcessMessage(pMessage);
711 } else { 711 else
712 pNoteDriver->QueueMessage(pMessage); 712 pNoteDriver->QueueMessage(pMessage);
713 } 713
714 #if (_FX_OS_ == _FX_MACOSX_) 714 #if (_FX_OS_ == _FX_MACOSX_)
715 CFWL_NoteLoop* pTopLoop = pNoteDriver->GetTopLoop(); 715 CFWL_NoteLoop* pTopLoop = pNoteDriver->GetTopLoop();
716 if (pTopLoop) { 716 if (pTopLoop) {
717 pNoteDriver->UnqueueMessage(pTopLoop); 717 pNoteDriver->UnqueueMessage(pTopLoop);
718 } 718 }
719 #endif 719 #endif
720 if (m_pWidgetMgr->IsThreadEnabled()) { 720 if (m_pWidgetMgr->IsThreadEnabled()) {
721 pMessage->Release(); 721 pMessage->Release();
722 } 722 }
723 return FWL_ERR_Succeeded; 723 return FWL_ERR_Succeeded;
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 CFX_RectF temp(m_pWidgetMgr->m_rtScreen); 1000 CFX_RectF temp(m_pWidgetMgr->m_rtScreen);
1001 temp.Deflate(50, 50); 1001 temp.Deflate(50, 50);
1002 if (!temp.Contains(r)) { 1002 if (!temp.Contains(r)) {
1003 return FALSE; 1003 return FALSE;
1004 } 1004 }
1005 pItem->bOutsideChanged = FALSE; 1005 pItem->bOutsideChanged = FALSE;
1006 } 1006 }
1007 #endif 1007 #endif
1008 return pItem->iRedrawCounter == 0; 1008 return pItem->iRedrawCounter == 0;
1009 } 1009 }
OLDNEW
« no previous file with comments | « xfa/fwl/core/fwl_widgetmgrimp.h ('k') | xfa/fwl/core/ifwl_adapternative.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698