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 
00084         void save();
00085 
00098         void restore();
00099 
00127         void scale(in float sx, in float sy);
00128 
00151         void rotate(in float angle);
00152 
00177         void translate(in float tx, in float ty);
00178 
00187         attribute float globalAlpha;
00188 
00239         attribute [ConvertNullToNullString] DOMString globalCompositeOperation;
00240 
00253         CanvasGradient createLinearGradient(in float x0, in float y0, in float x1, in float y1);
00254 
00269         CanvasGradient createRadialGradient(in float x0, in float y0, in float r0, in float x1, in float y1, in float r1);
00270 
00278         attribute float lineWidth;
00279 
00285         attribute [ConvertNullToNullString] DOMString lineCap;
00286 
00292         attribute [ConvertNullToNullString] DOMString lineJoin;
00293 
00301         attribute float miterLimit;
00302 
00307         attribute float shadowOffsetX;
00308 
00313         attribute float shadowOffsetY;
00314 
00319         attribute float shadowBlur;
00320 
00334         attribute [ConvertNullToNullString] DOMString shadowColor;
00335 
00342         void clearRect(in float x, in float y, in float width, in float height)
00343             raises (DOMException);
00344 
00352         void fillRect(in float x, in float y, in float width, in float height)
00353             raises (DOMException);
00354 
00374         void beginPath();
00375 
00385         void closePath();
00386 
00407         void moveTo(in float x, in float y);
00408 
00419         void lineTo(in float x, in float y);
00420 
00430         void quadraticCurveTo(in float cpx, in float cpy, in float x, in float y);
00431 
00444         void bezierCurveTo(in float cp1x, in float cp1y, in float cp2x, in float cp2y, in float x, in float y);
00445 
00459         void arcTo(in float x1, in float y1, in float x2, in float y2, in float radius)
00460             raises (DOMException);
00461 
00466         void rect(in float x, in float y, in float width, in float height)
00467             raises (DOMException);
00468 
00485         void arc(in float x, in float y, in float radius, in float startAngle, in float endAngle, in boolean clockwise)
00486             raises (DOMException);
00487 
00505         void fill();
00506 
00522         void stroke();
00523 
00539         void clip();
00540 
00541         // other
00542 
00543         void setAlpha(in float alpha);
00544         void setCompositeOperation(in DOMString compositeOperation);
00545 
00546         void setLineWidth(in float width);
00547         void setLineCap(in DOMString cap);
00548         void setLineJoin(in DOMString join);
00549         void setMiterLimit(in float limit);
00550 
00551         void clearShadow();
00552 
00553         [Custom] void setStrokeColor(/* 1  */);
00554         [Custom] void setFillColor(/* 1 */);
00555 
00574         [Custom] void strokeRect(/* 4 */);
00575 
00598         [Custom] void drawImage(/* 3 */);
00599 
00601         [Custom] void drawImageFromRect(/* 10 */);
00602 
00603         [Custom] void setShadow(/* 3 */);
00604 
00625         [Custom] void createPattern(/* 2 */);
00626         
00645         attribute [Custom] custom strokeStyle;
00646 
00667         attribute [Custom] custom fillStyle;        
00668 
00669     };
00670 
00671 }
00672 

Generated on Thu Jan 10 15:18:54 2008 for Web Kit DOM by  doxygen 1.5.4