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/core/cfwl_monthcalendar.h" | 10 #include "xfa/fwl/core/cfwl_monthcalendar.h" |
11 #include "xfa/fwl/core/cfwl_themebackground.h" | 11 #include "xfa/fwl/core/cfwl_themebackground.h" |
12 #include "xfa/fwl/core/cfwl_themetext.h" | 12 #include "xfa/fwl/core/cfwl_themetext.h" |
| 13 #include "xfa/fwl/core/cfwl_widget.h" |
13 #include "xfa/fwl/core/ifwl_themeprovider.h" | 14 #include "xfa/fwl/core/ifwl_themeprovider.h" |
14 #include "xfa/fwl/core/ifwl_widget.h" | |
15 #include "xfa/fxgraphics/cfx_color.h" | 15 #include "xfa/fxgraphics/cfx_color.h" |
16 #include "xfa/fxgraphics/cfx_path.h" | 16 #include "xfa/fxgraphics/cfx_path.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 const int kWidth = 200; | 20 const int kWidth = 200; |
21 const int kHeight = 160; | 21 const int kHeight = 160; |
22 | 22 |
23 const int kHeaderWidth = 200; | 23 const int kHeaderWidth = 200; |
24 const int kHeaderHeight = 30; | 24 const int kHeaderHeight = 30; |
(...skipping 23 matching lines...) Expand all Loading... |
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() : m_pThemeData(new MCThemeData) { | 52 CFWL_MonthCalendarTP::CFWL_MonthCalendarTP() : m_pThemeData(new MCThemeData) { |
53 SetThemeData(); | 53 SetThemeData(); |
54 } | 54 } |
55 | 55 |
56 CFWL_MonthCalendarTP::~CFWL_MonthCalendarTP() {} | 56 CFWL_MonthCalendarTP::~CFWL_MonthCalendarTP() {} |
57 | 57 |
58 bool CFWL_MonthCalendarTP::IsValidWidget(IFWL_Widget* pWidget) { | 58 bool CFWL_MonthCalendarTP::IsValidWidget(CFWL_Widget* pWidget) { |
59 return pWidget && pWidget->GetClassID() == FWL_Type::MonthCalendar; | 59 return pWidget && pWidget->GetClassID() == FWL_Type::MonthCalendar; |
60 } | 60 } |
61 | 61 |
62 void CFWL_MonthCalendarTP::DrawBackground(CFWL_ThemeBackground* pParams) { | 62 void CFWL_MonthCalendarTP::DrawBackground(CFWL_ThemeBackground* pParams) { |
63 if (!pParams) | 63 if (!pParams) |
64 return; | 64 return; |
65 | 65 |
66 switch (pParams->m_iPart) { | 66 switch (pParams->m_iPart) { |
67 case CFWL_Part::Border: { | 67 case CFWL_Part::Border: { |
68 DrawBorder(pParams->m_pGraphics, &pParams->m_rtPart, &pParams->m_matrix); | 68 DrawBorder(pParams->m_pGraphics, &pParams->m_rtPart, &pParams->m_matrix); |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 | 542 |
543 void CFWL_MonthCalendarTP::SetThemeData() { | 543 void CFWL_MonthCalendarTP::SetThemeData() { |
544 m_pThemeData->clrCaption = ArgbEncode(0xff, 0, 153, 255); | 544 m_pThemeData->clrCaption = ArgbEncode(0xff, 0, 153, 255); |
545 m_pThemeData->clrSeperator = ArgbEncode(0xff, 141, 161, 239); | 545 m_pThemeData->clrSeperator = ArgbEncode(0xff, 141, 161, 239); |
546 m_pThemeData->clrDatesHoverBK = ArgbEncode(0xff, 193, 211, 251); | 546 m_pThemeData->clrDatesHoverBK = ArgbEncode(0xff, 193, 211, 251); |
547 m_pThemeData->clrDatesSelectedBK = ArgbEncode(0xff, 173, 188, 239); | 547 m_pThemeData->clrDatesSelectedBK = ArgbEncode(0xff, 173, 188, 239); |
548 m_pThemeData->clrDatesCircle = ArgbEncode(0xff, 103, 144, 209); | 548 m_pThemeData->clrDatesCircle = ArgbEncode(0xff, 103, 144, 209); |
549 m_pThemeData->clrToday = ArgbEncode(0xff, 0, 0, 0); | 549 m_pThemeData->clrToday = ArgbEncode(0xff, 0, 0, 0); |
550 m_pThemeData->clrBK = ArgbEncode(0xff, 255, 255, 255); | 550 m_pThemeData->clrBK = ArgbEncode(0xff, 255, 255, 255); |
551 } | 551 } |
OLD | NEW |