[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:53:28 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 6abf2cba65a251c3718c246c4419915ade1aca75
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 18 18:21:06 2001 +0000

    Initial submission of the plug-in classes
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@512 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/khtml/rendering/render_frames.cpp b/WebCore/khtml/rendering/render_frames.cpp
index aa1e4ab..314c0df 100644
--- a/WebCore/khtml/rendering/render_frames.cpp
+++ b/WebCore/khtml/rendering/render_frames.cpp
@@ -825,7 +825,10 @@ void RenderPartObject::updateWidget()
 // ugly..
 void RenderPartObject::close()
 {
+#ifdef _KWQ_
+#else
     updateWidget();
+#endif
     RenderPart::close();
 }
 
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 9ef7ef5..d6669b1 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -52,7 +52,10 @@
 #import <WCURICache.h>
 #import <WCURICacheData.h>
 
-//#import <WKPluginDatabase.h>
+#import <WKPluginDatabase.h>
+#include <npapi.h>
+#include <KWQPlugin.h>
+#include <rendering/render_frames.h>
 
 #import <KWQView.h>
 
@@ -200,6 +203,7 @@ KHTMLPart::~KHTMLPart()
 {
     delete d;
     _logNotYetImplemented();
+    NSLog(@"destructing KHTMLPart");
 }
 
 static NSString *
@@ -1392,7 +1396,24 @@ void KHTMLPart::urlSelected( const QString &url, int button, int state, const QS
 bool KHTMLPart::requestObject( khtml::RenderPart *frame, const QString &url, const QString &serviceType,
                     const QStringList &args)
 {
-    //[WKPluginDatabase installedPlugins];
+    WKPlugin *plugin;
+    //KWQPlugin pluginWidget;
+    NPP_t instance;
+    
+    if(url.isEmpty() || serviceType.isEmpty()){
+        return FALSE;
+    }
+
+    plugin = [[WKPluginDatabase installedPlugins] getPluginForMimeType:QSTRING_TO_NSSTRING(serviceType)];
+    if(plugin == nil){
+        return FALSE;
+    }
+    [plugin load];
+    [plugin newInstance:&instance withType:QSTRING_TO_NSSTRING(serviceType) withMode:NP_EMBED withArguments:nil withValues:nil];
+    [plugin destroyInstance:&instance]; // this needs to be moved 
+    
+    //frame->setWidget(&pluginWidget);
+
     return FALSE;
 }
 
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 9ef7ef5..d6669b1 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -52,7 +52,10 @@
 #import <WCURICache.h>
 #import <WCURICacheData.h>
 
-//#import <WKPluginDatabase.h>
+#import <WKPluginDatabase.h>
+#include <npapi.h>
+#include <KWQPlugin.h>
+#include <rendering/render_frames.h>
 
 #import <KWQView.h>
 
@@ -200,6 +203,7 @@ KHTMLPart::~KHTMLPart()
 {
     delete d;
     _logNotYetImplemented();
+    NSLog(@"destructing KHTMLPart");
 }
 
 static NSString *
@@ -1392,7 +1396,24 @@ void KHTMLPart::urlSelected( const QString &url, int button, int state, const QS
 bool KHTMLPart::requestObject( khtml::RenderPart *frame, const QString &url, const QString &serviceType,
                     const QStringList &args)
 {
-    //[WKPluginDatabase installedPlugins];
+    WKPlugin *plugin;
+    //KWQPlugin pluginWidget;
+    NPP_t instance;
+    
+    if(url.isEmpty() || serviceType.isEmpty()){
+        return FALSE;
+    }
+
+    plugin = [[WKPluginDatabase installedPlugins] getPluginForMimeType:QSTRING_TO_NSSTRING(serviceType)];
+    if(plugin == nil){
+        return FALSE;
+    }
+    [plugin load];
+    [plugin newInstance:&instance withType:QSTRING_TO_NSSTRING(serviceType) withMode:NP_EMBED withArguments:nil withValues:nil];
+    [plugin destroyInstance:&instance]; // this needs to be moved 
+    
+    //frame->setWidget(&pluginWidget);
+
     return FALSE;
 }
 
diff --git a/WebCore/src/kwq/qt/qpopupmenu.h b/WebCore/kwq/KWQPlugin.h
similarity index 82%
copy from WebCore/src/kwq/qt/qpopupmenu.h
copy to WebCore/kwq/KWQPlugin.h
index 6cb02a3..cdf6a25 100644
--- a/WebCore/src/kwq/qt/qpopupmenu.h
+++ b/WebCore/kwq/KWQPlugin.h
@@ -23,40 +23,46 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef QPOPUPMENU_H_
-#define QPOPUPMENU_H_
+#ifndef KWQPlugin_H_
+#define KWQPlugin_H_
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
-// class QPopupMenu ============================================================
+#include "qwidget.h"
+#include "qstring.h"
 
-class QPopupMenu {
+#import <WKPluginView.h>
+    
+// class KWQPlugin ===============================================================
+
+class KWQPlugin : public QWidget {
 public:
 
     // typedefs ----------------------------------------------------------------
     // enums -------------------------------------------------------------------
     // constants ---------------------------------------------------------------
     // static member functions -------------------------------------------------
-        
-    // constructors, copy constructors, and destructors ------------------------
-    
-    QPopupMenu();
-    ~QPopupMenu();
     
+    // constructors, copy constructors, and destructors ------------------------
+
+    KWQPlugin(QWidget *parent=0);
+    ~KWQPlugin();
+
     // member functions --------------------------------------------------------
+    void *getPort();
+    
     // operators ---------------------------------------------------------------
 
 // protected -------------------------------------------------------------------
 // private ---------------------------------------------------------------------
 
 private:
-    // no copying or assignment
-    // note that these are "standard" (no pendantic stuff needed)
-    QPopupMenu(const QPopupMenu &);
-    QPopupMenu &operator=(const QPopupMenu &);
+    KWQPlugin(const KWQPlugin &);
+    KWQPlugin &operator=(const KWQPlugin &);
+    
 
-}; // class QPopupMenu =========================================================
+}; // class KWQPlugin ============================================================
 
 #endif
diff --git a/WebCore/src/kwq/KWQPushButton.mm b/WebCore/kwq/KWQPlugin.mm
similarity index 84%
copy from WebCore/src/kwq/KWQPushButton.mm
copy to WebCore/kwq/KWQPlugin.mm
index 26d20f2..1e690ef 100644
--- a/WebCore/src/kwq/KWQPushButton.mm
+++ b/WebCore/kwq/KWQPlugin.mm
@@ -22,24 +22,23 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
-#include <qpushbutton.h>
 
+#include <KWQPlugin.h>
 #include <KWQView.h>
-
 #include <kwqdebug.h>
 
-// Should require no additional code over KWQButton
-
-QPushButton::QPushButton(QWidget *w) : QButton (w)
+KWQPlugin::KWQPlugin(QWidget *parent)
 {
+    setView ([[[WKPluginView alloc] initWithFrame: NSMakeRect (0,0,0,0) widget: this] autorelease]);
 }
 
-
-QPushButton::QPushButton(const QString &text, QWidget *parent, const char* name)
+void * KWQPlugin::getPort()
 {
+    return [(WKPluginView *)getView() qdPort];
 }
 
-
-QPushButton::~QPushButton()
+KWQPlugin::~KWQPlugin()
 {
+
 }
+
diff --git a/WebCore/kwq/Makefile.in b/WebCore/kwq/Makefile.in
index e9249c6..00dc2b0 100644
--- a/WebCore/kwq/Makefile.in
+++ b/WebCore/kwq/Makefile.in
@@ -28,7 +28,6 @@ MMOBJECTS = \
     KWQButton.o \
     KWQCString.o \
     KWQChar.o \
-    KWQCharsets.o \
     KWQCheckBox.o \
     KWQColor.o \
     KWQColorGroup.o \
@@ -129,15 +128,22 @@ MMOBJECTS = \
     KWQxml.o \
     _KWQOwner.o \
     kwqdebug.o \
+    WKPlugin.o \
+    WKPluginView.o \
+    WKPluginDatabase.o \
+    KWQPlugin.o \
     $(NULL)
 
+COBJECTS = \
+    npapi.o \
+    $(NULL)
+        
 MOBJECTS = \
 	$(NULL)
 
-
 EXPORT_HEADERS = $(HEADERS)
 
-OBJECTS = $(MMOBJECTS) $(MOBJECTS)
+OBJECTS = $(MMOBJECTS) $(MOBJECTS) $(COBJECTS)
 EXPORT_OBJECTS = $(OBJECTS)
 
 EXPORT_HEADERS_DIR = $(TOPSRCDIR)/WebCore/include/private
@@ -191,6 +197,17 @@ CMFLAGS = $(BASECMFLAGS) \
     -I. \
     $(NULL)
 
+CFLAGS = $(BASECFLAGS) \
+    -I$(TOPSRCDIR) \
+    -I$(TOPSRCDIR)/WebCore/include \
+    -I$(TOPSRCDIR)/WebCore/src/kdelibs/khtml \
+    -I$(TOPSRCDIR)/WebCore/src/kwq \
+    -I$(TOPSRCDIR)/WebCore/src/kwq/qt \
+    -I$(TOPSRCDIR)/WebCore/src/kwq/kde \
+    -I$(TOPSRCDIR)/WebCore/src/kwq/kdecore \
+    -I. \
+    $(NULL)
+
 DEPFLAGS = $(CMFLAGS)
 
 #----------------------------------------------------------------------
@@ -202,33 +219,6 @@ $(LIBRARY): $(OBJECTS)
 	$(AR) $(ARFLAGS) $(LIBRARY) $(OBJECTS)
 	$(RANLIB) $(LIBRARY)
 
-make-mac-encodings: make-mac-encodings.o
-	$(CC) -o $@ $< $(LDFLAGS) -framework CoreFoundation
-
-mac-encodings.txt: make-mac-encodings
-	./make-mac-encodings $@
-
-KWQCharsetData.c: make-charset-table.pl character-sets.txt mac-encodings.txt
-	./make-charset-table.pl character-sets.txt mac-encodings.txt KWQCharsetData.c 
-
-KWQCharsets.o: KWQCharsetData.c
-
-CHARSET_FILES = make-mac-encodings \
-	 make-mac-encodings.o \
-	mac-encodings.txt \
-	KWQCharsetData.c \
-	$(NULL)
-
-KWQCharsets.o: KWQCharsetData.c
-
-#----------------------------------------------------------------------
-#
-
-CLEAN_FILES = $(OBJECTS) \
-	$(LIBRARY) \
-	$(CHARSET_FILES) \
-	$(NULL)
-
 #----------------------------------------------------------------------
 # include make rules boilerplate
 
diff --git a/WebCore/kwq/WKPlugin.h b/WebCore/kwq/WKPlugin.h
new file mode 100644
index 0000000..cd780bc
--- /dev/null
+++ b/WebCore/kwq/WKPlugin.h
@@ -0,0 +1,37 @@
+//
+//  WKPlugins.h
+//  
+//
+//  Created by Chris Blumenberg on Tue Dec 11 2001.
+//  Copyright (c) 2001 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#include "npapi.h"
+
+ at interface WKPlugin : NSObject {
+
+    NSDictionary *mimeTypes;
+    NSString *name;
+    NSString *executablePath;
+    BOOL isLoaded;
+    
+}
+
+- (BOOL)initializeWithPath:(NSString *)plugin;
+- (void)load;
+- (void)newInstance:(NPP)instance withType:(NSString *)mimeType withMode:(uint16)mode withArguments:(NSArray *)arguments withValues:(NSArray *)values;
+- (void)destroyInstance:(NPP)instance;
+- (void)unload;
+
+- (NSDictionary *)mimeTypes;
+- (NSString *)name;
+- (NSString *)executablePath;
+- (BOOL)isLoaded;
+- (NSString *)description;
+
+
+ at end
+    
+NSMutableDictionary *getMimeTypesForResourceFile(SInt16 resRef);
+NPError InitializePlugin(mainFuncPtr pluginMainFunc);
\ No newline at end of file
diff --git a/WebCore/kwq/WKPlugin.mm b/WebCore/kwq/WKPlugin.mm
new file mode 100644
index 0000000..f96bcc2
--- /dev/null
+++ b/WebCore/kwq/WKPlugin.mm
@@ -0,0 +1,244 @@
+//
+//  WKPlugins.m
+//  
+//
+//  Created by Chris Blumenberg on Tue Dec 11 2001.
+//  Copyright (c) 2001 __MyCompanyName__. All rights reserved.
+//
+
+#import "WKPlugin.h"
+#include "kwqdebug.h"
+
+NPPluginFuncs pluginFuncs;
+NPNetscapeFuncs browserFuncs;
+uint16 pluginSize;
+uint16 pluginVersion;
+NPP_NewProcPtr NPP_New;
+NPP_DestroyProcPtr NPP_Destroy;
+NPP_SetWindowProcPtr NPP_SetWindow;
+NPP_NewStreamProcPtr NPP_NewStream;
+NPP_DestroyStreamProcPtr NPP_DestroyStream;
+NPP_StreamAsFileProcPtr NPP_StreamAsFile;
+NPP_WriteReadyProcPtr NPP_WriteReady;
+NPP_WriteProcPtr NPP_Write;
+NPP_PrintProcPtr NPP_Print;
+NPP_HandleEventProcPtr NPP_HandleEvent;
+NPP_URLNotifyProcPtr NPP_URLNotify;
+NPP_GetValueProcPtr NPP_GetValue;
+NPP_SetValueProcPtr NPP_SetValue;
+NPP_ShutdownProcPtr NPP_Shutdown; 
+
+ at implementation WKPlugin
+
+- (BOOL)initializeWithPath:(NSString *)plugin{
+    NSFileManager *fileManager;
+    NSDictionary *fileInfo;
+    CFBundleRef bundle;
+    NSBundle *bundle2;
+    CFURLRef pluginURL;
+    SInt16 resRef;
+    FSRef fref;
+    OSErr err;
+    UInt32 type;
+    
+    fileManager = [NSFileManager defaultManager];
+    fileInfo = [fileManager fileAttributesAtPath:plugin traverseLink:YES];
+    if([[fileInfo objectForKey:@"NSFileType"] isEqualToString:@"NSFileTypeRegular"]){ 
+        if([[fileInfo objectForKey:@"NSFileHFSTypeCode"] unsignedLongValue] == 1112690764){ // 1112690764 = 'BRPL'
+            name = [plugin lastPathComponent];
+            executablePath = plugin;
+            err = FSPathMakeRef((UInt8 *)[plugin cString], &fref, NULL);
+            if(err != noErr){
+                KWQDebug("WKPlugin: FSPathMakeRef failed. Error=%d\n", err);
+                return FALSE;
+            }
+            resRef = FSOpenResFile(&fref, fsRdPerm);
+            if(resRef <= noErr){
+                KWQDebug("WKPlugin: FSOpenResFile failed. Can't open resource file: %s, Error=%d\n", [plugin cString], err);
+                return FALSE;
+            }
+            mimeTypes = getMimeTypesForResourceFile(resRef);
+            if(mimeTypes == nil) return FALSE;
+        }else return FALSE;
+    }else if([[fileInfo objectForKey:@"NSFileType"] isEqualToString:@"NSFileTypeDirectory"]){
+        pluginURL = CFURLCreateWithFileSystemPath(NULL, (CFStringRef)plugin, kCFURLPOSIXPathStyle, TRUE);
+        bundle = CFBundleCreate(NULL, pluginURL);
+        bundle2 = [NSBundle bundleWithPath:plugin]; // CFBundleCopyExecutableURL doesn't return full path! Have to use NSBundle
+        CFBundleGetPackageInfo(bundle, &type, NULL);
+        if(type == 1112690764){  // 1112690764 = 'BRPL'
+            name = [plugin lastPathComponent];
+            executablePath = [bundle2 executablePath];
+            resRef = CFBundleOpenBundleResourceMap(bundle);
+            mimeTypes = getMimeTypesForResourceFile(resRef);
+            if(mimeTypes == nil) return FALSE;
+        }else return FALSE;
+        CFRelease(bundle);
+        CFRelease(pluginURL);
+
+    }else{
+        return FALSE;
+    }
+    [mimeTypes retain];
+    [name retain];
+    [executablePath retain];
+    isLoaded = FALSE;
+    return TRUE;
+}
+
+
+- (void)load{    
+    OSErr err;
+    FSSpec spec;
+    FSRef fref;
+    CFragConnectionID connID;  
+    mainFuncPtr pluginMainFunc;
+    
+    if(isLoaded){
+        return;
+    }
+    err = FSPathMakeRef((UInt8 *)[executablePath cString], &fref, NULL);
+    if(err != noErr){
+        KWQDebug("WKPlugin: load: FSPathMakeRef failed. Error=%d\n", err);
+        return;
+    }
+    err = FSGetCatalogInfo(&fref, kFSCatInfoNone, NULL, NULL, &spec, NULL);
+    if(err != noErr){
+        KWQDebug("WKPlugin: load: FSGetCatalogInfo failed. Error=%d\n", err);
+        return;
+    }
+    err = GetDiskFragment(&spec, 0, kCFragGoesToEOF, nil, kPrivateCFragCopy, &connID, (Ptr *)&pluginMainFunc, nil);
+    if(err != noErr){
+        KWQDebug("WKPlugin: load: GetDiskFragment failed. Error=%d\n", err);
+        return;
+    }
+    InitializePlugin(pluginMainFunc);
+    KWQDebug("Plugin Loaded\n");
+    isLoaded = TRUE;
+}
+
+- (void)newInstance:(NPP)instance withType:(NSString *)mimeType withMode:(uint16)mode withArguments:(NSArray *)arguments withValues:(NSArray *)values{
+    NPError npErr;
+    char mime[200];
+
+    [mimeType getCString:mime];
+    npErr = NPP_New(mime, instance, mode, 0, NULL, NULL, NULL);
+    KWQDebug("NPP_New: %d\n", npErr);
+}
+
+- (void)destroyInstance:(NPP)instance{
+    NPError npErr;
+    
+    npErr = NPP_Destroy(instance, NULL);
+    KWQDebug("NPP_Destroy: %d\n", npErr);
+}
+
+- (void)unload{
+    // unload library here
+    NPP_Shutdown();
+}
+- (NSDictionary *)mimeTypes{
+    return mimeTypes;
+}
+
+- (NSString *)name{
+    return name;
+}
+
+- (NSString *)executablePath{
+    return executablePath;
+}
+
+- (BOOL)isLoaded{
+    return isLoaded;
+}
+
+- (NSString *)description{
+    NSMutableString *desc;
+    
+    desc = [NSMutableString stringWithCapacity:100];
+    [desc appendString:@"\n"];
+    [desc appendString:@"name: "];
+    [desc appendString:name];
+    [desc appendString:@"\n"];
+    [desc appendString:@"executablePath: "];
+    [desc appendString:executablePath];
+    [desc appendString:@"\n"];
+    [desc appendString:@"isLoaded: "];
+    if(isLoaded){
+        [desc appendString:@"TRUE\n"];
+    }else{
+        [desc appendString:@"FALSE\n"];
+    }
+    [desc appendString:@"mimeTypes: "];
+    [desc appendString:[mimeTypes description]];
+    [desc appendString:@"\n"];
+    return desc;
+}
+ at end
+
+NPError InitializePlugin(mainFuncPtr pluginMainFunc){
+    NPError npErr;
+    
+    browserFuncs.version = 11;
+    browserFuncs.size = sizeof(NPNetscapeFuncs);
+    browserFuncs.geturl = tVectorForFunctionPointer(NPN_GetURLNotify);
+    browserFuncs.posturl = tVectorForFunctionPointer(NPN_PostURLNotify);
+    browserFuncs.requestread = tVectorForFunctionPointer(NPN_RequestRead);
+    browserFuncs.newstream = tVectorForFunctionPointer(NPN_NewStream);
+    browserFuncs.write = tVectorForFunctionPointer(NPN_Write);
+    browserFuncs.destroystream = tVectorForFunctionPointer(NPN_DestroyStream);
+    browserFuncs.status = tVectorForFunctionPointer(NPN_Status);
+    browserFuncs.uagent = tVectorForFunctionPointer(NPN_UserAgent);
+    browserFuncs.memalloc = tVectorForFunctionPointer(NPN_MemAlloc);
+    browserFuncs.memfree = tVectorForFunctionPointer(NPN_MemFree);
+    browserFuncs.memflush = tVectorForFunctionPointer(NPN_MemFlush);
+    browserFuncs.reloadplugins = tVectorForFunctionPointer(NPN_ReloadPlugins);
+    browserFuncs.geturlnotify = tVectorForFunctionPointer(NPN_GetURLNotify);
+    browserFuncs.posturlnotify = tVectorForFunctionPointer(NPN_PostURLNotify);
+    browserFuncs.getvalue = tVectorForFunctionPointer(NPN_GetValue);
+    browserFuncs.setvalue = tVectorForFunctionPointer(NPN_SetValue);
+    browserFuncs.invalidaterect = tVectorForFunctionPointer(NPN_InvalidateRect);
+    browserFuncs.invalidateregion = tVectorForFunctionPointer(NPN_InvalidateRegion);
+    browserFuncs.forceredraw = tVectorForFunctionPointer(NPN_ForceRedraw);
+    
+    pluginMainFunc = functionPointerForTVector(pluginMainFunc);
+    npErr = pluginMainFunc(&browserFuncs, &pluginFuncs, &NPP_Shutdown);
+    
+    pluginSize = pluginFuncs.size;
+    pluginVersion = pluginFuncs.version;
+    KWQDebug("pluginMainFunc: %d, size=%d, version=%d\n", npErr, pluginSize, pluginVersion);
+    
+    NPP_New = functionPointerForTVector(pluginFuncs.newp);
+    NPP_Destroy = functionPointerForTVector(pluginFuncs.destroy);
+    NPP_SetWindow = functionPointerForTVector(pluginFuncs.setwindow);
+    NPP_NewStream = functionPointerForTVector(pluginFuncs.newstream);
+    NPP_DestroyStream = functionPointerForTVector(pluginFuncs.destroystream);
+    NPP_StreamAsFile = functionPointerForTVector(pluginFuncs.asfile);
+    NPP_WriteReady = functionPointerForTVector(pluginFuncs.writeready);
+    NPP_Write = functionPointerForTVector(pluginFuncs.write);
+    NPP_Print = functionPointerForTVector(pluginFuncs.print);
+    NPP_HandleEvent = functionPointerForTVector(pluginFuncs.event);
+    NPP_URLNotify = functionPointerForTVector(pluginFuncs.urlnotify);
+    NPP_GetValue = functionPointerForTVector(pluginFuncs.getvalue);
+    NPP_SetValue = functionPointerForTVector(pluginFuncs.setvalue);
+    return npErr;
+}
+
+NSMutableDictionary *getMimeTypesForResourceFile(SInt16 resRef){
+    NSMutableDictionary *mimeDict;
+    Str255 theString;
+    char mimeString[200], extString[200];
+    int n;
+    
+    mimeDict = [NSMutableDictionary dictionaryWithCapacity:1];
+    UseResFile(resRef);
+    for(n=1; 1; n+=2){
+        GetIndString(theString, 128, n);
+        CopyPascalStringToC(theString, mimeString);
+        if(!strcmp(mimeString, "")) break;
+        GetIndString(theString, 128, n+1);
+        CopyPascalStringToC(theString, extString);
+        [mimeDict setObject:[NSString stringWithCString:extString] forKey:[NSString stringWithCString:mimeString]];
+    }
+    return mimeDict;
+}
\ No newline at end of file
diff --git a/WebCore/kwq/WKPluginDatabase.h b/WebCore/kwq/WKPluginDatabase.h
new file mode 100644
index 0000000..e0e163a
--- /dev/null
+++ b/WebCore/kwq/WKPluginDatabase.h
@@ -0,0 +1,23 @@
+//
+//  WKPluginsDatabase.h
+//  
+//
+//  Created by Chris Blumenberg on Tue Dec 11 2001.
+//  Copyright (c) 2001 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "WKPlugin.h"
+
+ at interface WKPluginDatabase : NSObject {
+
+    NSArray *plugins;
+}
+
++ (WKPluginDatabase *)installedPlugins;
+- (WKPlugin *)getPluginForMimeType:(NSString *)mimeType;
+
+ at end
+
+NSMutableDictionary *getMimeTypesForResourceFile(SInt16 resRef);
+NSArray *findPlugins(void);
\ No newline at end of file
diff --git a/WebCore/kwq/WKPluginDatabase.mm b/WebCore/kwq/WKPluginDatabase.mm
new file mode 100644
index 0000000..371fc02
--- /dev/null
+++ b/WebCore/kwq/WKPluginDatabase.mm
@@ -0,0 +1,82 @@
+ //
+//  WKPluginsDatabase.m
+//  
+//
+//  Created by Chris Blumenberg on Tue Dec 11 2001.
+//  Copyright (c) 2001 __MyCompanyName__. All rights reserved.
+//
+
+#import "WKPluginDatabase.h"
+#include "kwqdebug.h"
+
+ at implementation WKPluginDatabase
+static WKPluginDatabase *__WKPluginDatabase = nil;
+
+
++ (WKPluginDatabase *)installedPlugins {
+
+    if(!__WKPluginDatabase){
+        __WKPluginDatabase  = [WKPluginDatabase alloc];
+        __WKPluginDatabase->plugins = findPlugins();
+    }
+    return __WKPluginDatabase;
+}
+
+// The first plugin with the specified mime type is returned. We may want to tie this to the defaults so that this is configurable.
+- (WKPlugin *)getPluginForMimeType:(NSString *)mimeType{
+    uint i;
+    WKPlugin *plugin;
+    NSDictionary *temp;
+    
+    for(i=0; i<[plugins count]; i++){      
+        plugin = [plugins objectAtIndex:i];
+        temp = [plugin mimeTypes];
+        if([[temp allKeys] containsObject:mimeType]){
+            return plugin;
+        }
+    }
+    KWQDebug("No plug-in found for mime type: %s\n", [mimeType cString]);
+    return nil;
+}
+
+ at end
+
+NSArray *findPlugins(void){
+    NSFileManager *fileManager;
+    NSArray *libraryPlugins, *homePlugins;
+    NSString *homePluginDir, *libPluginDir;
+    NSMutableArray *pluginPaths, *pluginArray;
+    WKPlugin *plugin;
+    uint i;
+    
+    fileManager = [NSFileManager defaultManager];
+    homePluginDir = [[NSString stringWithString:NSHomeDirectory()] stringByAppendingPathComponent:@"Library/Internet Plug-Ins"];
+    libPluginDir = [NSString stringWithString:@"/Library/Internet Plug-Ins"];
+    
+    homePlugins = [fileManager directoryContentsAtPath:homePluginDir];
+    libraryPlugins = [fileManager directoryContentsAtPath:libPluginDir];
+
+    pluginPaths = [NSMutableArray arrayWithCapacity:[homePlugins count]+[libraryPlugins count]];
+
+    for(i=0; i<[homePlugins count]; i++){
+        [pluginPaths addObject:[homePluginDir stringByAppendingPathComponent:[homePlugins objectAtIndex:i]]];
+    }
+    for(i=0; i<[libraryPlugins count]; i++){
+        if(![homePlugins containsObject:[libraryPlugins objectAtIndex:i]]){ // avoid dups, give precedense to home dir
+            [pluginPaths addObject:[libPluginDir stringByAppendingPathComponent:[libraryPlugins objectAtIndex:i]]];
+        }
+    }
+    pluginArray = [NSMutableArray arrayWithCapacity:[pluginPaths count]];
+    
+    for(i=0; i<[pluginPaths count]; i++){
+        plugin = [WKPlugin alloc];
+        if([plugin initializeWithPath:[pluginPaths objectAtIndex:i]]){
+            [plugin retain];
+            [pluginArray addObject:plugin];
+            KWQDebug("Found plugin: %s\n", [[plugin name] cString]);
+        }
+    }
+    return [pluginArray retain];
+}
+
+
diff --git a/WebCore/kwq/WKPluginView.mm b/WebCore/kwq/WKPluginView.mm
new file mode 100644
index 0000000..dfc2fec
--- /dev/null
+++ b/WebCore/kwq/WKPluginView.mm
@@ -0,0 +1,26 @@
+//
+//  WKPluginView.m
+//  
+//
+//  Created by Chris Blumenberg on Thu Dec 13 2001.
+//  Copyright (c) 2001 __MyCompanyName__. All rights reserved.
+//
+
+#import "WKPluginView.h"
+
+
+ at implementation WKPluginView
+
+- initWithFrame: (NSRect) r widget: (QWidget *)w 
+{
+    [super initWithFrame: r];
+    widget = w;
+    isFlipped = YES;
+    return self;
+}
+
+- (void)drawRect:(NSRect)rect {
+    // Drawing code here.
+}
+
+ at end
diff --git a/WebCore/kwq/npapi.c b/WebCore/kwq/npapi.c
new file mode 100644
index 0000000..dc07c80
--- /dev/null
+++ b/WebCore/kwq/npapi.c
@@ -0,0 +1,128 @@
+#include "npapi.h"
+
+NPError NPN_GetURLNotify(NPP instance, const char* url, const char* target, void* notifyData){
+    printf("NPN_GetURLNotify\n");
+    return NPERR_GENERIC_ERROR;
+
+}
+
+NPError NPN_GetURL(NPP instance, const char* url, const char* target){
+    printf("NPN_GetURL\n");
+    return NPERR_GENERIC_ERROR;
+}
+
+NPError NPN_PostURLNotify(NPP instance, const char* url, const char* target, UInt32 len, const char* buf, NPBool file, void* notifyData){
+    printf("NPN_PostURLNotify\n");
+    return NPERR_GENERIC_ERROR;
+}
+
+NPError NPN_PostURL(NPP instance, const char* url, const char* target, UInt32 len, const char* buf, NPBool file){
+    printf("NPN_PostURL\n");
+    return NPERR_GENERIC_ERROR;
+}
+
+NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList){
+    printf("NPN_RequestRead\n");
+    return NPERR_GENERIC_ERROR;
+}
+
+NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target, NPStream** stream){
+    printf("NPN_NewStream\n");
+    return NPERR_GENERIC_ERROR;
+}
+
+SInt32	NPN_Write(NPP instance, NPStream* stream, SInt32 len, void* buffer){
+    printf("NPN_Write\n");
+    return NPERR_GENERIC_ERROR;
+}
+
+NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason){
+    printf("NPN_DestroyStream\n");
+    return NPERR_GENERIC_ERROR;
+}
+
+void NPN_Status(NPP instance, const char* message){
+    printf("NPN_Status\n");
+}
+
+const char* NPN_UserAgent(NPP instance){
+    printf("NPN_UserAgent\n");
+    return "IE";
+}
+
+void* NPN_MemAlloc(UInt32 size){
+    printf("NPN_MemAlloc\n");
+    return malloc(size);
+
+}
+
+void NPN_MemFree(void* ptr){
+    printf("NPN_MemFree\n");
+    free(ptr);
+
+}
+
+UInt32 NPN_MemFlush(UInt32 size){
+    printf("NPN_MemFlush\n");
+    return 0;
+}
+
+void NPN_ReloadPlugins(NPBool reloadPages){
+    printf("NPN_ReloadPlugins\n");
+
+}
+
+NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value){
+    printf("NPN_GetValue\n");
+    return NPERR_GENERIC_ERROR;
+}
+
+NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value){
+    printf("NPN_SetValue\n");
+    return NPERR_GENERIC_ERROR;
+}	
+
+void NPN_InvalidateRect(NPP instance, NPRect *invalidRect){
+    printf("NPN_InvalidateRect\n");
+
+}
+
+void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion){
+    printf("NPN_InvalidateRegion\n");
+
+}
+
+void NPN_ForceRedraw(NPP instance){
+    printf("NPN_ForceRedraw\n");
+
+}
+
+
+void *functionPointerForTVector(void *tvp) {
+    UInt32 template[6] = {0x3D800000, 0x618C0000, 0x800C0000, 0x804C0004, 0x7C0903A6, 0x4E800420};
+    UInt32 *newGlue = NULL;
+    
+    if (tvp != NULL) {
+        newGlue = malloc(sizeof(template));
+        if (newGlue != NULL) {
+            unsigned i;
+            for (i = 0; i < 6; i++) newGlue[i] = template[i];
+            newGlue[0] |= ((UInt32)tvp >> 16);
+            newGlue[1] |= ((UInt32)tvp & 0xFFFF);
+            MakeDataExecutable(newGlue, sizeof(template));
+        }
+    }
+    return newGlue;
+}
+
+void *tVectorForFunctionPointer(void *fp) {
+    void **newGlue = NULL;
+    if (fp != NULL) {
+        newGlue = malloc(2 * sizeof(void *));
+        if (newGlue != NULL) {
+            newGlue[0] = fp;
+            newGlue[1] = NULL;
+        }
+    }
+    return newGlue;
+}
\ No newline at end of file
diff --git a/WebCore/kwq/npapi.h b/WebCore/kwq/npapi.h
new file mode 100644
index 0000000..493a08a
--- /dev/null
+++ b/WebCore/kwq/npapi.h
@@ -0,0 +1,366 @@
+/*
+ *  npapi.h
+ *  test
+ *
+ *  Created by chris on Tue Nov 20 2001.
+ *  Copyright (c) 2001 __MyCompanyName__. All rights reserved.
+ *
+ */
+ 
+#ifndef _NPAPI_H_
+#define _NPAPI_H_
+
+#include <CoreServices/CoreServices.h>
+#include <Foundation/Foundation.h>
+/*
+ * 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
+
+/*----------------------------------------------------------------------*/
+/*		     Definition of Basic Types				*/
+/*----------------------------------------------------------------------*/
+
+#ifndef _uint16
+typedef unsigned short uint16;
+#endif
+#ifndef _uint32
+#if defined(__alpha)
+typedef unsigned int uint32;
+#else /* __alpha */
+typedef unsigned long uint32;
+#endif /* __alpha */
+#endif
+#ifndef _INT16
+typedef short int16;
+#endif
+#ifndef _INT32
+#if defined(__alpha)
+typedef int int32;
+#else /* __alpha */
+typedef long int32;
+#endif /* __alpha */
+#endif
+
+typedef int16 NPError;
+typedef unsigned char NPBool;
+typedef int16 NPReason;
+typedef char* NPMIMEType;
+
+
+/*
+ *  NPP is a plug-in's opaque instance handle
+ */
+typedef struct _NPP
+{
+    void*	pdata;			/* plug-in private data */
+    void*	ndata;			/* netscape private data */
+} NPP_t;
+
+typedef NPP_t*	NPP;
+
+typedef struct _NPStream
+{
+    void*		pdata;		/* plug-in private data */
+    void*		ndata;		/* netscape private data */
+    const char* 	url;
+    uint32		end;
+    uint32		lastmodified;
+    void*		notifyData;
+} NPStream;
+
+
+typedef struct _NPByteRange
+{
+    int32	offset; 		/* negative offset means from the end */
+    uint32	length;
+    struct _NPByteRange* next;
+} NPByteRange;
+
+
+typedef struct _NPSavedData
+{
+    int32	len;
+    void*	buf;
+} NPSavedData;
+
+
+typedef struct _NPRect
+{
+    uint16	top;
+    uint16	left;
+    uint16	bottom;
+    uint16	right;
+} NPRect;
+
+typedef RgnHandle NPRegion;
+
+typedef struct NP_Port
+{
+    CGrafPtr	port;		/* Grafport */
+    int32		portx;		/* position inside the topmost window */
+    int32		porty;
+} NP_Port;
+
+/*
+ * List of variable names for which NPP_GetValue shall be implemented
+ */
+typedef enum {
+	NPPVpluginNameString = 1,
+	NPPVpluginDescriptionString,
+	NPPVpluginWindowBool,
+	NPPVpluginTransparentBool
+} NPPVariable;
+
+/*
+ * List of variable names for which NPN_GetValue is implemented by Mozilla
+ */
+typedef enum {
+	NPNVxDisplay = 1,
+	NPNVxtAppContext,
+    NPNVnetscapeWindow,
+	NPNVjavascriptEnabledBool,
+	NPNVasdEnabledBool,
+	NPNVisOfflineBool
+} NPNVariable;
+
+typedef enum {
+    NPWindowTypeWindow = 1,
+    NPWindowTypeDrawable
+} NPWindowType;
+
+typedef struct _NPWindow
+{
+    void*	window; 	/* Platform specific window handle */
+    int32	x;			/* Position of top left corner relative */
+    int32	y;			/*	to a netscape page.					*/
+    uint32	width;		/* Maximum window size */
+    uint32	height;
+    NPRect	clipRect;	/* Clipping rectangle in port coordinates */
+						/* Used by MAC only.			  */
+    NPWindowType type;	/* Is this a window or a drawable? */
+} NPWindow;
+
+typedef struct _NPFullPrint
+{
+    NPBool	pluginPrinted;	/* Set TRUE if plugin handled fullscreen */
+							/*	printing							 */
+    NPBool	printOne;		/* TRUE if plugin should print one copy  */
+							/*	to default printer					 */
+    void*	platformPrint;	/* Platform-specific printing info */
+} NPFullPrint;
+
+typedef struct _NPEmbedPrint
+{
+    NPWindow	window;
+    void*	platformPrint;	/* Platform-specific printing info */
+} NPEmbedPrint;
+
+typedef struct _NPPrint
+{
+    uint16	mode;						/* NP_FULL or NP_EMBED */
+    union
+    {
+		NPFullPrint		fullPrint;		/* if mode is NP_FULL */
+		NPEmbedPrint	embedPrint;		/* if mode is NP_EMBED */
+    } print;
+} NPPrint;
+
+
+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 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_alue);
+typedef NPError	(*NPN_SetValueProcPtr)(NPP instance, NPPVariable variable, void *ret_alue);
+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 ProcPtr NPN_GetJavaEnvProcPtr;
+typedef ProcPtr NPN_GetJavaPeerProcPtr;
+
+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 int16 (*NPP_WriteReadyProcPtr)(NPP instance, NPStream* stream);
+typedef int16 (*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_alue);
+typedef NPError	(*NPP_SetValueProcPtr)(NPP instance, NPNVariable variable, void *ret_alue);
+typedef void (*NPP_ShutdownProcPtr)(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_DestroyStreamProcPtr 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			*/
+/*----------------------------------------------------------------------*/
+
+/*
+ *	Values of type NPError:
+ */
+#define NPERR_BASE							0
+#define NPERR_NO_ERROR						(NPERR_BASE + 0)
+#define NPERR_GENERIC_ERROR					(NPERR_BASE + 1)
+#define NPERR_INVALID_INSTANCE_ERROR		(NPERR_BASE + 2)
+#define NPERR_INVALID_FUNCTABLE_ERROR		(NPERR_BASE + 3)
+#define NPERR_MODULE_LOAD_FAILED_ERROR		(NPERR_BASE + 4)
+#define NPERR_OUT_OF_MEMORY_ERROR			(NPERR_BASE + 5)
+#define NPERR_INVALID_PLUGIN_ERROR			(NPERR_BASE + 6)
+#define NPERR_INVALID_PLUGIN_DIR_ERROR		(NPERR_BASE + 7)
+#define NPERR_INCOMPATIBLE_VERSION_ERROR	(NPERR_BASE + 8)
+#define NPERR_INVALID_PARAM				(NPERR_BASE + 9)
+#define NPERR_INVALID_URL					(NPERR_BASE + 10)
+#define NPERR_FILE_NOT_FOUND				(NPERR_BASE + 11)
+#define NPERR_NO_DATA						(NPERR_BASE + 12)
+#define NPERR_STREAM_NOT_SEEKABLE			(NPERR_BASE + 13)
+
+/*
+ *	Values of type NPReason:
+ */
+#define NPRES_BASE				0
+#define NPRES_DONE					(NPRES_BASE + 0)
+#define NPRES_NETWORK_ERR			(NPRES_BASE + 1)
+#define NPRES_USER_BREAK			(NPRES_BASE + 2)
+
+/*
+ *      Don't use these obsolete error codes any more.
+ */
+#define NP_NOERR  NP_NOERR_is_obsolete_use_NPERR_NO_ERROR
+#define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR
+#define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK
+
+/*
+ * Version feature information
+ */
+#define NPVERS_HAS_STREAMOUTPUT 	8
+#define NPVERS_HAS_NOTIFICATION 	9
+#define NPVERS_HAS_LIVECONNECT		9
+#define NPVERS_WIN16_HAS_LIVECONNECT	9
+#define NPVERS_68K_HAS_LIVECONNECT	11
+#define NPVERS_HAS_WINDOWLESS       11
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+typedef NPError (* mainFuncPtr)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownProcPtr*);
+
+void *functionPointerForTVector(void *);
+void *tVectorForFunctionPointer(void *);
+
+/*
+ * 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);
+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);
+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);
+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"
+#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);
+*/
+#endif /* _NPAPI_H_ */
\ No newline at end of file
diff --git a/WebCore/src/kdelibs/khtml/rendering/render_frames.cpp b/WebCore/src/kdelibs/khtml/rendering/render_frames.cpp
index aa1e4ab..314c0df 100644
--- a/WebCore/src/kdelibs/khtml/rendering/render_frames.cpp
+++ b/WebCore/src/kdelibs/khtml/rendering/render_frames.cpp
@@ -825,7 +825,10 @@ void RenderPartObject::updateWidget()
 // ugly..
 void RenderPartObject::close()
 {
+#ifdef _KWQ_
+#else
     updateWidget();
+#endif
     RenderPart::close();
 }
 
