protected void ImplSetAttribute(DomAttribute attr) { //handle some attribute //special for some attributes switch ((WellknownName)attr.LocalNameIndex) { case WellknownName.Style: { //TODO: parse and evaluate style here //**** WebDom.Parser.CssParser miniCssParser = CssParserPool.GetFreeParser(); //parse and evaluate the ruleset CssRuleSet parsedRuleSet = miniCssParser.ParseCssPropertyDeclarationList(attr.Value.ToCharArray()); Css.BoxSpec spec = null; if (this.ParentNode != null) { spec = ((HtmlElement)this.ParentNode).Spec; } foreach (WebDom.CssPropertyDeclaration propDecl in parsedRuleSet.GetAssignmentIter()) { SpecSetter.AssignPropertyValue( _boxSpec, spec, propDecl); } CssParserPool.ReleaseParser(ref miniCssParser); } break; } }
public CssBoxSvgRoot(Css.BoxSpec spec, IRootGraphics rootgfx, SvgElement svgElem) : base(spec, rootgfx, Css.CssDisplay.Block) { SetAsCustomCssBox(this); //create svg node this.SvgSpec = svgElem; ChangeDisplayType(this, Css.CssDisplay.Block); }
/// <summary> /// Init. /// </summary> /// <param name="parent">the parent box of this box</param> /// <param name="controller">the html tag data of this box</param> public CssBoxImage(Css.BoxSpec boxSpec, IRootGraphics rootgfx, ImageBinder binder) : base(boxSpec, rootgfx) { this._imgRun = new CssImageRun(); this._imgRun.ImageBinder = binder; this._imgRun.SetOwner(this); var runlist = new List <CssRun>(1); runlist.Add(_imgRun); CssBox.UnsafeSetContentRuns(this, runlist, false); }
/// <summary> /// Init. /// </summary> /// <param name="parent">the parent box of this box</param> /// <param name="controller">the html tag data of this box</param> public CssBoxImage(Css.BoxSpec boxSpec, ImageBinder binder) : base(boxSpec) { _imgRun = new CssImageRun(); _imgRun.ImageBinder = binder; binder.ImageChanged += Binder_ImageChanged; _imgRun.SetOwner(this); // var runlist = new List <CssRun>(1); runlist.Add(_imgRun); CssBox.UnsafeSetContentRuns(this, runlist, false); }
public override void SetAttribute(DomAttribute attr) { base.SetAttribute(attr); //to base //---------------------- switch ((WellknownName)attr.LocalNameIndex) { case WellknownName.Src: { switch (this.WellknownElementName) { case WellKnownDomNodeName.img: { if (_principalBox != null) { CssBoxImage boxImg = (CssBoxImage)_principalBox; boxImg.ImageBinder = new ImageBinder(attr.Value); boxImg.InvalidateGraphics(); } } break; } } break; case WellknownName.Style: { //TODO: parse and evaluate style here //**** WebDom.Parser.CssParser miniCssParser = CssParserPool.GetFreeParser(); //parse and evaluate the ruleset CssRuleSet parsedRuleSet = miniCssParser.ParseCssPropertyDeclarationList(attr.Value.ToCharArray()); Css.BoxSpec spec = null; if (this.ParentNode != null) { spec = ((HtmlElement)this.ParentNode).Spec; } foreach (WebDom.CssPropertyDeclaration propDecl in parsedRuleSet.GetAssignmentIter()) { SpecSetter.AssignPropertyValue( _boxSpec, spec, propDecl); } CssParserPool.ReleaseParser(ref miniCssParser); } break; } }
public static CssBoxSvgRoot CreateSvgBox(CssBox parentBox, HtmlElement elementNode, Css.BoxSpec spec) { SvgFragment fragment = new SvgFragment(); SvgRootEventPortal svgRootController = new SvgRootEventPortal(elementNode); CssBoxSvgRoot svgRoot = new CssBoxSvgRoot( elementNode.Spec, parentBox.RootGfx, fragment); svgRoot.SetController(svgRootController); svgRootController.SvgRoot = svgRoot; parentBox.AppendChild(svgRoot); CreateSvgBoxContent(fragment, elementNode); return(svgRoot); }
public WrapperInlineCssBox(object controller, Css.BoxSpec boxSpec, RootGraphic rootgfx, RenderElement re) : base(controller, boxSpec, re.Root, CssDisplay.Inline) { int w = re.Width; int h = re.Height; ChangeDisplayType(this, CssDisplay.Inline); this.externalRun = new CssExternalRun(re); this.externalRun.SetOwner(this); var runlist = new List <CssRun>(1); runlist.Add(externalRun); CssBox.UnsafeSetContentRuns(this, runlist, false); ChangeDisplayType(this, Css.CssDisplay.Inline); //--------------------------------------------------- LayoutFarm.RenderElement.SetParentLink(re, this); }
public CssBox(BoxSpec spec) { _aa_boxes = new CssBoxCollection(); #if DEBUG //if (__aa_dbugId == 13) //{ //} //if (!spec.IsFreezed) //{ // //must be freezed // throw new NotSupportedException(); //} #endif //assign spec _myspec = spec; EvaluateSpec(spec); ChangeDisplayType(this, _myspec.CssDisplay); }
public CssBox(BoxSpec spec, RootGraphic rootgfx) { this.rootgfx = rootgfx; this._aa_boxes = new CssBoxCollection(); #if DEBUG //if (this.__aa_dbugId == 6) //{ //} if (!spec.IsFreezed) { //must be freezed throw new NotSupportedException(); } #endif //assign spec this._myspec = spec; EvaluateSpec(spec); ChangeDisplayType(this, _myspec.CssDisplay); }
public CssBox(BoxSpec spec, IRootGraphics rootgfx) { this.rootgfx = rootgfx; this._aa_boxes = new CssBoxCollection(); #if DEBUG //if (this.__aa_dbugId == 6) //{ //} if (!spec.IsFreezed) { //must be freezed throw new NotSupportedException(); } #endif //assign spec this._myspec = spec; EvaluateSpec(spec); ChangeDisplayType(this, _myspec.CssDisplay); }
public CssBox(BoxSpec spec, CssDisplay displayType) { _aa_boxes = new CssBoxCollection(); #if DEBUG //if (__aa_dbugId == 13) //{ //} if (!spec.IsFreezed) { //must be freezed throw new NotSupportedException(); } #endif //assign spec _boxCompactFlags |= BoxFlags.DONT_CHANGE_DISPLAY_TYPE; _cssDisplay = displayType; _myspec = spec; //---------------------------- EvaluateSpec(spec); ChangeDisplayType(this, _myspec.CssDisplay); }
public CssBoxSvgRoot(Css.BoxSpec spec, IRootGraphics rootgfx, VgDocument svgdoc) : base(spec, rootgfx, Css.CssDisplay.Block) { //---------- _vgVisualDocHost = new PaintLab.Svg.VgVisualDocHost(); _vgVisualDocHost.SetImgRequestDelgate((ImageBinder reqImgBinder, PaintLab.Svg.VgVisualElement vgVisualE, object requestFrom) => { //TODO: implementation here }); _vgVisualDocHost.SetInvalidateDelegate(vgVisualElem => { vgVisualElem.ClearBitmapSnapshot(); vgVisualElem.InvalidateBounds(); this.InvalidateGraphics(); }); //---------- SetAsCustomCssBox(this); //create svg node this.SvgDoc = svgdoc; //convert svgElem to agg-based ChangeDisplayType(this, Css.CssDisplay.Block); }
public CssBox(BoxSpec spec, RootGraphic rootgfx, CssDisplay displayType) { this.rootgfx = rootgfx; this._aa_boxes = new CssBoxCollection(); #if DEBUG //if (this.__aa_dbugId == 6) //{ //} if (!spec.IsFreezed) { //must be freezed throw new NotSupportedException(); } #endif //assign spec this._boxCompactFlags |= BoxFlags.DONT_CHANGE_DISPLAY_TYPE; this._cssDisplay = displayType; this._myspec = spec; //---------------------------- EvaluateSpec(spec); ChangeDisplayType(this, _myspec.CssDisplay); }
public CssScrollView(HtmlHost htmlhost, Css.BoxSpec boxSpec, IRootGraphics rootgfx) : base(boxSpec, rootgfx) { _htmlhost = htmlhost; }
internal HtmlElement(HtmlDocument owner, int prefix, int localNameIndex) : base(owner, prefix, localNameIndex) { _boxSpec = new Css.BoxSpec(); }
public CssFloatContainerBox(Css.BoxSpec boxSpec, IRootGraphics rootgfx, Css.CssDisplay display) : base(boxSpec, rootgfx, display) { }
public CssScrollView(Css.BoxSpec boxSpec, IRootGraphics rootgfx) : base(boxSpec, rootgfx) { }
/// <summary> /// Init. /// </summary> /// <param name="parent">the parent box of this box</param> /// <param name="controller">the html tag data of this box</param> public CssBoxHr(Css.BoxSpec spec) : base(spec) { ChangeDisplayType(this, Css.CssDisplay.Block); }
public CssBoxMathMLRoot(Css.BoxSpec spec) : base(spec, Css.CssDisplay.Block) { }
public CssScrollView(HtmlHost htmlhost, Css.BoxSpec boxSpec) : base(boxSpec) { _htmlhost = htmlhost; }
public CssFloatContainerBox(Css.BoxSpec boxSpec, Css.CssDisplay display) : base(boxSpec, display) { }
/// <summary> /// Init. /// </summary> /// <param name="parent">the parent box of this box</param> /// <param name="controller">the html tag data of this box</param> public CssBoxHr(Css.BoxSpec spec, IRootGraphics rootgfx) : base(spec, rootgfx) { ChangeDisplayType(this, Css.CssDisplay.Block); }
public CssBoxListItem(Css.BoxSpec spec) : base(spec) { }
public CssBoxListItem(Css.BoxSpec spec, IRootGraphics rootgfx) : base(spec, rootgfx) { }
internal HtmlElement(HtmlDocument owner, int prefix, int localNameIndex) : base(owner, prefix, localNameIndex) { this.boxSpec = new Css.BoxSpec(); }