Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / src / fwl / src / theme / barcodetp.cpp
1 // Copyright 2014 PDFium Authors. All rights reserved.\r
2 // Use of this source code is governed by a BSD-style license that can be\r
3 // found in the LICENSE file.\r
4 \r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
6 \r
7 #include "../../../foxitlib.h"\r
8 CFWL_BarcodeTP::CFWL_BarcodeTP()\r
9 {\r
10 }\r
11 CFWL_BarcodeTP::~CFWL_BarcodeTP()\r
12 {\r
13 }\r
14 FX_BOOL CFWL_BarcodeTP::IsValidWidget(IFWL_Widget *pWidget)\r
15 {\r
16     _FWL_RETURN_VALUE_IF_FAIL(pWidget, FALSE);\r
17     return pWidget->GetClassID() == FWL_CLASSHASH_Barcode;\r
18 }\r
19 FX_BOOL CFWL_BarcodeTP::DrawBackground(CFWL_ThemeBackground *pParams)\r
20 {\r
21     _FWL_RETURN_VALUE_IF_FAIL(pParams, FALSE);\r
22     switch(pParams->m_iPart) {\r
23         case FWL_PART_BCD_Border: {\r
24                 DrawBorder(pParams->m_pGraphics, &pParams->m_rtPart, &pParams->m_matrix);\r
25                 break;\r
26             }\r
27         case FWL_PART_BCD_Edge: {\r
28                 DrawEdge(pParams->m_pGraphics, pParams->m_pWidget->GetStyles(), &pParams->m_rtPart, &pParams->m_matrix);\r
29                 break;\r
30             }\r
31         case FWL_PART_BCD_Background: {\r
32                 FillBackground(pParams->m_pGraphics, &pParams->m_rtPart, &pParams->m_matrix);\r
33                 break;\r
34             }\r
35         default: {\r
36             }\r
37     }\r
38     return TRUE;\r
39 }\r