Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Side by Side Diff: fpdfsdk/fsdk_annothandler.cpp

Issue 1948583002: Remove FWL_WGTHITTEST_* defines in favour of enum class. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/DEPS ('k') | xfa.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/include/fsdk_annothandler.h" 7 #include "fpdfsdk/include/fsdk_annothandler.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
11 11
12 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" 12 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h"
13 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" 13 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
14 #include "fpdfsdk/formfiller/cffl_formfiller.h" 14 #include "fpdfsdk/formfiller/cffl_formfiller.h"
15 #include "fpdfsdk/include/fsdk_define.h" 15 #include "fpdfsdk/include/fsdk_define.h"
16 #include "fpdfsdk/include/fsdk_mgr.h" 16 #include "fpdfsdk/include/fsdk_mgr.h"
17 17
18 #ifdef PDF_ENABLE_XFA 18 #ifdef PDF_ENABLE_XFA
19 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h" 19 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h"
20 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_page.h" 20 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_page.h"
21 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_util.h" 21 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_util.h"
22 #include "xfa/fwl/core/include/fwl_widgethit.h"
22 #include "xfa/fxfa/include/xfa_ffwidget.h" 23 #include "xfa/fxfa/include/xfa_ffwidget.h"
23 #include "xfa/fxgraphics/include/cfx_graphics.h" 24 #include "xfa/fxgraphics/include/cfx_graphics.h"
24 #endif // PDF_ENABLE_XFA 25 #endif // PDF_ENABLE_XFA
25 26
26 CPDFSDK_AnnotHandlerMgr::CPDFSDK_AnnotHandlerMgr(CPDFDoc_Environment* pApp) { 27 CPDFSDK_AnnotHandlerMgr::CPDFSDK_AnnotHandlerMgr(CPDFDoc_Environment* pApp) {
27 m_pApp = pApp; 28 m_pApp = pApp;
28 29
29 CPDFSDK_BFAnnotHandler* pHandler = new CPDFSDK_BFAnnotHandler(m_pApp); 30 CPDFSDK_BFAnnotHandler* pHandler = new CPDFSDK_BFAnnotHandler(m_pApp);
30 pHandler->SetFormFiller(m_pApp->GetIFormFiller()); 31 pHandler->SetFormFiller(m_pApp->GetIFormFiller());
31 RegisterAnnotHandler(pHandler); 32 RegisterAnnotHandler(pHandler);
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 CPDFSDK_Annot* pAnnot, 717 CPDFSDK_Annot* pAnnot,
717 const CFX_FloatPoint& point) { 718 const CFX_FloatPoint& point) {
718 ASSERT(pPageView); 719 ASSERT(pPageView);
719 ASSERT(pAnnot); 720 ASSERT(pAnnot);
720 721
721 CFX_FloatRect rect = GetViewBBox(pPageView, pAnnot); 722 CFX_FloatRect rect = GetViewBBox(pPageView, pAnnot);
722 return rect.Contains(point.x, point.y); 723 return rect.Contains(point.x, point.y);
723 } 724 }
724 725
725 #ifdef PDF_ENABLE_XFA 726 #ifdef PDF_ENABLE_XFA
726 #define FWL_WGTHITTEST_Unknown 0
727 #define FWL_WGTHITTEST_Client 1 // arrow
728 #define FWL_WGTHITTEST_Titlebar 11 // caption
729 #define FWL_WGTHITTEST_HScrollBar 15
730 #define FWL_WGTHITTEST_VScrollBar 16
731 #define FWL_WGTHITTEST_Border 17
732 #define FWL_WGTHITTEST_Edit 19
733 #define FWL_WGTHITTEST_HyperLink 20
734 727
735 CPDFSDK_XFAAnnotHandler::CPDFSDK_XFAAnnotHandler(CPDFDoc_Environment* pApp) 728 CPDFSDK_XFAAnnotHandler::CPDFSDK_XFAAnnotHandler(CPDFDoc_Environment* pApp)
736 : m_pApp(pApp) {} 729 : m_pApp(pApp) {}
737 730
738 CPDFSDK_Annot* CPDFSDK_XFAAnnotHandler::NewAnnot(CXFA_FFWidget* pAnnot, 731 CPDFSDK_Annot* CPDFSDK_XFAAnnotHandler::NewAnnot(CXFA_FFWidget* pAnnot,
739 CPDFSDK_PageView* pPage) { 732 CPDFSDK_PageView* pPage) {
740 CPDFSDK_Document* pSDKDoc = m_pApp->GetSDKDocument(); 733 CPDFSDK_Document* pSDKDoc = m_pApp->GetSDKDocument();
741 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pSDKDoc->GetInterForm(); 734 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pSDKDoc->GetInterForm();
742 CPDFSDK_XFAWidget* pWidget = new CPDFSDK_XFAWidget(pAnnot, pPage, pInterForm); 735 CPDFSDK_XFAWidget* pWidget = new CPDFSDK_XFAWidget(pAnnot, pPage, pInterForm);
743 pInterForm->AddXFAMap(pAnnot, pWidget); 736 pInterForm->AddXFAMap(pAnnot, pWidget);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 return FALSE; 811 return FALSE;
819 812
820 CXFA_FFDocView* pDocView = pDoc->GetXFADocView(); 813 CXFA_FFDocView* pDocView = pDoc->GetXFADocView();
821 if (!pDocView) 814 if (!pDocView)
822 return FALSE; 815 return FALSE;
823 816
824 CXFA_FFWidgetHandler* pWidgetHandler = pDocView->GetWidgetHandler(); 817 CXFA_FFWidgetHandler* pWidgetHandler = pDocView->GetWidgetHandler();
825 if (!pWidgetHandler) 818 if (!pWidgetHandler)
826 return FALSE; 819 return FALSE;
827 820
828 uint32_t dwHitTest = 821 FWL_WidgetHit dwHitTest =
829 pWidgetHandler->OnHitTest(pAnnot->GetXFAWidget(), point.x, point.y); 822 pWidgetHandler->OnHitTest(pAnnot->GetXFAWidget(), point.x, point.y);
830 return (dwHitTest != FWL_WGTHITTEST_Unknown); 823 return dwHitTest != FWL_WidgetHit::Unknown;
831 } 824 }
832 825
833 void CPDFSDK_XFAAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView, 826 void CPDFSDK_XFAAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView,
834 CPDFSDK_Annot* pAnnot, 827 CPDFSDK_Annot* pAnnot,
835 uint32_t nFlag) { 828 uint32_t nFlag) {
836 if (!pPageView || !pAnnot) 829 if (!pPageView || !pAnnot)
837 return; 830 return;
838 CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 831 CXFA_FFWidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
839 pWidgetHandler->OnMouseEnter(pAnnot->GetXFAWidget()); 832 pWidgetHandler->OnMouseEnter(pAnnot->GetXFAWidget());
840 } 833 }
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 1093
1101 CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot() { 1094 CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot() {
1102 if (m_pos < m_iteratorAnnotList.size()) 1095 if (m_pos < m_iteratorAnnotList.size())
1103 return m_iteratorAnnotList[m_iteratorAnnotList.size() - ++m_pos]; 1096 return m_iteratorAnnotList[m_iteratorAnnotList.size() - ++m_pos];
1104 return nullptr; 1097 return nullptr;
1105 } 1098 }
1106 1099
1107 CPDFSDK_Annot* CPDFSDK_AnnotIterator::Next() { 1100 CPDFSDK_Annot* CPDFSDK_AnnotIterator::Next() {
1108 return m_bReverse ? PrevAnnot() : NextAnnot(); 1101 return m_bReverse ? PrevAnnot() : NextAnnot();
1109 } 1102 }
OLDNEW
« no previous file with comments | « fpdfsdk/DEPS ('k') | xfa.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698