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/fwl/theme/cfwl_checkboxtp.h"
8*3ac0a46fSAndroid Build Coastguard Worker
9*3ac0a46fSAndroid Build Coastguard Worker #include <math.h>
10*3ac0a46fSAndroid Build Coastguard Worker
11*3ac0a46fSAndroid Build Coastguard Worker #include <iterator>
12*3ac0a46fSAndroid Build Coastguard Worker
13*3ac0a46fSAndroid Build Coastguard Worker #include "core/fxge/cfx_path.h"
14*3ac0a46fSAndroid Build Coastguard Worker #include "xfa/fde/cfde_textout.h"
15*3ac0a46fSAndroid Build Coastguard Worker #include "xfa/fgas/graphics/cfgas_gecolor.h"
16*3ac0a46fSAndroid Build Coastguard Worker #include "xfa/fgas/graphics/cfgas_gegraphics.h"
17*3ac0a46fSAndroid Build Coastguard Worker #include "xfa/fgas/graphics/cfgas_gepath.h"
18*3ac0a46fSAndroid Build Coastguard Worker #include "xfa/fwl/cfwl_checkbox.h"
19*3ac0a46fSAndroid Build Coastguard Worker #include "xfa/fwl/cfwl_themebackground.h"
20*3ac0a46fSAndroid Build Coastguard Worker #include "xfa/fwl/cfwl_themetext.h"
21*3ac0a46fSAndroid Build Coastguard Worker #include "xfa/fwl/cfwl_widget.h"
22*3ac0a46fSAndroid Build Coastguard Worker
23*3ac0a46fSAndroid Build Coastguard Worker namespace {
24*3ac0a46fSAndroid Build Coastguard Worker
25*3ac0a46fSAndroid Build Coastguard Worker constexpr int kSignPath = 100;
26*3ac0a46fSAndroid Build Coastguard Worker
ScaleBezierPoint(const CFX_PointF & point)27*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF ScaleBezierPoint(const CFX_PointF& point) {
28*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF scaled_point(point);
29*3ac0a46fSAndroid Build Coastguard Worker scaled_point.x *= FXSYS_BEZIER;
30*3ac0a46fSAndroid Build Coastguard Worker scaled_point.y *= FXSYS_BEZIER;
31*3ac0a46fSAndroid Build Coastguard Worker return scaled_point;
32*3ac0a46fSAndroid Build Coastguard Worker }
33*3ac0a46fSAndroid Build Coastguard Worker
34*3ac0a46fSAndroid Build Coastguard Worker } // namespace
35*3ac0a46fSAndroid Build Coastguard Worker
36*3ac0a46fSAndroid Build Coastguard Worker CFWL_CheckBoxTP::CFWL_CheckBoxTP() = default;
37*3ac0a46fSAndroid Build Coastguard Worker
38*3ac0a46fSAndroid Build Coastguard Worker CFWL_CheckBoxTP::~CFWL_CheckBoxTP() = default;
39*3ac0a46fSAndroid Build Coastguard Worker
DrawText(const CFWL_ThemeText & pParams)40*3ac0a46fSAndroid Build Coastguard Worker void CFWL_CheckBoxTP::DrawText(const CFWL_ThemeText& pParams) {
41*3ac0a46fSAndroid Build Coastguard Worker EnsureTTOInitialized(pParams.GetWidget()->GetThemeProvider());
42*3ac0a46fSAndroid Build Coastguard Worker m_pTextOut->SetTextColor(pParams.m_dwStates & CFWL_PartState::kDisabled
43*3ac0a46fSAndroid Build Coastguard Worker ? FWLTHEME_CAPACITY_TextDisColor
44*3ac0a46fSAndroid Build Coastguard Worker : FWLTHEME_CAPACITY_TextColor);
45*3ac0a46fSAndroid Build Coastguard Worker CFWL_WidgetTP::DrawText(pParams);
46*3ac0a46fSAndroid Build Coastguard Worker }
47*3ac0a46fSAndroid Build Coastguard Worker
DrawSignCheck(CFGAS_GEGraphics * pGraphics,const CFX_RectF & rtSign,FX_ARGB argbFill,const CFX_Matrix & matrix)48*3ac0a46fSAndroid Build Coastguard Worker void CFWL_CheckBoxTP::DrawSignCheck(CFGAS_GEGraphics* pGraphics,
49*3ac0a46fSAndroid Build Coastguard Worker const CFX_RectF& rtSign,
50*3ac0a46fSAndroid Build Coastguard Worker FX_ARGB argbFill,
51*3ac0a46fSAndroid Build Coastguard Worker const CFX_Matrix& matrix) {
52*3ac0a46fSAndroid Build Coastguard Worker EnsureCheckPathInitialized(rtSign.width);
53*3ac0a46fSAndroid Build Coastguard Worker DCHECK(m_pCheckPath);
54*3ac0a46fSAndroid Build Coastguard Worker
55*3ac0a46fSAndroid Build Coastguard Worker CFX_Matrix mt;
56*3ac0a46fSAndroid Build Coastguard Worker mt.Translate(rtSign.left, rtSign.top);
57*3ac0a46fSAndroid Build Coastguard Worker mt.Concat(matrix);
58*3ac0a46fSAndroid Build Coastguard Worker
59*3ac0a46fSAndroid Build Coastguard Worker CFGAS_GEGraphics::StateRestorer restorer(pGraphics);
60*3ac0a46fSAndroid Build Coastguard Worker pGraphics->SetFillColor(CFGAS_GEColor(argbFill));
61*3ac0a46fSAndroid Build Coastguard Worker pGraphics->FillPath(*m_pCheckPath, CFX_FillRenderOptions::FillType::kWinding,
62*3ac0a46fSAndroid Build Coastguard Worker mt);
63*3ac0a46fSAndroid Build Coastguard Worker }
64*3ac0a46fSAndroid Build Coastguard Worker
DrawSignCircle(CFGAS_GEGraphics * pGraphics,const CFX_RectF & rtSign,FX_ARGB argbFill,const CFX_Matrix & matrix)65*3ac0a46fSAndroid Build Coastguard Worker void CFWL_CheckBoxTP::DrawSignCircle(CFGAS_GEGraphics* pGraphics,
66*3ac0a46fSAndroid Build Coastguard Worker const CFX_RectF& rtSign,
67*3ac0a46fSAndroid Build Coastguard Worker FX_ARGB argbFill,
68*3ac0a46fSAndroid Build Coastguard Worker const CFX_Matrix& matrix) {
69*3ac0a46fSAndroid Build Coastguard Worker CFGAS_GEPath path;
70*3ac0a46fSAndroid Build Coastguard Worker path.AddEllipse(rtSign);
71*3ac0a46fSAndroid Build Coastguard Worker
72*3ac0a46fSAndroid Build Coastguard Worker CFGAS_GEGraphics::StateRestorer restorer(pGraphics);
73*3ac0a46fSAndroid Build Coastguard Worker pGraphics->SetFillColor(CFGAS_GEColor(argbFill));
74*3ac0a46fSAndroid Build Coastguard Worker pGraphics->FillPath(path, CFX_FillRenderOptions::FillType::kWinding, matrix);
75*3ac0a46fSAndroid Build Coastguard Worker }
76*3ac0a46fSAndroid Build Coastguard Worker
DrawSignCross(CFGAS_GEGraphics * pGraphics,const CFX_RectF & rtSign,FX_ARGB argbFill,const CFX_Matrix & matrix)77*3ac0a46fSAndroid Build Coastguard Worker void CFWL_CheckBoxTP::DrawSignCross(CFGAS_GEGraphics* pGraphics,
78*3ac0a46fSAndroid Build Coastguard Worker const CFX_RectF& rtSign,
79*3ac0a46fSAndroid Build Coastguard Worker FX_ARGB argbFill,
80*3ac0a46fSAndroid Build Coastguard Worker const CFX_Matrix& matrix) {
81*3ac0a46fSAndroid Build Coastguard Worker CFGAS_GEPath path;
82*3ac0a46fSAndroid Build Coastguard Worker const float fRight = rtSign.right();
83*3ac0a46fSAndroid Build Coastguard Worker const float fBottom = rtSign.bottom();
84*3ac0a46fSAndroid Build Coastguard Worker path.AddLine(rtSign.TopLeft(), CFX_PointF(fRight, fBottom));
85*3ac0a46fSAndroid Build Coastguard Worker path.AddLine(CFX_PointF(rtSign.left, fBottom),
86*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF(fRight, rtSign.top));
87*3ac0a46fSAndroid Build Coastguard Worker
88*3ac0a46fSAndroid Build Coastguard Worker CFGAS_GEGraphics::StateRestorer restorer(pGraphics);
89*3ac0a46fSAndroid Build Coastguard Worker pGraphics->SetStrokeColor(CFGAS_GEColor(argbFill));
90*3ac0a46fSAndroid Build Coastguard Worker pGraphics->SetLineWidth(1.0f);
91*3ac0a46fSAndroid Build Coastguard Worker pGraphics->StrokePath(path, matrix);
92*3ac0a46fSAndroid Build Coastguard Worker }
93*3ac0a46fSAndroid Build Coastguard Worker
DrawSignDiamond(CFGAS_GEGraphics * pGraphics,const CFX_RectF & rtSign,FX_ARGB argbFill,const CFX_Matrix & matrix)94*3ac0a46fSAndroid Build Coastguard Worker void CFWL_CheckBoxTP::DrawSignDiamond(CFGAS_GEGraphics* pGraphics,
95*3ac0a46fSAndroid Build Coastguard Worker const CFX_RectF& rtSign,
96*3ac0a46fSAndroid Build Coastguard Worker FX_ARGB argbFill,
97*3ac0a46fSAndroid Build Coastguard Worker const CFX_Matrix& matrix) {
98*3ac0a46fSAndroid Build Coastguard Worker CFGAS_GEPath path;
99*3ac0a46fSAndroid Build Coastguard Worker const float fWidth = rtSign.width;
100*3ac0a46fSAndroid Build Coastguard Worker const float fHeight = rtSign.height;
101*3ac0a46fSAndroid Build Coastguard Worker const float fBottom = rtSign.bottom();
102*3ac0a46fSAndroid Build Coastguard Worker path.MoveTo(CFX_PointF(rtSign.left + fWidth / 2, rtSign.top));
103*3ac0a46fSAndroid Build Coastguard Worker path.LineTo(CFX_PointF(rtSign.left, rtSign.top + fHeight / 2));
104*3ac0a46fSAndroid Build Coastguard Worker path.LineTo(CFX_PointF(rtSign.left + fWidth / 2, fBottom));
105*3ac0a46fSAndroid Build Coastguard Worker path.LineTo(CFX_PointF(rtSign.right(), rtSign.top + fHeight / 2));
106*3ac0a46fSAndroid Build Coastguard Worker path.LineTo(CFX_PointF(rtSign.left + fWidth / 2, rtSign.top));
107*3ac0a46fSAndroid Build Coastguard Worker
108*3ac0a46fSAndroid Build Coastguard Worker CFGAS_GEGraphics::StateRestorer restorer(pGraphics);
109*3ac0a46fSAndroid Build Coastguard Worker pGraphics->SetFillColor(CFGAS_GEColor(argbFill));
110*3ac0a46fSAndroid Build Coastguard Worker pGraphics->FillPath(path, CFX_FillRenderOptions::FillType::kWinding, matrix);
111*3ac0a46fSAndroid Build Coastguard Worker }
112*3ac0a46fSAndroid Build Coastguard Worker
DrawSignSquare(CFGAS_GEGraphics * pGraphics,const CFX_RectF & rtSign,FX_ARGB argbFill,const CFX_Matrix & matrix)113*3ac0a46fSAndroid Build Coastguard Worker void CFWL_CheckBoxTP::DrawSignSquare(CFGAS_GEGraphics* pGraphics,
114*3ac0a46fSAndroid Build Coastguard Worker const CFX_RectF& rtSign,
115*3ac0a46fSAndroid Build Coastguard Worker FX_ARGB argbFill,
116*3ac0a46fSAndroid Build Coastguard Worker const CFX_Matrix& matrix) {
117*3ac0a46fSAndroid Build Coastguard Worker CFGAS_GEPath path;
118*3ac0a46fSAndroid Build Coastguard Worker path.AddRectangle(rtSign.left, rtSign.top, rtSign.width, rtSign.height);
119*3ac0a46fSAndroid Build Coastguard Worker
120*3ac0a46fSAndroid Build Coastguard Worker CFGAS_GEGraphics::StateRestorer restorer(pGraphics);
121*3ac0a46fSAndroid Build Coastguard Worker pGraphics->SetFillColor(CFGAS_GEColor(argbFill));
122*3ac0a46fSAndroid Build Coastguard Worker pGraphics->FillPath(path, CFX_FillRenderOptions::FillType::kWinding, matrix);
123*3ac0a46fSAndroid Build Coastguard Worker }
124*3ac0a46fSAndroid Build Coastguard Worker
DrawSignStar(CFGAS_GEGraphics * pGraphics,const CFX_RectF & rtSign,FX_ARGB argbFill,const CFX_Matrix & matrix)125*3ac0a46fSAndroid Build Coastguard Worker void CFWL_CheckBoxTP::DrawSignStar(CFGAS_GEGraphics* pGraphics,
126*3ac0a46fSAndroid Build Coastguard Worker const CFX_RectF& rtSign,
127*3ac0a46fSAndroid Build Coastguard Worker FX_ARGB argbFill,
128*3ac0a46fSAndroid Build Coastguard Worker const CFX_Matrix& matrix) {
129*3ac0a46fSAndroid Build Coastguard Worker CFGAS_GEPath path;
130*3ac0a46fSAndroid Build Coastguard Worker float fBottom = rtSign.bottom();
131*3ac0a46fSAndroid Build Coastguard Worker float fRadius = (rtSign.top - fBottom) / (1 + cosf(FXSYS_PI / 5.0f));
132*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF ptCenter((rtSign.left + rtSign.right()) / 2.0f,
133*3ac0a46fSAndroid Build Coastguard Worker (rtSign.top + fBottom) / 2.0f);
134*3ac0a46fSAndroid Build Coastguard Worker
135*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF points[5];
136*3ac0a46fSAndroid Build Coastguard Worker float fAngle = FXSYS_PI / 10.0f;
137*3ac0a46fSAndroid Build Coastguard Worker for (auto& point : points) {
138*3ac0a46fSAndroid Build Coastguard Worker point =
139*3ac0a46fSAndroid Build Coastguard Worker ptCenter + CFX_PointF(fRadius * cosf(fAngle), fRadius * sinf(fAngle));
140*3ac0a46fSAndroid Build Coastguard Worker fAngle += FXSYS_PI * 2 / 5.0f;
141*3ac0a46fSAndroid Build Coastguard Worker }
142*3ac0a46fSAndroid Build Coastguard Worker
143*3ac0a46fSAndroid Build Coastguard Worker path.MoveTo(points[0]);
144*3ac0a46fSAndroid Build Coastguard Worker int next = 0;
145*3ac0a46fSAndroid Build Coastguard Worker for (size_t i = 0; i < std::size(points); ++i) {
146*3ac0a46fSAndroid Build Coastguard Worker next = (next + 2) % std::size(points);
147*3ac0a46fSAndroid Build Coastguard Worker path.LineTo(points[next]);
148*3ac0a46fSAndroid Build Coastguard Worker }
149*3ac0a46fSAndroid Build Coastguard Worker
150*3ac0a46fSAndroid Build Coastguard Worker CFGAS_GEGraphics::StateRestorer restorer(pGraphics);
151*3ac0a46fSAndroid Build Coastguard Worker pGraphics->SetFillColor(CFGAS_GEColor(argbFill));
152*3ac0a46fSAndroid Build Coastguard Worker pGraphics->FillPath(path, CFX_FillRenderOptions::FillType::kWinding, matrix);
153*3ac0a46fSAndroid Build Coastguard Worker }
154*3ac0a46fSAndroid Build Coastguard Worker
EnsureCheckPathInitialized(float fCheckLen)155*3ac0a46fSAndroid Build Coastguard Worker void CFWL_CheckBoxTP::EnsureCheckPathInitialized(float fCheckLen) {
156*3ac0a46fSAndroid Build Coastguard Worker if (m_pCheckPath)
157*3ac0a46fSAndroid Build Coastguard Worker return;
158*3ac0a46fSAndroid Build Coastguard Worker
159*3ac0a46fSAndroid Build Coastguard Worker m_pCheckPath = std::make_unique<CFGAS_GEPath>();
160*3ac0a46fSAndroid Build Coastguard Worker
161*3ac0a46fSAndroid Build Coastguard Worker float fWidth = kSignPath;
162*3ac0a46fSAndroid Build Coastguard Worker float fHeight = -kSignPath;
163*3ac0a46fSAndroid Build Coastguard Worker float fBottom = kSignPath;
164*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF pt1(fWidth / 15.0f, fBottom + fHeight * 2 / 5.0f);
165*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF pt2(fWidth / 4.5f, fBottom + fHeight / 16.0f);
166*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF pt3(fWidth / 3.0f, fBottom);
167*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF pt4(fWidth * 14 / 15.0f, fBottom + fHeight * 15 / 16.0f);
168*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF pt5(fWidth / 3.6f, fBottom + fHeight / 3.5f);
169*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF pt12(fWidth / 7.0f, fBottom + fHeight * 2 / 7.0f);
170*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF pt21(fWidth / 5.0f, fBottom + fHeight / 5.0f);
171*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF pt23(fWidth / 4.4f, fBottom + fHeight * 0 / 16.0f);
172*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF pt32(fWidth / 4.0f, fBottom);
173*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF pt34(fWidth * (1 / 7.0f + 7 / 15.0f),
174*3ac0a46fSAndroid Build Coastguard Worker fBottom + fHeight * 4 / 5.0f);
175*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF pt43(fWidth * (1 / 7.0f + 7 / 15.0f),
176*3ac0a46fSAndroid Build Coastguard Worker fBottom + fHeight * 4 / 5.0f);
177*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF pt45(fWidth * 7 / 15.0f, fBottom + fHeight * 8 / 7.0f);
178*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF pt54(fWidth / 3.4f, fBottom + fHeight / 3.5f);
179*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF pt51(fWidth / 3.6f, fBottom + fHeight / 4.0f);
180*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF pt15(fWidth / 3.5f, fBottom + fHeight * 3.5f / 5.0f);
181*3ac0a46fSAndroid Build Coastguard Worker m_pCheckPath->MoveTo(pt1);
182*3ac0a46fSAndroid Build Coastguard Worker
183*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF p1 = ScaleBezierPoint(pt12 - pt1);
184*3ac0a46fSAndroid Build Coastguard Worker CFX_PointF p2 = ScaleBezierPoint(pt21 - pt2);
185*3ac0a46fSAndroid Build Coastguard Worker m_pCheckPath->BezierTo(pt1 + p1, pt2 + p2, pt2);
186*3ac0a46fSAndroid Build Coastguard Worker
187*3ac0a46fSAndroid Build Coastguard Worker p1 = ScaleBezierPoint(pt23 - pt2);
188*3ac0a46fSAndroid Build Coastguard Worker p2 = ScaleBezierPoint(pt32 - pt3);
189*3ac0a46fSAndroid Build Coastguard Worker m_pCheckPath->BezierTo(pt2 + p1, pt3 + p2, pt3);
190*3ac0a46fSAndroid Build Coastguard Worker
191*3ac0a46fSAndroid Build Coastguard Worker p1 = ScaleBezierPoint(pt34 - pt3);
192*3ac0a46fSAndroid Build Coastguard Worker p2 = ScaleBezierPoint(pt43 - pt4);
193*3ac0a46fSAndroid Build Coastguard Worker m_pCheckPath->BezierTo(pt3 + p1, pt4 + p2, pt4);
194*3ac0a46fSAndroid Build Coastguard Worker
195*3ac0a46fSAndroid Build Coastguard Worker p1 = ScaleBezierPoint(pt45 - pt4);
196*3ac0a46fSAndroid Build Coastguard Worker p2 = ScaleBezierPoint(pt54 - pt5);
197*3ac0a46fSAndroid Build Coastguard Worker m_pCheckPath->BezierTo(pt4 + p1, pt5 + p2, pt5);
198*3ac0a46fSAndroid Build Coastguard Worker
199*3ac0a46fSAndroid Build Coastguard Worker p1 = ScaleBezierPoint(pt51 - pt5);
200*3ac0a46fSAndroid Build Coastguard Worker p2 = ScaleBezierPoint(pt15 - pt1);
201*3ac0a46fSAndroid Build Coastguard Worker m_pCheckPath->BezierTo(pt5 + p1, pt1 + p2, pt1);
202*3ac0a46fSAndroid Build Coastguard Worker
203*3ac0a46fSAndroid Build Coastguard Worker float fScale = fCheckLen / kSignPath;
204*3ac0a46fSAndroid Build Coastguard Worker CFX_Matrix mt;
205*3ac0a46fSAndroid Build Coastguard Worker mt.Scale(fScale, fScale);
206*3ac0a46fSAndroid Build Coastguard Worker m_pCheckPath->TransformBy(mt);
207*3ac0a46fSAndroid Build Coastguard Worker }
208*3ac0a46fSAndroid Build Coastguard Worker
DrawBackground(const CFWL_ThemeBackground & pParams)209*3ac0a46fSAndroid Build Coastguard Worker void CFWL_CheckBoxTP::DrawBackground(const CFWL_ThemeBackground& pParams) {
210*3ac0a46fSAndroid Build Coastguard Worker if (pParams.GetPart() != CFWL_ThemePart::Part::kCheckBox)
211*3ac0a46fSAndroid Build Coastguard Worker return;
212*3ac0a46fSAndroid Build Coastguard Worker
213*3ac0a46fSAndroid Build Coastguard Worker if ((pParams.m_dwStates & CFWL_PartState::kChecked) ||
214*3ac0a46fSAndroid Build Coastguard Worker (pParams.m_dwStates & CFWL_PartState::kNeutral)) {
215*3ac0a46fSAndroid Build Coastguard Worker DrawCheckSign(pParams.GetWidget(), pParams.GetGraphics(),
216*3ac0a46fSAndroid Build Coastguard Worker pParams.m_PartRect, pParams.m_dwStates, pParams.m_matrix);
217*3ac0a46fSAndroid Build Coastguard Worker }
218*3ac0a46fSAndroid Build Coastguard Worker }
219*3ac0a46fSAndroid Build Coastguard Worker
DrawCheckSign(CFWL_Widget * pWidget,CFGAS_GEGraphics * pGraphics,const CFX_RectF & pRtBox,Mask<CFWL_PartState> iState,const CFX_Matrix & matrix)220*3ac0a46fSAndroid Build Coastguard Worker void CFWL_CheckBoxTP::DrawCheckSign(CFWL_Widget* pWidget,
221*3ac0a46fSAndroid Build Coastguard Worker CFGAS_GEGraphics* pGraphics,
222*3ac0a46fSAndroid Build Coastguard Worker const CFX_RectF& pRtBox,
223*3ac0a46fSAndroid Build Coastguard Worker Mask<CFWL_PartState> iState,
224*3ac0a46fSAndroid Build Coastguard Worker const CFX_Matrix& matrix) {
225*3ac0a46fSAndroid Build Coastguard Worker CFX_RectF rtSign(pRtBox);
226*3ac0a46fSAndroid Build Coastguard Worker uint32_t dwColor =
227*3ac0a46fSAndroid Build Coastguard Worker iState & CFWL_PartState::kNeutral ? 0xFFA9A9A9 : 0xFF000000;
228*3ac0a46fSAndroid Build Coastguard Worker uint32_t dwStyle = pWidget->GetStyleExts();
229*3ac0a46fSAndroid Build Coastguard Worker rtSign.Deflate(rtSign.width / 4, rtSign.height / 4);
230*3ac0a46fSAndroid Build Coastguard Worker switch (dwStyle & FWL_STYLEEXT_CKB_SignShapeMask) {
231*3ac0a46fSAndroid Build Coastguard Worker case FWL_STYLEEXT_CKB_SignShapeCheck:
232*3ac0a46fSAndroid Build Coastguard Worker DrawSignCheck(pGraphics, rtSign, dwColor, matrix);
233*3ac0a46fSAndroid Build Coastguard Worker break;
234*3ac0a46fSAndroid Build Coastguard Worker case FWL_STYLEEXT_CKB_SignShapeCircle:
235*3ac0a46fSAndroid Build Coastguard Worker DrawSignCircle(pGraphics, rtSign, dwColor, matrix);
236*3ac0a46fSAndroid Build Coastguard Worker break;
237*3ac0a46fSAndroid Build Coastguard Worker case FWL_STYLEEXT_CKB_SignShapeCross:
238*3ac0a46fSAndroid Build Coastguard Worker DrawSignCross(pGraphics, rtSign, dwColor, matrix);
239*3ac0a46fSAndroid Build Coastguard Worker break;
240*3ac0a46fSAndroid Build Coastguard Worker case FWL_STYLEEXT_CKB_SignShapeDiamond:
241*3ac0a46fSAndroid Build Coastguard Worker DrawSignDiamond(pGraphics, rtSign, dwColor, matrix);
242*3ac0a46fSAndroid Build Coastguard Worker break;
243*3ac0a46fSAndroid Build Coastguard Worker case FWL_STYLEEXT_CKB_SignShapeSquare:
244*3ac0a46fSAndroid Build Coastguard Worker DrawSignSquare(pGraphics, rtSign, dwColor, matrix);
245*3ac0a46fSAndroid Build Coastguard Worker break;
246*3ac0a46fSAndroid Build Coastguard Worker case FWL_STYLEEXT_CKB_SignShapeStar:
247*3ac0a46fSAndroid Build Coastguard Worker DrawSignStar(pGraphics, rtSign, dwColor, matrix);
248*3ac0a46fSAndroid Build Coastguard Worker break;
249*3ac0a46fSAndroid Build Coastguard Worker default:
250*3ac0a46fSAndroid Build Coastguard Worker break;
251*3ac0a46fSAndroid Build Coastguard Worker }
252*3ac0a46fSAndroid Build Coastguard Worker }
253