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/foxitlib.h"
CFWL_BarcodeTP()8 CFWL_BarcodeTP::CFWL_BarcodeTP() {}
~CFWL_BarcodeTP()9 CFWL_BarcodeTP::~CFWL_BarcodeTP() {}
IsValidWidget(IFWL_Widget * pWidget)10 FX_BOOL CFWL_BarcodeTP::IsValidWidget(IFWL_Widget* pWidget) {
11   if (!pWidget)
12     return FALSE;
13   return pWidget->GetClassID() == FWL_CLASSHASH_Barcode;
14 }
DrawBackground(CFWL_ThemeBackground * pParams)15 FX_BOOL CFWL_BarcodeTP::DrawBackground(CFWL_ThemeBackground* pParams) {
16   if (!pParams)
17     return FALSE;
18   switch (pParams->m_iPart) {
19     case FWL_PART_BCD_Border: {
20       DrawBorder(pParams->m_pGraphics, &pParams->m_rtPart, &pParams->m_matrix);
21       break;
22     }
23     case FWL_PART_BCD_Edge: {
24       DrawEdge(pParams->m_pGraphics, pParams->m_pWidget->GetStyles(),
25                &pParams->m_rtPart, &pParams->m_matrix);
26       break;
27     }
28     case FWL_PART_BCD_Background: {
29       FillBackground(pParams->m_pGraphics, &pParams->m_rtPart,
30                      &pParams->m_matrix);
31       break;
32     }
33     default: {}
34   }
35   return TRUE;
36 }
37