// Path: src/main/java/org/fit/cssbox/render/BoxRenderer.java
// public interface BoxRenderer extends Closeable
// {
//     /**
//      * Initializes the renderer for rendering a ready-to-render viewport.
//      * @param vp The viewport that will be rendered. The viewport must be fully initialized
//      * and ready to draw.
//      */
//     public void init(Viewport vp);
//     
//     /**
//      * Initializes the rendering of an element. This is called before any contents of the element
//      * or child boxes are rendered. Note that the {@link BoxRenderer#renderElementBackground} method 
//      * may be called before this method.
//      * @param elem the element
//      */
//     public void startElementContents(ElementBox elem);
//     
//     /**
//      * Finishes the rendering of an element. This is called after all contents of the element
//      * and the child boxes are rendered.
//      * @param elem the element
//      */
//     public void finishElementContents(ElementBox elem);
//     
//     /**
//      * Renders the background and borders of the given element box according to its style.
//      * @param elem
//      */
//     public void renderElementBackground(ElementBox elem);
//     
//     /**
//      * Renders the marker (the bullet or item number) used by the list-item boxes.
//      * @param elem the list-item box
//      */
//     public void renderMarker(ListItemBox elem);
//     
//     /**
//      * Renders the text represented by a text box according to its computed style.
//      * @param text
//      */
//     public void renderTextContent(TextBox text);
//     
//     /**
//      * Renders the contents of a replaced box.
//      * @param box
//      */
//     public void renderReplacedContent(ReplacedBox box);
//     
//     /**
//      * Finishes and the output.
//      */
//     public void close() throws IOException;
//     
// }


import java.util.Vector;
import org.fit.cssbox.render.BoxRenderer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Element;
import cz.vutbr.web.css.CSSFactory;
/*
 * Viewport.java
 * Copyright (c) 2005-2020 Radek Burget
 *
 * CSSBox is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *  
 * CSSBox is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *  
 * You should have received a copy of the GNU Lesser General Public License
 * along with CSSBox. If not, see <http://www.gnu.org/licenses/>.
 */

package org.fit.cssbox.layout;




/**
 * The viewport is a special case of BlockElement that has several widths and heights:
 * 
 * <ul>
 * <li><strong>Viewport size</strong> - the width and height of the visible area used for
 * computing the sizes of the contained blocks.</li>
 * <li><strong>Canvas size</strong> - the width and height of the whole rendered page</li> 
 * 
 * @author radek
 */
public class Viewport extends BlockBox
{
    private static Logger log = LoggerFactory.getLogger(Viewport.class);
    
    /** Total canvas width */
	private float width;
	/** Total canvas height */
	private float height;
	/** Visible rectagle -- the position and size of the CSS viewport */
    private Rectangle visibleRect;
	
    protected BrowserConfig config;
	private BoxFactory factory;
// Path: src/main/java/org/fit/cssbox/render/BoxRenderer.java
// public interface BoxRenderer extends Closeable
// {
//     /**
//      * Initializes the renderer for rendering a ready-to-render viewport.
//      * @param vp The viewport that will be rendered. The viewport must be fully initialized
//      * and ready to draw.
//      */
//     public void init(Viewport vp);
//     
//     /**
//      * Initializes the rendering of an element. This is called before any contents of the element
//      * or child boxes are rendered. Note that the {@link BoxRenderer#renderElementBackground} method 
//      * may be called before this method.
//      * @param elem the element
//      */
//     public void startElementContents(ElementBox elem);
//     
//     /**
//      * Finishes the rendering of an element. This is called after all contents of the element
//      * and the child boxes are rendered.
//      * @param elem the element
//      */
//     public void finishElementContents(ElementBox elem);
//     
//     /**
//      * Renders the background and borders of the given element box according to its style.
//      * @param elem
//      */
//     public void renderElementBackground(ElementBox elem);
//     
//     /**
//      * Renders the marker (the bullet or item number) used by the list-item boxes.
//      * @param elem the list-item box
//      */
//     public void renderMarker(ListItemBox elem);
//     
//     /**
//      * Renders the text represented by a text box according to its computed style.
//      * @param text
//      */
//     public void renderTextContent(TextBox text);
//     
//     /**
//      * Renders the contents of a replaced box.
//      * @param box
//      */
//     public void renderReplacedContent(ReplacedBox box);
//     
//     /**
//      * Finishes and the output.
//      */
//     public void close() throws IOException;
//     
// }


// Path: src/main/java/org/fit/cssbox/layout/Viewport.java
import java.util.Vector;
import org.fit.cssbox.render.BoxRenderer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Element;
import cz.vutbr.web.css.CSSFactory;

/*
 * Viewport.java
 * Copyright (c) 2005-2020 Radek Burget
 *
 * CSSBox is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *  
 * CSSBox is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *  
 * You should have received a copy of the GNU Lesser General Public License
 * along with CSSBox. If not, see <http://www.gnu.org/licenses/>.
 */

package org.fit.cssbox.layout;




/**
 * The viewport is a special case of BlockElement that has several widths and heights:
 * 
 * <ul>
 * <li><strong>Viewport size</strong> - the width and height of the visible area used for
 * computing the sizes of the contained blocks.</li>
 * <li><strong>Canvas size</strong> - the width and height of the whole rendered page</li> 
 * 
 * @author radek
 */
public class Viewport extends BlockBox
{
    private static Logger log = LoggerFactory.getLogger(Viewport.class);
    
    /** Total canvas width */
	private float width;
	/** Total canvas height */
	private float height;
	/** Visible rectagle -- the position and size of the CSS viewport */
    private Rectangle visibleRect;
	
    protected BrowserConfig config;
	private BoxFactory factory;
	private BoxRenderer renderer;