diff options
author | Nico Weber <thakis@chromium.org> | 2015-08-04 13:00:21 -0700 |
---|---|---|
committer | Nico Weber <thakis@chromium.org> | 2015-08-04 13:00:21 -0700 |
commit | 9d8ec5a6e37e8d1d4d4edca9040de234e2d4728f (patch) | |
tree | c97037f398d714665aefccb6eb54d0969ad7030c /xfa/include/fwl/theme | |
parent | 780cee82236d1b3b0f9b01a22424e4b8ec9a6f12 (diff) | |
download | pdfium-9d8ec5a6e37e8d1d4d4edca9040de234e2d4728f.tar.xz |
XFA: clang-format all pdfium code.
No behavior change.
Generated by:
find . -name '*.cpp' -o -name '*.h' | \
grep -E -v 'third_party|thirdparties|lpng_v163|tiff_v403' | \
xargs ../../buildtools/mac/clang-format -i
Then manually merged https://codereview.chromium.org/1269223002/
See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion.
BUG=none
Diffstat (limited to 'xfa/include/fwl/theme')
-rw-r--r-- | xfa/include/fwl/theme/barcodetp.h | 13 | ||||
-rw-r--r-- | xfa/include/fwl/theme/carettp.h | 22 | ||||
-rw-r--r-- | xfa/include/fwl/theme/checkboxtp.h | 104 | ||||
-rw-r--r-- | xfa/include/fwl/theme/comboboxtp.h | 26 | ||||
-rw-r--r-- | xfa/include/fwl/theme/datetimepickertp.h | 26 | ||||
-rw-r--r-- | xfa/include/fwl/theme/edittp.h | 17 | ||||
-rw-r--r-- | xfa/include/fwl/theme/formtp.h | 151 | ||||
-rw-r--r-- | xfa/include/fwl/theme/listboxtp.h | 26 | ||||
-rw-r--r-- | xfa/include/fwl/theme/monthcalendartp.h | 73 | ||||
-rw-r--r-- | xfa/include/fwl/theme/pictureboxtp.h | 13 | ||||
-rw-r--r-- | xfa/include/fwl/theme/pushbuttontp.h | 56 | ||||
-rw-r--r-- | xfa/include/fwl/theme/scrollbartp.h | 66 | ||||
-rw-r--r-- | xfa/include/fwl/theme/utils.h | 113 | ||||
-rw-r--r-- | xfa/include/fwl/theme/widgettp.h | 266 |
14 files changed, 566 insertions, 406 deletions
diff --git a/xfa/include/fwl/theme/barcodetp.h b/xfa/include/fwl/theme/barcodetp.h index 803e06bd04..6923909c92 100644 --- a/xfa/include/fwl/theme/barcodetp.h +++ b/xfa/include/fwl/theme/barcodetp.h @@ -8,12 +8,11 @@ #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);
+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 index 57ea85b708..c291f8c8fa 100644 --- a/xfa/include/fwl/theme/carettp.h +++ b/xfa/include/fwl/theme/carettp.h @@ -8,14 +8,18 @@ #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);
+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 index b11407063e..6d03cf199e 100644 --- a/xfa/include/fwl/theme/checkboxtp.h +++ b/xfa/include/fwl/theme/checkboxtp.h @@ -8,40 +8,74 @@ #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;
+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 index 62b378f653..7da5d661ca 100644 --- a/xfa/include/fwl/theme/comboboxtp.h +++ b/xfa/include/fwl/theme/comboboxtp.h @@ -8,16 +8,20 @@ #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);
+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 index 39e509530c..b95cd0537d 100644 --- a/xfa/include/fwl/theme/datetimepickertp.h +++ b/xfa/include/fwl/theme/datetimepickertp.h @@ -8,18 +8,18 @@ #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;
+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 index 307382e343..a6e1da816f 100644 --- a/xfa/include/fwl/theme/edittp.h +++ b/xfa/include/fwl/theme/edittp.h @@ -8,14 +8,13 @@ #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();
+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 index 55449da6fd..0b7cb874ec 100644 --- a/xfa/include/fwl/theme/formtp.h +++ b/xfa/include/fwl/theme/formtp.h @@ -8,66 +8,101 @@ #define _FWL_FORM_THEMEPROVIDER_H
class CFWL_WidgetTP;
class CFWL_FormTP;
-class CFWL_FormTP : public CFWL_WidgetTP
-{
-public:
- CFWL_FormTP();
- virtual ~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:
+ 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);
- 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);
+ 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;
+ 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 index 4b82aa653a..5e4a6dc991 100644 --- a/xfa/include/fwl/theme/listboxtp.h +++ b/xfa/include/fwl/theme/listboxtp.h @@ -9,16 +9,20 @@ 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);
+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 index f601600659..903e3a0860 100644 --- a/xfa/include/fwl/theme/monthcalendartp.h +++ b/xfa/include/fwl/theme/monthcalendartp.h @@ -8,41 +8,42 @@ #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;
+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 index 938ac07b1d..f2ffd5edf5 100644 --- a/xfa/include/fwl/theme/pictureboxtp.h +++ b/xfa/include/fwl/theme/pictureboxtp.h @@ -8,12 +8,11 @@ #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);
+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 index 20df2037ab..59b9d2dc7b 100644 --- a/xfa/include/fwl/theme/pushbuttontp.h +++ b/xfa/include/fwl/theme/pushbuttontp.h @@ -8,33 +8,35 @@ #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);
+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();
- struct PBThemeData {
- FX_ARGB clrBorder[5];
- FX_ARGB clrStart[5];
- FX_ARGB clrEnd[5];
- FX_ARGB clrFill[5];
- } *m_pThemeData;
+ 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 index 94002fbd11..24be474202 100644 --- a/xfa/include/fwl/theme/scrollbartp.h +++ b/xfa/include/fwl/theme/scrollbartp.h @@ -8,28 +8,48 @@ #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;
+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 index fbad2ad977..083debfda0 100644 --- a/xfa/include/fwl/theme/utils.h +++ b/xfa/include/fwl/theme/utils.h @@ -4,84 +4,69 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FWL_THEME_UTILS_H
-#define _FWL_THEME_UTILS_H
+#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
+ 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
+ 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
+ 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;
- };
+ 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;
- }
+ _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;
- }
+ bool operator==(const _FWLCOLOR& frColor) { return color == frColor.color; }
- operator FX_DWORD()
- {
- return 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))
+#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
+#define FWLTHEME_CAPACITY_EdgeFlat 2.0f
#else
-#define FWLTHEME_CAPACITY_EdgeFlat 0.0f
+#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
+#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 index 6460b2bd57..cd7cc0dbdd 100644 --- a/xfa/include/fwl/theme/widgettp.h +++ b/xfa/include/fwl/theme/widgettp.h @@ -16,110 +16,184 @@ 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;
+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_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 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;
- 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;
+ 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;
+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;
+ 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;
+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();
+CFWL_FontManager* FWL_GetFontManager();
#endif
|