diff options
Diffstat (limited to 'xfa/fwl/core')
-rw-r--r-- | xfa/fwl/core/fwl_appimp.cpp | 39 | ||||
-rw-r--r-- | xfa/fwl/core/fwl_appimp.h | 26 | ||||
-rw-r--r-- | xfa/fwl/core/fwl_formimp.cpp | 35 | ||||
-rw-r--r-- | xfa/fwl/core/fwl_noteimp.cpp | 70 | ||||
-rw-r--r-- | xfa/fwl/core/fwl_sdadapterimp.cpp | 151 | ||||
-rw-r--r-- | xfa/fwl/core/fwl_sdadapterimp.h | 80 | ||||
-rw-r--r-- | xfa/fwl/core/fwl_timerimp.cpp | 6 | ||||
-rw-r--r-- | xfa/fwl/core/fwl_widgetimp.cpp | 82 | ||||
-rw-r--r-- | xfa/fwl/core/fwl_widgetimp.h | 2 | ||||
-rw-r--r-- | xfa/fwl/core/fwl_widgetmgrimp.cpp | 84 | ||||
-rw-r--r-- | xfa/fwl/core/fwl_widgetmgrimp.h | 34 | ||||
-rw-r--r-- | xfa/fwl/core/ifwl_adapternative.h | 24 | ||||
-rw-r--r-- | xfa/fwl/core/ifwl_adapterthreadmgr.h | 22 | ||||
-rw-r--r-- | xfa/fwl/core/ifwl_adapterwidgetmgr.h | 79 | ||||
-rw-r--r-- | xfa/fwl/core/ifwl_app.h | 18 | ||||
-rw-r--r-- | xfa/fwl/core/ifwl_widget.h | 2 |
16 files changed, 104 insertions, 650 deletions
diff --git a/xfa/fwl/core/fwl_appimp.cpp b/xfa/fwl/core/fwl_appimp.cpp index 0017aad8ad..ac00cca144 100644 --- a/xfa/fwl/core/fwl_appimp.cpp +++ b/xfa/fwl/core/fwl_appimp.cpp @@ -8,11 +8,11 @@ #include "xfa/fwl/core/fwl_noteimp.h" #include "xfa/fwl/core/fwl_widgetmgrimp.h" -#include "xfa/fwl/core/ifwl_adapterwidgetmgr.h" #include "xfa/fwl/core/ifwl_app.h" #include "xfa/fwl/core/ifwl_widget.h" +#include "xfa/fxfa/app/xfa_fwladapter.h" -IFWL_App* IFWL_App::Create(IFWL_AdapterNative* pAdapter) { +IFWL_App* IFWL_App::Create(CXFA_FFApp* pAdapter) { IFWL_App* pApp = new IFWL_App; pApp->SetImpl(new CFWL_AppImp(pApp, pAdapter)); return pApp; @@ -28,7 +28,7 @@ FWL_ERR IFWL_App::Finalize() { return static_cast<CFWL_AppImp*>(GetImpl())->Finalize(); } -IFWL_AdapterNative* IFWL_App::GetAdapterNative() { +CXFA_FFApp* IFWL_App::GetAdapterNative() { return static_cast<CFWL_AppImp*>(GetImpl())->GetAdapterNative(); } @@ -40,19 +40,19 @@ IFWL_ThemeProvider* IFWL_App::GetThemeProvider() { return static_cast<CFWL_AppImp*>(GetImpl())->GetThemeProvider(); } -FWL_ERR IFWL_App::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { - return static_cast<CFWL_AppImp*>(GetImpl())->SetThemeProvider(pThemeProvider); +void IFWL_App::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { + static_cast<CFWL_AppImp*>(GetImpl())->SetThemeProvider(pThemeProvider); } -FWL_ERR IFWL_App::Exit(int32_t iExitCode) { - return static_cast<CFWL_AppImp*>(GetImpl())->Exit(iExitCode); +void IFWL_App::Exit(int32_t iExitCode) { + static_cast<CFWL_AppImp*>(GetImpl())->Exit(iExitCode); } CFWL_NoteDriver* IFWL_App::GetNoteDriver() const { return static_cast<CFWL_AppImp*>(GetImpl())->GetNoteDriver(); } -CFWL_AppImp::CFWL_AppImp(IFWL_App* pIface, IFWL_AdapterNative* pAdapter) +CFWL_AppImp::CFWL_AppImp(IFWL_App* pIface, CXFA_FFApp* pAdapter) : m_pAdapterNative(pAdapter), m_pThemeProvider(nullptr), m_pNoteDriver(new CFWL_NoteDriver), @@ -72,39 +72,42 @@ FWL_ERR CFWL_AppImp::Finalize() { m_pWidgetMgr.reset(); return FWL_ERR_Succeeded; } -IFWL_AdapterNative* CFWL_AppImp::GetAdapterNative() const { +CXFA_FFApp* CFWL_AppImp::GetAdapterNative() const { return m_pAdapterNative; } -IFWL_AdapterWidgetMgr* FWL_GetAdapterWidgetMgr() { +CXFA_FWLAdapterWidgetMgr* FWL_GetAdapterWidgetMgr() { return static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()) ->GetAdapterWidgetMgr(); } IFWL_WidgetMgr* CFWL_AppImp::GetWidgetMgr() const { return m_pWidgetMgr.get(); } -FWL_ERR CFWL_AppImp::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { +void CFWL_AppImp::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { m_pThemeProvider = pThemeProvider; - return FWL_ERR_Succeeded; } -FWL_ERR CFWL_AppImp::Exit(int32_t iExitCode) { + +void CFWL_AppImp::Exit(int32_t iExitCode) { while (m_pNoteDriver->PopNoteLoop()) { continue; } - return m_pWidgetMgr->GetAdapterWidgetMgr()->Exit(0); } + IFWL_ThemeProvider* CFWL_AppImp::GetThemeProvider() const { return m_pThemeProvider; } -IFWL_AdapterNative* FWL_GetAdapterNative() { + +CXFA_FFApp* FWL_GetAdapterNative() { IFWL_App* pApp = FWL_GetApp(); if (!pApp) return NULL; return pApp->GetAdapterNative(); } -static IFWL_App* _theApp = NULL; + +static IFWL_App* g_theApp = nullptr; IFWL_App* FWL_GetApp() { - return _theApp; + return g_theApp; } + void FWL_SetApp(IFWL_App* pApp) { - _theApp = pApp; + g_theApp = pApp; } diff --git a/xfa/fwl/core/fwl_appimp.h b/xfa/fwl/core/fwl_appimp.h index 8743b54a43..64b7922a15 100644 --- a/xfa/fwl/core/fwl_appimp.h +++ b/xfa/fwl/core/fwl_appimp.h @@ -12,7 +12,7 @@ #include "xfa/fwl/core/fwl_noteimp.h" class CFWL_WidgetMgr; -class IFWL_AdapterNative; +class CXFA_FFApp; class IFWL_App; class IFWL_NoteThread; class IFWL_ThemeProvider; @@ -20,27 +20,25 @@ class IFWL_WidgetMgr; class CFWL_AppImp { public: - CFWL_AppImp(IFWL_App* pIface, IFWL_AdapterNative* pAdapter); - virtual ~CFWL_AppImp(); + CFWL_AppImp(IFWL_App* pIface, CXFA_FFApp* pAdapter); + ~CFWL_AppImp(); IFWL_App* GetInterface() const { return m_pIface; } CFWL_NoteDriver* GetNoteDriver() const { return m_pNoteDriver.get(); } - virtual FWL_ERR Initialize(); - virtual FWL_ERR Finalize(); - virtual IFWL_AdapterNative* GetAdapterNative() const; - virtual IFWL_WidgetMgr* GetWidgetMgr() const; - virtual IFWL_ThemeProvider* GetThemeProvider() const; - virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); - virtual FWL_ERR Exit(int32_t iExitCode = 0); + FWL_ERR Initialize(); + FWL_ERR Finalize(); + CXFA_FFApp* GetAdapterNative() const; + IFWL_WidgetMgr* GetWidgetMgr() const; + IFWL_ThemeProvider* GetThemeProvider() const; + void SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); + void Exit(int32_t iExitCode); - protected: - IFWL_AdapterNative* const m_pAdapterNative; + private: + CXFA_FFApp* const m_pAdapterNative; std::unique_ptr<CFWL_WidgetMgr> m_pWidgetMgr; IFWL_ThemeProvider* m_pThemeProvider; std::unique_ptr<CFWL_NoteDriver> m_pNoteDriver; - - private: IFWL_App* const m_pIface; }; diff --git a/xfa/fwl/core/fwl_formimp.cpp b/xfa/fwl/core/fwl_formimp.cpp index 539a48dde0..78dc8b56a2 100644 --- a/xfa/fwl/core/fwl_formimp.cpp +++ b/xfa/fwl/core/fwl_formimp.cpp @@ -16,7 +16,6 @@ #include "xfa/fwl/core/fwl_noteimp.h" #include "xfa/fwl/core/fwl_widgetimp.h" #include "xfa/fwl/core/fwl_widgetmgrimp.h" -#include "xfa/fwl/core/ifwl_adapterwidgetmgr.h" #include "xfa/fwl/core/ifwl_app.h" #include "xfa/fwl/core/ifwl_themeprovider.h" #include "xfa/fwl/theme/cfwl_widgettp.h" @@ -155,12 +154,9 @@ FWL_ERR CFWL_FormImp::GetClientRect(CFX_RectF& rect) { CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); if (!pWidgetMgr) return FWL_ERR_Indefinite; - IFWL_AdapterWidgetMgr* adapterWidgetMgr = pWidgetMgr->GetAdapterWidgetMgr(); - FX_FLOAT l, t, r, b; - l = t = r = b = 0; - adapterWidgetMgr->GetSystemBorder(l, t, r, b); - rect.Deflate(l, t, r, b); - rect.left = rect.top = 0; + + rect.left = 0; + rect.top = 0; return FWL_ERR_Succeeded; #else FX_FLOAT x = 0; @@ -458,7 +454,6 @@ void CFWL_FormImp::ShowChildWidget(IFWL_Widget* pParent) { IFWL_Widget* pChild = pWidgetMgr->GetWidget(pParent, FWL_WGTRELATION_FirstChild); while (pChild) { - pWidgetMgr->ShowWidget_Native(pChild); ShowChildWidget(pChild); pChild = pWidgetMgr->GetWidget(pChild, FWL_WGTRELATION_NextSibling); } @@ -625,7 +620,6 @@ void CFWL_FormImp::SetWorkAreaRect() { if (!pWidgetMgr) return; m_bSetMaximize = TRUE; - pWidgetMgr->SetMaximize_Native(m_pInterface); Repaint(&m_rtRelative); } void CFWL_FormImp::SetCursor(FX_FLOAT fx, FX_FLOAT fy) {} @@ -778,14 +772,10 @@ void CFWL_FormImp::UpdateIcon() { static_cast<IFWL_FormDP*>(m_pProperties->m_pDataProvider); CFX_DIBitmap* pBigIcon = pData->GetIcon(m_pInterface, TRUE); CFX_DIBitmap* pSmallIcon = pData->GetIcon(m_pInterface, FALSE); - if (pBigIcon && pBigIcon != m_pBigIcon) { + if (pBigIcon) m_pBigIcon = pBigIcon; - pWidgetMgr->SetWidgetIcon_Native(m_pInterface, m_pBigIcon, TRUE); - } - if (pSmallIcon && pSmallIcon != m_pSmallIcon) { + if (pSmallIcon) m_pSmallIcon = pSmallIcon; - pWidgetMgr->SetWidgetIcon_Native(m_pInterface, m_pBigIcon, FALSE); - } } void CFWL_FormImp::UpdateCaption() { CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); @@ -797,7 +787,6 @@ void CFWL_FormImp::UpdateCaption() { return; CFX_WideString text; pData->GetCaption(m_pInterface, text); - pWidgetMgr->SetWidgetCaption_Native(m_pInterface, text.AsStringC()); } void CFWL_FormImp::DoWidthLimit(FX_FLOAT& fLeft, FX_FLOAT& fWidth, @@ -957,10 +946,8 @@ int32_t CFWL_FormImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { m_pOwner->m_bSetMaximize = FALSE; CFWL_MsgSize* pMsg = static_cast<CFWL_MsgSize*>(pMessage); - CFX_RectF rt; - pWidgetMgr->GetWidgetRect_Native(m_pOwner->m_pInterface, rt); - m_pOwner->m_pProperties->m_rtWidget.left = rt.left; - m_pOwner->m_pProperties->m_rtWidget.top = rt.top; + m_pOwner->m_pProperties->m_rtWidget.left = 0; + m_pOwner->m_pProperties->m_rtWidget.top = 0; m_pOwner->m_pProperties->m_rtWidget.width = (FX_FLOAT)pMsg->m_iWidth; m_pOwner->m_pProperties->m_rtWidget.height = (FX_FLOAT)pMsg->m_iHeight; m_pOwner->Update(); @@ -1044,13 +1031,7 @@ void CFWL_FormImpDelegate::OnLButtonUp(CFWL_MsgMouse* pMsg) { m_pOwner->Update(); } m_pOwner->m_bMaximized = !m_pOwner->m_bMaximized; - } else if (pPressedBtn == m_pOwner->m_pMinBox) { - CFWL_WidgetMgr* pWidgetMgr = - static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); - if (!pWidgetMgr) - return; - pWidgetMgr->SetMinimize_Native(m_pOwner->m_pInterface); - } else { + } else if (pPressedBtn != m_pOwner->m_pMinBox) { CFWL_EvtClose eClose; eClose.m_pSrcTarget = m_pOwner->m_pInterface; m_pOwner->DispatchEvent(&eClose); diff --git a/xfa/fwl/core/fwl_noteimp.cpp b/xfa/fwl/core/fwl_noteimp.cpp index d73a49fa90..5d439d7f0c 100644 --- a/xfa/fwl/core/fwl_noteimp.cpp +++ b/xfa/fwl/core/fwl_noteimp.cpp @@ -14,7 +14,6 @@ #include "xfa/fwl/core/fwl_formimp.h" #include "xfa/fwl/core/fwl_widgetimp.h" #include "xfa/fwl/core/fwl_widgetmgrimp.h" -#include "xfa/fwl/core/ifwl_adapterwidgetmgr.h" #include "xfa/fwl/core/ifwl_app.h" #include "xfa/fwl/core/ifwl_tooltiptarget.h" @@ -46,11 +45,6 @@ FX_BOOL CFWL_NoteLoop::ContinueModal() { } FWL_ERR CFWL_NoteLoop::EndModalLoop() { m_bContinueModal = FALSE; -#if (_FX_OS_ == _FX_MACOSX_) - CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); - IFWL_AdapterWidgetMgr* adapterWidgetMgr = pWidgetMgr->GetAdapterWidgetMgr(); - adapterWidgetMgr->EndLoop(); -#endif return FWL_ERR_Succeeded; } @@ -213,60 +207,22 @@ FWL_ERR CFWL_NoteDriver::Run() { CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); if (!pWidgetMgr) return FWL_ERR_Indefinite; -#if (_FX_OS_ == _FX_MACOSX_) - IFWL_AdapterWidgetMgr* adapterWidgetMgr = pWidgetMgr->GetAdapterWidgetMgr(); - CFWL_NoteLoop* pTopLoop = GetTopLoop(); - if (pTopLoop) { - CFWL_WidgetImp* formImp = pTopLoop->GetForm(); - if (formImp) { - IFWL_Widget* pForm = formImp->GetInterface(); - adapterWidgetMgr->RunLoop(pForm); - } - } -#elif(_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_) - FX_BOOL bIdle = TRUE; - int32_t iIdleCount = 0; - CFWL_NoteLoop* pTopLoop = NULL; - for (;;) { - pTopLoop = GetTopLoop(); - if (!pTopLoop || !pTopLoop->ContinueModal()) { - break; - } - if (UnqueueMessage(pTopLoop)) { - continue; - } - while (bIdle && !(pWidgetMgr->CheckMessage_Native())) { - if (FWL_ERR_Indefinite == pTopLoop->Idle(iIdleCount++)) { - bIdle = FALSE; - } - } - do { - if (FWL_ERR_Indefinite == pWidgetMgr->DispatchMessage_Native()) { - break; - } - if (pWidgetMgr->IsIdleMessage_Native()) { - bIdle = TRUE; - iIdleCount = 0; - } - } while (pWidgetMgr->CheckMessage_Native()); - } -#elif(_FX_OS_ == _FX_LINUX_DESKTOP_) - CFWL_NoteLoop* pTopLoop = NULL; - for (;;) { - pTopLoop = GetTopLoop(); - if (!pTopLoop || !pTopLoop->ContinueModal()) { - break; - } - if (UnqueueMessage(pTopLoop)) { - continue; - } - if (pWidgetMgr->CheckMessage_Native()) { - pWidgetMgr->DispatchMessage_Native(); - } - } + +#if (_FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_WIN32_DESKTOP_ || \ + _FX_OS_ == _FX_WIN64_) + CFWL_NoteLoop* pTopLoop = NULL; + for (;;) { + pTopLoop = GetTopLoop(); + if (!pTopLoop || !pTopLoop->ContinueModal()) + break; + if (UnqueueMessage(pTopLoop)) + continue; + } #endif + return FWL_ERR_Succeeded; } + IFWL_Widget* CFWL_NoteDriver::GetFocus() { return m_pFocus; } diff --git a/xfa/fwl/core/fwl_sdadapterimp.cpp b/xfa/fwl/core/fwl_sdadapterimp.cpp deleted file mode 100644 index c4dc61a8d1..0000000000 --- a/xfa/fwl/core/fwl_sdadapterimp.cpp +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#include "xfa/fwl/core/fwl_sdadapterimp.h" - -#include "core/fxcrt/include/fx_system.h" -#include "xfa/fwl/core/fwl_noteimp.h" -#include "xfa/fwl/core/fwl_widgetmgrimp.h" -#include "xfa/fwl/core/ifwl_adapterthreadmgr.h" -#include "xfa/fwl/core/ifwl_adapterwidgetmgr.h" -#include "xfa/fwl/core/ifwl_app.h" - -CFWL_SDAdapterWidgetMgr::CFWL_SDAdapterWidgetMgr() {} -CFWL_SDAdapterWidgetMgr::~CFWL_SDAdapterWidgetMgr() {} - -FWL_ERR CFWL_SDAdapterWidgetMgr::CreateWidget(IFWL_Widget* pWidget, - IFWL_Widget* pParent) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::DestroyWidget(IFWL_Widget* pWidget) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::SetWidgetRect(IFWL_Widget* pWidget, - const CFX_RectF& rect) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::SetWidgetPosition(IFWL_Widget* pWidget, - FX_FLOAT fx, - FX_FLOAT fy) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::SetParentWidget(IFWL_Widget* pWidget, - IFWL_Widget* pParent) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::ShowWidget(IFWL_Widget* pWidget) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::HideWidget(IFWL_Widget* pWidget) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::SetNormal(IFWL_Widget* pWidget) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::SetMaximize(IFWL_Widget* pWidget) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::SetMinimize(IFWL_Widget* pWidget) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::RunWidget(IFWL_Widget* pWidget) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::RepaintWidget(IFWL_Widget* pWidget, - const CFX_RectF* pRect) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::Exit(int32_t iExitCode) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::CreateWidgetWithNativeId(IFWL_Widget* pWidget, - void* vp) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::GetWidgetRect(IFWL_Widget* pWidget, - CFX_RectF& rect) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::SetWidgetIcon(IFWL_Widget* pWidget, - const CFX_DIBitmap* pIcon, - FX_BOOL bBig) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::SetWidgetCaption( - IFWL_Widget* pWidget, - const CFX_WideStringC& wsCaption) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::SetBorderRegion(IFWL_Widget* pWidget, - CFX_Path* pPath) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::SetTransparent(IFWL_Widget* pWidget, - uint32_t dwAlpha) { - return FWL_ERR_Succeeded; -} -FX_BOOL CFWL_SDAdapterWidgetMgr::CheckMessage() { - return TRUE; -} -FX_BOOL CFWL_SDAdapterWidgetMgr::IsIdleMessage() { - return TRUE; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::DispatchMessage() { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::GetWidgetDC(IFWL_Widget* pWidget, void*& pDC) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::ReleaseWidgetDC(IFWL_Widget* pWidget, - void* pDC, - CFX_RectF* pClip) { - return FWL_ERR_Succeeded; -} -void* CFWL_SDAdapterWidgetMgr::GetWindow(IFWL_Widget* pWidget) { - return NULL; -} -uint32_t CFWL_SDAdapterWidgetMgr::GetKeyState(uint32_t dwVirtKey) { - return 0; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::RunLoop(IFWL_Widget* widget) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::EndLoop() { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::InitMenu(IFWL_Menu* pMenu, - IFWL_MenuDP* pMenuData) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::UpdateMenu(IFWL_Menu* pMenu, - const void* hItem, - int32_t iType) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::SetMessageHook(IFWL_AdapterMessageHook* hook) { - return FWL_ERR_Succeeded; -} -FWL_ERR CFWL_SDAdapterWidgetMgr::GetSystemBorder(FX_FLOAT& l, - FX_FLOAT& t, - FX_FLOAT& r, - FX_FLOAT& b) { - return FWL_ERR_Succeeded; -} -FX_BOOL CFWL_SDAdapterWidgetMgr::GetPopupPos(IFWL_Widget* pWidget, - FX_FLOAT fMinHeight, - FX_FLOAT fMaxHeight, - const CFX_RectF& rtAnchor, - CFX_RectF& rtPopup) { - return FWL_ERR_Succeeded; -} - -CFWL_SDAdapterThreadMgr::CFWL_SDAdapterThreadMgr() {} - -CFWL_SDAdapterThreadMgr::~CFWL_SDAdapterThreadMgr() {} - -IFWL_App* CFWL_SDAdapterThreadMgr::GetCurrentThread() { - return FWL_GetApp(); -} diff --git a/xfa/fwl/core/fwl_sdadapterimp.h b/xfa/fwl/core/fwl_sdadapterimp.h deleted file mode 100644 index cd2ac8d6d8..0000000000 --- a/xfa/fwl/core/fwl_sdadapterimp.h +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef XFA_FWL_CORE_FWL_SDADAPTERIMP_H_ -#define XFA_FWL_CORE_FWL_SDADAPTERIMP_H_ - -#include "xfa/fwl/core/ifwl_adapterthreadmgr.h" -#include "xfa/fwl/core/ifwl_adapterwidgetmgr.h" - -class CFWL_SDAdapterWidgetMgr : public IFWL_AdapterWidgetMgr { - public: - CFWL_SDAdapterWidgetMgr(); - ~CFWL_SDAdapterWidgetMgr(); - virtual FWL_ERR CreateWidget(IFWL_Widget* pWidget, - IFWL_Widget* pParent = NULL); - virtual FWL_ERR DestroyWidget(IFWL_Widget* pWidget); - virtual FWL_ERR SetWidgetRect(IFWL_Widget* pWidget, const CFX_RectF& rect); - virtual FWL_ERR SetWidgetPosition(IFWL_Widget* pWidget, - FX_FLOAT fx, - FX_FLOAT fy); - virtual FWL_ERR SetParentWidget(IFWL_Widget* pWidget, IFWL_Widget* pParent); - virtual FWL_ERR ShowWidget(IFWL_Widget* pWidget); - virtual FWL_ERR HideWidget(IFWL_Widget* pWidget); - virtual FWL_ERR SetNormal(IFWL_Widget* pWidget); - virtual FWL_ERR SetMaximize(IFWL_Widget* pWidget); - virtual FWL_ERR SetMinimize(IFWL_Widget* pWidget); - virtual FWL_ERR RunWidget(IFWL_Widget* pWidget); - virtual FWL_ERR RepaintWidget(IFWL_Widget* pWidget, const CFX_RectF* pRect); - virtual FWL_ERR Exit(int32_t iExitCode); - virtual FWL_ERR CreateWidgetWithNativeId(IFWL_Widget* pWidget, void* vp); - virtual FX_BOOL GetPopupPos(IFWL_Widget* pWidget, - FX_FLOAT fMinHeight, - FX_FLOAT fMaxHeight, - const CFX_RectF& rtAnchor, - CFX_RectF& rtPopup); - - public: - virtual FWL_ERR GetWidgetRect(IFWL_Widget* pWidget, CFX_RectF& rect); - virtual FWL_ERR SetWidgetIcon(IFWL_Widget* pWidget, - const CFX_DIBitmap* pIcon, - FX_BOOL bBig); - virtual FWL_ERR SetWidgetCaption(IFWL_Widget* pWidget, - const CFX_WideStringC& wsCaption); - virtual FWL_ERR SetBorderRegion(IFWL_Widget* pWidget, CFX_Path* pPath); - virtual FWL_ERR SetTransparent(IFWL_Widget* pWidget, uint32_t dwAlpha); - virtual FX_BOOL CheckMessage(); - virtual FX_BOOL IsIdleMessage(); - virtual FWL_ERR DispatchMessage(); - virtual FWL_ERR GetWidgetDC(IFWL_Widget* pWidget, void*& pDC); - virtual FWL_ERR ReleaseWidgetDC(IFWL_Widget* pWidget, - void* pDC, - CFX_RectF* pClip = 0); - virtual void* GetWindow(IFWL_Widget* pWidget); - virtual uint32_t GetKeyState(uint32_t dwVirtKey); - virtual FWL_ERR RunLoop(IFWL_Widget* widget); - virtual FWL_ERR EndLoop(); - virtual FWL_ERR InitMenu(IFWL_Menu* pMenu, IFWL_MenuDP* pMenuData); - virtual FWL_ERR UpdateMenu(IFWL_Menu* pMenu, - const void* hItem, - int32_t iType); - virtual FWL_ERR SetMessageHook(IFWL_AdapterMessageHook* hook); - virtual FWL_ERR GetSystemBorder(FX_FLOAT& l, - FX_FLOAT& t, - FX_FLOAT& r, - FX_FLOAT& b); -}; - -class CFWL_SDAdapterThreadMgr : public IFWL_AdapterThreadMgr { - public: - CFWL_SDAdapterThreadMgr(); - ~CFWL_SDAdapterThreadMgr(); - - public: - virtual IFWL_App* GetCurrentThread(); -}; - -#endif // XFA_FWL_CORE_FWL_SDADAPTERIMP_H_ diff --git a/xfa/fwl/core/fwl_timerimp.cpp b/xfa/fwl/core/fwl_timerimp.cpp index 8a5f8896f5..5adf8e158c 100644 --- a/xfa/fwl/core/fwl_timerimp.cpp +++ b/xfa/fwl/core/fwl_timerimp.cpp @@ -5,15 +5,15 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "xfa/fwl/core/fwl_appimp.h" -#include "xfa/fwl/core/ifwl_adapternative.h" #include "xfa/fwl/core/ifwl_app.h" #include "xfa/fwl/core/ifwl_timer.h" #include "xfa/fwl/core/include/ifwl_adaptertimermgr.h" +#include "xfa/fxfa/include/xfa_ffapp.h" FWL_HTIMER FWL_StartTimer(IFWL_Timer* pTimer, uint32_t dwElapse, FX_BOOL bImmediately) { - IFWL_AdapterNative* pAdapterNative = FWL_GetAdapterNative(); + CXFA_FFApp* pAdapterNative = FWL_GetAdapterNative(); if (!pAdapterNative) return NULL; IFWL_AdapterTimerMgr* pAdapterTimerMgr = pAdapterNative->GetTimerMgr(); @@ -24,7 +24,7 @@ FWL_HTIMER FWL_StartTimer(IFWL_Timer* pTimer, return hTimer; } int32_t FWL_StopTimer(FWL_HTIMER hTimer) { - IFWL_AdapterNative* pAdapterNative = FWL_GetAdapterNative(); + CXFA_FFApp* pAdapterNative = FWL_GetAdapterNative(); if (!pAdapterNative) return FWL_ERR_Indefinite; IFWL_AdapterTimerMgr* pAdapterTimerMgr = pAdapterNative->GetTimerMgr(); diff --git a/xfa/fwl/core/fwl_widgetimp.cpp b/xfa/fwl/core/fwl_widgetimp.cpp index b9db4f984e..8863cef0f3 100644 --- a/xfa/fwl/core/fwl_widgetimp.cpp +++ b/xfa/fwl/core/fwl_widgetimp.cpp @@ -18,12 +18,10 @@ #include "xfa/fwl/core/fwl_appimp.h" #include "xfa/fwl/core/fwl_noteimp.h" #include "xfa/fwl/core/fwl_widgetmgrimp.h" -#include "xfa/fwl/core/ifwl_adapternative.h" -#include "xfa/fwl/core/ifwl_adapterthreadmgr.h" -#include "xfa/fwl/core/ifwl_adapterwidgetmgr.h" #include "xfa/fwl/core/ifwl_app.h" #include "xfa/fwl/core/ifwl_form.h" #include "xfa/fwl/core/ifwl_themeprovider.h" +#include "xfa/fxfa/include/xfa_ffapp.h" #define FWL_CLASSHASH_Menu 3957949655 #define FWL_STYLEEXT_MNU_Vert (1L << 0) @@ -97,8 +95,8 @@ FWL_ERR IFWL_Widget::ModifyStylesEx(uint32_t dwStylesExAdded, uint32_t IFWL_Widget::GetStates() { return static_cast<CFWL_WidgetImp*>(GetImpl())->GetStates(); } -FWL_ERR IFWL_Widget::SetStates(uint32_t dwStates, FX_BOOL bSet) { - return static_cast<CFWL_WidgetImp*>(GetImpl())->SetStates(dwStates, bSet); +void IFWL_Widget::SetStates(uint32_t dwStates, FX_BOOL bSet) { + static_cast<CFWL_WidgetImp*>(GetImpl())->SetStates(dwStates, bSet); } FWL_ERR IFWL_Widget::SetPrivateData(void* module_id, void* pData, @@ -165,33 +163,23 @@ FWL_ERR CFWL_WidgetImp::Initialize() { IFWL_App* pApp = FWL_GetApp(); if (!pApp) return FWL_ERR_Indefinite; - IFWL_AdapterNative* pAdapter = pApp->GetAdapterNative(); + CXFA_FFApp* pAdapter = pApp->GetAdapterNative(); if (!pAdapter) return FWL_ERR_Indefinite; - IFWL_AdapterThreadMgr* pAdapterThread = pAdapter->GetThreadMgr(); - if (!pAdapterThread) - return FWL_ERR_Indefinite; - SetOwnerApp( - static_cast<CFWL_AppImp*>(pAdapterThread->GetCurrentThread()->GetImpl())); + + SetOwnerApp(static_cast<CFWL_AppImp*>(FWL_GetApp()->GetImpl())); IFWL_Widget* pParent = m_pProperties->m_pParent; m_pWidgetMgr->InsertWidget(pParent, m_pInterface); if (!IsChild()) { - { - IFWL_Widget* pOwner = m_pProperties->m_pOwner; - if (pOwner) { - m_pWidgetMgr->SetOwner(pOwner, m_pInterface); - } - } - m_pWidgetMgr->CreateWidget_Native(m_pInterface); + IFWL_Widget* pOwner = m_pProperties->m_pOwner; + if (pOwner) + m_pWidgetMgr->SetOwner(pOwner, m_pInterface); } return FWL_ERR_Succeeded; } FWL_ERR CFWL_WidgetImp::Finalize() { NotifyDriver(); - if (!IsChild()) - m_pWidgetMgr->DestroyWidget_Native(m_pInterface); - m_pWidgetMgr->RemoveWidget(m_pInterface); return FWL_ERR_Succeeded; } @@ -314,29 +302,24 @@ static void NotifyHideChildWidget(IFWL_WidgetMgr* widgetMgr, child = widgetMgr->GetWidget(child, FWL_WGTRELATION_NextSibling); } } -FWL_ERR CFWL_WidgetImp::SetStates(uint32_t dwStates, FX_BOOL bSet) { +void CFWL_WidgetImp::SetStates(uint32_t dwStates, FX_BOOL bSet) { bSet ? (m_pProperties->m_dwStates |= dwStates) : (m_pProperties->m_dwStates &= ~dwStates); - FWL_ERR ret = FWL_ERR_Succeeded; - if (dwStates & FWL_WGTSTATE_Invisible) { - if (bSet) { - ret = m_pWidgetMgr->HideWidget_Native(m_pInterface); - CFWL_NoteDriver* noteDriver = - static_cast<CFWL_NoteDriver*>(GetOwnerApp()->GetNoteDriver()); - IFWL_WidgetMgr* widgetMgr = FWL_GetWidgetMgr(); - noteDriver->NotifyTargetHide(m_pInterface); - IFWL_Widget* child = - widgetMgr->GetWidget(m_pInterface, FWL_WGTRELATION_FirstChild); - while (child) { - noteDriver->NotifyTargetHide(child); - NotifyHideChildWidget(widgetMgr, child, noteDriver); - child = widgetMgr->GetWidget(child, FWL_WGTRELATION_NextSibling); - } - } else { - ret = m_pWidgetMgr->ShowWidget_Native(m_pInterface); - } + if (!(dwStates & FWL_WGTSTATE_Invisible) || !bSet) + return; + + CFWL_NoteDriver* noteDriver = + static_cast<CFWL_NoteDriver*>(GetOwnerApp()->GetNoteDriver()); + IFWL_WidgetMgr* widgetMgr = FWL_GetWidgetMgr(); + noteDriver->NotifyTargetHide(m_pInterface); + IFWL_Widget* child = + widgetMgr->GetWidget(m_pInterface, FWL_WGTRELATION_FirstChild); + while (child) { + noteDriver->NotifyTargetHide(child); + NotifyHideChildWidget(widgetMgr, child, noteDriver); + child = widgetMgr->GetWidget(child, FWL_WGTRELATION_NextSibling); } - return ret; + return; } FWL_ERR CFWL_WidgetImp::SetPrivateData(void* module_id, void* pData, @@ -418,14 +401,6 @@ FWL_ERR CFWL_WidgetImp::TransformTo(IFWL_Widget* pWidget, form1->GetWidgetRect(r); fx += r.left; fy += r.top; -#ifdef FWL_UseMacSystemBorder - if (form1->GetStyles() & FWL_WGTSTYLE_Caption) { - FX_FLOAT l, t, r, b; - l = t = r = b = 0; - FWL_GetAdapterWidgetMgr()->GetSystemBorder(l, t, r, b); - fy += t; - } -#endif return FWL_ERR_Succeeded; } IFWL_Widget* form2 = @@ -439,15 +414,6 @@ FWL_ERR CFWL_WidgetImp::TransformTo(IFWL_Widget* pWidget, form2->GetWidgetRect(r); fx -= r.left; fy -= r.top; -#ifdef FWL_UseMacSystemBorder - if ((form1->GetStyles() & FWL_WGTSTYLE_Caption) != - (form2->GetStyles() & FWL_WGTSTYLE_Caption)) { - FX_FLOAT l, t, r, b; - l = t = r = b = 0; - FWL_GetAdapterWidgetMgr()->GetSystemBorder(l, t, r, b); - (form1->GetStyles() & FWL_WGTSTYLE_Caption) ? (fy += t) : (fy -= t); - } -#endif } parent = pWidget->GetParent(); if (parent) { diff --git a/xfa/fwl/core/fwl_widgetimp.h b/xfa/fwl/core/fwl_widgetimp.h index 3eddfa51c2..d20fe0d75e 100644 --- a/xfa/fwl/core/fwl_widgetimp.h +++ b/xfa/fwl/core/fwl_widgetimp.h @@ -50,7 +50,7 @@ class CFWL_WidgetImp { virtual FWL_ERR ModifyStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved); virtual uint32_t GetStates(); - virtual FWL_ERR SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE); + virtual void SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE); virtual FWL_ERR SetPrivateData(void* module_id, void* pData, PD_CALLBACK_FREEDATA callback); diff --git a/xfa/fwl/core/fwl_widgetmgrimp.cpp b/xfa/fwl/core/fwl_widgetmgrimp.cpp index 3548f9b7a9..e56c308be9 100644 --- a/xfa/fwl/core/fwl_widgetmgrimp.cpp +++ b/xfa/fwl/core/fwl_widgetmgrimp.cpp @@ -10,10 +10,10 @@ #include "xfa/fwl/core/fwl_appimp.h" #include "xfa/fwl/core/fwl_noteimp.h" #include "xfa/fwl/core/fwl_widgetimp.h" -#include "xfa/fwl/core/ifwl_adapternative.h" -#include "xfa/fwl/core/ifwl_adapterwidgetmgr.h" #include "xfa/fwl/core/ifwl_app.h" #include "xfa/fwl/core/ifwl_form.h" +#include "xfa/fxfa/app/xfa_fwladapter.h" +#include "xfa/fxfa/include/xfa_ffapp.h" namespace { @@ -43,8 +43,7 @@ IFWL_WidgetMgr* FWL_GetWidgetMgr() { return pApp->GetWidgetMgr(); } -CFWL_WidgetMgr::CFWL_WidgetMgr(IFWL_AdapterNative* pAdapterNative) - : m_dwCapability(0) { +CFWL_WidgetMgr::CFWL_WidgetMgr(CXFA_FFApp* pAdapterNative) : m_dwCapability(0) { m_pDelegate = new CFWL_WidgetMgrDelegate(this); m_pAdapter = pAdapterNative->GetWidgetMgr(m_pDelegate); ASSERT(m_pAdapter); @@ -360,10 +359,8 @@ void CFWL_WidgetMgr::SetParent(IFWL_Widget* pParent, IFWL_Widget* pChild) { } pItem->pParent = pParentItem; SetWidgetIndex(pChild, -1); - if (!m_pAdapter) - return; - m_pAdapter->SetParentWidget(pChild, pParent); } + FX_BOOL CFWL_WidgetMgr::IsChild(IFWL_Widget* pChild, IFWL_Widget* pParent) { IFWL_Widget* pTemp = pChild; do { @@ -374,25 +371,6 @@ FX_BOOL CFWL_WidgetMgr::IsChild(IFWL_Widget* pChild, IFWL_Widget* pParent) { } while (pTemp); return FALSE; } -FWL_ERR CFWL_WidgetMgr::CreateWidget_Native(IFWL_Widget* pWidget) { - if (!IsAbleNative(pWidget)) { - return FWL_ERR_Succeeded; - } - return m_pAdapter->CreateWidget(pWidget, pWidget->GetOwner()); -} -FWL_ERR CFWL_WidgetMgr::DestroyWidget_Native(IFWL_Widget* pWidget) { - if (!IsAbleNative(pWidget)) { - return FWL_ERR_Succeeded; - } - return m_pAdapter->DestroyWidget(pWidget); -} -FWL_ERR CFWL_WidgetMgr::GetWidgetRect_Native(IFWL_Widget* pWidget, - CFX_RectF& rect) { - if (!IsAbleNative(pWidget)) { - return FWL_ERR_Succeeded; - } - return m_pAdapter->GetWidgetRect(pWidget, rect); -} FWL_ERR CFWL_WidgetMgr::SetWidgetRect_Native(IFWL_Widget* pWidget, const CFX_RectF& rect) { if (FWL_UseOffscreen(pWidget)) { @@ -413,57 +391,7 @@ FWL_ERR CFWL_WidgetMgr::SetWidgetRect_Native(IFWL_Widget* pWidget, pItem->bOutsideChanged = !m_rtScreen.Contains(rect); #endif } - return m_pAdapter->SetWidgetRect(pWidget, rect); -} -FWL_ERR CFWL_WidgetMgr::SetWidgetPosition_Native(IFWL_Widget* pWidget, - FX_FLOAT fx, - FX_FLOAT fy) { - return m_pAdapter->SetWidgetPosition(pWidget, fx, fy); -} -FWL_ERR CFWL_WidgetMgr::SetWidgetIcon_Native(IFWL_Widget* pWidget, - const CFX_DIBitmap* pIcon, - FX_BOOL bBig) { - return m_pAdapter->SetWidgetIcon(pWidget, pIcon, bBig); -} -FWL_ERR CFWL_WidgetMgr::SetWidgetCaption_Native( - IFWL_Widget* pWidget, - const CFX_WideStringC& wsCaption) { - return m_pAdapter->SetWidgetCaption(pWidget, wsCaption); -} -FWL_ERR CFWL_WidgetMgr::SetBorderRegion_Native(IFWL_Widget* pWidget, - CFX_Path* pPath) { - return m_pAdapter->SetBorderRegion(pWidget, pPath); -} -FWL_ERR CFWL_WidgetMgr::ShowWidget_Native(IFWL_Widget* pWidget) { - return m_pAdapter->ShowWidget(pWidget); -} -FWL_ERR CFWL_WidgetMgr::HideWidget_Native(IFWL_Widget* pWidget) { - return m_pAdapter->HideWidget(pWidget); -} -FWL_ERR CFWL_WidgetMgr::SetNormal_Native(IFWL_Widget* pWidget) { - return m_pAdapter->SetNormal(pWidget); -} -FWL_ERR CFWL_WidgetMgr::SetMaximize_Native(IFWL_Widget* pWidget) { - return m_pAdapter->SetMaximize(pWidget); -} -FWL_ERR CFWL_WidgetMgr::SetMinimize_Native(IFWL_Widget* pWidget) { - return m_pAdapter->SetMinimize(pWidget); -} -FX_BOOL CFWL_WidgetMgr::CheckMessage_Native() { - return m_pAdapter->CheckMessage(); -} -FWL_ERR CFWL_WidgetMgr::DispatchMessage_Native() { - return m_pAdapter->DispatchMessage(); -} -FX_BOOL CFWL_WidgetMgr::IsIdleMessage_Native() { - return m_pAdapter->IsIdleMessage(); -} -FWL_ERR CFWL_WidgetMgr::Exit_Native(int32_t iExitCode) { - return m_pAdapter->Exit(iExitCode); -} -FWL_ERR CFWL_WidgetMgr::CreateWidgetWithNativeId_Native(IFWL_Widget* pWidget, - void* vp) { - return m_pAdapter->CreateWidgetWithNativeId(pWidget, vp); + return FWL_ERR_Succeeded; } IFWL_Widget* CFWL_WidgetMgr::GetWidgetAtPoint(IFWL_Widget* parent, FX_FLOAT x, @@ -697,7 +625,7 @@ FX_BOOL CFWL_WidgetMgr::GetAdapterPopupPos(IFWL_Widget* pWidget, FX_FLOAT fMaxHeight, const CFX_RectF& rtAnchor, CFX_RectF& rtPopup) { - IFWL_AdapterWidgetMgr* pSDApapter = GetAdapterWidgetMgr(); + CXFA_FWLAdapterWidgetMgr* pSDApapter = GetAdapterWidgetMgr(); return pSDApapter->GetPopupPos(pWidget, fMinHeight, fMaxHeight, rtAnchor, rtPopup); } diff --git a/xfa/fwl/core/fwl_widgetmgrimp.h b/xfa/fwl/core/fwl_widgetmgrimp.h index 0fcd057aeb..ff732e5cc0 100644 --- a/xfa/fwl/core/fwl_widgetmgrimp.h +++ b/xfa/fwl/core/fwl_widgetmgrimp.h @@ -17,10 +17,10 @@ class CFWL_Message; class CFWL_WidgetMgrDelegate; +class CXFA_FFApp; +class CXFA_FWLAdapterWidgetMgr; class CFX_Graphics; class CFX_Matrix; -class IFWL_AdapterWidgetMgr; -class IFWL_AdapterNative; class IFWL_Widget; class CFWL_WidgetMgrItem { @@ -61,7 +61,7 @@ class CFWL_WidgetMgrItem { class CFWL_WidgetMgr : public IFWL_WidgetMgr { public: - CFWL_WidgetMgr(IFWL_AdapterNative* pAdapterNative); + CFWL_WidgetMgr(CXFA_FFApp* pAdapterNative); ~CFWL_WidgetMgr() override; // IFWL_WidgetMgr: @@ -83,29 +83,7 @@ class CFWL_WidgetMgr : public IFWL_WidgetMgr { void SetOwner(IFWL_Widget* pOwner, IFWL_Widget* pOwned); void SetParent(IFWL_Widget* pParent, IFWL_Widget* pChild); FX_BOOL IsChild(IFWL_Widget* pChild, IFWL_Widget* pParent); - FWL_ERR CreateWidget_Native(IFWL_Widget* pWidget); - FWL_ERR DestroyWidget_Native(IFWL_Widget* pWidget); - FWL_ERR GetWidgetRect_Native(IFWL_Widget* pWidget, CFX_RectF& rect); FWL_ERR SetWidgetRect_Native(IFWL_Widget* pWidget, const CFX_RectF& rect); - FWL_ERR SetWidgetPosition_Native(IFWL_Widget* pWidget, - FX_FLOAT fx, - FX_FLOAT fy); - FWL_ERR SetWidgetIcon_Native(IFWL_Widget* pWidget, - const CFX_DIBitmap* pIcon, - FX_BOOL bBig); - FWL_ERR SetWidgetCaption_Native(IFWL_Widget* pWidget, - const CFX_WideStringC& wsCaption); - FWL_ERR SetBorderRegion_Native(IFWL_Widget* pWidget, CFX_Path* pPath); - FWL_ERR ShowWidget_Native(IFWL_Widget* pWidget); - FWL_ERR HideWidget_Native(IFWL_Widget* pWidget); - FWL_ERR SetNormal_Native(IFWL_Widget* pWidget); - FWL_ERR SetMaximize_Native(IFWL_Widget* pWidget); - FWL_ERR SetMinimize_Native(IFWL_Widget* pWidget); - FX_BOOL CheckMessage_Native(); - FWL_ERR DispatchMessage_Native(); - FX_BOOL IsIdleMessage_Native(); - FWL_ERR Exit_Native(int32_t iExitCode); - FWL_ERR CreateWidgetWithNativeId_Native(IFWL_Widget* pWidget, void* vp); IFWL_Widget* GetWidgetAtPoint(IFWL_Widget* pParent, FX_FLOAT fx, FX_FLOAT fy); void NotifySizeChanged(IFWL_Widget* pForm, FX_FLOAT fx, FX_FLOAT fy); IFWL_Widget* nextTab(IFWL_Widget* parent, IFWL_Widget* focus, FX_BOOL& bFind); @@ -117,8 +95,8 @@ class CFWL_WidgetMgr : public IFWL_WidgetMgr { IFWL_Widget* GetDefaultButton(IFWL_Widget* pParent); void AddRedrawCounts(IFWL_Widget* pWidget); void ResetRedrawCounts(IFWL_Widget* pWidget); - IFWL_AdapterWidgetMgr* GetAdapterWidgetMgr() { return m_pAdapter; } - CFWL_WidgetMgrDelegate* GetDelegate() { return m_pDelegate; } + CXFA_FWLAdapterWidgetMgr* GetAdapterWidgetMgr() const { return m_pAdapter; } + CFWL_WidgetMgrDelegate* GetDelegate() const { return m_pDelegate; } CFWL_WidgetMgrItem* GetWidgetMgrItem(IFWL_Widget* pWidget); bool IsThreadEnabled(); bool IsFormDisabled(); @@ -135,7 +113,7 @@ class CFWL_WidgetMgr : public IFWL_WidgetMgr { IFWL_Widget** pWidget = NULL); FX_BOOL IsAbleNative(IFWL_Widget* pWidget); CFX_MapPtrToPtr m_mapWidgetItem; - IFWL_AdapterWidgetMgr* m_pAdapter; + CXFA_FWLAdapterWidgetMgr* m_pAdapter; CFWL_WidgetMgrDelegate* m_pDelegate; friend class CFWL_WidgetMgrDelegate; uint32_t m_dwCapability; diff --git a/xfa/fwl/core/ifwl_adapternative.h b/xfa/fwl/core/ifwl_adapternative.h deleted file mode 100644 index e787658e19..0000000000 --- a/xfa/fwl/core/ifwl_adapternative.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef XFA_FWL_CORE_IFWL_ADAPTERNATIVE_H_ -#define XFA_FWL_CORE_IFWL_ADAPTERNATIVE_H_ - -class CFWL_WidgetMgrDelegate; -class IFWL_AdapterWidgetMgr; -class IFWL_AdapterThreadMgr; -class IFWL_AdapterTimerMgr; - -class IFWL_AdapterNative { - public: - virtual ~IFWL_AdapterNative() {} - virtual IFWL_AdapterWidgetMgr* GetWidgetMgr( - CFWL_WidgetMgrDelegate* pDelegate) = 0; - virtual IFWL_AdapterThreadMgr* GetThreadMgr() = 0; - virtual IFWL_AdapterTimerMgr* GetTimerMgr() = 0; -}; - -#endif // XFA_FWL_CORE_IFWL_ADAPTERNATIVE_H_ diff --git a/xfa/fwl/core/ifwl_adapterthreadmgr.h b/xfa/fwl/core/ifwl_adapterthreadmgr.h deleted file mode 100644 index de2616a0af..0000000000 --- a/xfa/fwl/core/ifwl_adapterthreadmgr.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef XFA_FWL_CORE_IFWL_ADAPTERTHREADMGR_H_ -#define XFA_FWL_CORE_IFWL_ADAPTERTHREADMGR_H_ - -#include "core/fxcrt/include/fx_system.h" -#include "xfa/fwl/core/fwl_error.h" - -class IFWL_App; - -class IFWL_AdapterThreadMgr { - public: - virtual ~IFWL_AdapterThreadMgr() {} - - virtual IFWL_App* GetCurrentThread() = 0; -}; - -#endif // XFA_FWL_CORE_IFWL_ADAPTERTHREADMGR_H_ diff --git a/xfa/fwl/core/ifwl_adapterwidgetmgr.h b/xfa/fwl/core/ifwl_adapterwidgetmgr.h deleted file mode 100644 index a737e81c3c..0000000000 --- a/xfa/fwl/core/ifwl_adapterwidgetmgr.h +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef XFA_FWL_CORE_IFWL_ADAPTERWIDGETMGR_H_ -#define XFA_FWL_CORE_IFWL_ADAPTERWIDGETMGR_H_ - -#include "core/fxcrt/include/fx_coordinates.h" -#include "core/fxcrt/include/fx_system.h" -#include "xfa/fwl/core/fwl_error.h" - -class IFWL_Widget; -class IFWL_Menu; -class IFWL_MenuDP; -class CFX_Path; -class CFX_DIBitmap; -class IFWL_AdapterMessageHook; - -class IFWL_AdapterWidgetMgr { - public: - virtual ~IFWL_AdapterWidgetMgr() {} - virtual FWL_ERR CreateWidget(IFWL_Widget* pWidget, - IFWL_Widget* pParent = NULL) = 0; - virtual FWL_ERR DestroyWidget(IFWL_Widget* pWidget) = 0; - virtual FWL_ERR GetWidgetRect(IFWL_Widget* pWidget, CFX_RectF& rect) = 0; - virtual FWL_ERR SetWidgetRect(IFWL_Widget* pWidget, - const CFX_RectF& rect) = 0; - virtual FWL_ERR SetWidgetPosition(IFWL_Widget* pWidget, - FX_FLOAT fx, - FX_FLOAT fy) = 0; - virtual FWL_ERR SetParentWidget(IFWL_Widget* pWidget, - IFWL_Widget* pParent) = 0; - virtual FWL_ERR SetWidgetIcon(IFWL_Widget* pWidget, - const CFX_DIBitmap* pIcon, - FX_BOOL bBig) = 0; - virtual FWL_ERR SetWidgetCaption(IFWL_Widget* pWidget, - const CFX_WideStringC& wsCaption) = 0; - virtual FWL_ERR SetBorderRegion(IFWL_Widget* pWidget, CFX_Path* pPath) = 0; - virtual FWL_ERR SetTransparent(IFWL_Widget* pWidget, uint32_t dwAlpha) = 0; - virtual FWL_ERR ShowWidget(IFWL_Widget* pWidget) = 0; - virtual FWL_ERR HideWidget(IFWL_Widget* pWidget) = 0; - virtual FWL_ERR SetNormal(IFWL_Widget* pWidget) = 0; - virtual FWL_ERR SetMaximize(IFWL_Widget* pWidget) = 0; - virtual FWL_ERR SetMinimize(IFWL_Widget* pWidget) = 0; - virtual FX_BOOL CheckMessage() = 0; - virtual FX_BOOL IsIdleMessage() = 0; - virtual FWL_ERR DispatchMessage() = 0; - virtual FWL_ERR RepaintWidget(IFWL_Widget* pWidget, - const CFX_RectF* pRect) = 0; - virtual FWL_ERR Exit(int32_t iExitCode) = 0; - virtual FWL_ERR CreateWidgetWithNativeId(IFWL_Widget* pWidget, - void* UserData) = 0; - virtual FWL_ERR GetWidgetDC(IFWL_Widget* pWidget, void*& pDC) = 0; - virtual FWL_ERR ReleaseWidgetDC(IFWL_Widget* pWidget, - void* pDC, - CFX_RectF* pClip = 0) = 0; - virtual void* GetWindow(IFWL_Widget* pWidget) = 0; - virtual uint32_t GetKeyState(uint32_t dwVirtKey) = 0; - virtual FWL_ERR RunLoop(IFWL_Widget* widget) = 0; - virtual FWL_ERR EndLoop() = 0; - virtual FWL_ERR InitMenu(IFWL_Menu* pMenu, IFWL_MenuDP* pMenuData) = 0; - virtual FWL_ERR UpdateMenu(IFWL_Menu* pMenu, - const void* hItem, - int32_t iType) = 0; - virtual FWL_ERR SetMessageHook(IFWL_AdapterMessageHook* hook) = 0; - virtual FWL_ERR GetSystemBorder(FX_FLOAT& l, - FX_FLOAT& t, - FX_FLOAT& r, - FX_FLOAT& b) = 0; - virtual FX_BOOL GetPopupPos(IFWL_Widget* pWidget, - FX_FLOAT fMinHeight, - FX_FLOAT fMaxHeight, - const CFX_RectF& rtAnchor, - CFX_RectF& rtPopup) = 0; -}; - -#endif // XFA_FWL_CORE_IFWL_ADAPTERWIDGETMGR_H_ diff --git a/xfa/fwl/core/ifwl_app.h b/xfa/fwl/core/ifwl_app.h index 53dc35d33a..af5fafe0ad 100644 --- a/xfa/fwl/core/ifwl_app.h +++ b/xfa/fwl/core/ifwl_app.h @@ -7,7 +7,7 @@ #ifndef XFA_FWL_CORE_IFWL_APP_H_ #define XFA_FWL_CORE_IFWL_APP_H_ -// The FWL thread/app code contains three parallel classes, which reference each +// The FWL app code contains three parallel classes, which reference each // other via pointers as follows: // // m_pIface m_pImpl @@ -22,25 +22,25 @@ #include "xfa/fwl/core/fwl_error.h" class CFWL_NoteDriver; -class IFWL_AdapterNative; -class IFWL_AdapterWidgetMgr; +class CXFA_FFApp; +class CXFA_FWLAdapterWidgetMgr; class IFWL_ThemeProvider; class IFWL_Widget; class IFWL_WidgetMgr; class IFWL_App { public: - static IFWL_App* Create(IFWL_AdapterNative* pAdapter); + static IFWL_App* Create(CXFA_FFApp* pAdapter); virtual ~IFWL_App() {} FWL_ERR Initialize(); FWL_ERR Finalize(); - IFWL_AdapterNative* GetAdapterNative(); + CXFA_FFApp* GetAdapterNative(); IFWL_WidgetMgr* GetWidgetMgr(); IFWL_ThemeProvider* GetThemeProvider(); - FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); - FWL_ERR Exit(int32_t iExitCode); + void SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); + void Exit(int32_t iExitCode); // These call into polymorphic methods in the impl; no need to override. void Release(); @@ -61,7 +61,7 @@ class IFWL_App { IFWL_App* FWL_GetApp(); void FWL_SetApp(IFWL_App* pApp); -IFWL_AdapterNative* FWL_GetAdapterNative(); -IFWL_AdapterWidgetMgr* FWL_GetAdapterWidgetMgr(); +CXFA_FFApp* FWL_GetAdapterNative(); +CXFA_FWLAdapterWidgetMgr* FWL_GetAdapterWidgetMgr(); #endif // XFA_FWL_CORE_IFWL_APP_H_ diff --git a/xfa/fwl/core/ifwl_widget.h b/xfa/fwl/core/ifwl_widget.h index 62f7155c5d..8ec758a566 100644 --- a/xfa/fwl/core/ifwl_widget.h +++ b/xfa/fwl/core/ifwl_widget.h @@ -53,7 +53,7 @@ class IFWL_Widget { uint32_t GetStylesEx(); FWL_ERR ModifyStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved); uint32_t GetStates(); - FWL_ERR SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE); + void SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE); FWL_ERR SetPrivateData(void* module_id, void* pData, PD_CALLBACK_FREEDATA callback); |