7#include "fpdfsdk/pwl/cpwl_caret.h"
12#include "core/fxge/cfx_fillrenderoptions.h"
13#include "core/fxge/cfx_graphstatedata.h"
14#include "core/fxge/cfx_path.h"
15#include "core/fxge/cfx_renderdevice.h"
19 std::unique_ptr<IPWL_FillerNotify::PerWindowData> pAttachedData)
32 float fCaretX = rcRect
.left + m_fWidth * 0.5f;
33 float fCaretTop = rcRect
.top;
34 float fCaretBottom = rcRect
.bottom;
40 fCaretTop = rcRect
.top;
64 return CFX_FloatRect(m_ptFoot.x, m_ptFoot.y, m_ptHead.x + m_fWidth,
69 const CFX_PointF& ptHead,
70 const CFX_PointF& ptFoot) {
72 m_ptHead = CFX_PointF();
73 m_ptFoot = CFX_PointF();
86 static constexpr int32_t kCaretFlashIntervalMs = 500;
90 m_pTimer = std::make_unique<CFX_Timer>(GetTimerHandler(),
this,
91 kCaretFlashIntervalMs);
97 Move(m_rcInvalid,
false,
true);
103 if (m_ptHead == ptHead && m_ptFoot == ptFoot)
109 Move(m_rcInvalid,
false,
true);
void Intersect(const CFX_FloatRect &other_rect)
void Inflate(float x, float y)
void AppendPoint(const CFX_PointF &point, Point::Type type)
bool DrawPath(const CFX_Path &path, const CFX_Matrix *pObject2Device, const CFX_GraphStateData *pGraphState, uint32_t fill_color, uint32_t stroke_color, const CFX_FillRenderOptions &fill_options)
bool SetVisible(bool bVisible) override
bool InvalidateRect(const CFX_FloatRect *pRect) override
void DrawThisAppearance(CFX_RenderDevice *pDevice, const CFX_Matrix &mtUser2Device) override
void SetCaret(bool bVisible, const CFX_PointF &ptHead, const CFX_PointF &ptFoot)
void OnTimerFired() override
CPWL_Caret(const CreateParams &cp, std::unique_ptr< IPWL_FillerNotify::PerWindowData > pAttachedData)
const CFX_FloatRect & GetClipRect() const
virtual bool InvalidateRect(const CFX_FloatRect *pRect)
virtual bool SetVisible(bool bVisible)
bool Move(const CFX_FloatRect &rcNew, bool bReset, bool bRefresh)
constexpr FX_ARGB ArgbEncode(uint32_t a, uint32_t r, uint32_t g, uint32_t b)
static constexpr CFX_FillRenderOptions EvenOddOptions()