1<?php
2class FlowViewport {
3  var $left;
4  var $top;
5  var $width;
6  var $height;
7
8  function FlowViewport() {
9    $this->left = 0;
10    $this->top = 0;
11    $this->width = 0;
12    $this->height = 0;
13  }
14
15  function &create(&$box) {
16    $viewport = new FlowViewport;
17    $viewport->left   = $box->get_left_padding();
18    $viewport->top    = $box->get_top_padding();
19
20    $padding = $box->get_css_property(CSS_PADDING);
21
22    $viewport->width  = $box->get_width() + $padding->left->value + $padding->right->value;
23    $viewport->height = $box->get_height() + $padding->top->value + $padding->bottom->value;
24
25    return $viewport;
26  }
27
28  function get_left() { return $this->left; }
29  function get_top() { return $this->top; }
30  function get_height() { return $this->height; }
31  function get_width() { return $this->width; }
32}
33?>