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/formfiller/FFL_FormFiller.h" | 9 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h" |
10 #include "fpdfsdk/include/fsdk_annothandler.h" | 10 #include "fpdfsdk/include/fsdk_annothandler.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 GetAnnotHandler(pAnnot->GetSubType())) { | 65 GetAnnotHandler(pAnnot->GetSubType())) { |
66 return pAnnotHandler->NewAnnot(pAnnot, pPageView); | 66 return pAnnotHandler->NewAnnot(pAnnot, pPageView); |
67 } | 67 } |
68 | 68 |
69 return new CPDFSDK_BAAnnot(pAnnot, pPageView); | 69 return new CPDFSDK_BAAnnot(pAnnot, pPageView); |
70 } | 70 } |
71 | 71 |
72 #ifdef PDF_ENABLE_XFA | 72 #ifdef PDF_ENABLE_XFA |
73 CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::NewAnnot(IXFA_Widget* pAnnot, | 73 CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::NewAnnot(IXFA_Widget* pAnnot, |
74 CPDFSDK_PageView* pPageView) { | 74 CPDFSDK_PageView* pPageView) { |
75 ASSERT(pAnnot != NULL); | 75 ASSERT(pAnnot); |
76 ASSERT(pPageView != NULL); | 76 ASSERT(pPageView); |
77 | 77 |
78 if (IPDFSDK_AnnotHandler* pAnnotHandler = | 78 if (IPDFSDK_AnnotHandler* pAnnotHandler = |
79 GetAnnotHandler(FSDK_XFAWIDGET_TYPENAME)) { | 79 GetAnnotHandler(FSDK_XFAWIDGET_TYPENAME)) { |
80 return pAnnotHandler->NewAnnot(pAnnot, pPageView); | 80 return pAnnotHandler->NewAnnot(pAnnot, pPageView); |
81 } | 81 } |
82 | 82 |
83 return NULL; | 83 return NULL; |
84 } | 84 } |
85 #endif // PDF_ENABLE_XFA | 85 #endif // PDF_ENABLE_XFA |
86 | 86 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 XFA_TRAVERSEWAY_Tranvalse, XFA_WIDGETFILTER_Visible | | 371 XFA_TRAVERSEWAY_Tranvalse, XFA_WIDGETFILTER_Visible | |
372 XFA_WIDGETFILTER_Viewable | | 372 XFA_WIDGETFILTER_Viewable | |
373 XFA_WIDGETFILTER_Field); | 373 XFA_WIDGETFILTER_Field); |
374 if (pWidgetIterator == NULL) | 374 if (pWidgetIterator == NULL) |
375 return NULL; | 375 return NULL; |
376 if (pWidgetIterator->GetCurrentWidget() != pSDKAnnot->GetXFAWidget()) | 376 if (pWidgetIterator->GetCurrentWidget() != pSDKAnnot->GetXFAWidget()) |
377 pWidgetIterator->SetCurrentWidget(pSDKAnnot->GetXFAWidget()); | 377 pWidgetIterator->SetCurrentWidget(pSDKAnnot->GetXFAWidget()); |
378 IXFA_Widget* hNextFocus = NULL; | 378 IXFA_Widget* hNextFocus = NULL; |
379 hNextFocus = | 379 hNextFocus = |
380 bNext ? pWidgetIterator->MoveToNext() : pWidgetIterator->MoveToPrevious(); | 380 bNext ? pWidgetIterator->MoveToNext() : pWidgetIterator->MoveToPrevious(); |
381 if (hNextFocus == NULL && pSDKAnnot != NULL) | 381 if (!hNextFocus && pSDKAnnot) |
382 hNextFocus = pWidgetIterator->MoveToFirst(); | 382 hNextFocus = pWidgetIterator->MoveToFirst(); |
383 | 383 |
384 pWidgetIterator->Release(); | 384 pWidgetIterator->Release(); |
385 return pPageView->GetAnnotByXFAWidget(hNextFocus); | 385 return pPageView->GetAnnotByXFAWidget(hNextFocus); |
386 #else // PDF_ENABLE_XFA | 386 #else // PDF_ENABLE_XFA |
387 CBA_AnnotIterator ai(pSDKAnnot->GetPageView(), "Widget", ""); | 387 CBA_AnnotIterator ai(pSDKAnnot->GetPageView(), "Widget", ""); |
388 return bNext ? ai.GetNextAnnot(pSDKAnnot) : ai.GetPrevAnnot(pSDKAnnot); | 388 return bNext ? ai.GetNextAnnot(pSDKAnnot) : ai.GetPrevAnnot(pSDKAnnot); |
389 #endif // PDF_ENABLE_XFA | 389 #endif // PDF_ENABLE_XFA |
390 } | 390 } |
391 | 391 |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 | 745 |
746 void CPDFSDK_XFAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, | 746 void CPDFSDK_XFAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, |
747 CPDFSDK_Annot* pAnnot, | 747 CPDFSDK_Annot* pAnnot, |
748 CFX_RenderDevice* pDevice, | 748 CFX_RenderDevice* pDevice, |
749 CFX_Matrix* pUser2Device, | 749 CFX_Matrix* pUser2Device, |
750 FX_DWORD dwFlags) { | 750 FX_DWORD dwFlags) { |
751 ASSERT(pPageView != NULL); | 751 ASSERT(pPageView != NULL); |
752 ASSERT(pAnnot != NULL); | 752 ASSERT(pAnnot != NULL); |
753 | 753 |
754 CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument(); | 754 CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument(); |
755 ASSERT(pSDKDoc != NULL); | |
756 | |
757 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); | 755 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); |
758 ASSERT(pWidgetHandler != NULL); | |
759 | 756 |
760 CFX_Graphics gs; | 757 CFX_Graphics gs; |
761 gs.Create(pDevice); | 758 gs.Create(pDevice); |
762 | 759 |
763 CFX_Matrix mt; | 760 CFX_Matrix mt; |
764 mt = *(CFX_Matrix*)pUser2Device; | 761 mt = *(CFX_Matrix*)pUser2Device; |
765 | 762 |
766 FX_BOOL bIsHighlight = FALSE; | 763 FX_BOOL bIsHighlight = FALSE; |
767 if (pSDKDoc->GetFocusAnnot() != pAnnot) | 764 if (pSDKDoc->GetFocusAnnot() != pAnnot) |
768 bIsHighlight = TRUE; | 765 bIsHighlight = TRUE; |
769 | 766 |
770 pWidgetHandler->RenderWidget(pAnnot->GetXFAWidget(), &gs, &mt, bIsHighlight); | 767 pWidgetHandler->RenderWidget(pAnnot->GetXFAWidget(), &gs, &mt, bIsHighlight); |
771 | 768 |
772 // to do highlight and shadow | 769 // to do highlight and shadow |
773 } | 770 } |
774 | 771 |
775 void CPDFSDK_XFAAnnotHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot) { | 772 void CPDFSDK_XFAAnnotHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot) { |
776 ASSERT(pAnnot != NULL); | |
777 | |
778 CPDFSDK_XFAWidget* pWidget = (CPDFSDK_XFAWidget*)pAnnot; | 773 CPDFSDK_XFAWidget* pWidget = (CPDFSDK_XFAWidget*)pAnnot; |
779 CPDFSDK_InterForm* pInterForm = pWidget->GetInterForm(); | 774 CPDFSDK_InterForm* pInterForm = pWidget->GetInterForm(); |
780 ASSERT(pInterForm != NULL); | |
781 | |
782 pInterForm->RemoveXFAMap(pWidget->GetXFAWidget()); | 775 pInterForm->RemoveXFAMap(pWidget->GetXFAWidget()); |
783 | 776 |
784 delete pWidget; | 777 delete pWidget; |
785 } | 778 } |
786 | 779 |
787 CPDF_Rect CPDFSDK_XFAAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView, | 780 CPDF_Rect CPDFSDK_XFAAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView, |
788 CPDFSDK_Annot* pAnnot) { | 781 CPDFSDK_Annot* pAnnot) { |
789 ASSERT(pAnnot != NULL); | 782 ASSERT(pAnnot); |
790 | 783 |
791 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); | 784 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); |
792 ASSERT(pWidgetHandler != NULL); | |
793 | |
794 CFX_RectF rcBBox; | 785 CFX_RectF rcBBox; |
795 XFA_ELEMENT eType = | 786 XFA_ELEMENT eType = |
796 pWidgetHandler->GetDataAcc(pAnnot->GetXFAWidget())->GetUIType(); | 787 pWidgetHandler->GetDataAcc(pAnnot->GetXFAWidget())->GetUIType(); |
797 if (eType == XFA_ELEMENT_Signature) | 788 if (eType == XFA_ELEMENT_Signature) |
798 pWidgetHandler->GetBBox(pAnnot->GetXFAWidget(), rcBBox, | 789 pWidgetHandler->GetBBox(pAnnot->GetXFAWidget(), rcBBox, |
799 XFA_WIDGETSTATUS_Visible, TRUE); | 790 XFA_WIDGETSTATUS_Visible, TRUE); |
800 else | 791 else |
801 pWidgetHandler->GetBBox(pAnnot->GetXFAWidget(), rcBBox, 0); | 792 pWidgetHandler->GetBBox(pAnnot->GetXFAWidget(), rcBBox, 0); |
802 | 793 |
803 CFX_FloatRect rcWidget(rcBBox.left, rcBBox.top, rcBBox.left + rcBBox.width, | 794 CFX_FloatRect rcWidget(rcBBox.left, rcBBox.top, rcBBox.left + rcBBox.width, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 pWidgetHandler->OnHitTest(pAnnot->GetXFAWidget(), point.x, point.y); | 827 pWidgetHandler->OnHitTest(pAnnot->GetXFAWidget(), point.x, point.y); |
837 return (dwHitTest != FWL_WGTHITTEST_Unknown); | 828 return (dwHitTest != FWL_WGTHITTEST_Unknown); |
838 } | 829 } |
839 | 830 |
840 void CPDFSDK_XFAAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView, | 831 void CPDFSDK_XFAAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView, |
841 CPDFSDK_Annot* pAnnot, | 832 CPDFSDK_Annot* pAnnot, |
842 FX_DWORD nFlag) { | 833 FX_DWORD nFlag) { |
843 if (!pPageView || !pAnnot) | 834 if (!pPageView || !pAnnot) |
844 return; | 835 return; |
845 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); | 836 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); |
846 ASSERT(pWidgetHandler != NULL); | |
847 | |
848 pWidgetHandler->OnMouseEnter(pAnnot->GetXFAWidget()); | 837 pWidgetHandler->OnMouseEnter(pAnnot->GetXFAWidget()); |
849 } | 838 } |
850 | 839 |
851 void CPDFSDK_XFAAnnotHandler::OnMouseExit(CPDFSDK_PageView* pPageView, | 840 void CPDFSDK_XFAAnnotHandler::OnMouseExit(CPDFSDK_PageView* pPageView, |
852 CPDFSDK_Annot* pAnnot, | 841 CPDFSDK_Annot* pAnnot, |
853 FX_DWORD nFlag) { | 842 FX_DWORD nFlag) { |
854 if (!pPageView || !pAnnot) | 843 if (!pPageView || !pAnnot) |
855 return; | 844 return; |
856 | 845 |
857 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); | 846 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); |
858 ASSERT(pWidgetHandler != NULL); | |
859 | |
860 pWidgetHandler->OnMouseExit(pAnnot->GetXFAWidget()); | 847 pWidgetHandler->OnMouseExit(pAnnot->GetXFAWidget()); |
861 } | 848 } |
862 | 849 |
863 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView, | 850 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView, |
864 CPDFSDK_Annot* pAnnot, | 851 CPDFSDK_Annot* pAnnot, |
865 FX_DWORD nFlags, | 852 FX_DWORD nFlags, |
866 const CPDF_Point& point) { | 853 const CPDF_Point& point) { |
867 if (!pPageView || !pAnnot) | 854 if (!pPageView || !pAnnot) |
868 return FALSE; | 855 return FALSE; |
869 | 856 |
870 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); | 857 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); |
871 ASSERT(pWidgetHandler != NULL); | 858 return pWidgetHandler->OnLButtonDown(pAnnot->GetXFAWidget(), |
872 | |
873 FX_BOOL bRet = FALSE; | |
874 bRet = pWidgetHandler->OnLButtonDown(pAnnot->GetXFAWidget(), | |
875 GetFWLFlags(nFlags), point.x, point.y); | 859 GetFWLFlags(nFlags), point.x, point.y); |
876 | |
877 return bRet; | |
878 } | 860 } |
879 | 861 |
880 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView, | 862 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView, |
881 CPDFSDK_Annot* pAnnot, | 863 CPDFSDK_Annot* pAnnot, |
882 FX_DWORD nFlags, | 864 FX_DWORD nFlags, |
883 const CPDF_Point& point) { | 865 const CPDF_Point& point) { |
884 if (!pPageView || !pAnnot) | 866 if (!pPageView || !pAnnot) |
885 return FALSE; | 867 return FALSE; |
886 | 868 |
887 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); | 869 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); |
888 ASSERT(pWidgetHandler != NULL); | 870 return pWidgetHandler->OnLButtonUp(pAnnot->GetXFAWidget(), |
889 | |
890 FX_BOOL bRet = FALSE; | |
891 bRet = pWidgetHandler->OnLButtonUp(pAnnot->GetXFAWidget(), | |
892 GetFWLFlags(nFlags), point.x, point.y); | 871 GetFWLFlags(nFlags), point.x, point.y); |
893 | |
894 return bRet; | |
895 } | 872 } |
896 | 873 |
897 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView, | 874 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView, |
898 CPDFSDK_Annot* pAnnot, | 875 CPDFSDK_Annot* pAnnot, |
899 FX_DWORD nFlags, | 876 FX_DWORD nFlags, |
900 const CPDF_Point& point) { | 877 const CPDF_Point& point) { |
901 if (!pPageView || !pAnnot) | 878 if (!pPageView || !pAnnot) |
902 return FALSE; | 879 return FALSE; |
903 | 880 |
904 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); | 881 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); |
905 ASSERT(pWidgetHandler != NULL); | 882 return pWidgetHandler->OnLButtonDblClk(pAnnot->GetXFAWidget(), |
906 | |
907 FX_BOOL bRet = FALSE; | |
908 bRet = pWidgetHandler->OnLButtonDblClk(pAnnot->GetXFAWidget(), | |
909 GetFWLFlags(nFlags), point.x, point.y); | 883 GetFWLFlags(nFlags), point.x, point.y); |
910 | |
911 return bRet; | |
912 } | 884 } |
913 | 885 |
914 FX_BOOL CPDFSDK_XFAAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView, | 886 FX_BOOL CPDFSDK_XFAAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView, |
915 CPDFSDK_Annot* pAnnot, | 887 CPDFSDK_Annot* pAnnot, |
916 FX_DWORD nFlags, | 888 FX_DWORD nFlags, |
917 const CPDF_Point& point) { | 889 const CPDF_Point& point) { |
918 if (!pPageView || !pAnnot) | 890 if (!pPageView || !pAnnot) |
919 return FALSE; | 891 return FALSE; |
920 | 892 |
921 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); | 893 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); |
922 ASSERT(pWidgetHandler != NULL); | 894 return pWidgetHandler->OnMouseMove(pAnnot->GetXFAWidget(), |
923 | |
924 FX_BOOL bRet = FALSE; | |
925 bRet = pWidgetHandler->OnMouseMove(pAnnot->GetXFAWidget(), | |
926 GetFWLFlags(nFlags), point.x, point.y); | 895 GetFWLFlags(nFlags), point.x, point.y); |
927 | |
928 return bRet; | |
929 } | 896 } |
930 | 897 |
931 FX_BOOL CPDFSDK_XFAAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView, | 898 FX_BOOL CPDFSDK_XFAAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView, |
932 CPDFSDK_Annot* pAnnot, | 899 CPDFSDK_Annot* pAnnot, |
933 FX_DWORD nFlags, | 900 FX_DWORD nFlags, |
934 short zDelta, | 901 short zDelta, |
935 const CPDF_Point& point) { | 902 const CPDF_Point& point) { |
936 if (!pPageView || !pAnnot) | 903 if (!pPageView || !pAnnot) |
937 return FALSE; | 904 return FALSE; |
938 | 905 |
939 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); | 906 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); |
940 ASSERT(pWidgetHandler != NULL); | 907 return pWidgetHandler->OnMouseWheel( |
941 | |
942 FX_BOOL bRet = FALSE; | |
943 bRet = pWidgetHandler->OnMouseWheel( | |
944 pAnnot->GetXFAWidget(), GetFWLFlags(nFlags), zDelta, point.x, point.y); | 908 pAnnot->GetXFAWidget(), GetFWLFlags(nFlags), zDelta, point.x, point.y); |
945 | |
946 return bRet; | |
947 } | 909 } |
948 | 910 |
949 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView, | 911 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView, |
950 CPDFSDK_Annot* pAnnot, | 912 CPDFSDK_Annot* pAnnot, |
951 FX_DWORD nFlags, | 913 FX_DWORD nFlags, |
952 const CPDF_Point& point) { | 914 const CPDF_Point& point) { |
953 if (!pPageView || !pAnnot) | 915 if (!pPageView || !pAnnot) |
954 return FALSE; | 916 return FALSE; |
955 | 917 |
956 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); | 918 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); |
957 ASSERT(pWidgetHandler != NULL); | 919 return pWidgetHandler->OnRButtonDown(pAnnot->GetXFAWidget(), |
958 | |
959 FX_BOOL bRet = FALSE; | |
960 bRet = pWidgetHandler->OnRButtonDown(pAnnot->GetXFAWidget(), | |
961 GetFWLFlags(nFlags), point.x, point.y); | 920 GetFWLFlags(nFlags), point.x, point.y); |
962 | |
963 return bRet; | |
964 } | 921 } |
965 | 922 |
966 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView, | 923 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView, |
967 CPDFSDK_Annot* pAnnot, | 924 CPDFSDK_Annot* pAnnot, |
968 FX_DWORD nFlags, | 925 FX_DWORD nFlags, |
969 const CPDF_Point& point) { | 926 const CPDF_Point& point) { |
970 if (!pPageView || !pAnnot) | 927 if (!pPageView || !pAnnot) |
971 return FALSE; | 928 return FALSE; |
972 | 929 |
973 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); | 930 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); |
974 ASSERT(pWidgetHandler != NULL); | 931 return pWidgetHandler->OnRButtonUp(pAnnot->GetXFAWidget(), |
975 | |
976 FX_BOOL bRet = FALSE; | |
977 bRet = pWidgetHandler->OnRButtonUp(pAnnot->GetXFAWidget(), | |
978 GetFWLFlags(nFlags), point.x, point.y); | 932 GetFWLFlags(nFlags), point.x, point.y); |
979 | |
980 return bRet; | |
981 } | 933 } |
982 | 934 |
983 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonDblClk(CPDFSDK_PageView* pPageView, | 935 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonDblClk(CPDFSDK_PageView* pPageView, |
984 CPDFSDK_Annot* pAnnot, | 936 CPDFSDK_Annot* pAnnot, |
985 FX_DWORD nFlags, | 937 FX_DWORD nFlags, |
986 const CPDF_Point& point) { | 938 const CPDF_Point& point) { |
987 if (!pPageView || !pAnnot) | 939 if (!pPageView || !pAnnot) |
988 return FALSE; | 940 return FALSE; |
989 | 941 |
990 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); | 942 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); |
991 ASSERT(pWidgetHandler != NULL); | 943 return pWidgetHandler->OnRButtonDblClk(pAnnot->GetXFAWidget(), |
992 | |
993 FX_BOOL bRet = FALSE; | |
994 bRet = pWidgetHandler->OnRButtonDblClk(pAnnot->GetXFAWidget(), | |
995 GetFWLFlags(nFlags), point.x, point.y); | 944 GetFWLFlags(nFlags), point.x, point.y); |
996 | |
997 return bRet; | |
998 } | 945 } |
999 | 946 |
1000 FX_BOOL CPDFSDK_XFAAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, | 947 FX_BOOL CPDFSDK_XFAAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, |
1001 FX_DWORD nChar, | 948 FX_DWORD nChar, |
1002 FX_DWORD nFlags) { | 949 FX_DWORD nFlags) { |
1003 if (!pAnnot) | 950 if (!pAnnot) |
1004 return FALSE; | 951 return FALSE; |
1005 | 952 |
1006 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); | 953 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); |
1007 ASSERT(pWidgetHandler != NULL); | 954 return pWidgetHandler->OnChar(pAnnot->GetXFAWidget(), nChar, |
1008 | |
1009 FX_BOOL bRet = FALSE; | |
1010 bRet = pWidgetHandler->OnChar(pAnnot->GetXFAWidget(), nChar, | |
1011 GetFWLFlags(nFlags)); | 955 GetFWLFlags(nFlags)); |
1012 | |
1013 return bRet; | |
1014 } | 956 } |
1015 | 957 |
1016 FX_BOOL CPDFSDK_XFAAnnotHandler::OnKeyDown(CPDFSDK_Annot* pAnnot, | 958 FX_BOOL CPDFSDK_XFAAnnotHandler::OnKeyDown(CPDFSDK_Annot* pAnnot, |
1017 int nKeyCode, | 959 int nKeyCode, |
1018 int nFlag) { | 960 int nFlag) { |
1019 if (!pAnnot) | 961 if (!pAnnot) |
1020 return FALSE; | 962 return FALSE; |
1021 | 963 |
1022 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); | 964 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); |
1023 ASSERT(pWidgetHandler != NULL); | 965 return pWidgetHandler->OnKeyDown(pAnnot->GetXFAWidget(), nKeyCode, |
1024 | |
1025 FX_BOOL bRet = FALSE; | |
1026 bRet = pWidgetHandler->OnKeyDown(pAnnot->GetXFAWidget(), nKeyCode, | |
1027 GetFWLFlags(nFlag)); | 966 GetFWLFlags(nFlag)); |
1028 | |
1029 return bRet; | |
1030 } | 967 } |
1031 | 968 |
1032 FX_BOOL CPDFSDK_XFAAnnotHandler::OnKeyUp(CPDFSDK_Annot* pAnnot, | 969 FX_BOOL CPDFSDK_XFAAnnotHandler::OnKeyUp(CPDFSDK_Annot* pAnnot, |
1033 int nKeyCode, | 970 int nKeyCode, |
1034 int nFlag) { | 971 int nFlag) { |
1035 if (!pAnnot) | 972 if (!pAnnot) |
1036 return FALSE; | 973 return FALSE; |
1037 | 974 |
1038 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); | 975 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); |
1039 ASSERT(pWidgetHandler != NULL); | 976 return pWidgetHandler->OnKeyUp(pAnnot->GetXFAWidget(), nKeyCode, |
1040 | |
1041 FX_BOOL bRet = FALSE; | |
1042 bRet = pWidgetHandler->OnKeyUp(pAnnot->GetXFAWidget(), nKeyCode, | |
1043 GetFWLFlags(nFlag)); | 977 GetFWLFlags(nFlag)); |
1044 | |
1045 return bRet; | |
1046 } | 978 } |
1047 | 979 |
1048 FX_BOOL CPDFSDK_XFAAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, | 980 FX_BOOL CPDFSDK_XFAAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, |
1049 FX_DWORD nFlag) { | 981 FX_DWORD nFlag) { |
1050 return TRUE; | 982 return TRUE; |
1051 } | 983 } |
1052 | 984 |
1053 FX_BOOL CPDFSDK_XFAAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, | 985 FX_BOOL CPDFSDK_XFAAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, |
1054 FX_DWORD nFlag) { | 986 FX_DWORD nFlag) { |
1055 return TRUE; | 987 return TRUE; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 | 1099 |
1168 CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot() { | 1100 CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot() { |
1169 if (m_pos < m_iteratorAnnotList.size()) | 1101 if (m_pos < m_iteratorAnnotList.size()) |
1170 return m_iteratorAnnotList[m_iteratorAnnotList.size() - ++m_pos]; | 1102 return m_iteratorAnnotList[m_iteratorAnnotList.size() - ++m_pos]; |
1171 return nullptr; | 1103 return nullptr; |
1172 } | 1104 } |
1173 | 1105 |
1174 CPDFSDK_Annot* CPDFSDK_AnnotIterator::Next() { | 1106 CPDFSDK_Annot* CPDFSDK_AnnotIterator::Next() { |
1175 return m_bReverse ? PrevAnnot() : NextAnnot(); | 1107 return m_bReverse ? PrevAnnot() : NextAnnot(); |
1176 } | 1108 } |
OLD | NEW |