From 1770c021cf998ff1b33855b1397f6ea8ff9f7cd7 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 14 Mar 2016 14:14:16 -0400 Subject: Move xfa/src up to xfa/. This CL moves the xfa/src files up to the xfa/ directory and fixes the includes, include guards, and build files. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1803723002 . --- xfa/fwl/core/fwl_contentimp.cpp | 94 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 xfa/fwl/core/fwl_contentimp.cpp (limited to 'xfa/fwl/core/fwl_contentimp.cpp') diff --git a/xfa/fwl/core/fwl_contentimp.cpp b/xfa/fwl/core/fwl_contentimp.cpp new file mode 100644 index 0000000000..a38998f0cf --- /dev/null +++ b/xfa/fwl/core/fwl_contentimp.cpp @@ -0,0 +1,94 @@ +// 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_contentimp.h" + +#include "xfa/fwl/core/fwl_noteimp.h" +#include "xfa/fwl/core/fwl_targetimp.h" +#include "xfa/fwl/core/fwl_threadimp.h" +#include "xfa/fwl/core/fwl_widgetimp.h" +#include "xfa/fwl/core/fwl_widgetmgrimp.h" +#include "xfa/include/fwl/core/fwl_content.h" + +FWL_ERR IFWL_Content::InsertWidget(IFWL_Widget* pChild, int32_t nIndex) { + return static_cast(GetImpl())->InsertWidget(pChild, nIndex); +} +FWL_ERR IFWL_Content::RemoveWidget(IFWL_Widget* pWidget) { + return static_cast(GetImpl())->RemoveWidget(pWidget); +} +FWL_ERR IFWL_Content::RemoveAllWidgets() { + return static_cast(GetImpl())->RemoveAllWidgets(); +} +FWL_ERR IFWL_Content::GetMinSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight) { + return static_cast(GetImpl())->GetMinSize(fWidth, fHeight); +} +FWL_ERR IFWL_Content::SetMinSize(FX_FLOAT fWidth, FX_FLOAT fHeight) { + return static_cast(GetImpl())->SetMinSize(fWidth, fHeight); +} +FWL_ERR IFWL_Content::GetMaxSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight) { + return static_cast(GetImpl())->GetMaxSize(fWidth, fHeight); +} +FWL_ERR IFWL_Content::SetMaxSize(FX_FLOAT fWidth, FX_FLOAT fHeight) { + return static_cast(GetImpl())->SetMaxSize(fWidth, fHeight); +} +IFWL_Content::IFWL_Content() {} +CFWL_ContentImp::CFWL_ContentImp(const CFWL_WidgetImpProperties& properties, + IFWL_Widget* pOuter) + : CFWL_WidgetImp(properties, pOuter), + m_fWidthMin(0), + m_fWidthMax(10000), + m_fHeightMin(0), + m_fHeightMax(10000) {} +CFWL_ContentImp::~CFWL_ContentImp() {} +FWL_ERR CFWL_ContentImp::InsertWidget(IFWL_Widget* pChild, int32_t nIndex) { + if (!pChild) + return FWL_ERR_Indefinite; + pChild->SetParent(m_pInterface); + if (nIndex == -1) { + return FWL_ERR_Succeeded; + } + CFWL_WidgetMgr* pMgr = static_cast(FWL_GetWidgetMgr()); + if (!pMgr) + return FWL_ERR_Indefinite; + pMgr->SetWidgetIndex(pChild, nIndex); + return FWL_ERR_Succeeded; +} +FWL_ERR CFWL_ContentImp::RemoveWidget(IFWL_Widget* pWidget) { + if (!pWidget) + return FWL_ERR_Indefinite; + pWidget->SetParent(NULL); + return FWL_ERR_Succeeded; +} +FWL_ERR CFWL_ContentImp::RemoveAllWidgets() { + CFWL_WidgetMgr* pMgr = static_cast(FWL_GetWidgetMgr()); + if (!pMgr) + return FWL_ERR_Indefinite; + while (IFWL_Widget* widget = + pMgr->GetWidget(m_pInterface, FWL_WGTRELATION_FirstChild)) { + pMgr->SetParent(NULL, widget); + } + return FWL_ERR_Succeeded; +} +FWL_ERR CFWL_ContentImp::GetMinSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight) { + fWidth = m_fWidthMin; + fHeight = m_fHeightMin; + return FWL_ERR_Succeeded; +} +FWL_ERR CFWL_ContentImp::SetMinSize(FX_FLOAT fWidth, FX_FLOAT fHeight) { + m_fWidthMin = fWidth; + m_fHeightMin = fHeight; + return FWL_ERR_Succeeded; +} +FWL_ERR CFWL_ContentImp::GetMaxSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight) { + fWidth = m_fWidthMax; + fHeight = m_fHeightMax; + return FWL_ERR_Succeeded; +} +FWL_ERR CFWL_ContentImp::SetMaxSize(FX_FLOAT fWidth, FX_FLOAT fHeight) { + m_fWidthMax = fWidth; + m_fHeightMax = fHeight; + return FWL_ERR_Succeeded; +} -- cgit v1.2.3