Code

Split SPCanvasItem and SPCanvasGroup to individual .h files. Removed forward header.
[inkscape.git] / src / svg-view.cpp
index 31b54b36d727d2a01b8ac6ca8e7a8e09d39c6644..b35375736131a32b6dda884cad0a182558a29551 100644 (file)
@@ -1,11 +1,11 @@
-#define __SP_SVG_VIEW_C__
-
 /** \file
  * Functions and callbacks for generic SVG view and widget
  *
  * Authors:
  *   Lauris Kaplinski <lauris@kaplinski.com>
  *   Ralf Stephan <ralf@ark.in-berlin.de>
+ *   Jon A. Cruz <jon@joncruz.org>
+ *   Abhishek Sharma
  *
  * Copyright (C) 2001-2002 Lauris Kaplinski
  * Copyright (C) 2001 Ximian, Inc.
@@ -14,7 +14,6 @@
  */
 
 #include "display/canvas-arena.h"
-#include "display/display-forward.h"
 #include "document.h"
 #include "sp-item.h"
 #include "svg-view.h"
@@ -41,7 +40,7 @@ SPSVGView::~SPSVGView()
 {
     if (doc() && _drawing)
     {
-        SP_ITEM (sp_document_root (doc()))->invoke_hide (_dkey);
+        SP_ITEM( doc()->getRoot() )->invoke_hide(_dkey);
         _drawing = NULL;
     }
 }
@@ -84,12 +83,12 @@ void
 SPSVGView::doRescale (bool event)
 {
     if (!doc()) return;
-    if (sp_document_width (doc()) < 1e-9) return;
-    if (sp_document_height (doc()) < 1e-9) return;
+    if (doc()->getWidth () < 1e-9) return;
+    if (doc()->getHeight () < 1e-9) return;
 
     if (_rescale) {
-        _hscale = _width / sp_document_width (doc());
-        _vscale = _height / sp_document_height (doc());
+        _hscale = _width / doc()->getWidth ();
+        _vscale = _height / doc()->getHeight ();
         if (_keepaspect) {
             if (_hscale > _vscale) {
                 _hscale = _vscale;
@@ -104,8 +103,8 @@ SPSVGView::doRescale (bool event)
     }
 
     if (event) {
-        emitResized (sp_document_width (doc()) * _hscale,
-                sp_document_height (doc()) * _vscale);
+        emitResized (doc()->getWidth () * _hscale,
+                doc()->getHeight () * _vscale);
     }
 }
 
@@ -191,7 +190,7 @@ void
 SPSVGView::setDocument (SPDocument *document)
 {
     if (doc()) {
-        SP_ITEM (sp_document_root (doc()))->invoke_hide (_dkey);
+        SP_ITEM( doc()->getRoot() )->invoke_hide(_dkey);
     }
 
     if (!_drawing) {
@@ -200,7 +199,7 @@ SPSVGView::setDocument (SPDocument *document)
     }
 
     if (document) {
-        NRArenaItem *ai = SP_ITEM (sp_document_root (document))->invoke_show (
+        NRArenaItem *ai = SP_ITEM( document->getRoot() )->invoke_show(
                 SP_CANVAS_ARENA (_drawing)->arena,
                 _dkey,
                 SP_ITEM_SHOW_DISPLAY);