OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa/fxfa/app/xfa_fwltheme.h" | 7 #include "xfa/fxfa/app/xfa_fwltheme.h" |
8 | 8 |
9 #include "xfa/fde/tto/fde_textout.h" | 9 #include "xfa/fde/tto/fde_textout.h" |
10 #include "xfa/fgas/crt/fgas_codepage.h" | 10 #include "xfa/fgas/crt/fgas_codepage.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 namespace { | 28 namespace { |
29 | 29 |
30 const FX_WCHAR* const g_FWLTheme_CalFonts[] = { | 30 const FX_WCHAR* const g_FWLTheme_CalFonts[] = { |
31 L"Arial", L"Courier New", L"DejaVu Sans", | 31 L"Arial", L"Courier New", L"DejaVu Sans", |
32 }; | 32 }; |
33 | 33 |
34 } // namespace | 34 } // namespace |
35 | 35 |
36 CXFA_FFWidget* XFA_ThemeGetOuterWidget(IFWL_Widget* pWidget) { | 36 CXFA_FFWidget* XFA_ThemeGetOuterWidget(IFWL_Widget* pWidget) { |
37 IFWL_Widget* pOuter = pWidget; | 37 IFWL_Widget* pOuter = pWidget; |
38 while (pOuter->GetOuter()) { | 38 while (pOuter && pOuter->GetOuter()) |
39 pOuter = pOuter->GetOuter(); | 39 pOuter = pOuter->GetOuter(); |
40 } | 40 |
41 if (pOuter) { | 41 return pOuter ? static_cast<CXFA_FFWidget*>(pOuter->GetLayoutItem()) |
42 return (CXFA_FFWidget*)pOuter->GetPrivateData(pOuter); | 42 : nullptr; |
43 } | |
44 return NULL; | |
45 } | 43 } |
| 44 |
46 CXFA_FWLTheme::CXFA_FWLTheme(CXFA_FFApp* pApp) : m_pApp(pApp) { | 45 CXFA_FWLTheme::CXFA_FWLTheme(CXFA_FFApp* pApp) : m_pApp(pApp) { |
47 m_dwCapacity = 0; | 46 m_dwCapacity = 0; |
48 m_fCapacity = 0; | 47 m_fCapacity = 0; |
49 m_pCalendarFont = NULL; | 48 m_pCalendarFont = NULL; |
50 m_Rect.Set(0, 0, 0, 0); | 49 m_Rect.Set(0, 0, 0, 0); |
51 m_pCheckBoxTP = new CXFA_FWLCheckBoxTP; | 50 m_pCheckBoxTP = new CXFA_FWLCheckBoxTP; |
52 m_pListBoxTP = new CFWL_ListBoxTP; | 51 m_pListBoxTP = new CFWL_ListBoxTP; |
53 m_pPictureBoxTP = new CFWL_PictureBoxTP; | 52 m_pPictureBoxTP = new CFWL_PictureBoxTP; |
54 m_pSrollBarTP = new CFWL_ScrollBarTP; | 53 m_pSrollBarTP = new CFWL_ScrollBarTP; |
55 m_pEditTP = new CXFA_FWLEditTP; | 54 m_pEditTP = new CXFA_FWLEditTP; |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 } | 479 } |
481 } | 480 } |
482 CFX_Color crLine(cr); | 481 CFX_Color crLine(cr); |
483 pParams->m_pGraphics->SetStrokeColor(&crLine); | 482 pParams->m_pGraphics->SetStrokeColor(&crLine); |
484 pParams->m_pGraphics->SetLineWidth(fWidth); | 483 pParams->m_pGraphics->SetLineWidth(fWidth); |
485 pParams->m_pGraphics->StrokePath(pParams->m_pPath, &pParams->m_matrix); | 484 pParams->m_pGraphics->StrokePath(pParams->m_pPath, &pParams->m_matrix); |
486 return TRUE; | 485 return TRUE; |
487 } | 486 } |
488 return CFWL_EditTP::DrawBackground(pParams); | 487 return CFWL_EditTP::DrawBackground(pParams); |
489 } | 488 } |
OLD | NEW |