180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru/*
380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * Copyright 2006 The Android Open Source Project
480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru *
580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * Use of this source code is governed by a BSD-style license that can be
680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * found in the LICENSE file.
780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru */
880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
1080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#include "SkTypes.h"
1180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#include "SkWindow.h"
1280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
1380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruextern "C" {
1480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    typedef long JSWord;
1580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    typedef JSWord jsword;
1680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    typedef jsword  jsval;
1780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    typedef struct JSRuntime JSRuntime;
1880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    typedef struct JSContext JSContext;
1980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    typedef struct JSObject JSObject;
2080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru}
2180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
2280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruclass SkString;
2380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
2480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruclass SkJS : public SkOSWindow {
2580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Querupublic:
2680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SkJS(void* hwnd);
2780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    ~SkJS();
2880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SkBool EvaluateScript(const char* script, jsval* rVal);
2980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SkBool ValueToString(jsval value, SkString* string);
3080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#ifdef SK_DEBUG
3180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    static void Test(void* hwnd);
3280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#endif
3380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruprotected:
3480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    void InitializeDisplayables(const SkBitmap& , JSContext *, JSObject *, JSObject *);
3580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    void DisposeDisplayables();
3680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    JSRuntime *fRuntime;
3780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    JSContext *fContext;
3880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    JSObject *fGlobal;
3980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru};
40