OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa/fxfa/include/xfa_ffwidget.h" | 7 #include "xfa/fxfa/include/xfa_ffwidget.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 return; | 1172 return; |
1173 } | 1173 } |
1174 FX_FLOAT fLeftInset, fTopInset, fRightInset, fBottomInset; | 1174 FX_FLOAT fLeftInset, fTopInset, fRightInset, fBottomInset; |
1175 mg.GetLeftInset(fLeftInset); | 1175 mg.GetLeftInset(fLeftInset); |
1176 mg.GetTopInset(fTopInset); | 1176 mg.GetTopInset(fTopInset); |
1177 mg.GetRightInset(fRightInset); | 1177 mg.GetRightInset(fRightInset); |
1178 mg.GetBottomInset(fBottomInset); | 1178 mg.GetBottomInset(fBottomInset); |
1179 rt.Deflate(fLeftInset, fTopInset, fRightInset, fBottomInset); | 1179 rt.Deflate(fLeftInset, fTopInset, fRightInset, fBottomInset); |
1180 } | 1180 } |
1181 CXFA_FFWidget* XFA_GetWidgetFromLayoutItem(CXFA_LayoutItem* pLayoutItem) { | 1181 CXFA_FFWidget* XFA_GetWidgetFromLayoutItem(CXFA_LayoutItem* pLayoutItem) { |
1182 XFA_Element iType = pLayoutItem->GetFormNode()->GetClassID(); | 1182 XFA_Element iType = pLayoutItem->GetFormNode()->GetElementType(); |
1183 if (XFA_IsCreateWidget(iType)) { | 1183 if (XFA_IsCreateWidget(iType)) { |
1184 return static_cast<CXFA_FFWidget*>(pLayoutItem); | 1184 return static_cast<CXFA_FFWidget*>(pLayoutItem); |
1185 } | 1185 } |
1186 return nullptr; | 1186 return nullptr; |
1187 } | 1187 } |
1188 FX_BOOL XFA_IsCreateWidget(XFA_Element iType) { | 1188 FX_BOOL XFA_IsCreateWidget(XFA_Element iType) { |
1189 return iType == XFA_Element::Field || iType == XFA_Element::Draw || | 1189 return iType == XFA_Element::Field || iType == XFA_Element::Draw || |
1190 iType == XFA_Element::Subform || iType == XFA_Element::ExclGroup; | 1190 iType == XFA_Element::Subform || iType == XFA_Element::ExclGroup; |
1191 } | 1191 } |
1192 static void XFA_BOX_GetPath_Arc(CXFA_Box box, | 1192 static void XFA_BOX_GetPath_Arc(CXFA_Box box, |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2026 XFA_BOX_Stroke_Rect(box, strokes, pGS, rtWidget, pMatrix); | 2026 XFA_BOX_Stroke_Rect(box, strokes, pGS, rtWidget, pMatrix); |
2027 } | 2027 } |
2028 void XFA_DrawBox(CXFA_Box box, | 2028 void XFA_DrawBox(CXFA_Box box, |
2029 CFX_Graphics* pGS, | 2029 CFX_Graphics* pGS, |
2030 const CFX_RectF& rtWidget, | 2030 const CFX_RectF& rtWidget, |
2031 CFX_Matrix* pMatrix, | 2031 CFX_Matrix* pMatrix, |
2032 uint32_t dwFlags) { | 2032 uint32_t dwFlags) { |
2033 if (!box || box.GetPresence() != XFA_ATTRIBUTEENUM_Visible) | 2033 if (!box || box.GetPresence() != XFA_ATTRIBUTEENUM_Visible) |
2034 return; | 2034 return; |
2035 | 2035 |
2036 XFA_Element iType = box.GetClassID(); | 2036 XFA_Element iType = box.GetElementType(); |
2037 if (iType != XFA_Element::Arc && iType != XFA_Element::Border && | 2037 if (iType != XFA_Element::Arc && iType != XFA_Element::Border && |
2038 iType != XFA_Element::Rectangle) { | 2038 iType != XFA_Element::Rectangle) { |
2039 return; | 2039 return; |
2040 } | 2040 } |
2041 CXFA_StrokeArray strokes; | 2041 CXFA_StrokeArray strokes; |
2042 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_Element::Arc) { | 2042 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_Element::Arc) { |
2043 box.GetStrokes(strokes); | 2043 box.GetStrokes(strokes); |
2044 } | 2044 } |
2045 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); | 2045 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); |
2046 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); | 2046 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); |
2047 } | 2047 } |
2048 | 2048 |
2049 CXFA_CalcData::CXFA_CalcData() : m_iRefCount(0) {} | 2049 CXFA_CalcData::CXFA_CalcData() : m_iRefCount(0) {} |
2050 | 2050 |
2051 CXFA_CalcData::~CXFA_CalcData() { | 2051 CXFA_CalcData::~CXFA_CalcData() { |
2052 m_Globals.RemoveAll(); | 2052 m_Globals.RemoveAll(); |
2053 } | 2053 } |
OLD | NEW |