Rocket::Core::LayoutEngine Class Reference

#include <LayoutEngine.h>

Collaboration diagram for Rocket::Core::LayoutEngine:

Public Member Functions

 LayoutEngine ()
 Constructs a new layout engine.
bool FormatElement (Element *element, const Vector2f &containing_block)

Static Public Member Functions

static void BuildBox (Box &box, const Vector2f &containing_block, Element *element, bool inline_element=false)
static void BuildBox (Box &box, float &min_height, float &max_height, LayoutBlockBox *containing_box, Element *element, bool inline_element=false)
static float ClampWidth (float width, Element *element, float containing_block_width)
static float ClampHeight (float height, Element *element, float containing_block_height)
static Vector2fRound (Vector2f &value)
static float Round (float value)
static void * AllocateLayoutChunk (size_t size)
static void DeallocateLayoutChunk (void *chunk)

Detailed Description

Author:
Robert Curry

Member Function Documentation

bool Rocket::Core::LayoutEngine::FormatElement ( Element element,
const Vector2f containing_block 
)

Formats the contents for a root-level element (usually a document, floating or replaced element).

Parameters:
element[in] The element to lay out.
containing_block[in] The size of the containing block.

void Rocket::Core::LayoutEngine::BuildBox ( Box box,
const Vector2f containing_block,
Element element,
bool  inline_element = false 
) [static]

Generates the box for an element.

Parameters:
[out] box The box to be built.
[in] containing_block The dimensions of the content area of the block containing the element.
[in] element The element to build the box for.
[in] inline_element True if the element is placed in an inline context, false if not.

void Rocket::Core::LayoutEngine::BuildBox ( Box box,
float &  min_height,
float &  max_height,
LayoutBlockBox containing_box,
Element element,
bool  inline_element = false 
) [static]

Generates the box for an element placed in a block box.

Parameters:
[out] box The box to be built.
[out] min_height The minimum height of the element's box.
[out] max_height The maximum height of the element's box.
[in] containing_box The block box containing the element.
[in] element The element to build the box for.
[in] inline_element True if the element is placed in an inline context, false if not.

float Rocket::Core::LayoutEngine::ClampWidth ( float  width,
Element element,
float  containing_block_width 
) [static]

Clamps the width of an element based from its min-width and max-width properties.

Parameters:
[in] width The width to clamp.
[in] element The element to read the properties from.
[in] containing_block_width The width of the element's containing block.
Returns:
The clamped width.

float Rocket::Core::LayoutEngine::ClampHeight ( float  height,
Element element,
float  containing_block_height 
) [static]

Clamps the height of an element based from its min-height and max-height properties.

Parameters:
[in] height The height to clamp.
[in] element The element to read the properties from.
[in] containing_block_height The height of the element's containing block.
Returns:
The clamped height.

Vector2f & Rocket::Core::LayoutEngine::Round ( Vector2f value  )  [static]

Rounds a vector of two floating-point values to integral values.

Parameters:
inout] value The vector to round.
Returns:
The rounded vector.

float Rocket::Core::LayoutEngine::Round ( float  value  )  [static]

Rounds a floating-point value to an integral value.

Parameters:
[in] value The value to round.
Returns:
The rounded value.


The documentation for this class was generated from the following files: