Commit graph

22685 commits

Author SHA1 Message Date
Tor Lillqvist
6d9f298ee9 Prefer C++ std headers 2015-03-28 13:57:10 +02:00
Tor Lillqvist
41f41f7af5 Have lokitclient display tiles using ImageMagick's 'display' if available
Refactor the PNG encoding of a pixmap out to Util.
2015-03-28 13:57:03 +02:00
Tor Lillqvist
c5a8104c4f Add a new minimal non-GUI LOKit test program
For easier debugging of the LO code invoked through LibreOfficeKit, with is no
GUI stuff complicating debugging.
2015-03-28 13:56:03 +02:00
Tor Lillqvist
56f3678b36 Add a separate include file for some helper functions 2015-03-28 13:22:15 +02:00
Tor Lillqvist
7cb0449b8e More hacking 2015-03-27 18:25:06 +02:00
Tor Lillqvist
6e36de4534 For debugging, sleep a bit before initialising LOKit if requested
Set the SLEEPFORDEBUGGER environment variable to the number of seconds a child
process should sleep before calling lok_init(), so that you have time to
attach the process in a debugger.
2015-03-27 18:23:27 +02:00
Tor Lillqvist
cec37456ef Set no receive timeout 2015-03-27 16:53:51 +02:00
Tor Lillqvist
58f00ca165 Remove the dead "migratory socket" stuff 2015-03-27 16:26:33 +02:00
Tor Lillqvist
bb162a6ba7 Add trivial test program for sending commands to the LOOL server 2015-03-27 16:23:20 +02:00
Tor Lillqvist
022592e65c Do remove also the first level of subdirectories 2015-03-27 14:52:30 +02:00
Tor Lillqvist
70f175c9a7 Make Util a namespace instead of a class with just static member functions
This is not Java or C#.
2015-03-26 17:07:52 +02:00
Tor Lillqvist
422dfd1767 Start on load testing
Add a new program, loadtest, that runs a requested number of client sessions
in parallel to a loolwsd server. A client session loads one of a list of test
documents, and does some operations on it.

Move the getTokenInteger() and getTokenString() functions out from LOOLSession
into a new namespace LOOLProtocol, as they are neeeded also in the loadtest
program.

Add, also in LOOLProtocol, functions to parse some of the messages from the
server. (In general that is done in client JavaScript code, of course; only
for testing purposes needed in C++ code.)
2015-03-26 17:04:08 +02:00
Tor Lillqvist
425cae6b29 No need for <unistd.h> as far as I see 2015-03-26 17:04:08 +02:00
Tor Lillqvist
eb695513de Use const reference parameter 2015-03-26 17:04:08 +02:00
Tor Lillqvist
3cb43839ea Cosmetics 2015-03-26 17:04:08 +02:00
Tor Lillqvist
df95739819 Make DEFAULT_PORT_NUMBER public 2015-03-26 17:04:08 +02:00
Tor Lillqvist
b7c08d373e WaE: private field '_helpRequested' is not used 2015-03-26 14:37:38 +02:00
Michael Meeks
52376226d0 More README grist. 2015-03-25 14:16:04 +00:00
Tor Lillqvist
e8aa011af4 Undo accidental indentation 2015-03-25 15:48:28 +02:00
Tor Lillqvist
5df0766dad Return an error if the documentLoad() fails 2015-03-25 15:48:20 +02:00
Tor Lillqvist
867a66aa62 A bit more info 2015-03-24 19:04:16 +02:00
Tor Lillqvist
cae997c184 Check 'tile' parameter validity 2015-03-24 18:59:23 +02:00
Mihai Varga
b138c2431d Tiles are cached on the client side
Updated the removeTile method to just mark the tile as
not current and the set _update method not to 'hide'
(set opacity to 0) tiles from the current zoom level
2015-03-24 16:26:40 +02:00
Tor Lillqvist
8952d80dc0 No need to mention that 2015-03-24 13:16:15 +02:00
Tor Lillqvist
32de8661bc Mention how to run npm without root 2015-03-24 13:15:43 +02:00
Tor Lillqvist
97fbe8e857 Add 'saveas' 2015-03-23 22:14:11 +02:00
Mihai Varga
3b2c3a69df Mentioned about 'jake lint' in README 2015-03-23 19:37:42 +02:00
Mihai Varga
dc97c7eabd Fixed some lintjs coding style errors 2015-03-23 19:36:01 +02:00
Mihai Varga
624873cf47 Added instructions on how to use loleaflet + an example 2015-03-23 19:24:39 +02:00
Mihai Varga
31f5141c46 Added zoom functionality
The document can be zoomed in an out. Each zoom level corresponds
to a 20% increase or decrease in tile dimmension (in twips).
Zooming doesn't work well yet. Tiles are removed and readded to
many times and it looks bad. Also the zooming center has to be fixed.
2015-03-23 19:05:25 +02:00
Mihai Varga
5db22c1962 Temporary dded zoom control back 2015-03-23 18:57:23 +02:00
Tor Lillqvist
4974ea15b1 Bin leftover debug output 2015-03-20 15:53:00 +02:00
Tor Lillqvist
1e734c2c0e Reduce copypasta
Handle the start of a child process when needed centrally, not in each command
handler.

