48const char* pDisableCursorIndicator(getenv(
"SAL_DISABLE_CURSOR_INDICATOR"));
49bool bDisableCursorIndicator(
nullptr != pDisableCursorIndicator);
111 if (
pData->mnOrientation )
113 pRenderContext->
Invert( aPoly, nInvertStyle );
119 pRenderContext->
Invert( aRect, nInvertStyle );
133 if (bDoubleBuffering)
139 if (bDoubleBuffering)
140 pGuard->SetPaintRect(pRenderContext->
PixelToLogic(aPaintRect));
165 if (mpData && mpData->mpWindow)
168 if (ImplPrepForDraw(mpData->mpWindow->GetOutDev(), *mpData))
172 mpData->mbCurVisible =
true;
181 aData.mbCurVisible =
false;
183 if (ImplPrepForDraw(&rRenderContext,
aData))
192 assert( mpData && mpData->mbCurVisible );
195 mpData->mbCurVisible =
false;
223 mpData->mbCurVisible =
false;
224 mpData->maTimer.SetInvokeHandler(
LINK(
this,
Cursor, ImplTimerHdl ) );
227 mpData->mpWindow = pWindow;
228 mpData->mnStyle = mnStyle;
229 if ( bDrawDirect || bRestore )
232 if ( !
mpWindow && (bDrawDirect || !mpData->maTimer.IsActive()) )
236 mpData->maTimer.Start();
237 else if ( !mpData->mbCurVisible )
239 LOKNotify( pWindow,
"cursor_invalidate" );
240 LOKNotify( pWindow,
"cursor_visible" );
250 assert(pWindow &&
"Cannot notify without a window");
251 assert(mpData &&
"Require ImplCursorData");
258 std::vector<vcl::LOKPayloadItem> aItems;
259 if (rAction ==
"cursor_visible")
260 aItems.emplace_back(
"visible", mpData->mbCurVisible ?
"true" :
"false");
261 else if (rAction ==
"cursor_invalidate")
283 aItems.emplace_back(
"rectangle", aRect.
toString());
291 bool bWasCurVisible =
false;
292 if ( mpData && mpData->mpWindow )
294 bWasCurVisible = mpData->mbCurVisible;
295 if ( mpData->mbCurVisible )
300 LOKNotify( mpData->mpWindow,
"cursor_visible" );
301 mpData->maTimer.Stop();
302 mpData->mpWindow =
nullptr;
305 return bWasCurVisible;
310 ImplDoShow(
true,
false );
320 ImplDoShow(
false, bRestore );
325 return ImplDoHide(
true );
330 if ( !(
mbVisible && mpData && mpData->mpWindow) )
333 if ( mpData->mbCurVisible )
339 LOKNotify( mpData->mpWindow,
"cursor_invalidate" );
341 mpData->maTimer.Start();
347 if ( mpData->mbCurVisible )
357 mnOrientation = 0_deg10;
365 maPos( rCursor.maPos )
377 if (mpData && mpData->mbCurVisible)
383 if ( mnStyle != nStyle )
419 if ( maPos != rPoint )
437 if (
maSize.Width() != nNewWidth )
439 maSize.setWidth( nNewWidth );
446 if ( mnOrientation != nNewOrientation )
448 mnOrientation = nNewOrientation;
455 if ( mnDirection != nNewDirection )
457 mnDirection = nNewDirection;
464 maPos = rCursor.
maPos;
477 ((maPos == rCursor.
maPos) &&
geometry::RealSize2D maSize
const StyleSettings & GetStyleSettings() const
static vcl::Window * GetFocusWindow()
Get the currently focused window.
An auto-timer is a multi-shot timer re-emitting itself at interval until destroyed or stopped.
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
void EnableMapMode(bool bEnable=true)
SAL_DLLPRIVATE bool ImplIsAntiparallel() const
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
void Invert(const tools::Rectangle &rRect, InvertFlags nFlags=InvertFlags::NONE)
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
SAL_DLLPRIVATE void ReMirror(Point &rPoint) const
const AllSettings & GetSettings() const
bool IsMapModeEnabled() const
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
void setWidth(tools::Long nWidth)
constexpr tools::Long Width() const
sal_uInt64 GetCursorBlinkTime() const
sal_Int32 GetCursorSize() const
reference_type * get() const
Get the body.
ImplFrameData * mpFrameData
SAL_DLLPRIVATE void ImplShow()
bool ImplPrepForDraw(const OutputDevice *pDevice, ImplCursorData &rData)
SAL_DLLPRIVATE void ImplDraw()
Cursor & operator=(const Cursor &rCursor)
void ImplDoShow(bool bDrawDirect, bool bRestore)
bool ImplDoHide(bool bStop)
VclPtr< vcl::Window > mpWindow
void SetWindow(vcl::Window *pWindow)
std::unique_ptr< ImplCursorData > mpData
SAL_DLLPRIVATE void ImplResume(bool bRestore=false)
void SetStyle(sal_uInt16 nStyle)
void SetPos(const Point &rNewPos)
CursorDirection mnDirection
SAL_DLLPRIVATE void ImplHide()
void SetOrientation(Degree10 nOrientation=0_deg10)
SAL_DLLPRIVATE bool ImplSuspend()
bool operator==(const Cursor &rCursor) const
SAL_DLLPRIVATE void ImplNew()
void DrawToDevice(OutputDevice &rRenderContext)
void SetWidth(tools::Long nNewWidth)
void SetSize(const Size &rNewSize)
void SetDirection(CursorDirection nDirection=CursorDirection::NONE)
void LOKNotify(vcl::Window *pWindow, const OUString &rAction)
virtual void notifyWindow(vcl::LOKWindowId nLOKWindowId, const OUString &rAction, const std::vector< LOKPayloadItem > &rPayload=std::vector< LOKPayloadItem >()) const =0
Callbacks.
Sets up the buffer to have settings matching the window, and restores the original state in the dtor.
tools::Long GetOutOffXPixel() const
Point LogicToPixel(const Point &rLogicPt) const
bool SupportsDoubleBuffering() const
Can the widget derived from this Window do the double-buffering via RenderContext properly?
const AllSettings & GetSettings() const
tools::Long GetOutOffYPixel() const
VclPtr< vcl::Window > GetParentWithLOKNotifier()
Find the nearest parent with LOK Notifier; can be itself if this Window has LOK notifier set.
::OutputDevice const * GetOutDev() const
const vcl::ILibreOfficeKitNotifier * GetLOKNotifier() const
SAL_DLLPRIVATE WindowImpl * ImplGetWindowImpl() const
std::unique_ptr< WindowImpl > mpWindowImpl
vcl::LOKWindowId GetLOKWindowId() const
bool IsRTLEnabled() const
static tools::Rectangle ImplCursorInvert(vcl::RenderContext *pRenderContext, ImplCursorData const *pData)
#define LINK(Instance, Class, Member)
std::unique_ptr< sal_Int32[]> pData
constexpr OUStringLiteral aData
std::unique_ptr< PaintBufferGuard, o3tl::default_delete< PaintBufferGuard > > PaintBufferGuardPtr
IMPL_LINK_NOARG(QuickSelectionEngine_Data, SearchStringTimeout, Timer *, void)
#define STYLE_CURSOR_NOBLINKTIME
VclPtr< vcl::Window > mpWindow
CursorDirection mnDirection
VclPtr< vcl::Window > mpWindow