Detailed Description

Holds computed layout boxes for nodes and any style information.

Inheritance diagram for Css.RenderableData:
Css.TextRenderableData

Public Member Functions

void RequestPaintAll ()
 Requests that the document repaints this element, when possible. More...
 
void RequestPaint ()
 Requests that the document repaints this element, when possible. More...
 
void RequestLayout ()
 Requests that the renderer performs a layout on the next update. Note that layouts are more expensive than a paint. Paints simply update vertex colours and uvs where as layouts rebuild the whole mesh. More...
 
void RequestFastLayout ()
 Requests that the renderer performs a shortform layout on the next update. More...
 
float ScaleToWorldX (float value)
 Maps the given pixel value to an amount in world units. More...
 
float ScaleToWorldY (float value)
 Maps the given pixel value to an amount in world units. More...
 
void RepaintAll (Renderman renderer)
 Repaints this and all its childnodes. More...
 
void Repaint (Renderman renderer)
 Repaints this at OffsetLeft/OffsetTop with the given PixelWidth and PixelHeight values. A paint is less intensive than a layout as it only updates the uv/vert colours of the mesh. More...
 
TextRenderingProperty RequireTextProperty ()
 Creates a TextRenderingProperty if one doesn't exist yet. Note that it can be created as a 3D one if text-extrude is set. More...
 
LayoutBox BoxAt (float x, float y)
 Gets the box which contains the given x/y coords. More...
 
 RenderableData (Node node)
 
DisplayableProperty GetProperty (Type propertyType)
 Gets a render property of the given type. More...
 
int GetPropertyIndex (Type propertyType)
 Gets the index of a render property of the given type. -1 if it's not found. More...
 
void AddOrReplaceProperty (DisplayableProperty property, Type propertyType)
 Adds or replaces a render property of the given type. More...
 
void Render (bool first, LayoutBox box, Renderman renderer)
 Draws this at OffsetLeft/OffsetTop with the given PixelWidth and PixelHeight values. More...
 
void Render (Renderman renderer)
 This is the second pass of layout requests. It positions the element in global screen space and also fires the render events which in turn generate or reallocates mesh blocks. This call applies to all it's children elements too. More...
 
void WentOffScreen ()
 
virtual void UpdateCss (Renderman renderer)
 Called just before reflow to update CSS. More...
 
float ShrinkToFit ()
 This nodes 'shrink to fit' width. More...
 
float GetWidth (bool noAuto, out bool wasAuto)
 Obtains a defined width for non-inline elements. (Special case for things like img though). More...
 
virtual void Reflow (Renderman renderer)
 Positions this node and all its children relative to their parent. More...
 
void RuleRemoved (Css.StyleRule rule)
 Refreshes this elements css style if the given selector matches its own. More...
 
void RuleAdded (Css.StyleRule rule)
 Refreshes this elements css style if the given selector matches its own. More...
 

Public Attributes

Node Node
 The node that this is CSS data for. More...
 
float ValueScale =1f
 The zoom scale for all pixel based values on this style. More...
 
UpdateMode NextUpdateMode =UpdateMode.None
 True if this element is being repainted on the next frame. More...
 
LayoutBox FirstBox
 The first layout box. Forms a linked list using NextInElement. More...
 
LayoutBox LastBox
 The last layout box. Forms a linked list using NextInElement. More...
 
RenderableData Next
 Used for paint events. The next element style to paint. More...
 
RenderableData Ancestor
 This data's rendering ancestor. Used to resolve relative units and for rapid reflow. Usually set to Node.parentNode in the normal flow. More...
 
SortedDictionary< int,
RenderableData
StackingContexts
 All stacking contexts can have child stacking contexts. This exists if this is a stacking context. It will always contain at least 1 entry (at index 0) which refers to this node. That essentially enables negative z-index values to render before the normal flow. More...
 
VirtualElements Virtuals
 The set of virtual elements if it exists. More...
 
