Transform.hx 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright (C)2005-2013 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. // This file is generated, do not edit!
  23. package js.html.svg;
  24. /** <p><code>SVGTransform</code> is the interface for one of the component transformations within an <code><a rel="custom" href="/api/js/html/svg/TransformList">SVGTransformList</a></code>
  25. ; thus, an <code>SVGTransform</code> object corresponds to a single component (e.g., <code>scale(…)</code> or <code>matrix(…)</code>) within a
  26. <code><a rel="custom" href="https://developer.mozilla.org/en/SVG/Attribute/transform">transform</a></code> attribute.</p>
  27. <p>An <code>SVGTransform</code> object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.</p><br><br>
  28. Documentation for this class was provided by <a href="https://developer.mozilla.org/en/DOM/SVGTransform">MDN</a>. */
  29. @:native("SVGTransform")
  30. extern class Transform
  31. {
  32. /** A <code>matrix(…)</code> transformation */
  33. static inline var SVG_TRANSFORM_MATRIX : Int = 1;
  34. static inline var SVG_TRANSFORM_ROTATE : Int = 4;
  35. /** A <code>scale(…)</code> transformation */
  36. static inline var SVG_TRANSFORM_SCALE : Int = 3;
  37. static inline var SVG_TRANSFORM_SKEWX : Int = 5;
  38. static inline var SVG_TRANSFORM_SKEWY : Int = 6;
  39. /** A <code>translate(…)</code> transformation */
  40. static inline var SVG_TRANSFORM_TRANSLATE : Int = 2;
  41. /** The unit type is not one of predefined unit types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. */
  42. static inline var SVG_TRANSFORM_UNKNOWN : Int = 0;
  43. /** A convenience attribute for <code>SVG_TRANSFORM_ROTATE</code>, <code>SVG_TRANSFORM_SKEWX</code> and <code>SVG_TRANSFORM_SKEWY</code>. It holds the angle that was specified.<br> <br> For <code>SVG_TRANSFORM_MATRIX</code>, <code>SVG_TRANSFORM_TRANSLATE</code> and <code>SVG_TRANSFORM_SCALE</code>, <code>angle</code> will be zero. */
  44. var angle(default,null) : Float;
  45. /** <p>The matrix that represents this transformation. The matrix object is live, meaning that any changes made to the <code>SVGTransform</code> object are immediately reflected in the matrix object and vice versa. In case the matrix object is changed directly (i.e., without using the methods on the <code>SVGTransform</code> interface itself) then the type of the <code>SVGTransform</code> changes to <code>SVG_TRANSFORM_MATRIX</code>.</p> <ul> <li>For <code>SVG_TRANSFORM_MATRIX</code>, the matrix contains the a, b, c, d, e, f values supplied by the user.</li> <li>For <code>SVG_TRANSFORM_TRANSLATE</code>, e and f represent the translation amounts (a=1, b=0, c=0 and d=1).</li> <li>For <code>SVG_TRANSFORM_SCALE</code>, a and d represent the scale amounts (b=0, c=0, e=0 and f=0).</li> <li>For <code>SVG_TRANSFORM_SKEWX</code> and <code>SVG_TRANSFORM_SKEWY</code>, a, b, c and d represent the matrix which will result in the given skew (e=0 and f=0).</li> <li>For <code>SVG_TRANSFORM_ROTATE</code>, a, b, c, d, e and f together represent the matrix which will result in the given rotation. When the rotation is around the center point (0, 0), e and f will be zero.</li> </ul> */
  46. var matrix(default,null) : Matrix;
  47. /** The type of the value as specified by one of the SVG_TRANSFORM_* constants defined on this interface. */
  48. var type(default,null) : Int;
  49. function setMatrix( matrix : Matrix ) : Void;
  50. function setRotate( angle : Float, cx : Float, cy : Float ) : Void;
  51. function setScale( sx : Float, sy : Float ) : Void;
  52. function setSkewX( angle : Float ) : Void;
  53. function setSkewY( angle : Float ) : Void;
  54. function setTranslate( tx : Float, ty : Float ) : Void;
  55. }