blob: 645e03b4c5f15c882e91dfdc382f959bbc6b9412 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
reed@android.com8a1c16f2008-12-17 15:59:43 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * Copyright 2006 The Android Open Source Project
reed@android.com8a1c16f2008-12-17 15:59:43 +00004 *
epoger@google.comec3ed6a2011-07-28 14:26:00 +00005 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
reed@android.com8a1c16f2008-12-17 15:59:43 +00007 */
8
epoger@google.comec3ed6a2011-07-28 14:26:00 +00009
reed@android.com8a1c16f2008-12-17 15:59:43 +000010#include "SkTypes.h"
11#include "SkWindow.h"
12
13extern "C" {
14 typedef long JSWord;
15 typedef JSWord jsword;
16 typedef jsword jsval;
17 typedef struct JSRuntime JSRuntime;
18 typedef struct JSContext JSContext;
19 typedef struct JSObject JSObject;
20}
21
22class SkString;
23
24class SkJS : public SkOSWindow {
25public:
26 SkJS(void* hwnd);
27 ~SkJS();
28 SkBool EvaluateScript(const char* script, jsval* rVal);
29 SkBool ValueToString(jsval value, SkString* string);
30#ifdef SK_DEBUG
31 static void Test(void* hwnd);
32#endif
33protected:
34 void InitializeDisplayables(const SkBitmap& , JSContext *, JSObject *, JSObject *);
35 void DisposeDisplayables();
36 JSRuntime *fRuntime;
37 JSContext *fContext;
38 JSObject *fGlobal;
39};
40