Ignore:
Timestamp:
Sep 14, 2004, 7:48:37 PM (21 years ago)
Author:
rjw
Message:

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.
  1. Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
  1. 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.
  1. Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
  1. 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:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bindings/objc/WebScriptObject.h

    r6711 r7565  
    124124
    125125/*!
     126    @method invokeDefaultMethodWithArguments:
     127    @param args The args to pass the method.
     128    @discussion If a script attempts to invoke a method on an exposed object
     129    directory this method will be called.
     130*/
     131- (id)invokeDefaultMethodWithArguments:(NSArray *)args;
     132
     133/*!
    126134    @method finalizeForWebScript
    127135    @discussion finalizeForScript is called on objects exposed to the script
Note: See TracChangeset for help on using the changeset viewer.