Commit Graph

176 Commits

Author SHA1 Message Date
Miklos Vajna
c84e1e2521 lokdocview: call lok::Document::setClientZoom() after zoom change
This is similar to what is implemented in online.git's leaflet. If the
zoom factor changes, then inform LOK about it on the first keyboard hit.

Change-Id: I2db4ffed3897db5c852f4b8aea8f4e2d3500a25a
2016-02-01 18:56:23 +01:00
Miklos Vajna
dfe5531ec8 lokdocview: log lok::Document::postKeyEvent() arguments
Change-Id: I16e7c0fee34077d5bbb493d9d9502ff82355c2c6
2016-02-01 18:56:23 +01:00
Michael Stahl
23a0ee3c01 libreofficekit: password interaction optional and off by default
Add setOptionalFeatures() function that clients must call during
initialization, and enum LibreOfficeKitOptionalFeatures.

Change-Id: I73035193c87033052921c3aad94fdc057fe81111
Reviewed-on: https://gerrit.libreoffice.org/21809
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2016-01-27 08:26:19 +00:00
Michael Stahl
2b63e576a5 libreofficekit: ask for password when loading encrypted documents
Change-Id: I3b3b0c0e64965280c24842b0cf70a21b8abb4dfb
2016-01-25 12:31:39 +01:00
Miklos Vajna
455069c6ec lokdocview: handle page down and page up
Change-Id: I119633474236faa95ecf5fd26cd89789b313e382
2016-01-22 19:19:00 +01:00
Miklos Vajna
3d6dd6d83d lokdocview: log lok::Document::getTextSelection() parameters
Change-Id: I7706fe40705bc74bcebd53b58239c4b159bab7c0
2016-01-22 19:19:00 +01:00
Pranav Kant
070bfedb7c lokdocview: Center the widget inside the allocation
Change-Id: I8d7f8ffb1c5ddd07ccf7d56bdf0ccc866c927401
Reviewed-on: https://gerrit.libreoffice.org/21624
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Pranav Kant <pranavk@gnome.org>
2016-01-20 14:12:53 +00:00
Pranav Kant
11a3449429 lokdocview: Package and install selection handles
Now since, LOKDocView has started to get clients, we need to ship
all of its dependencies with the widget.

Reviewed on:
	https://gerrit.libreoffice.org/21605

Change-Id: I874eb416587a80b7760c5f00183d6004dfca4cce
2016-01-19 18:04:52 +01:00
Miklos Vajna
42cf5fe304 libreofficekit: log document paste arguments
Change-Id: I0e7783cf73d2d4bfcd4f0c75ca3ad82336048b27
2016-01-15 14:33:02 +01:00
Debarshi Ray
3ba1b60c97 lokdocview: Fix WARNING when creating an error
A GError needs a valid GQuark as the domain. Passing 0 leads to:
  GLib-WARNING **: (gerror.c:408):g_error_new_valist: runtime check
    failed: (domain != 0)

Change-Id: I2f252eaa83a1519b5d16c7ba22c8f593732807ca
Reviewed-on: https://gerrit.libreoffice.org/21261
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Pranav Kant <pranavk@gnome.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-01-11 12:30:58 +00:00
Stephan Bergmann
ac1f0b5904 Silence loplugin:implicitboolconversion between bool and gboolean
Change-Id: I83ce360622eea0fb805833650c0d2126bcd5d8db
2016-01-11 13:24:33 +01:00
Pranav Kant
ba539fa91f tdf#96513: Limit LOKDocView's zoom in [0.25, 5.0]
Change-Id: Ibee485909dca1ea4a3774fca7a840afbf2d9883c
Reviewed-on: https://gerrit.libreoffice.org/20819
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: David Tardon <dtardon@redhat.com>
2016-01-11 11:34:54 +00:00
Pranav Kant
4200a678fb tdf#96421: Return if no window is realized
Change-Id: I13de7e6eae4e73932e8441ba2e2ad3e4ff888f41
Reviewed-on: https://gerrit.libreoffice.org/20799
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: David Tardon <dtardon@redhat.com>
2016-01-11 11:23:50 +00:00
David Tardon
080a9c3a51 iostream is not needed
Change-Id: I481b402e0d3b42de5b486a159acb8a25e345b8b8
2016-01-11 12:20:36 +01:00
Pranav Kant
02b49890d5 lokdocview: Use shared_ptr to fix a possible memory leak
Possible because boost::property_tree can throw an exception.

