summaryrefslogtreecommitdiffstats
path: root/src/display
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-12-15 16:19:28 +0000
committerKrzysztof Kosiński <tweenk.pl@gmail.com>2010-12-15 16:19:28 +0000
commit70201e92aa1e700d49279871f2b84082750b8ed8 (patch)
tree1886fcdf8ad20d73b92bf4f4bfd3ab1406ba4c66 /src/display
parentFix mask luminance calculation, so the coeffs add up to 1 (diff)
parentWin32 post-GSoC fixups. (diff)
downloadinkscape-70201e92aa1e700d49279871f2b84082750b8ed8.tar.gz
inkscape-70201e92aa1e700d49279871f2b84082750b8ed8.zip
Merge from trunk (again)
(bzr r9508.1.72)
Diffstat (limited to 'src/display')
-rw-r--r--src/display/canvas-grid.cpp12
-rw-r--r--src/display/nr-arena-item.cpp1
-rw-r--r--src/display/nr-filter-image.cpp13
3 files changed, 16 insertions, 10 deletions
diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp
index 6c51acea8..86897baaa 100644
--- a/src/display/canvas-grid.cpp
+++ b/src/display/canvas-grid.cpp
@@ -3,6 +3,7 @@
*/
/* Copyright (C) Johan Engelen 2006-2007 <johan@shouraizou.nl>
* Copyright (C) Lauris Kaplinski 2000
+ * Abhishek Sharma
*/
/* As a general comment, I am not exactly proud of how things are done.
@@ -11,9 +12,10 @@
* Don't be shy to correct things.
*/
-#define INKSCAPE_CANVAS_GRID_C
-
#include "desktop.h"
+#include "sp-canvas-util.h"
+#include "util/mathfns.h"
+#include "display-forward.h"
#include "desktop-handles.h"
#include "display/cairo-utils.h"
#include "display/canvas-axonomgrid.h"
@@ -30,6 +32,8 @@
#include "util/mathfns.h"
#include "xml/node-event-vector.h"
+using Inkscape::DocumentUndo;
+
namespace Inkscape {
static gchar const *const grid_name[] = {
@@ -244,7 +248,7 @@ CanvasGrid::writeNewGridToRepr(Inkscape::XML::Node * repr, SPDocument * doc, Gri
// first create the child xml node, then hook it to repr. This order is important, to not set off listeners to repr before the new node is complete.
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc);
+ Inkscape::XML::Document *xml_doc = doc->getReprDoc();
Inkscape::XML::Node *newnode;
newnode = xml_doc->createElement("inkscape:grid");
newnode->setAttribute("type", getSVGName(gridtype));
@@ -252,7 +256,7 @@ CanvasGrid::writeNewGridToRepr(Inkscape::XML::Node * repr, SPDocument * doc, Gri
repr->appendChild(newnode);
Inkscape::GC::release(newnode);
- sp_document_done(doc, SP_VERB_DIALOG_NAMEDVIEW, _("Create new grid"));
+ DocumentUndo::done(doc, SP_VERB_DIALOG_NAMEDVIEW, _("Create new grid"));
}
/*
diff --git a/src/display/nr-arena-item.cpp b/src/display/nr-arena-item.cpp
index c4c42b8b5..a2a959415 100644
--- a/src/display/nr-arena-item.cpp
+++ b/src/display/nr-arena-item.cpp
@@ -492,7 +492,6 @@ nr_arena_item_invoke_render (cairo_t *ct, NRArenaItem *item, NRRectL const *area
if (mask) {
cairo_mask(ct, mask->cobj());
// opacity of masked objects is handled by premultiplying the mask
-
} else {
// opacity of non-masked objects must be rendered explicitly
if (needs_opacity) {
diff --git a/src/display/nr-filter-image.cpp b/src/display/nr-filter-image.cpp
index eae25c8cd..ca361e007 100644
--- a/src/display/nr-filter-image.cpp
+++ b/src/display/nr-filter-image.cpp
@@ -4,6 +4,7 @@
* Authors:
* Felipe Corrêa da Silva Sanches <juca@members.fsf.org>
* Tavmjong Bah <tavmjong@free.fr>
+ * Abhishek Sharma
*
* Copyright (C) 2007 authors
*
@@ -69,13 +70,15 @@ void FilterImage::render_cairo(FilterSlot &slot)
// TODO: do not recreate the rendering tree every time
// TODO: the entire thing is a hack, we should give filter primitives an "update" method
// like the one for NRArenaItems
- sp_document_ensure_up_to_date(document);
+ document->ensureUpToDate();
+
NRArena* arena = NRArena::create();
Geom::OptRect optarea = SVGElem->getBounds(Geom::identity());
if (!optarea) return;
- unsigned const key = sp_item_display_key_new(1);
- NRArenaItem* ai = sp_item_invoke_show(SVGElem, arena, key, SP_ITEM_SHOW_DISPLAY);
+ unsigned const key = SPItem::display_key_new(1);
+ NRArenaItem* ai = SVGElem->invoke_show(arena, key, SP_ITEM_SHOW_DISPLAY);
+
if (!ai) {
g_warning("feImage renderer: error creating NRArenaItem for SVG Element");
nr_object_unref((NRObject *) arena);
@@ -113,7 +116,7 @@ void FilterImage::render_cairo(FilterSlot &slot)
NR_ARENA_ITEM_STATE_ALL,
NR_ARENA_ITEM_STATE_NONE);
nr_arena_item_invoke_render(ct, ai, &render_rect, NULL, NR_ARENA_ITEM_RENDER_NO_CACHE);
- sp_item_invoke_hide(SVGElem, key);
+ SVGElem->invoke_hide(key);
nr_object_unref((NRObject*) arena);
slot.set(_output, out);
@@ -135,7 +138,7 @@ void FilterImage::render_cairo(FilterSlot &slot)
if ( !g_file_test( fullname, G_FILE_TEST_EXISTS ) ) {
// Try to load from relative postion combined with document base
if( document ) {
- fullname = g_build_filename( document->base, feImageHref, NULL );
+ fullname = g_build_filename( document->getBase(), feImageHref, NULL );
}
}
if ( !g_file_test( fullname, G_FILE_TEST_EXISTS ) ) {