diff --git a/WebCore/src/kwq/KWQKHTMLPart.mm b/WebCore/src/kwq/KWQKHTMLPart.mm
index 9ef7ef5..d6669b1 100644
--- a/WebCore/src/kwq/KWQKHTMLPart.mm
+++ b/WebCore/src/kwq/KWQKHTMLPart.mm
@@ -52,7 +52,10 @@
 #import <WCURICache.h>
 #import <WCURICacheData.h>
 
-//#import <WKPluginDatabase.h>
+#import <WKPluginDatabase.h>
+#include <npapi.h>
+#include <KWQPlugin.h>
+#include <rendering/render_frames.h>
 
 #import <KWQView.h>
 
@@ -200,6 +203,7 @@ KHTMLPart::~KHTMLPart()
 {
     delete d;
     _logNotYetImplemented();
+    NSLog(@"destructing KHTMLPart");
 }
 
 static NSString *
@@ -1392,7 +1396,24 @@ void KHTMLPart::urlSelected( const QString &url, int button, int state, const QS
 bool KHTMLPart::requestObject( khtml::RenderPart *frame, const QString &url, const QString &serviceType,
                     const QStringList &args)
 {
-    //[WKPluginDatabase installedPlugins];
+    WKPlugin *plugin;
+    //KWQPlugin pluginWidget;
+    NPP_t instance;
+    
+    if(url.isEmpty() || serviceType.isEmpty()){
+        return FALSE;
+    }
+
+    plugin = [[WKPluginDatabase installedPlugins] getPluginForMimeType:QSTRING_TO_NSSTRING(serviceType)];
+    if(plugin == nil){
+        return FALSE;
+    }
+    [plugin load];
+    [plugin newInstance:&instance withType:QSTRING_TO_NSSTRING(serviceType) withMode:NP_EMBED withArguments:nil withValues:nil];
+    [plugin destroyInstance:&instance]; // this needs to be moved 
+    
+    //frame->setWidget(&pluginWidget);
+
     return FALSE;
 }
 
diff --git a/WebCore/src/kwq/qt/qpopupmenu.h b/WebCore/src/kwq/KWQPlugin.h
similarity index 82%
copy from WebCore/src/kwq/qt/qpopupmenu.h
copy to WebCore/src/kwq/KWQPlugin.h
index 6cb02a3..cdf6a25 100644
--- a/WebCore/src/kwq/qt/qpopupmenu.h
+++ b/WebCore/src/kwq/KWQPlugin.h
@@ -23,40 +23,46 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef QPOPUPMENU_H_
-#define QPOPUPMENU_H_
+#ifndef KWQPlugin_H_
+#define KWQPlugin_H_
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
-// class QPopupMenu ============================================================
+#include "qwidget.h"
+#include "qstring.h"
 
-class QPopupMenu {
+#import <WKPluginView.h>
+    
+// class KWQPlugin ===============================================================
+
+class KWQPlugin : public QWidget {
 public:
 
     // typedefs ----------------------------------------------------------------
     // enums -------------------------------------------------------------------
     // constants ---------------------------------------------------------------
     // static member functions -------------------------------------------------
-        
-    // constructors, copy constructors, and destructors ------------------------
-    
-    QPopupMenu();
-    ~QPopupMenu();
     
+    // constructors, copy constructors, and destructors ------------------------
+
+    KWQPlugin(QWidget *parent=0);
+    ~KWQPlugin();
+
     // member functions --------------------------------------------------------
+    void *getPort();
+    
     // operators ---------------------------------------------------------------
 
 // protected -------------------------------------------------------------------
 // private ---------------------------------------------------------------------
 
 private:
-    // no copying or assignment
-    // note that these are "standard" (no pendantic stuff needed)
-    QPopupMenu(const QPopupMenu &);
-    QPopupMenu &operator=(const QPopupMenu &);
+    KWQPlugin(const KWQPlugin &);
+    KWQPlugin &operator=(const KWQPlugin &);
+    
 
-}; // class QPopupMenu =========================================================
+}; // class KWQPlugin ============================================================
 
 #endif
diff --git a/WebCore/src/kwq/KWQPushButton.mm b/WebCore/src/kwq/KWQPlugin.mm
similarity index 84%
copy from WebCore/src/kwq/KWQPushButton.mm
copy to WebCore/src/kwq/KWQPlugin.mm
index 26d20f2..1e690ef 100644
--- a/WebCore/src/kwq/KWQPushButton.mm
+++ b/WebCore/src/kwq/KWQPlugin.mm
@@ -22,24 +22,23 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
-#include <qpushbutton.h>
 
+#include <KWQPlugin.h>
 #include <KWQView.h>
-
 #include <kwqdebug.h>
 
-// Should require no additional code over KWQButton
-
-QPushButton::QPushButton(QWidget *w) : QButton (w)
+KWQPlugin::KWQPlugin(QWidget *parent)
 {
+    setView ([[[WKPluginView alloc] initWithFrame: NSMakeRect (0,0,0,0) widget: this] autorelease]);
 }
 
-
-QPushButton::QPushButton(const QString &text, QWidget *parent, const char* name)
+void * KWQPlugin::getPort()
 {
+    return [(WKPluginView *)getView() qdPort];
 }
 
-
-QPushButton::~QPushButton()
+KWQPlugin::~KWQPlugin()
 {
+
 }
+
diff --git a/WebCore/src/kwq/Makefile.in b/WebCore/src/kwq/Makefile.in
index e9249c6..00dc2b0 100644
--- a/WebCore/src/kwq/Makefile.in
+++ b/WebCore/src/kwq/Makefile.in
@@ -28,7 +28,6 @@ MMOBJECTS = \
     KWQButton.o \
     KWQCString.o \
     KWQChar.o \
-    KWQCharsets.o \
     KWQCheckBox.o \
     KWQColor.o \
     KWQColorGroup.o \
@@ -129,15 +128,22 @@ MMOBJECTS = \
     KWQxml.o \
     _KWQOwner.o \
     kwqdebug.o \
+    WKPlugin.o \
+    WKPluginView.o \
+    WKPluginDatabase.o \
+    KWQPlugin.o \
     $(NULL)
 
+COBJECTS = \
+    npapi.o \
+    $(NULL)
+        
 MOBJECTS = \
 	$(NULL)
 
-
 EXPORT_HEADERS = $(HEADERS)
 
-OBJECTS = $(MMOBJECTS) $(MOBJECTS)
+OBJECTS = $(MMOBJECTS) $(MOBJECTS) $(COBJECTS)
 EXPORT_OBJECTS = $(OBJECTS)
 
 EXPORT_HEADERS_DIR = $(TOPSRCDIR)/WebCore/include/private
@@ -191,6 +197,17 @@ CMFLAGS = $(BASECMFLAGS) \
     -I. \
     $(NULL)
 
+CFLAGS = $(BASECFLAGS) \
+    -I$(TOPSRCDIR) \
+    -I$(TOPSRCDIR)/WebCore/include \
+    -I$(TOPSRCDIR)/WebCore/src/kdelibs/khtml \
+    -I$(TOPSRCDIR)/WebCore/src/kwq \
+    -I$(TOPSRCDIR)/WebCore/src/kwq/qt \
+    -I$(TOPSRCDIR)/WebCore/src/kwq/kde \
+    -I$(TOPSRCDIR)/WebCore/src/kwq/kdecore \
+    -I. \
+    $(NULL)
+
 DEPFLAGS = $(CMFLAGS)
 
 #----------------------------------------------------------------------
@@ -202,33 +219,6 @@ $(LIBRARY): $(OBJECTS)
 	$(AR) $(ARFLAGS) $(LIBRARY) $(OBJECTS)
 	$(RANLIB) $(LIBRARY)
 
-make-mac-encodings: make-mac-encodings.o
-	$(CC) -o $@ $< $(LDFLAGS) -framework CoreFoundation
-
-mac-encodings.txt: make-mac-encodings
-	./make-mac-encodings $@
-
-KWQCharsetData.c: make-charset-table.pl character-sets.txt mac-encodings.txt
-	./make-charset-table.pl character-sets.txt mac-encodings.txt KWQCharsetData.c 
-
-KWQCharsets.o: KWQCharsetData.c
-
-CHARSET_FILES = make-mac-encodings \
-	 make-mac-encodings.o \
-	mac-encodings.txt \
-	KWQCharsetData.c \
-	$(NULL)
-
-KWQCharsets.o: KWQCharsetData.c
-
-#----------------------------------------------------------------------
-#
-
-CLEAN_FILES = $(OBJECTS) \
-	$(LIBRARY) \
-	$(CHARSET_FILES) \
-	$(NULL)
-
 #----------------------------------------------------------------------
 # include make rules boilerplate
 
diff --git a/WebCore/src/kwq/WKPlugin.h b/WebCore/src/kwq/WKPlugin.h
new file mode 100644
index 0000000..cd780bc
--- /dev/null
+++ b/WebCore/src/kwq/WKPlugin.h
@@ -0,0 +1,37 @@
+//
+//  WKPlugins.h
+//  
+//
+//  Created by Chris Blumenberg on Tue Dec 11 2001.
+//  Copyright (c) 2001 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#include "npapi.h"
+
+ at interface WKPlugin : NSObject {
+
+    NSDictionary *mimeTypes;
+    NSString *name;
+    NSString *executablePath;
+    BOOL isLoaded;
+    
+}
+
+- (BOOL)initializeWithPath:(NSString *)plugin;
+- (void)load;
+- (void)newInstance:(NPP)instance withType:(NSString *)mimeType withMode:(uint16)mode withArguments:(NSArray *)arguments withValues:(NSArray *)values;
+- (void)destroyInstance:(NPP)instance;
+- (void)unload;
+
+- (NSDictionary *)mimeTypes;
+- (NSString *)name;
+- (NSString *)executablePath;
+- (BOOL)isLoaded;
+- (NSString *)description;
+
+
+ at end
+    
+NSMutableDictionary *getMimeTypesForResourceFile(SInt16 resRef);
+NPError InitializePlugin(mainFuncPtr pluginMainFunc);
\ No newline at end of file
diff --git a/WebCore/src/kwq/WKPlugin.mm b/WebCore/src/kwq/WKPlugin.mm
new file mode 100644
index 0000000..f96bcc2
--- /dev/null
+++ b/WebCore/src/kwq/WKPlugin.mm
@@ -0,0 +1,244 @@
+//
+//  WKPlugins.m
+//  
+//
+//  Created by Chris Blumenberg on Tue Dec 11 2001.
+//  Copyright (c) 2001 __MyCompanyName__. All rights reserved.
+//
+
+#import "WKPlugin.h"
+#include "kwqdebug.h"
+
+NPPluginFuncs pluginFuncs;
+NPNetscapeFuncs browserFuncs;
+uint16 pluginSize;
+uint16 pluginVersion;
+NPP_NewProcPtr NPP_New;
+NPP_DestroyProcPtr NPP_Destroy;
+NPP_SetWindowProcPtr NPP_SetWindow;
+NPP_NewStreamProcPtr NPP_NewStream;
+NPP_DestroyStreamProcPtr NPP_DestroyStream;
+NPP_StreamAsFileProcPtr NPP_StreamAsFile;
+NPP_WriteReadyProcPtr NPP_WriteReady;
+NPP_WriteProcPtr NPP_Write;
+NPP_PrintProcPtr NPP_Print;
+NPP_HandleEventProcPtr NPP_HandleEvent;
+NPP_URLNotifyProcPtr NPP_URLNotify;
+NPP_GetValueProcPtr NPP_GetValue;
+NPP_SetValueProcPtr NPP_SetValue;
+NPP_ShutdownProcPtr NPP_Shutdown; 
+
+ at implementation WKPlugin
+
+- (BOOL)initializeWithPath:(NSString *)plugin{
+    NSFileManager *fileManager;
+    NSDictionary *fileInfo;
+    CFBundleRef bundle;
+    NSBundle *bundle2;
+    CFURLRef pluginURL;
+    SInt16 resRef;
+    FSRef fref;
+    OSErr err;
+    UInt32 type;
+    
+    fileManager = [NSFileManager defaultManager];
+    fileInfo = [fileManager fileAttributesAtPath:plugin traverseLink:YES];
+    if([[fileInfo objectForKey:@"NSFileType"] isEqualToString:@"NSFileTypeRegular"]){ 
+        if([[fileInfo objectForKey:@"NSFileHFSTypeCode"] unsignedLongValue] == 1112690764){ // 1112690764 = 'BRPL'
+            name = [plugin lastPathComponent];
+            executablePath = plugin;
+            err = FSPathMakeRef((UInt8 *)[plugin cString], &fref, NULL);
+            if(err != noErr){
+                KWQDebug("WKPlugin: FSPathMakeRef failed. Error=%d\n", err);
+                return FALSE;
+            }
+            resRef = FSOpenResFile(&fref, fsRdPerm);
+            if(resRef <= noErr){
+                KWQDebug("WKPlugin: FSOpenResFile failed. Can't open resource file: %s, Error=%d\n", [plugin cString], err);
+                return FALSE;
+            }
+            mimeTypes = getMimeTypesForResourceFile(resRef);
+            if(mimeTypes == nil) return FALSE;
+        }else return FALSE;
+    }else if([[fileInfo objectForKey:@"NSFileType"] isEqualToString:@"NSFileTypeDirectory"]){
+        pluginURL = CFURLCreateWithFileSystemPath(NULL, (CFStringRef)plugin, kCFURLPOSIXPathStyle, TRUE);
+        bundle = CFBundleCreate(NULL, pluginURL);
+        bundle2 = [NSBundle bundleWithPath:plugin]; // CFBundleCopyExecutableURL doesn't return full path! Have to use NSBundle
+        CFBundleGetPackageInfo(bundle, &type, NULL);
+        if(type == 1112690764){  // 1112690764 = 'BRPL'
+            name = [plugin lastPathComponent];
+            executablePath = [bundle2 executablePath];
+            resRef = CFBundleOpenBundleResourceMap(bundle);
+            mimeTypes = getMimeTypesForResourceFile(resRef);
+            if(mimeTypes == nil) return FALSE;
+        }else return FALSE;
+        CFRelease(bundle);
+        CFRelease(pluginURL);
+
+    }else{
+        return FALSE;
+    }
+    [mimeTypes retain];
+    [name retain];
+    [executablePath retain];
+    isLoaded = FALSE;
+    return TRUE;
+}
+
+
+- (void)load{    
+    OSErr err;
+    FSSpec spec;
+    FSRef fref;
+    CFragConnectionID connID;  
+    mainFuncPtr pluginMainFunc;
+    
+    if(isLoaded){
+        return;
+    }
+    err = FSPathMakeRef((UInt8 *)[executablePath cString], &fref, NULL);
+    if(err != noErr){
+        KWQDebug("WKPlugin: load: FSPathMakeRef failed. Error=%d\n", err);
+        return;
+    }
+    err = FSGetCatalogInfo(&fref, kFSCatInfoNone, NULL, NULL, &spec, NULL);
+    if(err != noErr){
+        KWQDebug("WKPlugin: load: FSGetCatalogInfo failed. Error=%d\n", err);
+        return;
+    }
+    err = GetDiskFragment(&spec, 0, kCFragGoesToEOF, nil, kPrivateCFragCopy, &connID, (Ptr *)&pluginMainFunc, nil);
+    if(err != noErr){
+        KWQDebug("WKPlugin: load: GetDiskFragment failed. Error=%d\n", err);
+        return;
+    }
+    InitializePlugin(pluginMainFunc);
+    KWQDebug("Plugin Loaded\n");
+    isLoaded = TRUE;
+}
+
+- (void)newInstance:(NPP)instance withType:(NSString *)mimeType withMode:(uint16)mode withArguments:(NSArray *)arguments withValues:(NSArray *)values{
+    NPError npErr;
+    char mime[200];
+
+    [mimeType getCString:mime];
+    npErr = NPP_New(mime, instance, mode, 0, NULL, NULL, NULL);
+    KWQDebug("NPP_New: %d\n", npErr);
+}
+
+- (void)destroyInstance:(NPP)instance{
+    NPError npErr;
+    
+    npErr = NPP_Destroy(instance, NULL);
+    KWQDebug("NPP_Destroy: %d\n", npErr);
+}
+
+- (void)unload{
+    // unload library here
+    NPP_Shutdown();
+}
+- (NSDictionary *)mimeTypes{
+    return mimeTypes;
+}
+
+- (NSString *)name{
+    return name;
+}
+
+- (NSString *)executablePath{
+    return executablePath;
+}
+
+- (BOOL)isLoaded{
+    return isLoaded;
+}
+
+- (NSString *)description{
+    NSMutableString *desc;
+    
+    desc = [NSMutableString stringWithCapacity:100];
+    [desc appendString:@"\n"];
+    [desc appendString:@"name: "];
+    [desc appendString:name];
+    [desc appendString:@"\n"];
+    [desc appendString:@"executablePath: "];
+    [desc appendString:executablePath];
+    [desc appendString:@"\n"];
+    [desc appendString:@"isLoaded: "];
+    if(isLoaded){
+        [desc appendString:@"TRUE\n"];
+    }else{
+        [desc appendString:@"FALSE\n"];
+    }
+    [desc appendString:@"mimeTypes: "];
+    [desc appendString:[mimeTypes description]];
+    [desc appendString:@"\n"];
+    return desc;
+}
+ at end
+
+NPError InitializePlugin(mainFuncPtr pluginMainFunc){
+    NPError npErr;
+    
+    browserFuncs.version = 11;
+    browserFuncs.size = sizeof(NPNetscapeFuncs);
+    browserFuncs.geturl = tVectorForFunctionPointer(NPN_GetURLNotify);
+    browserFuncs.posturl = tVectorForFunctionPointer(NPN_PostURLNotify);
+    browserFuncs.requestread = tVectorForFunctionPointer(NPN_RequestRead);
+    browserFuncs.newstream = tVectorForFunctionPointer(NPN_NewStream);
+    browserFuncs.write = tVectorForFunctionPointer(NPN_Write);
+    browserFuncs.destroystream = tVectorForFunctionPointer(NPN_DestroyStream);
+    browserFuncs.status = tVectorForFunctionPointer(NPN_Status);
+    browserFuncs.uagent = tVectorForFunctionPointer(NPN_UserAgent);
+    browserFuncs.memalloc = tVectorForFunctionPointer(NPN_MemAlloc);
+    browserFuncs.memfree = tVectorForFunctionPointer(NPN_MemFree);
+    browserFuncs.memflush = tVectorForFunctionPointer(NPN_MemFlush);
+    browserFuncs.reloadplugins = tVectorForFunctionPointer(NPN_ReloadPlugins);
+    browserFuncs.geturlnotify = tVectorForFunctionPointer(NPN_GetURLNotify);
+    browserFuncs.posturlnotify = tVectorForFunctionPointer(NPN_PostURLNotify);
+    browserFuncs.getvalue = tVectorForFunctionPointer(NPN_GetValue);
+    browserFuncs.setvalue = tVectorForFunctionPointer(NPN_SetValue);
+    browserFuncs.invalidaterect = tVectorForFunctionPointer(NPN_InvalidateRect);
+    browserFuncs.invalidateregion = tVectorForFunctionPointer(NPN_InvalidateRegion);
+    browserFuncs.forceredraw = tVectorForFunctionPointer(NPN_ForceRedraw);
+    
+    pluginMainFunc = functionPointerForTVector(pluginMainFunc);
+    npErr = pluginMainFunc(&browserFuncs, &pluginFuncs, &NPP_Shutdown);
+    
+    pluginSize = pluginFuncs.size;
+    pluginVersion = pluginFuncs.version;
+    KWQDebug("pluginMainFunc: %d, size=%d, version=%d\n", npErr, pluginSize, pluginVersion);
+    
+    NPP_New = functionPointerForTVector(pluginFuncs.newp);
+    NPP_Destroy = functionPointerForTVector(pluginFuncs.destroy);
+    NPP_SetWindow = functionPointerForTVector(pluginFuncs.setwindow);
+    NPP_NewStream = functionPointerForTVector(pluginFuncs.newstream);
+    NPP_DestroyStream = functionPointerForTVector(pluginFuncs.destroystream);
+    NPP_StreamAsFile = functionPointerForTVector(pluginFuncs.asfile);
+    NPP_WriteReady = functionPointerForTVector(pluginFuncs.writeready);
+    NPP_Write = functionPointerForTVector(pluginFuncs.write);
+    NPP_Print = functionPointerForTVector(pluginFuncs.print);
+    NPP_HandleEvent = functionPointerForTVector(pluginFuncs.event);
+    NPP_URLNotify = functionPointerForTVector(pluginFuncs.urlnotify);
+    NPP_GetValue = functionPointerForTVector(pluginFuncs.getvalue);
+    NPP_SetValue = functionPointerForTVector(pluginFuncs.setvalue);
+    return npErr;
+}
+
+NSMutableDictionary *getMimeTypesForResourceFile(SInt16 resRef){
+    NSMutableDictionary *mimeDict;
+    Str255 theString;
+    char mimeString[200], extString[200];
+    int n;
+    
+    mimeDict = [NSMutableDictionary dictionaryWithCapacity:1];
+    UseResFile(resRef);
+    for(n=1; 1; n+=2){
+        GetIndString(theString, 128, n);
+        CopyPascalStringToC(theString, mimeString);
+        if(!strcmp(mimeString, "")) break;
+        GetIndString(theString, 128, n+1);
+        CopyPascalStringToC(theString, extString);
+        [mimeDict setObject:[NSString stringWithCString:extString] forKey:[NSString stringWithCString:mimeString]];
+    }
+    return mimeDict;
+}
\ No newline at end of file
diff --git a/WebCore/src/kwq/WKPluginDatabase.h b/WebCore/src/kwq/WKPluginDatabase.h
new file mode 100644
index 0000000..e0e163a
--- /dev/null
+++ b/WebCore/src/kwq/WKPluginDatabase.h
@@ -0,0 +1,23 @@
+//
+//  WKPluginsDatabase.h
+//  
+//
+//  Created by Chris Blumenberg on Tue Dec 11 2001.
+//  Copyright (c) 2001 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "WKPlugin.h"
+
+ at interface WKPluginDatabase : NSObject {
+
+    NSArray *plugins;
+}
+
++ (WKPluginDatabase *)installedPlugins;
+- (WKPlugin *)getPluginForMimeType:(NSString *)mimeType;
+
+ at end
+
+NSMutableDictionary *getMimeTypesForResourceFile(SInt16 resRef);
+NSArray *findPlugins(void);
\ No newline at end of file
diff --git a/WebCore/src/kwq/WKPluginDatabase.mm b/WebCore/src/kwq/WKPluginDatabase.mm
new file mode 100644
index 0000000..371fc02
--- /dev/null
+++ b/WebCore/src/kwq/WKPluginDatabase.mm
@@ -0,0 +1,82 @@
+ //
+//  WKPluginsDatabase.m
+//  
+//
+//  Created by Chris Blumenberg on Tue Dec 11 2001.
+//  Copyright (c) 2001 __MyCompanyName__. All rights reserved.
+//
+
+#import "WKPluginDatabase.h"
+#include "kwqdebug.h"
+
+ at implementation WKPluginDatabase
+static WKPluginDatabase *__WKPluginDatabase = nil;
+
+
++ (WKPluginDatabase *)installedPlugins {
+
+    if(!__WKPluginDatabase){
+        __WKPluginDatabase  = [WKPluginDatabase alloc];
+        __WKPluginDatabase->plugins = findPlugins();
+    }
+    return __WKPluginDatabase;
+}
+
+// The first plugin with the specified mime type is returned. We may want to tie this to the defaults so that this is configurable.
+- (WKPlugin *)getPluginForMimeType:(NSString *)mimeType{
+    uint i;
+    WKPlugin *plugin;
+    NSDictionary *temp;
+    
+    for(i=0; i<[plugins count]; i++){      
+        plugin = [plugins objectAtIndex:i];
+        temp = [plugin mimeTypes];
+        if([[temp allKeys] containsObject:mimeType]){
+            return plugin;
+        }
+    }
+    KWQDebug("No plug-in found for mime type: %s\n", [mimeType cString]);
+    return nil;
+}
+
+ at end
+
+NSArray *findPlugins(void){
+    NSFileManager *fileManager;
+    NSArray *libraryPlugins, *homePlugins;
+    NSString *homePluginDir, *libPluginDir;
+    NSMutableArray *pluginPaths, *pluginArray;
+    WKPlugin *plugin;
+    uint i;
+    
+    fileManager = [NSFileManager defaultManager];
+    homePluginDir = [[NSString stringWithString:NSHomeDirectory()] stringByAppendingPathComponent:@"Library/Internet Plug-Ins"];
+    libPluginDir = [NSString stringWithString:@"/Library/Internet Plug-Ins"];
+    
+    homePlugins = [fileManager directoryContentsAtPath:homePluginDir];
+    libraryPlugins = [fileManager directoryContentsAtPath:libPluginDir];
+
+    pluginPaths = [NSMutableArray arrayWithCapacity:[homePlugins count]+[libraryPlugins count]];
+
+    for(i=0; i<[homePlugins count]; i++){
+        [pluginPaths addObject:[homePluginDir stringByAppendingPathComponent:[homePlugins objectAtIndex:i]]];
+    }
+    for(i=0; i<[libraryPlugins count]; i++){
+        if(![homePlugins containsObject:[libraryPlugins objectAtIndex:i]]){ // avoid dups, give precedense to home dir
+            [pluginPaths addObject:[libPluginDir stringByAppendingPathComponent:[libraryPlugins objectAtIndex:i]]];
+        }
+    }
+    pluginArray = [NSMutableArray arrayWithCapacity:[pluginPaths count]];
+    
+    for(i=0; i<[pluginPaths count]; i++){
+        plugin = [WKPlugin alloc];
+        if([plugin initializeWithPath:[pluginPaths objectAtIndex:i]]){
+            [plugin retain];
+            [pluginArray addObject:plugin];
+            KWQDebug("Found plugin: %s\n", [[plugin name] cString]);
+        }
+    }
+    return [pluginArray retain];
+}
+
+
diff --git a/WebCore/src/kwq/WKPluginView.mm b/WebCore/src/kwq/WKPluginView.mm
new file mode 100644
index 0000000..dfc2fec
--- /dev/null
+++ b/WebCore/src/kwq/WKPluginView.mm
@@ -0,0 +1,26 @@
+//
+//  WKPluginView.m
+//  
+//
+//  Created by Chris Blumenberg on Thu Dec 13 2001.
+//  Copyright (c) 2001 __MyCompanyName__. All rights reserved.
+//
+
+#import "WKPluginView.h"
+
+
+ at implementation WKPluginView
+
+- initWithFrame: (NSRect) r widget: (QWidget *)w 
+{
+    [super initWithFrame: r];
+    widget = w;
+    isFlipped = YES;
+    return self;
+}
+
+- (void)drawRect:(NSRect)rect {
+    // Drawing code here.
+}
+
+ at end
diff --git a/WebCore/src/kwq/npapi.c b/WebCore/src/kwq/npapi.c
new file mode 100644
index 0000000..dc07c80
--- /dev/null
+++ b/WebCore/src/kwq/npapi.c
@@ -0,0 +1,128 @@
+#include "npapi.h"
+
+NPError NPN_GetURLNotify(NPP instance, const char* url, const char* target, void* notifyData){
+    printf("NPN_GetURLNotify\n");
+    return NPERR_GENERIC_ERROR;
+
+}
+
+NPError NPN_GetURL(NPP instance, const char* url, const char* target){
+    printf("NPN_GetURL\n");
+    return NPERR_GENERIC_ERROR;
+}
+
+NPError NPN_PostURLNotify(NPP instance, const char* url, const char* target, UInt32 len, const char* buf, NPBool file, void* notifyData){
+    printf("NPN_PostURLNotify\n");
+    return NPERR_GENERIC_ERROR;
+}
+
+NPError NPN_PostURL(NPP instance, const char* url, const char* target, UInt32 len, const char* buf, NPBool file){
+    printf("NPN_PostURL\n");
+    return NPERR_GENERIC_ERROR;
+}
+
+NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList){
+    printf("NPN_RequestRead\n");
+    return NPERR_GENERIC_ERROR;
+}
+
+NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target, NPStream** stream){
+    printf("NPN_NewStream\n");
+    return NPERR_GENERIC_ERROR;
+}
+
+SInt32	NPN_Write(NPP instance, NPStream* stream, SInt32 len, void* buffer){
+    printf("NPN_Write\n");
+    return NPERR_GENERIC_ERROR;
+}
+
+NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason){
+    printf("NPN_DestroyStream\n");
+    return NPERR_GENERIC_ERROR;
+}
+
+void NPN_Status(NPP instance, const char* message){
+    printf("NPN_Status\n");
+}
+
+const char* NPN_UserAgent(NPP instance){
+    printf("NPN_UserAgent\n");
+    return "IE";
+}
+
+void* NPN_MemAlloc(UInt32 size){
+    printf("NPN_MemAlloc\n");
+    return malloc(size);
+
+}
+
+void NPN_MemFree(void* ptr){
+    printf("NPN_MemFree\n");
+    free(ptr);
+
+}
+
+UInt32 NPN_MemFlush(UInt32 size){
+    printf("NPN_MemFlush\n");
+    return 0;
+}
+
+void NPN_ReloadPlugins(NPBool reloadPages){
+    printf("NPN_ReloadPlugins\n");
+
+}
+
+NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value){
+    printf("NPN_GetValue\n");
+    return NPERR_GENERIC_ERROR;
+}
+
+NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value){
+    printf("NPN_SetValue\n");
+    return NPERR_GENERIC_ERROR;
+}	
+
+void NPN_InvalidateRect(NPP instance, NPRect *invalidRect){
+    printf("NPN_InvalidateRect\n");
+
+}
+
+void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion){
+    printf("NPN_InvalidateRegion\n");
+
+}
+
+void NPN_ForceRedraw(NPP instance){
+    printf("NPN_ForceRedraw\n");
+
+}
+
+
+void *functionPointerForTVector(void *tvp) {
+    UInt32 template[6] = {0x3D800000, 0x618C0000, 0x800C0000, 0x804C0004, 0x7C0903A6, 0x4E800420};
+    UInt32 *newGlue = NULL;
+    
+    if (tvp != NULL) {
+        newGlue = malloc(sizeof(template));
+        if (newGlue != NULL) {
+            unsigned i;
+            for (i = 0; i < 6; i++) newGlue[i] = template[i];
+            newGlue[0] |= ((UInt32)tvp >> 16);
+            newGlue[1] |= ((UInt32)tvp & 0xFFFF);
+            MakeDataExecutable(newGlue, sizeof(template));
+        }
+    }
+    return newGlue;
+}
+
+void *tVectorForFunctionPointer(void *fp) {
+    void **newGlue = NULL;
+    if (fp != NULL) {
+        newGlue = malloc(2 * sizeof(void *));
+        if (newGlue != NULL) {
+            newGlue[0] = fp;
+            newGlue[1] = NULL;
+        }
+    }
+    return newGlue;
+}
\ No newline at end of file
diff --git a/WebCore/src/kwq/npapi.h b/WebCore/src/kwq/npapi.h
new file mode 100644
index 0000000..493a08a
--- /dev/null
+++ b/WebCore/src/kwq/npapi.h
@@ -0,0 +1,366 @@
+/*
+ *  npapi.h
+ *  test
+ *
+ *  Created by chris on Tue Nov 20 2001.
+ *  Copyright (c) 2001 __MyCompanyName__. All rights reserved.
+ *
+ */
+ 
+#ifndef _NPAPI_H_
+#define _NPAPI_H_
+
+#include <CoreServices/CoreServices.h>
+#include <Foundation/Foundation.h>
+/*
+ * 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
+
+/*----------------------------------------------------------------------*/
+/*		     Definition of Basic Types				*/
+/*----------------------------------------------------------------------*/
+
+#ifndef _uint16
+typedef unsigned short uint16;
+#endif
+#ifndef _uint32
+#if defined(__alpha)
+typedef unsigned int uint32;
+#else /* __alpha */
+typedef unsigned long uint32;
+#endif /* __alpha */
+#endif
+#ifndef _INT16
+typedef short int16;
+#endif
+#ifndef _INT32
+#if defined(__alpha)
+typedef int int32;
+#else /* __alpha */
+typedef long int32;
+#endif /* __alpha */
+#endif
+
+typedef int16 NPError;
+typedef unsigned char NPBool;
+typedef int16 NPReason;
+typedef char* NPMIMEType;
+
+
+/*
+ *  NPP is a plug-in's opaque instance handle
+ */
+typedef struct _NPP
+{
+    void*	pdata;			/* plug-in private data */
+    void*	ndata;			/* netscape private data */
+} NPP_t;
+
+typedef NPP_t*	NPP;
+
+typedef struct _NPStream
+{
+    void*		pdata;		/* plug-in private data */
+    void*		ndata;		/* netscape private data */
+    const char* 	url;
+    uint32		end;
+    uint32		lastmodified;
+    void*		notifyData;
+} NPStream;
+
+
+typedef struct _NPByteRange
+{
+    int32	offset; 		/* negative offset means from the end */
+    uint32	length;
+    struct _NPByteRange* next;
+} NPByteRange;
+
+
+typedef struct _NPSavedData
+{
+    int32	len;
+    void*	buf;
+} NPSavedData;
+
+
+typedef struct _NPRect
+{
+    uint16	top;
+    uint16	left;
+    uint16	bottom;
+    uint16	right;
+} NPRect;
+
+typedef RgnHandle NPRegion;
+
+typedef struct NP_Port
+{
+    CGrafPtr	port;		/* Grafport */
+    int32		portx;		/* position inside the topmost window */
+    int32		porty;
+} NP_Port;
+
+/*
+ * List of variable names for which NPP_GetValue shall be implemented
+ */
+typedef enum {
+	NPPVpluginNameString = 1,
+	NPPVpluginDescriptionString,
+	NPPVpluginWindowBool,
+	NPPVpluginTransparentBool
+} NPPVariable;
+
+/*
+ * List of variable names for which NPN_GetValue is implemented by Mozilla
+ */
+typedef enum {
+	NPNVxDisplay = 1,
+	NPNVxtAppContext,
+    NPNVnetscapeWindow,
+	NPNVjavascriptEnabledBool,
+	NPNVasdEnabledBool,
+	NPNVisOfflineBool
+} NPNVariable;
+
+typedef enum {
+    NPWindowTypeWindow = 1,
+    NPWindowTypeDrawable
+} NPWindowType;
+
+typedef struct _NPWindow
+{
+    void*	window; 	/* Platform specific window handle */
+    int32	x;			/* Position of top left corner relative */
+    int32	y;			/*	to a netscape page.					*/
+    uint32	width;		/* Maximum window size */
+    uint32	height;
+    NPRect	clipRect;	/* Clipping rectangle in port coordinates */
+						/* Used by MAC only.			  */
+    NPWindowType type;	/* Is this a window or a drawable? */
+} NPWindow;
+
+typedef struct _NPFullPrint
+{
+    NPBool	pluginPrinted;	/* Set TRUE if plugin handled fullscreen */
+							/*	printing							 */
+    NPBool	printOne;		/* TRUE if plugin should print one copy  */
+							/*	to default printer					 */
+    void*	platformPrint;	/* Platform-specific printing info */
+} NPFullPrint;
+
+typedef struct _NPEmbedPrint
+{
+    NPWindow	window;
+    void*	platformPrint;	/* Platform-specific printing info */
+} NPEmbedPrint;
+
+typedef struct _NPPrint
+{
+    uint16	mode;						/* NP_FULL or NP_EMBED */
+    union
+    {
+		NPFullPrint		fullPrint;		/* if mode is NP_FULL */
+		NPEmbedPrint	embedPrint;		/* if mode is NP_EMBED */
+    } print;
+} NPPrint;
+
+
+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 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_alue);
+typedef NPError	(*NPN_SetValueProcPtr)(NPP instance, NPPVariable variable, void *ret_alue);
+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 ProcPtr NPN_GetJavaEnvProcPtr;
+typedef ProcPtr NPN_GetJavaPeerProcPtr;
+
+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 int16 (*NPP_WriteReadyProcPtr)(NPP instance, NPStream* stream);
+typedef int16 (*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_alue);
+typedef NPError	(*NPP_SetValueProcPtr)(NPP instance, NPNVariable variable, void *ret_alue);
+typedef void (*NPP_ShutdownProcPtr)(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_DestroyStreamProcPtr 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			*/
+/*----------------------------------------------------------------------*/
+
+/*
+ *	Values of type NPError:
+ */
+#define NPERR_BASE							0
+#define NPERR_NO_ERROR						(NPERR_BASE + 0)
+#define NPERR_GENERIC_ERROR					(NPERR_BASE + 1)
+#define NPERR_INVALID_INSTANCE_ERROR		(NPERR_BASE + 2)
+#define NPERR_INVALID_FUNCTABLE_ERROR		(NPERR_BASE + 3)
+#define NPERR_MODULE_LOAD_FAILED_ERROR		(NPERR_BASE + 4)
+#define NPERR_OUT_OF_MEMORY_ERROR			(NPERR_BASE + 5)
+#define NPERR_INVALID_PLUGIN_ERROR			(NPERR_BASE + 6)
+#define NPERR_INVALID_PLUGIN_DIR_ERROR		(NPERR_BASE + 7)
+#define NPERR_INCOMPATIBLE_VERSION_ERROR	(NPERR_BASE + 8)
+#define NPERR_INVALID_PARAM				(NPERR_BASE + 9)
+#define NPERR_INVALID_URL					(NPERR_BASE + 10)
+#define NPERR_FILE_NOT_FOUND				(NPERR_BASE + 11)
+#define NPERR_NO_DATA						(NPERR_BASE + 12)
+#define NPERR_STREAM_NOT_SEEKABLE			(NPERR_BASE + 13)
+
+/*
+ *	Values of type NPReason:
+ */
+#define NPRES_BASE				0
+#define NPRES_DONE					(NPRES_BASE + 0)
+#define NPRES_NETWORK_ERR			(NPRES_BASE + 1)
+#define NPRES_USER_BREAK			(NPRES_BASE + 2)
+
+/*
+ *      Don't use these obsolete error codes any more.
+ */
+#define NP_NOERR  NP_NOERR_is_obsolete_use_NPERR_NO_ERROR
+#define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR
+#define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK
+
+/*
+ * Version feature information
+ */
+#define NPVERS_HAS_STREAMOUTPUT 	8
+#define NPVERS_HAS_NOTIFICATION 	9
+#define NPVERS_HAS_LIVECONNECT		9
+#define NPVERS_WIN16_HAS_LIVECONNECT	9
+#define NPVERS_68K_HAS_LIVECONNECT	11
+#define NPVERS_HAS_WINDOWLESS       11
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+typedef NPError (* mainFuncPtr)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownProcPtr*);
+
+void *functionPointerForTVector(void *);
+void *tVectorForFunctionPointer(void *);
+
+/*
+ * 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);
+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);
+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);
+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"
+#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);
+*/
+#endif /* _NPAPI_H_ */
\ No newline at end of file

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list