| 1 | <h2>Full example</h2> |
| 2 | <pre><code>[Exposed=Window] |
| 3 | interface Paint { }; |
| 4 | |
| 5 | [Exposed=Window] |
| 6 | interface SolidColor : Paint { |
| 7 | attribute double red; |
| 8 | attribute double green; |
| 9 | attribute double blue; |
| 10 | }; |
| 11 | |
| 12 | [Exposed=Window] |
| 13 | interface Pattern : Paint { |
| 14 | attribute DOMString imageURL; |
| 15 | }; |
| 16 | |
| 17 | [Exposed=Window] |
| 18 | interface GraphicalWindow { |
| 19 | constructor(); |
| 20 | readonly attribute unsigned long width; |
| 21 | readonly attribute unsigned long height; |
| 22 | |
| 23 | attribute Paint currentPaint; |
| 24 | |
| 25 | undefined drawRectangle(double x, double y, double width, double height); |
| 26 | |
| 27 | undefined drawText(double x, double y, DOMString text); |
| 28 | };</code></pre> |