Change-Id: I68394ce3b30d448d40d8e22555bafdff1ffa6092
Reviewed-on: https://gerrit.libreoffice.org/21309
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2016-01-11 11:19:46 +00:00
Pranav Kant
398ef76d5d tdf#96514: Emits a 'notify' signal when zoom changes
Change-Id: I5f55e4cce26096afcae3ad3711efa37757aada39
Reviewed-on: https://gerrit.libreoffice.org/20798
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2015-12-30 09:46:32 +00:00
Pranav Kant
81f31f5151 lokdocview: Use an array to install properties
This way we can directly reference any property by pointers to
GParamSpec stored in a static array, rather than looking for
property using property name. The former is a faster approach.

This will come in handy for functions, such as, g_object_notify
which needs to access properties to notify the object of any
property change in a faster way.

Change-Id: Ic4087bff3bdb63a3e8853d158c7af688e5e67811
Reviewed-on: https://gerrit.libreoffice.org/20797
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2015-12-30 09:37:37 +00:00
Caolán McNamara
746da6b7fb coverity#1343633 Resource leak
Change-Id: I2384091557c2a3b061e2c60118309f35b65b45d6
2015-12-19 18:10:13 +00:00
Caolán McNamara
5b05a3fa2d coverity#1343632 Resource leak
Change-Id: I79bf35a4c1a2f0463abc202f6c2b104ffdd5139c
2015-12-19 18:10:12 +00:00
Caolán McNamara
169298fa73 coverity#1343631 Resource leak
Change-Id: Ic5d7c88ae4080c2e103fb691c2e326a9e239aa12
2015-12-19 18:10:12 +00:00
Pranav Kant
df4a196b8f lokdocview: Return if no document is set
For example, when document has been destroyed using
lok_doc_view_destroy_document()

Change-Id: I531b85018ffa25bcf88fb101c912b9f11b489a97
Reviewed-on: https://gerrit.libreoffice.org/20779
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2015-12-17 15:52:54 +00:00
Pranav Kant
b902432b43 lokdocview: Use GLib basic types
Change-Id: I07add7b9dcb1dc53d7ed61ff71545489de3be155
Reviewed-on: https://gerrit.libreoffice.org/20778
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2015-12-17 15:47:43 +00:00
Pranav Kant
a2682e4b08 lokdocview: Superfluous *_set_zoom() call on widget initialization
G_PARAM_CONSTRUCT implies that parameter will be set upon widget
initialization which means calling lok_doc_view_set_zoom() while
document still points to null.

Change-Id: Ib576ac3b32c2349be2b2df6067ae79a056a03028
Reviewed-on: https://gerrit.libreoffice.org/20775
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2015-12-17 15:45:24 +00:00
Pranav Kant
244aad533b lokdocview: Remove an easy FIXME
Change-Id: I8305f3eb45330f457089ca0524a0df004410f59c
Reviewed-on: https://gerrit.libreoffice.org/20774
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2015-12-17 15:44:09 +00:00
Miklos Vajna
032e34d001 tdf#96250 LOK: guard against 0 pRenderingArguments
Change-Id: Ifa39777795ce966662c31c891ffc1b9b1a297b00
2015-12-16 20:31:47 +01:00
Pranav Kant
ea5c99428f tdf#96384: Add a new signal 'text-selection' to lokdocview
To help client know when the user has selected a non-null text.

Change-Id: Ie939612fc5f38e2e50e9ad9792e04e89ae918886
Reviewed-on: https://gerrit.libreoffice.org/20621
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-12-11 14:02:33 +00:00
Ashod Nakashian
deb9203741 Crash fix in gtktiledviewer when creating new view
Change-Id: I85bb71e775f300214e05e75636bbee200d35ffaa
Reviewed-on: https://gerrit.libreoffice.org/20418
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2015-12-10 14:43:49 +00:00
Stephan Bergmann
fb8a3fac5d loplugin:nullptr: More NULL -> nullptr automatic rewrite
Change-Id: Ie83819e2bcdc5fa160b39296b005ca9a5ff74b1d
2015-12-10 08:06:06 +01:00
Pranav Kant
7d7fad258d tdf#96317: Add API for copy/paste from/to the widget
Change-Id: Iac869ddb65cbdd2227f96d047d83159ca7819f11
Reviewed-on: https://gerrit.libreoffice.org/20534
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2015-12-09 16:36:22 +00:00
Stephan Bergmann
ab5d730b2a loplugin:nullptr
Change-Id: Id249baebf047bae083e36ad6e23d5bb8989f9a98
2015-12-09 17:25:18 +01:00
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
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
74463457b3 (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