michael@0: michael@0: /* michael@0: * Copyright 2006 The Android Open Source Project michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: michael@0: #include "SkTypes.h" michael@0: #include "SkWindow.h" michael@0: michael@0: extern "C" { michael@0: typedef long JSWord; michael@0: typedef JSWord jsword; michael@0: typedef jsword jsval; michael@0: typedef struct JSRuntime JSRuntime; michael@0: typedef struct JSContext JSContext; michael@0: typedef struct JSObject JSObject; michael@0: } michael@0: michael@0: class SkString; michael@0: michael@0: class SkJS : public SkOSWindow { michael@0: public: michael@0: SkJS(void* hwnd); michael@0: ~SkJS(); michael@0: SkBool EvaluateScript(const char* script, jsval* rVal); michael@0: SkBool ValueToString(jsval value, SkString* string); michael@0: #ifdef SK_DEBUG michael@0: static void Test(void* hwnd); michael@0: #endif michael@0: protected: michael@0: void InitializeDisplayables(const SkBitmap& , JSContext *, JSObject *, JSObject *); michael@0: void DisposeDisplayables(); michael@0: JSRuntime *fRuntime; michael@0: JSContext *fContext; michael@0: JSObject *fGlobal; michael@0: };