323 Commits

Author SHA1 Message Date
Pranav Kant
0f64cf72ff tdf#96318: Add searching API
Clients should now use these APIs to search for text in the
widget, rather than executing UNO commands directly on the
widget. This allows searching for text in the widget in view-only
mode too.

Change-Id: I013b6f96e69a634ec33367394d39c0f645a4994d
Reviewed-on: https://gerrit.libreoffice.org/20488
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: David Tardon <dtardon@redhat.com>
2015-12-09 09:30:35 +00:00
Pranav Kant
b3bfc26d08 tdf#96316: Decouple view-only/editable modes
- Move text selection and graphic selection tasks into functions
- Merge GDK_BUTTON_PRESS, GDK_BUTTON_RELEASE conditional code
- Do not change to 'move' cursor in view-only mode
- Ignore LOK_POST_COMMAND, LOK_SET_GRAPHIC_SELECTION in view-only

As a consequence this commit also allows dragging handles during text
selection in view-only mode which was earlier not possible.

Change-Id: Iffb668d5447dd646a1e40237dee8d8d3fa3314b6
Reviewed-on: https://gerrit.libreoffice.org/20487
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2015-12-09 09:26:20 +00:00
Pranav Kant
424c09b10d lokdocview: Set a 'default' path for LOK init
When passed NULL to lok_doc_view_new, use the default path :
$libdir/libreoffice/program as LOK install path

Change-Id: I1e033c407184b29b1509cfb8c416b514591d67ce
Reviewed-on: https://gerrit.libreoffice.org/20476
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: David Tardon <dtardon@redhat.com>
2015-12-09 09:02:34 +00:00
Miklos Vajna
958b9a7fbd Let LIBO_INTERNAL_ONLY imply LOK_USE_UNSTABLE_API
Change-Id: Ifbed5e534ba79d32b7188bb7fb7108338b6e124d
2015-12-07 09:26:19 +01:00
Caolán McNamara
70b09d9322 cppcheck: noExplicitConstructor
Change-Id: I1934441858baeeb41a46f694dbcef2d846b308b7
2015-11-24 10:35:44 +00:00
Stephan Bergmann
086bd3c574 loplugin:cstylecast
Change-Id: I4a02309c3ef4cb8c88edd538012ed2a8c43da307
2015-11-23 15:58:19 +01:00
Caolán McNamara
b0f5416d7e Do all svp text rendering with cairo
enabling us to delete a whole pile of foo

For android we patch cairo, which is internal in that case, to swap the rgb
components so that cairo then matches the OpenGL GL_RGBA format so we can use
it there where we don't have GL_BGRA support.

Change-Id: I25e34889c7b7263438b143dd2a2ad882fb0f190a
2015-11-23 14:25:58 +00:00
Miklos Vajna
7ce0889ec9 android: remove duplicated bitmaps
Change-Id: I5e16aa9da0aabe4302ebdd30b080b6bad4767006
2015-11-23 13:47:31 +01:00
Miklos Vajna
0ea68eecdd gtktiledviewer: allow passing initializeForRendering() arguments
Change-Id: Ic7b52764cf2fedbf73d4dcaaf36d1055b8ee22f2
2015-11-18 16:39:18 +01:00
Miklos Vajna
4bddfc00d2 lok::Document::initializeForRendering: support init. arguments
Change-Id: I8aaf19a50f25f495cb87fba7ff6a4b0f56ed7d80
2015-11-18 16:39:17 +01:00
Stephan Bergmann
c6c8af5ef4 loplugin:nullptr
Change-Id: Iaf779157b97e4d3a3a449cc7f17e4d5c533955f0
2015-11-13 10:41:32 +01:00
Mihai Varga
5b1e22e9ba LOK: calc formula callback + formula bar implementation in gtk
We need the callback to be able implement the formula bar

Change-Id: I1c78ab0b9ed9304c0465a9993a7101f8efb91052

Conflicts:
	include/LibreOfficeKit/LibreOfficeKitEnums.h
	libreofficekit/source/gtk/lokdocview.cxx
