From fdc00a7042d912aafaabddae4d9c84199921ef23 Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Tue, 28 Oct 2014 23:03:33 -0700 Subject: Merge XFA to PDFium master at 4dc95e7 on 10/28/2014 --- xfa/include/fwl/theme/barcodetp.h | 19 +++++ xfa/include/fwl/theme/carettp.h | 21 ++++++ xfa/include/fwl/theme/checkboxtp.h | 48 ++++++++++++ xfa/include/fwl/theme/comboboxtp.h | 23 ++++++ xfa/include/fwl/theme/datetimepickertp.h | 26 +++++++ xfa/include/fwl/theme/edittp.h | 21 ++++++ xfa/include/fwl/theme/formtp.h | 74 ++++++++++++++++++ xfa/include/fwl/theme/listboxtp.h | 24 ++++++ xfa/include/fwl/theme/monthcalendartp.h | 48 ++++++++++++ xfa/include/fwl/theme/pictureboxtp.h | 19 +++++ xfa/include/fwl/theme/pushbuttontp.h | 41 ++++++++++ xfa/include/fwl/theme/scrollbartp.h | 36 +++++++++ xfa/include/fwl/theme/utils.h | 87 +++++++++++++++++++++ xfa/include/fwl/theme/widgettp.h | 126 +++++++++++++++++++++++++++++++ 14 files changed, 613 insertions(+) create mode 100644 xfa/include/fwl/theme/barcodetp.h create mode 100644 xfa/include/fwl/theme/carettp.h create mode 100644 xfa/include/fwl/theme/checkboxtp.h create mode 100644 xfa/include/fwl/theme/comboboxtp.h create mode 100644 xfa/include/fwl/theme/datetimepickertp.h create mode 100644 xfa/include/fwl/theme/edittp.h create mode 100644 xfa/include/fwl/theme/formtp.h create mode 100644 xfa/include/fwl/theme/listboxtp.h create mode 100644 xfa/include/fwl/theme/monthcalendartp.h create mode 100644 xfa/include/fwl/theme/pictureboxtp.h create mode 100644 xfa/include/fwl/theme/pushbuttontp.h create mode 100644 xfa/include/fwl/theme/scrollbartp.h create mode 100644 xfa/include/fwl/theme/utils.h create mode 100644 xfa/include/fwl/theme/widgettp.h (limited to 'xfa/include/fwl/theme') diff --git a/xfa/include/fwl/theme/barcodetp.h b/xfa/include/fwl/theme/barcodetp.h new file mode 100644 index 0000000000..803e06bd04 --- /dev/null +++ b/xfa/include/fwl/theme/barcodetp.h @@ -0,0 +1,19 @@ +// 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..57ea85b708 --- /dev/null +++ b/xfa/include/fwl/theme/carettp.h @@ -0,0 +1,21 @@ +// 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..384effe732 --- /dev/null +++ b/xfa/include/fwl/theme/checkboxtp.h @@ -0,0 +1,48 @@ +// 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 : public CFX_Object { + public: + 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..1ed39742e6 --- /dev/null +++ b/xfa/include/fwl/theme/comboboxtp.h @@ -0,0 +1,23 @@ +// 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 FX_LPVOID 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..01a775a6f1 --- /dev/null +++ b/xfa/include/fwl/theme/datetimepickertp.h @@ -0,0 +1,26 @@ +// 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 : public CFX_Object { + public: + 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..307382e343 --- /dev/null +++ b/xfa/include/fwl/theme/edittp.h @@ -0,0 +1,21 @@ +// 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..b7e68e2d5b --- /dev/null +++ b/xfa/include/fwl/theme/formtp.h @@ -0,0 +1,74 @@ +// 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 FX_LPVOID 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, FX_INT32 iActive = 0); + void DrawCaption(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive = 0); + void DrawNarrowCaption(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive = 0); + void DrawCloseBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive = 0); + void DrawMinMaxBoxCommon(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive = 0); + void DrawMinimizeBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive = 0); + void DrawMaximizeBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, FX_BOOL bMax, CFX_Matrix *pMatrix, FX_INT32 iActive = 0); + void DrawIconImage(CFX_Graphics *pGraphics, CFX_DIBitmap *pDIBitmap, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 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 : public CFX_Object { + public: + 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..aaae2eba38 --- /dev/null +++ b/xfa/include/fwl/theme/listboxtp.h @@ -0,0 +1,24 @@ +// 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, FX_LPVOID 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..55d991d404 --- /dev/null +++ b/xfa/include/fwl/theme/monthcalendartp.h @@ -0,0 +1,48 @@ +// 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 FX_LPVOID 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 CFX_Object + { + 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..938ac07b1d --- /dev/null +++ b/xfa/include/fwl/theme/pictureboxtp.h @@ -0,0 +1,19 @@ +// 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..676a5fce50 --- /dev/null +++ b/xfa/include/fwl/theme/pushbuttontp.h @@ -0,0 +1,41 @@ +// 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 FX_LPVOID 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); + FX_INT32 GetColorID(FX_DWORD dwStates); + + struct PBThemeData : CFX_Object { + public: + 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..b7f1926029 --- /dev/null +++ b/xfa/include/fwl/theme/scrollbartp.h @@ -0,0 +1,36 @@ +// 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 FX_LPVOID 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 : public CFX_Object { + public: + 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..f1b6b55876 --- /dev/null +++ b/xfa/include/fwl/theme/utils.h @@ -0,0 +1,87 @@ +// 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 { + FX_BYTE b; + FX_BYTE g; + FX_BYTE r; + FX_BYTE 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..3ede92f5d7 --- /dev/null +++ b/xfa/include/fwl/theme/widgettp.h @@ -0,0 +1,126 @@ +// 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 CFX_Object; +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 CFX_Object +{ +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 FX_LPVOID 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, FX_LPCWSTR 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, FX_INT32 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, FX_BYTE 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 CFX_Object +{ +public: + static CFWL_ArrowData* GetInstance(); + static FX_BOOL IsInstance(); + static void DestroyInstance(); + virtual ~CFWL_ArrowData(); + void SetColorData(FX_DWORD dwID); + + class CColorData : public CFX_Object + { + 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 CFX_Object +{ +public: + CFWL_FontData(); + virtual ~CFWL_FontData(); + FX_BOOL Equal(FX_WSTR wsFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage); + FX_BOOL LoadFont(FX_WSTR 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 CFX_Object +{ +public: + CFWL_FontManager(); + virtual ~CFWL_FontManager(); + IFX_Font* FindFont(FX_WSTR wsFontFamily, FX_DWORD dwFontStyles, FX_WORD dwCodePage); +protected: + CFX_PtrArray m_arrFonts; +}; +CFWL_FontManager *FWL_GetFontManager(); +#endif -- cgit v1.2.3