summaryrefslogtreecommitdiff
path: root/include/LibreOfficeKit
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2017-01-06 10:48:18 -0500
committerAndras Timar <andras.timar@collabora.com>2017-02-17 16:37:01 +0100
commit58c58b049dd79108ae1dc223b4a336c3655c616d (patch)
tree45fff83d43fdef77595afd0d018bff8e9a04841d /include/LibreOfficeKit
parent9f3e57e5fa31ca5654ee9eeaba03c871a1c83150 (diff)
Lok: support for batch API calls
Mouse and keyboard operations typically come in batches, and often each results in tile invalidations and/or layout modifications. Processing each input event on its own, then processing the resulting output event is very costly and unecessary when we know there is more of the same. The new API adds support for batching such related input events by disabling the output events generated by Core until the batch is done. The client can then process the resulting events, which will be compressed and deduplicated. Change-Id: Id381dab807186d010021a8778ee440074a739920 Reviewed-on: https://gerrit.libreoffice.org/33402 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> (cherry picked from commit 1c27286b9d5331634c073cd3e327bd941e61bbb6)
Diffstat (limited to 'include/LibreOfficeKit')
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.h10
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.hxx10
2 files changed, 20 insertions, 0 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index c7a2130315da..55cff727776c 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -250,6 +250,16 @@ struct _LibreOfficeKitDocumentClass
int* pArray,
size_t nSize);
+ /// Starts a batch of operations.
+ /// Events are emmitted only after ending the batch.
+ /// @see lok::Document::endBatch();
+ void (*beginBatch) (LibreOfficeKitDocument* pThis);
+
+ /// Ends a batch of operations.
+ /// @see lok::Document::beginBatch();
+ void (*endBatch) (LibreOfficeKitDocument* pThis);
+
+
#endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
};
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 447f44b09885..46ecb5f40d3f 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -452,6 +452,16 @@ public:
return mpDoc->pClass->getViewIds(mpDoc, pArray, nSize);
}
+ inline void beginBatch()
+ {
+ mpDoc->pClass->beginBatch(mpDoc);
+ }
+
+ inline void endBatch()
+ {
+ mpDoc->pClass->endBatch(mpDoc);
+ }
+
#endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
};