#include <v8.h>
#include "SkPaint.h"
-#include "BaseContext.h"
-
-using namespace v8;
+#include "DrawingMethods.h"
class SkCanvas;
class Global;
// context.fillStyle="#FF0000";
// context.fillRect(x, y, w, h);
// }
-class JsContext : public BaseContext {
+class JsContext : public DrawingMethods {
public:
JsContext(Global* global)
: INHERITED(global)
private:
// Wrap the 'this' pointer into an Object. Can be retrieved via Unwrap.
- Handle<Object> wrap();
+ v8::Handle<v8::Object> wrap();
// A handle to the onDraw function defined in the script.
- Persistent<Function> fOnDraw;
+ v8::Persistent<v8::Function> fOnDraw;
// The template for what a canvas context object looks like. The canvas
// context object is what's passed into the JS onDraw() function.
- static Persistent<ObjectTemplate> gContextTemplate;
+ static v8::Persistent<v8::ObjectTemplate> gContextTemplate;
// Only valid when inside OnDraw().
SkCanvas* fCanvas;
- typedef BaseContext INHERITED;
+ typedef DrawingMethods INHERITED;
};
#endif