xref: /aosp_15_r20/external/pdfium/xfa/fwl/cfwl_picturebox.cpp (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2014 The PDFium Authors
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/fwl/cfwl_picturebox.h"
8 
CFWL_PictureBox(CFWL_App * app)9 CFWL_PictureBox::CFWL_PictureBox(CFWL_App* app)
10     : CFWL_Widget(app, CFWL_Widget::Properties(), nullptr) {}
11 
12 CFWL_PictureBox::~CFWL_PictureBox() = default;
13 
GetClassID() const14 FWL_Type CFWL_PictureBox::GetClassID() const {
15   return FWL_Type::PictureBox;
16 }
17 
Update()18 void CFWL_PictureBox::Update() {
19   if (IsLocked())
20     return;
21 
22   m_ClientRect = GetClientRect();
23 }
24 
DrawWidget(CFGAS_GEGraphics * pGraphics,const CFX_Matrix & matrix)25 void CFWL_PictureBox::DrawWidget(CFGAS_GEGraphics* pGraphics,
26                                  const CFX_Matrix& matrix) {
27   if (!pGraphics)
28     return;
29 
30   if (HasBorder())
31     DrawBorder(pGraphics, CFWL_ThemePart::Part::kBorder, matrix);
32 }
33 
OnDrawWidget(CFGAS_GEGraphics * pGraphics,const CFX_Matrix & matrix)34 void CFWL_PictureBox::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
35                                    const CFX_Matrix& matrix) {
36   DrawWidget(pGraphics, matrix);
37 }
38