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/include/fwl/theme/scrollbartp.h" | 7 #include "xfa/include/fwl/theme/scrollbartp.h" |
8 | 8 |
9 #include "xfa/fwl/basewidget/ifwl_scrollbar.h" | 9 #include "xfa/fwl/basewidget/ifwl_scrollbar.h" |
10 #include "xfa/fwl/core/cfwl_themebackground.h" | 10 #include "xfa/fwl/core/cfwl_themebackground.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 delete m_pThemeData; | 24 delete m_pThemeData; |
25 m_pThemeData = NULL; | 25 m_pThemeData = NULL; |
26 } | 26 } |
27 } | 27 } |
28 FX_BOOL CFWL_ScrollBarTP::IsValidWidget(IFWL_Widget* pWidget) { | 28 FX_BOOL CFWL_ScrollBarTP::IsValidWidget(IFWL_Widget* pWidget) { |
29 if (!pWidget) | 29 if (!pWidget) |
30 return FALSE; | 30 return FALSE; |
31 return pWidget->GetClassID() == FWL_CLASSHASH_ScrollBar; | 31 return pWidget->GetClassID() == FWL_CLASSHASH_ScrollBar; |
32 } | 32 } |
33 void* CFWL_ScrollBarTP::GetCapacity(CFWL_ThemePart* pThemePart, | 33 void* CFWL_ScrollBarTP::GetCapacity(CFWL_ThemePart* pThemePart, |
34 FX_DWORD dwCapacity) { | 34 uint32_t dwCapacity) { |
35 if (dwCapacity == FWL_CAPACITY_SCB_Size) { | 35 if (dwCapacity == FWL_CAPACITY_SCB_Size) { |
36 m_fValue = 5; | 36 m_fValue = 5; |
37 return &m_fValue; | 37 return &m_fValue; |
38 } | 38 } |
39 return CFWL_WidgetTP::GetCapacity(pThemePart, dwCapacity); | 39 return CFWL_WidgetTP::GetCapacity(pThemePart, dwCapacity); |
40 } | 40 } |
41 FX_DWORD CFWL_ScrollBarTP::SetThemeID(IFWL_Widget* pWidget, | 41 uint32_t CFWL_ScrollBarTP::SetThemeID(IFWL_Widget* pWidget, |
42 FX_DWORD dwThemeID, | 42 uint32_t dwThemeID, |
43 FX_BOOL bChildren) { | 43 FX_BOOL bChildren) { |
44 if (m_pThemeData) { | 44 if (m_pThemeData) { |
45 SetThemeData(FWL_GetThemeColor(dwThemeID)); | 45 SetThemeData(FWL_GetThemeColor(dwThemeID)); |
46 } | 46 } |
47 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID, bChildren); | 47 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID, bChildren); |
48 } | 48 } |
49 FX_BOOL CFWL_ScrollBarTP::DrawBackground(CFWL_ThemeBackground* pParams) { | 49 FX_BOOL CFWL_ScrollBarTP::DrawBackground(CFWL_ThemeBackground* pParams) { |
50 if (!pParams) | 50 if (!pParams) |
51 return FALSE; | 51 return FALSE; |
52 IFWL_Widget* pWidget = pParams->m_pWidget; | 52 IFWL_Widget* pWidget = pParams->m_pWidget; |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 pGraphics->SaveGraphState(); | 328 pGraphics->SaveGraphState(); |
329 CFX_Color crFill(FWLTHEME_COLOR_Background); | 329 CFX_Color crFill(FWLTHEME_COLOR_Background); |
330 pGraphics->SetFillColor(&crFill); | 330 pGraphics->SetFillColor(&crFill); |
331 pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); | 331 pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); |
332 pGraphics->RestoreGraphState(); | 332 pGraphics->RestoreGraphState(); |
333 DrawArrow(pGraphics, pRect, eDict, | 333 DrawArrow(pGraphics, pRect, eDict, |
334 eState == FWLTHEME_STATE_Disabale ? 0xFFA0A0A0 : 0xFF000000, | 334 eState == FWLTHEME_STATE_Disabale ? 0xFFA0A0A0 : 0xFF000000, |
335 eState == FWLTHEME_STATE_Pressed, pMatrix); | 335 eState == FWLTHEME_STATE_Pressed, pMatrix); |
336 } | 336 } |
337 #endif | 337 #endif |
338 void CFWL_ScrollBarTP::SetThemeData(FX_DWORD dwID) { | 338 void CFWL_ScrollBarTP::SetThemeData(uint32_t dwID) { |
339 m_pThemeData->clrPawColorLight[3] = ArgbEncode(0xff, 208, 223, 172); | 339 m_pThemeData->clrPawColorLight[3] = ArgbEncode(0xff, 208, 223, 172); |
340 m_pThemeData->clrPawColorDark[3] = ArgbEncode(0xff, 140, 157, 115); | 340 m_pThemeData->clrPawColorDark[3] = ArgbEncode(0xff, 140, 157, 115); |
341 m_pThemeData->clrBtnBK[3][0] = ArgbEncode(0xff, 164, 180, 139); | 341 m_pThemeData->clrBtnBK[3][0] = ArgbEncode(0xff, 164, 180, 139); |
342 m_pThemeData->clrBtnBK[3][1] = ArgbEncode(0xff, 141, 157, 115); | 342 m_pThemeData->clrBtnBK[3][1] = ArgbEncode(0xff, 141, 157, 115); |
343 m_pThemeData->clrBtnBorder[3] = ArgbEncode(0xff, 236, 233, 216); | 343 m_pThemeData->clrBtnBorder[3] = ArgbEncode(0xff, 236, 233, 216); |
344 if (dwID) { | 344 if (dwID) { |
345 m_pThemeData->clrPawColorLight[0] = ArgbEncode(0xff, 208, 223, 172); | 345 m_pThemeData->clrPawColorLight[0] = ArgbEncode(0xff, 208, 223, 172); |
346 m_pThemeData->clrPawColorDark[0] = ArgbEncode(0xff, 140, 157, 115); | 346 m_pThemeData->clrPawColorDark[0] = ArgbEncode(0xff, 140, 157, 115); |
347 m_pThemeData->clrBtnBK[0][0] = ArgbEncode(0xff, 162, 179, 141); | 347 m_pThemeData->clrBtnBK[0][0] = ArgbEncode(0xff, 162, 179, 141); |
348 m_pThemeData->clrBtnBK[0][1] = ArgbEncode(0xff, 149, 167, 117); | 348 m_pThemeData->clrBtnBK[0][1] = ArgbEncode(0xff, 149, 167, 117); |
(...skipping 23 matching lines...) Expand all Loading... |
372 m_pThemeData->clrBtnBorder[1] = ArgbEncode(0xff, 218, 230, 254); | 372 m_pThemeData->clrBtnBorder[1] = ArgbEncode(0xff, 218, 230, 254); |
373 m_pThemeData->clrPawColorLight[2] = ArgbEncode(0xff, 207, 221, 253); | 373 m_pThemeData->clrPawColorLight[2] = ArgbEncode(0xff, 207, 221, 253); |
374 m_pThemeData->clrPawColorDark[2] = ArgbEncode(0xff, 131, 158, 216); | 374 m_pThemeData->clrPawColorDark[2] = ArgbEncode(0xff, 131, 158, 216); |
375 m_pThemeData->clrBtnBK[2][0] = ArgbEncode(0xff, 167, 190, 245); | 375 m_pThemeData->clrBtnBK[2][0] = ArgbEncode(0xff, 167, 190, 245); |
376 m_pThemeData->clrBtnBK[2][1] = ArgbEncode(0xff, 146, 179, 249); | 376 m_pThemeData->clrBtnBK[2][1] = ArgbEncode(0xff, 146, 179, 249); |
377 m_pThemeData->clrBtnBorder[2] = ArgbEncode(0xff, 124, 159, 211); | 377 m_pThemeData->clrBtnBorder[2] = ArgbEncode(0xff, 124, 159, 211); |
378 m_pThemeData->clrTrackBKStart = ArgbEncode(0xff, 243, 241, 236); | 378 m_pThemeData->clrTrackBKStart = ArgbEncode(0xff, 243, 241, 236); |
379 m_pThemeData->clrTrackBKEnd = ArgbEncode(0xff, 254, 254, 251); | 379 m_pThemeData->clrTrackBKEnd = ArgbEncode(0xff, 254, 254, 251); |
380 } | 380 } |
381 } | 381 } |
OLD | NEW |