26#include <giomm/appinfo.h>
27#include <gtkmm/window.h>
44 _canvas = std::make_unique<Inkscape::UI::Widget::Canvas>();
65 if (is<SPGroup>(obj) && !is<SPAnchor>(obj)) {
66 cast_unsafe<SPGroup>(obj)->setLayerDisplayMode(dkey,
SPGroup::LAYER);
88 SP_ITEM_SHOW_DISPLAY);
111 std::cerr <<
"SVGViewWidget::size_allocate: negative dimensions!" << std::endl;
129 auto const spanchor = drawing_item ? cast<SPAnchor>(drawing_item->
getItem()) :
nullptr;
130 auto const href = spanchor ? spanchor->href :
nullptr;
134 if (
event.num_press == 1 &&
event.button == 1) {
143 Gio::AppInfo::launch_default_for_uri(href);
149 set_cursor(
"pointer");
150 set_tooltip_text(href);
155 set_cursor(Glib::RefPtr<Gdk::Cursor>{});
156 set_tooltip_text(
"");
168 std::cerr <<
"SVGViewWidget::doRescale: No document!" << std::endl;
173 std::cerr <<
"SVGViewWidget::doRescale: Width too small!" << std::endl;
178 std::cerr <<
"SVGViewWidget::doRescale: Height too small!" << std::endl;
182 double x_offset = 0.0;
183 double y_offset = 0.0;
Two-dimensional point that doubles as a vector.
Inkscape::Drawing * get_drawing()
sigc::connection connect_drawing_event(sigc::slot< bool(CanvasEvent const &, Inkscape::DrawingItem *)> slot)
SVG drawing item for display.
void prependChild(DrawingItem *item)
void setCursorTolerance(double tol)
double value(Unit const *u) const
Return the quantity's value in the specified unit.
Typed SVG document implementation.
SPRoot * getRoot()
Returns our SPRoot.
Inkscape::Util::Quantity getWidth() const
Inkscape::Util::Quantity getHeight() const
Inkscape::DrawingItem * invoke_show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags)
void invoke_hide(unsigned int key)
SPObject is an abstract base class of all of the document nodes at the SVG document level.
static void set_layer_modes(SPObject *obj, unsigned dkey)
static void set_expand(Gtk::Widget &widget, Gtk::Orientation const orientation, bool const expand)
void inspect_event(E &&event, Fs... funcs)
Perform pattern-matching on a CanvasEvent.
Some things pertinent to all visible shapes: SPItem, SPItemView, SPItemCtx.
SPRoot: SVG <svg> implementation.
Abstract base class for events.
The pointer has entered a widget or item.
The pointer has exited a widget or item.
Movement of the mouse pointer.