protected FObj(FObj parent, PropertyList propertyList) : base(parent) { this.properties = propertyList; propertyList.FObj = this; this.propMgr = MakePropertyManager(propertyList); this.name = "default FO"; SetWritingMode(); }
protected FONode(FObj parent) { this.parent = parent; if (null != parent) { this.areaClass = parent.areaClass; } }
public override Property ConvertProperty( Property p, PropertyList propertyList, FObj fo) { if (p is ToBeImplementedProperty) { return p; } ToBeImplementedProperty val = new ToBeImplementedProperty(PropName); return val; }
public FOText(char[] chars, int s, int e, FObj parent) : base(parent) { this.start = 0; this.ca = new char[e - s]; for (int i = s; i < e; i++) { ca[i - s] = chars[i]; } this.length = e - s; }
public override Property ConvertProperty( Property p, PropertyList propertyList, FObj fo) { if (p is ListProperty) { return p; } else { return new ListProperty(p); } }
protected UnknownXMLObj(FObj parent, PropertyList propertyList, string space, string tag) : base(parent, propertyList, tag) { this.nmspace = space; if (!"".Equals(space)) { this.name = this.nmspace + ":" + tag; } else { this.name = "(none):" + tag; } }
public override Property ConvertProperty( Property p, PropertyList propertyList, FObj fo) { if (p is NumberProperty) { return p; } Number val = p.GetNumber(); if (val != null) { return new NumberProperty(val); } return ConvertPropertyDatatype(p, propertyList, fo); }
public override Property ConvertProperty( Property p, PropertyList propertyList, FObj fo) { if (p is ColorTypeProperty) { return p; } ColorType val = p.GetColorType(); if (val != null) { return new ColorTypeProperty(val); } return ConvertPropertyDatatype(p, propertyList, fo); }
public override Property Make( PropertyList propertyList, string value, FObj fo) { int vlen = value.Length - 1; if (vlen > 0) { char q1 = value[0]; if (q1 == '"' || q1 == '\'') { if (value[vlen] == q1) { return new StringProperty(value.Substring(1, vlen - 2)); } Console.WriteLine("Warning String-valued property starts with quote" + " but doesn't end with quote: " + value); } } return new StringProperty(value); }
public override Property ConvertProperty( Property p, PropertyList propertyList, FObj fo) { if (IsAutoLengthAllowed()) { string pval = p.GetString(); if (pval != null && pval.Equals("auto")) { return new LengthProperty(new AutoLength()); } } if (p is LengthProperty) { return p; } Length val = p.GetLength(); if (val != null) { return new LengthProperty(val); } return ConvertPropertyDatatype(p, propertyList, fo); }
public XMLElement(FObj parent, PropertyList propertyList, string tag) : base(parent, propertyList, tag) { Init(); }
protected Title(FObj parent, PropertyList propertyList) : base(parent, propertyList) { this.name = "fo:title"; }
public override FObj Make(FObj parent, PropertyList propertyList) { return new Unknown(parent, propertyList); }
public override FObj Make(FObj parent, PropertyList propertyList) { return new XMLElement(parent, propertyList, tag); }
private void EndElement() { if (currentFObj != null) { currentFObj.End(); // If it is a page-sequence, then we can finally render it. // This is the biggest performance problem we have, we need // to be able to render prior to this point. if (currentFObj is PageSequence) { streamRenderer.Render((PageSequence)currentFObj); } currentFObj = currentFObj.getParent(); } }
public override XMLElement Make(FObj parent, PropertyList propertyList) { return(new XMLElement(parent, propertyList, tag)); }
public void addLineagePair(FObj fo, int areaPosition) { returnedBy.Add(fo, areaPosition); }
private void StartElement( string uri, string localName, Attributes attlist) { FObj fobj; FObj.Maker fobjMaker = GetFObjMaker(uri, localName); PropertyListBuilder currentListBuilder = (PropertyListBuilder)this.propertylistTable[uri]; bool foreignXML = false; if (fobjMaker == null) { string fullName = uri + "^" + localName; if (!this.unknownFOs.ContainsKey(fullName)) { this.unknownFOs.Add(fullName, ""); FonetDriver.ActiveDriver.FireFonetError("Unknown formatting object " + fullName); } if (namespaces.Contains(String.Intern(uri))) { fobjMaker = new Unknown.Maker(); } else { fobjMaker = new UnknownXMLObj.Maker(uri, localName); foreignXML = true; } } PropertyList list = null; if (currentListBuilder != null) { list = currentListBuilder.MakeList(uri, localName, attlist, currentFObj); } else if (foreignXML) { list = null; } else { if (currentFObj == null) { throw new FonetException("Invalid XML or missing namespace"); } list = currentFObj.properties; } fobj = fobjMaker.Make(currentFObj, list); if (rootFObj == null) { rootFObj = fobj; if (!fobj.GetName().Equals("fo:root")) { throw new FonetException("Root element must" + " be root, not " + fobj.GetName()); } } else if (!(fobj is PageSequence)) { currentFObj.AddChild(fobj); } currentFObj = fobj; }
protected FObjMixed(FObj parent, PropertyList propertyList) : base(parent, propertyList) { }
public TextState getTextDecoration(FObj parent) { TextState tsp = null; bool found = false; do { string fname = parent.GetName(); if (fname.Equals("fo:flow") || fname.Equals("fo:static-content")) { found = true; } else if (fname.Equals("fo:block") || fname.Equals("fo:inline")) { FObjMixed fom = (FObjMixed)parent; tsp = fom.getTextState(); found = true; } parent = parent.getParent(); } while (!found); TextState ts = new TextState(); if (tsp != null) { ts.setUnderlined(tsp.getUnderlined()); ts.setOverlined(tsp.getOverlined()); ts.setLineThrough(tsp.getLineThrough()); } int textDecoration = this.properties.GetProperty("text-decoration").GetEnum(); if (textDecoration == TextDecoration.UNDERLINE) { ts.setUnderlined(true); } if (textDecoration == TextDecoration.OVERLINE) { ts.setOverlined(true); } if (textDecoration == TextDecoration.LINE_THROUGH) { ts.setLineThrough(true); } if (textDecoration == TextDecoration.NO_UNDERLINE) { ts.setUnderlined(false); } if (textDecoration == TextDecoration.NO_OVERLINE) { ts.setOverlined(false); } if (textDecoration == TextDecoration.NO_LINE_THROUGH) { ts.setLineThrough(false); } return ts; }
public override FObj Make(FObj parent, PropertyList propertyList) { return(new FObjMixed(parent, propertyList)); }
protected ToBeImplementedElement(FObj parent, PropertyList propertyList) : base(parent, propertyList) { }
public override FObj Make(FObj parent, PropertyList propertyList) { return new Title(parent, propertyList); }
protected Unknown(FObj parent, PropertyList propertyList) : base(parent, propertyList) { this.name = "unknown"; }
protected UnknownXMLObj(FObj parent, PropertyList propertyList, string space, string tag) : base(parent, propertyList, tag) { this.nmspace = space; }
public virtual FObj Make(FObj parent, PropertyList propertyList) { return new FObj(parent, propertyList); }
public XMLObj(FObj parent, PropertyList propertyList, string tag) : base(parent, propertyList) { tagName = tag; }
public override UnknownXMLObj Make(FObj parent, PropertyList propertyList) { return(new UnknownXMLObj(parent, propertyList, space, tag)); }
internal PropertyList MakeList( string ns, string elementName, Attributes attributes, FObj parentFO) { Debug.Assert(ns != null, "Namespace should never be null."); string space = "http://www.w3.org/TR/1999/XSL/Format"; if (ns != null) { space = ns; } PropertyList parentPropertyList = parentFO != null ? parentFO.properties : null; PropertyList par = null; if (parentPropertyList != null && space.Equals(parentPropertyList.GetNameSpace())) { par = parentPropertyList; } PropertyList p = new PropertyList(par, space, elementName); p.SetBuilder(this); StringCollection propsDone = new StringCollection(); string fontsizeval = attributes.getValue(FONTSIZEATTR); if (fontsizeval != null) { PropertyMaker propertyMaker = FindMaker(FONTSIZEATTR); if (propertyMaker != null) { try { p.Add(FONTSIZEATTR, propertyMaker.Make(p, fontsizeval, parentFO)); } catch (FonetException) { } } propsDone.Add(FONTSIZEATTR); } for (int i = 0; i < attributes.getLength(); i++) { string attributeName = attributes.getQName(i); int sepchar = attributeName.IndexOf('.'); string propName = attributeName; string subpropName = null; Property propVal = null; if (sepchar > -1) { propName = attributeName.Substring(0, sepchar); subpropName = attributeName.Substring(sepchar + 1); } else if (propsDone.Contains(propName)) { continue; } PropertyMaker propertyMaker = FindMaker(propName); if (propertyMaker != null) { try { if (subpropName != null) { Property baseProp = p.GetExplicitBaseProperty(propName); if (baseProp == null) { string baseValue = attributes.getValue(propName); if (baseValue != null) { baseProp = propertyMaker.Make(p, baseValue, parentFO); propsDone.Add(propName); } } propVal = propertyMaker.Make(baseProp, subpropName, p, attributes.getValue(i), parentFO); } else { propVal = propertyMaker.Make(p, attributes.getValue(i), parentFO); } if (propVal != null) { p[propName] = propVal; } } catch (FonetException e) { FonetDriver.ActiveDriver.FireFonetError(e.Message); } } else { if (!attributeName.StartsWith("xmlns")) { FonetDriver.ActiveDriver.FireFonetWarning( "property " + attributeName + " ignored"); } } } return p; }
public override FObj Make(FObj parent, PropertyList propertyList) { return new UnknownXMLObj(parent, propertyList, space, tag); }
public LengthBase(FObj parentFO, PropertyList plist, int iBaseType) { this.parentFO = parentFO; this.propertyList = plist; this.iBaseType = iBaseType; }
internal PropertyList MakeList( string ns, string elementName, Attributes attributes, FObj parentFO) { Debug.Assert(ns != null, "Namespace should never be null."); string space = "http://www.w3.org/TR/1999/XSL/Format"; if (ns != null) { space = ns; } PropertyList parentPropertyList = parentFO != null ? parentFO.properties : null; PropertyList par = null; if (parentPropertyList != null && space.Equals(parentPropertyList.GetNameSpace())) { par = parentPropertyList; } PropertyList p = new PropertyList(par, space, elementName); p.SetBuilder(this); StringCollection propsDone = new StringCollection(); string fontsizeval = attributes.getValue(FONTSIZEATTR); if (fontsizeval != null) { PropertyMaker propertyMaker = FindMaker(FONTSIZEATTR); if (propertyMaker != null) { try { p.Add(FONTSIZEATTR, propertyMaker.Make(p, fontsizeval, parentFO)); } catch (FonetException) { } } propsDone.Add(FONTSIZEATTR); } for (int i = 0; i < attributes.getLength(); i++) { string attributeName = attributes.getQName(i); int sepchar = attributeName.IndexOf('.'); string propName = attributeName; string subpropName = null; Property propVal = null; if (sepchar > -1) { propName = attributeName.Substring(0, sepchar); subpropName = attributeName.Substring(sepchar + 1); } else if (propsDone.Contains(propName)) { continue; } PropertyMaker propertyMaker = FindMaker(propName); if (propertyMaker != null) { try { if (subpropName != null) { Property baseProp = p.GetExplicitBaseProperty(propName); if (baseProp == null) { string baseValue = attributes.getValue(propName); if (baseValue != null) { baseProp = propertyMaker.Make(p, baseValue, parentFO); propsDone.Add(propName); } } propVal = propertyMaker.Make(baseProp, subpropName, p, attributes.getValue(i), parentFO); } else { propVal = propertyMaker.Make(p, attributes.getValue(i), parentFO); } if (propVal != null) { p[propName] = propVal; } } catch (FonetException e) { FonetDriver.ActiveDriver.FireFonetError(e.Message); } } else { if (!attributeName.StartsWith("xmlns")) { FonetDriver.ActiveDriver.FireFonetWarning( "property " + attributeName + " ignored"); } } } return(p); }
public void setGeneratedBy(FObj generatedBy) { this.generatedBy = generatedBy; }