|
1 /* |
|
2 This file is part of the WebKit open source project. |
|
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
|
4 |
|
5 This library is free software; you can redistribute it and/or |
|
6 modify it under the terms of the GNU Library General Public |
|
7 License as published by the Free Software Foundation; either |
|
8 version 2 of the License, or (at your option) any later version. |
|
9 |
|
10 This library is distributed in the hope that it will be useful, |
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 Library General Public License for more details. |
|
14 |
|
15 You should have received a copy of the GNU Library General Public License |
|
16 along with this library; see the file COPYING.LIB. If not, write to |
|
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
18 Boston, MA 02110-1301, USA. |
|
19 */ |
|
20 |
|
21 #ifndef JSCanvasRenderingContext2D_H |
|
22 #define JSCanvasRenderingContext2D_H |
|
23 |
|
24 #include "kjs_binding.h" |
|
25 |
|
26 namespace WebCore { |
|
27 |
|
28 class CanvasRenderingContext2D; |
|
29 |
|
30 class JSCanvasRenderingContext2D : public KJS::DOMObject { |
|
31 public: |
|
32 JSCanvasRenderingContext2D(KJS::ExecState*, CanvasRenderingContext2D*); |
|
33 virtual ~JSCanvasRenderingContext2D(); |
|
34 virtual bool getOwnPropertySlot(KJS::ExecState*, const KJS::Identifier&, KJS::PropertySlot&); |
|
35 KJS::JSValue* getValueProperty(KJS::ExecState*, int token) const; |
|
36 virtual void put(KJS::ExecState*, const KJS::Identifier&, KJS::JSValue*, int attr = KJS::None); |
|
37 void putValueProperty(KJS::ExecState*, int, KJS::JSValue*, int attr); |
|
38 virtual const KJS::ClassInfo* classInfo() const { return &info; } |
|
39 static const KJS::ClassInfo info; |
|
40 |
|
41 enum { |
|
42 // Attributes |
|
43 CanvasAttrNum, GlobalAlphaAttrNum, GlobalCompositeOperationAttrNum, LineWidthAttrNum, |
|
44 LineCapAttrNum, LineJoinAttrNum, MiterLimitAttrNum, ShadowOffsetXAttrNum, |
|
45 ShadowOffsetYAttrNum, ShadowBlurAttrNum, ShadowColorAttrNum, StrokeStyleAttrNum, |
|
46 FillStyleAttrNum, |
|
47 |
|
48 // Functions |
|
49 SaveFuncNum, RestoreFuncNum, ScaleFuncNum, RotateFuncNum, |
|
50 TranslateFuncNum, CreateLinearGradientFuncNum, CreateRadialGradientFuncNum, ClearRectFuncNum, |
|
51 FillRectFuncNum, BeginPathFuncNum, ClosePathFuncNum, MoveToFuncNum, |
|
52 LineToFuncNum, QuadraticCurveToFuncNum, BezierCurveToFuncNum, ArcToFuncNum, |
|
53 RectFuncNum, ArcFuncNum, FillFuncNum, StrokeFuncNum, |
|
54 ClipFuncNum, SetAlphaFuncNum, SetCompositeOperationFuncNum, SetLineWidthFuncNum, |
|
55 SetLineCapFuncNum, SetLineJoinFuncNum, SetMiterLimitFuncNum, ClearShadowFuncNum, |
|
56 SetStrokeColorFuncNum, SetFillColorFuncNum, StrokeRectFuncNum, DrawImageFuncNum, |
|
57 DrawImageFromRectFuncNum, SetShadowFuncNum, CreatePatternFuncNum |
|
58 }; |
|
59 |
|
60 // Custom attributes |
|
61 KJS::JSValue* strokeStyle(KJS::ExecState*) const; |
|
62 void setStrokeStyle(KJS::ExecState*, KJS::JSValue*); |
|
63 KJS::JSValue* fillStyle(KJS::ExecState*) const; |
|
64 void setFillStyle(KJS::ExecState*, KJS::JSValue*); |
|
65 |
|
66 // Custom functions |
|
67 KJS::JSValue* setStrokeColor(KJS::ExecState*, const KJS::List&); |
|
68 KJS::JSValue* setFillColor(KJS::ExecState*, const KJS::List&); |
|
69 KJS::JSValue* strokeRect(KJS::ExecState*, const KJS::List&); |
|
70 KJS::JSValue* drawImage(KJS::ExecState*, const KJS::List&); |
|
71 KJS::JSValue* drawImageFromRect(KJS::ExecState*, const KJS::List&); |
|
72 KJS::JSValue* setShadow(KJS::ExecState*, const KJS::List&); |
|
73 KJS::JSValue* createPattern(KJS::ExecState*, const KJS::List&); |
|
74 CanvasRenderingContext2D* impl() const { return m_impl.get(); } |
|
75 private: |
|
76 RefPtr<CanvasRenderingContext2D> m_impl; |
|
77 }; |
|
78 |
|
79 KJS::JSValue* toJS(KJS::ExecState*, CanvasRenderingContext2D*); |
|
80 CanvasRenderingContext2D* toCanvasRenderingContext2D(KJS::JSValue*); |
|
81 |
|
82 class JSCanvasRenderingContext2DPrototype : public KJS::JSObject { |
|
83 public: |
|
84 static KJS::JSObject* self(KJS::ExecState* exec); |
|
85 virtual const KJS::ClassInfo* classInfo() const { return &info; } |
|
86 static const KJS::ClassInfo info; |
|
87 bool getOwnPropertySlot(KJS::ExecState*, const KJS::Identifier&, KJS::PropertySlot&); |
|
88 JSCanvasRenderingContext2DPrototype(KJS::ExecState* exec) |
|
89 : KJS::JSObject(exec->lexicalInterpreter()->builtinObjectPrototype()) { } |
|
90 }; |
|
91 |
|
92 class JSCanvasRenderingContext2DPrototypeFunction : public KJS::InternalFunctionImp { |
|
93 public: |
|
94 JSCanvasRenderingContext2DPrototypeFunction(KJS::ExecState* exec, int i, int len, const KJS::Identifier& name) |
|
95 : KJS::InternalFunctionImp(static_cast<KJS::FunctionPrototype*>(exec->lexicalInterpreter()->builtinFunctionPrototype()), name) |
|
96 , id(i) |
|
97 { |
|
98 put(exec, exec->propertyNames().length, KJS::jsNumber(len), KJS::DontDelete|KJS::ReadOnly|KJS::DontEnum); |
|
99 } |
|
100 virtual KJS::JSValue* callAsFunction(KJS::ExecState*, KJS::JSObject*, const KJS::List&); |
|
101 |
|
102 private: |
|
103 int id; |
|
104 }; |
|
105 |
|
106 } // namespace WebCore |
|
107 |
|
108 #endif |