summaryrefslogtreecommitdiff
path: root/xfa/fwl/theme/cfwl_checkboxtp.h
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-08-10 11:29:57 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-10 11:29:57 -0700
commit4e62b5c7c5a35c7020d581fb65de4b3fc5ad3c1a (patch)
treeb3a46fd89073a9935bb3821d5f2638effc9617d7 /xfa/fwl/theme/cfwl_checkboxtp.h
parentd83842e0b9ef6e25ab28642e2a146159ac9f3596 (diff)
downloadpdfium-4e62b5c7c5a35c7020d581fb65de4b3fc5ad3c1a.tar.xz
Use smart pointers for class owned pointers in xfa/fwl/theme
Use smart pointers instead of raw pointer to make memory management easier for classes under xfa/fwl/theme. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2230813002
Diffstat (limited to 'xfa/fwl/theme/cfwl_checkboxtp.h')
-rw-r--r--xfa/fwl/theme/cfwl_checkboxtp.h51
1 files changed, 28 insertions, 23 deletions
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.h b/xfa/fwl/theme/cfwl_checkboxtp.h
index ce44f70aef..42d86d180f 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.h
+++ b/xfa/fwl/theme/cfwl_checkboxtp.h
@@ -7,6 +7,8 @@
#ifndef XFA_FWL_THEME_CFWL_CHECKBOXTP_H_
#define XFA_FWL_THEME_CFWL_CHECKBOXTP_H_
+#include <memory>
+
#include "xfa/fwl/theme/cfwl_utils.h"
#include "xfa/fwl/theme/cfwl_widgettp.h"
@@ -26,61 +28,64 @@ class CFWL_CheckBoxTP : public CFWL_WidgetTP {
FWL_Error Finalize() override;
protected:
+ 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;
+ };
+
void DrawBoxBk(IFWL_Widget* pWidget,
CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
uint32_t dwStates,
- CFX_Matrix* pMatrix = nullptr);
+ CFX_Matrix* pMatrix);
void DrawSign(IFWL_Widget* pWidget,
CFX_Graphics* pGraphics,
const CFX_RectF* pRtBox,
uint32_t dwStates,
- CFX_Matrix* pMatrix = nullptr);
+ CFX_Matrix* pMatrix);
void DrawSignNeutral(CFX_Graphics* pGraphics,
const CFX_RectF* pRtSign,
- CFX_Matrix* pMatrix = nullptr);
+ CFX_Matrix* pMatrix);
void DrawSignCheck(CFX_Graphics* pGraphics,
const CFX_RectF* pRtSign,
FX_ARGB argbFill,
- CFX_Matrix* pMatrix = nullptr);
+ CFX_Matrix* pMatrix);
void DrawSignCircle(CFX_Graphics* pGraphics,
const CFX_RectF* pRtSign,
FX_ARGB argbFill,
- CFX_Matrix* pMatrix = nullptr);
+ CFX_Matrix* pMatrix);
void DrawSignCross(CFX_Graphics* pGraphics,
const CFX_RectF* pRtSign,
FX_ARGB argbFill,
- CFX_Matrix* pMatrix = nullptr);
+ CFX_Matrix* pMatrix);
void DrawSignDiamond(CFX_Graphics* pGraphics,
const CFX_RectF* pRtSign,
FX_ARGB argbFill,
- CFX_Matrix* pMatrix = nullptr);
+ CFX_Matrix* pMatrix);
void DrawSignSquare(CFX_Graphics* pGraphics,
const CFX_RectF* pRtSign,
FX_ARGB argbFill,
- CFX_Matrix* pMatrix = nullptr);
+ CFX_Matrix* pMatrix);
void DrawSignStar(CFX_Graphics* pGraphics,
const CFX_RectF* pRtSign,
FX_ARGB argbFill,
- CFX_Matrix* pMatrix = nullptr);
+ CFX_Matrix* pMatrix);
void DrawSignBorder(IFWL_Widget* pWidget,
CFX_Graphics* pGraphics,
const CFX_RectF* pRtBox,
- FX_BOOL bDisable = FALSE,
- CFX_Matrix* pMatrix = nullptr);
+ FX_BOOL bDisable,
+ CFX_Matrix* pMatrix);
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;
+ void InitCheckPath(FX_FLOAT fCheckLen);
+
+ std::unique_ptr<CKBThemeData> m_pThemeData;
+ std::unique_ptr<CFX_Path> m_pCheckPath;
};
#endif // XFA_FWL_THEME_CFWL_CHECKBOXTP_H_