DisplayableProperty[] RenderProperties
 The set of renderable properties on this element. More...
 

Package Functions

float ParentInnerWidth ()
 Gets the most suitable parent inner width. More...
 
float ResolveParentDecimal (CssProperty prop)
 Resolves the value from the parent of this node for the given property. More...
 

Package Attributes

ScreenRegion OnScreenRegion
 The region that this element takes on the screen. Null if it's offscreen. More...
 

Properties

RasterDisplayableProperty RasterProperty [get, set]
 Gets or sets a RasterDisplayableProperty. More...
 
bool IsStackingContext [get, set]
 True if this is a stacking context. More...
 
bool IsOutOfFlow [get]
 True if this is not positioned in the flow More...
 
ReflowDocument Document [get]
 A reflow-capable document. More...
 
Node parentNode [get]
 Gets the parent node. More...
 
int BoxCount [get]
 Counts the number of boxes in the box linked list (starting at FirstBox). More...
 
RenderableData parentData [get]
 The parent renderable data. More...
 
ComputedStyle computedStyle [get]
 The computed style to use. More...
 
float OffsetTop [get]
 The global offset from the top edge. Computed in secondary layout pass. More...
 
float OffsetLeft [get]
 The global offset from the left edge. Computed in secondary layout pass. More...
 
float PixelWidth [get]
 The total width in pixels of this element. More...
 
float PixelHeight [get]
 The total height in pixels of this element. More...
 
float ContentWidth [get]
 The width of the content inside the box. Note that this is different from both InnerWidth and PixelWidth (which describe the "window" in which the content is seen). More...
 
float ContentHeight [get]
 The width of the content inside the box. Note that this is different from both InnerWidth and PixelWidth (which describe the "window" in which the content is seen). More...
 
float InnerWidth [get]
 The width of this element, excluding the border and padding. More...
 
float InnerHeight [get]
 The height of this element, excluding the border and padding. More...
 
bool Ready [get]
 True if the box model is ready and loaded. More...
 
BorderProperty Border [get, set]
 This handles rendering the border around this element, if any. More...
 
BackgroundImage BGImage [get, set]
 This handles rendering a tiled, clipped, offset background image for this element. More...
 
BackgroundColour BGColour [get, set]
 This handles rendering a solid background colour for this element. More...
 
int EndSpaceSize [get]
 The width in pixels of the last whitespace of this element, if it's got one. More...
 
TextRenderingProperty Text [get, set]
 This handles rendering text contained by this element. More...
 
TextRenderingProperty3D Text3D [get, set]
 This handles rendering 3D text contained by this element. Use text-extrude CSS property (a number). More...
 
SelectionRenderingProperty Selection [get, set]
 Selection zone. More...
 
bool HasBackground [get]
 True if this element has any form of background. More...
 

Private Member Functions

void ApplyTransform (Matrix4x4 delta, Renderman renderer)
 Applies the transform (rotate, scale etc) of this element to its background/border/content. More...
 
float ParentInnerHeight ()
 Gets the most suitable parent inner height. More...
 
void RemoveProperty (int index)
 Removes the render property at the given index. Use AddOrReplace instead. More...
 
void AddProperty (DisplayableProperty property)
 Adds the given render property. Use AddOrReplace instead. More...
 

Constructor & Destructor Documentation

Css.RenderableData.RenderableData ( Node  node)
inline

Member Function Documentation

void Css.RenderableData.AddOrReplaceProperty ( DisplayableProperty  property,
Type  propertyType 
)
inline

Adds or replaces a render property of the given type.

void Css.RenderableData.AddProperty ( DisplayableProperty  property)
inlineprivate

Adds the given render property. Use AddOrReplace instead.

void Css.RenderableData.ApplyTransform ( Matrix4x4  delta,
Renderman  renderer 
)
inlineprivate

Applies the transform (rotate, scale etc) of this element to its background/border/content.

