Hello!
Here is my patch about support for background properties of before,
after, start and end regions and precedence attribute of before and
after regions (lr-tb writing mode only). Actually this patch also adds
start and end regions support for AWT renderer and tries to unify
regions rendering in all renderers.
--
Oleg Tkachenko
Multiconn International, Israel
Index: fop-cvs/xml-fop/src/org/apache/fop/fo/pagination/RegionAfter.java
===
RCS file: /home/cvspublic/xml-fop/src/org/apache/fop/fo/pagination/RegionAfter.java,v
retrieving revision 1.9.2.1
diff -u -r1.9.2.1 RegionAfter.java
--- fop-cvs/xml-fop/src/org/apache/fop/fo/pagination/RegionAfter.java 23 Apr 2002
22:25:25 - 1.9.2.1
+++ fop-cvs/xml-fop/src/org/apache/fop/fo/pagination/RegionAfter.java 13 Jul 2002
+14:04:23 -
@@ -65,6 +65,20 @@
return area;
}
+RegionArea makeRegionArea(int allocationRectangleXPosition,
+ int allocationRectangleYPosition,
+ int allocationRectangleWidth,
+ int allocationRectangleHeight,
+ int startExtent, int endExtent) {
+if (getPrecedence() == false) {
+allocationRectangleXPosition += startExtent;
+allocationRectangleWidth -= startExtent + endExtent;
+}
+return makeRegionArea(allocationRectangleXPosition,
+ allocationRectangleYPosition,
+ allocationRectangleWidth,
+ allocationRectangleHeight);
+}
protected String getDefaultRegionName() {
return "xsl-region-after";
@@ -82,4 +96,7 @@
return (precedence == Precedence.TRUE ? true : false);
}
+public int getExtent() {
+return properties.get("extent").getLength().mvalue();
+}
}
Index: fop-cvs/xml-fop/src/org/apache/fop/fo/pagination/RegionBefore.java
===
RCS file: /home/cvspublic/xml-fop/src/org/apache/fop/fo/pagination/RegionBefore.java,v
retrieving revision 1.9.2.1
diff -u -r1.9.2.1 RegionBefore.java
--- fop-cvs/xml-fop/src/org/apache/fop/fo/pagination/RegionBefore.java 23 Apr 2002
22:25:25 - 1.9.2.1
+++ fop-cvs/xml-fop/src/org/apache/fop/fo/pagination/RegionBefore.java 13 Jul 2002
+14:04:24 -
@@ -65,6 +65,20 @@
return area;
}
+RegionArea makeRegionArea(int allocationRectangleXPosition,
+ int allocationRectangleYPosition,
+ int allocationRectangleWidth,
+ int allocationRectangleHeight,
+ int startExtent, int endExtent) {
+if (getPrecedence() == false) {
+allocationRectangleXPosition += startExtent;
+allocationRectangleWidth -= startExtent + endExtent;
+}
+return makeRegionArea(allocationRectangleXPosition,
+ allocationRectangleYPosition,
+ allocationRectangleWidth,
+ allocationRectangleHeight);
+}
protected String getDefaultRegionName() {
return "xsl-region-before";
@@ -82,4 +96,7 @@
return (precedence == Precedence.TRUE ? true : false);
}
+public int getExtent() {
+return properties.get("extent").getLength().mvalue();
+}
}
Index: fop-cvs/xml-fop/src/org/apache/fop/fo/pagination/RegionEnd.java
===
RCS file: /home/cvspublic/xml-fop/src/org/apache/fop/fo/pagination/RegionEnd.java,v
retrieving revision 1.3.2.1
diff -u -r1.3.2.1 RegionEnd.java
--- fop-cvs/xml-fop/src/org/apache/fop/fo/pagination/RegionEnd.java 23 Apr 2002
22:25:25 - 1.3.2.1
+++ fop-cvs/xml-fop/src/org/apache/fop/fo/pagination/RegionEnd.java 13 Jul 2002
+14:04:25 -
@@ -43,18 +43,18 @@
int allocationRectangleWidth,
int allocationRectangleHeight,
boolean beforePrecedence,
- boolean afterPrecedence, int beforeHeight,
- int afterHeight) {
+ boolean afterPrecedence, int beforeExtent,
+ int afterExtent) {
int extent = this.properties.get("extent").getLength().mvalue();
int startY = allocationRectangleYPosition;
int startH = allocationRectangleHeight;
if (beforePrecedence) {
-startY -= beforeHeight;
-startH -= beforeHeight;
+startY -= beforeExtent;
+startH -= beforeExtent;
}
if (afterPrecedence)
-startH -= afterHeight;
+startH -= afterExtent;
RegionArea area = new RegionArea(allocationRectangl