CanvasRenderingContext2D.idl

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
00003  *
00004  * Redistribution and use in source and binary forms, with or without
00005  * modification, are permitted provided that the following conditions
00006  * are met:
00007  * 1. Redistributions of source code must retain the above copyright
00008  *    notice, this list of conditions and the following disclaimer.
00009  * 2. Redistributions in binary form must reproduce the above copyright
00010  *    notice, this list of conditions and the following disclaimer in the
00011  *    documentation and/or other materials provided with the distribution.
00012  *
00013  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
00014  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00015  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00016  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
00017  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00018  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00019  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00020  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00021  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00022  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00023  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
00024  */
00025 
00026 module html {
00027 
00028     interface CanvasRenderingContext2D {
00029 
00030         // Web Applications 1.0 draft
00031 
00032         readonly attribute HTMLCanvasElement canvas;
00033 
00034         void save();
00035         void restore();
00036 
00037         void scale(in float sx, in float sy);
00038         void rotate(in float angle);
00039         void translate(in float tx, in float ty);
00040 
00041         attribute float globalAlpha;
00042         attribute DOMString globalCompositeOperation;
00043 
00044         CanvasGradient createLinearGradient(in float x0, in float y0, in float x1, in float y1);
00045         CanvasGradient createRadialGradient(in float x0, in float y0, in float r0, in float x1, in float y1, in float r1);
00046 
00047         attribute float lineWidth;
00048         attribute DOMString lineCap;
00049         attribute DOMString lineJoin;
00050         attribute float miterLimit;
00051 
00052         attribute float shadowOffsetX;
00053         attribute float shadowOffsetY;
00054         attribute float shadowBlur;
00055         attribute DOMString shadowColor;
00056 
00057         void clearRect(in float x, in float y, in float width, in float height)
00058             raises (DOMException);
00059         void fillRect(in float x, in float y, in float width, in float height)
00060             raises (DOMException);
00061 
00062         void beginPath();
00063         void closePath();
00064         void moveTo(in float x, in float y);
00065         void lineTo(in float x, in float y);
00066         void quadraticCurveTo(in float cpx, in float cpy, in float x, in float y);
00067         void bezierCurveTo(in float cp1x, in float cp1y, in float cp2x, in float cp2y, in float x, in float y);
00068         void arcTo(in float x1, in float y1, in float x2, in float y2, in float radius)
00069             raises (DOMException);
00070         void rect(in float x, in float y, in float width, in float height)
00071             raises (DOMException);
00072         void arc(in float x, in float y, in float radius, in float startAngle, in float endAngle, in boolean clockwise)
00073             raises (DOMException);
00074         void fill();
00075         void stroke();
00076         void clip();
00077 
00078         // other
00079 
00080         void setAlpha(in float alpha);
00081         void setCompositeOperation(in DOMString compositeOperation);
00082 
00083         void setLineWidth(in float width);
00084         void setLineCap(in DOMString cap);
00085         void setLineJoin(in DOMString join);
00086         void setMiterLimit(in float limit);
00087 
00088         void clearShadow();
00089 
00090         [Custom] void setStrokeColor(/* 1  */);
00091         [Custom] void setFillColor(/* 1 */);
00092         [Custom] void strokeRect(/* 4 */);
00093         [Custom] void drawImage(/* 3 */);
00094         [Custom] void drawImageFromRect(/* 10 */);
00095         [Custom] void setShadow(/* 3 */);
00096         [Custom] void createPattern(/* 2 */);
00097         
00098         attribute [Custom] custom strokeStyle;
00099         attribute [Custom] custom fillStyle;        
00100     };
00101 
00102 }
00103 

Generated on Fri Feb 9 15:10:25 2007 for Web Kit DOM by  doxygen 1.5.1