LayoutBox Css.RenderableData.BoxAt ( float  x,
float  y 
)
inline

Gets the box which contains the given x/y coords.

DisplayableProperty Css.RenderableData.GetProperty ( Type  propertyType)
inline

Gets a render property of the given type.

int Css.RenderableData.GetPropertyIndex ( Type  propertyType)
inline

Gets the index of a render property of the given type. -1 if it's not found.

float Css.RenderableData.GetWidth ( bool  noAuto,
out bool  wasAuto 
)
inline

Obtains a defined width for non-inline elements. (Special case for things like img though).

float Css.RenderableData.ParentInnerHeight ( )
inlineprivate

Gets the most suitable parent inner height.

float Css.RenderableData.ParentInnerWidth ( )
inlinepackage

Gets the most suitable parent inner width.

virtual void Css.RenderableData.Reflow ( Renderman  renderer)
inlinevirtual

Positions this node and all its children relative to their parent.

Reimplemented in Css.TextRenderableData.

void Css.RenderableData.RemoveProperty ( int  index)
inlineprivate

Removes the render property at the given index. Use AddOrReplace instead.

void Css.RenderableData.Render ( bool  first,
LayoutBox  box,
Renderman  renderer 
)
inline

Draws this at OffsetLeft/OffsetTop with the given PixelWidth and PixelHeight values.

void Css.RenderableData.Render ( Renderman  renderer)
inline

This is the second pass of layout requests. It positions the element in global screen space and also fires the render events which in turn generate or reallocates mesh blocks. This call applies to all it's children elements too.

Parameters
relativeToThe current style we are positioning relative to.
void Css.RenderableData.Repaint ( Renderman  renderer)
inline

Repaints this at OffsetLeft/OffsetTop with the given PixelWidth and PixelHeight values. A paint is less intensive than a layout as it only updates the uv/vert colours of the mesh.

void Css.RenderableData.RepaintAll ( Renderman  renderer)
inline

Repaints this and all its childnodes.

void Css.RenderableData.RequestFastLayout ( )
inline

Requests that the renderer performs a shortform layout on the next update.

void Css.RenderableData.RequestLayout ( )
inline

Requests that the renderer performs a layout on the next update. Note that layouts are more expensive than a paint. Paints simply update vertex colours and uvs where as layouts rebuild the whole mesh.

void Css.RenderableData.RequestPaint ( )
inline

Requests that the document repaints this element, when possible.

void Css.RenderableData.RequestPaintAll ( )
inline

Requests that the document repaints this element, when possible.

TextRenderingProperty Css.RenderableData.RequireTextProperty ( )
inline

Creates a TextRenderingProperty if one doesn't exist yet. Note that it can be created as a 3D one if text-extrude is set.

float Css.RenderableData.ResolveParentDecimal ( CssProperty  prop)
inlinepackage

Resolves the value from the parent of this node for the given property.

void Css.RenderableData.RuleAdded ( Css.StyleRule  rule)
inline

Refreshes this elements css style if the given selector matches its own.

Parameters
typeThe type of the given selector.
ruleThe selector to match with.
void Css.RenderableData.RuleRemoved ( Css.StyleRule  rule)
inline

Refreshes this elements css style if the given selector matches its own.

Parameters
typeThe type of the given selector.
ruleThe selector to match with.
float Css.RenderableData.ScaleToWorldX ( float  value)
inline

Maps the given pixel value to an amount in world units.

float Css.RenderableData.ScaleToWorldY ( float  value)
inline

Maps the given pixel value to an amount in world units.

float Css.RenderableData.ShrinkToFit ( )
inline

This nodes 'shrink to fit' width.

virtual void Css.RenderableData.UpdateCss ( Renderman  renderer)
inlinevirtual

Called just before reflow to update CSS.

Reimplemented in Css.TextRenderableData.

void Css.RenderableData.WentOffScreen ( )
inline

