Detailed Description

Stores the information used whilst laying out boxes during a reflow.

Inheritance diagram for PowerUI.LineBoxMeta:
PowerUI.BlockBoxMeta PowerUI.InlineBoxMeta

Public Member Functions

 LineBoxMeta (LineBoxMeta parent, LayoutBox firstBox, RenderableData renderData)
 
void RemoveFromLine (LayoutBox box)
 Removes the given box from this line. Must not be the first one. More...
 
void TryBreakParent ()
 Attempts to break a line for a parent inline node. More...
 
int GetLineSpace (float width, float initialOffset)
 Ensures the given amount of space is available by completing the line if needed and potentially clearing floats too. More...
 
float FloatClearance (bool left)
 The float 'clearance' on the left/right. It's basically the bottom of left/right floats. More...
 
bool TryClearFloat ()
 Tries to clear a left/right float (whichever is shortest first). More...
 
void ClearFloat (int mode)
 Clears left/right/both floats. More...
 
void CompleteLine (int settings)
 Completes a line, optionally breaking it. More...
 
void AdvancePen (LayoutBox styleBox)
 Advances the pen now. More...
 

Public Attributes

BlockBoxMeta HostBlock
 The "host" block box. More...
 
float LineHeight
 The height of the current line being processed. More...
 
int HorizontalAlign
 The value for horizontal-align. If it's not required, this is just 0. More...
 
int VerticalAlign
 The value for vertical-align. More...
 
float VerticalAlignOffset
 Vertical-align offset from the baseline. More...
 
LineBoxMeta Parent
 The next box in the hierarchy. More...
 
RenderableData RenderData
 The inline element. More...
 
float MaxOffset
 An offset to apply to MaxX. More...
 
bool ContainsBidirectional
 True if the current line contains bi-directional text. I.e. Any box with a non-zero "UnicodeBidi" value. More...
 
float CssLineHeight
 The value of the CSS line-height property. More...
 

Package Functions

void AddToLine (LayoutBox styleBox)
 Adds the given style to the current line. More...
 

Package Attributes

LayoutBox LastOnLine
 A linked list of elements on a line are kept. This is the last element on the current line. More...
 
LayoutBox FirstOnLine
 A linked list of elements on a line are kept. This is the first element on the current line. More...
 
LayoutBox LastOutOfFlow
 A linked list of elements on a line are kept. This is the last element on the current out of flow line. More...
 
LayoutBox FirstOutOfFlow
 A linked list of elements on a line are kept. This is the first element on the current out of flow line. More...
 
LayoutBox LastLineStart
 The last line start. Tracked for alignment. More...
 
LayoutBox FirstLineStart
 The first line start. Tracked for alignment. More...
 
int WhiteSpace
 This boxes whitespace mode. More...
 
float ClearY_
 The current 'clear zone'. Added to PenY when something is added to the current line. More...
 
FloatingElements Floats
 The set of active floated elements for the current line being rendered. More...
 
float PenX
 The current x location of the renderer in screen pixels from the left. More...
 
LayoutBox CurrentBox
 The current box being worked on. More...
 

Properties

virtual float PenY [get, set]
 The current y location of the renderer in screen pixels from the top. More...
 
virtual float LargestLineWidth [get, set]
 The length of the longest line so far. Used for the content width. More...
 
virtual bool GoingLeftwards [get, set]
 True if the rendering direction is left. This originates from the direction: css property. More...
 
virtual float LineStart [get, set]
 The start position of a line. More...
 
virtual float MaxX [get, set]
 The x value that must not be exceeded by elements on a line. Used if the parent has fixed width. More...
 

Private Member Functions

void AlignHorizontally (LayoutBox currentBox, LayoutBox lastBox, float lineSpace, int elementCount, float lineLength, int align)
 Horizontally aligns a line based on alignment settings. More...
 
void RightwardsAlign (LayoutBox currentBox, LayoutBox to, float lineMax)
 Part of the bi-directional algorithm. Converts leftwards boxes to rightwards ones. More...
 
bool ClearLineSpace (int floatMode)
 Attempts to clear left or right. If they're both the same height then it will clear the given side. More...
 

Constructor & Destructor Documentation

PowerUI.LineBoxMeta.LineBoxMeta ( LineBoxMeta  parent,
LayoutBox  firstBox,
RenderableData  renderData 
)
inline

Member Function Documentation

void PowerUI.LineBoxMeta.AddToLine ( LayoutBox  styleBox)
inlinepackage

Adds the given style to the current line.

Parameters
styleThe style to add.
void PowerUI.LineBoxMeta.AdvancePen ( LayoutBox  styleBox)
inline

Advances the pen now.

void PowerUI.LineBoxMeta.AlignHorizontally ( LayoutBox  currentBox,
LayoutBox  lastBox,
float  lineSpace,
int  elementCount,
float  lineLength,
int  align 
)
inlineprivate