2015-11-13 10:00:13 +02:00
Mihai Varga
96cd2abd74 LOK: setClientZoom() - sets the client zoom level
We need to know the client's view level to correctly handle the mouse
events in calc. PaintTile() set a zoom level that corresponds to the
requested tiles and previously postMouseEvent would call SetZoom(1,1).
Now we can make use of knowing the client's view level and call
SetZoom() with the correct parameters

Change-Id: I34b5afcdcc06a671a8ac92c03e87404e42adf4cd

Conflicts:
	sc/source/ui/unoobj/docuno.cxx
2015-11-13 09:55:19 +02:00
Andrzej Hunt
cc920bc27a lokdocview: support LOK_CALLBACK_MOUSE_POINTER
Change-Id: I2052e39fa2e25988a40f293389d5a183a625acd4
Reviewed-on: https://gerrit.libreoffice.org/19903
Reviewed-by: Andrzej Hunt <andrzej@ahunt.org>
Tested-by: Andrzej Hunt <andrzej@ahunt.org>
2015-11-11 09:31:13 +00:00
Stephan Bergmann
5678a4ce9e loplugin:nullptr (automatic rewrite)
Change-Id: Ibdb6409664cdf9499b6fec95c5de3549887b8106
2015-11-10 10:31:30 +01:00
Miklos Vajna
c044e51b99 lokdocview: assert that loading of handle bitmaps succeeded
A number of such bitmaps were removed by accident in commit
74463457b39c9def1add630b7b0581dc195549c8 (android: chanhe handles to use
alias, tint handles with color, 2015-11-01).

Change-Id: I253c4b5790e82de32e6fd06896645adf360fa586
2015-11-10 09:41:09 +01:00
László Németh
63d2d50ecb gtktiledviewer: add Ctrl, Alt, Shift shortcut support
For example in Writer:

Ctrl-B for bold text
Ctrl-Shift-B/P for subscript/superscript
Ctrl-Alt-C insert comment
Ctrl-1 apply Heading 1 paragraph style

Change-Id: Iaeb8341f2cb273980b637ff2fed89585094e0d9d
2015-11-06 19:33:14 +01:00
Andrzej Hunt
799406068d sc lok: Cell Cursor callback
This only works correctly for the default zoom level - since
the updateLibreOfficeKitCellCursor call happens during the
internal / hidden rendering, it uses the internal zoom values,
which can differ from the tiled-rendering zoom values.

Conflicts:
	include/LibreOfficeKit/LibreOfficeKitEnums.h

Change-Id: Ie4f344fe771078fca10ad9d6f7a93e88fb93880a
2015-11-05 12:54:21 +01:00
Pranav Kant
93f98e98e4 lokdocview: Don't render tiles while tile buffer has changed
This is common when widget gets a zoom request, resulting in a
new tile buffer, and the tiles from the old tile buffer are still
waiting to be processed in the LOK thread, for old tile buffer. If
we allow these useless operations to execute successfully, they
would end up writing in new tile buffer giving false results.

Lets tag every paint tile operations with their respective tile
buffer during `task` creation, and then check whether the tile
buffer has changed or not before writing to the tile buffer.

Change-Id: If784341a67ad430bc3415b765137badaad6b97f6
Reviewed-on: https://gerrit.libreoffice.org/19726
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-11-04 10:31:33 +00:00
Stephan Bergmann
02b39996fa -Werror,-Wformat-security
Change-Id: I23f4b906456fdba84f2772a4ed15ac6c141a094d
2015-11-03 22:20:45 +01:00
Jan Holesovsky
8c987fabab lok: Introduce LOK_CALLBACK_UNO_COMMAND_RESULT callback.
Posting of the .uno:Something commands is asynchronous.  To be able to find
out when eg. .uno:Save finished, this commit introduces a callback that fires
when that happens.

To be able to receive such a notification, the appropriate postUnoCommand()
must be called with 'true' as the parameter for bNotifyWhenFinished (defaults
to 'false').