Also, handle unrecognized commands always already in the parent
process. (Command syntax checks still done in child process, though.)
2015-03-20 15:53:00 +02:00
Tor Lillqvist
e05092ece2 Obviously need to handle input events etc in the child process
I need to re-factor this stuff, too much copypasta.
2015-03-20 15:52:43 +02:00
Tor Lillqvist
a3897bd906 paintTile does not take a row stride parameter any more 2015-03-20 13:18:01 +02:00
Tor Lillqvist
215fda0235 Add key and mouse event handling, uno command, and selection handling
Not "handled" here of course, just pass them on to LibreOfficeKit.
2015-03-20 13:18:01 +02:00
Tor Lillqvist
721d835c79 Also mention the communication between parent and child process 2015-03-20 13:18:01 +02:00
Mihai Varga
3921903e8e MaxBounds are set automatically based on the size specified by loolwsd 2015-03-20 10:05:22 +02:00
Mihai Varga
fe757bfc12 Workaround for Leaflet issue #3320 2015-03-20 10:02:58 +02:00
Mihai Varga
aa5d7c9ccc Fixed tiles interleaving problem + allowed static layers to be added
Tiles are now correctly displayed.
Layers that request tiles from a socket connection need to specify
the 'useSocket: true' option. This way layers that do not require an
internet connection can be added (like a grid, ruler, etc.).
I've also fixed some coding style problems suggested by lintjs
2015-03-19 19:08:29 +02:00
Tor Lillqvist
27ea953a3b Update 2015-03-18 15:40:50 +02:00
Tor Lillqvist
e8ea0f0d2e Use separate child processes for LibreOfficeKit
For now, each LOOL client has a separate child process (or none at all, if it
has accessed only information found in the cache). This will obviously have to
chnage to handle collaboration. Etc.

The parent process talks the same Websocket protocol with the child
processes. When there is a child process for a client, traffic from the client
is forwarded as such to the child process and vice versa.
2015-03-18 15:38:01 +02:00
Tor Lillqvist
d43e148ff4 Updates 2015-03-18 01:57:37 +02:00
Tor Lillqvist
ff8ceac560 Caller expects empty string as failure, not nullptr
Fixes crash.
2015-03-16 21:08:14 +02:00
Tor Lillqvist
bd35c1aeb8 Intermediate commit, will not actually do it like this
My comment in 1b0230e4df was misleading, even if
doing this for Unix only, if we had done it as I was first thinking, we would
have needed to pass sockets between processes. But we won't, we will instead
keep all the connections to the clients in the same master process, and pass
on the WebSocketg protocol as such to child processes. That way the child
processes can go away when idle, or crash, without the connections
breaking. Or something.
2015-03-16 19:19:30 +02:00
Tor Lillqvist
50e36c7ca5 Sort 'using' statements 2015-03-16 19:19:30 +02:00
Mihai Varga
0c5b654194 Tiles are now loaded from a loolwsd server
the '_addTile' method now also handles tiles comming from a websocket.
Tiles are no longer added in one batch as they are added when received.
Added twip to pixel and pixel to twip convertor methods.
1 twip = 15 px
2015-03-16 17:46:20 +02:00
Mihai Varga
a8075b8250 Added websockets to the Map object
'onopen' and 'onmessage' events are handled
in src/layer/tile/TileLayer.js
Tile data is received as an ArrayBuffer which contains a string message
followed by a new line and then by the actual PNG data. The PNG data
is encoded in base-64 in order to be displayed.
2015-03-16 17:38:19 +02:00
Mihai Varga
2213e76a32 Removed zoom control and attribution display 2015-03-16 17:33:07 +02:00
Tor Lillqvist
1b0230e4df Intermediate commit of start on transporting sockets to child process
Will be needed if we want loolwsd to run on Windows. Then we will have one
process receiving the connections from WebSocket clients and sending the
accepted connection sockets to child processes thatr might be already running,
either because they have been "pre-forked", or because of a collaboration
scenario where new clients join a session working on a document.

But initially we will write this as if for Unix only, so development of this
migratory socket stuff is paused for now. (And it isn't even clear whether the
API design so far is a good idea and elegantly implementable.)
2015-03-16 12:30:56 +02:00