You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by Apache Wiki <wi...@apache.org> on 2008/08/07 16:45:14 UTC

[Xmlgraphics-fop Wiki] Update of "AreaTreeIntermediateXml/NewDesign" by JeremiasMaerki

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Xmlgraphics-fop Wiki" for change notification.

The following page has been changed by JeremiasMaerki:
http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml/NewDesign

The comment on the change is:
Adjusted to reality and moved on to foreign objects

------------------------------------------------------------------------------
        [PDF bookmarks]
      </bookmarks>
    </header>
-   <page index="1" name="1">
+   <page index="1" name="1" width="595275" height="841889">
      <page-header>
        <ps:ps-setup-code>%FOPTestPSSetupCode: General setup code here!</ps:ps-setup-code>
      </page-header>
      <content>
-       <box transform="translate(5000, 6000)" width="18000" height="10000">
+       <viewport transform="translate(5000, 6000)" width="18000" height="10000">
          <font family="Helvetica" style="normal" weight="400" variant="normal" size="12000"
            color="black"/>
          <text x="1233" y="803" dx="0 0 20 0 0">Hello</text>
-         <draw-rect x="1233" y="1200" width="20000" height="20000" fill="yellow" stroke="none"/>
+         <rect x="1233" y="1200" width="20000" height="20000" fill="yellow" stroke="none"/>
-         <box transform="translate(1233, 1200)" width="20000" height="20000" clip="true">
+         <viewport transform="translate(1233, 1200)" width="20000" height="20000" clip-rect="0 0 20000 20000">
            <image xlink:href="myimage.svg" x="0" y="0" width="20000" height="20000"/>
-         </box>
-       </box>
+         </viewport>
+       </viewport>
        [..]
      </content>
    </page>
@@ -53, +53 @@

  </document>
  }}}
  
-  * box: pushes the graphics state on a stack and applies an optional transformation (SVG-style). This is mainly used for reference areas.
+  * viewport: pushes the graphics state on a stack and applies an optional transformation (SVG-style). This is mainly used for viewport/reference pairs.
   * image: in case of an instream-foreign-object, its content would simply be put in the image element's content instead of using xlink:href.
  
  == Other needed elements ==
@@ -109, +109 @@

      void addTarget(String name, int x, int y);
      void endPageTrailer();
  
+     //viewport: for viewport/reference pairs
-     void startBox(AffineTransform transform, Dimension size, boolean clip);
+     void startViewport(AffineTransform transform, Dimension size, Rectangle clipRect);
-     void startBox(AffineTransform[] transforms, Dimension size, boolean clip);
+     void startViewport(AffineTransform[] transforms, Dimension size, Rectangle clipRect);
      //For transform parsing, Batik's org.apache.batik.parser.TransformListHandler/Parser can be reused
-     void endBox();
+     void endViewport();
+ 
+     //group: for reference areas and explicit content grouping
+     void startGroup(AffineTransform transform);
+     void startGroup(AffineTransform[] transforms);
+     //For transform parsing, Batik's org.apache.batik.parser.TransformListHandler/Parser can be reused
+     void endViewport();
  
      void setFont(String family, String style, Integer weight, String variant, Integer size, String color);
      //All of setFont()'s parameters can be null if no state change is necessary
      void drawText(int x, int y, int[] dx, int[] dy, String text);
      void drawRect(Rectangle rect, Paint fill, Color stroke);
-     void drawImage(String uri, Rectangle rect); //external images
+     void drawImage(String uri, Rectangle rect, Map foreignAttributes); //external images
+     void drawImage(Document doc, String rootNamespace, Rectangle rect, Map foreignAttributes); //used for instream-foreign-objects
-     void startImage(Rectangle rect); //followed by a SAX stream (SVG etc.)
-     void endImage();
  
-     void handleExtensionObject();
+     void handleExtensionObject(Object extension);
      //etc. etc.
  }
  
@@ -142, +148 @@

      //convert IFPainter calls to XML (IF-NG)
  }
  
- public class IFContentHandler implements ContentHandler {
+ public class IFParser {
  
-     public IFContentHandler(IFPainter painter) {
+     public void parse(Source src, IFPainter painter, FOUserAgent userAgent)
+             throws TransformerException {
+     [..]
+     }
+ 
+     public ContentHandler getContentHandler(IFPainter painter, FOUserAgent userAgent) {
      [..]
  
      //convert SAX stream calls to IFPainter calls

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org