summaryrefslogtreecommitdiff
path: root/xfa/fwl/theme/cfwl_widgettp.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-01-03 15:47:20 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-01-03 21:15:57 +0000
commit72f50f2021cd9f66016c962df8d27fc0c34748cd (patch)
tree735ae945128093c89634eb5bccba29af00f4d7fb /xfa/fwl/theme/cfwl_widgettp.h
parentc635c93c974db1c55032c36e81e98f3d214a249f (diff)
downloadpdfium-72f50f2021cd9f66016c962df8d27fc0c34748cd.tar.xz
Cleanup ThemeProvider code
Remove unused methods, fold the arrow data into the CFWL_WidgetTP instead of a custom class and global object. Change-Id: Ie942052555d6c8668d27072c1fcc5e8e00597518 Reviewed-on: https://pdfium-review.googlesource.com/2139 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fwl/theme/cfwl_widgettp.h')
-rw-r--r--xfa/fwl/theme/cfwl_widgettp.h57
1 files changed, 10 insertions, 47 deletions
diff --git a/xfa/fwl/theme/cfwl_widgettp.h b/xfa/fwl/theme/cfwl_widgettp.h
index 50dd478cfd..33a5febbec 100644
--- a/xfa/fwl/theme/cfwl_widgettp.h
+++ b/xfa/fwl/theme/cfwl_widgettp.h
@@ -35,48 +35,25 @@ class CFWL_WidgetTP {
virtual void Initialize();
virtual void Finalize();
- virtual bool IsValidWidget(CFWL_Widget* pWidget);
-
virtual void DrawBackground(CFWL_ThemeBackground* pParams);
virtual void DrawText(CFWL_ThemeText* pParams);
- virtual void CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect);
CFGAS_GEFont* GetFont() const { return m_pFDEFont; }
- void SetFont(CFWL_Widget* pWidget,
- const FX_WCHAR* strFont,
- FX_FLOAT fFontSize,
- FX_ARGB rgbFont);
- void SetFont(CFWL_Widget* pWidget,
- CFGAS_GEFont* pFont,
- FX_FLOAT fFontSize,
- FX_ARGB rgbFont);
- CFGAS_GEFont* GetFont(CFWL_Widget* pWidget);
-
protected:
+ struct CColorData {
+ FX_ARGB clrBorder[4];
+ FX_ARGB clrStart[4];
+ FX_ARGB clrEnd[4];
+ FX_ARGB clrSign[4];
+ };
+
CFWL_WidgetTP();
+ void InitializeArrowColorData();
void InitTTO();
void FinalizeTTO();
- 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 = nullptr);
- 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 = nullptr);
void DrawBorder(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
CFX_Matrix* pMatrix = nullptr);
@@ -97,28 +74,12 @@ class CFWL_WidgetTP {
CFX_Path* path,
int32_t fillMode = FXFILL_WINDING,
CFX_Matrix* pMatrix = nullptr);
- void DrawAnnulusRect(CFX_Graphics* pGraphics,
- FX_ARGB fillColor,
- const CFX_RectF* pRect,
- FX_FLOAT fRingWidth = 1,
- CFX_Matrix* pMatrix = nullptr);
- void DrawAnnulusCircle(CFX_Graphics* pGraphics,
- FX_ARGB fillColor,
- const CFX_RectF* pRect,
- FX_FLOAT fWidth = 1,
- CFX_Matrix* pMatrix = nullptr);
void DrawFocus(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
CFX_Matrix* pMatrix = nullptr);
void DrawArrow(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
FWLTHEME_DIRECTION eDict,
- FX_ARGB argbFill,
- bool bPressed,
- CFX_Matrix* pMatrix = nullptr);
- void DrawArrow(CFX_Graphics* pGraphics,
- const CFX_RectF* pRect,
- FWLTHEME_DIRECTION eDict,
FX_ARGB argSign,
CFX_Matrix* pMatrix = nullptr);
void DrawBtn(CFX_Graphics* pGraphics,
@@ -130,9 +91,11 @@ class CFWL_WidgetTP {
FWLTHEME_DIRECTION eDict,
FWLTHEME_STATE eState,
CFX_Matrix* pMatrix = nullptr);
+
uint32_t m_dwRefCount;
std::unique_ptr<CFDE_TextOut> m_pTextOut;
CFGAS_GEFont* m_pFDEFont;
+ std::unique_ptr<CColorData> m_pColorData;
};
void FWLTHEME_Release();