xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vhenneb...@apache.org
Subject svn commit: r1343668 - in /xmlgraphics/fop/branches/Temp_TrueTypeInPostScript: ./ src/java/org/apache/fop/accessibility/ src/java/org/apache/fop/accessibility/fo/ src/java/org/apache/fop/afp/apps/ src/java/org/apache/fop/afp/parser/ src/java/org/apache...
Date Tue, 29 May 2012 11:13:03 GMT
Author: vhennebert
Date: Tue May 29 11:13:02 2012
New Revision: 1343668

URL: http://svn.apache.org/viewvc?rev=1343668&view=rev
Log:
Merged changes from trunk up to revision 1343632

Added:
    xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/accessibility/fo/artifact.fo
      - copied unchanged from r1343667, xmlgraphics/fop/trunk/test/java/org/apache/fop/accessibility/fo/artifact.fo
Modified:
    xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/   (props changed)
    xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/accessibility/Accessibility.java
    xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverter.java
    xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/afp/apps/ 
 (props changed)
    xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/afp/parser/
  (props changed)
    xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/fo/flow/Wrapper.java
    xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/util/ColorExt.java
  (props changed)
    xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java
    xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl
    xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/pdf/accessibility/pdf/role.pdf
    xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/pdf/accessibility/role.fo

