From bc77d284c5d95b00da3c63d5ab6dab21873235eb Mon Sep 17 00:00:00 2001 From: Karen Lease Date: Tue, 2 Jan 2001 21:45:33 +0000 Subject: [PATCH] Add keep properties as compound; handle enumeration types in subproperties; add corresponding properties; handle enumeration plus base property type; update dtd git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193944 13f79535-47bb-0310-9956-ffa450edef68 --- src/codegen/enumgen.xsl | 79 +++++++++++- src/codegen/foproperties.xml | 218 ++++++++++++++++++++++++++++++--- src/codegen/properties.dtd | 90 +++++++++++++- src/codegen/properties.xsl | 229 +++++++++++++++++++++++++---------- src/codegen/propinc.xsl | 33 ++++- 5 files changed, 560 insertions(+), 89 deletions(-) diff --git a/src/codegen/enumgen.xsl b/src/codegen/enumgen.xsl index 12d2cde71..e86a5fc27 100644 --- a/src/codegen/enumgen.xsl +++ b/src/codegen/enumgen.xsl @@ -25,24 +25,97 @@ - + - + + + + + package org.apache.fop.fo.properties; public interface - + extends .Enums { public final static int = ; + + + } + + + + + + public interface { + + public final static int = ; + + } + + + + + + + + + + + + + + + + + public interface extends .Enums { } + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + public interface extends .Enums. { + } + + + + + + + + diff --git a/src/codegen/foproperties.xml b/src/codegen/foproperties.xml index 1cc4e8921..e6f7549d9 100644 --- a/src/codegen/foproperties.xml +++ b/src/codegen/foproperties.xml @@ -20,23 +20,36 @@ generic-keep GenericKeep - Number - 0 - -1 - + + within-page - Number + Number + auto + + auto + always + - + within-line - Number + Number + auto + + auto + always + - + within-column - Number + Number + auto + + auto + always + - --> + conditional-length-template @@ -49,7 +62,11 @@ conditionality - String + Enum + + discard + retain + @@ -91,8 +108,12 @@ medium + Enum conditionality - String + + discard + retain + @@ -164,11 +185,18 @@ precedence Number + + force + 0 conditionality - String + Enum + + discard + retain + discard @@ -186,6 +214,14 @@ true Length 0pt + + margin- + + margin-+ + padding-+ + border--width + + font-style @@ -258,6 +294,14 @@ true Length 0pt + + margin- + + margin-+ + padding-+ + border--width + + color @@ -456,37 +500,61 @@ padding-before GenericCondPadding retain + + padding- + padding-after GenericCondPadding retain + + padding- + padding-start GenericCondPadding discard + + padding- + padding-end GenericCondPadding discard + + padding- + padding-top GenericPadding + + padding- + padding-left GenericPadding + + padding- + padding-bottom GenericPadding + + padding- + padding-right GenericPadding + + padding- + external-destination @@ -505,116 +573,188 @@ false GenericColor black + + border--color + border-before-style GenericBorderStyle + + border--style + border-before-width GenericCondBorderWidth retain + + border--width + border-after-color false GenericColor black + + border--color + border-after-style GenericBorderStyle + + border--style + border-after-width GenericCondBorderWidth retain + + border--width + border-start-color false GenericColor black + + border--color + border-start-style GenericBorderStyle + + border--style + border-start-width GenericCondBorderWidth discard + + border--width + border-end-color false GenericColor black + + border--color + border-end-style GenericBorderStyle + + border--style + border-end-width GenericCondBorderWidth discard + + border--width + border-top-color false GenericColor black + + border--color + border-top-style GenericBorderStyle + + border--style + border-top-width GenericBorderWidth + + border--width + border-bottom-color false GenericColor + + border--color + black border-bottom-style GenericBorderStyle + + border--style + border-bottom-width GenericBorderWidth + + border--width + border-left-color false GenericColor black + + border--color + border-left-style GenericBorderStyle + + border--style + border-left-width GenericBorderWidth + + border--width + border-right-color false GenericColor black + + border--color + border-right-style GenericBorderStyle + + border--style + border-right-width GenericBorderWidth + + border--width + border-color @@ -1042,6 +1182,56 @@ none + + writing-mode + true + Enum + lr-tb + + lr-tb + rl-tb + tb-rl + + + + + block-progression-dimension + false + LengthRange + + + > + + + minimum + Length + auto + + + + min- + > + + + optimum + Length + auto + + + + + maximum + Length + + auto + + + max- + > + + + + diff --git a/src/codegen/properties.dtd b/src/codegen/properties.dtd index 7d5c3b4c4..a8a6a9d79 100644 --- a/src/codegen/properties.dtd +++ b/src/codegen/properties.dtd @@ -1,3 +1,4 @@ + @@ -22,7 +23,7 @@ DTD for foproperties.xml and svgproperties.xml + keyword-equiv*, percent-ok?, auto-ok?, derive?, corresponding? ) > - @@ -144,7 +158,23 @@ DTD for foproperties.xml and svgproperties.xml and not to a ColorType, the datatype-conversion just uses it to directly initialize a ColorType object. --> - + + + + - + + + + + + + + + + + + + + + + + diff --git a/src/codegen/properties.xsl b/src/codegen/properties.xsl index 95f768a60..aae85444d 100644 --- a/src/codegen/properties.xsl +++ b/src/codegen/properties.xsl @@ -37,6 +37,16 @@ } + + public Property checkEnumValues(String value) { + + if (value.equals("")) { return s_prop; } + + return super.checkEnumValues(value); + } + + + protected String checkValueKeywords(String value) { @@ -193,14 +203,27 @@ public class extends + public interface Enums { int = ; + + + + + + + + public interface { + + int = ; + + } } + protected final static EnumProperty s_prop = new EnumProperty(Enums.); @@ -208,22 +231,43 @@ public class extends + + + + Enums + + + + + + + + + + Property.Maker + + + - + static private class SP_Maker - extends Property.Maker { - SP_Maker(String sPropName) { + extends + implements . { + SP_Maker(String sPropName) { super(sPropName); - } - + } + + protected final static EnumProperty s_prop = new EnumProperty(); + + + } final private static Property.Maker s_Maker = new SP_Maker( @@ -231,7 +275,7 @@ public class extends Maker = - new Property.Maker( + new ( "."); @@ -244,9 +288,22 @@ public class extends (String name) { super(name); + + m_shorthandMaker= getSubpropMaker(""); + } + Property.Maker m_shorthandMaker; + + public Property checkEnumValues(String value) { + return m_shorthandMaker.checkEnumValues(value); + } + + protected boolean isCompoundMaker() { + return true; + } + protected Property.Maker getSubpropMaker(String subprop) { @@ -262,36 +319,16 @@ public class extends val = - (()baseProp).get(); - - - - - - - if (subpropName.equals("")) - val.set(subProp.get(), false); - else - - return super.setSubprop(baseProp, subpropName, subProp); + val = baseProp.get(); + // Do some type checking??? + // Check if one of our subproperties??? + val.setComponent(subpropName, subProp, false); return baseProp; } public Property getSubpropValue(Property baseProp, String subpropName) { - val = - (()baseProp).get(); - - - - - - - if (subpropName.equals("")) - return new Property( - val.get()); - - return super.getSubpropValue(baseProp, subpropName); + val = baseProp.get(); + return val.getComponent(subpropName); } @@ -323,7 +360,7 @@ public class extends subProp = getSubpropMaker("").make(pList, getDefaultFor(), fo); - p.set(subProp.get(), true); + p.setComponent("", subProp, true); return new (p); } @@ -338,6 +375,8 @@ public class extends return ""; + + return ""; return ""; @@ -346,43 +385,30 @@ public class extends - - - - - - spval=p.get(); - if (spval == null) { - // NOTE: must convert to the component datatype, not compound! - Property pconv = convertPropertyDatatype(p, pList, fo); - if (pconv != null) { - spval=pconv.get(); - } + if (p instanceof ) return p; + if (! (p instanceof EnumProperty)) { + // delegate to the subprop maker to do conversions + p = m_shorthandMaker.convertProperty(p,pList,fo); } - if (spval != null) { + if (p != null) { Property prop = makeCompound(pList, fo); - pval = prop.get(); + + pval = prop.get(); - - - - pval.set(spval, false); + pval.setComponent("", p, false); return prop; } + else return null; + } @@ -399,14 +425,16 @@ public class extends - protected Property findConstant(String value) { + public Property checkEnumValues(String value) { if (value.equals("")) { return s_prop; } - return super.findConstant(value); + return super.checkEnumValues(value); } +--> @@ -424,12 +452,86 @@ public class extends + + + + + public boolean isCorrespondingForced(PropertyList propertyList) { + StringBuffer sbExpr=new StringBuffer(); + + sbExpr.setLength(0); + + if (propertyList.getExplicit(sbExpr.toString()) != null) return true; + + return false; + } + + + public Property compute(PropertyList propertyList) throws FOPException { + FObj parentFO = propertyList.getParentFObj(); + StringBuffer sbExpr=new StringBuffer(); + Property p=null; + + + // Make sure the property is set before calculating it! + if (propertyList.getExplicit(sbExpr.toString()) == null) return p; + sbExpr.setLength(0); + + p= make(propertyList, sbExpr.toString(), propertyList.getParentFObj()); + + + p= propertyList.getExplicit(sbExpr.toString()); + + if (p != null) { + p = convertProperty(p, propertyList, parentFO ); + } + + else p= makeCompound(propertyList, parentFO); + + Property subprop; + + sbExpr.setLength(0); + + + subprop= getSubpropMaker(""). + make(propertyList, sbExpr.toString(), parentFO); + + + subprop= propertyList.getExplicit(sbExpr.toString()); + + setSubprop(p, "", subprop); + + + return p; + } + + + } + + sbExpr.append("_fop-property-value("); + + sbExpr.append(")"); + + + + + + sbExpr.append(""); + + + + sbExpr.append(propertyList.wmRelToAbs(PropertyList.)); + + + + sbExpr.append(propertyList.wmAbsToRel(PropertyList.)); + + @@ -451,4 +553,5 @@ public class extends + - - + true + + + + + + false + + + + + + + + true - + + + + + + + + false - \ No newline at end of file + -- 2.39.5