diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2025-02-14 18:03:16 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2025-05-12 11:33:51 +0200 |
commit | 0ff4c6619031582b6c520db90a17ed285973e1be (patch) | |
tree | 671ea1783ed1c278268dfb8a233ba9d42764933b /include/editeng/editview.hxx | |
parent | 7143fc5d6f746543162d3de8320c10a0f7aeaca5 (diff) |
LOCRDT editeng,sw: yrs peer cursors for editengine
The cursors are represented as integers in yrs as a first step, which
isn't ideal.
Surprisingly EditView doesn't really have functions to correct the
cursor, only ImpEditEngine::UpdateSelections() for the case when nodes
are deleted, apparently there's only one active EditView at a time
typically so it wasn't needed? Typically the active EditView's cursor
is assigned from a return value of ImpEditEngine.
Add some new functions to correct peer cursors and call them all over
ImpEditEngine; unfortunately UpdateSelectionsDelete() isn't easy to get
working on EditView's actual EditSelection cursor so leave that for the
future...
To fix EE paint of non-active comment, add SwAnnotationWin::Paint()
To get things to paint with "gen", it's enough to invalidate the
SwAnnotationWin, but for gtk3 a queue_draw() must be called, else it's
only painted when clicking on the window.
Cursors are painted in color in SidebarTextControl::Paint()
Change-Id: Id8696238290405554ece1b9961676972a559b58e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181679
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'include/editeng/editview.hxx')
-rw-r--r-- | include/editeng/editview.hxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx index 750848eaee91..4e1ee56ef7ce 100644 --- a/include/editeng/editview.hxx +++ b/include/editeng/editview.hxx @@ -41,6 +41,7 @@ class IYrsTransactionSupplier; typedef struct TransactionInner YTransaction; typedef struct YTextEvent YTextEvent; +typedef struct Branch Branch; #endif class EditTextObject; @@ -416,6 +417,12 @@ public: void YrsReadEEState(YTransaction *); void YrsApplyEEDelta(YTransaction *, YTextEvent const* pEvent); OString GetYrsCommentId() const; + void YrsApplyEECursor(OString const& rPeerId, OUString const& rAuthor, + ::std::pair<int64_t, int64_t> point, + ::std::optional<::std::pair<int64_t, int64_t>> oMark); + bool YrsDelEECursor(OString const& rPeerId); + void YrsGetSelectionRectangles( + ::std::vector<::std::pair<OUString, ::std::vector<tools::Rectangle>>>& rLogicRects) const; #endif }; |