Change-Id: I254939ebc8ea5f309ae39686dcaaeddd5148b0c9
2015-11-03 13:25:23 +01:00
Jan Holesovsky
c0f37892a2 lok: Fix typo search-result_count -> search-result-count.
Change-Id: Iccd5b39f6bdf1c7a43131fc50186ea5a2838d77e
2015-11-03 12:59:56 +01:00
Miklos Vajna
602c1b4e29 libreofficekit: -Werror=unused-parameter
Change-Id: I89c4d9752ef650d516bed8fcdc5873de8ae87e18
2015-11-03 11:19:03 +01:00
Pranav Kant
de0c7e1783 lokdocview: Separate "painting" and "saving" of tiles
Lets separate the task of painting the tile, and saving the tile
in tile buffer using GAsyncReadyCallback. This will provide us
with better control over tiles -- cancelling the painting operation,
and filtering tiles that should not be saved in the tile buffer.

Change-Id: I6aae928d8cc0c906034570ed0e9a054763d493a3
Reviewed-on: https://gerrit.libreoffice.org/19725
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-11-03 10:18:29 +00:00
Pranav Kant
cfbc36e2ea lokdocview: Fix memory leaks
Change-Id: I5107e4fa1828145a709e1edffe02831f4faae3c8
Reviewed-on: https://gerrit.libreoffice.org/19676
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-10-31 08:01:22 +00:00
Miklos Vajna
bd0ec1e68d lokdocview: ensure private structure is allocated with operator new
It's undesirable to malloc a struct that has a TileBuffer member, while
TileBuffer doesn't have a default ctor.

Change-Id: I72dfacc0088f238ee101d84838bd7eea51ced82a
2015-10-30 08:32:24 +01:00
Pranav Kant
54409159b8 lokdocview: Emit a warning after error
Change-Id: Id8e20e6561239096438d420c65d0da6dcc7f5e2e
Reviewed-on: https://gerrit.libreoffice.org/19474
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-10-21 12:10:49 +00:00
Pranav Kant
d2d5a00e0e lokdocview: Use G_PARAM_STATIC_STRINGS
... as `name`, `nick`, and `blurb` are guaranteed to remain valid
and unmodified for the lifetime of the parameters.

Change-Id: Ic6463b470546669d5a815842daedb170df85d161
Reviewed-on: https://gerrit.libreoffice.org/19472
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-10-20 19:33:20 +00:00
Miklos Vajna
2e1503dbd0 lokdocview: log postUnoCommand() arguments
Change-Id: I0febc2b89d95bde59ad9d3a90d404b3932cc3624
2015-10-09 13:45:26 +02:00
Miklos Vajna
f0e3fe840b LOK: CALLBACK_SEARCH_RESULT_COUNT is redundant
1) The size of the searchResultSelection array in
LOK_CALLBACK_SEARCH_RESULT_SELECTION provides the same information.

2) None of the clients except lokdocview used it.

3) Only sw provided this callback, not sc/sd.

Change-Id: I9da639b6693f24634f298f9bc4773f705e944359
2015-10-09 08:09:16 +02:00
Miklos Vajna
c5ceddf344 lokdocview: invalidate after selection change
Without this e.g. Calc search does not show the selection rectangle
correctly.

Change-Id: I5bc20a93ee861d3353bc2e1c1ed7ea8d0e6c8ed4
2015-10-07 17:19:23 +02:00
Michael Stahl
0ca6d934b3 libreofficekit: -Werror=unused-macros
Change-Id: I154bd2c101819669d43ab475144ae400454df4d0
2015-10-06 14:24:17 +02:00
Miklos Vajna
23ac7f2fb5 lokdocview: log paintTile() arguments
Change-Id: I8015c8030c1c7f53ae1de053fe268a33464834ad
2015-10-06 12:03:34 +02:00
Miklos Vajna
2b6060d6c5 gtktiledviewer: recognize LOK_CALLBACK_SEARCH_RESULT_SELECTION
Change-Id: Ib932ee36e41afcb53d15a6362b998cc673d474f2
2015-10-06 10:18:43 +02:00
Mihai Varga
a6ef571847 LOK: fixed duplicated switch case values 2015-10-05 18:08:46 +03:00
Mihai Varga
c30defcf8e LOK: add the search phrase to the search result count callback
We need this to notify the user for which search phrase no results were
found

Change-Id: I8cc7ab235b9129dfdcb022145456180ff7e4ca92
2015-10-05 17:50:20 +03:00
Mihai Varga
c90c08a65c LOK: added the button type and key modifier to postMouseEvent()
To get a better functionality we need to know the button type (left,
right, middle). We also need the key modifier (ctrl, alt, shift) for
actions such as ctrl+click (to open a link) or shift+click to select

