function parse($value, &$pipeline) { $style = new ListStyleValue(); $style->image = CSSListStyleImage::parse($value, $pipeline); $style->position = CSSListStylePosition::parse($value); $style->type = CSSListStyleType::parse($value); return $style; }
function &create(&$root, &$pipeline) { $box = new ListItemBox($root, $pipeline); $box->readCSS($pipeline->getCurrentCSSState()); /** * Create text box containing item number */ $css_state =& $pipeline->getCurrentCSSState(); $css_state->pushState(); $css_state->setProperty(CSS_COLOR, CSSColor::parse('transparent')); $list_style = $css_state->getProperty(CSS_LIST_STYLE); $box->str_number_box = TextBox::create(CSSListStyleType::format_number($list_style->type, $css_state->getProperty(CSS_HTML2PS_LIST_COUNTER)) . ". ", 'iso-8859-1', $pipeline); $box->str_number_box->baseline = $box->str_number_box->default_baseline; $css_state->popState(); /** * Create nested items */ $box->create_content($root, $pipeline); return $box; }
function ListItemBox(&$root, &$pipeline) { // Call parent constructor $this->BlockBox($root); // Pseudo-CSS properties // '-list-counter' $counter =& get_css_handler('-list-counter'); $background_color =& get_css_handler('background-color'); $background_color->push_css('transparent', $pipeline); $this->str_number_box = TextBox::create(CSSListStyleType::format_number($this->list_style->type, $counter->get()), 'iso-8859-1'); $this->str_number_box->baseline = $this->str_number_box->default_baseline; $background_color->pop(); // increase counter value $counter->pop(); // remove inherited value $counter->replace($counter->get() + 1); $counter->push($counter->get()); // open the marker image if specified if (!$this->list_style->image->is_default()) { $this->marker_image = $this->list_style->image->_image; } else { $this->marker_image = null; } }
function show_footnote(&$driver, $x, $y) { /** * Render note reference number */ $this->_note_marker_box->content[0]->words[0] = CSSListStyleType::format_number(LST_DECIMAL, $this->_note_number); $this->_note_marker_box->moveto($x, $y); $this->_note_marker_box->show_fixed($driver); /** * Render note content */ $this->_note_content->moveto($x + $this->_note_marker_box->content[0]->get_width() * 0.75, $y); $this->_note_content->show_fixed($driver); return $y - $this->_note_content->get_full_height(); }
function is_default() { return $this->image->is_default() && $this->position == CSSListStylePosition::default_value() && $this->type == CSSListStyleType::default_value(); }