diff --git a/src/app/qt/element/QtCodeArea.cpp b/src/app/qt/element/QtCodeArea.cpp index 69441c81..6241ebb3 100644 --- a/src/app/qt/element/QtCodeArea.cpp +++ b/src/app/qt/element/QtCodeArea.cpp @@ -88,7 +88,6 @@ QtCodeArea::QtCodeArea( , m_fileWidget(file) , m_startLineNumber(startLineNumber) , m_locationFile(locationFile) - , m_hoveredAnnotation(nullptr) , m_digits(0) , m_panningValue(-1) , m_setIDECursorPositionAction(nullptr) @@ -324,7 +323,7 @@ void QtCodeArea::enterEvent(QEvent* event) void QtCodeArea::leaveEvent(QEvent* event) { - setHoveredAnnotation(nullptr); + setHoveredAnnotations(std::vector()); } void QtCodeArea::mousePressEvent(QMouseEvent* event) @@ -369,7 +368,7 @@ void QtCodeArea::mouseDoubleClickEvent(QMouseEvent* event) void QtCodeArea::mouseMoveEvent(QMouseEvent* event) { - if (m_panningValue!= -1) + if (m_panningValue != -1) { int panningCurrentPosition = event->pos().x(); int deltaPos = panningCurrentPosition - m_panningValue; @@ -383,31 +382,33 @@ void QtCodeArea::mouseMoveEvent(QMouseEvent* event) QTextCursor cursor = this->cursorForPosition(event->pos()); + std::vector annotations = getAnnotationsForPosition(cursor.position()); - m_hoveredLocationIds = findLocationIdsForPosition(cursor.position()); - const Annotation* annotation = findAnnotationForPosition(cursor.position()); - - if (annotation && annotation->isScope) + bool same = annotations.size() == m_hoveredAnnotations.size(); + if (same) { - annotation = nullptr; + for (size_t i = 0; i < annotations.size(); i++) + { + if (annotations[i] != m_hoveredAnnotations[i]) + { + same = false; + break; + } + } } QToolTip::hideText(); - if (annotation != m_hoveredAnnotation) + if (!same) { - setHoveredAnnotation(annotation); + setHoveredAnnotations(annotations); const std::vector& errorMessages = m_fileWidget->getErrorMessages(); - if (annotation && errorMessages.size() > annotation->tokenId) + if (annotations.size() == 1 && errorMessages.size() > annotations[0]->tokenId) { - QToolTip::showText(event->globalPos(), QString::fromStdString(errorMessages[annotation->tokenId])); + QToolTip::showText(event->globalPos(), QString::fromStdString(errorMessages[annotations[0]->tokenId])); } } - else if (m_hoveredLocationIds.size()) - { - updateContent(); - } } void QtCodeArea::contextMenuEvent(QContextMenuEvent* event) @@ -458,27 +459,6 @@ void QtCodeArea::setIDECursorPosition() MessageMoveIDECursor(m_locationFile->getFilePath().str(), lineColumn.first, lineColumn.second).dispatch(); } -const QtCodeArea::Annotation* QtCodeArea::findAnnotationForPosition(int pos) const -{ - const Annotation* annotationPtr = nullptr; - int diff = endTextEditPosition() + 1; - - for (const Annotation& annotation : m_annotations) - { - if (pos >= annotation.start && pos <= annotation.end) - { - int d = annotation.end - annotation.start; - if (d < diff) - { - diff = d; - annotationPtr = &annotation; - } - } - } - - return annotationPtr; -} - std::vector QtCodeArea::findLocationIdsForPosition(int pos) const { std::vector locationIds; @@ -494,6 +474,21 @@ std::vector QtCodeArea::findLocationIdsForPosition(int pos) const return locationIds; } +std::vector QtCodeArea::getAnnotationsForPosition(int pos) const +{ + std::vector annotations; + + for (const Annotation& annotation : m_annotations) + { + if (!annotation.isScope && pos >= annotation.start && pos <= annotation.end) + { + annotations.push_back(&annotation); + } + } + + return annotations; +} + void QtCodeArea::createAnnotations(std::shared_ptr locationFile) { locationFile->forEachStartTokenLocation( @@ -558,20 +553,19 @@ void QtCodeArea::createAnnotations(std::shared_ptr locationFi void QtCodeArea::annotateText() { - Id focusedTokenId = m_fileWidget->getFocusedTokenId(); const std::vector& activeIds = m_fileWidget->getActiveTokenIds(); - const std::vector& hoverIds = m_hoveredLocationIds; + const std::vector& focusIds = m_fileWidget->getFocusedTokenIds(); + bool isError = m_fileWidget->getErrorMessages().size() > 0; bool needsUpdate = false; - for (Annotation& annotation: m_annotations) { bool wasActive = annotation.isActive; bool wasFocused = annotation.isFocused; annotation.isActive = std::find(activeIds.begin(), activeIds.end(), annotation.tokenId) != activeIds.end(); - annotation.isFocused = std::find(hoverIds.begin(), hoverIds.end(), annotation.locationId) != hoverIds.end() || (annotation.tokenId == focusedTokenId); + annotation.isFocused = std::find(focusIds.begin(), focusIds.end(), annotation.tokenId) != focusIds.end(); annotation.isError = isError; @@ -588,18 +582,30 @@ void QtCodeArea::annotateText() } } -void QtCodeArea::setHoveredAnnotation(const Annotation* annotation) +void QtCodeArea::setHoveredAnnotations(const std::vector& annotations) { - if (m_hoveredAnnotation) + if (m_hoveredAnnotations.size()) { - MessageFocusOut(m_hoveredAnnotation->tokenId).dispatch(); + std::vector tokenIds; + for (const Annotation* annotation : m_hoveredAnnotations) + { + tokenIds.push_back(annotation->tokenId); + } + + MessageFocusOut(tokenIds).dispatch(); } - m_hoveredAnnotation = annotation; + m_hoveredAnnotations = annotations; - if (annotation) + if (annotations.size()) { - MessageFocusIn(annotation->tokenId).dispatch(); + std::vector tokenIds; + for (const Annotation* annotation : annotations) + { + tokenIds.push_back(annotation->tokenId); + } + + MessageFocusIn(tokenIds).dispatch(); } } diff --git a/src/app/qt/element/QtCodeArea.h b/src/app/qt/element/QtCodeArea.h index 97110d21..d95511dc 100644 --- a/src/app/qt/element/QtCodeArea.h +++ b/src/app/qt/element/QtCodeArea.h @@ -130,13 +130,13 @@ private: std::string fill; }; - const Annotation* findAnnotationForPosition(int pos) const; std::vector findLocationIdsForPosition(int pos) const; + std::vector getAnnotationsForPosition(int pos) const; void createAnnotations(std::shared_ptr locationFile); void annotateText(); - void setHoveredAnnotation(const Annotation* annotation); + void setHoveredAnnotations(const std::vector& annotations); int toTextEditPosition(int lineNumber, int columnNumber) const; std::pair toLineColumn(int textEditPosition) const; @@ -144,8 +144,8 @@ private: int endTextEditPosition() const; std::set getActiveLineNumbers() const; - std::vector getCursorRectsForAnnotation(const Annotation& annotation) const; + std::vector getCursorRectsForAnnotation(const Annotation& annotation) const; const AnnotationColor& getAnnotationColorForAnnotation(const Annotation& annotation); void createActions(); @@ -162,9 +162,7 @@ private: std::shared_ptr m_locationFile; std::vector m_annotations; - - const Annotation* m_hoveredAnnotation; - std::vector m_hoveredLocationIds; + std::vector m_hoveredAnnotations; int m_digits; int m_panningValue; // just for horizontal panning diff --git a/src/app/qt/element/QtCodeFile.cpp b/src/app/qt/element/QtCodeFile.cpp index 30fa6fc2..1e6e7ac6 100644 --- a/src/app/qt/element/QtCodeFile.cpp +++ b/src/app/qt/element/QtCodeFile.cpp @@ -124,16 +124,16 @@ std::string QtCodeFile::getFileName() const return m_filePath.fileName(); } -Id QtCodeFile::getFocusedTokenId() const -{ - return m_parent->getFocusedTokenId(); -} - const std::vector& QtCodeFile::getActiveTokenIds() const { return m_parent->getActiveTokenIds(); } +const std::vector& QtCodeFile::getFocusedTokenIds() const +{ + return m_parent->getFocusedTokenIds(); +} + const std::vector& QtCodeFile::getErrorMessages() const { return m_parent->getErrorMessages(); diff --git a/src/app/qt/element/QtCodeFile.h b/src/app/qt/element/QtCodeFile.h index bde81574..013e5a56 100644 --- a/src/app/qt/element/QtCodeFile.h +++ b/src/app/qt/element/QtCodeFile.h @@ -35,8 +35,9 @@ public: const FilePath& getFilePath() const; std::string getFileName() const; - Id getFocusedTokenId() const; + const std::vector& getActiveTokenIds() const; + const std::vector& getFocusedTokenIds() const; const std::vector& getErrorMessages() const; void addCodeSnippet( diff --git a/src/app/qt/element/QtCodeFileList.cpp b/src/app/qt/element/QtCodeFileList.cpp index 9f191603..2e2ff24a 100644 --- a/src/app/qt/element/QtCodeFileList.cpp +++ b/src/app/qt/element/QtCodeFileList.cpp @@ -12,7 +12,6 @@ QtCodeFileList::QtCodeFileList(QWidget* parent) : QScrollArea(parent) - , m_focusedTokenId(0) { setObjectName("code_file_list_base"); @@ -77,11 +76,6 @@ void QtCodeFileList::clearCodeSnippets() this->verticalScrollBar()->setValue(0); } -Id QtCodeFileList::getFocusedTokenId() const -{ - return m_focusedTokenId; -} - const std::vector& QtCodeFileList::getActiveTokenIds() const { return m_activeTokenIds; @@ -92,6 +86,16 @@ void QtCodeFileList::setActiveTokenIds(const std::vector& activeTokenIds) m_activeTokenIds = activeTokenIds; } +const std::vector& QtCodeFileList::getFocusedTokenIds() const +{ + return m_focusedTokenIds; +} + +void QtCodeFileList::setFocusedTokenIds(const std::vector& focusedTokenIds) +{ + m_focusedTokenIds = focusedTokenIds; +} + const std::vector& QtCodeFileList::getErrorMessages() const { return m_errorMessages; @@ -136,15 +140,15 @@ void QtCodeFileList::expandActiveSnippetFile() } } -void QtCodeFileList::focusToken(Id tokenId) +void QtCodeFileList::focusTokenIds(const std::vector& focusedTokenIds) { - m_focusedTokenId = tokenId; + setFocusedTokenIds(focusedTokenIds); updateFiles(); } -void QtCodeFileList::defocusToken() +void QtCodeFileList::defocusTokenIds() { - m_focusedTokenId = 0; + setFocusedTokenIds(std::vector()); updateFiles(); } diff --git a/src/app/qt/element/QtCodeFileList.h b/src/app/qt/element/QtCodeFileList.h index 9a369026..c68cb5a8 100644 --- a/src/app/qt/element/QtCodeFileList.h +++ b/src/app/qt/element/QtCodeFileList.h @@ -42,19 +42,20 @@ public: void clearCodeSnippets(); - Id getFocusedTokenId() const; - const std::vector& getActiveTokenIds() const; void setActiveTokenIds(const std::vector& activeTokenIds); + const std::vector& getFocusedTokenIds() const; + void setFocusedTokenIds(const std::vector& focusedTokenIds); + const std::vector& getErrorMessages() const; void setErrorMessages(const std::vector& errorMessages); bool scrollToFirstActiveSnippet(); void expandActiveSnippetFile(); - void focusToken(Id tokenId); - void defocusToken(); + void focusTokenIds(const std::vector& focusedTokenIds); + void defocusTokenIds(); private slots: void scrollToSnippet(QWidget* widget); @@ -69,8 +70,8 @@ private: std::shared_ptr m_frame; std::vector> m_files; - Id m_focusedTokenId; std::vector m_activeTokenIds; + std::vector m_focusedTokenIds; std::vector m_errorMessages; }; diff --git a/src/app/qt/view/QtCodeView.cpp b/src/app/qt/view/QtCodeView.cpp index 2a8422af..0dcdc242 100644 --- a/src/app/qt/view/QtCodeView.cpp +++ b/src/app/qt/view/QtCodeView.cpp @@ -15,8 +15,8 @@ QtCodeView::QtCodeView(ViewLayout* viewLayout) , m_addCodeSnippetsFunctor(std::bind(&QtCodeView::doAddCodeSnippets, this, std::placeholders::_1)) , m_showCodeFileFunctor(std::bind(&QtCodeView::doShowCodeFile, this, std::placeholders::_1)) , m_doShowFirstActiveSnippetFunctor(std::bind(&QtCodeView::doShowFirstActiveSnippet, this)) - , m_focusTokenFunctor(std::bind(&QtCodeView::doFocusToken, this, std::placeholders::_1)) - , m_defocusTokenFunctor(std::bind(&QtCodeView::doDefocusToken, this)) + , m_focusTokenIdsFunctor(std::bind(&QtCodeView::doFocusTokenIds, this, std::placeholders::_1)) + , m_defocusTokenIdsFunctor(std::bind(&QtCodeView::doDefocusTokenIds, this)) { m_widget = new QtCodeFileList(); setStyleSheet(); @@ -70,14 +70,14 @@ void QtCodeView::showFirstActiveSnippet() m_doShowFirstActiveSnippetFunctor(); } -void QtCodeView::focusToken(const Id tokenId) +void QtCodeView::focusTokenIds(const std::vector& focusedTokenIds) { - m_focusTokenFunctor(tokenId); + m_focusTokenIdsFunctor(focusedTokenIds); } -void QtCodeView::defocusToken() +void QtCodeView::defocusTokenIds() { - m_defocusTokenFunctor(); + m_defocusTokenIdsFunctor(); } void QtCodeView::doRefreshView() @@ -151,14 +151,14 @@ void QtCodeView::doShowFirstActiveSnippet() } } -void QtCodeView::doFocusToken(const Id tokenId) +void QtCodeView::doFocusTokenIds(const std::vector& focusedTokenIds) { - m_widget->focusToken(tokenId); + m_widget->focusTokenIds(focusedTokenIds); } -void QtCodeView::doDefocusToken() +void QtCodeView::doDefocusTokenIds() { - m_widget->defocusToken(); + m_widget->defocusTokenIds(); } void QtCodeView::setStyleSheet() const diff --git a/src/app/qt/view/QtCodeView.h b/src/app/qt/view/QtCodeView.h index d1b5b468..4f343637 100644 --- a/src/app/qt/view/QtCodeView.h +++ b/src/app/qt/view/QtCodeView.h @@ -35,8 +35,8 @@ public: virtual void showFirstActiveSnippet(); - virtual void focusToken(const Id tokenId); - virtual void defocusToken(); + virtual void focusTokenIds(const std::vector& focusedTokenIds); + virtual void defocusTokenIds(); private: void doRefreshView(); @@ -47,8 +47,8 @@ private: void doShowFirstActiveSnippet(); - void doFocusToken(const Id tokenId); - void doDefocusToken(); + void doFocusTokenIds(const std::vector& focusedTokenIds); + void doDefocusTokenIds(); void setStyleSheet() const; @@ -57,8 +57,8 @@ private: QtThreadedFunctor&> m_addCodeSnippetsFunctor; QtThreadedFunctor m_showCodeFileFunctor; QtThreadedFunctor<> m_doShowFirstActiveSnippetFunctor; - QtThreadedFunctor m_focusTokenFunctor; - QtThreadedFunctor<> m_defocusTokenFunctor; + QtThreadedFunctor&> m_focusTokenIdsFunctor; + QtThreadedFunctor<> m_defocusTokenIdsFunctor; QtCodeFileList* m_widget; diff --git a/src/app/qt/view/QtGraphView.cpp b/src/app/qt/view/QtGraphView.cpp index fd6ddaee..bb529c66 100644 --- a/src/app/qt/view/QtGraphView.cpp +++ b/src/app/qt/view/QtGraphView.cpp @@ -601,50 +601,56 @@ void QtGraphView::createTransition() m_transition->start(); } -void QtGraphView::focusToken(Id tokenId) +void QtGraphView::focusTokenIds(const std::vector& focusedTokenIds) { - m_focusInFunctor(tokenId); + m_focusInFunctor(focusedTokenIds); } -void QtGraphView::doFocusIn(Id tokenId) +void QtGraphView::doFocusIn(const std::vector& tokenIds) { - std::shared_ptr node = findNodeRecursive(m_oldNodes, tokenId); - if (node && node->isDataNode()) + for (const Id& tokenId : tokenIds) { - node->focusIn(); - return; - } - - for (std::shared_ptr edge : m_oldEdges) - { - if (edge->getData() && edge->getData()->getId() == tokenId) + std::shared_ptr node = findNodeRecursive(m_oldNodes, tokenId); + if (node && node->isDataNode()) { - edge->focusIn(); - return; + node->focusIn(); + continue; + } + + for (std::shared_ptr edge : m_oldEdges) + { + if (edge->getData() && edge->getData()->getId() == tokenId) + { + edge->focusIn(); + break; + } } } } -void QtGraphView::defocusToken(Id tokenId) +void QtGraphView::defocusTokenIds(const std::vector& defocusedTokenIds) { - m_focusOutFunctor(tokenId); + m_focusOutFunctor(defocusedTokenIds); } -void QtGraphView::doFocusOut(Id tokenId) +void QtGraphView::doFocusOut(const std::vector& tokenIds) { - std::shared_ptr node = findNodeRecursive(m_oldNodes, tokenId); - if (node && node->isDataNode()) + for (const Id& tokenId : tokenIds) { - node->focusOut(); - return; - } - - for (std::shared_ptr edge : m_oldEdges) - { - if (edge->getData() && edge->getData()->getId() == tokenId) + std::shared_ptr node = findNodeRecursive(m_oldNodes, tokenId); + if (node && node->isDataNode()) { - edge->focusOut(); - return; + node->focusOut(); + continue; + } + + for (std::shared_ptr edge : m_oldEdges) + { + if (edge->getData() && edge->getData()->getId() == tokenId) + { + edge->focusOut(); + break; + } } } } diff --git a/src/app/qt/view/QtGraphView.h b/src/app/qt/view/QtGraphView.h index 4d2dc387..38b799c9 100644 --- a/src/app/qt/view/QtGraphView.h +++ b/src/app/qt/view/QtGraphView.h @@ -51,8 +51,8 @@ public: virtual void rebuildGraph(std::shared_ptr graph, const std::vector& nodes, const std::vector& edges); virtual void clear(); - virtual void focusToken(Id tokenId); - virtual void defocusToken(Id tokenId); + virtual void focusTokenIds(const std::vector& focusedTokenIds); + virtual void defocusTokenIds(const std::vector& defocusedTokenIds); virtual void resizeView(); @@ -72,8 +72,9 @@ private: void doClear(); void doResize(); void doRefreshView(); - void doFocusIn(Id tokenId); - void doFocusOut(Id tokeId); + + void doFocusIn(const std::vector& tokenIds); + void doFocusOut(const std::vector& tokenIds); std::shared_ptr findNodeRecursive(const std::list>& nodes, Id tokenId); @@ -97,8 +98,8 @@ private: QtThreadedFunctor m_clearFunctor; QtThreadedFunctor m_resizeFunctor; QtThreadedFunctor m_refreshFunctor; - QtThreadedFunctor m_focusInFunctor; - QtThreadedFunctor m_focusOutFunctor; + QtThreadedFunctor&> m_focusInFunctor; + QtThreadedFunctor&> m_focusOutFunctor; std::shared_ptr m_graph; std::shared_ptr m_oldGraph; diff --git a/src/app/qt/view/graphElements/QtGraphEdge.cpp b/src/app/qt/view/graphElements/QtGraphEdge.cpp index c7fd3d49..9bd9d1da 100644 --- a/src/app/qt/view/graphElements/QtGraphEdge.cpp +++ b/src/app/qt/view/graphElements/QtGraphEdge.cpp @@ -204,7 +204,7 @@ void QtGraphEdge::hoverEnterEvent(QGraphicsSceneHoverEvent* event) return; } - MessageFocusIn(getData()->getId()).dispatch(); + MessageFocusIn(std::vector(1, getData()->getId())).dispatch(); } void QtGraphEdge::hoverLeaveEvent(QGraphicsSceneHoverEvent* event) @@ -215,7 +215,7 @@ void QtGraphEdge::hoverLeaveEvent(QGraphicsSceneHoverEvent* event) return; } - MessageFocusOut(getData()->getId()).dispatch(); + MessageFocusOut(std::vector(1, getData()->getId())).dispatch(); } void QtGraphEdge::setDirection(TokenComponentAggregation::Direction direction) diff --git a/src/app/qt/view/graphElements/QtGraphNodeData.cpp b/src/app/qt/view/graphElements/QtGraphNodeData.cpp index 7d25be30..2ba3c873 100644 --- a/src/app/qt/view/graphElements/QtGraphNodeData.cpp +++ b/src/app/qt/view/graphElements/QtGraphNodeData.cpp @@ -71,10 +71,10 @@ void QtGraphNodeData::updateStyle() void QtGraphNodeData::hoverEnterEvent(QGraphicsSceneHoverEvent* event) { - MessageFocusIn(m_data->getId()).dispatch(); + MessageFocusIn(std::vector(1, m_data->getId())).dispatch(); } void QtGraphNodeData::hoverLeaveEvent(QGraphicsSceneHoverEvent* event) { - MessageFocusOut(m_data->getId()).dispatch(); + MessageFocusOut(std::vector(1, m_data->getId())).dispatch(); } diff --git a/src/lib/component/controller/CodeController.cpp b/src/lib/component/controller/CodeController.cpp index 73ad2e1f..f3ad6981 100644 --- a/src/lib/component/controller/CodeController.cpp +++ b/src/lib/component/controller/CodeController.cpp @@ -80,12 +80,12 @@ void CodeController::handleMessage(MessageActivateTokens* message) void CodeController::handleMessage(MessageFocusIn* message) { - getView()->focusToken(message->tokenId); + getView()->focusTokenIds(message->tokenIds); } void CodeController::handleMessage(MessageFocusOut* message) { - getView()->defocusToken(); + getView()->defocusTokenIds(); } void CodeController::handleMessage(MessageShowErrors* message) @@ -268,7 +268,7 @@ std::vector CodeController::getSnippetsForFile(std: } ); atomicRanges = SnippetMerger::Range::mergeAdjacent(atomicRanges); - + ranges = fileScopedMerger.merge(atomicRanges); } diff --git a/src/lib/component/controller/GraphController.cpp b/src/lib/component/controller/GraphController.cpp index 3f0f227a..e2ff4d05 100644 --- a/src/lib/component/controller/GraphController.cpp +++ b/src/lib/component/controller/GraphController.cpp @@ -61,12 +61,12 @@ void GraphController::handleMessage(MessageFlushUpdates* message) void GraphController::handleMessage(MessageFocusIn* message) { - getView()->focusToken(message->tokenId); + getView()->focusTokenIds(message->tokenIds); } void GraphController::handleMessage(MessageFocusOut *message) { - getView()->defocusToken(message->tokenId); + getView()->defocusTokenIds(message->tokenIds); } void GraphController::handleMessage(MessageGraphNodeBundleSplit* message) diff --git a/src/lib/component/view/CodeView.h b/src/lib/component/view/CodeView.h index 413342ca..98e85acb 100644 --- a/src/lib/component/view/CodeView.h +++ b/src/lib/component/view/CodeView.h @@ -52,8 +52,8 @@ public: virtual void showFirstActiveSnippet() = 0; - virtual void focusToken(const Id tokenId) = 0; - virtual void defocusToken() = 0; + virtual void focusTokenIds(const std::vector& focusedTokenIds) = 0; + virtual void defocusTokenIds() = 0; private: CodeController* getController(); diff --git a/src/lib/component/view/GraphView.h b/src/lib/component/view/GraphView.h index ca96fc84..7ccaa00b 100644 --- a/src/lib/component/view/GraphView.h +++ b/src/lib/component/view/GraphView.h @@ -20,8 +20,9 @@ public: virtual void rebuildGraph( std::shared_ptr graph, const std::vector& nodes, const std::vector& edges) = 0; virtual void clear() = 0; - virtual void focusToken(Id tokenId) = 0; - virtual void defocusToken(Id tokenId) = 0; + + virtual void focusTokenIds(const std::vector& focusedTokenIds) = 0; + virtual void defocusTokenIds(const std::vector& defocusedTokenIds) = 0; virtual void resizeView() = 0; diff --git a/src/lib/utility/messaging/type/MessageFocusIn.h b/src/lib/utility/messaging/type/MessageFocusIn.h index ffed96bd..70ed99c1 100644 --- a/src/lib/utility/messaging/type/MessageFocusIn.h +++ b/src/lib/utility/messaging/type/MessageFocusIn.h @@ -1,23 +1,26 @@ #ifndef MESSAGE_FOCUS_IN_H #define MESSAGE_FOCUS_IN_H +#include + #include "utility/messaging/Message.h" #include "utility/types.h" -class MessageFocusIn : public Message +class MessageFocusIn + : public Message { public: - MessageFocusIn(Id tokenId) - : tokenId(tokenId) - { - } + MessageFocusIn(const std::vector& tokenIds) + : tokenIds(tokenIds) + { + } - static const std::string getStaticType() - { - return "MessageFocusIn"; - } + static const std::string getStaticType() + { + return "MessageFocusIn"; + } - const Id tokenId; + const std::vector tokenIds; }; #endif //MESSAGE_FOCUS_IN_H diff --git a/src/lib/utility/messaging/type/MessageFocusOut.h b/src/lib/utility/messaging/type/MessageFocusOut.h index 411c8e08..2ab89e0d 100644 --- a/src/lib/utility/messaging/type/MessageFocusOut.h +++ b/src/lib/utility/messaging/type/MessageFocusOut.h @@ -1,23 +1,26 @@ #ifndef MESSAGE_FOCUS_OUT_H #define MESSAGE_FOCUS_OUT_H +#include + #include "utility/messaging/Message.h" #include "utility/types.h" -class MessageFocusOut : public Message +class MessageFocusOut + : public Message { public: - MessageFocusOut(Id tokenId) - : tokenId(tokenId) - { - } + MessageFocusOut(const std::vector& tokenIds) + : tokenIds(tokenIds) + { + } - static const std::string getStaticType() - { - return "MessageHoverLeave"; - } + static const std::string getStaticType() + { + return "MessageHoverLeave"; + } - const Id tokenId; + const std::vector tokenIds; }; #endif //MESSAGE_FOCUS_OUT_H