/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is the Mozilla SVG project.
 *
 * The Initial Developer of the Original Code is
 * Crocodile Clips Ltd.
 * Portions created by the Initial Developer are Copyright (C) 2002
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *   Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either of the GNU General Public License Version 2 or later (the "GPL"),
 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

#include "nsISupports.idl"

/**
 * \addtogroup renderer_interfaces Rendering Engine Interfaces
 * @{
 */

/**
 * One of a number of interfaces (all starting with nsISVGRenderer*)
 * to be implemented by an SVG rendering engine. See nsISVGRenderer
 * for more details.
 *
 * This interface is used by an nsISVGRendererPathGeometry object in
 * a call to nsISVGPathGeometrySource::constructPath() to obtain a
 * native representation of the path described by
 * nsISVGPathGeometrySource.
 */
[uuid(c3cd294e-39ae-4718-b2bc-87c0fad97a12)]
interface nsISVGRendererPathBuilder : nsISupports
{
  /**
   * Move current position and start new sub-path.
   *
   * @param x X-coordinate (untransformed).
   * @param y Y-coordinate (untransformed).
   */
  void moveto(in float x, in float y);

  /**
   * Draw a straight line from the current position to (x,y). Advance
   * current position to (x,y).
   *
   * @param x X-coordinate of end point (untransformed).
   * @param y Y-coordinate of end point (untransformed).
   */
  void lineto(in float x, in float y);

  /**
   * Draw cubic Bezier curve from the current position to (x,y) using
   * (x1,y1) as the control point at the beginning og the curve and
   * (x2,y2) as the control point at the end of the curve. Advance
   * current position to (x,y).
   *
   * @param x  X-coordinate of end point (untransformed).
   * @param y  Y-coordinate of end point (untransformed).
   * @param x1 X-coordinate of first control point (untransformed).
   * @param y1 Y-coordinate of first control point (untransformed).
   * @param x2 X-coordinate of second control point (untransformed).
   * @param y2 Y-coordinate of second control point (untransformed).
   */
  void curveto(in float x, in float y, in float x1, in float y1, in float x2, in float y2);

  /**
   * Draw an elliptical arc from the current position to
   * (x,y). Advance current position to (x,y).
   *
   * @param x            X-coordinate of end point (untransformed).
   * @param y            Y-coordinate of end point (untransformed).
   * @param r1           Radius of ellipse in X direction (untransformed).
   * @param r2           Radius of ellipse in Y direction (untransformed).
   * @param angle        Rotation of ellipse as a whole (untransformed).
   * @param largeArcFlag PR_TRUE: choose the large arc (>=180 degrees),
   *                     PR_FALSE: choose the smaller arc (<=180 degrees)
   * @param sweepFlag    PR_TRUE: sweep in positive angle direction,
   *                     PR_FALSE: sweep in negative angle direction
   */
  void arcto(in float x, in float y, in float r1, in float r2, in float angle,
             in boolean largeArcFlag, in boolean sweepFlag);

  /**
   * Close the current subpath. Move current position back to
   * beginning of subpath.
   *
   * @param newX X-coordinate of new current position (untransformed).
   * @param newY Y-coordinate of new current position (untransformed).
   */
  void closePath(out float newX, out float newY);

  /**
   * End the path description. Guaranteed to be the last function
   * called.
   */
  void endPath();
};

/** @} */