Member Data Documentation

RenderableData Css.RenderableData.Ancestor

This data's rendering ancestor. Used to resolve relative units and for rapid reflow. Usually set to Node.parentNode in the normal flow.

LayoutBox Css.RenderableData.FirstBox

The first layout box. Forms a linked list using NextInElement.

LayoutBox Css.RenderableData.LastBox

The last layout box. Forms a linked list using NextInElement.

RenderableData Css.RenderableData.Next

Used for paint events. The next element style to paint.

UpdateMode Css.RenderableData.NextUpdateMode =UpdateMode.None

True if this element is being repainted on the next frame.

Node Css.RenderableData.Node

The node that this is CSS data for.

ScreenRegion Css.RenderableData.OnScreenRegion
package

The region that this element takes on the screen. Null if it's offscreen.

DisplayableProperty [] Css.RenderableData.RenderProperties

The set of renderable properties on this element.

SortedDictionary<int,RenderableData> Css.RenderableData.StackingContexts

All stacking contexts can have child stacking contexts. This exists if this is a stacking context. It will always contain at least 1 entry (at index 0) which refers to this node. That essentially enables negative z-index values to render before the normal flow.

float Css.RenderableData.ValueScale =1f

The zoom scale for all pixel based values on this style.

VirtualElements Css.RenderableData.Virtuals

The set of virtual elements if it exists.

Property Documentation

BackgroundColour Css.RenderableData.BGColour
getset

This handles rendering a solid background colour for this element.

BackgroundImage Css.RenderableData.BGImage
getset

This handles rendering a tiled, clipped, offset background image for this element.

BorderProperty Css.RenderableData.Border
getset

This handles rendering the border around this element, if any.

int Css.RenderableData.BoxCount
get

Counts the number of boxes in the box linked list (starting at FirstBox).

ComputedStyle Css.RenderableData.computedStyle
get

The computed style to use.

float Css.RenderableData.ContentHeight
get

The width of the content inside the box. Note that this is different from both InnerWidth and PixelWidth (which describe the "window" in which the content is seen).

float Css.RenderableData.ContentWidth
get

The width of the content inside the box. Note that this is different from both InnerWidth and PixelWidth (which describe the "window" in which the content is seen).

ReflowDocument Css.RenderableData.Document
get

A reflow-capable document.

int Css.RenderableData.EndSpaceSize
get

The width in pixels of the last whitespace of this element, if it's got one.

bool Css.RenderableData.HasBackground
get

True if this element has any form of background.

float Css.RenderableData.InnerHeight
get

The height of this element, excluding the border and padding.

float Css.RenderableData.InnerWidth
get

The width of this element, excluding the border and padding.

bool Css.RenderableData.IsOutOfFlow
get

True if this is not positioned in the flow

bool Css.RenderableData.IsStackingContext
getset

True if this is a stacking context.

float Css.RenderableData.OffsetLeft
get

The global offset from the left edge. Computed in secondary layout pass.

float Css.RenderableData.OffsetTop
get

The global offset from the top edge. Computed in secondary layout pass.

RenderableData Css.RenderableData.parentData
get

The parent renderable data.

Node Css.RenderableData.parentNode
get

Gets the parent node.

float Css.RenderableData.PixelHeight
get

The total height in pixels of this element.

float Css.RenderableData.PixelWidth
get

The total width in pixels of this element.

RasterDisplayableProperty Css.RenderableData.RasterProperty
getset

Gets or sets a RasterDisplayableProperty.

bool Css.RenderableData.Ready
get

True if the box model is ready and loaded.

SelectionRenderingProperty Css.RenderableData.Selection
getset

Selection zone.

TextRenderingProperty Css.RenderableData.Text
getset

This handles rendering text contained by this element.

TextRenderingProperty3D Css.RenderableData.Text3D
getset

This handles rendering 3D text contained by this element. Use text-extrude CSS property (a number).