Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / src / fwl / src / theme / pictureboxtp.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_PictureBoxTP::CFWL_PictureBoxTP()\r
9 {\r
10 }\r
11 CFWL_PictureBoxTP::~CFWL_PictureBoxTP()\r
12 {\r
13 }\r
14 FX_BOOL CFWL_PictureBoxTP::IsValidWidget(IFWL_Widget *pWidget)\r
15 {\r
16     _FWL_RETURN_VALUE_IF_FAIL(pWidget, FALSE);\r
17     return pWidget->GetClassID() == FWL_CLASSHASH_PictureBox;\r
18 }\r
19 FX_BOOL CFWL_PictureBoxTP::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_PTB_Border: {\r
24                 DrawBorder(pParams->m_pGraphics, &pParams->m_rtPart, &pParams->m_matrix);\r
25                 break;\r
26             }\r
27         case FWL_PART_PTB_Edge: {\r
28                 DrawEdge(pParams->m_pGraphics, pParams->m_pWidget->GetStyles(), &pParams->m_rtPart, &pParams->m_matrix);\r
29                 break;\r
30             }\r
31         default: {\r
32             }\r
33     }\r
34     return TRUE;\r
35 }\r