[Libreoffice-commits] online.git: 4 commits - loleaflet/src loolwsd/bundled loolwsd/LOKitClient.cpp loolwsd/LOOLSession.cpp

Andrzej Hunt andrzej.hunt at collabora.com
Wed Nov 11 01:43:39 PST 2015


 loleaflet/src/layer/tile/TileLayer.js                        |   12 +++++++++--
 loleaflet/src/map/handler/Map.Mouse.js                       |    8 +++++++
 loolwsd/LOKitClient.cpp                                      |    1 
 loolwsd/LOOLSession.cpp                                      |    3 ++
 loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h |    9 +++++++-
 5 files changed, 30 insertions(+), 3 deletions(-)

New commits:
commit 72c407e0ed5c3a9ffd2ae518f9f5d4407e1f5d61
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date:   Tue Nov 10 11:44:50 2015 +0100

    loleaflet: support mouse cursor calback

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 8f446ea..eddb2bb 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -241,6 +241,9 @@ L.TileLayer = L.GridLayer.extend({
 			msg += 'height=' + this._docHeightTwips;
 			this._onInvalidateTilesMsg(msg);
 		}
+		else if (textMsg.startsWith('mousepointer:')) {
+			this._onMousePointerMsg(textMsg);
+		}
 		else if (textMsg.startsWith('partpagerectangles:')) {
 			this._onPartPageRectanglesMsg(textMsg);
 		}
@@ -376,6 +379,11 @@ L.TileLayer = L.GridLayer.extend({
 		this._onUpdateCellCursor();
 	},
 
+	_onMousePointerMsg: function (textMsg) {
+		textMsg = textMsg.substring(14); // "mousepointer: "
+		this._map._container.style.cursor = textMsg;
+	},
+
 	_onHyperlinkClickedMsg: function (textMsg) {
 		var link = textMsg.substring(18);
 		window.open(link, '_blank');
diff --git a/loleaflet/src/map/handler/Map.Mouse.js b/loleaflet/src/map/handler/Map.Mouse.js
index 6477be4..82c8c83 100644
--- a/loleaflet/src/map/handler/Map.Mouse.js
+++ b/loleaflet/src/map/handler/Map.Mouse.js
@@ -157,6 +157,14 @@ L.Map.Mouse = L.Handler.extend({
 				this._map.fire('handleautoscroll', { pos: e.containerPoint, map: this._map });
 			}
 		}
+		else if (e.type === 'mousemove' && !this._mouseDown) {
+			clearTimeout(this._mouseOverTimeout);
+			mousePos = docLayer._latLngToTwips(e.latlng);
+			this._mouseOverTimeout = setTimeout(L.bind(function() {
+			    docLayer._postMouseEvent('move', mousePos.x, mousePos.y, 1, 0, modifier);
+			  }, this),
+			  100);
+		}
 		else if (e.type === 'dblclick' || e.type === 'trplclick' || e.type === 'qdrplclick') {
 			mousePos = docLayer._latLngToTwips(e.latlng);
 			var clicks = {
commit 74edae8703d1e3533260009f931709f64f997574
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date:   Tue Nov 10 11:42:56 2015 +0100

    loolwsd: support LOK_CALLBACK_MOUSE_POINTER

diff --git a/loolwsd/LOKitClient.cpp b/loolwsd/LOKitClient.cpp
index 481c3be..f72f8e6 100644
--- a/loolwsd/LOKitClient.cpp
+++ b/loolwsd/LOKitClient.cpp
@@ -53,6 +53,7 @@ extern "C"
             CASE(GRAPHIC_SELECTION);
             CASE(CELL_CURSOR);
             CASE(HYPERLINK_CLICKED);
+            CASE(MOUSE_POINTER);
             CASE(STATE_CHANGED);
             CASE(STATUS_INDICATOR_START);
             CASE(STATUS_INDICATOR_SET_VALUE);
diff --git a/loolwsd/LOOLSession.cpp b/loolwsd/LOOLSession.cpp
index 7565470..1edd3fa 100644
--- a/loolwsd/LOOLSession.cpp
+++ b/loolwsd/LOOLSession.cpp
@@ -891,6 +891,9 @@ extern "C"
         case LOK_CALLBACK_CELL_CURSOR:
             srv->sendTextFrame("cellcursor: " + std::string(pPayload));
             break;
+        case LOK_CALLBACK_MOUSE_POINTER:
+            srv->sendTextFrame("mousepointer: " + std::string(pPayload));
+            break;
         case LOK_CALLBACK_HYPERLINK_CLICKED:
             srv->sendTextFrame("hyperlinkclicked: " + std::string(pPayload));
             break;
commit 69325ce576cd04d4c1c950d42310fec4860d8317
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date:   Tue Nov 10 11:42:38 2015 +0100

    loolwsd: update bundled headers to contain LOK_CALLBACK_MOUSE_POINTER

diff --git a/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
index bf62675..37837ea 100644
--- a/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -202,7 +202,14 @@ typedef enum
      *
      * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
      */
-    LOK_CALLBACK_CELL_CURSOR
+    LOK_CALLBACK_CELL_CURSOR,
+
+    /**
+     * The current mouse pointer style.
+     *
+     * Payload is a css mouse pointer style.
+     */
+    LOK_CALLBACK_MOUSE_POINTER
 }
 LibreOfficeKitCallbackType;
 
commit 931d6badbe382f341aff577335591121cc3934d1
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date:   Mon Nov 9 11:02:12 2015 +0100

    loleaflet: no need for hungarian notation

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 1f00b05..8f446ea 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -943,8 +943,8 @@ L.TileLayer = L.GridLayer.extend({
 
 	// Cells can change position during changes of zoom level in calc
 	// hence we need to request an updated cell cursor position for this level.
-	_onCellCursorShift: function (bForce) {
-		if (this._cellCursorMarker || bForce) {
+	_onCellCursorShift: function (force) {
+		if (this._cellCursorMarker || force) {
 			L.Socket.sendMessage('commandvalues command=.uno:CellCursor'
 			                     + '?outputHeight=' + this._tileSize
 			                     + '&outputWidth=' + this._tileSize


More information about the Libreoffice-commits mailing list