mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Beta-3 Release Candidate branch (#753)
* Merge experimental session recording branch * Merge new CEF-based webgui branch
This commit is contained in:
@@ -31,8 +31,7 @@ namespace openspace {
|
||||
|
||||
class ShortcutTopic : public Topic {
|
||||
public:
|
||||
ShortcutTopic();
|
||||
virtual ~ShortcutTopic();
|
||||
virtual ~ShortcutTopic() = default;
|
||||
|
||||
void handleJson(const nlohmann::json& json) override;
|
||||
bool isDone() const override;
|
||||
|
||||
@@ -31,8 +31,7 @@ namespace openspace {
|
||||
|
||||
class VersionTopic : public Topic {
|
||||
public:
|
||||
VersionTopic();
|
||||
virtual ~VersionTopic();
|
||||
virtual ~VersionTopic() = default;
|
||||
|
||||
void handleJson(const nlohmann::json& json) override;
|
||||
bool isDone() const override;
|
||||
|
||||
@@ -25,11 +25,7 @@
|
||||
#include <modules/server/include/topics/shortcuttopic.h>
|
||||
|
||||
#include <modules/server/include/connection.h>
|
||||
#include <modules/server/servermodule.h>
|
||||
|
||||
#include <openspace/openspace.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
|
||||
#include <openspace/interaction/shortcutmanager.h>
|
||||
#include <openspace/interaction/keybindingmanager.h>
|
||||
|
||||
@@ -43,10 +39,6 @@ using nlohmann::json;
|
||||
|
||||
namespace openspace {
|
||||
|
||||
ShortcutTopic::ShortcutTopic() {}
|
||||
|
||||
ShortcutTopic::~ShortcutTopic() {}
|
||||
|
||||
bool ShortcutTopic::isDone() const {
|
||||
return true;
|
||||
}
|
||||
@@ -82,10 +74,10 @@ std::vector<nlohmann::json> ShortcutTopic::shortcutsJson() const {
|
||||
{ "key", ghoul::to_string(k.key) },
|
||||
{ "modifiers",
|
||||
{
|
||||
{"shift" , hasKeyModifier(k.modifier, KeyModifier::Shift) },
|
||||
{"control" , hasKeyModifier(k.modifier, KeyModifier::Control) },
|
||||
{"alt" , hasKeyModifier(k.modifier, KeyModifier::Alt) },
|
||||
{"super" , hasKeyModifier(k.modifier, KeyModifier::Super) }
|
||||
{ "shift" , hasKeyModifier(k.modifier, KeyModifier::Shift) },
|
||||
{ "control" , hasKeyModifier(k.modifier, KeyModifier::Control) },
|
||||
{ "alt" , hasKeyModifier(k.modifier, KeyModifier::Alt) },
|
||||
{ "super" , hasKeyModifier(k.modifier, KeyModifier::Super) }
|
||||
}
|
||||
},
|
||||
{ "name", info.name },
|
||||
@@ -100,9 +92,7 @@ std::vector<nlohmann::json> ShortcutTopic::shortcutsJson() const {
|
||||
}
|
||||
|
||||
void ShortcutTopic::sendData() const {
|
||||
nlohmann::json data = {
|
||||
{"shortcuts", shortcutsJson()}
|
||||
};
|
||||
nlohmann::json data = { {"shortcuts", shortcutsJson()} };
|
||||
_connection->sendJson(wrappedPayload(data));
|
||||
}
|
||||
|
||||
|
||||
@@ -26,24 +26,14 @@
|
||||
|
||||
#include <modules/server/include/connection.h>
|
||||
#include <modules/server/servermodule.h>
|
||||
|
||||
#include <openspace/openspace.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
|
||||
namespace {
|
||||
constexpr const char* _loggerCat = "VersionTopic";
|
||||
} // namespace
|
||||
|
||||
using nlohmann::json;
|
||||
|
||||
namespace openspace {
|
||||
|
||||
VersionTopic::VersionTopic() {
|
||||
}
|
||||
|
||||
VersionTopic::~VersionTopic() {
|
||||
}
|
||||
|
||||
bool VersionTopic::isDone() const {
|
||||
return true;
|
||||
}
|
||||
@@ -53,24 +43,22 @@ void VersionTopic::handleJson(const nlohmann::json&) {
|
||||
{
|
||||
"openSpaceVersion",
|
||||
{
|
||||
{"major", OPENSPACE_VERSION_MAJOR},
|
||||
{"minor", OPENSPACE_VERSION_MINOR},
|
||||
{"patch", OPENSPACE_VERSION_PATCH}
|
||||
{ "major", OPENSPACE_VERSION_MAJOR },
|
||||
{ "minor", OPENSPACE_VERSION_MINOR },
|
||||
{ "patch", OPENSPACE_VERSION_PATCH }
|
||||
}
|
||||
},
|
||||
{
|
||||
"socketApiVersion",
|
||||
{
|
||||
{"major", SOCKET_API_VERSION_MAJOR},
|
||||
{"minor", SOCKET_API_VERSION_MINOR},
|
||||
{"patch", SOCKET_API_VERSION_PATCH}
|
||||
{ "major", SOCKET_API_VERSION_MAJOR },
|
||||
{ "minor", SOCKET_API_VERSION_MINOR },
|
||||
{ "patch", SOCKET_API_VERSION_PATCH }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_connection->sendJson(
|
||||
wrappedPayload(versionJson)
|
||||
);
|
||||
_connection->sendJson(wrappedPayload(versionJson));
|
||||
}
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
Reference in New Issue
Block a user