Commit Graph

238 Commits

Author SHA1 Message Date
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
024d2fde2a In lok_init_2, allow vnd.sun.star.pathname user_profile_url
...which takes a raw filesystem pathname that is internally converted to a file
URL (similarly to what is supported for the INIFILENAME and URE_BOOTSTRAP
bootstrap variables in rtl::Bootstrap).  That way, the gtktiledviewer executable
doesn't need to try convert a pathname into a URL.

Also adapted various parameter names to make it obvious that URLs get passed,
not pathnames.

Change-Id: I33ab31fe142d94ee47885033ef48278ef5ff55a2
Reviewed-on: https://gerrit.libreoffice.org/24241
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-04-19 13:53:48 +00:00
df784ec1bf tdf#99314 lokdocview: add new userprofileurl property
So that users of the widget can use a custom user profile, allowing
running widgets users and LibreOffice in parallel.

Change-Id: I1bd0a8e53aa3216adc721052cf30f0dd174327bd
Reviewed-on: https://gerrit.libreoffice.org/24237
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-04-19 08:10:35 +00:00
788616fe7c lok context menu: Expose the disabled commands too.
OTOH, don't show choices that don't have the .uno: command, we have no way to
handle them.

Change-Id: I0df6ffe2049bbf11ba4b8931164be6a3381d3916
2016-04-08 09:43:56 +02:00
610db8d5d0 lok context menu: Expose context menu
Change-Id: I0968689630e10f838c075e86357eb36a9a220d0d
2016-04-08 09:43:50 +02:00
5e79a32864 New LOK_LOADLIB_GLOBAL to let clients control dlopen(RTLD_GLOBAL)
...in LibreOfficeKintInit.h's lok_loadlib, now that RTLD_GLOBAL isn't only
needed for UBSan (62b124b2704adf11a63681164d05a8eb49dfb105 "Ensure RTTI symbol
visibility for Linux Clang -fsanitize=function,vptr") but also for
-stdlib=libc++ on Linux (see
<https://whatofhow.wordpress.com/2016/03/01/libclibcabi-on-linux/>).

Change-Id: I24ed6612c3d922eba695423d46af5635c77f7077
2016-03-08 08:37:29 +01:00
02c0669017 Mention that there are two disjunct sets of callbacks
Change-Id: Ia8f18666c766cafa63cc702bfdfa69e971cf0e71
2016-03-04 12:07:47 +02:00
8fb170cbe9 sd lok: Remove LOK_CALLBACK_PARTS_COUNT_CHANGED from the API.
LOK_CALLBACK_PARTS_COUNT_CHANGED did not cover more complex scenarios, like
more pages deleted at the same time, etc.

Instead, we need to trigger the LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, and the
client has to be smart enough to update the previews in a way that does not
consume too much resources - ie. it has to have a link between the part names
(which are unique) and the previews, and request only the missing ones.

Change-Id: I36ff5dc86f360e3c7bd2c55fae8aaa99e054b4eb
2016-03-03 10:51:48 +01:00
80d7c5859b sd lok: add LOK_CALLBACK_PARTS_COUNT_CHANGED callback
In the tiled rendering case, when a slide is deleted or inserted
the sorted slides are updated on client side.

However, when .uno:Undo and .uno:Redo actions are requested on
client side the sorted slides are required to update all
sorted slides.

So every time when .uno:InsertPage, .uno:DeletePage, .uno:Undo, .uno:Redo
actions are requested, it will notify verbose action (PageInserted, PageDeleted)
with index on client side to update the sorted slide index.

Change-Id: Iebda2aa11be13aea8fbb6d0cc50442805d7485e9
Reviewed-on: https://gerrit.libreoffice.org/22309
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Henry Castro <hcastro@collabora.com>
2016-02-16 11:14:37 +00:00
a121074cbd lok: Introduce a "TakeOwnership" filter option for saveAs().
It is consumed by the saveAs() itself, and when provided, the document
identity changes to the provided pUrl - meaning that '.uno:ModifiedStatus' is
triggered as with the "Save As..." in the UI.

This mode must not be used when saving to PNG or PDF.

Change-Id: I11b5aa814476a8dcab9eac5202bd052828ebbd96
2016-02-11 15:14:21 +01:00
0d65937eef lok: Search result should contain info if it is a 'search all' result.
Change-Id: Ia3ee81ced4f74c0d029a478bd59eff44d72ef327
2016-02-06 12:34:34 +01:00
534b2a4b58 Fix typos
Change-Id: Ice72f8d9971e15dd6ef365e64cd567b8581a92d3
Reviewed-on: https://gerrit.libreoffice.org/21797
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-02-05 06:48:38 +00:00
8dbdf538fe LibreOfficeKit: document availability of some LibreOfficeKit C++ API
As done for C version in 80d1c914524bc61402c0e257b59377c5e47231ce

Change-Id: I879e070bc6a7cbf851594d748f603090f2e02459
Reviewed-on: https://gerrit.libreoffice.org/21901
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-02-04 12:57:15 +00:00
d9835c81b1 Include headers using OpenBSD too
OpenBSD ports patch: http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/editors/libreoffice/patches/patch-include_LibreOfficeKit_LibreOfficeKitInit_h

Change-Id: Ia3cebb41ca72bf022cc409814bed575cfbcfbf64
Reviewed-on: https://gerrit.libreoffice.org/22079
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-02-04 12:48:30 +00:00
c406c90289 lok interaction handler: Add handling of io and network errors.
Change-Id: If7c84a7b24f2072439718fb0c473b73243f2ecc1
2016-02-03 10:33:04 +01:00
18fbddcca5 lokdocview: Handle password protected documents
Change-Id: I606a1112c8eb4c1cc4596d6947ce1223543cc87c
Reviewed-on: https://gerrit.libreoffice.org/21861
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-02-02 12:29:51 +00:00
bd8610ebaf LOK: add Document::setClientVisibleArea()
... and implement it in Writer.

Otherwise there is no way we can perform e.g. page down in an expected
way. Without this, the core visible area depends on the zoom in the
document, and the client visible area can be something entirely
different.

Change-Id: Iadfb5a225da09a2551ffa41ddf503bb3d22b3eae
2016-02-02 10:56:40 +01:00
9d8b330794 lokdocview: add a set_visible_area()
Change-Id: Ib63959ad64fe52b648e0c0d3fe6d49fb282d57ee
2016-02-02 10:56:40 +01:00