summaryrefslogtreecommitdiff
path: root/xfa/fwl/theme
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fwl/theme')
-rw-r--r--xfa/fwl/theme/cfwl_barcodetp.cpp (renamed from xfa/fwl/theme/barcodetp.cpp)4
-rw-r--r--xfa/fwl/theme/cfwl_barcodetp.h21
-rw-r--r--xfa/fwl/theme/cfwl_carettp.cpp (renamed from xfa/fwl/theme/carettp.cpp)2
-rw-r--r--xfa/fwl/theme/cfwl_carettp.h27
-rw-r--r--xfa/fwl/theme/cfwl_checkboxtp.cpp (renamed from xfa/fwl/theme/checkboxtp.cpp)2
-rw-r--r--xfa/fwl/theme/cfwl_checkboxtp.h84
-rw-r--r--xfa/fwl/theme/cfwl_comboboxtp.cpp (renamed from xfa/fwl/theme/comboboxtp.cpp)2
-rw-r--r--xfa/fwl/theme/cfwl_comboboxtp.h29
-rw-r--r--xfa/fwl/theme/cfwl_datetimepickedtp.cpp (renamed from xfa/fwl/theme/datetimepickertp.cpp)6
-rw-r--r--xfa/fwl/theme/cfwl_datetimepickertp.h27
-rw-r--r--xfa/fwl/theme/cfwl_edittp.cpp (renamed from xfa/fwl/theme/edittp.cpp)2
-rw-r--r--xfa/fwl/theme/cfwl_edittp.h22
-rw-r--r--xfa/fwl/theme/cfwl_formtp.cpp (renamed from xfa/fwl/theme/formtp.cpp)2
-rw-r--r--xfa/fwl/theme/cfwl_formtp.h111
-rw-r--r--xfa/fwl/theme/cfwl_listboxtp.cpp (renamed from xfa/fwl/theme/listboxtp.cpp)2
-rw-r--r--xfa/fwl/theme/cfwl_listboxtp.h29
-rw-r--r--xfa/fwl/theme/cfwl_monthcalendartp.cpp (renamed from xfa/fwl/theme/monthcalendartp.cpp)2
-rw-r--r--xfa/fwl/theme/cfwl_monthcalendartp.h51
-rw-r--r--xfa/fwl/theme/cfwl_pictureboxtp.cpp (renamed from xfa/fwl/theme/pictureboxtp.cpp)2
-rw-r--r--xfa/fwl/theme/cfwl_pictureboxtp.h20
-rw-r--r--xfa/fwl/theme/cfwl_pushbuttontp.cpp (renamed from xfa/fwl/theme/pushbuttontp.cpp)2
-rw-r--r--xfa/fwl/theme/cfwl_pushbuttontp.h46
-rw-r--r--xfa/fwl/theme/cfwl_scrollbartp.cpp (renamed from xfa/fwl/theme/scrollbartp.cpp)2
-rw-r--r--xfa/fwl/theme/cfwl_scrollbartp.h60
-rw-r--r--xfa/fwl/theme/cfwl_utils.h75
-rw-r--r--xfa/fwl/theme/cfwl_widgettp.cpp (renamed from xfa/fwl/theme/widgettp.cpp)2
-rw-r--r--xfa/fwl/theme/cfwl_widgettp.h220
27 files changed, 840 insertions, 14 deletions
diff --git a/xfa/fwl/theme/barcodetp.cpp b/xfa/fwl/theme/cfwl_barcodetp.cpp
index da10d7a344..0edc29b775 100644
--- a/xfa/fwl/theme/barcodetp.cpp
+++ b/xfa/fwl/theme/cfwl_barcodetp.cpp
@@ -4,13 +4,14 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/include/fwl/theme/barcodetp.h"
+#include "xfa/fwl/theme/cfwl_barcodetp.h"
#include "xfa/fwl/basewidget/ifwl_barcode.h"
#include "xfa/fwl/core/cfwl_themebackground.h"
#include "xfa/fwl/core/ifwl_widget.h"
CFWL_BarcodeTP::CFWL_BarcodeTP() {}
+
CFWL_BarcodeTP::~CFWL_BarcodeTP() {}
FX_BOOL CFWL_BarcodeTP::IsValidWidget(IFWL_Widget* pWidget) {
@@ -18,6 +19,7 @@ FX_BOOL CFWL_BarcodeTP::IsValidWidget(IFWL_Widget* pWidget) {
return FALSE;
return pWidget->GetClassID() == FWL_CLASSHASH_Barcode;
}
+
FX_BOOL CFWL_BarcodeTP::DrawBackground(CFWL_ThemeBackground* pParams) {
if (!pParams)
return FALSE;
diff --git a/xfa/fwl/theme/cfwl_barcodetp.h b/xfa/fwl/theme/cfwl_barcodetp.h
new file mode 100644
index 0000000000..0a03f49805
--- /dev/null
+++ b/xfa/fwl/theme/cfwl_barcodetp.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 XFA_FWL_THEME_CFWL_BARCODETP_H_
+#define XFA_FWL_THEME_CFWL_BARCODETP_H_
+
+#include "xfa/fwl/theme/cfwl_utils.h"
+#include "xfa/fwl/theme/cfwl_widgettp.h"
+
+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 // XFA_FWL_THEME_CFWL_BARCODETP_H_
diff --git a/xfa/fwl/theme/carettp.cpp b/xfa/fwl/theme/cfwl_carettp.cpp
index a5782f30b6..0ebc519642 100644
--- a/xfa/fwl/theme/carettp.cpp
+++ b/xfa/fwl/theme/cfwl_carettp.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/include/fwl/theme/carettp.h"
+#include "xfa/fwl/theme/cfwl_carettp.h"
#include "xfa/fwl/basewidget/ifwl_caret.h"
#include "xfa/fwl/core/cfwl_themebackground.h"
diff --git a/xfa/fwl/theme/cfwl_carettp.h b/xfa/fwl/theme/cfwl_carettp.h
new file mode 100644
index 0000000000..8c56d38aa9
--- /dev/null
+++ b/xfa/fwl/theme/cfwl_carettp.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 XFA_FWL_THEME_CFWL_CARETTP_H_
+#define XFA_FWL_THEME_CFWL_CARETTP_H_
+
+#include "xfa/fwl/theme/cfwl_widgettp.h"
+
+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,
+ uint32_t dwStates,
+ const CFX_RectF* pRect,
+ CFX_Color* crFill,
+ CFX_Matrix* pMatrix = NULL);
+};
+
+#endif // XFA_FWL_THEME_CFWL_CARETTP_H_
diff --git a/xfa/fwl/theme/checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp
index ee485fb7ac..94f69a4389 100644
--- a/xfa/fwl/theme/checkboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/include/fwl/theme/checkboxtp.h"
+#include "xfa/fwl/theme/cfwl_checkboxtp.h"
#include "xfa/fde/tto/fde_textout.h"
#include "xfa/fwl/basewidget/ifwl_checkbox.h"
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.h b/xfa/fwl/theme/cfwl_checkboxtp.h
new file mode 100644
index 0000000000..bb2f14dec3
--- /dev/null
+++ b/xfa/fwl/theme/cfwl_checkboxtp.h
@@ -0,0 +1,84 @@
+// 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 XFA_FWL_THEME_CFWL_CHECKBOXTP_H_
+#define XFA_FWL_THEME_CFWL_CHECKBOXTP_H_
+
+#include "xfa/fwl/theme/cfwl_utils.h"
+#include "xfa/fwl/theme/cfwl_widgettp.h"
+
+class CFWL_CheckBoxTP : public CFWL_WidgetTP {
+ public:
+ CFWL_CheckBoxTP();
+ virtual ~CFWL_CheckBoxTP();
+ virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget);
+ virtual uint32_t SetThemeID(IFWL_Widget* pWidget,
+ uint32_t 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,
+ uint32_t dwStates,
+ CFX_Matrix* pMatrix = NULL);
+ void DrawSign(IFWL_Widget* pWidget,
+ CFX_Graphics* pGraphics,
+ const CFX_RectF* pRtBox,
+ uint32_t 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(uint32_t 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 // XFA_FWL_THEME_CFWL_CHECKBOXTP_H_
diff --git a/xfa/fwl/theme/comboboxtp.cpp b/xfa/fwl/theme/cfwl_comboboxtp.cpp
index 578793b002..2c5a1c4ff4 100644
--- a/xfa/fwl/theme/comboboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_comboboxtp.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/include/fwl/theme/comboboxtp.h"
+#include "xfa/fwl/theme/cfwl_comboboxtp.h"
#include "xfa/fwl/basewidget/ifwl_combobox.h"
#include "xfa/fwl/core/cfwl_themebackground.h"
diff --git a/xfa/fwl/theme/cfwl_comboboxtp.h b/xfa/fwl/theme/cfwl_comboboxtp.h
new file mode 100644
index 0000000000..fd65fa5fab
--- /dev/null
+++ b/xfa/fwl/theme/cfwl_comboboxtp.h
@@ -0,0 +1,29 @@
+// 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 XFA_FWL_THEME_CFWL_COMBOBOXTP_H_
+#define XFA_FWL_THEME_CFWL_COMBOBOXTP_H_
+
+#include "xfa/fwl/theme/cfwl_widgettp.h"
+
+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, uint32_t dwCapacity);
+
+ protected:
+ void DrawDropDownButton(CFWL_ThemeBackground* pParams,
+ uint32_t dwStates,
+ CFX_Matrix* pMatrix);
+ void DrawStrethHandler(CFWL_ThemeBackground* pParams,
+ uint32_t dwStates,
+ CFX_Matrix* pMatrix);
+};
+
+#endif // XFA_FWL_THEME_CFWL_COMBOBOXTP_H_
diff --git a/xfa/fwl/theme/datetimepickertp.cpp b/xfa/fwl/theme/cfwl_datetimepickedtp.cpp
index 63fbc13110..4e1d39a15a 100644
--- a/xfa/fwl/theme/datetimepickertp.cpp
+++ b/xfa/fwl/theme/cfwl_datetimepickedtp.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/include/fwl/theme/datetimepickertp.h"
+#include "xfa/fwl/theme/cfwl_datetimepickertp.h"
#include "xfa/fwl/basewidget/ifwl_datetimepicker.h"
#include "xfa/fwl/core/cfwl_themebackground.h"
@@ -112,7 +112,9 @@ void CFWL_DateTimePickerTP::DrawDropDownButton(CFWL_ThemeBackground* pParams,
#endif
void CFWL_DateTimePickerTP::initThemeData() {
uint32_t* pData = (uint32_t*)&m_pThemeData->BoxBkColor;
- *pData++ = 0, *pData++ = 0, *pData++ = ArgbEncode(255, 220, 220, 215),
+ *pData++ = 0;
+ *pData++ = 0;
+ *pData++ = ArgbEncode(255, 220, 220, 215),
*pData++ = ArgbEncode(255, 255, 255, 255),
*pData++ = ArgbEncode(255, 255, 240, 207),
*pData++ = ArgbEncode(255, 248, 179, 48),
diff --git a/xfa/fwl/theme/cfwl_datetimepickertp.h b/xfa/fwl/theme/cfwl_datetimepickertp.h
new file mode 100644
index 0000000000..199551ea1f
--- /dev/null
+++ b/xfa/fwl/theme/cfwl_datetimepickertp.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 XFA_FWL_THEME_CFWL_DATETIMEPICKERTP_H_
+#define XFA_FWL_THEME_CFWL_DATETIMEPICKERTP_H_
+
+#include "xfa/fwl/theme/cfwl_widgettp.h"
+
+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 // XFA_FWL_THEME_CFWL_DATETIMEPICKERTP_H_
diff --git a/xfa/fwl/theme/edittp.cpp b/xfa/fwl/theme/cfwl_edittp.cpp
index a99b2146d1..92f32dcaa9 100644
--- a/xfa/fwl/theme/edittp.cpp
+++ b/xfa/fwl/theme/cfwl_edittp.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/include/fwl/theme/edittp.h"
+#include "xfa/fwl/theme/cfwl_edittp.h"
#include "xfa/fwl/basewidget/ifwl_edit.h"
#include "xfa/fwl/core/cfwl_themebackground.h"
diff --git a/xfa/fwl/theme/cfwl_edittp.h b/xfa/fwl/theme/cfwl_edittp.h
new file mode 100644
index 0000000000..73c99dafb7
--- /dev/null
+++ b/xfa/fwl/theme/cfwl_edittp.h
@@ -0,0 +1,22 @@
+// 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 XFA_FWL_THEME_CFWL_EDITTP_H_
+#define XFA_FWL_THEME_CFWL_EDITTP_H_
+
+#include "xfa/fwl/theme/cfwl_widgettp.h"
+
+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 // XFA_FWL_THEME_CFWL_EDITTP_H_
diff --git a/xfa/fwl/theme/formtp.cpp b/xfa/fwl/theme/cfwl_formtp.cpp
index 28a8805dee..e7cc1221d0 100644
--- a/xfa/fwl/theme/formtp.cpp
+++ b/xfa/fwl/theme/cfwl_formtp.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/include/fwl/theme/formtp.h"
+#include "xfa/fwl/theme/cfwl_formtp.h"
#include "xfa/fde/tto/fde_textout.h"
#include "xfa/fwl/core/cfwl_themebackground.h"
diff --git a/xfa/fwl/theme/cfwl_formtp.h b/xfa/fwl/theme/cfwl_formtp.h
new file mode 100644
index 0000000000..838f19858a
--- /dev/null
+++ b/xfa/fwl/theme/cfwl_formtp.h
@@ -0,0 +1,111 @@
+// 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 XFA_FWL_THEME_CFWL_FORMTP_H_
+#define XFA_FWL_THEME_CFWL_FORMTP_H_
+
+#include "xfa/fwl/theme/cfwl_utils.h"
+#include "xfa/fwl/theme/cfwl_widgettp.h"
+
+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 uint32_t SetThemeID(IFWL_Widget* pWidget,
+ uint32_t 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, uint32_t 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(uint32_t 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 // XFA_FWL_THEME_CFWL_FORMTP_H_
diff --git a/xfa/fwl/theme/listboxtp.cpp b/xfa/fwl/theme/cfwl_listboxtp.cpp
index 5c38166afa..210949aa41 100644
--- a/xfa/fwl/theme/listboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_listboxtp.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/include/fwl/theme/listboxtp.h"
+#include "xfa/fwl/theme/cfwl_listboxtp.h"
#include "xfa/fwl/basewidget/ifwl_listbox.h"
#include "xfa/fwl/core/cfwl_themebackground.h"
diff --git a/xfa/fwl/theme/cfwl_listboxtp.h b/xfa/fwl/theme/cfwl_listboxtp.h
new file mode 100644
index 0000000000..d4bd7eff94
--- /dev/null
+++ b/xfa/fwl/theme/cfwl_listboxtp.h
@@ -0,0 +1,29 @@
+// 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 XFA_FWL_THEME_CFWL_LISTBOXTP_H_
+#define XFA_FWL_THEME_CFWL_LISTBOXTP_H_
+
+#include "xfa/fwl/theme/cfwl_widgettp.h"
+
+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,
+ uint32_t dwStates,
+ const CFX_RectF* prtItem,
+ void* pData = NULL,
+ CFX_Matrix* pMatrix = NULL);
+};
+
+#endif // XFA_FWL_THEME_CFWL_LISTBOXTP_H_
diff --git a/xfa/fwl/theme/monthcalendartp.cpp b/xfa/fwl/theme/cfwl_monthcalendartp.cpp
index 2ae154860a..2d53080b37 100644
--- a/xfa/fwl/theme/monthcalendartp.cpp
+++ b/xfa/fwl/theme/cfwl_monthcalendartp.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/include/fwl/theme/monthcalendartp.h"
+#include "xfa/fwl/theme/cfwl_monthcalendartp.h"
#include "xfa/fde/tto/fde_textout.h"
#include "xfa/fwl/basewidget/ifwl_monthcalendar.h"
diff --git a/xfa/fwl/theme/cfwl_monthcalendartp.h b/xfa/fwl/theme/cfwl_monthcalendartp.h
new file mode 100644
index 0000000000..3624ee1bfd
--- /dev/null
+++ b/xfa/fwl/theme/cfwl_monthcalendartp.h
@@ -0,0 +1,51 @@
+// 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 XFA_FWL_THEME_CFWL_MONTHCALENDARTP_H_
+#define XFA_FWL_THEME_CFWL_MONTHCALENDARTP_H_
+
+#include "xfa/fwl/theme/cfwl_widgettp.h"
+
+class CFWL_MonthCalendarTP : public CFWL_WidgetTP {
+ public:
+ CFWL_MonthCalendarTP();
+ virtual ~CFWL_MonthCalendarTP();
+ virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget);
+ virtual uint32_t SetThemeID(IFWL_Widget* pWidget,
+ uint32_t 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, uint32_t 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(uint32_t dwFWLStates);
+ void SetThemeData(uint32_t 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 // XFA_FWL_THEME_CFWL_MONTHCALENDARTP_H_
diff --git a/xfa/fwl/theme/pictureboxtp.cpp b/xfa/fwl/theme/cfwl_pictureboxtp.cpp
index ab5cd02246..ee83a7eb3f 100644
--- a/xfa/fwl/theme/pictureboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_pictureboxtp.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/include/fwl/theme/pictureboxtp.h"
+#include "xfa/fwl/theme/cfwl_pictureboxtp.h"
#include "xfa/fwl/basewidget/ifwl_picturebox.h"
#include "xfa/fwl/core/cfwl_themebackground.h"
diff --git a/xfa/fwl/theme/cfwl_pictureboxtp.h b/xfa/fwl/theme/cfwl_pictureboxtp.h
new file mode 100644
index 0000000000..0216971a94
--- /dev/null
+++ b/xfa/fwl/theme/cfwl_pictureboxtp.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 XFA_FWL_THEME_CFWL_PICTUREBOXTP_H_
+#define XFA_FWL_THEME_CFWL_PICTUREBOXTP_H_
+
+#include "xfa/fwl/theme/cfwl_widgettp.h"
+
+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 // XFA_FWL_THEME_CFWL_PICTUREBOXTP_H_
diff --git a/xfa/fwl/theme/pushbuttontp.cpp b/xfa/fwl/theme/cfwl_pushbuttontp.cpp
index 00ff3e9737..5889f30927 100644
--- a/xfa/fwl/theme/pushbuttontp.cpp
+++ b/xfa/fwl/theme/cfwl_pushbuttontp.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/include/fwl/theme/pushbuttontp.h"
+#include "xfa/fwl/theme/cfwl_pushbuttontp.h"
#include "xfa/fwl/basewidget/ifwl_pushbutton.h"
#include "xfa/fwl/core/cfwl_themebackground.h"
diff --git a/xfa/fwl/theme/cfwl_pushbuttontp.h b/xfa/fwl/theme/cfwl_pushbuttontp.h
new file mode 100644
index 0000000000..b72ac86126
--- /dev/null
+++ b/xfa/fwl/theme/cfwl_pushbuttontp.h
@@ -0,0 +1,46 @@
+// 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 XFA_FWL_THEME_CFWL_PUSHBUTTONTP_H_
+#define XFA_FWL_THEME_CFWL_PUSHBUTTONTP_H_
+
+#include "xfa/fwl/theme/cfwl_widgettp.h"
+
+class CFWL_PushButtonTP : public CFWL_WidgetTP {
+ public:
+ CFWL_PushButtonTP();
+ virtual ~CFWL_PushButtonTP();
+ virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget);
+ virtual uint32_t SetThemeID(IFWL_Widget* pWidget,
+ uint32_t dwThemeID,
+ FX_BOOL bChildren = TRUE);
+ virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams);
+ virtual void* GetCapacity(CFWL_ThemePart* pThemePart, uint32_t dwCapacity);
+ virtual FWL_ERR Initialize();
+ virtual FWL_ERR Finalize();
+
+ protected:
+ struct PBThemeData {
+ FX_ARGB clrBorder[5];
+ FX_ARGB clrStart[5];
+ FX_ARGB clrEnd[5];
+ FX_ARGB clrFill[5];
+ };
+
+ void SetThemeData(uint32_t dwID);
+ void SetTopLineColor(uint32_t* pData);
+ void SetLeftLineColor(uint32_t* pData);
+ void SetRightLineColor(uint32_t* pData);
+ void SetBottomLineColor(uint32_t* pData);
+ void SetBackgroudColor(uint32_t* pData);
+ void SetCaptionColor(uint32_t* pData);
+ void SetCornerColor(uint32_t* pData);
+ int32_t GetColorID(uint32_t dwStates);
+
+ struct PBThemeData* m_pThemeData;
+};
+
+#endif // XFA_FWL_THEME_CFWL_PUSHBUTTONTP_H_
diff --git a/xfa/fwl/theme/scrollbartp.cpp b/xfa/fwl/theme/cfwl_scrollbartp.cpp
index 2df08d68be..c6a14f8e94 100644
--- a/xfa/fwl/theme/scrollbartp.cpp
+++ b/xfa/fwl/theme/cfwl_scrollbartp.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/include/fwl/theme/scrollbartp.h"
+#include "xfa/fwl/theme/cfwl_scrollbartp.h"
#include "xfa/fwl/basewidget/ifwl_scrollbar.h"
#include "xfa/fwl/core/cfwl_themebackground.h"
diff --git a/xfa/fwl/theme/cfwl_scrollbartp.h b/xfa/fwl/theme/cfwl_scrollbartp.h
new file mode 100644
index 0000000000..0530393043
--- /dev/null
+++ b/xfa/fwl/theme/cfwl_scrollbartp.h
@@ -0,0 +1,60 @@
+// 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 XFA_FWL_THEME_CFWL_SCROLLBARTP_H_
+#define XFA_FWL_THEME_CFWL_SCROLLBARTP_H_
+
+#include "xfa/fwl/theme/cfwl_widgettp.h"
+
+class CFWL_ScrollBarTP : public CFWL_WidgetTP {
+ public:
+ CFWL_ScrollBarTP();
+ virtual ~CFWL_ScrollBarTP();
+ virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget);
+ virtual uint32_t SetThemeID(IFWL_Widget* pWidget,
+ uint32_t dwThemeID,
+ FX_BOOL bChildren = TRUE);
+ virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams);
+ virtual void* GetCapacity(CFWL_ThemePart* pThemePart, uint32_t dwCapacity);
+
+ protected:
+ 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;
+ };
+
+ 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(uint32_t dwID);
+
+ struct SBThemeData* m_pThemeData;
+};
+
+#endif // XFA_FWL_THEME_CFWL_SCROLLBARTP_H_
diff --git a/xfa/fwl/theme/cfwl_utils.h b/xfa/fwl/theme/cfwl_utils.h
new file mode 100644
index 0000000000..d530b7631b
--- /dev/null
+++ b/xfa/fwl/theme/cfwl_utils.h
@@ -0,0 +1,75 @@
+// 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 XFA_FWL_THEME_CFWL_UTILS_H_
+#define XFA_FWL_THEME_CFWL_UTILS_H_
+
+#include "core/fxcrt/include/fx_system.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
+};
+struct FWLCOLOR {
+ union {
+ uint32_t color;
+ struct {
+ uint8_t b;
+ uint8_t g;
+ uint8_t r;
+ uint8_t a;
+ };
+ };
+
+ FWLCOLOR() : color(0) {}
+ FWLCOLOR(uint32_t c) : color(c) {}
+ FWLCOLOR(const FWLCOLOR& c) : color(c.color) {}
+
+ bool operator==(const FWLCOLOR& frColor) { return color == frColor.color; }
+ operator uint32_t() { return color; }
+};
+#define FWLTHEME_BEZIER FX_BEZIER
+#define FWLTHEME_PI FX_PI
+#define FWLTHEME_PI_2_1 (FX_PI / 2.0f)
+#define FWLTHEME_PI_2_3 (3.0f * FX_PI / 2.0f)
+#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 // XFA_FWL_THEME_CFWL_UTILS_H_
diff --git a/xfa/fwl/theme/widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp
index c87c70c1c2..7aaaf40454 100644
--- a/xfa/fwl/theme/widgettp.cpp
+++ b/xfa/fwl/theme/cfwl_widgettp.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/include/fwl/theme/widgettp.h"
+#include "xfa/fwl/theme/cfwl_widgettp.h"
#include <algorithm>
diff --git a/xfa/fwl/theme/cfwl_widgettp.h b/xfa/fwl/theme/cfwl_widgettp.h
new file mode 100644
index 0000000000..03d575a1d9
--- /dev/null
+++ b/xfa/fwl/theme/cfwl_widgettp.h
@@ -0,0 +1,220 @@
+// 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 XFA_FWL_THEME_CFWL_WIDGETTP_H_
+#define XFA_FWL_THEME_CFWL_WIDGETTP_H_
+
+#include <memory>
+#include <vector>
+
+#include "core/fxcrt/include/fx_coordinates.h"
+#include "core/fxcrt/include/fx_system.h"
+#include "xfa/fwl/core/fwl_error.h"
+#include "xfa/fxgraphics/include/cfx_graphics.h"
+#include "xfa/fwl/theme/cfwl_utils.h"
+
+class IFWL_Widget;
+class IFDE_TextOut;
+class IFX_Font;
+class IFX_FontMgr;
+class CFWL_ArrowData;
+class CFWL_ThemeBackground;
+class CFWL_ThemePart;
+class CFWL_ThemeText;
+
+#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
+class IFX_FontSourceEnum;
+#endif
+
+class CFWL_WidgetTP {
+ public:
+ virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget);
+ virtual uint32_t GetThemeID(IFWL_Widget* pWidget);
+ virtual uint32_t SetThemeID(IFWL_Widget* pWidget,
+ uint32_t 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, uint32_t 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,
+ uint32_t 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);
+ uint32_t m_dwRefCount;
+ IFDE_TextOut* m_pTextOut;
+ IFX_Font* m_pFDEFont;
+ FX_FLOAT m_fValue;
+ uint32_t m_dwValue;
+ CFX_RectF m_rtMargin;
+ uint32_t m_dwThemeID;
+ CFX_Matrix _ctm;
+};
+FX_BOOL FWLTHEME_Init();
+void FWLTHEME_Release();
+uint32_t FWL_GetThemeLayout(uint32_t dwThemeID);
+uint32_t FWL_GetThemeColor(uint32_t dwThemeID);
+uint32_t FWL_MakeThemeID(uint32_t dwLayout, uint32_t dwColor);
+
+class CFWL_ArrowData {
+ public:
+ static CFWL_ArrowData* GetInstance();
+ static FX_BOOL IsInstance();
+ static void DestroyInstance();
+ virtual ~CFWL_ArrowData();
+ void SetColorData(uint32_t 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,
+ uint32_t dwFontStyles,
+ uint16_t wCodePage);
+ FX_BOOL LoadFont(const CFX_WideStringC& wsFontFamily,
+ uint32_t dwFontStyles,
+ uint16_t wCodePage);
+ IFX_Font* GetFont() const { return m_pFont; }
+
+ protected:
+ CFX_WideString m_wsFamily;
+ uint32_t m_dwStyles;
+ uint32_t 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:
+ static CFWL_FontManager* GetInstance();
+ static void DestroyInstance();
+
+ IFX_Font* FindFont(const CFX_WideStringC& wsFontFamily,
+ uint32_t dwFontStyles,
+ uint16_t dwCodePage);
+
+ protected:
+ CFWL_FontManager();
+ virtual ~CFWL_FontManager();
+
+ static CFWL_FontManager* s_FontManager;
+ std::vector<std::unique_ptr<CFWL_FontData>> m_FontsArray;
+};
+
+#endif // XFA_FWL_THEME_CFWL_WIDGETTP_H_