| 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 "../../include/formfiller/FFL_FormFiller.h" | 7 #include "../../include/formfiller/FFL_FormFiller.h" |
| 8 #include "../../include/formfiller/FFL_Notify.h" | 8 #include "../../include/formfiller/FFL_Notify.h" |
| 9 #include "../../include/formfiller/FFL_CBA_Fontmap.h" | 9 #include "../../include/formfiller/FFL_CBA_Fontmap.h" |
| 10 | 10 |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 ASSERT(pPageView != NULL); | 235 ASSERT(pPageView != NULL); |
| 236 | 236 |
| 237 if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { | 237 if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { |
| 238 return pWnd->OnChar(nChar, nFlags); | 238 return pWnd->OnChar(nChar, nFlags); |
| 239 } | 239 } |
| 240 } | 240 } |
| 241 | 241 |
| 242 return FALSE; | 242 return FALSE; |
| 243 } | 243 } |
| 244 | 244 |
| 245 FX_BOOL CFFL_FormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) { | 245 FX_BOOL CFFL_FormFiller::SetFocusForAnnot(CPDFSDK_Annot* pAnnot, |
| 246 FX_UINT nFlag) { |
| 246 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; | 247 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; |
| 247 CPDFXFA_Page* pPage = pWidget->GetPDFXFAPage(); | 248 CPDFXFA_Page* pPage = pWidget->GetPDFXFAPage(); |
| 248 CPDFSDK_Document* pDoc = m_pApp->GetSDKDocument(); | 249 CPDFSDK_Document* pDoc = m_pApp->GetSDKDocument(); |
| 249 CPDFSDK_PageView* pPageView = pDoc->GetPageView(pPage); | 250 CPDFSDK_PageView* pPageView = pDoc->GetPageView(pPage); |
| 250 if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE)) | 251 if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE)) |
| 251 pWnd->SetFocus(); | 252 pWnd->SetFocus(); |
| 252 | 253 |
| 253 m_bValid = TRUE; | 254 m_bValid = TRUE; |
| 254 FX_RECT rcRect = GetViewBBox(pPageView, pAnnot); | 255 FX_RECT rcRect = GetViewBBox(pPageView, pAnnot); |
| 255 InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom); | 256 InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom); |
| 256 return TRUE; | 257 return TRUE; |
| 257 } | 258 } |
| 258 | 259 |
| 259 FX_BOOL CFFL_FormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) { | 260 FX_BOOL CFFL_FormFiller::KillFocusForAnnot(CPDFSDK_Annot* pAnnot, |
| 261 FX_UINT nFlag) { |
| 260 if (!IsValid()) | 262 if (!IsValid()) |
| 261 return TRUE; | 263 return TRUE; |
| 262 | 264 |
| 263 CPDFSDK_PageView* pPageView = GetCurPageView(); | 265 CPDFSDK_PageView* pPageView = GetCurPageView(); |
| 264 CommitData(pPageView, nFlag); | 266 CommitData(pPageView, nFlag); |
| 265 | 267 |
| 266 if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) | 268 if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) |
| 267 pWnd->KillFocus(); | 269 pWnd->KillFocus(); |
| 268 | 270 |
| 269 switch (m_pWidget->GetFieldType()) { | 271 switch (m_pWidget->GetFieldType()) { |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 FX_BOOL bRestoreValue) { | 598 FX_BOOL bRestoreValue) { |
| 597 return GetPDFWindow(pPageView, FALSE); | 599 return GetPDFWindow(pPageView, FALSE); |
| 598 } | 600 } |
| 599 | 601 |
| 600 void CFFL_FormFiller::TimerProc() {} | 602 void CFFL_FormFiller::TimerProc() {} |
| 601 | 603 |
| 602 IFX_SystemHandler* CFFL_FormFiller::GetSystemHandler() const { | 604 IFX_SystemHandler* CFFL_FormFiller::GetSystemHandler() const { |
| 603 return m_pApp->GetSysHandler(); | 605 return m_pApp->GetSysHandler(); |
| 604 } | 606 } |
| 605 | 607 |
| 606 void CFFL_FormFiller::OnKeyStroke(FX_BOOL bKeyDown) {} | 608 void CFFL_FormFiller::OnKeyStroke(FX_BOOL bKeyDown, FX_DWORD nFlag) {} |
| 607 | 609 |
| 608 void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView, | 610 void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView, |
| 609 FX_BOOL bDestroyPDFWindow) { | 611 FX_BOOL bDestroyPDFWindow) { |
| 610 m_bValid = FALSE; | 612 m_bValid = FALSE; |
| 611 | 613 |
| 612 FX_RECT rcRect = GetViewBBox(pPageView, m_pWidget); | 614 FX_RECT rcRect = GetViewBBox(pPageView, m_pWidget); |
| 613 InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom); | 615 InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom); |
| 614 | 616 |
| 615 if (bDestroyPDFWindow) | 617 if (bDestroyPDFWindow) |
| 616 DestroyPDFWindow(pPageView); | 618 DestroyPDFWindow(pPageView); |
| 617 } | 619 } |
| 618 | 620 |
| 619 FX_BOOL CFFL_FormFiller::CanCopy(CPDFSDK_Document* pDocument) { | |
| 620 return FALSE; | |
| 621 } | |
| 622 | |
| 623 FX_BOOL CFFL_FormFiller::CanCut(CPDFSDK_Document* pDocument) { | |
| 624 return FALSE; | |
| 625 } | |
| 626 | |
| 627 FX_BOOL CFFL_FormFiller::CanPaste(CPDFSDK_Document* pDocument) { | |
| 628 return FALSE; | |
| 629 } | |
| 630 | |
| 631 void CFFL_FormFiller::DoCopy(CPDFSDK_Document* pDocument) {} | |
| 632 | |
| 633 void CFFL_FormFiller::DoCut(CPDFSDK_Document* pDocument) {} | |
| 634 | |
| 635 void CFFL_FormFiller::DoPaste(CPDFSDK_Document* pDocument) {} | |
| 636 | |
| 637 void CFFL_FormFiller::InvalidateRect(double left, | 621 void CFFL_FormFiller::InvalidateRect(double left, |
| 638 double top, | 622 double top, |
| 639 double right, | 623 double right, |
| 640 double bottom) { | 624 double bottom) { |
| 641 CPDFXFA_Page* pPage = m_pWidget->GetPDFXFAPage(); | 625 CPDFXFA_Page* pPage = m_pWidget->GetPDFXFAPage(); |
| 642 m_pApp->FFI_Invalidate(pPage, left, top, right, bottom); | 626 m_pApp->FFI_Invalidate(pPage, left, top, right, bottom); |
| 643 } | 627 } |
| 644 | 628 |
| 645 /* ------------------------- CFFL_Button ------------------------- */ | 629 /* ------------------------- CFFL_Button ------------------------- */ |
| 646 | 630 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL); | 721 pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL); |
| 738 } | 722 } |
| 739 | 723 |
| 740 void CFFL_Button::OnDrawDeactive(CPDFSDK_PageView* pPageView, | 724 void CFFL_Button::OnDrawDeactive(CPDFSDK_PageView* pPageView, |
| 741 CPDFSDK_Annot* pAnnot, | 725 CPDFSDK_Annot* pAnnot, |
| 742 CFX_RenderDevice* pDevice, | 726 CFX_RenderDevice* pDevice, |
| 743 CPDF_Matrix* pUser2Device, | 727 CPDF_Matrix* pUser2Device, |
| 744 FX_DWORD dwFlags) { | 728 FX_DWORD dwFlags) { |
| 745 OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); | 729 OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); |
| 746 } | 730 } |
| OLD | NEW |