diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-01-27 09:32:43 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-09 08:09:22 +0100 |
commit | ec170c92c61fbe043b5a8848402f5ded33b81c21 (patch) | |
tree | dfcf01f66322299d5c2804902a76347ae0790fb8 | |
parent | 62969accf9c01b71b738424d4d643db8bfaed182 (diff) |
Add LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR
So that clients can draw a blinking cursor at the cursor position if
they want so.
Change-Id: I662b8d28d7054f89c381c14333a51e1dc222f93d
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.h | 8 | ||||
-rw-r--r-- | sw/source/core/crsr/viscrs.cxx | 9 |
2 files changed, 16 insertions, 1 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 0ec30fb9bf25..e4852e4c4535 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -60,7 +60,13 @@ typedef enum * Rectangle format: "width,height,x,y", where all numbers are document * coordinates, in twips. */ - LOK_CALLBACK_INVALIDATE_TILES + LOK_CALLBACK_INVALIDATE_TILES, + /** + * The size and/or the position of the visible cursor changed. + * + * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES. + */ + LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR } LibreOfficeKitCallbackType; diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index a0031b025d6a..b9f805d7ded4 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -175,6 +175,15 @@ void SwVisCrsr::_SetPosAndShow() m_aTxtCrsr.SetSize( aRect.SSize() ); m_aTxtCrsr.SetPos( aRect.Pos() ); + + if (m_pCrsrShell->isTiledRendering()) + { + std::stringstream ss; + ss << aRect.Width() << ", " << aRect.Height() << ", " << aRect.Left() << ", " << aRect.Top(); + OString sRect = ss.str().c_str(); + m_pCrsrShell->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr()); + } + if ( !m_pCrsrShell->IsCrsrReadonly() || m_pCrsrShell->GetViewOptions()->IsSelectionInReadonly() ) { if ( m_pCrsrShell->GetDrawView() ) |