1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:37:44 +00:00

LibWeb: Generate CanvasRenderingContext2D bindings from IDL :^)

We're still missing optional argument support, so this implementation
doesn't support fill(), only fill(fill_rule).

Still it's really nice to get rid of so much hand-written wrapper code.
This commit is contained in:
Andreas Kling 2020-06-22 18:39:22 +02:00
parent f361d25ec8
commit 9ce25bbf1d
8 changed files with 84 additions and 505 deletions

View file

@ -0,0 +1,28 @@
interface CanvasRenderingContext2D {
void fillRect(double x, double y, double w, double h);
void strokeRect(double x, double y, double w, double h);
void scale(double x, double y);
void translate(double x, double y);
void beginPath();
void closePath();
void fill(DOMString fillRule);
void stroke();
void moveTo(double x, double y);
void lineTo(double x, double y);
void quadraticCurveTo(double cpx, double cpy, double x, double y);
void drawImage(HTMLImageElement image, double dx, double dy);
attribute DOMString fillStyle;
attribute DOMString strokeStyle;
attribute double lineWidth;
ImageData createImageData(double sw, double sh);
void putImageData(ImageData imagedata, double dx, double dy);
readonly attribute HTMLCanvasElement canvas;
}