| 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" |
| 11 #include "xfa/fxfa/app/xfa_ffapp.h" | 11 #include "xfa/fxfa/app/xfa_ffapp.h" |
| 12 #include "xfa/fxfa/app/xfa_ffwidget.h" | 12 #include "xfa/fxfa/app/xfa_ffwidget.h" |
| 13 #include "xfa/fxgraphics/cfx_color.h" | 13 #include "xfa/fxgraphics/cfx_color.h" |
| 14 #include "xfa/include/fwl/basewidget/fwl_barcode.h" | 14 #include "xfa/include/fwl/basewidget/fwl_barcode.h" |
| 15 #include "xfa/include/fwl/basewidget/fwl_caret.h" | 15 #include "xfa/include/fwl/basewidget/fwl_caret.h" |
| 16 #include "xfa/include/fwl/basewidget/fwl_checkbox.h" | 16 #include "xfa/include/fwl/basewidget/fwl_checkbox.h" |
| 17 #include "xfa/include/fwl/basewidget/fwl_combobox.h" | 17 #include "xfa/include/fwl/basewidget/fwl_combobox.h" |
| 18 #include "xfa/include/fwl/basewidget/fwl_datetimepicker.h" | 18 #include "xfa/include/fwl/basewidget/fwl_datetimepicker.h" |
| 19 #include "xfa/include/fwl/basewidget/fwl_edit.h" | 19 #include "xfa/include/fwl/basewidget/fwl_edit.h" |
| 20 #include "xfa/include/fwl/basewidget/fwl_listbox.h" | 20 #include "xfa/include/fwl/basewidget/fwl_listbox.h" |
| 21 #include "xfa/include/fwl/basewidget/fwl_monthcalendar.h" | 21 #include "xfa/include/fwl/basewidget/fwl_monthcalendar.h" |
| 22 #include "xfa/include/fwl/basewidget/fwl_picturebox.h" | 22 #include "xfa/include/fwl/basewidget/fwl_picturebox.h" |
| 23 #include "xfa/include/fwl/basewidget/fwl_pushbutton.h" | 23 #include "xfa/include/fwl/basewidget/fwl_pushbutton.h" |
| 24 #include "xfa/include/fwl/basewidget/fwl_scrollbar.h" | 24 #include "xfa/include/fwl/basewidget/fwl_scrollbar.h" |
| 25 | 25 |
| 26 namespace { |
| 27 |
| 28 const FX_WCHAR* const g_FWLTheme_CalFonts[] = { |
| 29 L"Arial", L"Courier New", L"DejaVu Sans", |
| 30 }; |
| 31 |
| 32 } // namespace |
| 33 |
| 26 CXFA_FFWidget* XFA_ThemeGetOuterWidget(IFWL_Widget* pWidget) { | 34 CXFA_FFWidget* XFA_ThemeGetOuterWidget(IFWL_Widget* pWidget) { |
| 27 IFWL_Widget* pOuter = pWidget; | 35 IFWL_Widget* pOuter = pWidget; |
| 28 while (pOuter->GetOuter()) { | 36 while (pOuter->GetOuter()) { |
| 29 pOuter = pOuter->GetOuter(); | 37 pOuter = pOuter->GetOuter(); |
| 30 } | 38 } |
| 31 if (pOuter) { | 39 if (pOuter) { |
| 32 return (CXFA_FFWidget*)pOuter->GetPrivateData(pOuter); | 40 return (CXFA_FFWidget*)pOuter->GetPrivateData(pOuter); |
| 33 } | 41 } |
| 34 return NULL; | 42 return NULL; |
| 35 } | 43 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 59 delete m_pPictureBoxTP; | 67 delete m_pPictureBoxTP; |
| 60 delete m_pSrollBarTP; | 68 delete m_pSrollBarTP; |
| 61 delete m_pEditTP; | 69 delete m_pEditTP; |
| 62 delete m_pComboBoxTP; | 70 delete m_pComboBoxTP; |
| 63 delete m_pMonthCalendarTP; | 71 delete m_pMonthCalendarTP; |
| 64 delete m_pDateTimePickerTP; | 72 delete m_pDateTimePickerTP; |
| 65 delete m_pPushButtonTP; | 73 delete m_pPushButtonTP; |
| 66 delete m_pCaretTP; | 74 delete m_pCaretTP; |
| 67 delete m_pBarcodeTP; | 75 delete m_pBarcodeTP; |
| 68 } | 76 } |
| 69 static const FX_WCHAR* g_FWLTheme_CalFonts[] = { | |
| 70 L"Arial", L"Courier New", L"DejaVu Sans", | |
| 71 }; | |
| 72 FWL_ERR CXFA_FWLTheme::Initialize() { | 77 FWL_ERR CXFA_FWLTheme::Initialize() { |
| 73 m_pTextOut = IFDE_TextOut::Create(); | 78 m_pTextOut = IFDE_TextOut::Create(); |
| 74 for (size_t i = 0; !m_pCalendarFont && i < FX_ArraySize(g_FWLTheme_CalFonts); | 79 for (size_t i = 0; !m_pCalendarFont && i < FX_ArraySize(g_FWLTheme_CalFonts); |
| 75 ++i) { | 80 ++i) { |
| 76 m_pCalendarFont = IFX_Font::LoadFont(g_FWLTheme_CalFonts[i], 0, 0, | 81 m_pCalendarFont = IFX_Font::LoadFont(g_FWLTheme_CalFonts[i], 0, 0, |
| 77 m_pApp->GetFDEFontMgr()); | 82 m_pApp->GetFDEFontMgr()); |
| 78 } | 83 } |
| 79 if (!m_pCalendarFont) { | 84 if (!m_pCalendarFont) { |
| 80 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 85 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| 81 m_pCalendarFont = m_pApp->GetFDEFontMgr()->GetDefFontByCodePage( | 86 m_pCalendarFont = m_pApp->GetFDEFontMgr()->GetDefFontByCodePage( |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 } | 421 } |
| 417 } | 422 } |
| 418 CFX_Color crLine(cr); | 423 CFX_Color crLine(cr); |
| 419 pParams->m_pGraphics->SetStrokeColor(&crLine); | 424 pParams->m_pGraphics->SetStrokeColor(&crLine); |
| 420 pParams->m_pGraphics->SetLineWidth(fWidth); | 425 pParams->m_pGraphics->SetLineWidth(fWidth); |
| 421 pParams->m_pGraphics->StrokePath(pParams->m_pPath, &pParams->m_matrix); | 426 pParams->m_pGraphics->StrokePath(pParams->m_pPath, &pParams->m_matrix); |
| 422 return TRUE; | 427 return TRUE; |
| 423 } | 428 } |
| 424 return CFWL_EditTP::DrawBackground(pParams); | 429 return CFWL_EditTP::DrawBackground(pParams); |
| 425 } | 430 } |
| OLD | NEW |