| 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/fxfa/app/xfa_ffnotify.h" | 7 #include "xfa/fxfa/app/xfa_ffnotify.h" |
| 8 | 8 |
| 9 #include "xfa/fxfa/app/xfa_ffapp.h" | 9 #include "xfa/fxfa/app/xfa_ffapp.h" |
| 10 #include "xfa/fxfa/app/xfa_ffbarcode.h" | 10 #include "xfa/fxfa/app/xfa_ffbarcode.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 break; | 64 break; |
| 65 case XFA_NODEEVENT_ChildAdded: | 65 case XFA_NODEEVENT_ChildAdded: |
| 66 OnChildAdded(pSender, pParam, pParam2); | 66 OnChildAdded(pSender, pParam, pParam2); |
| 67 break; | 67 break; |
| 68 case XFA_NODEEVENT_ChildRemoved: | 68 case XFA_NODEEVENT_ChildRemoved: |
| 69 OnChildRemoved(pSender, pParam, pParam2); | 69 OnChildRemoved(pSender, pParam, pParam2); |
| 70 break; | 70 break; |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 void CXFA_FFNotify::OnWidgetDataEvent(CXFA_WidgetData* pSender, | 73 void CXFA_FFNotify::OnWidgetDataEvent(CXFA_WidgetData* pSender, |
| 74 FX_DWORD dwEvent, | 74 uint32_t dwEvent, |
| 75 void* pParam, | 75 void* pParam, |
| 76 void* pAdditional, | 76 void* pAdditional, |
| 77 void* pAdditional2) { | 77 void* pAdditional2) { |
| 78 CXFA_WidgetAcc* pWidgetAcc = static_cast<CXFA_WidgetAcc*>(pSender); | 78 CXFA_WidgetAcc* pWidgetAcc = static_cast<CXFA_WidgetAcc*>(pSender); |
| 79 switch (dwEvent) { | 79 switch (dwEvent) { |
| 80 case XFA_WIDGETEVENT_ListItemAdded: { | 80 case XFA_WIDGETEVENT_ListItemAdded: { |
| 81 if (pWidgetAcc->GetUIType() != XFA_ELEMENT_ChoiceList) { | 81 if (pWidgetAcc->GetUIType() != XFA_ELEMENT_ChoiceList) { |
| 82 return; | 82 return; |
| 83 } | 83 } |
| 84 FX_BOOL bStaticNotify = pWidgetAcc->GetDocView()->IsStaticNotify(); | 84 FX_BOOL bStaticNotify = pWidgetAcc->GetDocView()->IsStaticNotify(); |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 void CXFA_FFNotify::OnValueChanging(CXFA_Node* pSender, | 425 void CXFA_FFNotify::OnValueChanging(CXFA_Node* pSender, |
| 426 void* pParam, | 426 void* pParam, |
| 427 void* pParam2) { | 427 void* pParam2) { |
| 428 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 428 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
| 429 if (!pDocView) { | 429 if (!pDocView) { |
| 430 return; | 430 return; |
| 431 } | 431 } |
| 432 if (pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End) { | 432 if (pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End) { |
| 433 return; | 433 return; |
| 434 } | 434 } |
| 435 FX_DWORD dwPacket = pSender->GetPacketID(); | 435 uint32_t dwPacket = pSender->GetPacketID(); |
| 436 if (dwPacket & XFA_XDPPACKET_Datasets) { | 436 if (dwPacket & XFA_XDPPACKET_Datasets) { |
| 437 } else if (pSender->IsFormContainer()) { | 437 } else if (pSender->IsFormContainer()) { |
| 438 XFA_ATTRIBUTE eAttr = (XFA_ATTRIBUTE)(uintptr_t)pParam; | 438 XFA_ATTRIBUTE eAttr = (XFA_ATTRIBUTE)(uintptr_t)pParam; |
| 439 if (eAttr == XFA_ATTRIBUTE_Presence) { | 439 if (eAttr == XFA_ATTRIBUTE_Presence) { |
| 440 CXFA_WidgetAcc* pWidgetAcc = | 440 CXFA_WidgetAcc* pWidgetAcc = |
| 441 static_cast<CXFA_WidgetAcc*>(pSender->GetWidgetData()); | 441 static_cast<CXFA_WidgetAcc*>(pSender->GetWidgetData()); |
| 442 if (!pWidgetAcc) { | 442 if (!pWidgetAcc) { |
| 443 return; | 443 return; |
| 444 } | 444 } |
| 445 CXFA_FFWidget* pWidget = NULL; | 445 CXFA_FFWidget* pWidget = NULL; |
| 446 while ((pWidget = pWidgetAcc->GetNextWidget(pWidget))) { | 446 while ((pWidget = pWidgetAcc->GetNextWidget(pWidget))) { |
| 447 if (pWidget->IsLoaded()) { | 447 if (pWidget->IsLoaded()) { |
| 448 pWidget->AddInvalidateRect(); | 448 pWidget->AddInvalidateRect(); |
| 449 } | 449 } |
| 450 } | 450 } |
| 451 } | 451 } |
| 452 } | 452 } |
| 453 } | 453 } |
| 454 void CXFA_FFNotify::OnValueChanged(CXFA_Node* pSender, | 454 void CXFA_FFNotify::OnValueChanged(CXFA_Node* pSender, |
| 455 void* pParam, | 455 void* pParam, |
| 456 void* pParam2, | 456 void* pParam2, |
| 457 void* pParam3, | 457 void* pParam3, |
| 458 void* pParam4) { | 458 void* pParam4) { |
| 459 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 459 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
| 460 if (!pDocView) { | 460 if (!pDocView) { |
| 461 return; | 461 return; |
| 462 } | 462 } |
| 463 FX_DWORD dwPacket = pSender->GetPacketID(); | 463 uint32_t dwPacket = pSender->GetPacketID(); |
| 464 XFA_ATTRIBUTE eAttr = (XFA_ATTRIBUTE)(uintptr_t)pParam; | 464 XFA_ATTRIBUTE eAttr = (XFA_ATTRIBUTE)(uintptr_t)pParam; |
| 465 if (dwPacket & XFA_XDPPACKET_Form) { | 465 if (dwPacket & XFA_XDPPACKET_Form) { |
| 466 CXFA_Node* pParentNode = static_cast<CXFA_Node*>(pParam3); | 466 CXFA_Node* pParentNode = static_cast<CXFA_Node*>(pParam3); |
| 467 CXFA_Node* pWidgetNode = static_cast<CXFA_Node*>(pParam4); | 467 CXFA_Node* pWidgetNode = static_cast<CXFA_Node*>(pParam4); |
| 468 XFA_ELEMENT ePType = pParentNode->GetClassID(); | 468 XFA_ELEMENT ePType = pParentNode->GetClassID(); |
| 469 FX_BOOL bIsContainerNode = pParentNode->IsContainerNode(); | 469 FX_BOOL bIsContainerNode = pParentNode->IsContainerNode(); |
| 470 CXFA_WidgetAcc* pWidgetAcc = | 470 CXFA_WidgetAcc* pWidgetAcc = |
| 471 static_cast<CXFA_WidgetAcc*>(pWidgetNode->GetWidgetData()); | 471 static_cast<CXFA_WidgetAcc*>(pWidgetNode->GetWidgetData()); |
| 472 if (!pWidgetAcc) { | 472 if (!pWidgetAcc) { |
| 473 return; | 473 return; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 } | 568 } |
| 569 } | 569 } |
| 570 void CXFA_FFNotify::OnLayoutItemAdd(CXFA_FFDocView* pDocView, | 570 void CXFA_FFNotify::OnLayoutItemAdd(CXFA_FFDocView* pDocView, |
| 571 IXFA_DocLayout* pLayout, | 571 IXFA_DocLayout* pLayout, |
| 572 CXFA_LayoutItem* pSender, | 572 CXFA_LayoutItem* pSender, |
| 573 void* pParam, | 573 void* pParam, |
| 574 void* pParam2) { | 574 void* pParam2) { |
| 575 CXFA_FFWidget* pWidget = static_cast<CXFA_FFWidget*>(pSender); | 575 CXFA_FFWidget* pWidget = static_cast<CXFA_FFWidget*>(pSender); |
| 576 int32_t iPageIdx = (int32_t)(uintptr_t)pParam; | 576 int32_t iPageIdx = (int32_t)(uintptr_t)pParam; |
| 577 IXFA_PageView* pNewPageView = pDocView->GetPageView(iPageIdx); | 577 IXFA_PageView* pNewPageView = pDocView->GetPageView(iPageIdx); |
| 578 FX_DWORD dwStatus = (FX_DWORD)(uintptr_t)pParam2; | 578 uint32_t dwStatus = (uint32_t)(uintptr_t)pParam2; |
| 579 FX_DWORD dwFilter = XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable | | 579 uint32_t dwFilter = XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable | |
| 580 XFA_WIDGETSTATUS_Printable; | 580 XFA_WIDGETSTATUS_Printable; |
| 581 pWidget->ModifyStatus(dwStatus, dwFilter); | 581 pWidget->ModifyStatus(dwStatus, dwFilter); |
| 582 IXFA_PageView* pPrePageView = pWidget->GetPageView(); | 582 IXFA_PageView* pPrePageView = pWidget->GetPageView(); |
| 583 if (pPrePageView != pNewPageView || | 583 if (pPrePageView != pNewPageView || |
| 584 (dwStatus & (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) == | 584 (dwStatus & (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) == |
| 585 (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) { | 585 (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) { |
| 586 pWidget->SetPageView(pNewPageView); | 586 pWidget->SetPageView(pNewPageView); |
| 587 m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(), | 587 m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(), |
| 588 XFA_WIDGETEVENT_PostAdded, | 588 XFA_WIDGETEVENT_PostAdded, |
| 589 pNewPageView, pPrePageView); | 589 pNewPageView, pPrePageView); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 void* pParam2) {} | 621 void* pParam2) {} |
| 622 void CXFA_FFNotify::OnLayoutItemStatustChanged(CXFA_FFDocView* pDocView, | 622 void CXFA_FFNotify::OnLayoutItemStatustChanged(CXFA_FFDocView* pDocView, |
| 623 IXFA_DocLayout* pLayout, | 623 IXFA_DocLayout* pLayout, |
| 624 CXFA_LayoutItem* pSender, | 624 CXFA_LayoutItem* pSender, |
| 625 void* pParam, | 625 void* pParam, |
| 626 void* pParam2) { | 626 void* pParam2) { |
| 627 CXFA_FFWidget* pWidget = static_cast<CXFA_FFWidget*>(pSender); | 627 CXFA_FFWidget* pWidget = static_cast<CXFA_FFWidget*>(pSender); |
| 628 if (!pWidget) { | 628 if (!pWidget) { |
| 629 return; | 629 return; |
| 630 } | 630 } |
| 631 FX_DWORD dwStatus = (FX_DWORD)(uintptr_t)pParam; | 631 uint32_t dwStatus = (uint32_t)(uintptr_t)pParam; |
| 632 if (dwStatus == 0) { | 632 if (dwStatus == 0) { |
| 633 CXFA_LayoutItem* pPreItem = pSender->GetPrev(); | 633 CXFA_LayoutItem* pPreItem = pSender->GetPrev(); |
| 634 if (pPreItem) { | 634 if (pPreItem) { |
| 635 CXFA_FFWidget* pPreWidget = static_cast<CXFA_FFWidget*>(pPreItem); | 635 CXFA_FFWidget* pPreWidget = static_cast<CXFA_FFWidget*>(pPreItem); |
| 636 if (pPreWidget) { | 636 if (pPreWidget) { |
| 637 dwStatus = pPreWidget->GetStatus(); | 637 dwStatus = pPreWidget->GetStatus(); |
| 638 } | 638 } |
| 639 } | 639 } |
| 640 } | 640 } |
| 641 FX_DWORD dwOldStatus = pWidget->GetStatus(); | 641 uint32_t dwOldStatus = pWidget->GetStatus(); |
| 642 FX_DWORD dwFilter = XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable | | 642 uint32_t dwFilter = XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable | |
| 643 XFA_WIDGETSTATUS_Printable; | 643 XFA_WIDGETSTATUS_Printable; |
| 644 if ((dwOldStatus & dwFilter) == dwStatus) { | 644 if ((dwOldStatus & dwFilter) == dwStatus) { |
| 645 return; | 645 return; |
| 646 } | 646 } |
| 647 pWidget->ModifyStatus(dwStatus, dwFilter); | 647 pWidget->ModifyStatus(dwStatus, dwFilter); |
| 648 } | 648 } |
| OLD | NEW |