summaryrefslogtreecommitdiffstats
path: root/V8Binding/jni/jni_npobject.cpp
blob: daa26a8749093417ca19474753c63d8aa395ce3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

#include "jni_npobject.h"

namespace V8 { namespace Binding {

static NPClass JavaNPClass = {
    NP_CLASS_STRUCT_VERSION,
    0,  // allocate,
    0,  // free,
    0,  // invalidate
    JavaNPObject_HasMethod,
    JavaNPObject_Invoke,
    0,  // invokeDefault,
    JavaNPObject_HasProperty,
    JavaNPobject_GetProperty,
    JavaNPObject_SetProperty,
    0,  // removeProperty
    0,  // enumerate
    0   // construct
};

NPObject* JavaInstanceToNPObject(PassRefPtr<JavaInstance> instance) {
    JavaNPObject* object = new JavaNPObject(instance);
    return static_cast<NPObject*>(object);
}

bool JavaNPObject_HasMethod(NPObject* obj, NPIdentifier name) {
    // FIXME: for now, always pretend the object has the named method.
    return true;
}

bool JavaNPObject_Invoke(NPobject* obj, NPIdentifier methodName, const NPVariant* args, uint32_t argCount, NPVariant* result) {

}

bool JavaNPObject_HasProperty(NPObject* obj, NPIdentifier name) {
}

bool JavaNPObject_GetProperty(NPObject* obj, NPIdentifier name, NPVariant* ressult) {
}

bool JavaNPObject_SetProperty(NPObject* obj, NPIdentifier name, const NPVariant* value) {

}

} }  // namespace V8::Binding