Revert "jsdialogs: send events to the core"
core not yet ready
This reverts commit 80ecaa60f6
.
This commit is contained in:
parent
f6b2cd63a4
commit
ca4351e6ef
7 changed files with 3 additions and 52 deletions
|
@ -199,11 +199,6 @@ struct _LibreOfficeKitDocumentClass
|
|||
int nButtons,
|
||||
int nModifier);
|
||||
|
||||
/// @see lok::Document::sendDialogEvent
|
||||
void (*sendDialogEvent) (LibreOfficeKitDocument* pThis,
|
||||
unsigned nLOKWindowId,
|
||||
const char* pArguments);
|
||||
|
||||
/// @see lok::Document::postUnoCommand
|
||||
void (*postUnoCommand) (LibreOfficeKitDocument* pThis,
|
||||
const char* pCommand,
|
||||
|
|
|
@ -302,17 +302,6 @@ public:
|
|||
mpDoc->pClass->postWindowMouseEvent(mpDoc, nWindowId, nType, nX, nY, nCount, nButtons, nModifier);
|
||||
}
|
||||
|
||||
/**
|
||||
* Posts a dialog event for the window with given id
|
||||
*
|
||||
* @param nWindowId id of the window to notify
|
||||
* @param pArguments arguments of the event.
|
||||
*/
|
||||
void sendDialogEvent(unsigned nWindowId, const char* pArguments = NULL)
|
||||
{
|
||||
mpDoc->pClass->sendDialogEvent(mpDoc, nWindowId, pArguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* Posts an UNO command to the document.
|
||||
*
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#include <Util.hpp>
|
||||
#include <Unit.hpp>
|
||||
#include <Clipboard.hpp>
|
||||
#include <string>
|
||||
|
||||
using Poco::JSON::Object;
|
||||
using Poco::JSON::Parser;
|
||||
|
@ -296,8 +295,7 @@ bool ChildSession::_handleInput(const char *buffer, int length)
|
|||
tokens[0] == "uploadsigneddocument" ||
|
||||
tokens[0] == "exportsignanduploaddocument" ||
|
||||
tokens[0] == "rendershapeselection" ||
|
||||
tokens[0] == "removetextcontext" ||
|
||||
tokens[0] == "dialogevent");
|
||||
tokens[0] == "removetextcontext");
|
||||
|
||||
if (tokens[0] == "clientzoom")
|
||||
{
|
||||
|
@ -421,10 +419,6 @@ bool ChildSession::_handleInput(const char *buffer, int length)
|
|||
{
|
||||
return removeTextContext(buffer, length, tokens);
|
||||
}
|
||||
else if (tokens[0] == "dialogevent")
|
||||
{
|
||||
return dialogEvent(buffer, length, tokens);
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(false && "Unknown command token.");
|
||||
|
@ -1381,23 +1375,6 @@ bool ChildSession::mouseEvent(const char* /*buffer*/, int /*length*/,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ChildSession::dialogEvent(const char* /*buffer*/, int /*length*/, const std::vector<std::string>& tokens)
|
||||
{
|
||||
if (tokens.size() <= 2)
|
||||
{
|
||||
sendTextFrame("error: cmd=dialogevent kind=syntax");
|
||||
return false;
|
||||
}
|
||||
|
||||
getLOKitDocument()->setView(_viewId);
|
||||
|
||||
unsigned nLOKWindowId = std::stoi(tokens[1].c_str());
|
||||
getLOKitDocument()->sendDialogEvent(nLOKWindowId,
|
||||
Poco::cat(std::string(" "), tokens.begin() + 2, tokens.end()).c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChildSession::unoCommand(const char* /*buffer*/, int /*length*/, const std::vector<std::string>& tokens)
|
||||
{
|
||||
if (tokens.size() <= 1)
|
||||
|
|
|
@ -259,7 +259,6 @@ private:
|
|||
bool dialogKeyEvent(const char* buffer, int length, const std::vector<std::string>& tokens);
|
||||
bool mouseEvent(const char* buffer, int length, const std::vector<std::string>& tokens, const LokEventTargetEnum target);
|
||||
bool gestureEvent(const char* buffer, int length, const std::vector<std::string>& tokens);
|
||||
bool dialogEvent(const char* buffer, int length, const std::vector<std::string>& tokens);
|
||||
bool unoCommand(const char* buffer, int length, const std::vector<std::string>& tokens);
|
||||
bool selectText(const char* buffer, int length, const std::vector<std::string>& tokens);
|
||||
bool selectGraphic(const char* buffer, int length, const std::vector<std::string>& tokens);
|
||||
|
|
|
@ -91,12 +91,10 @@ L.Control.JSDialogBuilder = L.Control.extend({
|
|||
|
||||
// by default send new state to the core
|
||||
_defaultCallbackHandler: function(objectType, eventType, object, data, builder) {
|
||||
console.debug('control: \'' + objectType + '\' id:\'' + object.id + '\' event: \'' + eventType + '\' state: \'' + data + '\'');
|
||||
console.debug('control: \'' + objectType + '\' event: \'' + eventType + '\' state: \'' + data + '\'');
|
||||
|
||||
if (objectType == 'toolbutton' && eventType == 'click') {
|
||||
builder.map.sendUnoCommand(data);
|
||||
} else {
|
||||
builder.map._socket.sendMessage('dialogevent ' + window.sidebarId + ' ' + object.id);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -263,8 +263,6 @@ L.Control.LokDialog = L.Control.extend({
|
|||
} else if (e.winType === 'deck') {
|
||||
if (!window.mode.isMobile()) {
|
||||
this._launchSidebar(e.id, width, height);
|
||||
} else {
|
||||
window.sidebarId = e.id;
|
||||
}
|
||||
} else if (e.winType === 'child') {
|
||||
var parentId = parseInt(e.parentId);
|
||||
|
|
|
@ -427,8 +427,7 @@ bool ClientSession::_handleInput(const char *buffer, int length)
|
|||
tokens[0] != "removesession" &&
|
||||
tokens[0] != "renamefile" &&
|
||||
tokens[0] != "resizewindow" &&
|
||||
tokens[0] != "removetextcontext" &&
|
||||
tokens[0] != "dialogevent")
|
||||
tokens[0] != "removetextcontext")
|
||||
{
|
||||
LOG_ERR("Session [" << getId() << "] got unknown command [" << tokens[0] << "].");
|
||||
sendTextFrame("error: cmd=" + tokens[0] + " kind=unknown");
|
||||
|
@ -697,10 +696,6 @@ bool ClientSession::_handleInput(const char *buffer, int length)
|
|||
docBroker->saveAsToStorage(getId(), "", wopiFilename, true);
|
||||
return true;
|
||||
}
|
||||
else if (tokens[0] == "dialogevent")
|
||||
{
|
||||
return forwardToChild(firstLine, docBroker);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tokens[0] == "key")
|
||||
|
|
Loading…
Reference in a new issue