diff options
Diffstat (limited to 'xfa/include/fwl/theme')
-rw-r--r-- | xfa/include/fwl/theme/barcodetp.h | 18 | ||||
-rw-r--r-- | xfa/include/fwl/theme/carettp.h | 25 | ||||
-rw-r--r-- | xfa/include/fwl/theme/checkboxtp.h | 81 | ||||
-rw-r--r-- | xfa/include/fwl/theme/comboboxtp.h | 27 | ||||
-rw-r--r-- | xfa/include/fwl/theme/datetimepickertp.h | 25 | ||||
-rw-r--r-- | xfa/include/fwl/theme/edittp.h | 20 | ||||
-rw-r--r-- | xfa/include/fwl/theme/formtp.h | 108 | ||||
-rw-r--r-- | xfa/include/fwl/theme/listboxtp.h | 28 | ||||
-rw-r--r-- | xfa/include/fwl/theme/monthcalendartp.h | 49 | ||||
-rw-r--r-- | xfa/include/fwl/theme/pictureboxtp.h | 18 | ||||
-rw-r--r-- | xfa/include/fwl/theme/pushbuttontp.h | 42 | ||||
-rw-r--r-- | xfa/include/fwl/theme/scrollbartp.h | 55 | ||||
-rw-r--r-- | xfa/include/fwl/theme/utils.h | 72 | ||||
-rw-r--r-- | xfa/include/fwl/theme/widgettp.h | 199 |
14 files changed, 767 insertions, 0 deletions
diff --git a/xfa/include/fwl/theme/barcodetp.h b/xfa/include/fwl/theme/barcodetp.h new file mode 100644 index 0000000000..7a16afcac3 --- /dev/null +++ b/xfa/include/fwl/theme/barcodetp.h @@ -0,0 +1,18 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_BARCODETP_H +#define _FWL_BARCODETP_H +class CFWL_WidgetTP; +class CFWL_BarcodeTP; +class CFWL_BarcodeTP : public CFWL_WidgetTP { + public: + CFWL_BarcodeTP(); + virtual ~CFWL_BarcodeTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); +}; +#endif diff --git a/xfa/include/fwl/theme/carettp.h b/xfa/include/fwl/theme/carettp.h new file mode 100644 index 0000000000..f3f5992636 --- /dev/null +++ b/xfa/include/fwl/theme/carettp.h @@ -0,0 +1,25 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_CARETTP_H +#define _FWL_CARETTP_H +class CFWL_WidgetTP; +class CFWL_CaretTP; +class CFWL_CaretTP : public CFWL_WidgetTP { + public: + CFWL_CaretTP(); + virtual ~CFWL_CaretTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + + protected: + void DrawCaretBK(CFX_Graphics* pGraphics, + FX_DWORD dwStates, + const CFX_RectF* pRect, + CFX_Color* crFill, + CFX_Matrix* pMatrix = NULL); +}; +#endif diff --git a/xfa/include/fwl/theme/checkboxtp.h b/xfa/include/fwl/theme/checkboxtp.h new file mode 100644 index 0000000000..edc3f7170f --- /dev/null +++ b/xfa/include/fwl/theme/checkboxtp.h @@ -0,0 +1,81 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_CHECKBOXTP_H +#define _FWL_CHECKBOXTP_H +class CFWL_WidgetTP; +class CFWL_CheckBoxTP; +class CFWL_CheckBoxTP : public CFWL_WidgetTP { + public: + CFWL_CheckBoxTP(); + virtual ~CFWL_CheckBoxTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, + FX_DWORD dwThemeID, + FX_BOOL bChildren = TRUE); + virtual FX_BOOL DrawText(CFWL_ThemeText* pParams); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + virtual FWL_ERR Initialize(); + virtual FWL_ERR Finalize(); + + protected: + void DrawBoxBk(IFWL_Widget* pWidget, + CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FX_DWORD dwStates, + CFX_Matrix* pMatrix = NULL); + void DrawSign(IFWL_Widget* pWidget, + CFX_Graphics* pGraphics, + const CFX_RectF* pRtBox, + FX_DWORD dwStates, + CFX_Matrix* pMatrix = NULL); + void DrawSignNeutral(CFX_Graphics* pGraphics, + const CFX_RectF* pRtSign, + CFX_Matrix* pMatrix = NULL); + void DrawSignCheck(CFX_Graphics* pGraphics, + const CFX_RectF* pRtSign, + FX_ARGB argbFill, + CFX_Matrix* pMatrix = NULL); + void DrawSignCircle(CFX_Graphics* pGraphics, + const CFX_RectF* pRtSign, + FX_ARGB argbFill, + CFX_Matrix* pMatrix = NULL); + void DrawSignCross(CFX_Graphics* pGraphics, + const CFX_RectF* pRtSign, + FX_ARGB argbFill, + CFX_Matrix* pMatrix = NULL); + void DrawSignDiamond(CFX_Graphics* pGraphics, + const CFX_RectF* pRtSign, + FX_ARGB argbFill, + CFX_Matrix* pMatrix = NULL); + void DrawSignSquare(CFX_Graphics* pGraphics, + const CFX_RectF* pRtSign, + FX_ARGB argbFill, + CFX_Matrix* pMatrix = NULL); + void DrawSignStar(CFX_Graphics* pGraphics, + const CFX_RectF* pRtSign, + FX_ARGB argbFill, + CFX_Matrix* pMatrix = NULL); + void DrawSignBorder(IFWL_Widget* pWidget, + CFX_Graphics* pGraphics, + const CFX_RectF* pRtBox, + FX_BOOL bDisable = FALSE, + CFX_Matrix* pMatrix = NULL); + void SetThemeData(FX_DWORD dwID); + void initCheckPath(FX_FLOAT fCheckLen); + struct CKBThemeData { + FX_ARGB clrBoxBk[13][2]; + FX_ARGB clrSignBorderNormal; + FX_ARGB clrSignBorderDisable; + FX_ARGB clrSignCheck; + FX_ARGB clrSignNeutral; + FX_ARGB clrSignNeutralNormal; + FX_ARGB clrSignNeutralHover; + FX_ARGB clrSignNeutralPressed; + } * m_pThemeData; + CFX_Path* m_pCheckPath; +}; +#endif diff --git a/xfa/include/fwl/theme/comboboxtp.h b/xfa/include/fwl/theme/comboboxtp.h new file mode 100644 index 0000000000..84dbdbabf3 --- /dev/null +++ b/xfa/include/fwl/theme/comboboxtp.h @@ -0,0 +1,27 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_COMBOBOXTP_H +#define _FWL_COMBOBOXTP_H +class CFWL_WidgetTP; +class CFWL_ComboBoxTP; +class CFWL_ComboBoxTP : public CFWL_WidgetTP { + public: + CFWL_ComboBoxTP(); + virtual ~CFWL_ComboBoxTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); + + protected: + void DrawDropDownButton(CFWL_ThemeBackground* pParams, + FX_DWORD dwStates, + CFX_Matrix* pMatrix); + void DrawStrethHandler(CFWL_ThemeBackground* pParams, + FX_DWORD dwStates, + CFX_Matrix* pMatrix); +}; +#endif diff --git a/xfa/include/fwl/theme/datetimepickertp.h b/xfa/include/fwl/theme/datetimepickertp.h new file mode 100644 index 0000000000..5fe43f3d49 --- /dev/null +++ b/xfa/include/fwl/theme/datetimepickertp.h @@ -0,0 +1,25 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_DATETIMEPICKERTP_H +#define _FWL_DATETIMEPICKERTP_H +class CFWL_WidgetTP; +class CFWL_DateTimePickerTP; +class CFWL_DateTimePickerTP : public CFWL_WidgetTP { + public: + CFWL_DateTimePickerTP(); + virtual ~CFWL_DateTimePickerTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + + protected: + void DrawDropDownButton(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + void initThemeData(); + struct DTPThemeData { + FX_ARGB BoxBkColor[13][2]; + } * m_pThemeData; +}; +#endif diff --git a/xfa/include/fwl/theme/edittp.h b/xfa/include/fwl/theme/edittp.h new file mode 100644 index 0000000000..babea93807 --- /dev/null +++ b/xfa/include/fwl/theme/edittp.h @@ -0,0 +1,20 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_EDITTP_H +#define _FWL_EDITTP_H +class CFWL_WidgetTP; +class CFWL_EditTP; +class CFWL_EditTP : public CFWL_WidgetTP { + public: + CFWL_EditTP(); + virtual ~CFWL_EditTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + virtual FWL_ERR Initialize(); + virtual FWL_ERR Finalize(); +}; +#endif diff --git a/xfa/include/fwl/theme/formtp.h b/xfa/include/fwl/theme/formtp.h new file mode 100644 index 0000000000..83085040b1 --- /dev/null +++ b/xfa/include/fwl/theme/formtp.h @@ -0,0 +1,108 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_FORM_THEMEPROVIDER_H +#define _FWL_FORM_THEMEPROVIDER_H +class CFWL_WidgetTP; +class CFWL_FormTP; +class CFWL_FormTP : public CFWL_WidgetTP { + public: + CFWL_FormTP(); + virtual ~CFWL_FormTP(); + + virtual FWL_ERR Initialize(); + virtual FWL_ERR Finalize(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, + FX_DWORD dwThemeID, + FX_BOOL bChildren = TRUE); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + virtual FX_BOOL DrawText(CFWL_ThemeText* pParams); + virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); + virtual FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart); + + protected: + void CalCloseBox(IFWL_Widget* pWidget, CFX_RectF& rect); + void CalMaxBox(IFWL_Widget* pWidget, CFX_RectF& rect); + void CalMinBox(IFWL_Widget* pWidget, CFX_RectF& rect); + void CalCaption(IFWL_Widget* pWidget, CFX_RectF& rect); + void CalIcon(IFWL_Widget* pWidget, CFX_RectF& rect); + + void DrawFormBorder(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix, + int32_t iActive = 0); + void DrawCaption(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix, + int32_t iActive = 0); + void DrawNarrowCaption(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix, + int32_t iActive = 0); + void DrawCloseBox(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix, + int32_t iActive = 0); + void DrawMinMaxBoxCommon(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix, + int32_t iActive = 0); + void DrawMinimizeBox(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix, + int32_t iActive = 0); + void DrawMaximizeBox(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_STATE eState, + FX_BOOL bMax, + CFX_Matrix* pMatrix, + int32_t iActive = 0); + void DrawIconImage(CFX_Graphics* pGraphics, + CFX_DIBitmap* pDIBitmap, + const CFX_RectF* pRect, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix, + int32_t iActive = 0); + void SetThemeData(FX_DWORD dwID); + void TransModeColor(FX_ARGB clrFore, FX_ARGB& clrBack); + void DeactiveForm(); + void InitCaption(FX_BOOL bActive); + CFX_DIBitmap* m_pActiveBitmap; + CFX_DIBitmap* m_pDeactivebitmap; + CFX_RectF m_rtDisCaption; + CFX_RectF m_rtDisLBorder; + CFX_RectF m_rtDisRBorder; + CFX_RectF m_rtDisBBorder; + struct SBThemeData { + FX_ARGB clrHeadBK[2][4]; + FX_ARGB clrHeadEdgeLeft[2][3]; + FX_ARGB clrHeadEdgeRight[2][3]; + FX_ARGB clrHeadEdgeTop[2][3]; + FX_ARGB clrHeadEdgeBottom[2][3]; + FX_ARGB clrCloseBtBKStart[2][3]; + FX_ARGB clrCloseBtBKEnd[2][3]; + FX_ARGB clrCloseBtEdgeLight[2][3]; + FX_ARGB clrCloseBtEdgeDark[2][3]; + FX_ARGB clrNormalBtBKStart[2][3]; + FX_ARGB clrNormalBtBKEnd[2][3]; + FX_ARGB clrNormalBtEdgeLight[2][3]; + FX_ARGB clrNormalBtEdgeDark[2][3]; + FX_ARGB clrBtnEdgeOut[2]; + FX_ARGB clrBtnCornerLight[2][3]; + FX_ARGB clrHeadText[2]; + FX_ARGB clrFormBorder[2][5]; + FX_ARGB clrFormBorderLight[2]; + FX_ARGB clrTransWhite; + } * m_pThemeData; +}; +#endif diff --git a/xfa/include/fwl/theme/listboxtp.h b/xfa/include/fwl/theme/listboxtp.h new file mode 100644 index 0000000000..c44fcc72bc --- /dev/null +++ b/xfa/include/fwl/theme/listboxtp.h @@ -0,0 +1,28 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_LISTBOXTP_H +#define _FWL_LISTBOXTP_H +class CFWL_WidgetTP; +class CFWL_ScrollBarTP; +class CFWL_ListBoxTP; +class CFWL_ListBoxTP : public CFWL_WidgetTP { + public: + CFWL_ListBoxTP(); + virtual ~CFWL_ListBoxTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + virtual FWL_ERR Initialize(); + virtual FWL_ERR Finalize(); + + protected: + void DrawListBoxItem(CFX_Graphics* pGraphics, + FX_DWORD dwStates, + const CFX_RectF* prtItem, + void* pData = NULL, + CFX_Matrix* pMatrix = NULL); +}; +#endif diff --git a/xfa/include/fwl/theme/monthcalendartp.h b/xfa/include/fwl/theme/monthcalendartp.h new file mode 100644 index 0000000000..27773df1e0 --- /dev/null +++ b/xfa/include/fwl/theme/monthcalendartp.h @@ -0,0 +1,49 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_MONTHCALENDARTP_H +#define _FWL_MONTHCALENDARTP_H +class CFWL_WidgetTP; +class CFWL_MonthCalendarTP; +class CFWL_MonthCalendarTP : public CFWL_WidgetTP { + public: + CFWL_MonthCalendarTP(); + virtual ~CFWL_MonthCalendarTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, + FX_DWORD dwThemeID, + FX_BOOL bChildren = TRUE); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + virtual FX_BOOL DrawText(CFWL_ThemeText* pParams); + virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); + virtual FWL_ERR Initialize(); + virtual FWL_ERR Finalize(); + + protected: + FX_BOOL DrawTotalBK(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + FX_BOOL DrawHeadBk(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + FX_BOOL DrawLButton(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + FX_BOOL DrawRButton(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + FX_BOOL DrawDatesInBK(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + FX_BOOL DrawDatesInCircle(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + FX_BOOL DrawTodayCircle(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + FX_BOOL DrawHSeperator(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + FX_BOOL DrawWeekNumSep(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + FWLTHEME_STATE GetState(FX_DWORD dwFWLStates); + void SetThemeData(FX_DWORD dwThemeID); + class MCThemeData { + public: + FX_ARGB clrCaption; + FX_ARGB clrSeperator; + FX_ARGB clrDatesHoverBK; + FX_ARGB clrDatesSelectedBK; + FX_ARGB clrDatesCircle; + FX_ARGB clrToday; + FX_ARGB clrBK; + } * m_pThemeData; + CFX_WideString wsResource; +}; +#endif diff --git a/xfa/include/fwl/theme/pictureboxtp.h b/xfa/include/fwl/theme/pictureboxtp.h new file mode 100644 index 0000000000..f15b220093 --- /dev/null +++ b/xfa/include/fwl/theme/pictureboxtp.h @@ -0,0 +1,18 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_PICTUREBOXTP_H +#define _FWL_PICTUREBOXTP_H +class CFWL_WidgetTP; +class CFWL_PictureBoxTP; +class CFWL_PictureBoxTP : public CFWL_WidgetTP { + public: + CFWL_PictureBoxTP(); + virtual ~CFWL_PictureBoxTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); +}; +#endif diff --git a/xfa/include/fwl/theme/pushbuttontp.h b/xfa/include/fwl/theme/pushbuttontp.h new file mode 100644 index 0000000000..632ded96c7 --- /dev/null +++ b/xfa/include/fwl/theme/pushbuttontp.h @@ -0,0 +1,42 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_PUSHBUTTONTP_H +#define _FWL_PUSHBUTTONTP_H +class CFWL_WidgetTP; +class CFWL_PushButtonTP; +class CFWL_PushButtonTP : public CFWL_WidgetTP { + public: + CFWL_PushButtonTP(); + virtual ~CFWL_PushButtonTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, + FX_DWORD dwThemeID, + FX_BOOL bChildren = TRUE); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); + virtual FWL_ERR Initialize(); + virtual FWL_ERR Finalize(); + + protected: + void SetThemeData(FX_DWORD dwID); + void SetTopLineColor(FX_DWORD* pData); + void SetLeftLineColor(FX_DWORD* pData); + void SetRightLineColor(FX_DWORD* pData); + void SetBottomLineColor(FX_DWORD* pData); + void SetBackgroudColor(FX_DWORD* pData); + void SetCaptionColor(FX_DWORD* pData); + void SetCornerColor(FX_DWORD* pData); + int32_t GetColorID(FX_DWORD dwStates); + + struct PBThemeData { + FX_ARGB clrBorder[5]; + FX_ARGB clrStart[5]; + FX_ARGB clrEnd[5]; + FX_ARGB clrFill[5]; + } * m_pThemeData; +}; +#endif diff --git a/xfa/include/fwl/theme/scrollbartp.h b/xfa/include/fwl/theme/scrollbartp.h new file mode 100644 index 0000000000..d708066d4d --- /dev/null +++ b/xfa/include/fwl/theme/scrollbartp.h @@ -0,0 +1,55 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_SCROLLBARTP_H +#define _FWL_SCROLLBARTP_H +class CFWL_WidgetTP; +class CFWL_ScrollBarTP; +class CFWL_ScrollBarTP : public CFWL_WidgetTP { + public: + CFWL_ScrollBarTP(); + virtual ~CFWL_ScrollBarTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, + FX_DWORD dwThemeID, + FX_BOOL bChildren = TRUE); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); + + protected: + void DrawThumbBtn(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FX_BOOL bVert, + FWLTHEME_STATE eState, + FX_BOOL bPawButton = TRUE, + CFX_Matrix* pMatrix = NULL); + void DrawTrack(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FX_BOOL bVert, + FWLTHEME_STATE eState, + FX_BOOL bLowerTrack, + CFX_Matrix* pMatrix = NULL); + void DrawMaxMinBtn(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_DIRECTION eDict, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix = NULL); + void DrawPaw(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FX_BOOL bVert, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix = NULL); + void SetThemeData(FX_DWORD dwID); + struct SBThemeData { + FX_ARGB clrPawColorLight[4]; + FX_ARGB clrPawColorDark[4]; + FX_ARGB clrBtnBK[4][2]; + FX_ARGB clrBtnBorder[4]; + FX_ARGB clrTrackBKStart; + FX_ARGB clrTrackBKEnd; + } * m_pThemeData; +}; +#endif diff --git a/xfa/include/fwl/theme/utils.h b/xfa/include/fwl/theme/utils.h new file mode 100644 index 0000000000..4855feace1 --- /dev/null +++ b/xfa/include/fwl/theme/utils.h @@ -0,0 +1,72 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_THEME_UTILS_H +#define _FWL_THEME_UTILS_H +#define THEME_XPSimilar +enum FWLTHEME_EDGE { + FWLTHEME_EDGE_Flat = 0, + FWLTHEME_EDGE_Raised, + FWLTHEME_EDGE_Sunken +}; +enum FWLTHEME_STATE { + FWLTHEME_STATE_Normal = 1, + FWLTHEME_STATE_Hover, + FWLTHEME_STATE_Pressed, + FWLTHEME_STATE_Disabale +}; +enum FWLTHEME_DIRECTION { + FWLTHEME_DIRECTION_Up = 0, + FWLTHEME_DIRECTION_Down, + FWLTHEME_DIRECTION_Left, + FWLTHEME_DIRECTION_Right +}; +typedef struct _FWLCOLOR { + union { + FX_DWORD color; + struct { + uint8_t b; + uint8_t g; + uint8_t r; + uint8_t a; + }; + }; + + _FWLCOLOR() { color = 0; } + _FWLCOLOR(FX_DWORD c) { color = c; } + _FWLCOLOR(const _FWLCOLOR& c) { color = c.color; } + + bool operator==(const _FWLCOLOR& frColor) { return color == frColor.color; } + + operator FX_DWORD() { return color; } +} FWLCOLOR; +#define FWLTHEME_BEZIER 0.5522847498308f +#define FWLTHEME_PI 3.141592f +#define FWLTHEME_PI_2_1 1.570796f +#define FWLTHEME_PI_2_3 4.712388f +#define FWLTHEME_COLOR_EDGELT1 (ArgbEncode(255, 172, 168, 153)) +#define FWLTHEME_COLOR_EDGELT2 (ArgbEncode(255, 113, 111, 100)) +#define FWLTHEME_COLOR_EDGERB1 (ArgbEncode(255, 241, 239, 226)) +#define FWLTHEME_COLOR_EDGERB2 (ArgbEncode(255, 255, 255, 255)) +#define FWLTHEME_COLOR_Background (ArgbEncode(255, 236, 233, 216)) +#define FWLTHEME_COLOR_BKSelected (ArgbEncode(255, 153, 193, 218)) +#define FWLTHEME_COLOR_Green_BKSelected (ArgbEncode(255, 147, 160, 112)) +#ifdef THEME_XPSimilar +#define FWLTHEME_CAPACITY_EdgeFlat 2.0f +#else +#define FWLTHEME_CAPACITY_EdgeFlat 0.0f +#endif +#define FWLTHEME_CAPACITY_EdgeRaised 2.0f +#define FWLTHEME_CAPACITY_EdgeSunken 2.0f +#define FWLTHEME_CAPACITY_FontSize 12.0f +#define FWLTHEME_CAPACITY_LineHeight 12.0f +#define FWLTHEME_CAPACITY_TextColor (ArgbEncode(255, 0, 0, 0)) +#define FWLTHEME_CAPACITY_TextSelColor (ArgbEncode(255, 153, 193, 218)) +#define FWLTHEME_CAPACITY_TextDisColor (ArgbEncode(255, 172, 168, 153)) +#define FWLTHEME_CAPACITY_ScrollBarWidth 17.0f +#define FWLTHEME_CAPACITY_CXBorder 1.0f +#define FWLTHEME_CAPACITY_CYBorder 1.0f +#endif diff --git a/xfa/include/fwl/theme/widgettp.h b/xfa/include/fwl/theme/widgettp.h new file mode 100644 index 0000000000..adeeb42d6c --- /dev/null +++ b/xfa/include/fwl/theme/widgettp.h @@ -0,0 +1,199 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_WIDGETTP_H +#define _FWL_WIDGETTP_H +class IFWL_ThemeProvider; +class IFWL_Widget; +class IFDE_TextOut; +class IFX_Font; +class IFX_FontMgr; +#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +class IFX_FontSourceEnum; +#endif +class CFWL_WidgetTP; +class CFWL_ArrowData; +class CFWL_WidgetTP { + public: + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_DWORD GetThemeID(IFWL_Widget* pWidget); + virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, + FX_DWORD dwThemeID, + FX_BOOL bChildren = TRUE); + virtual FWL_ERR GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix); + virtual FWL_ERR SetThemeMatrix(IFWL_Widget* pWidget, + const CFX_Matrix& matrix); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + virtual FX_BOOL DrawText(CFWL_ThemeText* pParams); + virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); + virtual FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget); + virtual FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart); + virtual FX_BOOL IsInPart(CFWL_ThemePart* pThemePart, + FX_FLOAT fx, + FX_FLOAT fy); + virtual FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect); + virtual FWL_ERR Initialize(); + virtual FWL_ERR Finalize(); + virtual ~CFWL_WidgetTP(); + FWL_ERR SetFont(IFWL_Widget* pWidget, + const FX_WCHAR* strFont, + FX_FLOAT fFontSize, + FX_ARGB rgbFont); + FWL_ERR SetFont(IFWL_Widget* pWidget, + IFX_Font* pFont, + FX_FLOAT fFontSize, + FX_ARGB rgbFont); + IFX_Font* GetFont(IFWL_Widget* pWidget); + + protected: + CFWL_WidgetTP(); + FX_ERR InitTTO(); + FX_ERR FinalizeTTO(); + void DrawEdge(CFX_Graphics* pGraphics, + FX_DWORD dwStyles, + const CFX_RectF* pRect, + CFX_Matrix* pMatrix = NULL); + void Draw3DRect(CFX_Graphics* pGraphics, + FWLTHEME_EDGE eType, + FX_FLOAT fWidth, + const CFX_RectF* pRect, + FX_ARGB cr1, + FX_ARGB cr2, + FX_ARGB cr3, + FX_ARGB cr4, + CFX_Matrix* pMatrix = NULL); + void Draw3DCircle(CFX_Graphics* pGraphics, + FWLTHEME_EDGE eType, + FX_FLOAT fWidth, + const CFX_RectF* pRect, + FX_ARGB cr1, + FX_ARGB cr2, + FX_ARGB cr3, + FX_ARGB cr4, + CFX_Matrix* pMatrix = NULL); + void DrawBorder(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + CFX_Matrix* pMatrix = NULL); + void FillBackground(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + CFX_Matrix* pMatrix = NULL); + void FillSoildRect(CFX_Graphics* pGraphics, + FX_ARGB fillColor, + const CFX_RectF* pRect, + CFX_Matrix* pMatrix = NULL); + void DrawAxialShading(CFX_Graphics* pGraphics, + FX_FLOAT fx1, + FX_FLOAT fy1, + FX_FLOAT fx2, + FX_FLOAT fy2, + FX_ARGB beginColor, + FX_ARGB endColor, + CFX_Path* path, + int32_t fillMode = FXFILL_WINDING, + CFX_Matrix* pMatrix = NULL); + void DrawAnnulusRect(CFX_Graphics* pGraphics, + FX_ARGB fillColor, + const CFX_RectF* pRect, + FX_FLOAT fRingWidth = 1, + CFX_Matrix* pMatrix = NULL); + void DrawAnnulusCircle(CFX_Graphics* pGraphics, + FX_ARGB fillColor, + const CFX_RectF* pRect, + FX_FLOAT fWidth = 1, + CFX_Matrix* pMatrix = NULL); + void DrawFocus(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + CFX_Matrix* pMatrix = NULL); + void DrawArrow(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_DIRECTION eDict, + FX_ARGB argbFill, + FX_BOOL bPressed, + CFX_Matrix* pMatrix = NULL); + void DrawArrow(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_DIRECTION eDict, + FX_ARGB argSign, + CFX_Matrix* pMatrix = NULL); + void DrawBtn(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix = NULL); + void DrawArrowBtn(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_DIRECTION eDict, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix = NULL); + FWLCOLOR BlendColor(FWLCOLOR srcColor, FWLCOLOR renderColor, uint8_t scale); + FX_DWORD m_dwRefCount; + IFDE_TextOut* m_pTextOut; + IFX_Font* m_pFDEFont; + FX_FLOAT m_fValue; + FX_DWORD m_dwValue; + CFX_RectF m_rtMargin; + FX_DWORD m_dwThemeID; + CFX_Matrix _ctm; +}; +FX_BOOL FWLTHEME_Init(); +void FWLTHEME_Release(); +FX_DWORD FWL_GetThemeLayout(FX_DWORD dwThemeID); +FX_DWORD FWL_GetThemeColor(FX_DWORD dwThemeID); +FX_DWORD FWL_MakeThemeID(FX_DWORD dwLayout, FX_DWORD dwColor); +class CFWL_ArrowData { + public: + static CFWL_ArrowData* GetInstance(); + static FX_BOOL IsInstance(); + static void DestroyInstance(); + virtual ~CFWL_ArrowData(); + void SetColorData(FX_DWORD dwID); + + class CColorData { + public: + FX_ARGB clrBorder[4]; + FX_ARGB clrStart[4]; + FX_ARGB clrEnd[4]; + FX_ARGB clrSign[4]; + } * m_pColorData; + + protected: + CFWL_ArrowData(); + static CFWL_ArrowData* m_pInstance; +}; +class CFWL_FontData { + public: + CFWL_FontData(); + virtual ~CFWL_FontData(); + FX_BOOL Equal(const CFX_WideStringC& wsFontFamily, + FX_DWORD dwFontStyles, + FX_WORD wCodePage); + FX_BOOL LoadFont(const CFX_WideStringC& wsFontFamily, + FX_DWORD dwFontStyles, + FX_WORD wCodePage); + IFX_Font* GetFont() const { return m_pFont; } + + protected: + CFX_WideString m_wsFamily; + FX_DWORD m_dwStyles; + FX_DWORD m_dwCodePage; + IFX_Font* m_pFont; + IFX_FontMgr* m_pFontMgr; +#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ + IFX_FontSourceEnum* m_pFontSource; +#endif +}; +class CFWL_FontManager { + public: + CFWL_FontManager(); + virtual ~CFWL_FontManager(); + IFX_Font* FindFont(const CFX_WideStringC& wsFontFamily, + FX_DWORD dwFontStyles, + FX_WORD dwCodePage); + + protected: + CFX_PtrArray m_arrFonts; +}; +CFWL_FontManager* FWL_GetFontManager(); +#endif |