| 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 "fpdfsdk/formfiller/cffl_formfiller.h" | 7 #include "fpdfsdk/formfiller/cffl_formfiller.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
| 10 #include "core/fxge/include/cfx_renderdevice.h" | 10 #include "core/fxge/include/cfx_renderdevice.h" |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 | 412 |
| 413 return mt; | 413 return mt; |
| 414 } | 414 } |
| 415 } | 415 } |
| 416 return CFX_Matrix(1, 0, 0, 1, 0, 0); | 416 return CFX_Matrix(1, 0, 0, 1, 0, 0); |
| 417 } | 417 } |
| 418 | 418 |
| 419 CFX_Matrix CFFL_FormFiller::GetCurMatrix() { | 419 CFX_Matrix CFFL_FormFiller::GetCurMatrix() { |
| 420 CFX_Matrix mt; | 420 CFX_Matrix mt; |
| 421 | 421 |
| 422 CFX_FloatRect rcDA; | 422 CFX_FloatRect rcDA = m_pWidget->GetPDFAnnot()->GetRect(); |
| 423 m_pWidget->GetPDFAnnot()->GetRect(rcDA); | |
| 424 | 423 |
| 425 switch (m_pWidget->GetRotate()) { | 424 switch (m_pWidget->GetRotate()) { |
| 426 default: | 425 default: |
| 427 case 0: | 426 case 0: |
| 428 mt = CFX_Matrix(1, 0, 0, 1, 0, 0); | 427 mt = CFX_Matrix(1, 0, 0, 1, 0, 0); |
| 429 break; | 428 break; |
| 430 case 90: | 429 case 90: |
| 431 mt = CFX_Matrix(0, 1, -1, 0, rcDA.right - rcDA.left, 0); | 430 mt = CFX_Matrix(0, 1, -1, 0, rcDA.right - rcDA.left, 0); |
| 432 break; | 431 break; |
| 433 case 180: | 432 case 180: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 444 return mt; | 443 return mt; |
| 445 } | 444 } |
| 446 | 445 |
| 447 CFX_WideString CFFL_FormFiller::LoadPopupMenuString(int nIndex) { | 446 CFX_WideString CFFL_FormFiller::LoadPopupMenuString(int nIndex) { |
| 448 ASSERT(m_pApp); | 447 ASSERT(m_pApp); |
| 449 | 448 |
| 450 return L""; | 449 return L""; |
| 451 } | 450 } |
| 452 | 451 |
| 453 CFX_FloatRect CFFL_FormFiller::GetPDFWindowRect() const { | 452 CFX_FloatRect CFFL_FormFiller::GetPDFWindowRect() const { |
| 454 CFX_FloatRect rectAnnot; | 453 CFX_FloatRect rectAnnot = m_pWidget->GetPDFAnnot()->GetRect(); |
| 455 m_pWidget->GetPDFAnnot()->GetRect(rectAnnot); | |
| 456 | 454 |
| 457 FX_FLOAT fWidth = rectAnnot.right - rectAnnot.left; | 455 FX_FLOAT fWidth = rectAnnot.right - rectAnnot.left; |
| 458 FX_FLOAT fHeight = rectAnnot.top - rectAnnot.bottom; | 456 FX_FLOAT fHeight = rectAnnot.top - rectAnnot.bottom; |
| 459 if ((m_pWidget->GetRotate() / 90) & 0x01) | 457 if ((m_pWidget->GetRotate() / 90) & 0x01) |
| 460 return CFX_FloatRect(0, 0, fHeight, fWidth); | 458 return CFX_FloatRect(0, 0, fHeight, fWidth); |
| 461 | 459 |
| 462 return CFX_FloatRect(0, 0, fWidth, fHeight); | 460 return CFX_FloatRect(0, 0, fWidth, fHeight); |
| 463 } | 461 } |
| 464 | 462 |
| 465 CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView(bool renew) { | 463 CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView(bool renew) { |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 } | 717 } |
| 720 } | 718 } |
| 721 | 719 |
| 722 void CFFL_Button::OnDrawDeactive(CPDFSDK_PageView* pPageView, | 720 void CFFL_Button::OnDrawDeactive(CPDFSDK_PageView* pPageView, |
| 723 CPDFSDK_Annot* pAnnot, | 721 CPDFSDK_Annot* pAnnot, |
| 724 CFX_RenderDevice* pDevice, | 722 CFX_RenderDevice* pDevice, |
| 725 CFX_Matrix* pUser2Device, | 723 CFX_Matrix* pUser2Device, |
| 726 uint32_t dwFlags) { | 724 uint32_t dwFlags) { |
| 727 OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); | 725 OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); |
| 728 } | 726 } |
| OLD | NEW |