• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
9 namespace pdfium {
10 
CFWL_PictureBox(CFWL_App * app)11 CFWL_PictureBox::CFWL_PictureBox(CFWL_App* app)
12     : CFWL_Widget(app, CFWL_Widget::Properties(), nullptr) {}
13 
14 CFWL_PictureBox::~CFWL_PictureBox() = default;
15 
GetClassID() const16 FWL_Type CFWL_PictureBox::GetClassID() const {
17   return FWL_Type::PictureBox;
18 }
19 
Update()20 void CFWL_PictureBox::Update() {
21   if (IsLocked())
22     return;
23 
24   m_ClientRect = GetClientRect();
25 }
26 
DrawWidget(CFGAS_GEGraphics * pGraphics,const CFX_Matrix & matrix)27 void CFWL_PictureBox::DrawWidget(CFGAS_GEGraphics* pGraphics,
28                                  const CFX_Matrix& matrix) {
29   if (!pGraphics)
30     return;
31 
32   if (HasBorder())
33     DrawBorder(pGraphics, CFWL_ThemePart::Part::kBorder, matrix);
34 }
35 
OnDrawWidget(CFGAS_GEGraphics * pGraphics,const CFX_Matrix & matrix)36 void CFWL_PictureBox::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
37                                    const CFX_Matrix& matrix) {
38   DrawWidget(pGraphics, matrix);
39 }
40 
41 }  // namespace pdfium
42