1*3ac0a46fSAndroid Build Coastguard Worker // Copyright 2014 The PDFium Authors
2*3ac0a46fSAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be
3*3ac0a46fSAndroid Build Coastguard Worker // found in the LICENSE file.
4*3ac0a46fSAndroid Build Coastguard Worker
5*3ac0a46fSAndroid Build Coastguard Worker // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6*3ac0a46fSAndroid Build Coastguard Worker
7*3ac0a46fSAndroid Build Coastguard Worker #include "xfa/fxfa/cxfa_fwladapterwidgetmgr.h"
8*3ac0a46fSAndroid Build Coastguard Worker
9*3ac0a46fSAndroid Build Coastguard Worker #include "core/fxcrt/fx_coordinates.h"
10*3ac0a46fSAndroid Build Coastguard Worker #include "xfa/fxfa/cxfa_ffdoc.h"
11*3ac0a46fSAndroid Build Coastguard Worker #include "xfa/fxfa/cxfa_fffield.h"
12*3ac0a46fSAndroid Build Coastguard Worker
13*3ac0a46fSAndroid Build Coastguard Worker CXFA_FWLAdapterWidgetMgr::CXFA_FWLAdapterWidgetMgr() = default;
14*3ac0a46fSAndroid Build Coastguard Worker
15*3ac0a46fSAndroid Build Coastguard Worker CXFA_FWLAdapterWidgetMgr::~CXFA_FWLAdapterWidgetMgr() = default;
16*3ac0a46fSAndroid Build Coastguard Worker
Trace(cppgc::Visitor * visitor) const17*3ac0a46fSAndroid Build Coastguard Worker void CXFA_FWLAdapterWidgetMgr::Trace(cppgc::Visitor* visitor) const {}
18*3ac0a46fSAndroid Build Coastguard Worker
RepaintWidget(CFWL_Widget * pWidget)19*3ac0a46fSAndroid Build Coastguard Worker void CXFA_FWLAdapterWidgetMgr::RepaintWidget(CFWL_Widget* pWidget) {
20*3ac0a46fSAndroid Build Coastguard Worker if (!pWidget)
21*3ac0a46fSAndroid Build Coastguard Worker return;
22*3ac0a46fSAndroid Build Coastguard Worker
23*3ac0a46fSAndroid Build Coastguard Worker auto* pFFWidget = static_cast<CXFA_FFWidget*>(pWidget->GetAdapterIface());
24*3ac0a46fSAndroid Build Coastguard Worker if (!pFFWidget)
25*3ac0a46fSAndroid Build Coastguard Worker return;
26*3ac0a46fSAndroid Build Coastguard Worker
27*3ac0a46fSAndroid Build Coastguard Worker pFFWidget->InvalidateRect();
28*3ac0a46fSAndroid Build Coastguard Worker }
29*3ac0a46fSAndroid Build Coastguard Worker
GetPopupPos(CFWL_Widget * pWidget,float fMinHeight,float fMaxHeight,const CFX_RectF & rtAnchor,CFX_RectF * pPopupRect)30*3ac0a46fSAndroid Build Coastguard Worker bool CXFA_FWLAdapterWidgetMgr::GetPopupPos(CFWL_Widget* pWidget,
31*3ac0a46fSAndroid Build Coastguard Worker float fMinHeight,
32*3ac0a46fSAndroid Build Coastguard Worker float fMaxHeight,
33*3ac0a46fSAndroid Build Coastguard Worker const CFX_RectF& rtAnchor,
34*3ac0a46fSAndroid Build Coastguard Worker CFX_RectF* pPopupRect) {
35*3ac0a46fSAndroid Build Coastguard Worker auto* pFFWidget = static_cast<CXFA_FFWidget*>(pWidget->GetAdapterIface());
36*3ac0a46fSAndroid Build Coastguard Worker CFX_RectF rtRotateAnchor =
37*3ac0a46fSAndroid Build Coastguard Worker pFFWidget->GetRotateMatrix().TransformRect(rtAnchor);
38*3ac0a46fSAndroid Build Coastguard Worker pFFWidget->GetDoc()->GetPopupPos(pFFWidget, fMinHeight, fMaxHeight,
39*3ac0a46fSAndroid Build Coastguard Worker rtRotateAnchor, pPopupRect);
40*3ac0a46fSAndroid Build Coastguard Worker return true;
41*3ac0a46fSAndroid Build Coastguard Worker }
42