aboutsummaryrefslogtreecommitdiffstats
path: root/src/sandbox
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2009-01-02 14:29:30 +0000
committerJeremias Maerki <jeremias@apache.org>2009-01-02 14:29:30 +0000
commit01ceb0032ead03d9c35abeee9075dabc3702fc7f (patch)
tree024f667fa9fbd31a966c08a0dff5211123b113eb /src/sandbox
parent211330493a528d1793cc1b86ff9907ed16d1a16a (diff)
downloadxmlgraphics-fop-01ceb0032ead03d9c35abeee9075dabc3702fc7f.tar.gz
xmlgraphics-fop-01ceb0032ead03d9c35abeee9075dabc3702fc7f.zip
Introduced IFContext to provide access to foreign attributes (as discussed on fop-dev).
Removed the foreign attributes map from the drawImage methods as a consequence. Added support for foreign attributes on the page (PCL's paper-source and duplex-mode extensions). Fixed a couple of bugs parsing the document navigation elements. Build-time test suite now runs through. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign@730740 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/sandbox')
-rw-r--r--src/sandbox/org/apache/fop/render/svg/SVGDocumentHandlerMaker.java3
-rw-r--r--src/sandbox/org/apache/fop/render/svg/SVGPainter.java11
-rw-r--r--src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandlerMaker.java3
3 files changed, 10 insertions, 7 deletions
diff --git a/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandlerMaker.java b/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandlerMaker.java
index 0296135fd..c24a5af61 100644
--- a/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandlerMaker.java
+++ b/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandlerMaker.java
@@ -21,6 +21,7 @@ package org.apache.fop.render.svg;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.render.intermediate.AbstractIFDocumentHandlerMaker;
+import org.apache.fop.render.intermediate.IFContext;
import org.apache.fop.render.intermediate.IFDocumentHandler;
import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator;
@@ -34,7 +35,7 @@ public class SVGDocumentHandlerMaker extends AbstractIFDocumentHandlerMaker {
/** {@inheritDoc} */
public IFDocumentHandler makeIFDocumentHandler(FOUserAgent ua) {
SVGDocumentHandler handler = new SVGDocumentHandler();
- handler.setUserAgent(ua);
+ handler.setContext(new IFContext(ua));
return handler;
}
diff --git a/src/sandbox/org/apache/fop/render/svg/SVGPainter.java b/src/sandbox/org/apache/fop/render/svg/SVGPainter.java
index df67971b8..e1626e6f9 100644
--- a/src/sandbox/org/apache/fop/render/svg/SVGPainter.java
+++ b/src/sandbox/org/apache/fop/render/svg/SVGPainter.java
@@ -44,13 +44,13 @@ import org.apache.xmlgraphics.image.loader.ImageSessionContext;
import org.apache.xmlgraphics.util.QName;
import org.apache.xmlgraphics.xmp.Metadata;
-import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.events.ResourceEventProducer;
import org.apache.fop.fo.extensions.ExtensionElementMapping;
import org.apache.fop.render.RenderingContext;
import org.apache.fop.render.intermediate.AbstractIFPainter;
import org.apache.fop.render.intermediate.IFConstants;
+import org.apache.fop.render.intermediate.IFContext;
import org.apache.fop.render.intermediate.IFException;
import org.apache.fop.render.intermediate.IFState;
import org.apache.fop.render.intermediate.IFUtil;
@@ -93,8 +93,8 @@ public class SVGPainter extends AbstractIFPainter implements SVGConstants {
}
/** {@inheritDoc} */
- protected FOUserAgent getUserAgent() {
- return parent.getUserAgent();
+ protected IFContext getContext() {
+ return parent.getContext();
}
/** {@inheritDoc} */
@@ -197,7 +197,7 @@ public class SVGPainter extends AbstractIFPainter implements SVGConstants {
= new QName(ExtensionElementMapping.URI, null, "conversion-mode");
/** {@inheritDoc} */
- public void drawImage(String uri, Rectangle rect, Map foreignAttributes) throws IFException {
+ public void drawImage(String uri, Rectangle rect) throws IFException {
try {
establish(MODE_NORMAL);
@@ -208,6 +208,7 @@ public class SVGPainter extends AbstractIFPainter implements SVGConstants {
info = manager.getImageInfo(uri, sessionContext);
String mime = info.getMimeType();
+ Map foreignAttributes = getContext().getForeignAttributes();
String conversionMode = (String)foreignAttributes.get(CONVERSION_MODE);
if ("reference".equals(conversionMode)
&& (MimeConstants.MIME_GIF.equals(mime)
@@ -245,7 +246,7 @@ public class SVGPainter extends AbstractIFPainter implements SVGConstants {
}
/** {@inheritDoc} */
- public void drawImage(Document doc, Rectangle rect, Map foreignAttributes) throws IFException {
+ public void drawImage(Document doc, Rectangle rect) throws IFException {
try {
establish(MODE_NORMAL);
diff --git a/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandlerMaker.java b/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandlerMaker.java
index 61993da13..8da7032aa 100644
--- a/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandlerMaker.java
+++ b/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandlerMaker.java
@@ -21,6 +21,7 @@ package org.apache.fop.render.svg;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.render.intermediate.AbstractIFDocumentHandlerMaker;
+import org.apache.fop.render.intermediate.IFContext;
import org.apache.fop.render.intermediate.IFDocumentHandler;
import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator;
@@ -34,7 +35,7 @@ public class SVGPrintDocumentHandlerMaker extends AbstractIFDocumentHandlerMaker
/** {@inheritDoc} */
public IFDocumentHandler makeIFDocumentHandler(FOUserAgent ua) {
SVGPrintDocumentHandler handler = new SVGPrintDocumentHandler();
- handler.setUserAgent(ua);
+ handler.setContext(new IFContext(ua));
return handler;
}