| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "fpdfsdk/include/fsdk_mgr.h" | 9 #include "fpdfsdk/include/fsdk_mgr.h" |
| 10 | 10 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 void CFX_SystemHandler::SetCursor(int32_t nCursorType) { | 88 void CFX_SystemHandler::SetCursor(int32_t nCursorType) { |
| 89 m_pEnv->FFI_SetCursor(nCursorType); | 89 m_pEnv->FFI_SetCursor(nCursorType); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void CFX_SystemHandler::InvalidateRect(FX_HWND hWnd, FX_RECT rect) { | 92 void CFX_SystemHandler::InvalidateRect(FX_HWND hWnd, FX_RECT rect) { |
| 93 CPDFSDK_Annot* pSDKAnnot = (CPDFSDK_Annot*)hWnd; | 93 CPDFSDK_Annot* pSDKAnnot = (CPDFSDK_Annot*)hWnd; |
| 94 CPDFSDK_PageView* pPageView = pSDKAnnot->GetPageView(); | 94 CPDFSDK_PageView* pPageView = pSDKAnnot->GetPageView(); |
| 95 UnderlyingPageType* pPage = pSDKAnnot->GetUnderlyingPage(); | 95 UnderlyingPageType* pPage = pSDKAnnot->GetUnderlyingPage(); |
| 96 if (!pPage || !pPageView) | 96 if (!pPage || !pPageView) |
| 97 return; | 97 return; |
| 98 CPDF_Matrix page2device; | 98 CFX_Matrix page2device; |
| 99 pPageView->GetCurrentMatrix(page2device); | 99 pPageView->GetCurrentMatrix(page2device); |
| 100 CPDF_Matrix device2page; | 100 CFX_Matrix device2page; |
| 101 device2page.SetReverse(page2device); | 101 device2page.SetReverse(page2device); |
| 102 FX_FLOAT left, top, right, bottom; | 102 FX_FLOAT left, top, right, bottom; |
| 103 device2page.Transform((FX_FLOAT)rect.left, (FX_FLOAT)rect.top, left, top); | 103 device2page.Transform((FX_FLOAT)rect.left, (FX_FLOAT)rect.top, left, top); |
| 104 device2page.Transform((FX_FLOAT)rect.right, (FX_FLOAT)rect.bottom, right, | 104 device2page.Transform((FX_FLOAT)rect.right, (FX_FLOAT)rect.bottom, right, |
| 105 bottom); | 105 bottom); |
| 106 CPDF_Rect rcPDF(left, bottom, right, top); | 106 CPDF_Rect rcPDF(left, bottom, right, top); |
| 107 rcPDF.Normalize(); | 107 rcPDF.Normalize(); |
| 108 | 108 |
| 109 m_pEnv->FFI_Invalidate(pPage, rcPDF.left, rcPDF.top, rcPDF.right, | 109 m_pEnv->FFI_Invalidate(pPage, rcPDF.left, rcPDF.top, rcPDF.right, |
| 110 rcPDF.bottom); | 110 rcPDF.bottom); |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 | 615 |
| 616 m_pAnnotList.reset(); | 616 m_pAnnotList.reset(); |
| 617 | 617 |
| 618 m_page->RemovePrivateData((void*)m_page); | 618 m_page->RemovePrivateData((void*)m_page); |
| 619 if (m_bTakeOverPage) { | 619 if (m_bTakeOverPage) { |
| 620 delete m_page; | 620 delete m_page; |
| 621 } | 621 } |
| 622 } | 622 } |
| 623 | 623 |
| 624 void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice, | 624 void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice, |
| 625 CPDF_Matrix* pUser2Device, | 625 CFX_Matrix* pUser2Device, |
| 626 CPDF_RenderOptions* pOptions) { | 626 CPDF_RenderOptions* pOptions) { |
| 627 m_curMatrix = *pUser2Device; | 627 m_curMatrix = *pUser2Device; |
| 628 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); | 628 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); |
| 629 CPDFSDK_AnnotIterator annotIterator(this, true); | 629 CPDFSDK_AnnotIterator annotIterator(this, true); |
| 630 while (CPDFSDK_Annot* pSDKAnnot = annotIterator.Next()) { | 630 while (CPDFSDK_Annot* pSDKAnnot = annotIterator.Next()) { |
| 631 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr(); | 631 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr(); |
| 632 pAnnotHandlerMgr->Annot_OnDraw(this, pSDKAnnot, pDevice, pUser2Device, 0); | 632 pAnnotHandlerMgr->Annot_OnDraw(this, pSDKAnnot, pDevice, pUser2Device, 0); |
| 633 } | 633 } |
| 634 } | 634 } |
| 635 | 635 |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); | 920 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); |
| 921 if (!pFocusAnnot) | 921 if (!pFocusAnnot) |
| 922 return nullptr; | 922 return nullptr; |
| 923 | 923 |
| 924 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { | 924 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { |
| 925 if (pAnnot == pFocusAnnot) | 925 if (pAnnot == pFocusAnnot) |
| 926 return pAnnot; | 926 return pAnnot; |
| 927 } | 927 } |
| 928 return nullptr; | 928 return nullptr; |
| 929 } | 929 } |
| OLD | NEW |