From 35512aa7e4acc3ceb9c6aef5d61eebfb4ae802af Mon Sep 17 00:00:00 2001 From: jaepark Date: Mon, 29 Aug 2016 17:15:08 -0700 Subject: Display content of the annotation when mouse hover. Each annotation has its contents, and users should be able to see the contents. In this patch, PDFium creates a Popup annotation for each annotation and stores the author and the content. When a user mouse hover on the annotation, PDFium draws the corresponding Popup annotation and displays the content. Also, roll DEPS for testing/corpus to 5867fa6. BUG=62625 Review-Url: https://codereview.chromium.org/2273893002 --- fpdfsdk/cpdfsdk_baannot.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'fpdfsdk/cpdfsdk_baannot.cpp') diff --git a/fpdfsdk/cpdfsdk_baannot.cpp b/fpdfsdk/cpdfsdk_baannot.cpp index d1d3a0f63a..5e3e14572c 100644 --- a/fpdfsdk/cpdfsdk_baannot.cpp +++ b/fpdfsdk/cpdfsdk_baannot.cpp @@ -23,6 +23,10 @@ CPDF_Annot* CPDFSDK_BAAnnot::GetPDFAnnot() const { return m_pAnnot; } +CPDF_Annot* CPDFSDK_BAAnnot::GetPDFPopupAnnot() const { + return m_pAnnot->GetPopupAnnot(); +} + CPDF_Dictionary* CPDFSDK_BAAnnot::GetAnnotDict() const { return m_pAnnot->GetAnnotDict(); } @@ -396,3 +400,8 @@ void CPDFSDK_BAAnnot::Annot_OnDraw(CFX_RenderDevice* pDevice, m_pAnnot->DrawAppearance(m_pPageView->GetPDFPage(), pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); } + +void CPDFSDK_BAAnnot::SetOpenState(bool bOpenState) { + if (CPDF_Annot* pAnnot = m_pAnnot->GetPopupAnnot()) + pAnnot->SetOpenState(bOpenState); +} -- cgit v1.2.3