Commit Graph

255 Commits

Author SHA1 Message Date
5751291e8c LOK - Calc: changed the way header is updated on row/col insert/remove
This patch introduce a new LOK callback for informing the client that
the row/col header is no more valid and needs to be updated.

Change-Id: I21a3a41d69bd1a3c11c9ffaf1d7d53dbc3b9681d
Reviewed-on: https://gerrit.libreoffice.org/36733
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2017-04-21 15:35:22 +02:00
d49dcc7ccc lokit: this was supposed to be plain C functions
Change-Id: I22c568edd297fcc53a8d4fb826e12ee0cea59432
Reviewed-on: https://gerrit.libreoffice.org/36176
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-04-06 15:33:44 +00:00
a016ac1667 lokit: make this build on windows, silence extra warnings
Change-Id: I78d5ce58d55d27eaa0256a0c1ddffed3a5f2cf91
Reviewed-on: https://gerrit.libreoffice.org/36175
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-04-06 14:05:57 +00:00
0840bc7957 lokit: avoid null pointer access w/ undefined LOPath var
Change-Id: I777fa58a138d453a108b0c65dcfd667d3da25999
Reviewed-on: https://gerrit.libreoffice.org/36174
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-04-06 11:33:25 +00:00
5fefac660a lok: Allow setting of the language during load.
Change-Id: I9dbb62950e639376c26122ceb9fcec2982b3ca82
2017-03-24 19:01:53 +01:00
587e9c2d15 Consistently mark function definitions in LibreOfficeKitInit.h as static
...to give them internal linkage in both C and C++.  Of those definitions that
were not marked as static:

* Those that had not been marked as inline had external linkage in both C and
  C++, so would have caused ODR violations were LibreOfficeKitInit.h included in
  multiple translation units.

* Those that had been marked as inline lacked an external defintion in C.
  (Which 3f02b2aa51e32c46d5b6610480bc1ba22156a3ec "LOK init: avoid non-inline
  function definition in header file" had apparently faied to take into
  account.)

(IOS_SWIFTCBRIDGE introduced in 028ef4748e53aa8f72c6464ce6bbeeb28c61d30c
"LibreOfficeKitInit.h modified to avoid ODR" becomes unnecessary again.)

Change-Id: Ibb8033cdbac87b20fa0e3b203b99571c1a7e7234
Reviewed-on: https://gerrit.libreoffice.org/35491
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-22 08:04:40 +00:00
028ef4748e LibreOfficeKitInit.h modified to avoid ODR.
As discussed in IRC, the prev. version would cause an ODR

the use of _cplusplus have been changed to IOS_SWIFTCBRIDGE

Change-Id: If18610858cb56780347bb28f909619db4aac85b0
2017-03-20 15:38:39 +01:00
c1f46c54a6 ios LibreOfficeLight LOkit integration
Integrated LibreOfficeLight into gbuild.
added lo.xcconfig and Resources (needed to link with LO and run LO)
added swift --> C interface for LOkit
add known commands from JS client

added C++ condition in LibreOfficekitInit.h (inline no good in a C file)

Change-Id: I19ebe8912546408bf701c96c0c63541d6e37cad8
Reviewed-on: https://gerrit.libreoffice.org/35430
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@libreoffice.org>
2017-03-19 16:36:11 +00:00
2ba485158b tdf#102511: Fix gobject-introspection annotation syntax
Change-Id: I43a3ee21bd2db9ace809084d3ab888008243c97f
Reviewed-on: https://gerrit.libreoffice.org/35155
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-03-15 14:17:30 +00:00
f6262b3dcb Remove redundant 'inline' keyword, Linux redux
Change-Id: I10c7dbd6a7acce309b056a1ae57c39f00f22c46d
2017-03-07 08:12:52 +01:00
bcb402298f Fix typos
Change-Id: I5e3c9683741ddc66283008c20794be5c2b2bc53f
Reviewed-on: https://gerrit.libreoffice.org/34804
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-03 06:56:42 +00:00
e7729f4584 Run macro:// via LOKit
Change-Id: I54d3c734d86d4b44e1dfe1ad7728e2f51cd26d53
Reviewed-on: https://gerrit.libreoffice.org/34538
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-02-28 09:50:11 +00:00
dd18f8ae55 ios update to make TiledLibreOffice compile/link
changes needed to make TiledLibreOffice compile/link for ios-simulator.

Remark:
autogen.input need to have --disable-pdfium due to a missing
<Carbon/Carbon.h>