Horizontally aligns a line based on alignment settings.

Parameters
currentBoxThe style of the first element on the line.
lineSpaceThe amount of space available to the line.
elementCountThe number of elements on this line.
lineLengthThe width of the line in pixels.
parentBoxThe style which defines the alignment.
void PowerUI.LineBoxMeta.ClearFloat ( int  mode)
inline

Clears left/right/both floats.

bool PowerUI.LineBoxMeta.ClearLineSpace ( int  floatMode)
inlineprivate

Attempts to clear left or right. If they're both the same height then it will clear the given side.

void PowerUI.LineBoxMeta.CompleteLine ( int  settings)
inline

Completes a line, optionally breaking it.

Parameters
settingsValues from LineBreakMode. You'd usually pass Normal.
float PowerUI.LineBoxMeta.FloatClearance ( bool  left)
inline

The float 'clearance' on the left/right. It's basically the bottom of left/right floats.

int PowerUI.LineBoxMeta.GetLineSpace ( float  width,
float  initialOffset 
)
inline

Ensures the given amount of space is available by completing the line if needed and potentially clearing floats too.

Returns
True if it broke.
void PowerUI.LineBoxMeta.RemoveFromLine ( LayoutBox  box)
inline

Removes the given box from this line. Must not be the first one.

void PowerUI.LineBoxMeta.RightwardsAlign ( LayoutBox  currentBox,
LayoutBox  to,
float  lineMax 
)
inlineprivate

Part of the bi-directional algorithm. Converts leftwards boxes to rightwards ones.

void PowerUI.LineBoxMeta.TryBreakParent ( )
inline

Attempts to break a line for a parent inline node.

bool PowerUI.LineBoxMeta.TryClearFloat ( )
inline

Tries to clear a left/right float (whichever is shortest first).

Returns
True if either side was cleared.

Member Data Documentation

float PowerUI.LineBoxMeta.ClearY_
package

The current 'clear zone'. Added to PenY when something is added to the current line.

bool PowerUI.LineBoxMeta.ContainsBidirectional

True if the current line contains bi-directional text. I.e. Any box with a non-zero "UnicodeBidi" value.

float PowerUI.LineBoxMeta.CssLineHeight

The value of the CSS line-height property.

LayoutBox PowerUI.LineBoxMeta.CurrentBox
package

The current box being worked on.

LayoutBox PowerUI.LineBoxMeta.FirstLineStart
package

The first line start. Tracked for alignment.

LayoutBox PowerUI.LineBoxMeta.FirstOnLine
package

A linked list of elements on a line are kept. This is the first element on the current line.

LayoutBox PowerUI.LineBoxMeta.FirstOutOfFlow
package

A linked list of elements on a line are kept. This is the first element on the current out of flow line.

FloatingElements PowerUI.LineBoxMeta.Floats
package

The set of active floated elements for the current line being rendered.

int PowerUI.LineBoxMeta.HorizontalAlign

The value for horizontal-align. If it's not required, this is just 0.

BlockBoxMeta PowerUI.LineBoxMeta.HostBlock

The "host" block box.

LayoutBox PowerUI.LineBoxMeta.LastLineStart
package

The last line start. Tracked for alignment.

LayoutBox PowerUI.LineBoxMeta.LastOnLine
package

A linked list of elements on a line are kept. This is the last element on the current line.

LayoutBox PowerUI.LineBoxMeta.LastOutOfFlow
package

A linked list of elements on a line are kept. This is the last element on the current out of flow line.

float PowerUI.LineBoxMeta.LineHeight

The height of the current line being processed.

float PowerUI.LineBoxMeta.MaxOffset

An offset to apply to MaxX.

LineBoxMeta PowerUI.LineBoxMeta.Parent

The next box in the hierarchy.

float PowerUI.LineBoxMeta.PenX
package

The current x location of the renderer in screen pixels from the left.

RenderableData PowerUI.LineBoxMeta.RenderData

The inline element.

int PowerUI.LineBoxMeta.VerticalAlign

The value for vertical-align.

float PowerUI.LineBoxMeta.VerticalAlignOffset

Vertical-align offset from the baseline.

int PowerUI.LineBoxMeta.WhiteSpace
package

This boxes whitespace mode.

Property Documentation

virtual bool PowerUI.LineBoxMeta.GoingLeftwards
getset

True if the rendering direction is left. This originates from the direction: css property.

virtual float PowerUI.LineBoxMeta.LargestLineWidth
getset

The length of the longest line so far. Used for the content width.

virtual float PowerUI.LineBoxMeta.LineStart
getset

The start position of a line.

virtual float PowerUI.LineBoxMeta.MaxX
getset

The x value that must not be exceeded by elements on a line. Used if the parent has fixed width.

virtual float PowerUI.LineBoxMeta.PenY
getset

The current y location of the renderer in screen pixels from the top.