From ab143333746e25648b253f13c0539adff089b1b6 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Fri, 24 Jun 2011 00:22:07 +0200 Subject: Remove more of libnr (bzr r10347.1.2) --- src/svg-view.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/svg-view.cpp') diff --git a/src/svg-view.cpp b/src/svg-view.cpp index b35375736..44c874150 100644 --- a/src/svg-view.cpp +++ b/src/svg-view.cpp @@ -13,6 +13,7 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include <2geom/transforms.h> #include "display/canvas-arena.h" #include "document.h" #include "sp-item.h" -- cgit v1.2.3 From 0ef9a2a418fa95af850ce36fb469676c86464296 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Mon, 27 Jun 2011 20:57:12 +0200 Subject: Inkview. Fix for bug #771365 (Inkview rendering with incorrect scaling when slide showing multiple files). (bzr r10376) --- src/svg-view.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/svg-view.cpp') diff --git a/src/svg-view.cpp b/src/svg-view.cpp index b35375736..5deff7421 100644 --- a/src/svg-view.cpp +++ b/src/svg-view.cpp @@ -198,6 +198,8 @@ SPSVGView::setDocument (SPDocument *document) g_signal_connect (G_OBJECT (_drawing), "arena_event", G_CALLBACK (arena_handler), this); } + View::setDocument (document); + if (document) { NRArenaItem *ai = SP_ITEM( document->getRoot() )->invoke_show( SP_CANVAS_ARENA (_drawing)->arena, @@ -210,8 +212,6 @@ SPSVGView::setDocument (SPDocument *document) doRescale (!_rescale); } - - View::setDocument (document); } /** -- cgit v1.2.3 From 2be2cf32db0668dc64512a98f6c2394152bd10cc Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sat, 16 Jul 2011 00:42:39 -0700 Subject: Cleanup of oudated/redundant SP_ITEM() macro use. (bzr r10461) --- src/svg-view.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/svg-view.cpp') diff --git a/src/svg-view.cpp b/src/svg-view.cpp index 03056de2e..2f1a20b82 100644 --- a/src/svg-view.cpp +++ b/src/svg-view.cpp @@ -18,7 +18,7 @@ #include "document.h" #include "sp-item.h" #include "svg-view.h" - +#include "sp-root.h" /** * Constructs new SPSVGView object and returns pointer to it. @@ -41,7 +41,7 @@ SPSVGView::~SPSVGView() { if (doc() && _drawing) { - SP_ITEM( doc()->getRoot() )->invoke_hide(_dkey); + doc()->getRoot()->invoke_hide(_dkey); _drawing = NULL; } } @@ -191,7 +191,7 @@ void SPSVGView::setDocument (SPDocument *document) { if (doc()) { - SP_ITEM( doc()->getRoot() )->invoke_hide(_dkey); + doc()->getRoot()->invoke_hide(_dkey); } if (!_drawing) { @@ -202,7 +202,7 @@ SPSVGView::setDocument (SPDocument *document) View::setDocument (document); if (document) { - NRArenaItem *ai = SP_ITEM( document->getRoot() )->invoke_show( + NRArenaItem *ai = document->getRoot()->invoke_show( SP_CANVAS_ARENA (_drawing)->arena, _dkey, SP_ITEM_SHOW_DISPLAY); -- cgit v1.2.3 From 4dd33aa4d5c57706c7f64f63391174954160a308 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 6 Aug 2011 14:18:32 +0200 Subject: Rewrite NRArenaItem hierarchy into C++ (bzr r10347.1.21) --- src/svg-view.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/svg-view.cpp') diff --git a/src/svg-view.cpp b/src/svg-view.cpp index 2f1a20b82..3221ce146 100644 --- a/src/svg-view.cpp +++ b/src/svg-view.cpp @@ -15,6 +15,7 @@ #include <2geom/transforms.h> #include "display/canvas-arena.h" +#include "display/drawing-group.h" #include "document.h" #include "sp-item.h" #include "svg-view.h" @@ -129,13 +130,13 @@ SPSVGView::mouseout() */ /// \todo fixme. static gint -arena_handler (SPCanvasArena */*arena*/, NRArenaItem *ai, GdkEvent *event, SPSVGView *svgview) +arena_handler (SPCanvasArena */*arena*/, Inkscape::DrawingItem *ai, GdkEvent *event, SPSVGView *svgview) { static gdouble x, y; static gboolean active = FALSE; SPEvent spev; - SPItem *spitem = (ai) ? (SPItem*)NR_ARENA_ITEM_GET_DATA (ai) : 0; + SPItem *spitem = (ai) ? (SPItem*) ai->data() : 0; switch (event->type) { case GDK_BUTTON_PRESS: @@ -202,13 +203,13 @@ SPSVGView::setDocument (SPDocument *document) View::setDocument (document); if (document) { - NRArenaItem *ai = document->getRoot()->invoke_show( + Inkscape::DrawingItem *ai = document->getRoot()->invoke_show( SP_CANVAS_ARENA (_drawing)->arena, _dkey, SP_ITEM_SHOW_DISPLAY); if (ai) { - nr_arena_item_add_child (SP_CANVAS_ARENA (_drawing)->root, ai, NULL); + SP_CANVAS_ARENA (_drawing)->root->prependChild(ai); } doRescale (!_rescale); -- cgit v1.2.3 From 75976ea07dba9b97186667524d0a76603de416af Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 7 Aug 2011 12:53:12 +0200 Subject: Rewrite NRArena -> Inkscape::Drawing. Call render and update methods on the Drawing rather than on the root DrawingItem. (bzr r10347.1.25) --- src/svg-view.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/svg-view.cpp') diff --git a/src/svg-view.cpp b/src/svg-view.cpp index 3221ce146..8773dfab7 100644 --- a/src/svg-view.cpp +++ b/src/svg-view.cpp @@ -204,12 +204,12 @@ SPSVGView::setDocument (SPDocument *document) if (document) { Inkscape::DrawingItem *ai = document->getRoot()->invoke_show( - SP_CANVAS_ARENA (_drawing)->arena, + SP_CANVAS_ARENA (_drawing)->drawing, _dkey, SP_ITEM_SHOW_DISPLAY); if (ai) { - SP_CANVAS_ARENA (_drawing)->root->prependChild(ai); + SP_CANVAS_ARENA (_drawing)->drawing.root()->prependChild(ai); } doRescale (!_rescale); -- cgit v1.2.3 From 2633767789e4264b13ef91a684accf734fb4e94f Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Wed, 26 Oct 2011 21:55:51 -0700 Subject: Fixing more broken and split doc comments. (bzr r10697) --- src/svg-view.cpp | 61 +++++++++++++++++++------------------------------------- 1 file changed, 20 insertions(+), 41 deletions(-) (limited to 'src/svg-view.cpp') diff --git a/src/svg-view.cpp b/src/svg-view.cpp index 8773dfab7..6eca02d5c 100644 --- a/src/svg-view.cpp +++ b/src/svg-view.cpp @@ -1,5 +1,5 @@ -/** \file - * Functions and callbacks for generic SVG view and widget +/* + * Functions and callbacks for generic SVG view and widget. * * Authors: * Lauris Kaplinski @@ -21,10 +21,7 @@ #include "svg-view.h" #include "sp-root.h" -/** - * Constructs new SPSVGView object and returns pointer to it. - */ -SPSVGView::SPSVGView (SPCanvasGroup *parent) +SPSVGView::SPSVGView(SPCanvasGroup *parent) { _hscale = 1.0; _vscale = 1.0; @@ -47,11 +44,7 @@ SPSVGView::~SPSVGView() } } -/** - * Rescales SPSVGView to given proportions. - */ -void -SPSVGView::setScale (gdouble hscale, gdouble vscale) +void SPSVGView::setScale(gdouble hscale, gdouble vscale) { if (!_rescale && ((hscale != _hscale) || (vscale != _vscale))) { _hscale = hscale; @@ -60,12 +53,7 @@ SPSVGView::setScale (gdouble hscale, gdouble vscale) } } -/** - * Rescales SPSVGView and keeps aspect ratio. - */ -void -SPSVGView::setRescale -(bool rescale, bool keepaspect, gdouble width, gdouble height) +void SPSVGView::setRescale(bool rescale, bool keepaspect, gdouble width, gdouble height) { g_return_if_fail (!rescale || (width >= 0.0)); g_return_if_fail (!rescale || (height >= 0.0)); @@ -78,15 +66,17 @@ SPSVGView::setRescale doRescale (true); } -/** - * Helper function that sets rescale ratio and emits resize event. - */ -void -SPSVGView::doRescale (bool event) +void SPSVGView::doRescale(bool event) { - if (!doc()) return; - if (doc()->getWidth () < 1e-9) return; - if (doc()->getHeight () < 1e-9) return; + if (!doc()) { + return; + } + if (doc()->getWidth () < 1e-9) { + return; + } + if (doc()->getHeight () < 1e-9) { + return; + } if (_rescale) { _hscale = _width / doc()->getWidth (); @@ -110,16 +100,14 @@ SPSVGView::doRescale (bool event) } } -void -SPSVGView::mouseover() +void SPSVGView::mouseover() { GdkCursor *cursor = gdk_cursor_new(GDK_HAND2); gdk_window_set_cursor(GTK_WIDGET(SP_CANVAS_ITEM(_drawing)->canvas)->window, cursor); gdk_cursor_unref(cursor); } -void -SPSVGView::mouseout() +void SPSVGView::mouseout() { gdk_window_set_cursor(GTK_WIDGET(SP_CANVAS_ITEM(_drawing)->canvas)->window, NULL); } @@ -129,8 +117,7 @@ SPSVGView::mouseout() * Callback connected with arena_event. */ /// \todo fixme. -static gint -arena_handler (SPCanvasArena */*arena*/, Inkscape::DrawingItem *ai, GdkEvent *event, SPSVGView *svgview) +static gint arena_handler(SPCanvasArena */*arena*/, Inkscape::DrawingItem *ai, GdkEvent *event, SPSVGView *svgview) { static gdouble x, y; static gboolean active = FALSE; @@ -185,11 +172,7 @@ arena_handler (SPCanvasArena */*arena*/, Inkscape::DrawingItem *ai, GdkEvent *ev return TRUE; } -/** - * Callback connected with set_document signal. - */ -void -SPSVGView::setDocument (SPDocument *document) +void SPSVGView::setDocument(SPDocument *document) { if (doc()) { doc()->getRoot()->invoke_hide(_dkey); @@ -216,11 +199,7 @@ SPSVGView::setDocument (SPDocument *document) } } -/** - * Callback connected with document_resized signal. - */ -void -SPSVGView::onDocumentResized (gdouble width, gdouble height) +void SPSVGView::onDocumentResized(gdouble width, gdouble height) { setScale (width, height); doRescale (!_rescale); -- cgit v1.2.3