| 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/fwl/theme/cfwl_monthcalendartp.h" | 7 #include "xfa/fwl/theme/cfwl_monthcalendartp.h" |
| 8 | 8 |
| 9 #include "xfa/fde/tto/fde_textout.h" | 9 #include "xfa/fde/tto/fde_textout.h" |
| 10 #include "xfa/fwl/basewidget/ifwl_monthcalendar.h" | 10 #include "xfa/fwl/basewidget/ifwl_monthcalendar.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 const int kHorizontalSeparatorWidth = kWeekWidth - 10; | 42 const int kHorizontalSeparatorWidth = kWeekWidth - 10; |
| 43 const int kHorizontalSeparatorHeight = 1; | 43 const int kHorizontalSeparatorHeight = 1; |
| 44 const int kVerticalSeparatorWidth = 1; | 44 const int kVerticalSeparatorWidth = 1; |
| 45 const int kVerticalSeparatorHeight = kWeekNumHeight; | 45 const int kVerticalSeparatorHeight = kWeekNumHeight; |
| 46 const int kSeparatorDOffset = -4; | 46 const int kSeparatorDOffset = -4; |
| 47 const int kSeparatorX = 3; | 47 const int kSeparatorX = 3; |
| 48 const int kSeparatorY = kHeaderHeight + kDatesCellHeight + kSeparatorDOffset; | 48 const int kSeparatorY = kHeaderHeight + kDatesCellHeight + kSeparatorDOffset; |
| 49 | 49 |
| 50 } // namespace | 50 } // namespace |
| 51 | 51 |
| 52 CFWL_MonthCalendarTP::CFWL_MonthCalendarTP() { | 52 CFWL_MonthCalendarTP::CFWL_MonthCalendarTP() : m_pThemeData(new MCThemeData) { |
| 53 m_pThemeData = new MCThemeData; | |
| 54 SetThemeData(0); | 53 SetThemeData(0); |
| 55 } | 54 } |
| 56 | 55 |
| 57 CFWL_MonthCalendarTP::~CFWL_MonthCalendarTP() { | 56 CFWL_MonthCalendarTP::~CFWL_MonthCalendarTP() {} |
| 58 delete m_pThemeData; | |
| 59 } | |
| 60 | 57 |
| 61 bool CFWL_MonthCalendarTP::IsValidWidget(IFWL_Widget* pWidget) { | 58 bool CFWL_MonthCalendarTP::IsValidWidget(IFWL_Widget* pWidget) { |
| 62 return pWidget && pWidget->GetClassID() == FWL_Type::MonthCalendar; | 59 return pWidget && pWidget->GetClassID() == FWL_Type::MonthCalendar; |
| 63 } | 60 } |
| 61 |
| 64 uint32_t CFWL_MonthCalendarTP::SetThemeID(IFWL_Widget* pWidget, | 62 uint32_t CFWL_MonthCalendarTP::SetThemeID(IFWL_Widget* pWidget, |
| 65 uint32_t dwThemeID, | 63 uint32_t dwThemeID, |
| 66 FX_BOOL bChildren) { | 64 FX_BOOL bChildren) { |
| 67 if (m_pThemeData) { | 65 if (m_pThemeData) |
| 68 SetThemeData(FWL_GetThemeColor(dwThemeID)); | 66 SetThemeData(FWL_GetThemeColor(dwThemeID)); |
| 69 } | 67 |
| 70 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID, bChildren); | 68 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID, bChildren); |
| 71 } | 69 } |
| 70 |
| 72 FX_BOOL CFWL_MonthCalendarTP::DrawBackground(CFWL_ThemeBackground* pParams) { | 71 FX_BOOL CFWL_MonthCalendarTP::DrawBackground(CFWL_ThemeBackground* pParams) { |
| 73 if (!pParams) | 72 if (!pParams) |
| 74 return FALSE; | 73 return FALSE; |
| 75 switch (pParams->m_iPart) { | 74 switch (pParams->m_iPart) { |
| 76 case CFWL_Part::Border: { | 75 case CFWL_Part::Border: { |
| 77 DrawBorder(pParams->m_pGraphics, &pParams->m_rtPart, &pParams->m_matrix); | 76 DrawBorder(pParams->m_pGraphics, &pParams->m_rtPart, &pParams->m_matrix); |
| 78 break; | 77 break; |
| 79 } | 78 } |
| 80 case CFWL_Part::Edge: { | 79 case CFWL_Part::Edge: { |
| 81 DrawEdge(pParams->m_pGraphics, pParams->m_pWidget->GetStyles(), | 80 DrawEdge(pParams->m_pGraphics, pParams->m_pWidget->GetStyles(), |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 } else { | 558 } else { |
| 560 m_pThemeData->clrCaption = ArgbEncode(0xff, 128, 128, 0); | 559 m_pThemeData->clrCaption = ArgbEncode(0xff, 128, 128, 0); |
| 561 m_pThemeData->clrSeperator = ArgbEncode(0xff, 128, 128, 64); | 560 m_pThemeData->clrSeperator = ArgbEncode(0xff, 128, 128, 64); |
| 562 m_pThemeData->clrDatesHoverBK = ArgbEncode(0xff, 217, 220, 191); | 561 m_pThemeData->clrDatesHoverBK = ArgbEncode(0xff, 217, 220, 191); |
| 563 m_pThemeData->clrDatesSelectedBK = ArgbEncode(0xff, 204, 208, 183); | 562 m_pThemeData->clrDatesSelectedBK = ArgbEncode(0xff, 204, 208, 183); |
| 564 m_pThemeData->clrDatesCircle = ArgbEncode(0xff, 128, 128, 0); | 563 m_pThemeData->clrDatesCircle = ArgbEncode(0xff, 128, 128, 0); |
| 565 m_pThemeData->clrToday = ArgbEncode(0xff, 0, 0, 0); | 564 m_pThemeData->clrToday = ArgbEncode(0xff, 0, 0, 0); |
| 566 m_pThemeData->clrBK = ArgbEncode(0xff, 255, 255, 255); | 565 m_pThemeData->clrBK = ArgbEncode(0xff, 255, 255, 255); |
| 567 } | 566 } |
| 568 } | 567 } |
| OLD | NEW |