summaryrefslogtreecommitdiffstats
path: root/src/object/sp-anchor.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2018-12-03 14:12:58 +0000
committerTavmjong Bah <tavmjong@free.fr>2018-12-03 14:12:58 +0000
commitd0a70cf731c5d3e2698f62876a4acade0361bb8e (patch)
treeff8e35ffe8c44db6b28b8c29c108513307f057c7 /src/object/sp-anchor.cpp
parentUse std::unique_ptr for all MessageContext (diff)
downloadinkscape-d0a70cf731c5d3e2698f62876a4acade0361bb8e.tar.gz
inkscape-d0a70cf731c5d3e2698f62876a4acade0361bb8e.zip
Remove dependance of SVGViewWidget on SVGView and View. Remove SVGView.
Another step in making View not dependent on GUI.
Diffstat (limited to 'src/object/sp-anchor.cpp')
-rw-r--r--src/object/sp-anchor.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/object/sp-anchor.cpp b/src/object/sp-anchor.cpp
index d4361a4ef..544e2d3e9 100644
--- a/src/object/sp-anchor.cpp
+++ b/src/object/sp-anchor.cpp
@@ -20,7 +20,7 @@
#include "xml/repr.h"
#include "attributes.h"
#include "sp-anchor.h"
-#include "ui/view/svg-view.h"
+#include "ui/view/svg-view-widget.h"
#include "document.h"
SPAnchor::SPAnchor() : SPGroup() {
@@ -154,11 +154,13 @@ gchar* SPAnchor::description() const {
/* fixme: We should forward event to appropriate container/view */
/* The only use of SPEvent appears to be here, to change the cursor in Inkview when over a link (and
- * which hasn't worked since at least 0.48). */
-gint SPAnchor::event(SPEvent* event) {
+ * which hasn't worked since at least 0.48). GUI code should not be here. */
+int SPAnchor::event(SPEvent* event) {
+
switch (event->type) {
case SPEvent::ACTIVATE:
if (this->href) {
+ // If this actually worked, it could be useful to open a webpage with the link.
g_print("Activated xlink:href=\"%s\"\n", this->href);
return TRUE;
}
@@ -166,18 +168,16 @@ gint SPAnchor::event(SPEvent* event) {
case SPEvent::MOUSEOVER:
{
- auto view = dynamic_cast<Inkscape::UI::View::SVGView*>(event->view);
- if (view) {
- view->mouseover();
+ if (event->view) {
+ event->view->mouseover();
}
break;
}
case SPEvent::MOUSEOUT:
{
- auto view = dynamic_cast<Inkscape::UI::View::SVGView*>(event->view);
- if (view) {
- view->mouseout();
+ if (event->view) {
+ event->view->mouseout();
}
break;
}