Change-Id: Iaccb93b276f8a6870dd41cc5132dbb85d2bbf71b
2015-10-05 15:02:36 +03:00
Miklos Vajna
22d342a82f lokdocview: handle LOK_CALLBACK_SEARCH_RESULT_COUNT
Change-Id: I0d1b641654e0de65169e19bb5843ea11b43a90a3
2015-10-05 12:05:00 +02:00
Pranav Kant
c3ce35f0a1 lokdocview: Reset view completely
Resetting tiles only is not enough. We need to empty stale
selection rectangles, handle bars, cursor positions etc., so that
they do not interfere with next view to be opened using same
widget instance.

We are not destroying the document here, so the widget would
still point to the same document unless it is made to point to
another document by subsequent lok_doc_view_open_document calls.

Change-Id: I3c7cc789c8c7393b3793b4edf6aa96d54bc0b1a3
Reviewed-on: https://gerrit.libreoffice.org/18866
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-09-29 11:32:16 +00:00
Miklos Vajna
0067b4df75 libreofficekit: fix mismatched free() / delete
Change-Id: I60eb53d4bf9943fd52e0a9d8e3574a7d1cc027e0
2015-09-28 09:26:39 +02:00
Pranav Kant
392437393d Move all introspection comments to header file
... wherever possible. There are few things we can't move to
header file, for example, the comments corresponding to GObject
properties, and signals.

Change-Id: If74d61b17ccee11f8a056f3a93040d2cff2dd98d
Reviewed-on: https://gerrit.libreoffice.org/18863
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-09-25 12:03:11 +00:00
Miklos Vajna
43b2103f93 gtktiledviewer: don't crash on opening non-existing files
Change-Id: Ic48adaf038e8fbcc86a94b5e351d2f963fcfcd16
2015-09-21 07:30:26 +02:00
Miklos Vajna
d3446bc860 lokdocview: set view before calling lok::Document member functions
getTextSelection() is still to be done, but has to be moved to the
widget first.

Change-Id: I780a31f1dbce38b2b7398bfdacbbc1c40881229d
2015-09-21 07:30:22 +02:00
Miklos Vajna
c9ebc92a1e LOK: allow postMouseEvent() in multiple views
Change-Id: Iafb08cb44a96dbc03d12367d21b4120063bd0222
2015-09-21 07:30:21 +02:00
Miklos Vajna
f2e55ea106 gtktiledviewer: use setView() before postKeyEvent()
Also in SfxLokHelper::setView() set the current view shell directly,
GetFocus() in VCL may be a NOP for hidden windows.

With this, the Writer layout dump shows that two Gtk windows can have
different cursor positions correctly.

Change-Id: I81890c1d8ad7972f1194db3d5f2e9d8a39fc2f87
2015-09-21 07:30:20 +02:00
Miklos Vajna
b3498e9fcd lokdocview: set up the widget in all windows
With this finally the number of GTK+ windows always match the number
returned by SfxLokHelper::getViews().

Change-Id: Ia45bef7dea86b80cfac00e2ad7c1a16d7f5b507b
2015-09-21 07:30:19 +02:00
Miklos Vajna
e6e5c248e5 lokdocview: avoid GTK+ calls in openDocumentInThread()
GTK+ calls should be made from the main thread.

Change-Id: Idcfa46d427d6e35fc544246a691bafc72f75a74c
2015-09-21 07:30:19 +02:00
Miklos Vajna
4fd59356cb lokdocview: allow not calling documentLoad()
Change-Id: I2ff57c4be11cd3908bc951ebf572a2c02e2c4585
2015-09-21 07:30:17 +02:00
Miklos Vajna
88b6dd3ea7 lokdocview: GTK+ calls should be made from the main thread
Change-Id: Ia76ef111170700ef507550222ca917986d4fe00e
2015-09-11 11:43:22 +02:00
Pranav Kant
520053459a Fix incomplete g-i annotations
Change-Id: I2665a12251921523045f4071df88ca69ecd5a5c0
2015-08-19 12:02:17 +02:00