Change-Id: I3e1af26d99c35c3c552510f28e13a7e530fca09f
Reviewed-on: https://gerrit.libreoffice.org/34145
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@libreoffice.org>
2017-02-16 13:00:24 +00:00
be71e2b860 Revert "Lok: support for batch API calls"
This was for the moment removed from the online.git, so let's disable the API
bits too before it shows this is really necessary.  Reverts also:
Revert "Lok: unittest batch API"

Change-Id: I7bf3fe62d1e73b6f233992d51f587868a78f4bec
2017-01-31 17:45:29 +01:00
5f5073a845 lok: Implement new callbacks for comment notifications
Change-Id: I298183b295c68c4a39cb1f6fffe4b89b4eaee0f3
Reviewed-on: https://gerrit.libreoffice.org/33469
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-01-27 11:50:02 +00:00
75d8b305bb lok: New feature flag to turn off tiled annotations
Change-Id: Ie418642242ada98d4a41f30bb6cefcd57f398ef0
Reviewed-on: https://gerrit.libreoffice.org/33472
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2017-01-23 19:32:03 +00:00
1c27286b9d 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>
2017-01-23 03:23:19 +00:00
719f7cb94c Lok: number callback enum for easier debugging
Since the entries and their order are part of the
public API, and will not change, numbering them
makes it easier to trap particular callbacks by
their number (as that's what shows in logs and
the debugger).

Change-Id: Ife2fe3e601ce3dce0939363d748fcb54d3c85fd4
Reviewed-on: https://gerrit.libreoffice.org/31257
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-27 03:57:17 +00:00
6b4eaa7ee7 Add the missing lok::Office::registerCallback().
Change-Id: I0aebf12c4d685f69f094b9acbe6b04bb5b3234a4
2016-11-15 13:09:17 +01:00
32d0378284 lok: add character parameter to renderFont
When client side request special character, it is very useful to send a
preview of the rendered font character

Conflicts:
	desktop/source/lib/init.cxx

Change-Id: I1f5727163dfcc861add121e616bdb17881c28197
Reviewed-on: https://gerrit.libreoffice.org/30784
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2016-11-14 13:06:47 +00:00
84bfe584e4 tdf#102511: Add (allow-none) for backward GI compatibility
(allow-none), though deprecated since GI 1.42, is required to
maintain the backward compatibility since (nullable), added in
GI 1.42, is not understood by GI tools < 1.42 preventing the
clients from passing a null parameter to various functions in the
widget.

We can remove this deprecated (allow-none) annotation once we
bump the GI version in LibreOffice to atleast 1.42

Change-Id: I98a1f3d2205ec5afd8060f16e69c5f938f229e26
2016-10-21 11:38:29 +05:30
d5263c2c56 LOK: conditionally include part number in invalidation payload
Since desktop/ code queues, compresses and only emits callbacks on idle,
it's possible that two invalidations are in the queue, and there was a
setPart() call between them. In this case it's impossible to tell what
part the invalidation was sent for.

Fix this by conditionally including the part number in the invalidation
payload. It's off by default, a new feature flag is added to request
this behavior.

gtktiledviewer enables this feature flag by default, though just to show
the part number in the debug output. Android doesn't enable it.

Change-Id: I73e6def848c0eb61d64e71026002c7a0e750aab4
2016-09-29 12:53:02 +02:00
dcc92a7cb5 sfx2: add SfxLokHelper::getViewIds
and also expose it in the LOK API. This way clients don't have to keep
track of what views they created / destroyed, they can also get an up to
date list with this method.

Change-Id: Ibaee42c545803e04a31e7c13ab6ec370b99465c4
2016-09-16 14:48:23 +02:00
dc00592b4e lok::Document: rename getViews() to getViewsCount()
As this only returns the number of views, not the actual views. Since
it's a rename, it's just an API (but not an ABI) change.

Change-Id: Ib4f0ea56a90e5ae9c80ee1781aa2f29aff4259e7
2016-09-16 12:36:28 +02:00
a097d680d2 Revert "LOK: we use callbacks latch for not missing messages sent very early"
This reverts commit bbae556d12e4edf7795b0b5643df77fd8cdbdacd.

Change-Id: If1370751b612ff06ef5be13e8a4017af7dc34a7c
Reviewed-on: https://gerrit.libreoffice.org/28908
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
(cherry picked from commit c0dd075d52409031876f5bc3923062ba5847fd53)
Reviewed-on: https://gerrit.libreoffice.org/28929
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
2016-09-15 13:25:51 +00:00
539f981900 LOK: we use callbacks latch for not missing messages sent very early
- lok::Document::setCallbackLatch: used on document load for
set/unset the latch

