rk towards the JavaScript ObjC bindings. The bindings now work for
authorrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Feb 2004 22:39:36 +0000 (22:39 +0000)
committerrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Feb 2004 22:39:36 +0000 (22:39 +0000)
commitc6d176b82ccc7be9d8e69a0d3d23e4bd8d95a181
tree353937cf48224cd37b728374c61194d803584d27
parentfef1d72024186179a2a7581d88e9ecdc10646605
rk towards the JavaScript ObjC bindings.  The bindings now work for
simple scalar types.  testbindings.mm is an illustration of how the
bindings work.

        Reviewed by Ken.

        * JavaScriptCore.pbproj/project.pbxproj:
        * Makefile.am:
        * bindings/jni/jni_class.cpp:
        (JavaClass::methodsNamed):
        * bindings/jni/jni_class.h:
        * bindings/jni/jni_instance.cpp:
        (JavaInstance::invokeMethod):
        * bindings/jni/jni_instance.h:
        * bindings/jni/jni_runtime.h:
        (KJS::Bindings::JavaMethod::returnType):
        * bindings/make_testbindings: Added.
        * bindings/objc/objc_class.h: Added.
        (KJS::Bindings::ObjcClass::~ObjcClass):
        (KJS::Bindings::ObjcClass::ObjcClass):
        (KJS::Bindings::ObjcClass::operator=):
        (KJS::Bindings::ObjcClass::constructorAt):
        (KJS::Bindings::ObjcClass::numConstructors):
        * bindings/objc/objc_class.mm: Added.
        (ObjcClass::_commonDelete):
        (ObjcClass::_commonCopy):
        (ObjcClass::_commonInit):
        (_createClassesByIsAIfNecessary):
        (ObjcClass::classForIsA):
        (ObjcClass::ObjcClass):
        (ObjcClass::name):
        (ObjcClass::methodsNamed):
        (ObjcClass::fieldNamed):
        * bindings/objc/objc_header.h: Added.
        * bindings/objc/objc_instance.h: Added.
        (KJS::Bindings::ObjcInstance::getObject):
        * bindings/objc/objc_instance.mm: Added.
        (ObjcInstance::ObjcInstance):
        (ObjcInstance::~ObjcInstance):
        (ObjcInstance::operator=):
        (ObjcInstance::begin):
        (ObjcInstance::end):
        (ObjcInstance::getClass):
        (ObjcInstance::invokeMethod):
        (ObjcInstance::defaultValue):
        (ObjcInstance::stringValue):
        (ObjcInstance::numberValue):
        (ObjcInstance::booleanValue):
        (ObjcInstance::valueOf):
        * bindings/objc/objc_jsobject.h: Added.
        * bindings/objc/objc_jsobject.mm: Added.
        * bindings/objc/objc_runtime.h:
        (KJS::Bindings::ObjcField::~ObjcField):
        (KJS::Bindings::ObjcField::ObjcField):
        (KJS::Bindings::ObjcField::operator=):
        (KJS::Bindings::ObjcMethod::ObjcMethod):
        (KJS::Bindings::ObjcMethod::~ObjcMethod):
        (KJS::Bindings::ObjcMethod::operator=):
        * bindings/objc/objc_runtime.mm: Added.
        (ObjcMethod::ObjcMethod):
        (ObjcMethod::name):
        (ObjcMethod::numParameters):
        (ObjcMethod::getMethodSignature):
        (ObjcField::ObjcField):
        (ObjcField::name):
        (ObjcField::type):
        (ObjcField::valueFromInstance):
        (ObjcField::setValueToInstance):
        * bindings/objc/objc_utility.h: Added.
        (KJS::Bindings::):
        * bindings/objc/objc_utility.mm: Added.
        (KJS::Bindings::JSMethodNameToObjCMethodName):
        (KJS::Bindings::convertValueToObjcValue):
        (KJS::Bindings::convertObjcValueToValue):
        (KJS::Bindings::objcValueTypeForType):
        * bindings/runtime.cpp:
        (MethodList::MethodList):
        (MethodList::operator=):
        (Instance::setValueOfField):
        (Instance::createBindingForLanguageInstance):
        (Instance::createRuntimeObject):
        * bindings/runtime.h:
        * bindings/runtime_method.cpp:
        (RuntimeMethodImp::RuntimeMethodImp):
        (RuntimeMethodImp::get):
        (RuntimeMethodImp::call):
        * bindings/runtime_method.h:
        * bindings/runtime_object.cpp:
        (RuntimeObjectImp::get):
        (RuntimeObjectImp::hasProperty):
        * bindings/test.js: Added.
        * bindings/testbindings.mm: Added.
        (-[MySecondInterface init]):
        (-[MyFirstInterface init]):
        (-[MyFirstInterface dealloc]):
        (+[MyFirstInterface JavaScriptNameForSelector:]):
        (-[MyFirstInterface getInt]):
        (-[MyFirstInterface setInt:]):
        (-[MyFirstInterface getMySecondInterface]):
        (-[MyFirstInterface logMessage:]):
        (GlobalImp::className):
        (readJavaScriptFromFile):
        (main):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@6086 268f45cc-cd09-0410-ab3c-d52691b4dbfc
27 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.pbproj/project.pbxproj
JavaScriptCore/Makefile.am
JavaScriptCore/bindings/jni/jni_class.cpp
JavaScriptCore/bindings/jni/jni_class.h
JavaScriptCore/bindings/jni/jni_instance.cpp
JavaScriptCore/bindings/jni/jni_instance.h
JavaScriptCore/bindings/jni/jni_runtime.h
JavaScriptCore/bindings/make_testbindings [new file with mode: 0755]
JavaScriptCore/bindings/objc/objc_class.h [new file with mode: 0644]
JavaScriptCore/bindings/objc/objc_class.mm [new file with mode: 0644]
JavaScriptCore/bindings/objc/objc_header.h [new file with mode: 0644]
JavaScriptCore/bindings/objc/objc_instance.h [new file with mode: 0644]
JavaScriptCore/bindings/objc/objc_instance.mm [new file with mode: 0644]
JavaScriptCore/bindings/objc/objc_jsobject.h [new file with mode: 0644]
JavaScriptCore/bindings/objc/objc_jsobject.mm [new file with mode: 0644]
JavaScriptCore/bindings/objc/objc_runtime.h
JavaScriptCore/bindings/objc/objc_runtime.mm [new file with mode: 0644]
JavaScriptCore/bindings/objc/objc_utility.h [new file with mode: 0644]
JavaScriptCore/bindings/objc/objc_utility.mm [new file with mode: 0644]
JavaScriptCore/bindings/runtime.cpp
JavaScriptCore/bindings/runtime.h
JavaScriptCore/bindings/runtime_method.cpp
JavaScriptCore/bindings/runtime_method.h
JavaScriptCore/bindings/runtime_object.cpp
JavaScriptCore/bindings/test.js [new file with mode: 0644]
JavaScriptCore/bindings/testbindings.mm [new file with mode: 0644]