Propchange: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/
------------------------------------------------------------------------------
  Merged /xmlgraphics/fop/trunk:r1343305-1343667

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/accessibility/Accessibility.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/accessibility/Accessibility.java?rev=1343668&r1=1343667&r2=1343668&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/accessibility/Accessibility.java
(original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/accessibility/Accessibility.java
Tue May 29 11:13:02 2012
@@ -28,6 +28,12 @@ public final class Accessibility {
     /** Constant string for the rendering options key to enable accessibility features. */
     public static final String ACCESSIBILITY = "accessibility";
 
+    /**
+     * The value to be set on the 'role' property for the element and its descendants to
+     * be considered as artifacts.
+     */
+    public static final String ROLE_ARTIFACT = "artifact";
+
     private Accessibility() { }
 
 }

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverter.java?rev=1343668&r1=1343667&r2=1343668&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverter.java
(original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverter.java
Tue May 29 11:13:02 2012
@@ -23,6 +23,7 @@ import java.util.Stack;
 
 import org.xml.sax.SAXException;
 
+import org.apache.fop.accessibility.Accessibility;
 import org.apache.fop.accessibility.StructureTreeEventHandler;
 import org.apache.fop.fo.DelegatingFOEventHandler;
 import org.apache.fop.fo.FOEventHandler;
@@ -57,6 +58,8 @@ import org.apache.fop.fo.pagination.Flow
 import org.apache.fop.fo.pagination.PageSequence;
 import org.apache.fop.fo.pagination.Root;
 import org.apache.fop.fo.pagination.StaticContent;
+import org.apache.fop.fo.properties.CommonAccessibility;
+import org.apache.fop.fo.properties.CommonAccessibilityHolder;
 
 /**
  * Allows to create the structure tree of an FO document, by converting FO
@@ -355,6 +358,7 @@ public class FO2StructureTreeConverter e
 
     @Override
     public void startStatic(StaticContent staticContent) {
+        handleStartArtifact(staticContent);
         converter.startStatic(staticContent);
         super.startStatic(staticContent);
     }
@@ -362,6 +366,7 @@ public class FO2StructureTreeConverter e
     @Override
     public void endStatic(StaticContent statisContent) {
         converter.endStatic(statisContent);
+        handleEndArtifact(statisContent);
         super.endStatic(statisContent);
     }
 
@@ -454,6 +459,7 @@ public class FO2StructureTreeConverter e
 
     @Override
     public void startWrapper(Wrapper wrapper) {
+        handleStartArtifact(wrapper);
         converter.startWrapper(wrapper);
         super.startWrapper(wrapper);
     }
@@ -461,6 +467,7 @@ public class FO2StructureTreeConverter e
     @Override
     public void endWrapper(Wrapper wrapper) {
         converter.endWrapper(wrapper);
+        handleEndArtifact(wrapper);
         super.endWrapper(wrapper);
     }
 
@@ -488,4 +495,22 @@ public class FO2StructureTreeConverter e
         super.endExternalDocument(document);
     }
 
+    private void handleStartArtifact(CommonAccessibilityHolder fobj) {
+        if (isArtifact(fobj)) {
+            converters.push(converter);
+            converter = eventSwallower;
+        }
+    }
+
+    private void handleEndArtifact(CommonAccessibilityHolder fobj) {
+        if (isArtifact(fobj)) {
+            converter = converters.pop();
+        }
+    }
+
+    private boolean isArtifact(CommonAccessibilityHolder fobj) {
+        CommonAccessibility accessibility = fobj.getCommonAccessibility();
+        return Accessibility.ROLE_ARTIFACT.equalsIgnoreCase(accessibility.getRole());
+    }
+
 }

Propchange: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/afp/apps/
------------------------------------------------------------------------------
  Merged /xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/apps:r1343305-1343667

Propchange: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/afp/parser/
------------------------------------------------------------------------------
  Merged /xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/parser:r1343305-1343667

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/fo/flow/Wrapper.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/fo/flow/Wrapper.java?rev=1343668&r1=1343667&r2=1343668&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/fo/flow/Wrapper.java
(original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/fo/flow/Wrapper.java
Tue May 29 11:13:02 2012
@@ -26,7 +26,10 @@ import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FOText;
 import org.apache.fop.fo.FObjMixed;
+import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.ValidationException;
+import org.apache.fop.fo.properties.CommonAccessibility;
+import org.apache.fop.fo.properties.CommonAccessibilityHolder;
 
 /**
  * Class modelling the <a href=http://www.w3.org/TR/xsl/#fo_wrapper">
@@ -34,13 +37,13 @@ import org.apache.fop.fo.ValidationExcep
  * The <code>fo:wrapper</code> object serves as a property holder for
  * its child node objects.
  */
-public class Wrapper extends FObjMixed {
-    // The value of properties relevant for fo:wrapper.
-    // End of property values
+public class Wrapper extends FObjMixed implements CommonAccessibilityHolder {
 
     // used for FO validation
     private boolean blockOrInlineItemFound = false;
 
+    private CommonAccessibility commonAccessibility;
+
     /**
      * Create a Wrapper instance that is a child of the
      * given {@link FONode}
@@ -52,6 +55,12 @@ public class Wrapper extends FObjMixed {
     }
 
     @Override
+    public void bind(PropertyList pList) throws FOPException {
+        super.bind(pList);
+        commonAccessibility = CommonAccessibility.getInstance(pList);
+    }
+
+    @Override
     protected void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startWrapper(this);
@@ -136,6 +145,10 @@ public class Wrapper extends FObjMixed {
         return FO_WRAPPER;
     }
 
+    public CommonAccessibility getCommonAccessibility() {
+        return commonAccessibility;
+    }
+
     @Override
     public boolean isDelimitedTextRangeBoundary ( int boundary ) {
         return false;

Propchange: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/util/ColorExt.java
------------------------------------------------------------------------------
  Merged /xmlgraphics/fop/trunk/src/java/org/apache/fop/util/ColorExt.java:r1343305-1343667

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java?rev=1343668&r1=1343667&r2=1343668&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java
(original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java
Tue May 29 11:13:02 2012
@@ -19,8 +19,6 @@
 
 package org.apache.fop.accessibility.fo;
 
-import static org.junit.Assert.assertTrue;
-
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -45,6 +43,8 @@ import org.w3c.dom.Document;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.AttributesImpl;
 
+import static org.junit.Assert.assertTrue;
+
 import org.apache.fop.accessibility.StructureTree2SAXEventAdapter;
 import org.apache.fop.accessibility.StructureTreeEventHandler;
 import org.apache.fop.apps.FOPException;
@@ -102,6 +102,17 @@ public class FO2StructureTreeConverterTe
         testConverter();
     }
 
+    @Test
+    public void testArtifact() throws Exception {
+        foLoader = new FOLoader() {
+
+            public InputStream getFoInputStream() {
+                return getResource("artifact.fo");
+            }
+        };
+        testConverter();
+    }
+
     private Transformer createTransformer(Source xslt) throws TransformerFactoryConfigurationError,
             TransformerConfigurationException {
         TransformerFactory transformerFactory = TransformerFactory.newInstance();

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl?rev=1343668&r1=1343667&r2=1343668&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl
(original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl
Tue May 29 11:13:02 2012
@@ -105,6 +105,8 @@
     <xsl:call-template name="copy"/>
   </xsl:template>
 
+  <xsl:template match="fo:wrapper[translate(normalize-space(@role), 'ARTIFCT', 'artifct')
= 'artifact']"/>
+
 
   <!-- Discard descendants of fo:leader -->
   <xsl:template match="fo:leader"/>

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/pdf/accessibility/pdf/role.pdf
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/pdf/accessibility/pdf/role.pdf?rev=1343668&r1=1343667&r2=1343668&view=diff
==============================================================================
Binary files - no diff available.

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/pdf/accessibility/role.fo
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/pdf/accessibility/role.fo?rev=1343668&r1=1343667&r2=1343668&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/pdf/accessibility/role.fo (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/test/pdf/accessibility/role.fo Tue
May 29 11:13:02 2012
@@ -24,8 +24,8 @@
       <fo:region-after extent="10pt"/>
     </fo:simple-page-master>
   </fo:layout-master-set>
-  <fo:page-sequence master-reference="page" role="Art">
-    <fo:static-content flow-name="xsl-region-after" role="NonStruct" font-size="8pt">
+  <fo:page-sequence master-reference="page" language="en" country="GB" role="Art">
+    <fo:static-content flow-name="xsl-region-after" role="artifact" font-size="8pt">
       <fo:block text-align="center"><fo:page-number/></fo:block>
     </fo:static-content>
     <fo:flow flow-name="xsl-region-body" role="NonStruct"  hyphenate="true" 



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


Mime
View raw message