- now cell cursors of other views are correctly notified to the new
view

Change-Id: Ife6dca0e3e329b801d44070f55869afe95a2f313
Reviewed-on: https://gerrit.libreoffice.org/28812
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
2016-09-11 17:05:22 +00:00
d0f8361289 Clarify what the error code actually is
Based on how LOK_CALLBACK_ERROR callbacks are actually done in
desktop/source/lib/lokinteractionhandler.cxx.

Change-Id: Ibbe37c681252aa91c979d51b9aae6236ff9d88de
2016-08-30 10:18:07 +03:00
8f96ab602a Emit notification to a LibreOfficeKit client also when a redline is modified
Work in progress, not all modifications to a redline record cause
notifications yet.

Change-Id: I01614cd6ede9576e9cc329889fef86342567325f
2016-08-29 11:02:58 +03:00
932804559e Check arm64 too
Change-Id: I51f89eb05f7844a7b0a99eab1587bbe333b96b09
2016-08-20 23:39:19 +03:00
9e310a4705 sw redlines: expose description as part of the UNO/LOK API
A redline can have a manual comment and also an autogenerated
description, like "Insert 'abc'". Expose this later property as well, as
it provides useful additional information, especially when the comment
property is empty.

Change-Id: Id0f0ff62aef58d96b9b6071706c6f5b4a0d74800
2016-08-19 16:51:36 +02:00
0bc553f3ef sw lok: add callbacks for redline table insertion / removal
An alternative would be to follow the Manage Changes dialog approach and
subscribe to the SFX_HINT_DOCCHANGED notification in SwDocShell, cache
the old redline table and find out the differences to the current one,
but that way sound much more complex without benefits.

Change-Id: I20a45285b88255ccea9d6646c0b5288ac1c91879
2016-08-19 16:21:32 +02:00
f2afe318ce gtktiledviewer: specify author name when calling initializeForRendering()
Open two views, and type into both of them when a Writer doc with
redlining enabled is open: the manage changes dialog now shows how the
correct author is used when creating the redline items.

Change-Id: I48fb90301bfcc04b06d5be5544324ca76fe7b3d7
2016-08-18 11:37:59 +02:00
50e19b71a6 Better fix for Objective-C
Not sure what the exact mechanism of the problem is, but anyway, this
helps.

Change-Id: I5812381af0e4f12fcbdd06eafb1eedc170ffb608
2016-08-18 10:56:19 +03:00
bb10522fd9 Revert "These 'inline' keywords are fairly pointless"
Nah, they are a good idea in most cases.

This reverts commit 1c8e4f74c63312fca5898452fae4ba32268fce65.
2016-08-17 18:25:46 +03:00
1c8e4f74c6 These 'inline' keywords are fairly pointless
Change-Id: I1018ca4954282d0b62a254d509e29493588960c1
2016-08-17 18:16:10 +03:00
60cfbcf9e7 LOK init: strcpy() -> strncpy()
'strcpy' is insecure as it does not provide bounding of the memory
buffer in general, so let's avoid it even here.

Change-Id: If39319a2df7ddd9297938bc0be67fe5f8a2af962
Reviewed-on: https://gerrit.libreoffice.org/27999
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-08-09 08:51:43 +00:00
3f02b2aa51 LOK init: avoid non-inline function definition in header file
To prevent possible ODR violations.

Change-Id: Ic9538244a0bf3760808904d2bcf608151c53f899
Reviewed-on: https://gerrit.libreoffice.org/27883
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-08-04 17:50:41 +00:00
897189cfc6 sw: add new LOK_CALLBACK_VIEW_LOCK callback
When we're after SdrBeginTextEdit(), but before SdrEndTextEdit(), and
have multiple views, then only the active view paints the edited text,
the other views look like the shape has no text at all.

Add a new callback that exposes the position and size of the rectangle
where the shape text will be painted after text edit ended, so clients
can draw some kind of locking indicator there. This way the rendered
result can differ in the "shape has no text" and the "shape text is
edited in an other view" cases.

Change-Id: I6096479a8a05c2547d15222e6d997b848af02945
Reviewed-on: https://gerrit.libreoffice.org/27441
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-07-22 15:13:07 +00:00
af8419fa1d sw lok: add LOK_CALLBACK_VIEW_CURSOR_VISIBLE
With this, in case a text cursor is turned into a graphic selection in
view#0, then view#1 can also hide the text cursor of view#0.

