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/fwl_widgetimp.h" | 7 #include "xfa/fwl/core/fwl_widgetimp.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 return FWL_ERR_Succeeded; | 466 return FWL_ERR_Succeeded; |
467 } | 467 } |
468 FWL_ERR CFWL_WidgetImp::TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt) { | 468 FWL_ERR CFWL_WidgetImp::TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt) { |
469 return TransformTo(pWidget, rt.left, rt.top); | 469 return TransformTo(pWidget, rt.left, rt.top); |
470 } | 470 } |
471 FWL_ERR CFWL_WidgetImp::GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal) { | 471 FWL_ERR CFWL_WidgetImp::GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal) { |
472 if (!m_pProperties) | 472 if (!m_pProperties) |
473 return FWL_ERR_Indefinite; | 473 return FWL_ERR_Indefinite; |
474 if (bGlobal) { | 474 if (bGlobal) { |
475 IFWL_Widget* parent = GetParent(); | 475 IFWL_Widget* parent = GetParent(); |
476 CFX_PtrArray parents; | 476 CFX_ArrayTemplate<IFWL_Widget*> parents; |
477 while (parent) { | 477 while (parent) { |
478 parents.Add(parent); | 478 parents.Add(parent); |
479 parent = parent->GetParent(); | 479 parent = parent->GetParent(); |
480 } | 480 } |
481 matrix.SetIdentity(); | 481 matrix.SetIdentity(); |
482 CFX_Matrix ctmOnParent; | 482 CFX_Matrix ctmOnParent; |
483 CFX_RectF rect; | 483 CFX_RectF rect; |
484 int32_t count = parents.GetSize(); | 484 int32_t count = parents.GetSize(); |
485 for (int32_t i = count - 2; i >= 0; i--) { | 485 for (int32_t i = count - 2; i >= 0; i--) { |
486 parent = static_cast<IFWL_Widget*>(parents.GetAt(i)); | 486 parent = parents.GetAt(i); |
487 parent->GetMatrix(ctmOnParent, FALSE); | 487 parent->GetMatrix(ctmOnParent, FALSE); |
488 parent->GetWidgetRect(rect); | 488 parent->GetWidgetRect(rect); |
489 matrix.Concat(ctmOnParent, TRUE); | 489 matrix.Concat(ctmOnParent, TRUE); |
490 matrix.Translate(rect.left, rect.top, TRUE); | 490 matrix.Translate(rect.left, rect.top, TRUE); |
491 } | 491 } |
492 matrix.Concat(m_pProperties->m_ctmOnParent, TRUE); | 492 matrix.Concat(m_pProperties->m_ctmOnParent, TRUE); |
493 parents.RemoveAll(); | 493 parents.RemoveAll(); |
494 } else { | 494 } else { |
495 matrix = m_pProperties->m_ctmOnParent; | 495 matrix = m_pProperties->m_ctmOnParent; |
496 } | 496 } |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1073 FWL_ERR CFWL_WidgetImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { | 1073 FWL_ERR CFWL_WidgetImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { |
1074 return FWL_ERR_Succeeded; | 1074 return FWL_ERR_Succeeded; |
1075 } | 1075 } |
1076 | 1076 |
1077 FWL_ERR CFWL_WidgetImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, | 1077 FWL_ERR CFWL_WidgetImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
1078 const CFX_Matrix* pMatrix) { | 1078 const CFX_Matrix* pMatrix) { |
1079 CFWL_EvtDraw evt; | 1079 CFWL_EvtDraw evt; |
1080 evt.m_pGraphics = pGraphics; | 1080 evt.m_pGraphics = pGraphics; |
1081 return FWL_ERR_Succeeded; | 1081 return FWL_ERR_Succeeded; |
1082 } | 1082 } |
OLD | NEW |