OLD | NEW |
| (Empty) |
1 // Copyright 2014 PDFium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
6 | |
7 #include "xfa/src/fxfa/app/xfa_fwladapter.h" | |
8 | |
9 #include "xfa/src/fxfa/app/xfa_ffdoc.h" | |
10 #include "xfa/src/fxfa/app/xfa_fffield.h" | |
11 #include "xfa/src/fxfa/app/xfa_ffwidget.h" | |
12 | |
13 void FWL_PostMessageToMainRoop(CFWL_Message* pMessage) {} | |
14 FX_BOOL FWL_ShowCaret(IFWL_Widget* pWidget, | |
15 FX_BOOL bVisible, | |
16 const CFX_RectF* pRtAnchor) { | |
17 CXFA_FFWidget* pXFAWidget = (CXFA_FFWidget*)pWidget->GetPrivateData(pWidget); | |
18 if (!pXFAWidget) { | |
19 return FALSE; | |
20 } | |
21 IXFA_DocProvider* pDocProvider = pXFAWidget->GetDoc()->GetDocProvider(); | |
22 if (!pDocProvider) { | |
23 return FALSE; | |
24 } | |
25 if (bVisible) { | |
26 CFX_Matrix mt; | |
27 pXFAWidget->GetRotateMatrix(mt); | |
28 CFX_RectF rt(*pRtAnchor); | |
29 mt.TransformRect(rt); | |
30 pDocProvider->DisplayCaret(pXFAWidget, bVisible, &rt); | |
31 return TRUE; | |
32 } | |
33 pDocProvider->DisplayCaret(pXFAWidget, bVisible, pRtAnchor); | |
34 return TRUE; | |
35 } | |
36 | |
37 FWL_ERR CXFA_FWLAdapterWidgetMgr::RepaintWidget(IFWL_Widget* pWidget, | |
38 const CFX_RectF* pRect) { | |
39 if (!pWidget) | |
40 return FWL_ERR_Indefinite; | |
41 CXFA_FFField* pField = (CXFA_FFField*)pWidget->GetPrivateData(pWidget); | |
42 if (!pField) | |
43 return FWL_ERR_Indefinite; | |
44 pField->AddInvalidateRect(nullptr); | |
45 return FWL_ERR_Succeeded; | |
46 } | |
47 | |
48 FX_BOOL CXFA_FWLAdapterWidgetMgr::GetPopupPos(IFWL_Widget* pWidget, | |
49 FX_FLOAT fMinHeight, | |
50 FX_FLOAT fMaxHeight, | |
51 const CFX_RectF& rtAnchor, | |
52 CFX_RectF& rtPopup) { | |
53 CXFA_FFWidget* pFFWidget = (CXFA_FFWidget*)(pWidget->GetPrivateData(pWidget)); | |
54 CFX_Matrix mt; | |
55 pFFWidget->GetRotateMatrix(mt); | |
56 CFX_RectF rtRotateAnchor(rtAnchor); | |
57 mt.TransformRect(rtRotateAnchor); | |
58 pFFWidget->GetDoc()->GetDocProvider()->GetPopupPos( | |
59 pFFWidget, fMinHeight, fMaxHeight, rtRotateAnchor, rtPopup); | |
60 return TRUE; | |
61 } | |
OLD | NEW |