WebKit:
authorrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Sep 2004 02:48:37 +0000 (02:48 +0000)
committerrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Sep 2004 02:48:37 +0000 (02:48 +0000)
commite7f809debf8de93c58642b61ffbad8f0ed01858d
tree5fc4a4490c2ebcce90147af62c60935fb0035581
parent3290b23fe95a6c0c6b7deef2ea1d3d090d419690
WebKit:
        1.  Add class parameter to object allocation function.  This is somewhat redundant, given that
        the allocation function is in the class function vector, but people wanted to use the same
        allocation function for different classes.

        2.  Renamed NPN_Class to NPN_Invoke to match the name in the function vector.

        3.  Add support for a default function on an object.  This is a feature that ActiveX supports,
        and will allow JavaScript code to be written that will look exactly the same for both ActiveX
        plugins and Netscape or WebKit plugins.  There are implementations included for the 'C' and
        'Objective-C' bindings.

        There bugs are covered by

        <rdar://problem/3776343> Support for default functions in the JavaScript bindings
        <rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke
        <rdar://problem/3674754> Need to implement latest npruntime.h

        Reviewed by John.

        * Plugins.subproj/WebNetscapePluginPackage.m:
        (-[WebNetscapePluginPackage load]):
        * Plugins.subproj/WebScriptObject.h:
        * Plugins.subproj/npfunctions.h:
        * Plugins.subproj/npruntime.h:

JavaScriptCore:
        1.  Add class parameter to object allocation function.  This is somewhat redundant, given that
        the allocation function is in the class function vector, but people wanted to use the same
        allocation function for different classes.

        2.  Renamed NPN_Class to NPN_Invoke to match the name in the function vector.

        3.  Add support for a default function on an object.  This is a feature that ActiveX supports,
        and will allow JavaScript code to be written that will look exactly the same for both ActiveX
        plugins and Netscape or WebKit plugins.  There are implementations included for the 'C' and
        'Objective-C' bindings.

        There bugs are covered by

        <rdar://problem/3776343> Support for default functions in the JavaScript bindings
        <rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke
        <rdar://problem/3674754> Need to implement latest npruntime.h

        Reviewed by John.

        * bindings/NP_jsobject.cpp:
        (jsAllocate):
        (NPN_InvokeDefault):
        (NPN_Invoke):
        * bindings/c/c_class.cpp:
        * bindings/c/c_instance.cpp:
        (CInstance::CInstance):
        (CInstance::operator=):
        (CInstance::invokeMethod):
        (CInstance::invokeDefaultMethod):
        * bindings/c/c_instance.h:
        * bindings/c/c_runtime.cpp:
        * bindings/c/c_runtime.h:
        * bindings/jni/jni_instance.cpp:
        (JavaInstance::invokeDefaultMethod):
        * bindings/jni/jni_instance.h:
        * bindings/npruntime.cpp:
        (NPN_CreateObject):
        * bindings/npruntime.h:
        * bindings/objc/WebScriptObject.h:
        * bindings/objc/objc_class.mm:
        (ObjcClass::fallbackObject):
        * bindings/objc/objc_instance.h:
        * bindings/objc/objc_instance.mm:
        (ObjcInstance::invokeDefaultMethod):
        * bindings/objc/objc_runtime.h:
        * bindings/objc/objc_runtime.mm:
        (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
        (ObjcFallbackObjectImp::get):
        (ObjcFallbackObjectImp::put):
        (ObjcFallbackObjectImp::canPut):
        (ObjcFallbackObjectImp::implementsCall):
        (ObjcFallbackObjectImp::call):
        (ObjcFallbackObjectImp::hasProperty):
        (ObjcFallbackObjectImp::deleteProperty):
        (ObjcFallbackObjectImp::defaultValue):
        * bindings/runtime.h:
        (KJS::Bindings::Class::fallbackObject):
        (KJS::Bindings::Instance::getValueOfUndefinedField):
        (KJS::Bindings::Instance::setValueOfUndefinedField):
        (KJS::Bindings::Instance::valueOf):
        * bindings/runtime_object.cpp:
        (RuntimeObjectImp::implementsCall):
        (RuntimeObjectImp::call):
        * bindings/runtime_object.h:

WebKitExamples:
Reworked NetscapeMoviePlugIn to better test and illustrate
scripting APIs.

        Reviewed by John.

        * CarbonWeb/MyWebUIAdapter.m:
        (-[MyWebUIAdapter webView:runJavaScriptAlertPanelWithMessage:]):
        (-[MyWebUIAdapter webView:runJavaScriptConfirmPanelWithMessage:]):
        (-[MyWebUIAdapter webView:runJavaScriptTextInputPanelWithPrompt:defaultText:]):
        * CarbonWeb/TWebWindow.cp:
        * NetscapeMoviePlugIn/MovieObject.c: Added.
        (getMovieClass):
        (initializeIdentifiers):
        (movieHasProperty):
        (movieHasMethod):
        (movieGetProperty):
        (movieSetProperty):
        (movieInvoke):
        (movieInvokeDefault):
        (movieInvalidate):
        (movieAllocate):
        (movieDeallocate):
        (LoadMovieFromFile):
        (CreateMovieController):
        (UpdateMovieFrame):
        (PlayMovie):
        (PauseMovie):
        (IsMovieMuted):
        (SetMovieMuted):
        (DestroyMovie):
        (HandleMovieEvent):
        * NetscapeMoviePlugIn/MovieObject.h: Added.
        * NetscapeMoviePlugIn/NetscapeMoviePlugIn.xcode/project.pbxproj:
        * NetscapeMoviePlugIn/PluginObject.c: Added.
        (getPluginClass):
        (initializeIdentifiers):
        (pluginHasProperty):
        (pluginHasMethod):
        (pluginGetProperty):
        (pluginSetProperty):
        (pluginInvoke):
        (pluginInvokeDefault):
        (pluginInvalidate):
        (pluginAllocate):
        (pluginDeallocate):
        * NetscapeMoviePlugIn/PluginObject.h: Added.
        * NetscapeMoviePlugIn/main.c:
        (NP_Initialize):
        (NPP_New):
        (NPP_Destroy):
        (NPP_SetWindow):
        (NPP_StreamAsFile):
        (NPP_HandleEvent):
        (NPP_GetValue):
        (NPP_SetValue):
        * NetscapeMoviePlugIn/movie.h: Added.
        * NetscapeMoviePlugIn/movie.html:
        * makefile:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7565 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/bindings/NP_jsobject.cpp
JavaScriptCore/bindings/c/c_class.cpp
JavaScriptCore/bindings/c/c_instance.cpp
JavaScriptCore/bindings/c/c_instance.h
JavaScriptCore/bindings/c/c_runtime.cpp
JavaScriptCore/bindings/c/c_runtime.h
JavaScriptCore/bindings/jni/jni_instance.cpp
JavaScriptCore/bindings/jni/jni_instance.h
JavaScriptCore/bindings/npruntime.cpp
JavaScriptCore/bindings/npruntime.h
JavaScriptCore/bindings/objc/WebScriptObject.h
JavaScriptCore/bindings/objc/objc_class.mm
JavaScriptCore/bindings/objc/objc_instance.h
JavaScriptCore/bindings/objc/objc_instance.mm
JavaScriptCore/bindings/objc/objc_runtime.h
JavaScriptCore/bindings/objc/objc_runtime.mm
JavaScriptCore/bindings/runtime.h
JavaScriptCore/bindings/runtime_object.cpp
JavaScriptCore/bindings/runtime_object.h
WebKit/ChangeLog
WebKit/Plugins.subproj/WebNetscapePluginPackage.m
WebKit/Plugins.subproj/WebScriptObject.h
WebKit/Plugins.subproj/npfunctions.h
WebKit/Plugins.subproj/npruntime.h