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/cfwl_widgetmgr.h" | 7 #include "xfa/fwl/core/cfwl_widgetmgr.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_noteimp.h" | 10 #include "xfa/fwl/core/fwl_noteimp.h" |
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 pWidget->GetWidgetRect(clipCopy); | 606 pWidget->GetWidgetRect(clipCopy); |
607 clipCopy.left = clipCopy.top = 0; | 607 clipCopy.left = clipCopy.top = 0; |
608 if (bUseOffscreenDirect(pWidget)) { | 608 if (bUseOffscreenDirect(pWidget)) { |
609 DrawWidgetAfter(pWidget, pGraphics, clipCopy, pMatrix); | 609 DrawWidgetAfter(pWidget, pGraphics, clipCopy, pMatrix); |
610 return; | 610 return; |
611 } | 611 } |
612 CFX_RectF clipBounds; | 612 CFX_RectF clipBounds; |
613 | 613 |
614 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ || \ | 614 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ || \ |
615 _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_ANDROID_ | 615 _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_ANDROID_ |
616 IFWL_WidgetDelegate* pDelegate = pWidget->SetDelegate(nullptr); | 616 pWidget->GetCurrentDelegate()->OnDrawWidget(pTemp, pMatrix); |
617 pDelegate->OnDrawWidget(pTemp, pMatrix); | |
618 pGraphics->GetClipRect(clipBounds); | 617 pGraphics->GetClipRect(clipBounds); |
619 clipCopy = clipBounds; | 618 clipCopy = clipBounds; |
620 #elif _FX_OS_ == _FX_MACOSX_ | 619 #elif _FX_OS_ == _FX_MACOSX_ |
621 if (m_pWidgetMgr->IsFormDisabled()) { | 620 if (m_pWidgetMgr->IsFormDisabled()) { |
622 IFWL_WidgetDelegate* pDelegate = pWidget->SetDelegate(nullptr); | 621 pWidget->GetCurrentDelegate()->OnDrawWidget(pTemp, pMatrix); |
623 pDelegate->OnDrawWidget(pTemp, pMatrix); | |
624 pGraphics->GetClipRect(clipBounds); | 622 pGraphics->GetClipRect(clipBounds); |
625 clipCopy = clipBounds; | 623 clipCopy = clipBounds; |
626 } else { | 624 } else { |
627 clipBounds.Set(pMatrix->a, pMatrix->b, pMatrix->c, pMatrix->d); | 625 clipBounds.Set(pMatrix->a, pMatrix->b, pMatrix->c, pMatrix->d); |
628 const_cast<CFX_Matrix*>(pMatrix)->SetIdentity(); // FIXME: const cast. | 626 const_cast<CFX_Matrix*>(pMatrix)->SetIdentity(); // FIXME: const cast. |
629 IFWL_WidgetDelegate* pDelegate = pWidget->SetDelegate(nullptr); | 627 pWidget->GetCurrentDelegate()->OnDrawWidget(pTemp, pMatrix); |
630 pDelegate->OnDrawWidget(pTemp, pMatrix); | |
631 } | 628 } |
632 #endif // _FX_OS_ == _FX_MACOSX_ | 629 #endif // _FX_OS_ == _FX_MACOSX_ |
633 | 630 |
634 if (!m_pWidgetMgr->IsFormDisabled()) { | 631 if (!m_pWidgetMgr->IsFormDisabled()) { |
635 CFX_RectF rtClient; | 632 CFX_RectF rtClient; |
636 pWidget->GetClientRect(rtClient); | 633 pWidget->GetClientRect(rtClient); |
637 clipBounds.Intersect(rtClient); | 634 clipBounds.Intersect(rtClient); |
638 } | 635 } |
639 if (!clipBounds.IsEmpty()) | 636 if (!clipBounds.IsEmpty()) |
640 DrawChild(pWidget, clipBounds, pTemp, pMatrix); | 637 DrawChild(pWidget, clipBounds, pTemp, pMatrix); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 if (!bFormDisable) { | 670 if (!bFormDisable) { |
674 widgetMatrix.TransformPoint(clipBounds.left, clipBounds.top); | 671 widgetMatrix.TransformPoint(clipBounds.left, clipBounds.top); |
675 clipBounds.Intersect(rtClip); | 672 clipBounds.Intersect(rtClip); |
676 if (clipBounds.IsEmpty()) | 673 if (clipBounds.IsEmpty()) |
677 continue; | 674 continue; |
678 | 675 |
679 pGraphics->SaveGraphState(); | 676 pGraphics->SaveGraphState(); |
680 pGraphics->SetClipRect(clipBounds); | 677 pGraphics->SetClipRect(clipBounds); |
681 } | 678 } |
682 widgetMatrix.Translate(rtWidget.left, rtWidget.top, TRUE); | 679 widgetMatrix.Translate(rtWidget.left, rtWidget.top, TRUE); |
683 IFWL_WidgetDelegate* pDelegate = child->SetDelegate(nullptr); | 680 |
684 if (pDelegate) { | 681 if (IFWL_WidgetDelegate* pDelegate = child->GetCurrentDelegate()) { |
685 if (m_pWidgetMgr->IsFormDisabled() || | 682 if (m_pWidgetMgr->IsFormDisabled() || |
686 IsNeedRepaint(child, &widgetMatrix, rtClip)) { | 683 IsNeedRepaint(child, &widgetMatrix, rtClip)) { |
687 pDelegate->OnDrawWidget(pGraphics, &widgetMatrix); | 684 pDelegate->OnDrawWidget(pGraphics, &widgetMatrix); |
688 } | 685 } |
689 } | 686 } |
690 if (!bFormDisable) | 687 if (!bFormDisable) |
691 pGraphics->RestoreGraphState(); | 688 pGraphics->RestoreGraphState(); |
692 | 689 |
693 DrawChild(child, clipBounds, pGraphics, | 690 DrawChild(child, clipBounds, pGraphics, |
694 bFormDisable ? &widgetMatrix : pMatrix); | 691 bFormDisable ? &widgetMatrix : pMatrix); |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 pWidget(widget), | 861 pWidget(widget), |
865 iRedrawCounter(0) | 862 iRedrawCounter(0) |
866 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) | 863 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) |
867 , | 864 , |
868 bOutsideChanged(FALSE) | 865 bOutsideChanged(FALSE) |
869 #endif | 866 #endif |
870 { | 867 { |
871 } | 868 } |
872 | 869 |
873 CFWL_WidgetMgrItem::~CFWL_WidgetMgrItem() {} | 870 CFWL_WidgetMgrItem::~CFWL_WidgetMgrItem() {} |
OLD | NEW |