From c74acf4552944c5485b1175c008708d19b57d322 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 9 Feb 2016 10:18:11 -0800 Subject: Several pure virtual IFWL_Adapter* classes not implemented. The routines that would return them always return NULL. Some path, however, didn't previously check for NULL. Those must have been bugs; treat such cases as unreachable. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1679103002 . --- BUILD.gn | 3 - xfa.gyp | 3 - xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h | 34 --- xfa/include/fwl/adapter/fwl_adaptercursormgr.h | 38 ---- xfa/include/fwl/adapter/fwl_adaptermonitormgr.h | 24 -- xfa/include/fwl/adapter/fwl_adapternative.h | 7 +- xfa/include/fwl/fwl.h | 3 - xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp | 43 ---- xfa/src/fwl/src/basewidget/fwl_editimp.cpp | 61 +---- xfa/src/fwl/src/core/fwl_formimp.cpp | 260 ---------------------- xfa/src/fwl/src/core/fwl_widgetimp.cpp | 8 +- xfa/src/fwl/src/core/fwl_widgetmgrimp.cpp | 7 - xfa/src/fxfa/src/app/xfa_ffapp.cpp | 9 - xfa/src/fxfa/src/app/xfa_ffapp.h | 3 - 14 files changed, 3 insertions(+), 500 deletions(-) delete mode 100644 xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h delete mode 100644 xfa/include/fwl/adapter/fwl_adaptercursormgr.h delete mode 100644 xfa/include/fwl/adapter/fwl_adaptermonitormgr.h diff --git a/BUILD.gn b/BUILD.gn index 6ece5e7a90..c793d74df7 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -776,9 +776,6 @@ if (pdf_enable_xfa) { static_library("xfa") { sources = [ "xfa/include/foxitxfa.h", - "xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h", - "xfa/include/fwl/adapter/fwl_adaptercursormgr.h", - "xfa/include/fwl/adapter/fwl_adaptermonitormgr.h", "xfa/include/fwl/adapter/fwl_adapternative.h", "xfa/include/fwl/adapter/fwl_adapterthreadmgr.h", "xfa/include/fwl/adapter/fwl_adaptertimermgr.h", diff --git a/xfa.gyp b/xfa.gyp index 8e1ddec9fe..0ff4fa8568 100644 --- a/xfa.gyp +++ b/xfa.gyp @@ -23,9 +23,6 @@ ], "sources":[ "xfa/include/foxitxfa.h", - "xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h", - "xfa/include/fwl/adapter/fwl_adaptercursormgr.h", - "xfa/include/fwl/adapter/fwl_adaptermonitormgr.h", "xfa/include/fwl/adapter/fwl_adapternative.h", "xfa/include/fwl/adapter/fwl_adapterthreadmgr.h", "xfa/include/fwl/adapter/fwl_adaptertimermgr.h", diff --git a/xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h b/xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h deleted file mode 100644 index 52cd7b8ff8..0000000000 --- a/xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h +++ /dev/null @@ -1,34 +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 _FWL_ADAPTER_CLIPBOARDMGR_H -#define _FWL_ADAPTER_CLIPBOARDMGR_H - -enum FWL_CLIPBOARDFORMAT { - FWL_CLIPBOARDFORMAT_Dib, - FWL_CLIPBOARDFORMAT_Text, - FWL_CLIPBOARDFORMAT_UncodeText, -}; -typedef struct _FWL_HCLIPBOARDDATA { void* pData; } * FWL_HCLIPBOARDDATA; - -class IFWL_AdapterClipboardMgr { - public: - virtual ~IFWL_AdapterClipboardMgr() {} - virtual FWL_ERR Empty() = 0; - virtual FX_BOOL IsDataAvailable(FX_DWORD dwFormat) = 0; - virtual FWL_HCLIPBOARDDATA GetData(FX_DWORD dwFormat) = 0; - virtual FWL_ERR SetData(FX_DWORD dwFormat, uint8_t* pBuf, int32_t iSize) = 0; - virtual int32_t GetDataSize(FWL_HCLIPBOARDDATA hData) = 0; - virtual void* LockDataBuffer(FWL_HCLIPBOARDDATA hData) = 0; - virtual FX_BOOL UnLockDataBuffer(FWL_HCLIPBOARDDATA hData) = 0; - virtual FWL_ERR SetStringData(const CFX_WideStringC& ws) = 0; - virtual FWL_ERR SetStringData(const CFX_ByteStringC& bs) = 0; - virtual FWL_ERR GetStringData(CFX_WideString& ws) = 0; - virtual FWL_ERR GetStringData(CFX_ByteString& bs) = 0; - virtual FWL_ERR EnumFormats(CFX_DWordArray& formats) = 0; - virtual FX_DWORD RegisterFormat(const CFX_WideStringC& wsFormat) = 0; -}; -#endif diff --git a/xfa/include/fwl/adapter/fwl_adaptercursormgr.h b/xfa/include/fwl/adapter/fwl_adaptercursormgr.h deleted file mode 100644 index cc8b8ecc10..0000000000 --- a/xfa/include/fwl/adapter/fwl_adaptercursormgr.h +++ /dev/null @@ -1,38 +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 _FWL_ADAPTER_CURSORMGR_H -#define _FWL_ADAPTER_CURSORMGR_H -class CFX_DIBitmap; -class IFWL_AdapterCursorMgr; -enum FWL_CURSORTYPE { - FWL_CURSORTYPE_Arrow = 0, - FWL_CURSORTYPE_Cross, - FWL_CURSORTYPE_Hand, - FWL_CURSORTYPE_InputBeam, - FWL_CURSORTYPE_Wait, - FWL_CURSORTYPE_SizeAll, - FWL_CURSORTYPE_SizeNWSE, - FWL_CURSORTYPE_SizeNESW, - FWL_CURSORTYPE_SizeWE, - FWL_CURSORTYPE_SizeNS, - FWL_CURSORTYPE_Prohibition, - FWL_CURSORTYPE_Help -}; -typedef struct _FWL_HCURSOR { void* pData; } * FWL_HCURSOR; - -class IFWL_AdapterCursorMgr { - public: - virtual ~IFWL_AdapterCursorMgr() {} - virtual FWL_HCURSOR GetSystemCursor(FWL_CURSORTYPE eCursorType) = 0; - virtual FWL_HCURSOR GetCustomCursor(const CFX_DIBitmap* pBitmap, - FX_FLOAT xHotspot = 0, - FX_FLOAT yHotspot = 0) = 0; - virtual FWL_ERR SetCursor(FWL_HCURSOR hCursor) = 0; - virtual FWL_ERR ShowCursor(FX_BOOL bShow) = 0; - virtual FWL_ERR GetCursorPos(CFX_PointF& pt) = 0; -}; -#endif diff --git a/xfa/include/fwl/adapter/fwl_adaptermonitormgr.h b/xfa/include/fwl/adapter/fwl_adaptermonitormgr.h deleted file mode 100644 index 666f06cd6c..0000000000 --- a/xfa/include/fwl/adapter/fwl_adaptermonitormgr.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 _FWL_ADAPTER_MONITORMGR_H -#define _FWL_ADAPTER_MONITORMGR_H - -typedef struct _FWL_HMONITOR { void* pData; } * FWL_HMONITOR; - -class IFWL_AdapterMonitorMgr { - public: - virtual ~IFWL_AdapterMonitorMgr() {} - virtual int32_t CountMonitors() = 0; - virtual FWL_HMONITOR GetMonitor(int32_t nIndex) = 0; - virtual FWL_HMONITOR GetCurrentMonitor() = 0; - virtual FWL_HMONITOR GetMonitorByRect(const CFX_RectF& rect) = 0; - virtual FWL_HMONITOR GetMonitorByPoint(FX_FLOAT fx, FX_FLOAT fy) = 0; - virtual FWL_ERR GetMonitorSize(FWL_HMONITOR hMonitor, - FX_FLOAT& fx, - FX_FLOAT& fy) = 0; -}; -#endif diff --git a/xfa/include/fwl/adapter/fwl_adapternative.h b/xfa/include/fwl/adapter/fwl_adapternative.h index 6d02610337..b914f7bfb2 100644 --- a/xfa/include/fwl/adapter/fwl_adapternative.h +++ b/xfa/include/fwl/adapter/fwl_adapternative.h @@ -6,13 +6,11 @@ #ifndef _FWL_ADAPTER_NATIVE_H #define _FWL_ADAPTER_NATIVE_H + class IFWL_WidgetMgrDelegate; class IFWL_AdapterWidgetMgr; class IFWL_AdapterThreadMgr; class IFWL_AdapterTimerMgr; -class IFWL_AdapterCursorMgr; -class IFWL_AdapterMonitorMgr; -class IFWL_AdapterClipboardMgr; class IFWL_AdapterNative { public: @@ -21,9 +19,6 @@ class IFWL_AdapterNative { IFWL_WidgetMgrDelegate* pDelegate) = 0; virtual IFWL_AdapterThreadMgr* GetThreadMgr() = 0; virtual IFWL_AdapterTimerMgr* GetTimerMgr() = 0; - virtual IFWL_AdapterCursorMgr* GetCursorMgr() = 0; - virtual IFWL_AdapterMonitorMgr* GetMonitorMgr() = 0; - virtual IFWL_AdapterClipboardMgr* GetClipboardMgr() = 0; }; IFWL_AdapterNative* FWL_CreateFuelAdapterNative(); void FWL_ReleaseFuelAdapterNative(IFWL_AdapterNative* pAdapterNative); diff --git a/xfa/include/fwl/fwl.h b/xfa/include/fwl/fwl.h index f0b4b1519a..999e9a9fc1 100644 --- a/xfa/include/fwl/fwl.h +++ b/xfa/include/fwl/fwl.h @@ -71,8 +71,5 @@ #include "xfa/include/fwl/adapter/fwl_adapterthreadmgr.h" #include "xfa/include/fwl/adapter/fwl_adaptertimermgr.h" #include "xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h" -#include "xfa/include/fwl/adapter/fwl_adaptercursormgr.h" -#include "xfa/include/fwl/adapter/fwl_adaptermonitormgr.h" -#include "xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h" #include "xfa/include/fwl/adapter/fwl_sdadapterimp.h" #endif diff --git a/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp b/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp index 2237953907..2aa072ed2d 100644 --- a/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp @@ -1786,15 +1786,7 @@ void CFWL_ComboProxyImpDelegate::OnLButtonDown(CFWL_MsgMouse* pMsg) { m_bLButtonDown = FALSE; pDriver->SetGrab(m_pForm, FALSE); m_pComboBox->ShowDropList(FALSE); - return; } - IFWL_AdapterNative* pNative = FWL_GetAdapterNative(); - IFWL_AdapterCursorMgr* pCursorMgr = pNative->GetCursorMgr(); - FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNS); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - m_pForm->TransformTo(NULL, pMsg->m_fx, pMsg->m_fy); - m_fStartPos = pMsg->m_fy; } void CFWL_ComboProxyImpDelegate::OnLButtonUp(CFWL_MsgMouse* pMsg) { m_bLButtonDown = FALSE; @@ -1817,41 +1809,6 @@ void CFWL_ComboProxyImpDelegate::OnLButtonUp(CFWL_MsgMouse* pMsg) { } } void CFWL_ComboProxyImpDelegate::OnMouseMove(CFWL_MsgMouse* pMsg) { - IFWL_AdapterNative* pNative = FWL_GetAdapterNative(); - IFWL_AdapterCursorMgr* pCursorMgr = pNative->GetCursorMgr(); - FWL_CURSORTYPE cursorType = FWL_CURSORTYPE_Arrow; - if (m_pComboBox->m_rtHandler.Contains(pMsg->m_fx, pMsg->m_fy)) { - cursorType = FWL_CURSORTYPE_SizeNS; - } - FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(cursorType); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - if (!m_bLButtonDown) { - return; - } - m_pForm->TransformTo(NULL, pMsg->m_fx, pMsg->m_fy); - FX_FLOAT fChanged = pMsg->m_fy - m_fStartPos; - if (m_pComboBox->m_bUpFormHandler) { - fChanged = m_fStartPos - pMsg->m_fy; - } - if (m_pComboBox->m_rtList.height + fChanged < m_pComboBox->m_fItemHeight) { - return; - } - m_pComboBox->m_rtList.height += fChanged; - m_pComboBox->m_rtProxy.height += fChanged; - if (m_pComboBox->m_bUpFormHandler) { - m_pComboBox->m_rtProxy.top -= fChanged; - m_pComboBox->m_rtHandler.Set(0, 0, m_pComboBox->m_rtList.width, - m_pComboBox->m_fComboFormHandler); - } else { - m_pComboBox->m_rtHandler.Set(0, m_pComboBox->m_rtList.height, - m_pComboBox->m_rtList.width, - m_pComboBox->m_fComboFormHandler); - } - m_pForm->SetWidgetRect(m_pComboBox->m_rtProxy); - m_pComboBox->m_pListBox->SetWidgetRect(m_pComboBox->m_rtList); - m_pComboBox->m_pListBox->Update(); - m_fStartPos = pMsg->m_fy; } void CFWL_ComboProxyImpDelegate::OnDeactive(CFWL_MsgDeactivate* pMsg) { m_pComboBox->ShowDropList(FALSE); diff --git a/xfa/src/fwl/src/basewidget/fwl_editimp.cpp b/xfa/src/fwl/src/basewidget/fwl_editimp.cpp index 45b94d13b0..f5342d0f52 100644 --- a/xfa/src/fwl/src/basewidget/fwl_editimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_editimp.cpp @@ -648,56 +648,7 @@ FWL_ERR CFWL_EditImp::DoClipboard(int32_t iCmd) { (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled)) { return FWL_ERR_Succeeded; } - IFWL_AdapterNative* pNative = FWL_GetAdapterNative(); - if (!pNative) - return FWL_ERR_Indefinite; - IFWL_AdapterClipboardMgr* pClipBorder = pNative->GetClipboardMgr(); - if (!pClipBorder) - return FWL_ERR_Indefinite; - CFX_WideString wsText; - switch (iCmd) { - case 1: { - int32_t nStart; - int32_t nCount = m_pEdtEngine->GetSelRange(0, nStart); - if (nCount < 1) { - break; - } - m_pEdtEngine->GetText(wsText, nStart, nCount); - pClipBorder->SetStringData(wsText); - break; - } - case 2: { - int32_t nStart; - int32_t nCount = m_pEdtEngine->GetSelRange(0, nStart); - if (nCount < 1) { - break; - } - m_pEdtEngine->GetText(wsText, nStart, nCount); - m_pEdtEngine->DeleteRange(nStart, nCount); - m_pEdtEngine->ClearSelection(); - pClipBorder->SetStringData(wsText); - break; - } - case 3: { - pClipBorder->GetStringData(wsText); - int32_t iLen = wsText.GetLength(); - if (iLen < 0) { - break; - } - if (wsText[iLen] == L'\0') { - if (iLen == 1) { - break; - } - iLen--; - wsText = wsText.Left(iLen); - } - int32_t nPos = m_pEdtEngine->GetCaretPos(); - m_pEdtEngine->Insert(nPos, wsText, iLen); - break; - } - default: {} - } - return FWL_ERR_Succeeded; + return FWL_ERR_Indefinite; } FX_BOOL CFWL_EditImp::Copy(CFX_WideString& wsCopy) { if (!m_pEdtEngine) @@ -2205,14 +2156,4 @@ FX_BOOL CFWL_EditImpDelegate::OnScroll(IFWL_ScrollBar* pScrollBar, return TRUE; } void CFWL_EditImpDelegate::DoCursor(CFWL_MsgMouse* pMsg) { - if (m_pOwner->m_rtClient.Contains(pMsg->m_fx, pMsg->m_fy)) { - IFWL_AdapterNative* pNative = FWL_GetAdapterNative(); - IFWL_AdapterCursorMgr* pCursorMgr = pNative->GetCursorMgr(); - if (NULL != pCursorMgr) { - FWL_HCURSOR hCursor = - pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_InputBeam); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - } - } } diff --git a/xfa/src/fwl/src/core/fwl_formimp.cpp b/xfa/src/fwl/src/core/fwl_formimp.cpp index ae450f353d..d98d9d9ce6 100644 --- a/xfa/src/fwl/src/core/fwl_formimp.cpp +++ b/xfa/src/fwl/src/core/fwl_formimp.cpp @@ -648,78 +648,6 @@ void CFWL_FormImp::SetWorkAreaRect() { Repaint(&m_rtRelative); } void CFWL_FormImp::SetCursor(FX_FLOAT fx, FX_FLOAT fy) { - IFWL_AdapterNative* pNative = FWL_GetAdapterNative(); - IFWL_AdapterCursorMgr* pCursorMgr = pNative->GetCursorMgr(); - if (!pCursorMgr) - return; - FX_DWORD dwHitTest = HitTest(fx, fy); - switch (dwHitTest) { - case FWL_WGTHITTEST_Right: { - FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeWE); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - m_eResizeType = FORM_RESIZETYPE_Right; - break; - } - case FWL_WGTHITTEST_Bottom: { - FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNS); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - m_eResizeType = FORM_RESIZETYPE_Bottom; - break; - } - case FWL_WGTHITTEST_Left: { - FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeWE); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - m_eResizeType = FORM_RESIZETYPE_Left; - break; - } - case FWL_WGTHITTEST_Top: { - FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNS); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - m_eResizeType = FORM_RESIZETYPE_Top; - break; - } - case FWL_WGTHITTEST_LeftTop: { - FWL_HCURSOR hCursor = - pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNWSE); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - m_eResizeType = FORM_RESIZETYPE_LeftTop; - break; - } - case FWL_WGTHITTEST_LeftBottom: { - FWL_HCURSOR hCursor = - pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNESW); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - m_eResizeType = FORM_RESIZETYPE_LeftBottom; - break; - } - case FWL_WGTHITTEST_RightTop: { - FWL_HCURSOR hCursor = - pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNESW); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - m_eResizeType = FORM_RESIZETYPE_RightTop; - break; - } - case FWL_WGTHITTEST_RightBottom: { - FWL_HCURSOR hCursor = - pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNWSE); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - m_eResizeType = FORM_RESIZETYPE_RightBottom; - break; - } - default: { - FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_Arrow); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - } - } } void CFWL_FormImp::Layout() { GetRelativeRect(m_rtRelative); @@ -1144,195 +1072,7 @@ void CFWL_FormImpDelegate::OnLButtonUp(CFWL_MsgMouse* pMsg) { } } void CFWL_FormImpDelegate::OnMouseMove(CFWL_MsgMouse* pMsg) { - CFWL_WidgetMgr* pWidgetMgr = static_cast(FWL_GetWidgetMgr()); if (m_pOwner->m_bLButtonDown) { - IFWL_AdapterNative* pNative = FWL_GetAdapterNative(); - IFWL_AdapterCursorMgr* pCursorMgr = pNative->GetCursorMgr(); - if (!pCursorMgr) - return; - CFWL_SysBtn* pPressedBtn = - m_pOwner->GetSysBtnByIndex(m_pOwner->m_iCaptureBtn); - FX_FLOAT fTop, fLeft, fWidth, fHeight; - fTop = m_pOwner->m_pProperties->m_rtWidget.top; - fLeft = m_pOwner->m_pProperties->m_rtWidget.left; - fWidth = m_pOwner->m_pProperties->m_rtWidget.width; - fHeight = m_pOwner->m_pProperties->m_rtWidget.height; - FX_FLOAT fWidthMax, fWidthMin, fHeightMax, fHeightMin; - if (m_pOwner->m_pContent) { - m_pOwner->GetContent()->GetMaxSize(fWidthMax, fHeightMax); - m_pOwner->GetContent()->GetMinSize(fWidthMin, fHeightMin); - } else { - fWidthMax = fHeightMax = 1024 * 4; - fWidthMin = fHeightMin = 0; - } - FX_BOOL bWidthlimit = (fWidthMin != 0 || fWidthMax != 0); - FX_BOOL bHeightlimit = (fHeightMin != 0 || fHeightMax != 0); - FX_BOOL bSizelimit = bWidthlimit || bHeightlimit; - if (fWidthMax != 0 || fHeightMax != 0 || fWidthMin != 0 || - fHeightMin != 0) { - bSizelimit = TRUE; - } - if (pPressedBtn) { - if (!pPressedBtn->m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { - pPressedBtn->SetNormal(); - } else { - pPressedBtn->SetPressed(); - } - m_pOwner->Repaint(&pPressedBtn->m_rtBtn); - return; - } else if (m_pOwner->m_bMaximized) { - return; - } else if (m_pOwner->m_eResizeType == FORM_RESIZETYPE_Cap) { - m_pOwner->m_pProperties->m_rtWidget.Offset( - pMsg->m_fx - m_pOwner->m_InfoStart.m_ptStart.x, - pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y); - pWidgetMgr->SetWidgetPosition_Native( - m_pOwner->m_pInterface, m_pOwner->m_pProperties->m_rtWidget.left, - m_pOwner->m_pProperties->m_rtWidget.top); - return; - } else if (m_pOwner->m_eResizeType == FORM_RESIZETYPE_Right) { - FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeWE); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - if (!bWidthlimit) { - fWidth += pMsg->m_fx - m_pOwner->m_InfoStart.m_ptStart.x; - m_pOwner->m_InfoStart.m_ptStart.x = pMsg->m_fx; - } else { - m_pOwner->DoWidthLimit(fLeft, fWidth, pMsg->m_fx, - m_pOwner->m_InfoStart.m_szStart.x - - m_pOwner->m_InfoStart.m_ptStart.x, - fWidthMin, fWidthMax, FALSE); - } - } else if (m_pOwner->m_eResizeType == FORM_RESIZETYPE_Left) { - FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeWE); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - if (!bWidthlimit) { - fLeft -= m_pOwner->m_InfoStart.m_ptStart.x - pMsg->m_fx; - fWidth += m_pOwner->m_InfoStart.m_ptStart.x - pMsg->m_fx; - } else { - m_pOwner->DoWidthLimit(fLeft, fWidth, pMsg->m_fx, - m_pOwner->m_InfoStart.m_ptStart.x, fWidthMin, - fWidthMax, TRUE); - } - } else if (m_pOwner->m_eResizeType == FORM_RESIZETYPE_Bottom) { - FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNS); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - if (!bHeightlimit) { - fHeight += pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y; - m_pOwner->m_InfoStart.m_ptStart.y = pMsg->m_fy; - } else { - m_pOwner->DoHeightLimit(fTop, fHeight, pMsg->m_fy, - m_pOwner->m_InfoStart.m_szStart.y - - m_pOwner->m_InfoStart.m_ptStart.y, - fHeightMin, fHeightMax, FALSE); - } - } else if (m_pOwner->m_eResizeType == FORM_RESIZETYPE_Top) { - FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNS); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - if (!bHeightlimit) { - fTop += pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y; - fHeight -= pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y; - } else { - m_pOwner->DoHeightLimit(fTop, fHeight, pMsg->m_fy, - m_pOwner->m_InfoStart.m_ptStart.y, fHeightMin, - fHeightMax, TRUE); - } - } else if (m_pOwner->m_eResizeType == FORM_RESIZETYPE_LeftTop) { - FWL_HCURSOR hCursor = - pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNWSE); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - if (!bSizelimit) { - fLeft -= m_pOwner->m_InfoStart.m_ptStart.x - pMsg->m_fx; - fTop += pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y; - fWidth += m_pOwner->m_InfoStart.m_ptStart.x - pMsg->m_fx; - fHeight -= pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y; - m_pOwner->m_InfoStart.m_ptStart.x = pMsg->m_fx; - m_pOwner->m_InfoStart.m_ptStart.y = pMsg->m_fy; - } else { - m_pOwner->DoWidthLimit(fLeft, fWidth, pMsg->m_fx, - m_pOwner->m_InfoStart.m_ptStart.x, fWidthMin, - fWidthMax, TRUE); - m_pOwner->DoHeightLimit(fTop, fHeight, pMsg->m_fy, - m_pOwner->m_InfoStart.m_ptStart.y, fHeightMin, - fHeightMax, TRUE); - } - } else if (m_pOwner->m_eResizeType == FORM_RESIZETYPE_LeftBottom) { - FWL_HCURSOR hCursor = - pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNESW); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - if (!bSizelimit) { - fLeft -= m_pOwner->m_InfoStart.m_ptStart.x - pMsg->m_fx; - fWidth += m_pOwner->m_InfoStart.m_ptStart.x - pMsg->m_fx; - fHeight += pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y; - m_pOwner->m_InfoStart.m_ptStart.x = pMsg->m_fx; - m_pOwner->m_InfoStart.m_ptStart.y = pMsg->m_fy; - } else { - m_pOwner->DoWidthLimit(fLeft, fWidth, pMsg->m_fx, - m_pOwner->m_InfoStart.m_ptStart.x, fWidthMin, - fWidthMax, TRUE); - m_pOwner->DoHeightLimit(fTop, fHeight, pMsg->m_fy, - m_pOwner->m_InfoStart.m_szStart.y - - m_pOwner->m_InfoStart.m_ptStart.y, - fHeightMin, fHeightMax, FALSE); - } - } else if (m_pOwner->m_eResizeType == FORM_RESIZETYPE_RightTop) { - FWL_HCURSOR hCursor = - pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNESW); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - if (!bSizelimit) { - fTop += pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y; - fWidth += pMsg->m_fx - m_pOwner->m_InfoStart.m_ptStart.x; - fHeight -= pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y; - m_pOwner->m_InfoStart.m_ptStart.x = pMsg->m_fx; - m_pOwner->m_InfoStart.m_ptStart.y = pMsg->m_fy; - } else { - m_pOwner->DoWidthLimit(fLeft, fWidth, pMsg->m_fx, - m_pOwner->m_InfoStart.m_szStart.x - - m_pOwner->m_InfoStart.m_ptStart.x, - fWidthMin, fWidthMax, FALSE); - m_pOwner->DoHeightLimit(fTop, fHeight, pMsg->m_fy, - m_pOwner->m_InfoStart.m_ptStart.y, fHeightMin, - fHeightMax, TRUE); - } - } else if (m_pOwner->m_eResizeType == FORM_RESIZETYPE_RightBottom) { - FWL_HCURSOR hCursor = - pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNWSE); - pCursorMgr->SetCursor(hCursor); - pCursorMgr->ShowCursor(TRUE); - if (!bSizelimit) { - fWidth += pMsg->m_fx - m_pOwner->m_InfoStart.m_ptStart.x; - fHeight += pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y; - m_pOwner->m_InfoStart.m_ptStart.x = pMsg->m_fx; - m_pOwner->m_InfoStart.m_ptStart.y = pMsg->m_fy; - } else { - m_pOwner->DoWidthLimit(fLeft, fWidth, pMsg->m_fx, - m_pOwner->m_InfoStart.m_szStart.x - - m_pOwner->m_InfoStart.m_ptStart.x, - fWidthMin, fWidthMax, FALSE); - m_pOwner->DoHeightLimit(fTop, fHeight, pMsg->m_fy, - m_pOwner->m_InfoStart.m_szStart.y - - m_pOwner->m_InfoStart.m_ptStart.y, - fHeightMin, fHeightMax, FALSE); - } - } - if (m_pOwner->m_pContent) { - } - CFX_RectF rtForm; - rtForm.Set(fLeft, fTop, fWidth, fHeight); -#if (_FX_OS_ == _FX_MACOSX_) - m_pOwner->m_pProperties->m_rtWidget = rtForm; - m_pOwner->Update(); - m_pOwner->SetWidgetRect(rtForm); -#else - m_pOwner->SetWidgetRect(rtForm); - m_pOwner->Update(); -#endif return; } if ((m_pOwner->m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border) && diff --git a/xfa/src/fwl/src/core/fwl_widgetimp.cpp b/xfa/src/fwl/src/core/fwl_widgetimp.cpp index 3021796a57..beae23db08 100644 --- a/xfa/src/fwl/src/core/fwl_widgetimp.cpp +++ b/xfa/src/fwl/src/core/fwl_widgetimp.cpp @@ -803,13 +803,7 @@ FX_BOOL CFWL_WidgetImp::GetPopupPosGeneral(FX_FLOAT fMinHeight, return TRUE; } FX_BOOL CFWL_WidgetImp::GetScreenSize(FX_FLOAT& fx, FX_FLOAT& fy) { - IFWL_AdapterNative* pNative = FWL_GetAdapterNative(); - IFWL_AdapterMonitorMgr* pMonitorMgr = pNative->GetMonitorMgr(); - if (!pMonitorMgr) - return FALSE; - FWL_HMONITOR hMonitor = pMonitorMgr->GetMonitorByPoint(fx, fy); - pMonitorMgr->GetMonitorSize(hMonitor, fx, fy); - return TRUE; + return FALSE; } void CFWL_WidgetImp::RegisterEventTarget(IFWL_Widget* pEventSource, FX_DWORD dwFilter) { diff --git a/xfa/src/fwl/src/core/fwl_widgetmgrimp.cpp b/xfa/src/fwl/src/core/fwl_widgetmgrimp.cpp index 610345f1d4..577ff07909 100644 --- a/xfa/src/fwl/src/core/fwl_widgetmgrimp.cpp +++ b/xfa/src/fwl/src/core/fwl_widgetmgrimp.cpp @@ -33,13 +33,6 @@ CFWL_WidgetMgr::CFWL_WidgetMgr(IFWL_AdapterNative* pAdapterNative) m_mapWidgetItem.SetAt(NULL, pRoot); #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) m_rtScreen.Reset(); - IFWL_AdapterMonitorMgr* pMonitorMgr = pAdapterNative->GetMonitorMgr(); - if (pMonitorMgr) { - FWL_HMONITOR monitor = pMonitorMgr->GetCurrentMonitor(); - if (monitor) { - pMonitorMgr->GetMonitorSize(monitor, m_rtScreen.width, m_rtScreen.height); - } - } #endif } CFWL_WidgetMgr::~CFWL_WidgetMgr() { diff --git a/xfa/src/fxfa/src/app/xfa_ffapp.cpp b/xfa/src/fxfa/src/app/xfa_ffapp.cpp index c9e791a3be..e153d956c5 100644 --- a/xfa/src/fxfa/src/app/xfa_ffapp.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffapp.cpp @@ -204,12 +204,3 @@ IFWL_AdapterThreadMgr* CXFA_FFApp::GetThreadMgr() { IFWL_AdapterTimerMgr* CXFA_FFApp::GetTimerMgr() { return m_pProvider->GetTimerMgr(); } -IFWL_AdapterCursorMgr* CXFA_FFApp::GetCursorMgr() { - return NULL; -} -IFWL_AdapterMonitorMgr* CXFA_FFApp::GetMonitorMgr() { - return NULL; -} -IFWL_AdapterClipboardMgr* CXFA_FFApp::GetClipboardMgr() { - return NULL; -} diff --git a/xfa/src/fxfa/src/app/xfa_ffapp.h b/xfa/src/fxfa/src/app/xfa_ffapp.h index 52ad2af16c..515e192430 100644 --- a/xfa/src/fxfa/src/app/xfa_ffapp.h +++ b/xfa/src/fxfa/src/app/xfa_ffapp.h @@ -45,9 +45,6 @@ class CXFA_FFApp : public IXFA_App, public IFWL_AdapterNative { IFWL_WidgetMgrDelegate* pDelegate) override; IFWL_AdapterThreadMgr* GetThreadMgr() override; IFWL_AdapterTimerMgr* GetTimerMgr() override; - IFWL_AdapterCursorMgr* GetCursorMgr() override; - IFWL_AdapterMonitorMgr* GetMonitorMgr() override; - IFWL_AdapterClipboardMgr* GetClipboardMgr() override; CXFA_FontMgr* GetXFAFontMgr(); IFX_FontMgr* GetFDEFontMgr(); -- cgit v1.2.3