OLD | NEW |
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/ifwl_widget.h" | 7 #include "xfa/fwl/core/ifwl_widget.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 if (!pNoteDriver) | 544 if (!pNoteDriver) |
545 return; | 545 return; |
546 | 546 |
547 pNoteDriver->UnregisterEventTarget(this); | 547 pNoteDriver->UnregisterEventTarget(this); |
548 } | 548 } |
549 | 549 |
550 void IFWL_Widget::DispatchKeyEvent(CFWL_MsgKey* pNote) { | 550 void IFWL_Widget::DispatchKeyEvent(CFWL_MsgKey* pNote) { |
551 if (!pNote) | 551 if (!pNote) |
552 return; | 552 return; |
553 | 553 |
554 CFWL_EvtKey* pEvent = new CFWL_EvtKey; | 554 auto pEvent = pdfium::MakeUnique<CFWL_EvtKey>(); |
555 pEvent->m_pSrcTarget = this; | 555 pEvent->m_pSrcTarget = this; |
556 pEvent->m_dwCmd = pNote->m_dwCmd; | 556 pEvent->m_dwCmd = pNote->m_dwCmd; |
557 pEvent->m_dwKeyCode = pNote->m_dwKeyCode; | 557 pEvent->m_dwKeyCode = pNote->m_dwKeyCode; |
558 pEvent->m_dwFlags = pNote->m_dwFlags; | 558 pEvent->m_dwFlags = pNote->m_dwFlags; |
559 DispatchEvent(pEvent); | 559 DispatchEvent(pEvent.get()); |
560 pEvent->Release(); | |
561 } | 560 } |
562 | 561 |
563 void IFWL_Widget::DispatchEvent(CFWL_Event* pEvent) { | 562 void IFWL_Widget::DispatchEvent(CFWL_Event* pEvent) { |
564 if (m_pOuter) { | 563 if (m_pOuter) { |
565 m_pOuter->GetDelegate()->OnProcessEvent(pEvent); | 564 m_pOuter->GetDelegate()->OnProcessEvent(pEvent); |
566 return; | 565 return; |
567 } | 566 } |
568 const IFWL_App* pApp = GetOwnerApp(); | 567 const IFWL_App* pApp = GetOwnerApp(); |
569 if (!pApp) | 568 if (!pApp) |
570 return; | 569 return; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 } | 742 } |
744 default: | 743 default: |
745 break; | 744 break; |
746 } | 745 } |
747 } | 746 } |
748 | 747 |
749 void IFWL_Widget::OnProcessEvent(CFWL_Event* pEvent) {} | 748 void IFWL_Widget::OnProcessEvent(CFWL_Event* pEvent) {} |
750 | 749 |
751 void IFWL_Widget::OnDrawWidget(CFX_Graphics* pGraphics, | 750 void IFWL_Widget::OnDrawWidget(CFX_Graphics* pGraphics, |
752 const CFX_Matrix* pMatrix) {} | 751 const CFX_Matrix* pMatrix) {} |
OLD | NEW |