Change-Id: I7de89b8537ef8b0985336793b719d93733604bff
Reviewed-on: https://gerrit.libreoffice.org/27044
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-07-08 13:46:10 +00:00
3ebfc5b955 svx lok: add LOK_CALLBACK_GRAPHIC_VIEW_SELECTION
So a view can be aware where the graphic selections of other views are.

Change-Id: I0cc420cfe4bf3824fbfa1a58da889cac5e9a7b60
Reviewed-on: https://gerrit.libreoffice.org/26863
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-07-01 17:20:17 +00:00
68c5c0bb7e sc lok: add LOK_CALLBACK_CELL_VIEW_CURSOR
So a view can be aware where the cell cursors of other views are.

Change-Id: Ifcf06c0019c6af8b859e2e92222e4f3fd18da74f
Reviewed-on: https://gerrit.libreoffice.org/26844
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-07-01 09:28:49 +00:00
615c37503c LOK: change back type of view ids to int
Commit 45c2410041c48c22bd860efb42d4daadad7869b0 (LOK: change type of
view ids to uintptr_t, 2016-06-17) fixed the problem of view IDs being
reused for the price of random IDs, which makes debugging harder.

Implement a simple shellToView() function that makes sure view IDs are
not reused, and stop exposing view shell pointer addresses, which allows
reverting the LOK API change.

Change-Id: I63089e6de08ee7e1c7706757d43a11f6cf4d6e06
Reviewed-on: https://gerrit.libreoffice.org/26773
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-06-30 06:16:28 +00:00
d7b45c97b3 lok: Change version string to JSON format
Change-Id: Ie1264fed9964b09006980df2e151e170b48b4082
2016-06-21 22:08:51 +05:30
9f66db9c47 sw lok: add LOK_CALLBACK_TEXT_VIEW_SELECTION
So a view can be aware where selections of other views are.

Change-Id: I5026b1ff2b99a4eedfd0bde32a05ceb8e2f424bc
Reviewed-on: https://gerrit.libreoffice.org/26542
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-06-21 11:17:10 +00:00
90c75f775b lok: Expose LO version information
Change-Id: Ided924e928c04385457c7a2e231fdf57e7e38970
2016-06-21 14:35:59 +05:30
c544a8b674 sw lok: add LOK_CALLBACK_INVALIDATE_VIEW_CURSOR
So a view can be aware where cursors of other views are.

Change-Id: I6133fb55aa2869843c0284b7d76264bab3b3d5da
Reviewed-on: https://gerrit.libreoffice.org/26513
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-06-20 15:12:54 +00:00
45c2410041 LOK: change type of view ids to uintptr_t
This fixes the following problem:

- createView() = 1
- createView() = 2
- destroyView(1)

and then view #2 was renumbered to 1.

Instead expose the pointer address of the SfxViewShell as the ID, which
is not changing in such a situation.

Note that the SfxViewShell <-> ID mapping is an implementation detail of
SfxLokHelper, and only pointers are converted to IDs, user-supplied IDs
are never converted back to pointers.

Change-Id: If79ef8b99ba391011b5d82b219ad13447d44cd5a
Reviewed-on: https://gerrit.libreoffice.org/26423
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-06-17 16:00:44 +00:00
70e8e788be Allow painting for arbitrary part
Painting should not cause any state changes, but
to paint a tile on a different part than the current
has to change the document, which sends notifications
to all clients.

A new API, paintPartTile, allows for painting tiles
on any part without sending change of part notifications.

Furthermore, because we block notifications during this
operation, no tile invalidation is issued due to
changing of the part.

One issue remains in the cases when the LO Core
resets the cursor position internally and we resume
editing after painting, the cursor might be at the top
of the page. This needs fixing separately.

Change-Id: If19bd1c90ecad4d5ed5e8d09513741b7994fa6e5
Reviewed-on: https://gerrit.libreoffice.org/24698
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-09 13:58:29 +02:00
b74163742f lok: getPartHash should be at the end, it is a new API call.
Also add it to the init.cxx so that it is actually used.

Change-Id: I255411158d0822718116ac05aad1ee925a9a7a9a
2016-04-21 19:10:02 +02:00
1a74c6333a lokit: add getPartHash
In the tiled rendering case, the slides, no matter
if it is inserted or deleted, the part names always return
sequential names i.e. Slide 1, Slide 2, ..., Slide N.

However the client side needs to know what slides had been
deleted or inserted, so it is necessary to send the hash codes.

Change-Id: I0e9caeec660c3e42dd9f751bdce7690f9ad365a1
Reviewed-on: https://gerrit.libreoffice.org/24267
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-04-21 13:48:33 +00:00