[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
rjw
rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:30:48 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 061843744af18ec518e973c186683c3f4fa5c139
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Mar 25 22:58:38 2004 +0000
Netscape plugin API header cleanup.
Replaced our hacked up version of npapi.h with the
"official SDK" npapi.h. Moved our changes to the new
npfunctions.h. npfunctions.h really replaces what was defined in
the Netscape npupp.h header. However, rather than use the "official SDK"
npupp.h I think the cleaner npfunctions.h is better. npupp.h actually
has a bunch of Mac classic specific stuff that is no longer needed.
Copied npruntime.h to WebKit using Ken's copy-o-matic mechanism.
Made npapi.h, npruntime.h, and npfunctions.h SPI. With a bit
more consideration they will become API. They will also eventually be made
available for other platforms/vendors are mozilla.org.
Reviewed by Ken.
* Plugins.subproj/WebBaseNetscapePluginStream.h:
* Plugins.subproj/WebBaseNetscapePluginStream.m:
(-[WebBaseNetscapePluginStream dealloc]):
(-[WebBaseNetscapePluginStream startStreamWithURL:expectedContentLength:lastModifiedDate:MIMEType:]):
* Plugins.subproj/WebBaseNetscapePluginView.h:
* Plugins.subproj/WebNetscapePluginPackage.h:
* Plugins.subproj/WebNetscapePluginPackage.m:
(-[WebNetscapePluginPackage load]):
* Plugins.subproj/npapi.h:
* Plugins.subproj/npruntime.h: Added.
* WebKit.pbproj/project.pbxproj:
* copy-webcore-files-to-webkit:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6258 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index e978c16..5b3ac25 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,35 @@
+2004-03-25 Richard Williamson <rjw at apple.com>
+
+ Netscape plugin API header cleanup.
+
+ Replaced our hacked up version of npapi.h with the
+ "official SDK" npapi.h. Moved our changes to the new
+ npfunctions.h. npfunctions.h really replaces what was defined in
+ the Netscape npupp.h header. However, rather than use the "official SDK"
+ npupp.h I think the cleaner npfunctions.h is better. npupp.h actually
+ has a bunch of Mac classic specific stuff that is no longer needed.
+
+ Copied npruntime.h to WebKit using Ken's copy-o-matic mechanism.
+
+ Made npapi.h, npruntime.h, and npfunctions.h SPI. With a bit
+ more consideration they will become API. They will also eventually be made
+ available for other platforms/vendors are mozilla.org.
+
+ Reviewed by Ken.
+
+ * Plugins.subproj/WebBaseNetscapePluginStream.h:
+ * Plugins.subproj/WebBaseNetscapePluginStream.m:
+ (-[WebBaseNetscapePluginStream dealloc]):
+ (-[WebBaseNetscapePluginStream startStreamWithURL:expectedContentLength:lastModifiedDate:MIMEType:]):
+ * Plugins.subproj/WebBaseNetscapePluginView.h:
+ * Plugins.subproj/WebNetscapePluginPackage.h:
+ * Plugins.subproj/WebNetscapePluginPackage.m:
+ (-[WebNetscapePluginPackage load]):
+ * Plugins.subproj/npapi.h:
+ * Plugins.subproj/npruntime.h: Added.
+ * WebKit.pbproj/project.pbxproj:
+ * copy-webcore-files-to-webkit:
+
2004-03-24 Darin Adler <darin at apple.com>
Reviewed by John.
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.h b/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.h
index abc800f..ae68799 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.h
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.h
@@ -5,7 +5,7 @@
#import <Foundation/Foundation.h>
-#import <WebKit/npapi.h>
+#import <WebKit/npfunctions.h>
@class WebNetscapePluginPackage;
@class NSURLResponse;
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.m b/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.m
index 5bddc73..1ea035e 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.m
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.m
@@ -30,7 +30,7 @@
}
[URL release];
- free((void *)stream.URL);
+ free((void *)stream.url);
free(path);
[plugin release];
[deliveryData release];
@@ -75,8 +75,8 @@
[URL release];
URL = theURL;
- free((void *)stream.URL);
- stream.URL = strdup([URL _web_URLCString]);
+ free((void *)stream.url);
+ stream.url = strdup([URL _web_URLCString]);
stream.ndata = self;
stream.end = expectedContentLength > 0 ? expectedContentLength : 0;
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.h b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.h
index 933a12d..6adc86c 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.h
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.h
@@ -5,7 +5,7 @@
#import <Cocoa/Cocoa.h>
-#import <npapi.h>
+#import <WebKit/npfunctions.h>
@class WebDataSource;
@class WebFrame;
diff --git a/WebKit/Plugins.subproj/WebNetscapePluginPackage.h b/WebKit/Plugins.subproj/WebNetscapePluginPackage.h
index e7c4094..b432bf0 100644
--- a/WebKit/Plugins.subproj/WebNetscapePluginPackage.h
+++ b/WebKit/Plugins.subproj/WebNetscapePluginPackage.h
@@ -7,7 +7,7 @@
#import <WebCore/WebCoreViewFactory.h>
-#import <WebKit/npapi.h>
+#import <WebKit/npfunctions.h>
#import <WebKit/WebBasePluginPackage.h>
typedef enum {
diff --git a/WebKit/Plugins.subproj/WebNetscapePluginPackage.m b/WebKit/Plugins.subproj/WebNetscapePluginPackage.m
index 56fb276..1672329 100644
--- a/WebKit/Plugins.subproj/WebNetscapePluginPackage.m
+++ b/WebKit/Plugins.subproj/WebNetscapePluginPackage.m
@@ -424,7 +424,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
// swap function tables
if (isCFM) {
- browserFuncs.version = 11;
+ browserFuncs.version = NP_VERSION_MINOR;
browserFuncs.size = sizeof(NPNetscapeFuncs);
browserFuncs.geturl = (NPN_GetURLProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_GetURL);
browserFuncs.posturl = (NPN_PostURLProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_PostURL);
@@ -502,7 +502,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
} else {
// no function pointer conversion necessary for mach-o
- browserFuncs.version = 11;
+ browserFuncs.version = NP_VERSION_MINOR;
browserFuncs.size = sizeof(NPNetscapeFuncs);
browserFuncs.geturl = NPN_GetURL;
browserFuncs.posturl = NPN_PostURL;
diff --git a/WebKit/Plugins.subproj/npapi.h b/WebKit/Plugins.subproj/npapi.h
index 4075d62..1ee9dac 100644
--- a/WebKit/Plugins.subproj/npapi.h
+++ b/WebKit/Plugins.subproj/npapi.h
@@ -1,35 +1,76 @@
+/* -*- Mode: C; tab-width: 4; -*- */
/*
- npapi.h
- Copyright (c) 2002, Apple, Inc. All rights reserved.
-*/
-
+ * npapi.h $Revision$
+ * Netscape client plug-in API spec
+ */
+
#ifndef _NPAPI_H_
#define _NPAPI_H_
-#import <CoreServices/CoreServices.h>
-#import <Foundation/Foundation.h>
-/*
- * Values for mode passed to NPP_New:
- */
-#define NP_EMBED 1
-#define NP_FULL 2
+#ifdef INCLUDE_JAVA
+#include "jri.h" /* Java Runtime Interface */
+#else
+#define jref void *
+#define JRIEnv void
+#endif
+
+#ifdef _WINDOWS
+# ifndef XP_WIN
+# define XP_WIN 1
+# endif /* XP_WIN */
+#endif /* _WINDOWS */
+
+#ifdef __MWERKS__
+# define _declspec __declspec
+# ifdef macintosh
+# ifndef XP_MAC
+# define XP_MAC 1
+# endif /* XP_MAC */
+# endif /* macintosh */
+# ifdef __INTEL__
+# undef NULL
+# ifndef XP_WIN
+# define XP_WIN 1
+# endif /* __INTEL__ */
+# endif /* XP_PC */
+#endif /* __MWERKS__ */
+
+#ifdef __APPLE_CC__
+# define XP_MACOSX
+#endif
+
+#ifdef XP_MAC
+ #include <Quickdraw.h>
+ #include <Events.h>
+#endif
+
+#ifdef XP_MACOSX
+ #include <ApplicationServices/ApplicationServices.h>
+#endif
+
+#ifdef XP_UNIX
+ #include <X11/Xlib.h>
+ #include <X11/Xutil.h>
+#endif
+
+
+/*----------------------------------------------------------------------*/
+/* Plugin Version Constants */
+/*----------------------------------------------------------------------*/
+
+#define NP_VERSION_MAJOR 0
+#define NP_VERSION_MINOR 11
+
-/*
- * Values for stream type passed to NPP_NewStream:
- */
-#define NP_NORMAL 1
-#define NP_SEEK 2
-#define NP_ASFILE 3
-#define NP_ASFILEONLY 4
/*----------------------------------------------------------------------*/
/* Definition of Basic Types */
/*----------------------------------------------------------------------*/
-#ifndef _uint16
+#ifndef _UINT16
typedef unsigned short uint16;
#endif
-#ifndef _uint32
+#ifndef _UINT32
#if defined(__alpha)
typedef unsigned int uint32;
#else /* __alpha */
@@ -47,11 +88,30 @@ typedef long int32;
#endif /* __alpha */
#endif
-typedef int16 NPError;
-typedef unsigned char NPBool;
-typedef int16 NPReason;
-typedef char* NPMIMEType;
+#ifndef FALSE
+#define FALSE (0)
+#endif
+#ifndef TRUE
+#define TRUE (1)
+#endif
+#ifndef NULL
+#define NULL (0L)
+#endif
+
+typedef unsigned char NPBool;
+typedef int16 NPError;
+typedef int16 NPReason;
+typedef char* NPMIMEType;
+
+
+
+/*----------------------------------------------------------------------*/
+/* Structures and definitions */
+/*----------------------------------------------------------------------*/
+#ifdef XP_MAC
+#pragma options align=mac68k
+#endif
/*
* NPP is a plug-in's opaque instance handle
@@ -64,11 +124,12 @@ typedef struct _NPP
typedef NPP_t* NPP;
+
typedef struct _NPStream
{
void* pdata; /* plug-in private data */
void* ndata; /* netscape private data */
- const char* URL;
+ const char* url;
uint32 end;
uint32 lastmodified;
void* notifyData;
@@ -98,23 +159,43 @@ typedef struct _NPRect
uint16 right;
} NPRect;
-typedef RgnHandle NPRegion;
-
-typedef struct NP_Port
-{
- CGrafPtr port; /* Grafport */
- int32 portx; /* position inside the topmost window */
- int32 porty;
-} NP_Port;
+#ifdef XP_UNIX
+/*
+ * Unix specific structures and definitions
+ */
/*
- * Non-standard event types that can be passed to HandleEvent
+ * Callback Structures.
+ *
+ * These are used to pass additional platform specific information.
*/
-#define getFocusEvent (osEvt + 16)
-#define loseFocusEvent (osEvt + 17)
-#define adjustCursorEvent (osEvt + 18)
+enum {
+ NP_SETWINDOW = 1,
+ NP_PRINT
+};
+
+typedef struct
+{
+ int32 type;
+} NPAnyCallbackStruct;
+
+typedef struct
+{
+ int32 type;
+ Display* display;
+ Visual* visual;
+ Colormap colormap;
+ unsigned int depth;
+} NPSetWindowCallbackStruct;
+
+typedef struct
+{
+ int32 type;
+ FILE* fp;
+} NPPrintCallbackStruct;
+#endif /* XP_UNIX */
/*
* List of variable names for which NPP_GetValue shall be implemented
@@ -138,6 +219,10 @@ typedef enum {
NPNVisOfflineBool
} NPNVariable;
+/*
+ * The type of a NPWindow - it specifies the type of the data structure
+ * returned in the window field.
+ */
typedef enum {
NPWindowTypeWindow = 1,
NPWindowTypeDrawable
@@ -152,9 +237,13 @@ typedef struct _NPWindow
uint32 height;
NPRect clipRect; /* Clipping rectangle in port coordinates */
/* Used by MAC only. */
+#ifdef XP_UNIX
+ void * ws_info; /* Platform-dependent additonal data */
+#endif /* XP_UNIX */
NPWindowType type; /* Is this a window or a drawable? */
} NPWindow;
+
typedef struct _NPFullPrint
{
NPBool pluginPrinted; /* Set TRUE if plugin handled fullscreen */
@@ -180,91 +269,73 @@ typedef struct _NPPrint
} print;
} NPPrint;
+#if defined(XP_MAC) || defined(XP_MACOSX)
+typedef EventRecord NPEvent;
+#elif defined(XP_WIN)
+typedef struct _NPEvent
+{
+ uint16 event;
+ uint32 wParam;
+ uint32 lParam;
+} NPEvent;
+#elif defined (XP_UNIX)
+typedef XEvent NPEvent;
+#else
+typedef void* NPEvent;
+#endif /* XP_MAC */
+
+#if defined(XP_MAC) || defined(XP_MACOSX)
+typedef RgnHandle NPRegion;
+#elif defined(XP_WIN)
+typedef HRGN NPRegion;
+#elif defined(XP_UNIX)
+typedef Region NPRegion;
+#else
+typedef void *NPRegion;
+#endif /* XP_MAC */
+
+#if defined(XP_MAC) || defined(XP_MACOSX)
+/*
+ * Mac-specific structures and definitions.
+ */
+
+typedef struct NP_Port
+{
+ CGrafPtr port; /* Grafport */
+ int32 portx; /* position inside the topmost window */
+ int32 porty;
+} NP_Port;
+
+/*
+ * Non-standard event types that can be passed to HandleEvent
+ */
+#define getFocusEvent (osEvt + 16)
+#define loseFocusEvent (osEvt + 17)
+#define adjustCursorEvent (osEvt + 18)
+
+#endif /* XP_MAC */
+
+
+/*
+ * Values for mode passed to NPP_New:
+ */
+#define NP_EMBED 1
+#define NP_FULL 2
+
+/*
+ * Values for stream type passed to NPP_NewStream:
+ */
+#define NP_NORMAL 1
+#define NP_SEEK 2
+#define NP_ASFILE 3
+#define NP_ASFILEONLY 4
+
+#define NP_MAXREADY (((unsigned)(~0)<<1)>>1)
+
+#ifdef XP_MAC
+#pragma options align=reset
+#endif
-typedef NPError (*NPN_GetURLNotifyProcPtr)(NPP instance, const char* URL, const char* window, void* notifyData);
-typedef NPError (*NPN_PostURLNotifyProcPtr)(NPP instance, const char* URL, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData);
-typedef NPError (*NPN_RequestReadProcPtr)(NPStream* stream, NPByteRange* rangeList);
-typedef NPError (*NPN_NewStreamProcPtr)(NPP instance, NPMIMEType type, const char* window, NPStream** stream);
-typedef int32 (*NPN_WriteProcPtr)(NPP instance, NPStream* stream, int32 len, void* buffer);
-typedef NPError (*NPN_DestroyStreamProcPtr)(NPP instance, NPStream* stream, NPReason reason);
-typedef void (*NPN_StatusProcPtr)(NPP instance, const char* message);
-typedef const char*(*NPN_UserAgentProcPtr)(NPP instance);
-typedef void* (*NPN_MemAllocProcPtr)(uint32 size);
-typedef void (*NPN_MemFreeProcPtr)(void* ptr);
-typedef uint32 (*NPN_MemFlushProcPtr)(uint32 size);
-typedef void (*NPN_ReloadPluginsProcPtr)(NPBool reloadPages);
-typedef NPError (*NPN_GetValueProcPtr)(NPP instance, NPNVariable variable, void *ret_value);
-typedef NPError (*NPN_SetValueProcPtr)(NPP instance, NPPVariable variable, void *value);
-typedef void (*NPN_InvalidateRectProcPtr)(NPP instance, NPRect *rect);
-typedef void (*NPN_InvalidateRegionProcPtr)(NPP instance, NPRegion region);
-typedef void (*NPN_ForceRedrawProcPtr)(NPP instance);
-typedef NPError (*NPN_GetURLProcPtr)(NPP instance, const char* URL, const char* window);
-typedef NPError (*NPN_PostURLProcPtr)(NPP instance, const char* URL, const char* window, uint32 len, const char* buf, NPBool file);
-typedef void* (*NPN_GetJavaEnvProcPtr)(void);
-typedef void* (*NPN_GetJavaPeerProcPtr)(NPP instance);
-
-typedef NPError (*NPP_NewProcPtr)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
-typedef NPError (*NPP_DestroyProcPtr)(NPP instance, NPSavedData** save);
-typedef NPError (*NPP_SetWindowProcPtr)(NPP instance, NPWindow* window);
-typedef NPError (*NPP_NewStreamProcPtr)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
-typedef NPError (*NPP_DestroyStreamProcPtr)(NPP instance, NPStream* stream, NPReason reason);
-typedef void (*NPP_StreamAsFileProcPtr)(NPP instance, NPStream* stream, const char* fname);
-typedef int32 (*NPP_WriteReadyProcPtr)(NPP instance, NPStream* stream);
-typedef int32 (*NPP_WriteProcPtr)(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer);
-typedef void (*NPP_PrintProcPtr)(NPP instance, NPPrint* platformPrint);
-typedef int16 (*NPP_HandleEventProcPtr)(NPP instance, void* event);
-typedef void (*NPP_URLNotifyProcPtr)(NPP instance, const char* URL, NPReason reason, void* notifyData);
-typedef NPError (*NPP_GetValueProcPtr)(NPP instance, NPPVariable variable, void *ret_value);
-typedef NPError (*NPP_SetValueProcPtr)(NPP instance, NPNVariable variable, void *value);
-typedef void (*NPP_ShutdownProcPtr)(void);
-
-typedef void *(*NPP_GetJavaClassProcPtr)(void);
-typedef void* JRIGlobalRef; //not using this right now
-
-typedef struct _NPNetscapeFuncs {
- uint16 size;
- uint16 version;
- NPN_GetURLProcPtr geturl;
- NPN_PostURLProcPtr posturl;
- NPN_RequestReadProcPtr requestread;
- NPN_NewStreamProcPtr newstream;
- NPN_WriteProcPtr write;
- NPN_DestroyStreamProcPtr destroystream;
- NPN_StatusProcPtr status;
- NPN_UserAgentProcPtr uagent;
- NPN_MemAllocProcPtr memalloc;
- NPN_MemFreeProcPtr memfree;
- NPN_MemFlushProcPtr memflush;
- NPN_ReloadPluginsProcPtr reloadplugins;
- NPN_GetJavaEnvProcPtr getJavaEnv;
- NPN_GetJavaPeerProcPtr getJavaPeer;
- NPN_GetURLNotifyProcPtr geturlnotify;
- NPN_PostURLNotifyProcPtr posturlnotify;
- NPN_GetValueProcPtr getvalue;
- NPN_SetValueProcPtr setvalue;
- NPN_InvalidateRectProcPtr invalidaterect;
- NPN_InvalidateRegionProcPtr invalidateregion;
- NPN_ForceRedrawProcPtr forceredraw;
-} NPNetscapeFuncs;
-
-typedef struct _NPPluginFuncs {
- uint16 size;
- uint16 version;
- NPP_NewProcPtr newp;
- NPP_DestroyProcPtr destroy;
- NPP_SetWindowProcPtr setwindow;
- NPP_NewStreamProcPtr newstream;
- NPP_DestroyStreamProcPtr destroystream;
- NPP_StreamAsFileProcPtr asfile;
- NPP_WriteReadyProcPtr writeready;
- NPP_WriteProcPtr write;
- NPP_PrintProcPtr print;
- NPP_HandleEventProcPtr event;
- NPP_URLNotifyProcPtr urlnotify;
- JRIGlobalRef javaClass;
- NPP_GetValueProcPtr getvalue;
- NPP_SetValueProcPtr setvalue;
-} NPPluginFuncs;
/*----------------------------------------------------------------------*/
/* Error and Reason Code definitions */
@@ -314,68 +385,98 @@ typedef struct _NPPluginFuncs {
#define NPVERS_68K_HAS_LIVECONNECT 11
#define NPVERS_HAS_WINDOWLESS 11
-#if defined(__cplusplus)
+
+/*----------------------------------------------------------------------*/
+/* Function Prototypes */
+/*----------------------------------------------------------------------*/
+
+#if defined(_WINDOWS) && !defined(WIN32)
+#define NP_LOADDS _loadds
+#else
+#define NP_LOADDS
+#endif
+
+#ifdef __cplusplus
extern "C" {
#endif
-typedef NPError (* MainFuncPtr)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownProcPtr*);
+/*
+ * NPP_* functions are provided by the plugin and called by the navigator.
+ */
-typedef NPError (* NP_InitializeFuncPtr)(NPNetscapeFuncs*);
-typedef NPError (* NP_GetEntryPointsFuncPtr)(NPPluginFuncs*);
-typedef void (* BP_CreatePluginMIMETypesPreferencesFuncPtr)(void);
+#ifdef XP_UNIX
+char* NPP_GetMIMEDescription(void);
+#endif /* XP_UNIX */
-typedef void* (* NP_GetJavaClassFuncPtr)(void);
+NPError NPP_Initialize(void);
+void NPP_Shutdown(void);
+NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
+ uint16 mode, int16 argc, char* argn[],
+ char* argv[], NPSavedData* saved);
+NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save);
+NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window);
+NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type,
+ NPStream* stream, NPBool seekable,
+ uint16* stype);
+NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream,
+ NPReason reason);
+int32 NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream);
+int32 NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32 offset,
+ int32 len, void* buffer);
+void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
+ const char* fname);
+void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint);
+int16 NPP_HandleEvent(NPP instance, void* event);
+void NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
+ NPReason reason, void* notifyData);
+jref NP_LOADDS NPP_GetJavaClass(void);
+NPError NPP_GetValue(void *instance, NPPVariable variable,
+ void *value);
+NPError NPP_SetValue(void *instance, NPNVariable variable,
+ void *value);
/*
* NPN_* functions are provided by the navigator and called by the plugin.
*/
-void NPN_Version(int* plugin_major, int* plugin_minor, int* netscape_major, int* netscape_minor);
-NPError NPN_GetURLNotify(NPP instance, const char* URL, const char* target, void* notifyData);
-NPError NPN_GetURL(NPP instance, const char* URL, const char* target);
-NPError NPN_PostURLNotify(NPP instance, const char* URL, const char* target, uint32 len, const char* buf, NPBool file, void* notifyData);
-NPError NPN_PostURL(NPP instance, const char* URL, const char* target, uint32 len, const char* buf, NPBool file);
+void NPN_Version(int* plugin_major, int* plugin_minor,
+ int* netscape_major, int* netscape_minor);
+NPError NPN_GetURLNotify(NPP instance, const char* url,
+ const char* target, void* notifyData);
+NPError NPN_GetURL(NPP instance, const char* url,
+ const char* target);
+NPError NPN_PostURLNotify(NPP instance, const char* url,
+ const char* target, uint32 len,
+ const char* buf, NPBool file,
+ void* notifyData);
+NPError NPN_PostURL(NPP instance, const char* url,
+ const char* target, uint32 len,
+ const char* buf, NPBool file);
NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
-NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target, NPStream** stream);
-int32 NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer);
-NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason);
+NPError NPN_NewStream(NPP instance, NPMIMEType type,
+ const char* target, NPStream** stream);
+int32 NPN_Write(NPP instance, NPStream* stream, int32 len,
+ void* buffer);
+NPError NPN_DestroyStream(NPP instance, NPStream* stream,
+ NPReason reason);
void NPN_Status(NPP instance, const char* message);
const char* NPN_UserAgent(NPP instance);
void* NPN_MemAlloc(uint32 size);
void NPN_MemFree(void* ptr);
uint32 NPN_MemFlush(uint32 size);
-void NPN_ReloadPlugins(NPBool reloadPages);
-void* NPN_GetJavaEnv(void);
-void* NPN_GetJavaPeer(NPP instance);
-NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value);
-NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value);
+void NPN_ReloadPlugins(NPBool reloadPages);
+JRIEnv* NPN_GetJavaEnv(void);
+jref NPN_GetJavaPeer(NPP instance);
+NPError NPN_GetValue(NPP instance, NPNVariable variable,
+ void *value);
+NPError NPN_SetValue(NPP instance, NPPVariable variable,
+ void *value);
void NPN_InvalidateRect(NPP instance, NPRect *invalidRect);
void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion);
void NPN_ForceRedraw(NPP instance);
-#if defined(__cplusplus)
-} // extern "C"
+#ifdef __cplusplus
+} /* end extern "C" */
#endif
-/*
- * NPP_* functions are provided by the plugin and called by the navigator.
- */
-/*
-void NPP_Shutdown(void);
-NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
-NPError NPP_Destroy(NPP instance, NPSavedData** save);
-NPError NPP_SetWindow(NPP instance, NPWindow* window);
-NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
-NPError NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason);
-int32 NPP_WriteReady(NPP instance, NPStream* stream);
-int32 NPP_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer);
-void NPP_StreamAsFile(NPP instance, NPStream* stream, const char* fname);
-void NPP_Print(NPP instance, NPPrint* platformPrint);
-int16 NPP_HandleEvent(NPP instance, void* event);
-void NPP_URLNotify(NPP instance, const char* URL, NPReason reason, void* notifyData);
-NPError NPP_GetValue(void *instance, NPPVariable variable, void *value);
-NPError NPP_SetValue(void *instance, NPNVariable variable, void *value);
-
-void* NPP_GetJavaClass();
-*/
#endif /* _NPAPI_H_ */
diff --git a/JavaScriptCore/bindings/npruntime.h b/WebKit/Plugins.subproj/npruntime.h
similarity index 99%
copy from JavaScriptCore/bindings/npruntime.h
copy to WebKit/Plugins.subproj/npruntime.h
index abf0103..3420171 100644
--- a/JavaScriptCore/bindings/npruntime.h
+++ b/WebKit/Plugins.subproj/npruntime.h
@@ -48,6 +48,7 @@
extern "C" {
#endif
+
/*
This API is used to facilitate binding code written in 'C' to JavaScript
objects. In particular it is used to support the extended Netscape
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index fc681a2..305f165 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -345,6 +345,8 @@
9321290B06068E3100B62302,
9321290C06068E3100B62302,
9321290D06068E3100B62302,
+ 51C16E090613868100A1657B,
+ 51C16E4106138EB400A1657B,
);
isa = PBXHeadersBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
@@ -1501,6 +1503,40 @@
);
};
};
+ 51C16E080613868100A1657B = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ path = npruntime.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 51C16E090613868100A1657B = {
+ fileRef = 51C16E080613868100A1657B;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Private,
+ );
+ };
+ };
+ 51C16E4006138EB400A1657B = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ path = npfunctions.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 51C16E4106138EB400A1657B = {
+ fileRef = 51C16E4006138EB400A1657B;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Private,
+ );
+ };
+ };
51F6866C0366057300CA2D3A = {
fileEncoding = 30;
isa = PBXFileReference;
@@ -2231,8 +2267,10 @@
848DFF410365F6FB00CA2ACA = {
children = (
515B878E05F5348600EABBF9,
+ 51C16E4006138EB400A1657B,
F5F717220288493C018635CA,
F5F717230288493C018635CA,
+ 51C16E080613868100A1657B,
F5A672B90263866E01000102,
F5A672BA0263866E01000102,
F5EBC45502134BC301CA1520,
@@ -4462,6 +4500,9 @@
fileRef = F5F717220288493C018635CA;
isa = PBXBuildFile;
settings = {
+ ATTRIBUTES = (
+ Private,
+ );
};
};
F5F717290288493C018635CA = {
diff --git a/WebKit/copy-webcore-files-to-webkit b/WebKit/copy-webcore-files-to-webkit
index f4fa87b..a5410b2 100755
--- a/WebKit/copy-webcore-files-to-webkit
+++ b/WebKit/copy-webcore-files-to-webkit
@@ -6,7 +6,7 @@ use File::Basename;
my $ProgramName = 'copy-webcore-files-to-webkit';
-my %Files = (
+my %WebCoreFiles = (
'kwq/DOM.h' => 'DOM.subproj/DOM.h',
'kwq/DOMCore.h' => 'DOM.subproj/DOMCore.h',
'kwq/DOMViews.h' => 'DOM.subproj/DOMViews.h',
@@ -19,11 +19,17 @@ my %Files = (
'kwq/DOM-compat.h' => 'DOM.subproj/DOM-compat.h',
);
+my %JavaScriptCoreFiles = (
+ 'bindings/NP_runtime.h' => 'Plugins.subproj/npruntime.h',
+);
+
+my $JavaScriptCorePath = '';
my $WebCorePath = '';
my $WebKitPath = '';
CheckInWebKit();
CheckWebCoreFound();
+CheckJavaScriptCoreFound();
CopyFilesIfNeeded();
#=======================================================================================
@@ -64,14 +70,43 @@ sub CheckWebCoreFound {
}
}
+sub CheckJavaScriptCoreFound {
+ my $path = cwd();
+ $path = dirname($path) . '/JavaScriptCore';
+ if (-d $path) {
+ # ok...WebCore is where we expect it
+ $JavaScriptCorePath = $path;
+ }
+ else {
+ Say("*** $ProgramName: JavaScriptCore is not a sibling directory to WebKit. Cannot copy, exiting...");
+ exit(0);
+ }
+}
+
sub CopyFilesIfNeeded {
# Only copy files if the dest file does not exist
# or the source file is different than the dest file
my $blab = 0;
- for my $file (keys(%Files)) {
+ for my $file (keys(%WebCoreFiles)) {
my $source = "$WebCorePath/$file";
- my $dest = "$WebKitPath/$Files{$file}";
+ my $dest = "$WebKitPath/$WebCoreFiles{$file}";
+ if (! -f $source) {
+ Fail("$source is not a plain file");
+ }
+ if (-e $dest && ! -f $dest) {
+ Fail("$dest is not a plain file");
+ }
+ if (! -e $dest || system("cmp $source $dest > /dev/null 2>&1")) {
+ Say("$ProgramName: copying files...") if $blab == 0;
+ $blab = 1;
+ ExecuteCommand("cp -f $source $dest");
+ }
+ }
+
+ for my $file (keys(%JavaScriptCoreFiles)) {
+ my $source = "$JavaScriptCorePath/$file";
+ my $dest = "$WebKitPath/$JavaScriptCoreFiles{$file}";
if (! -f $source) {
Fail("$source is not a plain file");
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list