| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
| 6 | |
| 7 #ifndef XFA_FWL_THEME_CFWL_FORMTP_H_ | |
| 8 #define XFA_FWL_THEME_CFWL_FORMTP_H_ | |
| 9 | |
| 10 #include "xfa/fwl/theme/cfwl_utils.h" | |
| 11 #include "xfa/fwl/theme/cfwl_widgettp.h" | |
| 12 | |
| 13 class CFWL_FormTP : public CFWL_WidgetTP { | |
| 14 public: | |
| 15 CFWL_FormTP(); | |
| 16 ~CFWL_FormTP() override; | |
| 17 | |
| 18 // CFWL_WidgetTP | |
| 19 FWL_Error Initialize() override; | |
| 20 FWL_Error Finalize() override; | |
| 21 bool IsValidWidget(IFWL_Widget* pWidget) override; | |
| 22 uint32_t SetThemeID(IFWL_Widget* pWidget, | |
| 23 uint32_t dwThemeID, | |
| 24 FX_BOOL bChildren = TRUE) override; | |
| 25 FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) override; | |
| 26 FX_BOOL DrawText(CFWL_ThemeText* pParams) override; | |
| 27 void* GetCapacity(CFWL_ThemePart* pThemePart, | |
| 28 CFWL_WidgetCapacity dwCapacity) override; | |
| 29 FWL_Error GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart) override; | |
| 30 | |
| 31 protected: | |
| 32 void CalCloseBox(IFWL_Widget* pWidget, CFX_RectF& rect); | |
| 33 void CalMaxBox(IFWL_Widget* pWidget, CFX_RectF& rect); | |
| 34 void CalMinBox(IFWL_Widget* pWidget, CFX_RectF& rect); | |
| 35 void CalCaption(IFWL_Widget* pWidget, CFX_RectF& rect); | |
| 36 void CalIcon(IFWL_Widget* pWidget, CFX_RectF& rect); | |
| 37 | |
| 38 void DrawFormBorder(CFX_Graphics* pGraphics, | |
| 39 const CFX_RectF* pRect, | |
| 40 FWLTHEME_STATE eState, | |
| 41 CFX_Matrix* pMatrix, | |
| 42 int32_t iActive = 0); | |
| 43 void DrawCaption(CFX_Graphics* pGraphics, | |
| 44 const CFX_RectF* pRect, | |
| 45 FWLTHEME_STATE eState, | |
| 46 CFX_Matrix* pMatrix, | |
| 47 int32_t iActive = 0); | |
| 48 void DrawNarrowCaption(CFX_Graphics* pGraphics, | |
| 49 const CFX_RectF* pRect, | |
| 50 FWLTHEME_STATE eState, | |
| 51 CFX_Matrix* pMatrix, | |
| 52 int32_t iActive = 0); | |
| 53 void DrawCloseBox(CFX_Graphics* pGraphics, | |
| 54 const CFX_RectF* pRect, | |
| 55 FWLTHEME_STATE eState, | |
| 56 CFX_Matrix* pMatrix, | |
| 57 int32_t iActive = 0); | |
| 58 void DrawMinMaxBoxCommon(CFX_Graphics* pGraphics, | |
| 59 const CFX_RectF* pRect, | |
| 60 FWLTHEME_STATE eState, | |
| 61 CFX_Matrix* pMatrix, | |
| 62 int32_t iActive = 0); | |
| 63 void DrawMinimizeBox(CFX_Graphics* pGraphics, | |
| 64 const CFX_RectF* pRect, | |
| 65 FWLTHEME_STATE eState, | |
| 66 CFX_Matrix* pMatrix, | |
| 67 int32_t iActive = 0); | |
| 68 void DrawMaximizeBox(CFX_Graphics* pGraphics, | |
| 69 const CFX_RectF* pRect, | |
| 70 FWLTHEME_STATE eState, | |
| 71 bool bMax, | |
| 72 CFX_Matrix* pMatrix, | |
| 73 int32_t iActive = 0); | |
| 74 void DrawIconImage(CFX_Graphics* pGraphics, | |
| 75 CFX_DIBitmap* pDIBitmap, | |
| 76 const CFX_RectF* pRect, | |
| 77 FWLTHEME_STATE eState, | |
| 78 CFX_Matrix* pMatrix, | |
| 79 int32_t iActive = 0); | |
| 80 void SetThemeData(uint32_t dwID); | |
| 81 void TransModeColor(FX_ARGB clrFore, FX_ARGB& clrBack); | |
| 82 void DeactiveForm(); | |
| 83 void InitCaption(FX_BOOL bActive); | |
| 84 CFX_DIBitmap* m_pActiveBitmap; | |
| 85 CFX_DIBitmap* m_pDeactivebitmap; | |
| 86 CFX_RectF m_rtDisCaption; | |
| 87 CFX_RectF m_rtDisLBorder; | |
| 88 CFX_RectF m_rtDisRBorder; | |
| 89 CFX_RectF m_rtDisBBorder; | |
| 90 struct SBThemeData { | |
| 91 FX_ARGB clrHeadBK[2][4]; | |
| 92 FX_ARGB clrHeadEdgeLeft[2][3]; | |
| 93 FX_ARGB clrHeadEdgeRight[2][3]; | |
| 94 FX_ARGB clrHeadEdgeTop[2][3]; | |
| 95 FX_ARGB clrHeadEdgeBottom[2][3]; | |
| 96 FX_ARGB clrCloseBtBKStart[2][3]; | |
| 97 FX_ARGB clrCloseBtBKEnd[2][3]; | |
| 98 FX_ARGB clrCloseBtEdgeLight[2][3]; | |
| 99 FX_ARGB clrCloseBtEdgeDark[2][3]; | |
| 100 FX_ARGB clrNormalBtBKStart[2][3]; | |
| 101 FX_ARGB clrNormalBtBKEnd[2][3]; | |
| 102 FX_ARGB clrNormalBtEdgeLight[2][3]; | |
| 103 FX_ARGB clrNormalBtEdgeDark[2][3]; | |
| 104 FX_ARGB clrBtnEdgeOut[2]; | |
| 105 FX_ARGB clrBtnCornerLight[2][3]; | |
| 106 FX_ARGB clrHeadText[2]; | |
| 107 FX_ARGB clrFormBorder[2][5]; | |
| 108 FX_ARGB clrFormBorderLight[2]; | |
| 109 FX_ARGB clrTransWhite; | |
| 110 } * m_pThemeData; | |
| 111 }; | |
| 112 | |
| 113 #endif // XFA_FWL_THEME_CFWL_FORMTP_H_ | |
| OLD | NEW |