| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/cpdfsdk_xfawidgethandler.h" | 7 #include "fpdfsdk/cpdfsdk_xfawidgethandler.h" |
| 8 | 8 |
| 9 #include "core/fpdfdoc/cpdf_interform.h" | 9 #include "core/fpdfdoc/cpdf_interform.h" |
| 10 #include "fpdfsdk/cpdfsdk_annot.h" | 10 #include "fpdfsdk/cpdfsdk_annot.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 FX_BOOL bIsHighlight = FALSE; | 62 FX_BOOL bIsHighlight = FALSE; |
| 63 if (pPageView->GetFormFillEnv()->GetSDKDocument()->GetFocusAnnot() != pAnnot) | 63 if (pPageView->GetFormFillEnv()->GetSDKDocument()->GetFocusAnnot() != pAnnot) |
| 64 bIsHighlight = TRUE; | 64 bIsHighlight = TRUE; |
| 65 | 65 |
| 66 GetXFAWidgetHandler(pAnnot)->RenderWidget(pAnnot->GetXFAWidget(), &gs, &mt, | 66 GetXFAWidgetHandler(pAnnot)->RenderWidget(pAnnot->GetXFAWidget(), &gs, &mt, |
| 67 bIsHighlight); | 67 bIsHighlight); |
| 68 | 68 |
| 69 // to do highlight and shadow | 69 // to do highlight and shadow |
| 70 } | 70 } |
| 71 | 71 |
| 72 void CPDFSDK_XFAWidgetHandler::OnCreate(CPDFSDK_Annot* pAnnot) {} | |
| 73 | |
| 74 void CPDFSDK_XFAWidgetHandler::OnLoad(CPDFSDK_Annot* pAnnot) {} | 72 void CPDFSDK_XFAWidgetHandler::OnLoad(CPDFSDK_Annot* pAnnot) {} |
| 75 | 73 |
| 76 void CPDFSDK_XFAWidgetHandler::OnDelete(CPDFSDK_Annot* pAnnot) {} | |
| 77 | |
| 78 void CPDFSDK_XFAWidgetHandler::OnRelease(CPDFSDK_Annot* pAnnot) {} | |
| 79 | |
| 80 void CPDFSDK_XFAWidgetHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot) { | 74 void CPDFSDK_XFAWidgetHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot) { |
| 81 CPDFSDK_XFAWidget* pWidget = reinterpret_cast<CPDFSDK_XFAWidget*>(pAnnot); | 75 CPDFSDK_XFAWidget* pWidget = reinterpret_cast<CPDFSDK_XFAWidget*>(pAnnot); |
| 82 CPDFSDK_InterForm* pInterForm = pWidget->GetInterForm(); | 76 CPDFSDK_InterForm* pInterForm = pWidget->GetInterForm(); |
| 83 pInterForm->RemoveXFAMap(pWidget->GetXFAWidget()); | 77 pInterForm->RemoveXFAMap(pWidget->GetXFAWidget()); |
| 84 | 78 |
| 85 delete pWidget; | 79 delete pWidget; |
| 86 } | 80 } |
| 87 | 81 |
| 88 void CPDFSDK_XFAWidgetHandler::DeleteAnnot(CPDFSDK_Annot* pAnnot) {} | |
| 89 | |
| 90 CFX_FloatRect CPDFSDK_XFAWidgetHandler::GetViewBBox(CPDFSDK_PageView* pPageView, | 82 CFX_FloatRect CPDFSDK_XFAWidgetHandler::GetViewBBox(CPDFSDK_PageView* pPageView, |
| 91 CPDFSDK_Annot* pAnnot) { | 83 CPDFSDK_Annot* pAnnot) { |
| 92 ASSERT(pAnnot); | 84 ASSERT(pAnnot); |
| 93 | 85 |
| 94 CFX_RectF rcBBox; | 86 CFX_RectF rcBBox; |
| 95 XFA_Element eType = pAnnot->GetXFAWidget()->GetDataAcc()->GetUIType(); | 87 XFA_Element eType = pAnnot->GetXFAWidget()->GetDataAcc()->GetUIType(); |
| 96 if (eType == XFA_Element::Signature) | 88 if (eType == XFA_Element::Signature) |
| 97 pAnnot->GetXFAWidget()->GetBBox(rcBBox, XFA_WidgetStatus_Visible, TRUE); | 89 pAnnot->GetXFAWidget()->GetBBox(rcBBox, XFA_WidgetStatus_Visible, TRUE); |
| 98 else | 90 else |
| 99 pAnnot->GetXFAWidget()->GetBBox(rcBBox, XFA_WidgetStatus_None); | 91 pAnnot->GetXFAWidget()->GetBBox(rcBBox, XFA_WidgetStatus_None); |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 int nKeyCode, | 277 int nKeyCode, |
| 286 int nFlag) { | 278 int nFlag) { |
| 287 if (!pAnnot) | 279 if (!pAnnot) |
| 288 return FALSE; | 280 return FALSE; |
| 289 | 281 |
| 290 CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); | 282 CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); |
| 291 return pWidgetHandler->OnKeyUp(pAnnot->GetXFAWidget(), nKeyCode, | 283 return pWidgetHandler->OnKeyUp(pAnnot->GetXFAWidget(), nKeyCode, |
| 292 GetFWLFlags(nFlag)); | 284 GetFWLFlags(nFlag)); |
| 293 } | 285 } |
| 294 | 286 |
| 295 void CPDFSDK_XFAWidgetHandler::OnDeSelected(CPDFSDK_Annot* pAnnot) {} | |
| 296 | |
| 297 void CPDFSDK_XFAWidgetHandler::OnSelected(CPDFSDK_Annot* pAnnot) {} | |
| 298 | |
| 299 FX_BOOL CPDFSDK_XFAWidgetHandler::OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, | 287 FX_BOOL CPDFSDK_XFAWidgetHandler::OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 300 uint32_t nFlag) { | 288 uint32_t nFlag) { |
| 301 return TRUE; | 289 return TRUE; |
| 302 } | 290 } |
| 303 | 291 |
| 304 FX_BOOL CPDFSDK_XFAWidgetHandler::OnKillFocus( | 292 FX_BOOL CPDFSDK_XFAWidgetHandler::OnKillFocus( |
| 305 CPDFSDK_Annot::ObservedPtr* pAnnot, | 293 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 306 uint32_t nFlag) { | 294 uint32_t nFlag) { |
| 307 return TRUE; | 295 return TRUE; |
| 308 } | 296 } |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 dwFWLFlag |= FWL_KEYFLAG_MButton; | 364 dwFWLFlag |= FWL_KEYFLAG_MButton; |
| 377 if (dwFlag & FWL_EVENTFLAG_RightButtonDown) | 365 if (dwFlag & FWL_EVENTFLAG_RightButtonDown) |
| 378 dwFWLFlag |= FWL_KEYFLAG_RButton; | 366 dwFWLFlag |= FWL_KEYFLAG_RButton; |
| 379 if (dwFlag & FWL_EVENTFLAG_ShiftKey) | 367 if (dwFlag & FWL_EVENTFLAG_ShiftKey) |
| 380 dwFWLFlag |= FWL_KEYFLAG_Shift; | 368 dwFWLFlag |= FWL_KEYFLAG_Shift; |
| 381 if (dwFlag & FWL_EVENTFLAG_AltKey) | 369 if (dwFlag & FWL_EVENTFLAG_AltKey) |
| 382 dwFWLFlag |= FWL_KEYFLAG_Alt; | 370 dwFWLFlag |= FWL_KEYFLAG_Alt; |
| 383 | 371 |
| 384 return dwFWLFlag; | 372 return dwFWLFlag; |
| 385 } | 373 } |
| OLD | NEW |