[webkit-changes] cvs commit: WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj Info.plist PluginObject.c PluginObject.h main.c

Geoffrey ggaren at opensource.apple.com
Thu Jan 5 14:23:16 PST 2006


ggaren      06/01/05 14:23:15

  Modified:    .        ChangeLog
               .        ChangeLog WebKit.exp
               .        ChangeLog
               DumpRenderTree DumpRenderTree.m
               DumpRenderTree/DumpRenderTree.xcodeproj project.pbxproj
  Added:       fast/plugins netscape-back-forward-expected.txt
                        netscape-back-forward.html
               fast/plugins/resources go-back.html
               DumpRenderTree/TestNetscapePlugIn.subproj Info.plist
                        PluginObject.c PluginObject.h main.c
  Log:
  LayoutTests:
  
          Layout test for http://bugzilla.opendarwin.org/show_bug.cgi?id=6318
          REGRESSION: Repro crash in JS called from Flash on bdash.net.nz
  
          * fast/plugins/netscape-back-forward-expected.txt: Added.
          * fast/plugins/netscape-back-forward.html: Added.
          * fast/plugins/resources/go-back.html: Added.
  
  WebKit:
  
          Reviewed by Darin.
  
          - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6361
          Add plugin support to DumpRenderTree
  
          * WebKit.exp: export WebPluginDatabase class, which DumpRenderTree
          needs to add plugins to the runtime.
  
  WebKitTools:
  
          Reviewed by darin.
  
          - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6361
          Add plugin support to DumpRenderTree
  
          Also wrote first test plugin.
  
          * DumpRenderTree/DumpRenderTree.m:
          (main):
          (1) Put the WebView in an invisible window, because PlugIns are
          optimized not to load if there's no parent window.
          (2) Tell WebKit to load any PlugIns in the directory from which we
          loaded. This means we can build nasty PlugIns alongside DumpRenderTree
          and they'll load automagically during layout testing, but they won't be
          added to the user's system, hosing apps like Safari.
  
          * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Added new
          test PlugIn to project.
  
          PlugIn added to project:
  
          * DumpRenderTree/TestNetscapePlugIn.subproj/Info.plist: Added.
          * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.c: Added.
          (getPluginClass):
          (initializeIdentifiers):
          (pluginHasProperty):
          (pluginHasMethod):
          (pluginGetProperty):
          (pluginSetProperty):
          (pluginInvoke):
          (pluginInvokeDefault):
          (pluginInvalidate):
          (pluginAllocate):
          (pluginDeallocate):
          * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h: Added.
          * DumpRenderTree/TestNetscapePlugIn.subproj/main.c: Added.
          (NP_Initialize):
          (NP_GetEntryPoints):
          (NP_Shutdown):
          (NPP_New):
          (NPP_Destroy):
          (NPP_SetWindow):
          (NPP_NewStream):
          (NPP_DestroyStream):
          (NPP_WriteReady):
          (NPP_Write):
          (NPP_StreamAsFile):
          (NPP_Print):
          (NPP_HandleEvent):
          (NPP_URLNotify):
          (NPP_GetValue):
          (NPP_SetValue):
  
  Revision  Changes    Path
  1.225     +9 -0      LayoutTests/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/LayoutTests/ChangeLog,v
  retrieving revision 1.224
  retrieving revision 1.225
  diff -u -r1.224 -r1.225
  --- ChangeLog	5 Jan 2006 20:48:09 -0000	1.224
  +++ ChangeLog	5 Jan 2006 22:23:02 -0000	1.225
  @@ -1,3 +1,12 @@
  +2006-01-06  Geoffrey Garen  <ggaren at apple.com>
  +
  +        Layout test for http://bugzilla.opendarwin.org/show_bug.cgi?id=6318
  +        REGRESSION: Repro crash in JS called from Flash on bdash.net.nz
  +
  +        * fast/plugins/netscape-back-forward-expected.txt: Added.
  +        * fast/plugins/netscape-back-forward.html: Added.
  +        * fast/plugins/resources/go-back.html: Added.
  +
   2006-01-05  Alexey Proskuryakov  <ap at nypop.com>
   
           Reviewed by Darin.
  
  
  
  1.3443    +10 -0     WebKit/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebKit/ChangeLog,v
  retrieving revision 1.3442
  retrieving revision 1.3443
  diff -u -r1.3442 -r1.3443
  --- ChangeLog	5 Jan 2006 06:41:26 -0000	1.3442
  +++ ChangeLog	5 Jan 2006 22:23:04 -0000	1.3443
  @@ -1,3 +1,13 @@
  +2006-01-05  Geoffrey Garen  <ggaren at apple.com>
  +
  +        Reviewed by Darin.
  +
  +        - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6361
  +        Add plugin support to DumpRenderTree
  +
  +        * WebKit.exp: export WebPluginDatabase class, which DumpRenderTree
  +        needs to add plugins to the runtime.
  +
   2006-01-03  Maciej Stachowiak  <mjs at apple.com>
   
           Reviewed by Darin.
  
  
  
  1.78      +1 -0      WebKit/WebKit.exp
  
  Index: WebKit.exp
  ===================================================================
  RCS file: /cvs/root/WebKit/WebKit.exp,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- WebKit.exp	2 Nov 2005 01:59:11 -0000	1.77
  +++ WebKit.exp	5 Jan 2006 22:23:08 -0000	1.78
  @@ -1,3 +1,4 @@
  +.objc_class_name_WebPluginDatabase
   .objc_class_name_WebArchive
   .objc_class_name_WebBackForwardList
   .objc_class_name_WebCoreStatistics
  
  
  
  1.138     +55 -0     WebKitTools/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebKitTools/ChangeLog,v
  retrieving revision 1.137
  retrieving revision 1.138
  diff -u -r1.137 -r1.138
  --- ChangeLog	4 Jan 2006 21:10:38 -0000	1.137
  +++ ChangeLog	5 Jan 2006 22:23:13 -0000	1.138
  @@ -1,3 +1,58 @@
  +2006-01-06  Geoffrey Garen  <ggaren at apple.com>
  +
  +        Reviewed by darin.
  +
  +        - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6361
  +        Add plugin support to DumpRenderTree
  +
  +        Also wrote first test plugin.
  +
  +        * DumpRenderTree/DumpRenderTree.m:
  +        (main):
  +        (1) Put the WebView in an invisible window, because PlugIns are
  +        optimized not to load if there's no parent window.
  +        (2) Tell WebKit to load any PlugIns in the directory from which we 
  +        loaded. This means we can build nasty PlugIns alongside DumpRenderTree 
  +        and they'll load automagically during layout testing, but they won't be
  +        added to the user's system, hosing apps like Safari.
  +
  +        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Added new
  +        test PlugIn to project.
  +
  +        PlugIn added to project:
  +
  +        * DumpRenderTree/TestNetscapePlugIn.subproj/Info.plist: Added.
  +        * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.c: Added.
  +        (getPluginClass):
  +        (initializeIdentifiers):
  +        (pluginHasProperty):
  +        (pluginHasMethod):
  +        (pluginGetProperty):
  +        (pluginSetProperty):
  +        (pluginInvoke):
  +        (pluginInvokeDefault):
  +        (pluginInvalidate):
  +        (pluginAllocate):
  +        (pluginDeallocate):
  +        * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h: Added.
  +        * DumpRenderTree/TestNetscapePlugIn.subproj/main.c: Added.
  +        (NP_Initialize):
  +        (NP_GetEntryPoints):
  +        (NP_Shutdown):
  +        (NPP_New):
  +        (NPP_Destroy):
  +        (NPP_SetWindow):
  +        (NPP_NewStream):
  +        (NPP_DestroyStream):
  +        (NPP_WriteReady):
  +        (NPP_Write):
  +        (NPP_StreamAsFile):
  +        (NPP_Print):
  +        (NPP_HandleEvent):
  +        (NPP_URLNotify):
  +        (NPP_GetValue):
  +        (NPP_SetValue):
  +
   2006-01-04  Timothy Hatcher  <timothy at apple.com>
   
           Reviewed by Darin.
  
  
  
  1.1                  LayoutTests/fast/plugins/netscape-back-forward-expected.txt
  
  Index: netscape-back-forward-expected.txt
  ===================================================================
  Bug: REGRESSION: Repro crash in JS called from Flash on bdash.net.nz
  
  If this test passes, you will see a PASS messge below.
  
  
  ----- AFTER back/forward navigation: -----
  
  plugin.property is 'property'
  
  callback received from plugin
  
  PASS
  
  
  
  
  
  1.1                  LayoutTests/fast/plugins/netscape-back-forward.html
  
  Index: netscape-back-forward.html
  ===================================================================
  <html>
  <head>
  <script>
      /* Helper functions */
      function print(message) {
          var paragraph = document.createElement("p");
          paragraph.appendChild(document.createTextNode(message));
          document.getElementById("console").appendChild(paragraph);
      }
  
      /* Evaluator -- use for evaluating an expression in a funny way */
      var Evaluator = new Object();
  
      Evaluator.evaluateAfterBackForwardNavigation = function(expression)
      {
          /* onload doesn't fire after a back/forward navigation, but timers get restored.
           * So, to execute a script after the back/forward navigation has completed, 
           * we set a timer.
           */
          Evaluator.interval = window.setInterval("Evaluator.evaluate(" + expression + ")", 1000);
          window.location.href = "resources/go-back.html";
      }
  
      Evaluator.evaluate = function(expression)
      {
          window.clearInterval(Evaluator.interval);
          eval(expression);
      }
  
      /* Test */
      
      var Test = new Object();
  
      Test.didReceiveCallback = false;
  
      Test.callback = function()
      {
          Test.didReceiveCallback = true;
          print('callback received from plugin');
      }
      
      Test.continueAfterBackForwardNavigation = function()
      {
          print("----- AFTER back/forward navigation: -----");
  
          try {
              var plugin = document.embeds["testPlugin"];
              if (plugin.property)
                  print("plugin.property is '" + plugin.property + "'");
  
              // Netscape plugins seem to be able to call window-level functions only
              window.callback = Test.callback;
              if (plugin.testCallback)
                  plugin.testCallback("callback");
              delete window.callback;
                  
              if (plugin.property && Test.didReceiveCallback)
                  print ("PASS");
              else
                  print("FAIL");
          }
          catch (e) {
              print("FAIL");
          }
          
          if (window.layoutTestController) {
              layoutTestController.notifyDone();
          }
      }
      
      Test.run = function()
      {
          if (window.layoutTestController) {
              layoutTestController.dumpAsText();
              layoutTestController.waitUntilDone();
          }
          
          Evaluator.evaluateAfterBackForwardNavigation('Test.continueAfterBackForwardNavigation()');    
      }
  </script>
  </head>
  <body onload="Test.run()">
  <p>Bug: <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=6318">REGRESSION: Repro crash in JS called from Flash on bdash.net.nz</a></p>
  <p>If this test passes, you will see a PASS messge below.</p>
  <hr>
  <embed name="testPlugin" width="0" height="0" src="" type="application/x-webkit-test-netscape"></embed>
  <div id="console"></div>
  </body>
  </html>
  
  
  
  1.1                  LayoutTests/fast/plugins/resources/go-back.html
  
  Index: go-back.html
  ===================================================================
  <html>
  <body onload="window.history.back()"> </body>
  </html>
  
  
  
  1.24      +12 -0     WebKitTools/DumpRenderTree/DumpRenderTree.m
  
  Index: DumpRenderTree.m
  ===================================================================
  RCS file: /cvs/root/WebKitTools/DumpRenderTree/DumpRenderTree.m,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- DumpRenderTree.m	30 Dec 2005 07:04:10 -0000	1.23
  +++ DumpRenderTree.m	5 Jan 2006 22:23:14 -0000	1.24
  @@ -34,6 +34,7 @@
   #import <WebKit/WebFrameView.h>
   #import <WebKit/WebPreferences.h>
   #import <WebKit/WebView.h>
  +#import <WebKit/WebPluginDatabase.h>
   
   #import <Carbon/Carbon.h>                           // for GetCurrentEventTime()
   #import <ApplicationServices/ApplicationServices.h> // for CMSetDefaultProfileBySpace
  @@ -185,6 +186,16 @@
       localPasteboard = [NSPasteboard pasteboardWithUniqueName];
   
       WebView *webView = [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)];
  +    NSWindow *window = [[NSWindow alloc] initWithContentRect:NSZeroRect 
  +                                                   styleMask:NSBorderlessWindowMask 
  +                                                     backing:NSBackingStoreNonretained 
  +                                                       defer:YES];
  +    [window setContentView:webView];
  +    
  +    NSString *pwd = [[NSString stringWithCString:argv[0]] stringByDeletingLastPathComponent];
  +    [WebPluginDatabase setAdditionalWebPlugInPaths:[NSArray arrayWithObject:pwd]];
  +    [[WebPluginDatabase installedPlugins] refresh];    
  +
       WaitUntilDoneDelegate *delegate = [[WaitUntilDoneDelegate alloc] init];
       EditingDelegate *editingDelegate = [[EditingDelegate alloc] init];
       [webView setFrameLoadDelegate:delegate];
  @@ -223,6 +234,7 @@
       [webView setUIDelegate:nil];
   
       [webView release];
  +    [window release];
       [delegate release];
       [editingDelegate release];
   
  
  
  
  1.8       +214 -0    WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
  
  Index: project.pbxproj
  ===================================================================
  RCS file: /cvs/root/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- project.pbxproj	9 Oct 2005 02:57:21 -0000	1.7
  +++ project.pbxproj	5 Jan 2006 22:23:14 -0000	1.8
  @@ -28,6 +28,7 @@
   			dependencies = (
   				A84F609108B1370E00E9745F /* PBXTargetDependency */,
   				A84F608F08B1370E00E9745F /* PBXTargetDependency */,
  +				141BF238096A451E00E0753C /* PBXTargetDependency */,
   			);
   			name = All;
   			productName = All;
  @@ -35,6 +36,15 @@
   /* End PBXAggregateTarget section */
   
   /* Begin PBXBuildFile section */
  +		141BF435096A455900E0753C /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9335435F03D75502008635CE /* WebKit.framework */; };
  +		141BF436096A455900E0753C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A84F608908B136DA00E9745F /* Cocoa.framework */; };
  +		141BF437096A455900E0753C /* WebCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A817090108B1643800CCB9FB /* WebCore.framework */; };
  +		141BF438096A455900E0753C /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A817090308B164D300CCB9FB /* JavaScriptCore.framework */; };
  +		141BF439096A455900E0753C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE8257EF08D22389000507AB /* Carbon.framework */; };
  +		141BF44A096A45C800E0753C /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 141BF445096A45C800E0753C /* main.c */; };
  +		141BF44B096A45C800E0753C /* PluginObject.c in Sources */ = {isa = PBXBuildFile; fileRef = 141BF446096A45C800E0753C /* PluginObject.c */; };
  +		141BF44C096A45C800E0753C /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 141BF448096A45C800E0753C /* Info.plist */; };
  +		141BF453096A45EB00E0753C /* PluginObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 141BF447096A45C800E0753C /* PluginObject.h */; };
   		9340994C08540CAE007F3BC8 /* DumpRenderTreePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = 32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */; };
   		9340994E08540CAE007F3BC8 /* DumpRenderTree.m in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* DumpRenderTree.m */; settings = {ATTRIBUTES = (); }; };
   		9340995108540CAE007F3BC8 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9335435F03D75502008635CE /* WebKit.framework */; };
  @@ -68,6 +78,13 @@
   /* End PBXBuildStyle section */
   
   /* Begin PBXContainerItemProxy section */
  +		141BF237096A451E00E0753C /* PBXContainerItemProxy */ = {
  +			isa = PBXContainerItemProxy;
  +			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
  +			proxyType = 1;
  +			remoteGlobalIDString = 141BF21E096A441D00E0753C;
  +			remoteInfo = TestNetscapePlugIn;
  +		};
   		A84F608E08B1370E00E9745F /* PBXContainerItemProxy */ = {
   			isa = PBXContainerItemProxy;
   			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
  @@ -86,6 +103,11 @@
   
   /* Begin PBXFileReference section */
   		08FB7796FE84155DC02AAC07 /* DumpRenderTree.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DumpRenderTree.m; sourceTree = "<group>"; };
  +		141BF233096A44CF00E0753C /* TestNetscapePlugIn.plugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TestNetscapePlugIn.plugin; sourceTree = BUILT_PRODUCTS_DIR; };
  +		141BF445096A45C800E0753C /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = main.c; path = ../TestNetscapePlugIn.subproj/main.c; sourceTree = "<group>"; };
  +		141BF446096A45C800E0753C /* PluginObject.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = PluginObject.c; path = ../TestNetscapePlugIn.subproj/PluginObject.c; sourceTree = "<group>"; };
  +		141BF447096A45C800E0753C /* PluginObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PluginObject.h; path = ../TestNetscapePlugIn.subproj/PluginObject.h; sourceTree = "<group>"; };
  +		141BF448096A45C800E0753C /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; name = Info.plist; path = ../TestNetscapePlugIn.subproj/Info.plist; sourceTree = "<group>"; };
   		32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumpRenderTreePrefix.h; sourceTree = "<group>"; };
   		9335435F03D75502008635CE /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
   		9340995408540CAF007F3BC8 /* DumpRenderTree */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = DumpRenderTree; sourceTree = BUILT_PRODUCTS_DIR; };
  @@ -101,6 +123,18 @@
   /* End PBXFileReference section */
   
   /* Begin PBXFrameworksBuildPhase section */
  +		141BF21D096A441D00E0753C /* Frameworks */ = {
  +			isa = PBXFrameworksBuildPhase;
  +			buildActionMask = 2147483647;
  +			files = (
  +				141BF435096A455900E0753C /* WebKit.framework in Frameworks */,
  +				141BF436096A455900E0753C /* Cocoa.framework in Frameworks */,
  +				141BF437096A455900E0753C /* WebCore.framework in Frameworks */,
  +				141BF438096A455900E0753C /* JavaScriptCore.framework in Frameworks */,
  +				141BF439096A455900E0753C /* Carbon.framework in Frameworks */,
  +			);
  +			runOnlyForDeploymentPostprocessing = 0;
  +		};
   		9340994F08540CAE007F3BC8 /* Frameworks */ = {
   			isa = PBXFrameworksBuildPhase;
   			buildActionMask = 2147483647;
  @@ -129,6 +163,7 @@
   		08FB7794FE84155DC02AAC07 /* DumpRenderTree */ = {
   			isa = PBXGroup;
   			children = (
  +				141BF1F5096A439800E0753C /* TestNetscapePlugIn.subproj */,
   				08FB7796FE84155DC02AAC07 /* DumpRenderTree.m */,
   				32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */,
   				93442CF408F8BA4900BFE8CA /* TextInputController.h */,
  @@ -145,11 +180,23 @@
   			name = DumpRenderTree;
   			sourceTree = "<group>";
   		};
  +		141BF1F5096A439800E0753C /* TestNetscapePlugIn.subproj */ = {
  +			isa = PBXGroup;
  +			children = (
  +				141BF445096A45C800E0753C /* main.c */,
  +				141BF446096A45C800E0753C /* PluginObject.c */,
  +				141BF447096A45C800E0753C /* PluginObject.h */,
  +				141BF448096A45C800E0753C /* Info.plist */,
  +			);
  +			path = TestNetscapePlugIn.subproj;
  +			sourceTree = "<group>";
  +		};
   		9340995508540CAF007F3BC8 /* Products */ = {
   			isa = PBXGroup;
   			children = (
   				9340995408540CAF007F3BC8 /* DumpRenderTree */,
   				B5A7526708AF4A4A00138E45 /* ImageDiff */,
  +				141BF233096A44CF00E0753C /* TestNetscapePlugIn.plugin */,
   			);
   			name = Products;
   			sourceTree = "<group>";
  @@ -157,6 +204,14 @@
   /* End PBXGroup section */
   
   /* Begin PBXHeadersBuildPhase section */
  +		141BF44E096A45DD00E0753C /* Headers */ = {
  +			isa = PBXHeadersBuildPhase;
  +			buildActionMask = 2147483647;
  +			files = (
  +				141BF453096A45EB00E0753C /* PluginObject.h in Headers */,
  +			);
  +			runOnlyForDeploymentPostprocessing = 0;
  +		};
   		9340994B08540CAE007F3BC8 /* Headers */ = {
   			isa = PBXHeadersBuildPhase;
   			buildActionMask = 2147483647;
  @@ -176,6 +231,71 @@
   /* End PBXHeadersBuildPhase section */
   
   /* Begin PBXNativeTarget section */
  +		141BF21E096A441D00E0753C /* TestNetscapePlugIn */ = {
  +			isa = PBXNativeTarget;
  +			buildConfigurationList = 141BF221096A441E00E0753C /* Build configuration list for PBXNativeTarget "TestNetscapePlugIn" */;
  +			buildPhases = (
  +				141BF21B096A441D00E0753C /* Resources */,
  +				141BF44E096A45DD00E0753C /* Headers */,
  +				141BF21C096A441D00E0753C /* Sources */,
  +				141BF21D096A441D00E0753C /* Frameworks */,
  +			);
  +			buildRules = (
  +			);
  +			buildSettings = {
  +				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
  +				GCC_MODEL_TUNING = G5;
  +				GCC_PRECOMPILE_PREFIX_HEADER = YES;
  +				GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h";
  +				INFOPLIST_FILE = "TestNetscapePlugIn.plugin-Info.plist";
  +				INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles";
  +				LIBRARY_STYLE = BUNDLE;
  +				OPTIMIZATION_CFLAGS = "";
  +				OTHER_CFLAGS = "";
  +				OTHER_LDFLAGS = (
  +					"-framework",
  +					Carbon,
  +				);
  +				OTHER_REZFLAGS = "";
  +				PREBINDING = NO;
  +				PRODUCT_NAME = TestNetscapePlugIn.plugin;
  +				SECTORDER_FLAGS = "";
  +				WARNING_CFLAGS = (
  +					"-Wmost",
  +					"-Wno-four-char-constants",
  +					"-Wno-unknown-pragmas",
  +				);
  +			};
  +			dependencies = (
  +			);
  +			name = TestNetscapePlugIn;
  +			productName = TestNetscapePlugIn.plugin;
  +			productReference = 141BF233096A44CF00E0753C /* TestNetscapePlugIn.plugin */;
  +			productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
  +<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
  +<plist version=\"1.0\">
  +<dict>
  +	<key>CFBundleDevelopmentRegion</key>
  +	<string>English</string>
  +	<key>CFBundleExecutable</key>
  +	<string>TestNetscapePlugIn.plugin</string>
  +	<key>CFBundleIdentifier</key>
  +	<string>com.yourcompany.TestNetscapePlugIn_plugin</string>
  +	<key>CFBundleInfoDictionaryVersion</key>
  +	<string>6.0</string>
  +	<key>CFBundlePackageType</key>
  +	<string>APPL</string>
  +	<key>CFBundleSignature</key>
  +	<string>????</string>
  +	<key>CFBundleVersion</key>
  +	<string>1.0</string>
  +	<key>CSResourcesFileMapped</key>
  +	<string>yes</string>
  +</dict>
  +</plist>
  +";
  +			productType = "com.apple.product-type.bundle";
  +		};
   		9340994A08540CAE007F3BC8 /* DumpRenderTree */ = {
   			isa = PBXNativeTarget;
   			buildConfigurationList = 149C29BF08902C6D008A9EFC /* Build configuration list for PBXNativeTarget "DumpRenderTree" */;
  @@ -254,11 +374,32 @@
   				A84F608D08B1370600E9745F /* All */,
   				9340994A08540CAE007F3BC8 /* DumpRenderTree */,
   				B5A7525A08AF4A4A00138E45 /* ImageDiff */,
  +				141BF21E096A441D00E0753C /* TestNetscapePlugIn */,
   			);
   		};
   /* End PBXProject section */
   
  +/* Begin PBXResourcesBuildPhase section */
  +		141BF21B096A441D00E0753C /* Resources */ = {
  +			isa = PBXResourcesBuildPhase;
  +			buildActionMask = 2147483647;
  +			files = (
  +				141BF44C096A45C800E0753C /* Info.plist in Resources */,
  +			);
  +			runOnlyForDeploymentPostprocessing = 0;
  +		};
  +/* End PBXResourcesBuildPhase section */
  +
   /* Begin PBXSourcesBuildPhase section */
  +		141BF21C096A441D00E0753C /* Sources */ = {
  +			isa = PBXSourcesBuildPhase;
  +			buildActionMask = 2147483647;
  +			files = (
  +				141BF44A096A45C800E0753C /* main.c in Sources */,
  +				141BF44B096A45C800E0753C /* PluginObject.c in Sources */,
  +			);
  +			runOnlyForDeploymentPostprocessing = 0;
  +		};
   		9340994D08540CAE007F3BC8 /* Sources */ = {
   			isa = PBXSourcesBuildPhase;
   			buildActionMask = 2147483647;
  @@ -279,6 +420,11 @@
   /* End PBXSourcesBuildPhase section */
   
   /* Begin PBXTargetDependency section */
  +		141BF238096A451E00E0753C /* PBXTargetDependency */ = {
  +			isa = PBXTargetDependency;
  +			target = 141BF21E096A441D00E0753C /* TestNetscapePlugIn */;
  +			targetProxy = 141BF237096A451E00E0753C /* PBXContainerItemProxy */;
  +		};
   		A84F608F08B1370E00E9745F /* PBXTargetDependency */ = {
   			isa = PBXTargetDependency;
   			target = B5A7525A08AF4A4A00138E45 /* ImageDiff */;
  @@ -292,6 +438,66 @@
   /* End PBXTargetDependency section */
   
   /* Begin XCBuildConfiguration section */
  +		141BF222096A441E00E0753C /* Development */ = {
  +			isa = XCBuildConfiguration;
  +			buildSettings = {
  +				COPY_PHASE_STRIP = NO;
  +				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
  +				GCC_MODEL_TUNING = G5;
  +				GCC_PRECOMPILE_PREFIX_HEADER = YES;
  +				GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h";
  +				INFOPLIST_FILE = TestNetscapePlugin.subproj/Info.plist;
  +				INSTALL_PATH = "$(USER_LIBRARY_DIR)/Plugins";
  +				LIBRARY_STYLE = BUNDLE;
  +				OPTIMIZATION_CFLAGS = "-O0";
  +				OTHER_CFLAGS = "";
  +				OTHER_LDFLAGS = (
  +					"-framework",
  +					Carbon,
  +				);
  +				OTHER_REZFLAGS = "";
  +				PREBINDING = NO;
  +				PRODUCT_NAME = TestNetscapePlugIn;
  +				SECTORDER_FLAGS = "";
  +				WARNING_CFLAGS = (
  +					"-Wmost",
  +					"-Wno-four-char-constants",
  +					"-Wno-unknown-pragmas",
  +				);
  +				WRAPPER_EXTENSION = plugin;
  +			};
  +			name = Development;
  +		};
  +		141BF223096A441E00E0753C /* Deployment */ = {
  +			isa = XCBuildConfiguration;
  +			buildSettings = {
  +				COPY_PHASE_STRIP = YES;
  +				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
  +				GCC_MODEL_TUNING = G5;
  +				GCC_PRECOMPILE_PREFIX_HEADER = YES;
  +				GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h";
  +				INFOPLIST_FILE = TestNetscapePlugin.subproj/Info.plist;
  +				INSTALL_PATH = "$(USER_LIBRARY_DIR)/Plugins";
  +				LIBRARY_STYLE = BUNDLE;
  +				OPTIMIZATION_CFLAGS = "-O0";
  +				OTHER_CFLAGS = "";
  +				OTHER_LDFLAGS = (
  +					"-framework",
  +					Carbon,
  +				);
  +				OTHER_REZFLAGS = "";
  +				PREBINDING = NO;
  +				PRODUCT_NAME = TestNetscapePlugIn;
  +				SECTORDER_FLAGS = "";
  +				WARNING_CFLAGS = (
  +					"-Wmost",
  +					"-Wno-four-char-constants",
  +					"-Wno-unknown-pragmas",
  +				);
  +				WRAPPER_EXTENSION = plugin;
  +			};
  +			name = Deployment;
  +		};
   		149C29C008902C6D008A9EFC /* Development */ = {
   			isa = XCBuildConfiguration;
   			buildSettings = {
  @@ -402,6 +608,14 @@
   /* End XCBuildConfiguration section */
   
   /* Begin XCConfigurationList section */
  +		141BF221096A441E00E0753C /* Build configuration list for PBXNativeTarget "TestNetscapePlugIn" */ = {
  +			isa = XCConfigurationList;
  +			buildConfigurations = (
  +				141BF222096A441E00E0753C /* Development */,
  +				141BF223096A441E00E0753C /* Deployment */,
  +			);
  +			defaultConfigurationIsVisible = 0;
  +		};
   		149C29BF08902C6D008A9EFC /* Build configuration list for PBXNativeTarget "DumpRenderTree" */ = {
   			isa = XCConfigurationList;
   			buildConfigurations = (
  
  
  
  1.1                  WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/Info.plist
  
  Index: Info.plist
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  <plist version="1.0">
  <dict>
  	<key>CFBundleDevelopmentRegion</key>
  	<string>English</string>
  	<key>CFBundleExecutable</key>
  	<string>TestNetscapePlugIn</string>
  	<key>CFBundleIconFile</key>
  	<string></string>
  	<key>CFBundleIdentifier</key>
  	<string>com.apple.testnetscapeplugin</string>
  	<key>CFBundleInfoDictionaryVersion</key>
  	<string>6.0</string>
  	<key>CFBundlePackageType</key>
  	<string>BRPL</string>
  	<key>CFBundleShortVersionString</key>
  	<string>1.0</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
  	<string>1.0</string>
  	<key>CFPlugInDynamicRegisterFunction</key>
  	<string></string>
  	<key>CFPlugInDynamicRegistration</key>
  	<string>NO</string>
  	<key>CFPlugInFactories</key>
  	<dict>
  		<key>00000000-0000-0000-0000-000000000000</key>
  		<string>MyFactoryFunction</string>
  	</dict>
  	<key>CFPlugInTypes</key>
  	<dict>
  		<key>00000000-0000-0000-0000-000000000000</key>
  		<array>
  			<string>00000000-0000-0000-0000-000000000000</string>
  		</array>
  	</dict>
  	<key>CFPlugInUnloadFunction</key>
  	<string></string>
  	<key>WebPluginDescription</key>
  	<string>Simple Netscape plug-in that handles test content for WebKit</string>
  	<key>WebPluginMIMETypes</key>
  	<dict>
  		<key>application/x-webkit-test-netscape</key>
  		<dict>
  			<key>WebPluginExtensions</key>
  			<array>
  				<string>testnetscape</string>
  			</array>
  			<key>WebPluginTypeDescription</key>
  			<string>test netscape content</string>
  		</dict>
  	</dict>
  	<key>WebPluginName</key>
  	<string>WebKit Test PlugIn</string>
  </dict>
  </plist>
  
  
  
  1.1                  WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.c
  
  Index: PluginObject.c
  ===================================================================
  /*
   IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in
   consideration of your agreement to the following terms, and your use, installation, 
   modification or redistribution of this Apple software constitutes acceptance of these 
   terms.  If you do not agree with these terms, please do not use, install, modify or 
   redistribute this Apple software.
   
   In consideration of your agreement to abide by the following terms, and subject to these 
   terms, Apple grants you a personal, non-exclusive license, under AppleÕs copyrights in 
   this original Apple software (the "Apple Software"), to use, reproduce, modify and 
   redistribute the Apple Software, with or without modifications, in source and/or binary 
   forms; provided that if you redistribute the Apple Software in its entirety and without 
   modifications, you must retain this notice and the following text and disclaimers in all 
   such redistributions of the Apple Software.  Neither the name, trademarks, service marks 
   or logos of Apple Computer, Inc. may be used to endorse or promote products derived from 
   the Apple Software without specific prior written permission from Apple. Except as expressly
   stated in this notice, no other rights or licenses, express or implied, are granted by Apple
   herein, including but not limited to any patent rights that may be infringed by your 
   derivative works or by other works in which the Apple Software may be incorporated.
   
   The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO WARRANTIES, 
   EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, 
   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS 
   USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
   
   IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL 
   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 
   OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 
   REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND 
   WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR 
   OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   */
  #import "PluginObject.h"
  
  void pluginInvalidate ();
  bool pluginHasProperty (NPClass *theClass, NPIdentifier name);
  bool pluginHasMethod (NPClass *theClass, NPIdentifier name);
  void pluginGetProperty (PluginObject *obj, NPIdentifier name, NPVariant *variant);
  void pluginSetProperty (PluginObject *obj, NPIdentifier name, const NPVariant *variant);
  void pluginInvoke (PluginObject *obj, NPIdentifier name, NPVariant *args, uint32_t argCount, NPVariant *result);
  void pluginInvokeDefault (PluginObject *obj, NPVariant *args, uint32_t argCount, NPVariant *result);
  NPObject *pluginAllocate (NPP npp, NPClass *theClass);
  void pluginDeallocate (PluginObject *obj);
  
  static NPClass _pluginFunctionPtrs = { 
      NP_CLASS_STRUCT_VERSION,
      (NPAllocateFunctionPtr) pluginAllocate, 
      (NPDeallocateFunctionPtr) pluginDeallocate, 
      (NPInvalidateFunctionPtr) pluginInvalidate,
      (NPHasMethodFunctionPtr) pluginHasMethod,
      (NPInvokeFunctionPtr) pluginInvoke,
      (NPInvokeDefaultFunctionPtr) pluginInvokeDefault,
      (NPHasPropertyFunctionPtr) pluginHasProperty,
      (NPGetPropertyFunctionPtr) pluginGetProperty,
      (NPSetPropertyFunctionPtr) pluginSetProperty,
  };
   
  NPClass *getPluginClass(void)
  {
      return &_pluginFunctionPtrs;
  }
  
  static bool identifiersInitialized = false;
  
  #define ID_PROPERTY_PROPERTY        0
  #define NUM_PROPERTY_IDENTIFIERS    1
  
  static NPIdentifier pluginPropertyIdentifiers[NUM_PROPERTY_IDENTIFIERS];
  static const NPUTF8 *pluginPropertyIdentifierNames[NUM_PROPERTY_IDENTIFIERS] = {
      "property"
  };
  
  #define ID_TEST_CALLBACK_METHOD     0
  #define NUM_METHOD_IDENTIFIERS      1
  
  static NPIdentifier pluginMethodIdentifiers[NUM_METHOD_IDENTIFIERS];
  static const NPUTF8 *pluginMethodIdentifierNames[NUM_METHOD_IDENTIFIERS] = {
      "testCallback"
  };
  
  static void initializeIdentifiers()
  {
      browser->getstringidentifiers (pluginPropertyIdentifierNames, NUM_PROPERTY_IDENTIFIERS, pluginPropertyIdentifiers);
      browser->getstringidentifiers (pluginMethodIdentifierNames, NUM_METHOD_IDENTIFIERS, pluginMethodIdentifiers);
  };
  
  bool pluginHasProperty (NPClass *theClass, NPIdentifier name)
  {
      for (int i = 0; i < NUM_PROPERTY_IDENTIFIERS; i++) {
          if (name == pluginPropertyIdentifiers[i])
              return true;
      }
      return false;
  }
  
  bool pluginHasMethod (NPClass *theClass, NPIdentifier name)
  {
      for (int i = 0; i < NUM_METHOD_IDENTIFIERS; i++) {
          if (name == pluginMethodIdentifiers[i])
              return true;
      }
      return false;
  }
  
  void pluginGetProperty (PluginObject *obj, NPIdentifier name, NPVariant *variant)
  {
      if (name == pluginPropertyIdentifiers[ID_PROPERTY_PROPERTY]) {
          // just return "property"
          NPString propertyNameString;
          propertyNameString.UTF8Characters = "property";
          propertyNameString.UTF8Length = sizeof("property") - 1;
          variant->type = NPVariantType_String;
          variant->value.stringValue = propertyNameString;
      } else
          variant->type = NPVariantType_Void;
  }
  
  void pluginSetProperty (PluginObject *obj, NPIdentifier name, const NPVariant *variant)
  {
  }
  
  void pluginInvoke (PluginObject *obj, NPIdentifier name, NPVariant *args, unsigned argCount, NPVariant *result)
  {
      if (name == pluginMethodIdentifiers[ID_TEST_CALLBACK_METHOD]) {
          // call whatever method name we're given
          if (argCount > 0 && args->type == NPVariantType_String) {
              NPVariant browserResult;
              
              NPObject *windowScriptObject;
              browser->getvalue(obj->npp, NPPVpluginScriptableNPObject, &windowScriptObject);
  
              NPString argString = args[0].value.stringValue;
              int size = argString.UTF8Length + 1;
              NPUTF8 callbackString[size];
              strncpy(callbackString, argString.UTF8Characters, argString.UTF8Length);
              callbackString[size - 1] = '\0';
  
              NPIdentifier callbackMethodID = browser->getstringidentifier(callbackString);
              browser->invoke(obj->npp, windowScriptObject, callbackMethodID, 0, 0, &browserResult);
          }
      }
  
      result->type = NPVariantType_Void;
  }
  
  void pluginInvokeDefault (PluginObject *obj, NPVariant *args, unsigned argCount, NPVariant *result)
  {
      result->type = NPVariantType_Void;
  }
  
  void pluginInvalidate ()
  {
      // Make sure we've released any remainging references to JavaScript
      // objects.
  }
  
  NPObject *pluginAllocate (NPP npp, NPClass *theClass)
  {
      PluginObject *newInstance = (PluginObject *)malloc (sizeof(PluginObject));
      
      if (!identifiersInitialized) {
          identifiersInitialized = true;
          initializeIdentifiers();
      }
  
      newInstance->npp = npp;
      
      return (NPObject *)newInstance;
  }
  
  void pluginDeallocate (PluginObject *obj) 
  {
      free ((void *)obj);
  }
  
  
  
  
  1.1                  WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h
  
  Index: PluginObject.h
  ===================================================================
  /*
   IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in
   consideration of your agreement to the following terms, and your use, installation, 
   modification or redistribution of this Apple software constitutes acceptance of these 
   terms.  If you do not agree with these terms, please do not use, install, modify or 
   redistribute this Apple software.
   
   In consideration of your agreement to abide by the following terms, and subject to these 
   terms, Apple grants you a personal, non-exclusive license, under AppleÕs copyrights in 
   this original Apple software (the "Apple Software"), to use, reproduce, modify and 
   redistribute the Apple Software, with or without modifications, in source and/or binary 
   forms; provided that if you redistribute the Apple Software in its entirety and without 
   modifications, you must retain this notice and the following text and disclaimers in all 
   such redistributions of the Apple Software.  Neither the name, trademarks, service marks 
   or logos of Apple Computer, Inc. may be used to endorse or promote products derived from 
   the Apple Software without specific prior written permission from Apple. Except as expressly
   stated in this notice, no other rights or licenses, express or implied, are granted by Apple
   herein, including but not limited to any patent rights that may be infringed by your 
   derivative works or by other works in which the Apple Software may be incorporated.
   
   The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO WARRANTIES, 
   EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, 
   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS 
   USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
   
   IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL 
   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 
            OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 
   REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND 
   WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR 
   OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   */
  #import <WebKit/npapi.h>
  #import <WebKit/npfunctions.h>
  #import <WebKit/npruntime.h>
  
  extern NPNetscapeFuncs* browser;
  
  typedef struct
  {
      NPClass *_class;
      uint32_t referenceCount;
      NPP npp;
      NPWindow* window;
  } PluginObject;
  
  extern NPClass *getPluginClass(void);
  
  
  
  
  1.1                  WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.c
  
  Index: main.c
  ===================================================================
  /*
   IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in
   consideration of your agreement to the following terms, and your use, installation, 
   modification or redistribution of this Apple software constitutes acceptance of these 
   terms.  If you do not agree with these terms, please do not use, install, modify or 
   redistribute this Apple software.
   
   In consideration of your agreement to abide by the following terms, and subject to these 
   terms, Apple grants you a personal, non-exclusive license, under AppleÕs copyrights in 
   this original Apple software (the "Apple Software"), to use, reproduce, modify and 
   redistribute the Apple Software, with or without modifications, in source and/or binary 
   forms; provided that if you redistribute the Apple Software in its entirety and without 
   modifications, you must retain this notice and the following text and disclaimers in all 
   such redistributions of the Apple Software.  Neither the name, trademarks, service marks 
   or logos of Apple Computer, Inc. may be used to endorse or promote products derived from 
   the Apple Software without specific prior written permission from Apple. Except as expressly
   stated in this notice, no other rights or licenses, express or implied, are granted by Apple
   herein, including but not limited to any patent rights that may be infringed by your 
   derivative works or by other works in which the Apple Software may be incorporated.
   
   The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO WARRANTIES, 
   EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, 
   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS 
   USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
   
   IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL 
   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 
            OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 
   REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND 
   WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR 
   OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   */
  #import "PluginObject.h"
  
  NPNetscapeFuncs *browser;
  
  // Mach-o entry points
  NPError NP_Initialize(NPNetscapeFuncs *browserFuncs);
  NPError NP_GetEntryPoints(NPPluginFuncs *pluginFuncs);
  void NP_Shutdown(void);
  
  // Mach-o entry points
  NPError NP_Initialize(NPNetscapeFuncs *browserFuncs)
  {
      browser = browserFuncs;
      return NPERR_NO_ERROR;
  }
  
  NPError NP_GetEntryPoints(NPPluginFuncs *pluginFuncs)
  {
      pluginFuncs->version = 11;
      pluginFuncs->size = sizeof(pluginFuncs);
      pluginFuncs->newp = NPP_New;
      pluginFuncs->destroy = NPP_Destroy;
      pluginFuncs->setwindow = NPP_SetWindow;
      pluginFuncs->newstream = NPP_NewStream;
      pluginFuncs->destroystream = NPP_DestroyStream;
      pluginFuncs->asfile = NPP_StreamAsFile;
      pluginFuncs->writeready = NPP_WriteReady;
      pluginFuncs->write = (NPP_WriteProcPtr)NPP_Write;
      pluginFuncs->print = NPP_Print;
      pluginFuncs->event = NPP_HandleEvent;
      pluginFuncs->urlnotify = NPP_URLNotify;
      pluginFuncs->getvalue = NPP_GetValue;
      pluginFuncs->setvalue = NPP_SetValue;
      
      return NPERR_NO_ERROR;
  }
  
  void NP_Shutdown(void)
  {
      
  }
  
  NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char *argn[], char *argv[], NPSavedData *saved)
  {
      if (browser->version >= 14)
          instance->pdata = browser->createobject (instance, getPluginClass());
      
      return NPERR_NO_ERROR;
  }
  
  NPError NPP_Destroy(NPP instance, NPSavedData **save)
  {
      return NPERR_NO_ERROR;
  }
  
  NPError NPP_SetWindow(NPP instance, NPWindow *window)
  {
      PluginObject *obj = instance->pdata;
      
      // Do nothing if browser didn't support NPN_CreateObject which would have created the PluginObject.
      if (obj != NULL)
          obj->window = window;
      
      return NPERR_NO_ERROR;
  }
  
  
  NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream *stream, NPBool seekable, uint16 *stype)
  {
      *stype = NP_ASFILEONLY;
      return NPERR_NO_ERROR;
  }
  
  NPError NPP_DestroyStream(NPP instance, NPStream *stream, NPReason reason)
  {
      return NPERR_NO_ERROR;
  }
  
  int32 NPP_WriteReady(NPP instance, NPStream *stream)
  {
      return 0;
  }
  
  int32 NPP_Write(NPP instance, NPStream *stream, int32 offset, int32 len, void *buffer)
  {
      return 0;
  }
  
  void NPP_StreamAsFile(NPP instance, NPStream *stream, const char *fname)
  {
      
  }
  
  void NPP_Print(NPP instance, NPPrint *platformPrint)
  {
      
  }
  
  int16 NPP_HandleEvent(NPP instance, void *event)
  {
      return 0;
  }
  
  void NPP_URLNotify(NPP instance, const char *url, NPReason reason, void *notifyData)
  {
      
  }
  
  NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)
  {
      if (variable == NPPVpluginScriptableNPObject) {
          void **v = (void **)value;
          PluginObject *obj = instance->pdata;
          *v = obj;
          return NPERR_NO_ERROR;
      }
      return NPERR_GENERIC_ERROR;
  }
  
  NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value)
  {
      return NPERR_GENERIC_ERROR;
  }
  
  
  



More information about the webkit-changes mailing list