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

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

Issue 2510823003: Move the message definitions to their own files. (Closed)
Patch Set: Review feedback Created 4 years, 1 month 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/cfwl_widgetmgr.h ('k') | xfa/fwl/core/fwl_noteimp.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/cfwl_widgetmgr.h" 7 #include "xfa/fwl/core/cfwl_widgetmgr.h"
8 8
9 #include "xfa/fwl/core/cfwl_message.h"
10 #include "xfa/fwl/core/fwl_noteimp.h" 9 #include "xfa/fwl/core/fwl_noteimp.h"
11 #include "xfa/fwl/core/ifwl_app.h" 10 #include "xfa/fwl/core/ifwl_app.h"
12 #include "xfa/fwl/core/ifwl_form.h" 11 #include "xfa/fwl/core/ifwl_form.h"
13 #include "xfa/fxfa/app/xfa_fwladapter.h" 12 #include "xfa/fxfa/app/xfa_fwladapter.h"
14 #include "xfa/fxfa/xfa_ffapp.h" 13 #include "xfa/fxfa/xfa_ffapp.h"
15 14
16 namespace { 15 namespace {
17 16
18 const int kNeedRepaintHitPoints = 12; 17 const int kNeedRepaintHitPoints = 12;
19 const int kNeedRepaintHitPiece = 3; 18 const int kNeedRepaintHitPiece = 3;
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 IFWL_Widget* pDstWidget = pMessage->m_pDstTarget; 466 IFWL_Widget* pDstWidget = pMessage->m_pDstTarget;
468 const IFWL_App* pApp = pDstWidget->GetOwnerApp(); 467 const IFWL_App* pApp = pDstWidget->GetOwnerApp();
469 if (!pApp) 468 if (!pApp)
470 return; 469 return;
471 470
472 CFWL_NoteDriver* pNoteDriver = 471 CFWL_NoteDriver* pNoteDriver =
473 static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver()); 472 static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver());
474 if (!pNoteDriver) 473 if (!pNoteDriver)
475 return; 474 return;
476 475
477 if (IsThreadEnabled()) 476 std::unique_ptr<CFWL_Message> pClonedMessage = pMessage->Clone();
478 pMessage = static_cast<CFWL_Message*>(pMessage->Clone());
479 if (IsFormDisabled()) 477 if (IsFormDisabled())
480 pNoteDriver->ProcessMessage(pMessage); 478 pNoteDriver->ProcessMessage(pClonedMessage.get());
481 else 479 else
482 pNoteDriver->QueueMessage(pMessage); 480 pNoteDriver->QueueMessage(std::move(pClonedMessage));
483 481
484 #if (_FX_OS_ == _FX_MACOSX_) 482 #if (_FX_OS_ == _FX_MACOSX_)
485 CFWL_NoteLoop* pTopLoop = pNoteDriver->GetTopLoop(); 483 CFWL_NoteLoop* pTopLoop = pNoteDriver->GetTopLoop();
486 if (pTopLoop) 484 if (pTopLoop)
487 pNoteDriver->UnqueueMessage(pTopLoop); 485 pNoteDriver->UnqueueMessage(pTopLoop);
488 #endif 486 #endif
489
490 if (IsThreadEnabled())
491 pMessage->Release();
492
493 return;
494 } 487 }
495 488
496 void CFWL_WidgetMgr::OnDrawWidget(IFWL_Widget* pWidget, 489 void CFWL_WidgetMgr::OnDrawWidget(IFWL_Widget* pWidget,
497 CFX_Graphics* pGraphics, 490 CFX_Graphics* pGraphics,
498 const CFX_Matrix* pMatrix) { 491 const CFX_Matrix* pMatrix) {
499 if (!pWidget || !pGraphics) 492 if (!pWidget || !pGraphics)
500 return; 493 return;
501 494
502 CFX_Graphics* pTemp = DrawWidgetBefore(pWidget, pGraphics, pMatrix); 495 CFX_Graphics* pTemp = DrawWidgetBefore(pWidget, pGraphics, pMatrix);
503 CFX_RectF clipCopy; 496 CFX_RectF clipCopy;
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 pWidget(widget), 751 pWidget(widget),
759 iRedrawCounter(0) 752 iRedrawCounter(0)
760 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) 753 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_)
761 , 754 ,
762 bOutsideChanged(false) 755 bOutsideChanged(false)
763 #endif 756 #endif
764 { 757 {
765 } 758 }
766 759
767 CFWL_WidgetMgrItem::~CFWL_WidgetMgrItem() {} 760 CFWL_WidgetMgrItem::~CFWL_WidgetMgrItem() {}
OLDNEW
« no previous file with comments | « xfa/fwl/core/cfwl_widgetmgr.h ('k') | xfa/fwl/core/fwl_noteimp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698