From 633f1e436e1cced874a44a797f02c452eb3cf958 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 1 Sep 2015 15:01:58 -0700 Subject: Remove IPDFSDK_AnnotHandler interface. It's pointless to have an abstract interface and its only concrete implementation defined in the same header. We can de-virtualize along the way and get a small savings. Rename CPDFSDK_BFAnnotHandler along the way, since its the only kind of AnnotHandler, and I can't imagine what BF stands for. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1313733013 . --- fpdfsdk/include/fsdk_annothandler.h | 192 +++++++++--------------------------- fpdfsdk/src/fsdk_annothandler.cpp | 180 ++++++++++++++++----------------- 2 files changed, 134 insertions(+), 238 deletions(-) diff --git a/fpdfsdk/include/fsdk_annothandler.h b/fpdfsdk/include/fsdk_annothandler.h index 369a080a9b..5edb504c40 100644 --- a/fpdfsdk/include/fsdk_annothandler.h +++ b/fpdfsdk/include/fsdk_annothandler.h @@ -21,188 +21,86 @@ class CPDF_Matrix; class CPDF_Point; class CPDF_Rect; -class IPDFSDK_AnnotHandler { +class CPDFSDK_AnnotHandler { public: - virtual ~IPDFSDK_AnnotHandler() {} - - virtual CFX_ByteString GetType() = 0; - - virtual CFX_ByteString GetName() = 0; - - virtual FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot) = 0; - - virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, - CPDFSDK_PageView* pPage) = 0; - - virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot) = 0; - - virtual void DeleteAnnot(CPDFSDK_Annot* pAnnot) = 0; - - virtual CPDF_Rect GetViewBBox(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot) = 0; - - virtual FX_BOOL HitTest(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - const CPDF_Point& point) = 0; - - virtual void OnDraw(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - CFX_RenderDevice* pDevice, - CPDF_Matrix* pUser2Device, - FX_DWORD dwFlags) = 0; - - virtual void OnDrawSleep(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - CFX_RenderDevice* pDevice, - CPDF_Matrix* pUser2Device, - const CPDF_Rect& rcWindow, - FX_DWORD dwFlags) = 0; - - virtual void OnCreate(CPDFSDK_Annot* pAnnot) = 0; - - virtual void OnLoad(CPDFSDK_Annot* pAnnot) = 0; - - virtual void OnDelete(CPDFSDK_Annot* pAnnot) = 0; - - virtual void OnRelease(CPDFSDK_Annot* pAnnot) = 0; - - virtual void OnMouseEnter(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlag) = 0; - virtual void OnMouseExit(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlag) = 0; - - virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlags, - const CPDF_Point& point) = 0; - virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlags, - const CPDF_Point& point) = 0; - virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlags, - const CPDF_Point& point) = 0; - virtual FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlags, - const CPDF_Point& point) = 0; - virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlags, - short zDelta, - const CPDF_Point& point) = 0; - virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlags, - const CPDF_Point& point) = 0; - virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlags, - const CPDF_Point& point) = 0; - virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlags, - const CPDF_Point& point) = 0; - // by wjm. - virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, - FX_DWORD nChar, - FX_DWORD nFlags) = 0; - virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) = 0; - virtual FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) = 0; - - virtual void OnDeSelected(CPDFSDK_Annot* pAnnot) = 0; - virtual void OnSelected(CPDFSDK_Annot* pAnnot) = 0; - - virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) = 0; - virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) = 0; -}; - -class CPDFSDK_BFAnnotHandler : public IPDFSDK_AnnotHandler { - public: - CPDFSDK_BFAnnotHandler(CPDFDoc_Environment* pApp) - : m_pApp(pApp), m_pFormFiller(NULL) {} - ~CPDFSDK_BFAnnotHandler() override {} - - // IPDFSDK_AnnotHandler - CFX_ByteString GetType() override { return CFX_ByteString("Widget"); } - CFX_ByteString GetName() override { return CFX_ByteString("WidgetHandler"); } - FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot) override; - CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) override; - void ReleaseAnnot(CPDFSDK_Annot* pAnnot) override; - void DeleteAnnot(CPDFSDK_Annot* pAnnot) override {} - CPDF_Rect GetViewBBox(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot) override; + explicit CPDFSDK_AnnotHandler(CPDFDoc_Environment* pApp) + : m_pApp(pApp), m_pFormFiller(nullptr) {} + + ~CPDFSDK_AnnotHandler() {} + + CFX_ByteString GetType() { return CFX_ByteString("Widget"); } + CFX_ByteString GetName() { return CFX_ByteString("WidgetHandler"); } + FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot); + CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage); + void ReleaseAnnot(CPDFSDK_Annot* pAnnot); + void DeleteAnnot(CPDFSDK_Annot* pAnnot) {} + CPDF_Rect GetViewBBox(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot); FX_BOOL HitTest(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, - const CPDF_Point& point) override; + const CPDF_Point& point); void OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, - FX_DWORD dwFlags) override; + FX_DWORD dwFlags); void OnDrawSleep(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, const CPDF_Rect& rcWindow, - FX_DWORD dwFlags) override {} - void OnCreate(CPDFSDK_Annot* pAnnot) override; - void OnLoad(CPDFSDK_Annot* pAnnot) override; - void OnDelete(CPDFSDK_Annot* pAnnot) override {} - void OnRelease(CPDFSDK_Annot* pAnnot) override {} + FX_DWORD dwFlags) {} + void OnCreate(CPDFSDK_Annot* pAnnot); + void OnLoad(CPDFSDK_Annot* pAnnot); + void OnDelete(CPDFSDK_Annot* pAnnot) {} + void OnRelease(CPDFSDK_Annot* pAnnot) {} void OnMouseEnter(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, - FX_DWORD nFlag) override; + FX_DWORD nFlag); void OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, - FX_DWORD nFlag) override; + FX_DWORD nFlag); FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point) override; + const CPDF_Point& point); FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point) override; + const CPDF_Point& point); FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point) override; + const CPDF_Point& point); FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point) override; + const CPDF_Point& point); FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, - const CPDF_Point& point) override; + const CPDF_Point& point); FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point) override; + const CPDF_Point& point); FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point) override; + const CPDF_Point& point); FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, - const CPDF_Point& point) override { + const CPDF_Point& point) { return FALSE; } - FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, - FX_DWORD nChar, - FX_DWORD nFlags) override; - FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; - FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; - void OnDeSelected(CPDFSDK_Annot* pAnnot) override {} - void OnSelected(CPDFSDK_Annot* pAnnot) override {} - FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) override; - FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) override; + FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags); + FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag); + FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag); + void OnDeSelected(CPDFSDK_Annot* pAnnot) {} + void OnSelected(CPDFSDK_Annot* pAnnot) {} + FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag); + FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag); void SetFormFiller(CFFL_IFormFiller* pFiller) { m_pFormFiller = pFiller; } CFFL_IFormFiller* GetFormFiller() { return m_pFormFiller; } @@ -212,16 +110,16 @@ class CPDFSDK_BFAnnotHandler : public IPDFSDK_AnnotHandler { CFFL_IFormFiller* m_pFormFiller; }; -#define CBA_AnnotHandlerArray CFX_ArrayTemplate +using CBA_AnnotHandlerArray = CFX_ArrayTemplate; + class CPDFSDK_AnnotHandlerMgr { public: // Destroy the handler explicit CPDFSDK_AnnotHandlerMgr(CPDFDoc_Environment* pApp); virtual ~CPDFSDK_AnnotHandlerMgr(); - public: - void RegisterAnnotHandler(IPDFSDK_AnnotHandler* pAnnotHandler); - void UnRegisterAnnotHandler(IPDFSDK_AnnotHandler* pAnnotHandler); + void RegisterAnnotHandler(CPDFSDK_AnnotHandler* pAnnotHandler); + void UnRegisterAnnotHandler(CPDFSDK_AnnotHandler* pAnnotHandler); virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView); @@ -230,8 +128,7 @@ class CPDFSDK_AnnotHandlerMgr { virtual void Annot_OnCreate(CPDFSDK_Annot* pAnnot); virtual void Annot_OnLoad(CPDFSDK_Annot* pAnnot); - public: - IPDFSDK_AnnotHandler* GetAnnotHandler(CPDFSDK_Annot* pAnnot) const; + CPDFSDK_AnnotHandler* GetAnnotHandler(CPDFSDK_Annot* pAnnot) const; virtual void Annot_OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, @@ -294,12 +191,11 @@ class CPDFSDK_AnnotHandlerMgr { const CPDF_Point& point); private: - IPDFSDK_AnnotHandler* GetAnnotHandler(const CFX_ByteString& sType) const; + CPDFSDK_AnnotHandler* GetAnnotHandler(const CFX_ByteString& sType) const; CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pSDKAnnot, FX_BOOL bNext); - private: CBA_AnnotHandlerArray m_Handlers; - std::map m_mapType2Handler; + std::map m_mapType2Handler; CPDFDoc_Environment* m_pApp; }; diff --git a/fpdfsdk/src/fsdk_annothandler.cpp b/fpdfsdk/src/fsdk_annothandler.cpp index bb999e1f08..f1b6153701 100644 --- a/fpdfsdk/src/fsdk_annothandler.cpp +++ b/fpdfsdk/src/fsdk_annothandler.cpp @@ -12,14 +12,14 @@ CPDFSDK_AnnotHandlerMgr::CPDFSDK_AnnotHandlerMgr(CPDFDoc_Environment* pApp) { m_pApp = pApp; - CPDFSDK_BFAnnotHandler* pHandler = new CPDFSDK_BFAnnotHandler(m_pApp); + CPDFSDK_AnnotHandler* pHandler = new CPDFSDK_AnnotHandler(m_pApp); pHandler->SetFormFiller(m_pApp->GetIFormFiller()); RegisterAnnotHandler(pHandler); } CPDFSDK_AnnotHandlerMgr::~CPDFSDK_AnnotHandlerMgr() { for (int i = 0; i < m_Handlers.GetSize(); i++) { - IPDFSDK_AnnotHandler* pHandler = m_Handlers.GetAt(i); + CPDFSDK_AnnotHandler* pHandler = m_Handlers.GetAt(i); delete pHandler; } m_Handlers.RemoveAll(); @@ -27,7 +27,7 @@ CPDFSDK_AnnotHandlerMgr::~CPDFSDK_AnnotHandlerMgr() { } void CPDFSDK_AnnotHandlerMgr::RegisterAnnotHandler( - IPDFSDK_AnnotHandler* pAnnotHandler) { + CPDFSDK_AnnotHandler* pAnnotHandler) { ASSERT(!GetAnnotHandler(pAnnotHandler->GetType())); m_Handlers.Add(pAnnotHandler); @@ -35,7 +35,7 @@ void CPDFSDK_AnnotHandlerMgr::RegisterAnnotHandler( } void CPDFSDK_AnnotHandlerMgr::UnRegisterAnnotHandler( - IPDFSDK_AnnotHandler* pAnnotHandler) { + CPDFSDK_AnnotHandler* pAnnotHandler) { m_mapType2Handler.erase(pAnnotHandler->GetType()); for (int i = 0, sz = m_Handlers.GetSize(); i < sz; i++) { if (m_Handlers.GetAt(i) == pAnnotHandler) { @@ -50,7 +50,7 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::NewAnnot(CPDF_Annot* pAnnot, ASSERT(pAnnot != NULL); ASSERT(pPageView != NULL); - if (IPDFSDK_AnnotHandler* pAnnotHandler = + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot->GetSubType())) { return pAnnotHandler->NewAnnot(pAnnot, pPageView); } @@ -63,7 +63,7 @@ void CPDFSDK_AnnotHandlerMgr::ReleaseAnnot(CPDFSDK_Annot* pAnnot) { pAnnot->GetPDFPage(); - if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { pAnnotHandler->OnRelease(pAnnot); pAnnotHandler->ReleaseAnnot(pAnnot); } else { @@ -80,7 +80,7 @@ void CPDFSDK_AnnotHandlerMgr::Annot_OnCreate(CPDFSDK_Annot* pAnnot) { pPDFAnnot->GetAnnotDict()->SetAtString("M", curTime.ToPDFDateTimeString()); pPDFAnnot->GetAnnotDict()->SetAtNumber("F", 0); - if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { pAnnotHandler->OnCreate(pAnnot); } } @@ -88,12 +88,12 @@ void CPDFSDK_AnnotHandlerMgr::Annot_OnCreate(CPDFSDK_Annot* pAnnot) { void CPDFSDK_AnnotHandlerMgr::Annot_OnLoad(CPDFSDK_Annot* pAnnot) { ASSERT(pAnnot != NULL); - if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { pAnnotHandler->OnLoad(pAnnot); } } -IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler( +CPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler( CPDFSDK_Annot* pAnnot) const { ASSERT(pAnnot != NULL); @@ -103,7 +103,7 @@ IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler( return GetAnnotHandler(pPDFAnnot->GetSubType()); } -IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler( +CPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler( const CFX_ByteString& sType) const { auto it = m_mapType2Handler.find(sType); return it != m_mapType2Handler.end() ? it->second : nullptr; @@ -116,7 +116,7 @@ void CPDFSDK_AnnotHandlerMgr::Annot_OnDraw(CPDFSDK_PageView* pPageView, FX_DWORD dwFlags) { ASSERT(pAnnot != NULL); - if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { pAnnotHandler->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); } else { pAnnot->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL); @@ -130,7 +130,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown( const CPDF_Point& point) { ASSERT(pAnnot != NULL); - if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { return pAnnotHandler->OnLButtonDown(pPageView, pAnnot, nFlags, point); } return FALSE; @@ -141,7 +141,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonUp(CPDFSDK_PageView* pPageView, const CPDF_Point& point) { ASSERT(pAnnot != NULL); - if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { return pAnnotHandler->OnLButtonUp(pPageView, pAnnot, nFlags, point); } return FALSE; @@ -153,7 +153,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDblClk( const CPDF_Point& point) { ASSERT(pAnnot != NULL); - if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { return pAnnotHandler->OnLButtonDblClk(pPageView, pAnnot, nFlags, point); } return FALSE; @@ -164,7 +164,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseMove(CPDFSDK_PageView* pPageView, const CPDF_Point& point) { ASSERT(pAnnot != NULL); - if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { return pAnnotHandler->OnMouseMove(pPageView, pAnnot, nFlags, point); } return FALSE; @@ -176,7 +176,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseWheel(CPDFSDK_PageView* pPageView, const CPDF_Point& point) { ASSERT(pAnnot != NULL); - if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { return pAnnotHandler->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta, point); } @@ -189,7 +189,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonDown( const CPDF_Point& point) { ASSERT(pAnnot != NULL); - if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { return pAnnotHandler->OnRButtonDown(pPageView, pAnnot, nFlags, point); } return FALSE; @@ -200,7 +200,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonUp(CPDFSDK_PageView* pPageView, const CPDF_Point& point) { ASSERT(pAnnot != NULL); - if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { return pAnnotHandler->OnRButtonUp(pPageView, pAnnot, nFlags, point); } return FALSE; @@ -211,7 +211,7 @@ void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseEnter(CPDFSDK_PageView* pPageView, FX_DWORD nFlag) { ASSERT(pAnnot != NULL); - if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { pAnnotHandler->OnMouseEnter(pPageView, pAnnot, nFlag); } return; @@ -222,7 +222,7 @@ void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseExit(CPDFSDK_PageView* pPageView, FX_DWORD nFlag) { ASSERT(pAnnot != NULL); - if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { pAnnotHandler->OnMouseExit(pPageView, pAnnot, nFlag); } return; @@ -231,7 +231,7 @@ void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseExit(CPDFSDK_PageView* pPageView, FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags) { - if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { return pAnnotHandler->OnChar(pAnnot, nChar, nFlags); } return FALSE; @@ -255,7 +255,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, } } - if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { return pAnnotHandler->OnKeyDown(pAnnot, nKeyCode, nFlag); } return FALSE; @@ -270,7 +270,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) { ASSERT(pAnnot != NULL); - if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { if (pAnnotHandler->OnSetFocus(pAnnot, nFlag)) { CPDFSDK_PageView* pPage = pAnnot->GetPageView(); pPage->GetSDKDocument(); @@ -283,7 +283,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) { ASSERT(pAnnot); - if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) return pAnnotHandler->OnKillFocus(pAnnot, nFlag); return FALSE; @@ -293,7 +293,7 @@ CPDF_Rect CPDFSDK_AnnotHandlerMgr::Annot_OnGetViewBBox( CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) { ASSERT(pAnnot); - if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) return pAnnotHandler->GetViewBBox(pPageView, pAnnot); return pAnnot->GetRect(); @@ -303,7 +303,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnHitTest(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point) { ASSERT(pAnnot); - if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { + if (CPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { if (pAnnotHandler->CanAnswer(pAnnot)) return pAnnotHandler->HitTest(pPageView, pAnnot, point); } @@ -316,7 +316,7 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot, return bNext ? ai.GetNextAnnot(pSDKAnnot) : ai.GetPrevAnnot(pSDKAnnot); } -FX_BOOL CPDFSDK_BFAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot) { +FX_BOOL CPDFSDK_AnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot) { ASSERT(pAnnot->GetType() == "Widget"); if (pAnnot->GetSubType() == BFFT_SIGNATURE) return FALSE; @@ -339,8 +339,8 @@ FX_BOOL CPDFSDK_BFAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot) { (dwPermissions & FPDFPERM_ANNOT_FORM); } -CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(CPDF_Annot* pAnnot, - CPDFSDK_PageView* pPage) { +CPDFSDK_Annot* CPDFSDK_AnnotHandler::NewAnnot(CPDF_Annot* pAnnot, + CPDFSDK_PageView* pPage) { CPDFSDK_Document* pSDKDoc = m_pApp->GetSDKDocument(); CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pSDKDoc->GetInterForm(); CPDF_FormControl* pCtrl = CPDFSDK_Widget::GetFormControl( @@ -357,7 +357,7 @@ CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(CPDF_Annot* pAnnot, return pWidget; } -void CPDFSDK_BFAnnotHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot) { +void CPDFSDK_AnnotHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot) { ASSERT(pAnnot != NULL); if (m_pFormFiller) @@ -373,11 +373,11 @@ void CPDFSDK_BFAnnotHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot) { delete pWidget; } -void CPDFSDK_BFAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - CFX_RenderDevice* pDevice, - CPDF_Matrix* pUser2Device, - FX_DWORD dwFlags) { +void CPDFSDK_AnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot, + CFX_RenderDevice* pDevice, + CPDF_Matrix* pUser2Device, + FX_DWORD dwFlags) { ASSERT(pAnnot != NULL); CFX_ByteString sSubType = pAnnot->GetSubType(); @@ -390,9 +390,9 @@ void CPDFSDK_BFAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, } } -void CPDFSDK_BFAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlag) { +void CPDFSDK_AnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot, + FX_DWORD nFlag) { ASSERT(pAnnot != NULL); CFX_ByteString sSubType = pAnnot->GetSubType(); @@ -402,9 +402,9 @@ void CPDFSDK_BFAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView, m_pFormFiller->OnMouseEnter(pPageView, pAnnot, nFlag); } } -void CPDFSDK_BFAnnotHandler::OnMouseExit(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlag) { +void CPDFSDK_AnnotHandler::OnMouseExit(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot, + FX_DWORD nFlag) { ASSERT(pAnnot != NULL); CFX_ByteString sSubType = pAnnot->GetSubType(); @@ -414,10 +414,10 @@ void CPDFSDK_BFAnnotHandler::OnMouseExit(CPDFSDK_PageView* pPageView, m_pFormFiller->OnMouseExit(pPageView, pAnnot, nFlag); } } -FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlags, - const CPDF_Point& point) { +FX_BOOL CPDFSDK_AnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot, + FX_DWORD nFlags, + const CPDF_Point& point) { ASSERT(pAnnot != NULL); CFX_ByteString sSubType = pAnnot->GetSubType(); @@ -430,10 +430,10 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView, return FALSE; } -FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlags, - const CPDF_Point& point) { +FX_BOOL CPDFSDK_AnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot, + FX_DWORD nFlags, + const CPDF_Point& point) { ASSERT(pAnnot != NULL); CFX_ByteString sSubType = pAnnot->GetSubType(); @@ -446,10 +446,10 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView, return FALSE; } -FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlags, - const CPDF_Point& point) { +FX_BOOL CPDFSDK_AnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot, + FX_DWORD nFlags, + const CPDF_Point& point) { ASSERT(pAnnot != NULL); CFX_ByteString sSubType = pAnnot->GetSubType(); @@ -462,10 +462,10 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView, return FALSE; } -FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlags, - const CPDF_Point& point) { +FX_BOOL CPDFSDK_AnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot, + FX_DWORD nFlags, + const CPDF_Point& point) { ASSERT(pAnnot != NULL); CFX_ByteString sSubType = pAnnot->GetSubType(); @@ -478,11 +478,11 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView, return FALSE; } -FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlags, - short zDelta, - const CPDF_Point& point) { +FX_BOOL CPDFSDK_AnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot, + FX_DWORD nFlags, + short zDelta, + const CPDF_Point& point) { ASSERT(pAnnot != NULL); CFX_ByteString sSubType = pAnnot->GetSubType(); @@ -496,10 +496,10 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView, return FALSE; } -FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlags, - const CPDF_Point& point) { +FX_BOOL CPDFSDK_AnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot, + FX_DWORD nFlags, + const CPDF_Point& point) { ASSERT(pAnnot != NULL); CFX_ByteString sSubType = pAnnot->GetSubType(); @@ -511,10 +511,10 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView, return FALSE; } -FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - FX_DWORD nFlags, - const CPDF_Point& point) { +FX_BOOL CPDFSDK_AnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot, + FX_DWORD nFlags, + const CPDF_Point& point) { ASSERT(pAnnot != NULL); CFX_ByteString sSubType = pAnnot->GetSubType(); @@ -527,9 +527,9 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView, return FALSE; } -FX_BOOL CPDFSDK_BFAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, - FX_DWORD nChar, - FX_DWORD nFlags) { +FX_BOOL CPDFSDK_AnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, + FX_DWORD nChar, + FX_DWORD nFlags) { ASSERT(pAnnot != NULL); CFX_ByteString sSubType = pAnnot->GetSubType(); @@ -542,9 +542,9 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, return FALSE; } -FX_BOOL CPDFSDK_BFAnnotHandler::OnKeyDown(CPDFSDK_Annot* pAnnot, - int nKeyCode, - int nFlag) { +FX_BOOL CPDFSDK_AnnotHandler::OnKeyDown(CPDFSDK_Annot* pAnnot, + int nKeyCode, + int nFlag) { ASSERT(pAnnot != NULL); CFX_ByteString sSubType = pAnnot->GetSubType(); @@ -557,12 +557,12 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnKeyDown(CPDFSDK_Annot* pAnnot, return FALSE; } -FX_BOOL CPDFSDK_BFAnnotHandler::OnKeyUp(CPDFSDK_Annot* pAnnot, - int nKeyCode, - int nFlag) { +FX_BOOL CPDFSDK_AnnotHandler::OnKeyUp(CPDFSDK_Annot* pAnnot, + int nKeyCode, + int nFlag) { return FALSE; } -void CPDFSDK_BFAnnotHandler::OnCreate(CPDFSDK_Annot* pAnnot) { +void CPDFSDK_AnnotHandler::OnCreate(CPDFSDK_Annot* pAnnot) { ASSERT(pAnnot != NULL); CFX_ByteString sSubType = pAnnot->GetSubType(); @@ -573,7 +573,7 @@ void CPDFSDK_BFAnnotHandler::OnCreate(CPDFSDK_Annot* pAnnot) { } } -void CPDFSDK_BFAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot) { +void CPDFSDK_AnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot) { ASSERT(pAnnot != NULL); CFX_ByteString sSubType = pAnnot->GetSubType(); @@ -598,8 +598,8 @@ void CPDFSDK_BFAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot) { } } -FX_BOOL CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, - FX_DWORD nFlag) { +FX_BOOL CPDFSDK_AnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, + FX_DWORD nFlag) { ASSERT(pAnnot != NULL); CFX_ByteString sSubType = pAnnot->GetSubType(); @@ -611,8 +611,8 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, return TRUE; } -FX_BOOL CPDFSDK_BFAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, - FX_DWORD nFlag) { +FX_BOOL CPDFSDK_AnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, + FX_DWORD nFlag) { ASSERT(pAnnot != NULL); CFX_ByteString sSubType = pAnnot->GetSubType(); @@ -625,8 +625,8 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, return TRUE; } -CPDF_Rect CPDFSDK_BFAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot) { +CPDF_Rect CPDFSDK_AnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot) { ASSERT(pAnnot != NULL); CFX_ByteString sSubType = pAnnot->GetSubType(); @@ -639,9 +639,9 @@ CPDF_Rect CPDFSDK_BFAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView, return CPDF_Rect(0, 0, 0, 0); } -FX_BOOL CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - const CPDF_Point& point) { +FX_BOOL CPDFSDK_AnnotHandler::HitTest(CPDFSDK_PageView* pPageView, + CPDFSDK_Annot* pAnnot, + const CPDF_Point& point) { ASSERT(pPageView); ASSERT(pAnnot); -- cgit v1.2.3