| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef XFA_FWL_BASEWIDGET_FWL_CARETIMP_H_ | 7 #ifndef XFA_FWL_BASEWIDGET_FWL_CARETIMP_H_ |
| 8 #define XFA_FWL_BASEWIDGET_FWL_CARETIMP_H_ | 8 #define XFA_FWL_BASEWIDGET_FWL_CARETIMP_H_ |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #include "xfa/fwl/core/fwl_widgetimp.h" | 12 #include "xfa/fwl/core/fwl_widgetimp.h" |
| 11 #include "xfa/fwl/core/ifwl_timer.h" | 13 #include "xfa/fwl/core/ifwl_timer.h" |
| 12 #include "xfa/fwl/core/ifwl_widget.h" | 14 #include "xfa/fwl/core/ifwl_widget.h" |
| 13 #include "xfa/fxgraphics/cfx_color.h" | 15 #include "xfa/fxgraphics/cfx_color.h" |
| 14 | 16 |
| 15 class CFWL_WidgetImpProperties; | 17 class CFWL_WidgetImpProperties; |
| 16 class IFWL_Widget; | 18 class IFWL_Widget; |
| 17 class CFWL_CaretImpDelegate; | 19 class CFWL_CaretImpDelegate; |
| 18 | 20 |
| 19 class CFWL_CaretImp : public CFWL_WidgetImp { | 21 class CFWL_CaretImp : public CFWL_WidgetImp { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 44 explicit CFWL_CaretTimer(CFWL_CaretImp* pCaret); | 46 explicit CFWL_CaretTimer(CFWL_CaretImp* pCaret); |
| 45 ~CFWL_CaretTimer() override {} | 47 ~CFWL_CaretTimer() override {} |
| 46 void Run(IFWL_TimerInfo* hTimer) override; | 48 void Run(IFWL_TimerInfo* hTimer) override; |
| 47 CFWL_CaretImp* const m_pCaret; | 49 CFWL_CaretImp* const m_pCaret; |
| 48 }; | 50 }; |
| 49 | 51 |
| 50 void DrawCaretBK(CFX_Graphics* pGraphics, | 52 void DrawCaretBK(CFX_Graphics* pGraphics, |
| 51 IFWL_ThemeProvider* pTheme, | 53 IFWL_ThemeProvider* pTheme, |
| 52 const CFX_Matrix* pMatrix); | 54 const CFX_Matrix* pMatrix); |
| 53 | 55 |
| 54 CFWL_CaretTimer* m_pTimer; | 56 std::unique_ptr<CFWL_CaretTimer> m_pTimer; |
| 55 IFWL_TimerInfo* m_pTimerInfo; | 57 IFWL_TimerInfo* m_pTimerInfo; // not owned. |
| 56 uint32_t m_dwElapse; | 58 uint32_t m_dwElapse; |
| 57 CFX_Color m_crFill; | 59 CFX_Color m_crFill; |
| 58 FX_BOOL m_bSetColor; | 60 FX_BOOL m_bSetColor; |
| 59 }; | 61 }; |
| 60 | 62 |
| 61 class CFWL_CaretImpDelegate : public CFWL_WidgetImpDelegate { | 63 class CFWL_CaretImpDelegate : public CFWL_WidgetImpDelegate { |
| 62 public: | 64 public: |
| 63 CFWL_CaretImpDelegate(CFWL_CaretImp* pOwner); | 65 CFWL_CaretImpDelegate(CFWL_CaretImp* pOwner); |
| 64 void OnProcessMessage(CFWL_Message* pMessage) override; | 66 void OnProcessMessage(CFWL_Message* pMessage) override; |
| 65 void OnDrawWidget(CFX_Graphics* pGraphics, | 67 void OnDrawWidget(CFX_Graphics* pGraphics, |
| 66 const CFX_Matrix* pMatrix = nullptr) override; | 68 const CFX_Matrix* pMatrix = nullptr) override; |
| 67 | 69 |
| 68 protected: | 70 protected: |
| 69 CFWL_CaretImp* m_pOwner; | 71 CFWL_CaretImp* m_pOwner; |
| 70 }; | 72 }; |
| 71 | 73 |
| 72 #endif // XFA_FWL_BASEWIDGET_FWL_CARETIMP_H_ | 74 #endif // XFA_FWL_BASEWIDGET_FWL_CARETIMP_H_ |
| OLD | NEW |