From 544599af515868bbd57995261d3c3bdfe5bede58 Mon Sep 17 00:00:00 2001 From: "idk%eng.sun.com" Date: Fri, 6 Jul 2001 06:45:11 +0000 Subject: [PATCH] *not part of the build* scriptable wrappers for plugin API a=sep@sparc.spb.su git-svn-id: svn://10.0.0.236/trunk@98793 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/java/plugins/wrappers/cpp/Makefile | 59 ++++++++ mozilla/java/plugins/wrappers/cpp/Makefile.in | 59 ++++++++ .../wrappers/cpp/nsXPIDLInputStream.cpp | 63 +++++++++ .../plugins/wrappers/cpp/nsXPIDLInputStream.h | 42 ++++++ .../wrappers/cpp/nsXPIDLOutputStream.cpp | 62 ++++++++ .../wrappers/cpp/nsXPIDLOutputStream.h | 42 ++++++ .../plugins/wrappers/cpp/nsXPIDLPlugin.cpp | 64 +++++++++ .../java/plugins/wrappers/cpp/nsXPIDLPlugin.h | 51 +++++++ .../wrappers/cpp/nsXPIDLPluginInstance.cpp | 77 ++++++++++ .../wrappers/cpp/nsXPIDLPluginInstance.h | 54 +++++++ .../cpp/nsXPIDLPluginInstancePeer.cpp | 105 ++++++++++++++ .../wrappers/cpp/nsXPIDLPluginInstancePeer.h | 42 ++++++ .../wrappers/cpp/nsXPIDLPluginManager.cpp | 106 ++++++++++++++ .../wrappers/cpp/nsXPIDLPluginManager.h | 42 ++++++ .../wrappers/cpp/nsXPIDLPluginManager2.cpp | 127 +++++++++++++++++ .../wrappers/cpp/nsXPIDLPluginManager2.h | 45 ++++++ .../wrappers/cpp/nsXPIDLPluginStreamInfo.cpp | 96 +++++++++++++ .../wrappers/cpp/nsXPIDLPluginStreamInfo.h | 42 ++++++ .../cpp/nsXPIDLPluginStreamListener.cpp | 82 +++++++++++ .../cpp/nsXPIDLPluginStreamListener.h | 57 ++++++++ .../wrappers/cpp/nsXPIDLPluginTagInfo.cpp | 56 ++++++++ .../wrappers/cpp/nsXPIDLPluginTagInfo.h | 42 ++++++ .../wrappers/cpp/nsXPIDLPluginTagInfo2.cpp | 133 ++++++++++++++++++ .../wrappers/cpp/nsXPIDLPluginTagInfo2.h | 45 ++++++ mozilla/java/plugins/wrappers/java/Makefile | 96 +++++++++++++ .../java/plugins/wrappers/java/Makefile.in | 96 +++++++++++++ .../wrappers/java/nsXPIDLInputStream.java | 56 ++++++++ .../wrappers/java/nsXPIDLOutputStream.java | 53 +++++++ .../plugins/wrappers/java/nsXPIDLPlugin.java | 68 +++++++++ .../wrappers/java/nsXPIDLPluginInstance.java | 67 +++++++++ .../java/nsXPIDLPluginInstancePeer.java | 62 ++++++++ .../wrappers/java/nsXPIDLPluginManager.java | 91 ++++++++++++ .../wrappers/java/nsXPIDLPluginManager2.java | 54 +++++++ .../java/nsXPIDLPluginStreamInfo.java | 57 ++++++++ .../java/nsXPIDLPluginStreamListener.java | 74 ++++++++++ .../wrappers/java/nsXPIDLPluginTagInfo.java | 55 ++++++++ .../wrappers/java/nsXPIDLPluginTagInfo2.java | 99 +++++++++++++ mozilla/java/plugins/wrappers/public/Makefile | 54 +++++++ .../java/plugins/wrappers/public/Makefile.in | 54 +++++++ .../wrappers/public/nsIXPIDLInputStream.idl | 34 +++++ .../wrappers/public/nsIXPIDLOutputStream.idl | 34 +++++ .../wrappers/public/nsIXPIDLPlugin.idl | 36 +++++ .../public/nsIXPIDLPluginInstance.idl | 40 ++++++ .../public/nsIXPIDLPluginInstancePeer.idl | 41 ++++++ .../wrappers/public/nsIXPIDLPluginManager.idl | 53 +++++++ .../public/nsIXPIDLPluginManager2.idl | 34 +++++ .../public/nsIXPIDLPluginStreamInfo.idl | 38 +++++ .../public/nsIXPIDLPluginStreamListener.idl | 48 +++++++ .../wrappers/public/nsIXPIDLPluginTagInfo.idl | 34 +++++ .../public/nsIXPIDLPluginTagInfo2.idl | 44 ++++++ 50 files changed, 3065 insertions(+) create mode 100644 mozilla/java/plugins/wrappers/cpp/Makefile create mode 100644 mozilla/java/plugins/wrappers/cpp/Makefile.in create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLInputStream.cpp create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLInputStream.h create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLOutputStream.cpp create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLOutputStream.h create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLPlugin.cpp create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLPlugin.h create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginInstance.cpp create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginInstance.h create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginInstancePeer.cpp create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginInstancePeer.h create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginManager.cpp create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginManager.h create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginManager2.cpp create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginManager2.h create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginStreamInfo.cpp create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginStreamInfo.h create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginStreamListener.cpp create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginStreamListener.h create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginTagInfo.cpp create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginTagInfo.h create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginTagInfo2.cpp create mode 100644 mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginTagInfo2.h create mode 100644 mozilla/java/plugins/wrappers/java/Makefile create mode 100644 mozilla/java/plugins/wrappers/java/Makefile.in create mode 100644 mozilla/java/plugins/wrappers/java/nsXPIDLInputStream.java create mode 100644 mozilla/java/plugins/wrappers/java/nsXPIDLOutputStream.java create mode 100644 mozilla/java/plugins/wrappers/java/nsXPIDLPlugin.java create mode 100644 mozilla/java/plugins/wrappers/java/nsXPIDLPluginInstance.java create mode 100644 mozilla/java/plugins/wrappers/java/nsXPIDLPluginInstancePeer.java create mode 100644 mozilla/java/plugins/wrappers/java/nsXPIDLPluginManager.java create mode 100644 mozilla/java/plugins/wrappers/java/nsXPIDLPluginManager2.java create mode 100644 mozilla/java/plugins/wrappers/java/nsXPIDLPluginStreamInfo.java create mode 100644 mozilla/java/plugins/wrappers/java/nsXPIDLPluginStreamListener.java create mode 100644 mozilla/java/plugins/wrappers/java/nsXPIDLPluginTagInfo.java create mode 100644 mozilla/java/plugins/wrappers/java/nsXPIDLPluginTagInfo2.java create mode 100644 mozilla/java/plugins/wrappers/public/Makefile create mode 100644 mozilla/java/plugins/wrappers/public/Makefile.in create mode 100644 mozilla/java/plugins/wrappers/public/nsIXPIDLInputStream.idl create mode 100644 mozilla/java/plugins/wrappers/public/nsIXPIDLOutputStream.idl create mode 100644 mozilla/java/plugins/wrappers/public/nsIXPIDLPlugin.idl create mode 100644 mozilla/java/plugins/wrappers/public/nsIXPIDLPluginInstance.idl create mode 100644 mozilla/java/plugins/wrappers/public/nsIXPIDLPluginInstancePeer.idl create mode 100644 mozilla/java/plugins/wrappers/public/nsIXPIDLPluginManager.idl create mode 100644 mozilla/java/plugins/wrappers/public/nsIXPIDLPluginManager2.idl create mode 100644 mozilla/java/plugins/wrappers/public/nsIXPIDLPluginStreamInfo.idl create mode 100644 mozilla/java/plugins/wrappers/public/nsIXPIDLPluginStreamListener.idl create mode 100644 mozilla/java/plugins/wrappers/public/nsIXPIDLPluginTagInfo.idl create mode 100644 mozilla/java/plugins/wrappers/public/nsIXPIDLPluginTagInfo2.idl diff --git a/mozilla/java/plugins/wrappers/cpp/Makefile b/mozilla/java/plugins/wrappers/cpp/Makefile new file mode 100644 index 00000000000..3556fb163e1 --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/Makefile @@ -0,0 +1,59 @@ +#!gmake +# +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/NPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# Serge Pikalev +# + +DEPTH = ../../../.. +topsrcdir = ../../../.. +srcdir = . +VPATH = . + + + +include $(DEPTH)/config/autoconf.mk +include $(topsrcdir)/config/config.mk + +CPPSRCS = \ + nsXPIDLPlugin.cpp \ + nsXPIDLPluginInstance.cpp \ + nsXPIDLPluginStreamListener.cpp \ + nsXPIDLPluginManager.cpp \ + nsXPIDLPluginManager2.cpp \ + nsXPIDLPluginInstancePeer.cpp \ + nsXPIDLPluginTagInfo.cpp \ + nsXPIDLPluginTagInfo2.cpp \ + nsXPIDLPluginStreamInfo.cpp \ + nsXPIDLInputStream.cpp \ + nsXPIDLOutputStream.cpp \ + $(NULL) + +DSO_LDOPTS += \ + $(XPCOM_LIBS) \ + $(NSPR_LIBS) \ + $(NULL) + + + +include $(topsrcdir)/config/rules.mk + +TARGETS = $(OBJS) + +export:: $(TARGETS) diff --git a/mozilla/java/plugins/wrappers/cpp/Makefile.in b/mozilla/java/plugins/wrappers/cpp/Makefile.in new file mode 100644 index 00000000000..6e63310a89d --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/Makefile.in @@ -0,0 +1,59 @@ +#!gmake +# +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/NPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# Serge Pikalev +# + +DEPTH = ../../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + + + +include $(DEPTH)/config/autoconf.mk +include $(topsrcdir)/config/config.mk + +CPPSRCS = \ + nsXPIDLPlugin.cpp \ + nsXPIDLPluginInstance.cpp \ + nsXPIDLPluginStreamListener.cpp \ + nsXPIDLPluginManager.cpp \ + nsXPIDLPluginManager2.cpp \ + nsXPIDLPluginInstancePeer.cpp \ + nsXPIDLPluginTagInfo.cpp \ + nsXPIDLPluginTagInfo2.cpp \ + nsXPIDLPluginStreamInfo.cpp \ + nsXPIDLInputStream.cpp \ + nsXPIDLOutputStream.cpp \ + $(NULL) + +DSO_LDOPTS += \ + $(XPCOM_LIBS) \ + $(NSPR_LIBS) \ + $(NULL) + + + +include $(topsrcdir)/config/rules.mk + +TARGETS = $(OBJS) + +export:: $(TARGETS) diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLInputStream.cpp b/mozilla/java/plugins/wrappers/cpp/nsXPIDLInputStream.cpp new file mode 100644 index 00000000000..d6d4c78118f --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLInputStream.cpp @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsXPIDLInputStream.h" +#include "nsIInputStream.h" + +NS_IMPL_ISUPPORTS1(nsXPIDLInputStream, nsIXPIDLInputStream) + +nsXPIDLInputStream::nsXPIDLInputStream() +{ + NS_INIT_ISUPPORTS(); +} + +nsXPIDLInputStream::nsXPIDLInputStream( nsIInputStream *inputStream ) +{ + NS_INIT_ISUPPORTS(); + this->inputStream = inputStream; + NS_ADDREF( inputStream ); +} + +nsXPIDLInputStream::~nsXPIDLInputStream() +{ + NS_RELEASE( inputStream ); +} + +NS_IMETHODIMP +nsXPIDLInputStream::Close() +{ + return inputStream->Close(); +} + +NS_IMETHODIMP +nsXPIDLInputStream::Available( PRUint32 *_retval ) +{ + return inputStream->Available( _retval ); +} + +NS_IMETHODIMP +nsXPIDLInputStream::Read( PRUint32 count, + PRUint8 *buf, + PRUint32 *_retval ) +{ + return inputStream->Read( (char *)buf, count, _retval ); +} diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLInputStream.h b/mozilla/java/plugins/wrappers/cpp/nsXPIDLInputStream.h new file mode 100644 index 00000000000..720cc49723b --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLInputStream.h @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#ifndef _nsXPIDLInputStream_included_ +#define _nsXPIDLInputStream_included_ + +#include "nsIXPIDLInputStream.h" +#include "nsIInputStream.h" + +class nsXPIDLInputStream : public nsIXPIDLInputStream +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIXPIDLINPUTSTREAM + + nsXPIDLInputStream(); + nsXPIDLInputStream( nsIInputStream *inputStream ); + virtual ~nsXPIDLInputStream(); + + nsIInputStream *inputStream; +}; + +#endif // _nsXPIDLInputStream_included_ diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLOutputStream.cpp b/mozilla/java/plugins/wrappers/cpp/nsXPIDLOutputStream.cpp new file mode 100644 index 00000000000..82c8c16ece9 --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLOutputStream.cpp @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsXPIDLOutputStream.h" + +NS_IMPL_ISUPPORTS1(nsXPIDLOutputStream, nsIXPIDLOutputStream) + +nsXPIDLOutputStream::nsXPIDLOutputStream() +{ + NS_INIT_ISUPPORTS(); +} + +nsXPIDLOutputStream::nsXPIDLOutputStream( nsIOutputStream *outputStream ) +{ + NS_INIT_ISUPPORTS(); + this->outputStream = outputStream; + NS_ADDREF( outputStream ); +} + +nsXPIDLOutputStream::~nsXPIDLOutputStream() +{ + NS_RELEASE( outputStream ); +} + +NS_IMETHODIMP +nsXPIDLOutputStream::Close() +{ + return outputStream->Close(); +} + +NS_IMETHODIMP +nsXPIDLOutputStream::Flush() +{ + return outputStream->Flush(); +} + +NS_IMETHODIMP +nsXPIDLOutputStream::Write( PRUint32 count, + PRUint8 *buf, + PRUint32 *_retval ) +{ + return outputStream->Write( (char *)buf, count, _retval ); +} diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLOutputStream.h b/mozilla/java/plugins/wrappers/cpp/nsXPIDLOutputStream.h new file mode 100644 index 00000000000..9ae8960071c --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLOutputStream.h @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#ifndef _nsXPIDLOutputStream_included_ +#define _nsXPIDLOutputStream_included_ + +#include "nsIXPIDLOutputStream.h" +#include "nsIOutputStream.h" + +class nsXPIDLOutputStream : public nsIXPIDLOutputStream +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIXPIDLOUTPUTSTREAM + + nsXPIDLOutputStream(); + nsXPIDLOutputStream( nsIOutputStream *outputStream ); + virtual ~nsXPIDLOutputStream(); + + nsIOutputStream *outputStream; +}; + +#endif // _nsXPIDLOutputStream_included_ diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLPlugin.cpp b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPlugin.cpp new file mode 100644 index 00000000000..861bceab758 --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPlugin.cpp @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsIPlugin.h" +#include "nsXPIDLPlugin.h" + +NS_IMPL_ISUPPORTS1(nsXPIDLPlugin, nsIPlugin) + +nsXPIDLPlugin::nsXPIDLPlugin() +{ + NS_INIT_ISUPPORTS(); +} + +nsXPIDLPlugin::nsXPIDLPlugin( nsIXPIDLPlugin *plugin ) +{ + NS_INIT_ISUPPORTS(); + this->plugin = plugin; + NS_ADDREF( plugin ); +} + +nsXPIDLPlugin::~nsXPIDLPlugin() +{ + NS_RELEASE( plugin ); +} + +NS_IMETHODIMP +nsXPIDLPlugin::CreatePluginInstance( nsISupports *aOuter, + REFNSIID aIID, + const char* aPluginMIMEType, + void **aResult ) +{ + return plugin->CreatePluginInstance( aOuter, aIID, aPluginMIMEType, aResult ); +} + +NS_IMETHODIMP +nsXPIDLPlugin::Initialize() +{ + return plugin->Initialize(); +} + +NS_IMETHODIMP +nsXPIDLPlugin::Shutdown() +{ + return plugin->Shutdown(); +} diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLPlugin.h b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPlugin.h new file mode 100644 index 00000000000..729c6021646 --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPlugin.h @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#ifndef _nsXPIDLPlugin_included_ +#define _nsXPIDLPlugin_included_ + +#include "nsIPlugin.h" + +#include "nsIXPIDLPlugin.h" + +class nsXPIDLPlugin : public nsIPlugin +{ +public: + NS_DECL_ISUPPORTS +// NS_DECL_NSIXPIDLPLUGIN + + nsXPIDLPlugin(); + nsXPIDLPlugin( nsIXPIDLPlugin *plugin ); + virtual ~nsXPIDLPlugin(); + + nsIXPIDLPlugin *plugin; + + // from nsIPlugin + NS_IMETHODIMP CreatePluginInstance( nsISupports *aOuter, + REFNSIID aIID, + const char* aPluginMIMEType, + void **aResult ); + NS_IMETHODIMP Initialize(); + NS_IMETHODIMP Shutdown(); +}; + +#endif // _nsIXPIDLPlugin_included_ diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginInstance.cpp b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginInstance.cpp new file mode 100644 index 00000000000..42295adbddb --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginInstance.cpp @@ -0,0 +1,77 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsIPluginInstance.h" +#include "nsXPIDLPluginInstance.h" + +NS_IMPL_ISUPPORTS1(nsXPIDLPluginInstance, nsIPluginInstance) + +nsXPIDLPluginInstance::nsXPIDLPluginInstance() +{ + NS_INIT_ISUPPORTS(); +} + +nsXPIDLPluginInstance::nsXPIDLPluginInstance( nsIXPIDLPluginInstance *pluginInstance ) +{ + NS_INIT_ISUPPORTS(); + this->pluginInstance = pluginInstance; + NS_ADDREF( pluginInstance ); +} + +nsXPIDLPluginInstance::~nsXPIDLPluginInstance() +{ + NS_RELEASE( pluginInstance ); +} + +NS_IMETHODIMP +nsXPIDLPluginInstance::Destroy() +{ + return pluginInstance->Destroy(); +} + +NS_IMETHODIMP +nsXPIDLPluginInstance::Initialize( nsIPluginInstancePeer *peer ) +{ + nsIXPIDLPluginInstancePeer *instPeer = new nsXPIDLPluginInstancePeer( peer ); + return pluginInstance->Initialize( instPeer ); +} + +NS_IMETHODIMP +nsXPIDLPluginInstance::NewStream( nsIPluginStreamListener **_retval ) +{ + nsIXPIDLPluginStreamListener **sListener; + nsresult res = pluginInstance->NewStream( sListener ); + *_retval = new nsXPIDLPluginStreamListener( *sListener ); + return res; +} + +NS_IMETHODIMP +nsXPIDLPluginInstance::Start() +{ + return pluginInstance->Start(); +} + +NS_IMETHODIMP +nsXPIDLPluginInstance::Stop() +{ + return pluginInstance->Stop(); +} diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginInstance.h b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginInstance.h new file mode 100644 index 00000000000..19ffccf7e89 --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginInstance.h @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#ifndef _nsXPIDLPluginInstance_included_ +#define _nsXPIDLPluginInstance_included_ + +#include "nsIPluginInstance.h" + +#include "nsIXPIDLPluginInstance.h" +#include "nsIPluginInstancePeer.h" +#include "nsXPIDLPluginInstancePeer.h" +#include "nsIPluginStreamListener.h" +#include "nsXPIDLPluginStreamListener.h" + +class nsXPIDLPluginInstance : public nsIPluginInstance +{ +public: + NS_DECL_ISUPPORTS +// NS_DECL_NSIXPIDLPLUGININSTANCE + + nsXPIDLPluginInstance(); + nsXPIDLPluginInstance( nsIXPIDLPluginInstance *pluginInstance ); + virtual ~nsXPIDLPluginInstance(); + + nsIXPIDLPluginInstance *pluginInstance; + + // from nsIPluginInstance + NS_IMETHODIMP Destroy(); + NS_IMETHODIMP Initialize( nsIPluginInstancePeer *peer ); + NS_IMETHODIMP NewStream( nsIPluginStreamListener **_retval ); + NS_IMETHODIMP Start(); + NS_IMETHODIMP Stop(); +}; + +#endif // _nsXPIDLPluginInstance_included_ diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginInstancePeer.cpp b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginInstancePeer.cpp new file mode 100644 index 00000000000..519565439da --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginInstancePeer.cpp @@ -0,0 +1,105 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsIPluginInstancePeer.h" +#include "nsXPIDLPluginInstancePeer.h" + +#include "nsIOutputStream.h" +#include "nsXPIDLOutputStream.h" +#include "nsIPluginTagInfo2.h" +#include "nsXPIDLPluginTagInfo2.h" + +NS_IMPL_ISUPPORTS1(nsXPIDLPluginInstancePeer, nsIXPIDLPluginInstancePeer) + +nsXPIDLPluginInstancePeer::nsXPIDLPluginInstancePeer() +{ + NS_INIT_ISUPPORTS(); +} + +nsXPIDLPluginInstancePeer::nsXPIDLPluginInstancePeer( nsIPluginInstancePeer *pluginInstancePeer ) +{ + NS_INIT_ISUPPORTS(); + this->pluginInstancePeer = pluginInstancePeer; + NS_ADDREF( pluginInstancePeer ); +} + +nsXPIDLPluginInstancePeer::~nsXPIDLPluginInstancePeer() +{ + NS_RELEASE( pluginInstancePeer ); +} + +NS_IMETHODIMP +nsXPIDLPluginInstancePeer::GetMIMEType( char * *aMIMEType ) +{ + nsMIMEType *mimeType = (nsMIMEType *)aMIMEType; + return pluginInstancePeer->GetMIMEType( mimeType ); +} + +NS_IMETHODIMP +nsXPIDLPluginInstancePeer::GetMode( PRUint32 *aMode ) +{ + nsPluginMode *mode = (nsPluginMode *)aMode; + return pluginInstancePeer->GetMode( mode ); +} + +NS_IMETHODIMP +nsXPIDLPluginInstancePeer::GetTagInfo( nsIXPIDLPluginTagInfo2 * *aTagInfo ) +{ + nsIPluginTagInfo2 *tagInfo; + nsresult res = pluginInstancePeer->QueryInterface( NS_GET_IID(nsIPluginTagInfo2), (void **)&tagInfo ); + if( NS_FAILED(res) ) { + *aTagInfo = NULL; + return res; + } + *aTagInfo = new nsXPIDLPluginTagInfo2( tagInfo ); + return res; +} + +NS_IMETHODIMP +nsXPIDLPluginInstancePeer::GetValue( PRInt32 variable, char **_retval ) +{ + nsPluginInstancePeerVariable var = (nsPluginInstancePeerVariable)variable; + return pluginInstancePeer->GetValue( var, (void *)*_retval ); +} + +NS_IMETHODIMP +nsXPIDLPluginInstancePeer::NewStream( const char *type, + const char *target, + nsIXPIDLOutputStream **_retval ) +{ + nsIOutputStream **oStream; + nsresult nsRes = pluginInstancePeer->NewStream( type, target, oStream ); + *_retval = new nsXPIDLOutputStream( *oStream ); + return nsRes; +} + +NS_IMETHODIMP +nsXPIDLPluginInstancePeer::SetWindowSize( PRUint32 width, PRUint32 height ) +{ + return pluginInstancePeer->SetWindowSize( width, height ); +} + +NS_IMETHODIMP +nsXPIDLPluginInstancePeer::ShowStatus( const char *message ) +{ + return pluginInstancePeer->ShowStatus( message ); +} diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginInstancePeer.h b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginInstancePeer.h new file mode 100644 index 00000000000..e1a85df4100 --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginInstancePeer.h @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#ifndef _nsXPIDLPluginInstancePeer_included_ +#define _nsXPIDLPluginInstancePeer_included_ + +#include "nsIXPIDLPluginInstancePeer.h" +#include "nsIPluginInstancePeer.h" + +class nsXPIDLPluginInstancePeer : public nsIXPIDLPluginInstancePeer +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIXPIDLPLUGININSTANCEPEER + + nsXPIDLPluginInstancePeer(); + nsXPIDLPluginInstancePeer( nsIPluginInstancePeer *pluginInstancePeer ); + virtual ~nsXPIDLPluginInstancePeer(); + + nsIPluginInstancePeer *pluginInstancePeer; +}; + +#endif // _nsXPIDLPluginInstancePeer_included_ diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginManager.cpp b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginManager.cpp new file mode 100644 index 00000000000..50fa24761f9 --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginManager.cpp @@ -0,0 +1,106 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsIPluginManager.h" +#include "nsXPIDLPluginManager.h" +#include "nsXPIDLPluginManager2.h" + +#include "nsXPIDLPluginStreamListener.h" + +NS_IMPL_ISUPPORTS1(nsXPIDLPluginManager, nsIXPIDLPluginManager) + +nsXPIDLPluginManager::nsXPIDLPluginManager() +{ + NS_INIT_ISUPPORTS(); +} + +nsXPIDLPluginManager::nsXPIDLPluginManager( nsIPluginManager *pluginManager ) +{ + NS_INIT_ISUPPORTS(); + this->pluginManager = pluginManager; + NS_ADDREF( pluginManager ); +} + +nsXPIDLPluginManager::~nsXPIDLPluginManager() +{ + NS_RELEASE( pluginManager ); +} + +NS_IMETHODIMP +nsXPIDLPluginManager::GetURL( nsISupports *pliginInstance, + const char *url, + const char *target, + nsIXPIDLPluginStreamListener *streamListener, + const char *altHost, + const char *referrer, + PRBool forceJSEnabled ) +{ + nsIPluginStreamListener *sListener = new nsXPIDLPluginStreamListener( streamListener ); + return pluginManager->GetURL( pliginInstance, + (char *)url, + (char *)target, + sListener, + (char *)altHost, + (char *)referrer, + forceJSEnabled ); +} + +NS_IMETHODIMP +nsXPIDLPluginManager::PostURL( nsISupports *pliginInstance, + const char *url, + PRUint32 postDataLength, + PRUint8 *postData, + PRUint32 postHeadersLength, + const char *postHeaders, + PRBool isFile, + const char *target, + nsIXPIDLPluginStreamListener *streamListener, + const char *altHost, + const char *referrer, + PRBool forceJSEnabled ) +{ + nsIPluginStreamListener *sListener = new nsXPIDLPluginStreamListener( streamListener ); + return pluginManager->PostURL( pliginInstance, + (char *)url, + postDataLength, + (char *)postData, + isFile, + (char *)target, + sListener, + (char *)altHost, + (char *)referrer, + forceJSEnabled, + postHeadersLength, + postHeaders ); +} + +NS_IMETHODIMP +nsXPIDLPluginManager::ReloadPlugins( PRBool reloadPages ) +{ + return pluginManager->ReloadPlugins( reloadPages ); +} + +NS_IMETHODIMP +nsXPIDLPluginManager::UserAgent( char **_retval ) +{ + return pluginManager->UserAgent( (const char **)_retval ); +} diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginManager.h b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginManager.h new file mode 100644 index 00000000000..ccd05d8ef89 --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginManager.h @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#ifndef _nsXPIDLPluginManager_included_ +#define _nsXPIDLPluginManager_included_ + +#include "nsIXPIDLPluginManager.h" +#include "nsIPluginManager.h" + +class nsXPIDLPluginManager : public nsIXPIDLPluginManager +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIXPIDLPLUGINMANAGER + + nsXPIDLPluginManager(); + nsXPIDLPluginManager( nsIPluginManager *pluginManager ); + virtual ~nsXPIDLPluginManager(); + + nsIPluginManager *pluginManager; +}; + +#endif // _nsXPIDLPluginManager_included_ diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginManager2.cpp b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginManager2.cpp new file mode 100644 index 00000000000..9a06a7a6d28 --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginManager2.cpp @@ -0,0 +1,127 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsXPIDLPluginManager2.h" + +NS_IMPL_ISUPPORTS1(nsXPIDLPluginManager2, nsIXPIDLPluginManager2) + +nsXPIDLPluginManager2::nsXPIDLPluginManager2() +{ + NS_INIT_ISUPPORTS(); +} + +nsXPIDLPluginManager2::nsXPIDLPluginManager2( nsIPluginManager2 *pluginManager ) +{ + NS_INIT_ISUPPORTS(); + this->pluginManager = pluginManager; + NS_ADDREF( pluginManager ); +} + +nsXPIDLPluginManager2::~nsXPIDLPluginManager2() +{ + NS_RELEASE( pluginManager ); +} + +NS_IMETHODIMP +nsXPIDLPluginManager2::BeginWaitCursor() +{ + return pluginManager->BeginWaitCursor(); +} + +NS_IMETHODIMP +nsXPIDLPluginManager2::EndWaitCursor() +{ + return pluginManager->EndWaitCursor(); +} + +NS_IMETHODIMP +nsXPIDLPluginManager2::FindProxyForURL( const char *url, char **_retval ) +{ + return pluginManager->FindProxyForURL( url, _retval ); +} + +NS_IMETHODIMP +nsXPIDLPluginManager2::SupportsURLProtocol( const char *protocol, + PRBool *_retval ) +{ + return pluginManager->SupportsURLProtocol( protocol, _retval ); +} + +// from nsXPIDLPluginManager + +NS_IMETHODIMP +nsXPIDLPluginManager2::GetURL( nsISupports *pliginInstance, + const char *url, + const char *target, + nsIXPIDLPluginStreamListener *streamListener, + const char *altHost, + const char *referrer, + PRBool forceJSEnabled ) +{ + return nsXPIDLPluginManager::GetURL( pliginInstance, + url, + target, + streamListener, + altHost, + referrer, + forceJSEnabled ); +} + +NS_IMETHODIMP +nsXPIDLPluginManager2::PostURL( nsISupports *pliginInstance, + const char *url, + PRUint32 postDataLength, + PRUint8 *postData, + PRUint32 postHeadersLength, + const char *postHeaders, + PRBool isFile, + const char *target, + nsIXPIDLPluginStreamListener *streamListener, + const char *altHost, + const char *referrer, + PRBool forceJSEnabled ) +{ + return nsXPIDLPluginManager::PostURL( pliginInstance, + url, + postDataLength, + postData, + postHeadersLength, + postHeaders, + isFile, + target, + streamListener, + altHost, + referrer, + forceJSEnabled ); +} + +NS_IMETHODIMP +nsXPIDLPluginManager2::ReloadPlugins( PRBool reloadPages ) +{ + return nsXPIDLPluginManager::ReloadPlugins( reloadPages ); +} + +NS_IMETHODIMP +nsXPIDLPluginManager2::UserAgent( char **_retval ) +{ + return nsXPIDLPluginManager::UserAgent( _retval ); +} diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginManager2.h b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginManager2.h new file mode 100644 index 00000000000..c32b598fea6 --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginManager2.h @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#ifndef _nsXPIDLPluginManager2_included_ +#define _nsXPIDLPluginManager2_included_ + +#include "nsIXPIDLPluginManager2.h" +#include "nsIPluginManager2.h" + +#include "nsXPIDLPluginManager.h" + +class nsXPIDLPluginManager2 : public nsXPIDLPluginManager, public nsIXPIDLPluginManager2 +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIXPIDLPLUGINMANAGER2 + NS_DECL_NSIXPIDLPLUGINMANAGER + + nsXPIDLPluginManager2(); + nsXPIDLPluginManager2( nsIPluginManager2 *pluginManager ); + virtual ~nsXPIDLPluginManager2(); + + nsIPluginManager2 *pluginManager; +}; + +#endif // _nsXPIDLPluginManager2_included_ diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginStreamInfo.cpp b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginStreamInfo.cpp new file mode 100644 index 00000000000..d5b6017feb3 --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginStreamInfo.cpp @@ -0,0 +1,96 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsXPIDLPluginStreamInfo.h" + +NS_IMPL_ISUPPORTS1(nsXPIDLPluginStreamInfo, nsIXPIDLPluginStreamInfo) + +nsXPIDLPluginStreamInfo::nsXPIDLPluginStreamInfo() +{ + NS_INIT_ISUPPORTS(); +} + +nsXPIDLPluginStreamInfo::nsXPIDLPluginStreamInfo( nsIPluginStreamInfo *pluginStreamInfo ) +{ + NS_INIT_ISUPPORTS(); + this->pluginStreamInfo = pluginStreamInfo; + NS_ADDREF( pluginStreamInfo ); +} + +nsXPIDLPluginStreamInfo::~nsXPIDLPluginStreamInfo() +{ + NS_RELEASE( pluginStreamInfo ); +} + +NS_IMETHODIMP +nsXPIDLPluginStreamInfo::GetContentType( char * *aContentType ) +{ + return pluginStreamInfo->GetContentType( (nsMIMEType *)aContentType ); +} + +NS_IMETHODIMP +nsXPIDLPluginStreamInfo::GetLastModified( PRUint32 *aLastModified ) +{ + return pluginStreamInfo->GetLastModified( aLastModified ); +} + +NS_IMETHODIMP +nsXPIDLPluginStreamInfo::GetLength( PRUint32 *aLength ) +{ + return pluginStreamInfo->GetLength( aLength ); +} + +NS_IMETHODIMP +nsXPIDLPluginStreamInfo::GetURL( PRUnichar * *aURL ) +{ + return pluginStreamInfo->GetURL( (const char **)aURL ); +} + +NS_IMETHODIMP +nsXPIDLPluginStreamInfo::IsSeekable( PRBool *_retval ) +{ + return pluginStreamInfo->IsSeekable( _retval ); +} + +NS_IMETHODIMP +nsXPIDLPluginStreamInfo::RequestRead( PRUint32 count, + PRInt32 *offsets, + PRUint32 *lengths ) +{ + nsByteRange *rangeList, *last; + + // rekolbasing data to nsByteRange structure + for( int i=0; ioffset = offsets[i]; + newRange->length = lengths[i]; + newRange->next = NULL; + if( i == 0 ) rangeList = last = newRange; + else { + last->next = newRange; + last = last->next; + } + } + + // make a call + return pluginStreamInfo->RequestRead( rangeList ); +} diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginStreamInfo.h b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginStreamInfo.h new file mode 100644 index 00000000000..4d645295c9a --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginStreamInfo.h @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#ifndef _nsXPIDLPluginStreamInfo_included_ +#define _nsXPIDLPluginStreamInfo_included_ + +#include "nsIXPIDLPluginStreamInfo.h" +#include "nsIPluginStreamInfo.h" + +class nsXPIDLPluginStreamInfo : public nsIXPIDLPluginStreamInfo +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIXPIDLPLUGINSTREAMINFO + + nsXPIDLPluginStreamInfo(); + nsXPIDLPluginStreamInfo( nsIPluginStreamInfo *pluginStreamInfo ); + virtual ~nsXPIDLPluginStreamInfo(); + + nsIPluginStreamInfo *pluginStreamInfo; +}; + +#endif // _nsXPIDLPluginStreamInfo_included_ diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginStreamListener.cpp b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginStreamListener.cpp new file mode 100644 index 00000000000..99df478138c --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginStreamListener.cpp @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsIPluginStreamListener.h" +#include "nsXPIDLPluginStreamListener.h" + +NS_IMPL_ISUPPORTS1(nsXPIDLPluginStreamListener, nsIPluginStreamListener) + +nsXPIDLPluginStreamListener::nsXPIDLPluginStreamListener() +{ + NS_INIT_ISUPPORTS(); +} + +nsXPIDLPluginStreamListener::nsXPIDLPluginStreamListener( nsIXPIDLPluginStreamListener *pluginStreamListener ) +{ + NS_INIT_ISUPPORTS(); + this->pluginStreamListener = pluginStreamListener; + NS_ADDREF( pluginStreamListener ); +} + +nsXPIDLPluginStreamListener::~nsXPIDLPluginStreamListener() +{ + NS_RELEASE( pluginStreamListener ); +} + +NS_IMETHODIMP +nsXPIDLPluginStreamListener::GetStreamType( nsPluginStreamType *result ) +{ + return pluginStreamListener->GetStreamType( (PRUint32 *)result ); +} + +NS_IMETHODIMP +nsXPIDLPluginStreamListener::OnDataAvailable( nsIPluginStreamInfo *streamInfo, + nsIInputStream *input, + PRUint32 length ) +{ + nsIXPIDLPluginStreamInfo *sInfo = new nsXPIDLPluginStreamInfo( streamInfo ); + nsIXPIDLInputStream *iStream = new nsXPIDLInputStream( input ); + return pluginStreamListener->OnDataAvailable( sInfo, iStream, length ); +} + +NS_IMETHODIMP +nsXPIDLPluginStreamListener::OnFileAvailable( nsIPluginStreamInfo *streamInfo, + const char *fileName ) +{ + nsIXPIDLPluginStreamInfo *sInfo = new nsXPIDLPluginStreamInfo( streamInfo ); + return pluginStreamListener->OnFileAvailable( sInfo, (PRUnichar *)fileName ); +} + +NS_IMETHODIMP +nsXPIDLPluginStreamListener::OnStartBinding( nsIPluginStreamInfo *streamInfo ) +{ + nsIXPIDLPluginStreamInfo *sInfo = new nsXPIDLPluginStreamInfo( streamInfo ); + return pluginStreamListener->OnStartBinding( sInfo ); +} + +NS_IMETHODIMP +nsXPIDLPluginStreamListener::OnStopBinding( nsIPluginStreamInfo *streamInfo, + nsresult status ) +{ + nsIXPIDLPluginStreamInfo *sInfo = new nsXPIDLPluginStreamInfo( streamInfo ); + return pluginStreamListener->OnStopBinding( sInfo, (PRInt32)status ); +} diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginStreamListener.h b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginStreamListener.h new file mode 100644 index 00000000000..22ccf11573b --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginStreamListener.h @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#ifndef _nsXPIDLPluginStreamListener_included_ +#define _nsXPIDLPluginStreamListener_included_ + +#include "nsIPluginStreamListener.h" + +#include "nsIXPIDLPluginStreamListener.h" +#include "nsIPluginStreamInfo.h" +#include "nsXPIDLPluginStreamInfo.h" +#include "nsIInputStream.h" +#include "nsXPIDLInputStream.h" + +class nsXPIDLPluginStreamListener : public nsIPluginStreamListener +{ +public: + NS_DECL_ISUPPORTS +// NS_DECL_NSIXPIDLPLUGINSTREAMLISTENER + + nsXPIDLPluginStreamListener(); + nsXPIDLPluginStreamListener( nsIXPIDLPluginStreamListener * pluginStreamListener ); + virtual ~nsXPIDLPluginStreamListener(); + + nsIXPIDLPluginStreamListener * pluginStreamListener; + + // from nsIPluginStreamListener + NS_IMETHODIMP GetStreamType( nsPluginStreamType *result ); + NS_IMETHODIMP OnDataAvailable( nsIPluginStreamInfo *streamInfo, + nsIInputStream *input, + PRUint32 length ); + NS_IMETHODIMP OnFileAvailable( nsIPluginStreamInfo *streamInfo, + const char *fileName ); + NS_IMETHODIMP OnStartBinding( nsIPluginStreamInfo *streamInfo ); + NS_IMETHODIMP OnStopBinding( nsIPluginStreamInfo *streamInfo, nsresult status ); +}; + +#endif // _nsXPIDLPluginStreamListener_included_ diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginTagInfo.cpp b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginTagInfo.cpp new file mode 100644 index 00000000000..a0b65a2253e --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginTagInfo.cpp @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsXPIDLPluginTagInfo.h" + +NS_IMPL_ISUPPORTS1(nsXPIDLPluginTagInfo, nsIXPIDLPluginTagInfo) + +nsXPIDLPluginTagInfo::nsXPIDLPluginTagInfo() +{ + NS_INIT_ISUPPORTS(); +} + +nsXPIDLPluginTagInfo::nsXPIDLPluginTagInfo( nsIPluginTagInfo *tagInfo ) +{ + NS_INIT_ISUPPORTS(); + this->tagInfo = tagInfo; + NS_ADDREF( tagInfo ); +} + +nsXPIDLPluginTagInfo::~nsXPIDLPluginTagInfo() +{ + NS_RELEASE( tagInfo ); +} + +NS_IMETHODIMP +nsXPIDLPluginTagInfo::GetAttribute( const char *name, char **_retval ) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP +nsXPIDLPluginTagInfo::GetAttributes( PRUint32 *count, + char ***names, + char ***values ) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginTagInfo.h b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginTagInfo.h new file mode 100644 index 00000000000..9e2baaabf4a --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginTagInfo.h @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#ifndef _nsXPIDLPluginTagInfo_included_ +#define _nsXPIDLPluginTagInfo_included_ + +#include "nsIXPIDLPluginTagInfo.h" +#include "nsIPluginTagInfo.h" + +class nsXPIDLPluginTagInfo : public nsIXPIDLPluginTagInfo +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIXPIDLPLUGINTAGINFO + + nsXPIDLPluginTagInfo(); + nsXPIDLPluginTagInfo( nsIPluginTagInfo *tagInfo ); + virtual ~nsXPIDLPluginTagInfo(); + + nsIPluginTagInfo *tagInfo; +}; + +#endif // _nsXPIDLPluginTagInfo_included_ diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginTagInfo2.cpp b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginTagInfo2.cpp new file mode 100644 index 00000000000..d297b045436 --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginTagInfo2.cpp @@ -0,0 +1,133 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsXPIDLPluginTagInfo2.h" + +NS_IMPL_ISUPPORTS1(nsXPIDLPluginTagInfo2, nsIXPIDLPluginTagInfo2) + +nsXPIDLPluginTagInfo2::nsXPIDLPluginTagInfo2() +{ + NS_INIT_ISUPPORTS(); +} + +nsXPIDLPluginTagInfo2::nsXPIDLPluginTagInfo2( nsIPluginTagInfo2 *tagInfo ) +{ + NS_INIT_ISUPPORTS(); + this->tagInfo = tagInfo; + NS_ADDREF( tagInfo ); +} + +nsXPIDLPluginTagInfo2::~nsXPIDLPluginTagInfo2() +{ + NS_RELEASE( tagInfo ); +} + +NS_IMETHODIMP +nsXPIDLPluginTagInfo2::GetAlignment( char * *aAlignment ) +{ + return tagInfo->GetAlignment( (const char **)aAlignment ); +} + +NS_IMETHODIMP +nsXPIDLPluginTagInfo2::GetParameter( const char *name, char **_retval ) +{ + return tagInfo->GetParameter( name, (const char **)_retval ); +} + +NS_IMETHODIMP +nsXPIDLPluginTagInfo2::GetParameters( PRUint32 *count, + char ***names, + char ***values ) +{ + return tagInfo->GetParameters( (PRUint16)*count, + (const char*const*)*names, + (const char*const*)*values ); +} + +NS_IMETHODIMP +nsXPIDLPluginTagInfo2::GetBorderHorizSpace( PRUint32 *aBorderHorizSpace ) +{ + return tagInfo->GetBorderHorizSpace( aBorderHorizSpace ); +} + +NS_IMETHODIMP +nsXPIDLPluginTagInfo2::GetBorderVertSpace( PRUint32 *aBorderVertSpace ) +{ + return tagInfo->GetBorderVertSpace( aBorderVertSpace ); +} + +NS_IMETHODIMP +nsXPIDLPluginTagInfo2::GetDocumentBase( char * *aDocumentBase ) +{ + return tagInfo->GetDocumentBase( (const char **)aDocumentBase ); +} + +NS_IMETHODIMP +nsXPIDLPluginTagInfo2::GetDocumentEncoding( char * *aDocumentEncoding ) +{ + return tagInfo->GetDocumentEncoding( (const char**)aDocumentEncoding ); +} + +NS_IMETHODIMP +nsXPIDLPluginTagInfo2::GetHeight( PRUint32 *aHeight ) +{ + return tagInfo->GetHeight( aHeight ); +} + +NS_IMETHODIMP +nsXPIDLPluginTagInfo2::GetWidth( PRUint32 *aWidth ) +{ + return tagInfo->GetWidth( aWidth ); +} + +NS_IMETHODIMP +nsXPIDLPluginTagInfo2::GetTagText( char * *aTagText ) +{ + return tagInfo->GetTagText( (const char **)aTagText ); +} + +NS_IMETHODIMP +nsXPIDLPluginTagInfo2::GetTagType( char * *aTagType ) +{ + return tagInfo->GetTagType( (nsPluginTagType *)aTagType ); +} + +NS_IMETHODIMP +nsXPIDLPluginTagInfo2::GetUniqueID( PRUint32 *aUniqueID ) +{ + return tagInfo->GetUniqueID( aUniqueID ); +} + +// from TagInfo +NS_IMETHODIMP +nsXPIDLPluginTagInfo2::GetAttribute( const char *name, char **_retval ) +{ + return nsXPIDLPluginTagInfo::GetAttribute( name, _retval ); +} + +NS_IMETHODIMP +nsXPIDLPluginTagInfo2::GetAttributes( PRUint32 *count, + char ***names, + char ***values ) +{ + return nsXPIDLPluginTagInfo::GetAttributes( count, names, values ); +} diff --git a/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginTagInfo2.h b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginTagInfo2.h new file mode 100644 index 00000000000..dff2b25e119 --- /dev/null +++ b/mozilla/java/plugins/wrappers/cpp/nsXPIDLPluginTagInfo2.h @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#ifndef _nsXPIDLPluginTagInfo2_included_ +#define _nsXPIDLPluginTagInfo2_included_ + +#include "nsIXPIDLPluginTagInfo2.h" +#include "nsIPluginTagInfo2.h" + +#include "nsXPIDLPluginTagInfo.h" + +class nsXPIDLPluginTagInfo2 : public nsXPIDLPluginTagInfo, public nsIXPIDLPluginTagInfo2 +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIXPIDLPLUGINTAGINFO2 + NS_DECL_NSIXPIDLPLUGINTAGINFO + + nsXPIDLPluginTagInfo2(); + nsXPIDLPluginTagInfo2( nsIPluginTagInfo2 *tagInfo ); + virtual ~nsXPIDLPluginTagInfo2(); + + nsIPluginTagInfo2 *tagInfo; +}; + +#endif // _nsXPIDLPluginTagInfo2_included_ diff --git a/mozilla/java/plugins/wrappers/java/Makefile b/mozilla/java/plugins/wrappers/java/Makefile new file mode 100644 index 00000000000..4f950169e98 --- /dev/null +++ b/mozilla/java/plugins/wrappers/java/Makefile @@ -0,0 +1,96 @@ +#!gmake +# +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/NPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# Serge Pikalev +# + +DEPTH = ../../../.. +topsrcdir = ../../../.. +srcdir = . +VPATH = . + + + +include $(DEPTH)/config/autoconf.mk +include $(topsrcdir)/config/config.mk + +IDLDIR = ../public +IDLSRCS = \ + $(IDLDIR)/nsIXPIDLPlugin.idl \ + $(IDLDIR)/nsIXPIDLPluginInstance.idl \ + $(IDLDIR)/nsIXPIDLPluginStreamListener.idl \ + $(IDLDIR)/nsIXPIDLPluginManager.idl \ + $(IDLDIR)/nsIXPIDLPluginManager2.idl \ + $(IDLDIR)/nsIXPIDLPluginInstancePeer.idl \ + $(IDLDIR)/nsIXPIDLPluginTagInfo.idl \ + $(IDLDIR)/nsIXPIDLPluginTagInfo2.idl \ + $(IDLDIR)/nsIXPIDLPluginStreamInfo.idl \ + $(IDLDIR)/nsIXPIDLInputStream.idl \ + $(IDLDIR)/nsIXPIDLOutputStream.idl \ + $(NULL) +IDLCLASSES = \ + nsIXPIDLPlugin.class \ + nsIXPIDLPluginInstance.class \ + nsIXPIDLPluginStreamListener.class \ + nsIXPIDLPluginManager.class \ + nsIXPIDLPluginManager2.class \ + nsIXPIDLPluginInstancePeer.class \ + nsIXPIDLPluginTagInfo.class \ + nsIXPIDLPluginTagInfo2.class \ + nsIXPIDLPluginStreamInfo.class \ + nsIXPIDLInputStream.class \ + nsIXPIDLOutputStream.class \ + $(NULL) + + + +include $(topsrcdir)/config/rules.mk + +.SUFFIXES: .java .idl +XPIDL_JAVA=$(IDLSRCS:.idl=.java) +.idl.java: + $(XPIDL_COMPILE) -m java -w -I$(DEPTH)/dist/idl/ $< + +CLASSES = \ + nsXPIDLPlugin.class \ + nsXPIDLPluginInstance.class \ + nsXPIDLPluginStreamListener.class \ + nsXPIDLPluginInstancePeer.class \ + nsXPIDLPluginTagInfo.class \ + nsXPIDLPluginTagInfo2.class \ + nsXPIDLPluginManager.class \ + nsXPIDLPluginManager2.class \ + nsXPIDLPluginStreamInfo.class \ + nsXPIDLInputStream.class \ + nsXPIDLOutputStream.class \ + $(NULL) +.java.class: + $(JDKHOME)/bin/javac -classpath .:../../classes:$(DIST)/classes $< + +build-java: $(IDLSRCS:.idl=.java) +build-classes: $(CLASSES) + +export:: build-java build-classes + +clean-java: + rm -f *class nsIXPIDL*.java + rm -rf _xpidlgen + +clean:: clean-java diff --git a/mozilla/java/plugins/wrappers/java/Makefile.in b/mozilla/java/plugins/wrappers/java/Makefile.in new file mode 100644 index 00000000000..dad217f7df9 --- /dev/null +++ b/mozilla/java/plugins/wrappers/java/Makefile.in @@ -0,0 +1,96 @@ +#!gmake +# +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/NPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# Serge Pikalev +# + +DEPTH = ../../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + + + +include $(DEPTH)/config/autoconf.mk +include $(topsrcdir)/config/config.mk + +IDLDIR = ../public +IDLSRCS = \ + $(IDLDIR)/nsIXPIDLPlugin.idl \ + $(IDLDIR)/nsIXPIDLPluginInstance.idl \ + $(IDLDIR)/nsIXPIDLPluginStreamListener.idl \ + $(IDLDIR)/nsIXPIDLPluginManager.idl \ + $(IDLDIR)/nsIXPIDLPluginManager2.idl \ + $(IDLDIR)/nsIXPIDLPluginInstancePeer.idl \ + $(IDLDIR)/nsIXPIDLPluginTagInfo.idl \ + $(IDLDIR)/nsIXPIDLPluginTagInfo2.idl \ + $(IDLDIR)/nsIXPIDLPluginStreamInfo.idl \ + $(IDLDIR)/nsIXPIDLInputStream.idl \ + $(IDLDIR)/nsIXPIDLOutputStream.idl \ + $(NULL) +IDLCLASSES = \ + nsIXPIDLPlugin.class \ + nsIXPIDLPluginInstance.class \ + nsIXPIDLPluginStreamListener.class \ + nsIXPIDLPluginManager.class \ + nsIXPIDLPluginManager2.class \ + nsIXPIDLPluginInstancePeer.class \ + nsIXPIDLPluginTagInfo.class \ + nsIXPIDLPluginTagInfo2.class \ + nsIXPIDLPluginStreamInfo.class \ + nsIXPIDLInputStream.class \ + nsIXPIDLOutputStream.class \ + $(NULL) + + + +include $(topsrcdir)/config/rules.mk + +.SUFFIXES: .java .idl +XPIDL_JAVA=$(IDLSRCS:.idl=.java) +.idl.java: + $(XPIDL_COMPILE) -m java -w -I$(DEPTH)/dist/idl/ $< + +CLASSES = \ + nsXPIDLPlugin.class \ + nsXPIDLPluginInstance.class \ + nsXPIDLPluginStreamListener.class \ + nsXPIDLPluginInstancePeer.class \ + nsXPIDLPluginTagInfo.class \ + nsXPIDLPluginTagInfo2.class \ + nsXPIDLPluginManager.class \ + nsXPIDLPluginManager2.class \ + nsXPIDLPluginStreamInfo.class \ + nsXPIDLInputStream.class \ + nsXPIDLOutputStream.class \ + $(NULL) +.java.class: + $(JDKHOME)/bin/javac -classpath .:../../classes:$(DIST)/classes $< + +build-java: $(IDLSRCS:.idl=.java) +build-classes: $(CLASSES) + +export:: build-java build-classes + +clean-java: + rm -f *class nsIXPIDL*.java + rm -rf _xpidlgen + +clean:: clean-java diff --git a/mozilla/java/plugins/wrappers/java/nsXPIDLInputStream.java b/mozilla/java/plugins/wrappers/java/nsXPIDLInputStream.java new file mode 100644 index 00000000000..08927146fd5 --- /dev/null +++ b/mozilla/java/plugins/wrappers/java/nsXPIDLInputStream.java @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +import org.mozilla.xpcom.*; +import org.mozilla.pluglet.*; +import org.mozilla.pluglet.mozilla.*; +import java.io.*; + +public class nsXPIDLInputStream extends InputStream { + + public nsIXPIDLInputStream inputStream; + + public nsXPIDLInputStream( nsIXPIDLInputStream inputStream ) { + this.inputStream = inputStream; + } + + public void close() { + inputStream.close(); + } + + public int available() { + return inputStream.available(); + } + + public int read(byte[] b, int off, int len) throws IOException { + return inputStream.read( len, b ); + } + + public int read() throws IOException { + byte buf[] = new byte[1]; + if( read( buf, 0, 1 ) < 0 ) { + return -1; + } else { + return buf[0] & 0xff; + } + } +} diff --git a/mozilla/java/plugins/wrappers/java/nsXPIDLOutputStream.java b/mozilla/java/plugins/wrappers/java/nsXPIDLOutputStream.java new file mode 100644 index 00000000000..65ad54e0b87 --- /dev/null +++ b/mozilla/java/plugins/wrappers/java/nsXPIDLOutputStream.java @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +import org.mozilla.xpcom.*; +import org.mozilla.pluglet.*; +import org.mozilla.pluglet.mozilla.*; +import java.io.*; + +public class nsXPIDLOutputStream extends OutputStream { + + public nsIXPIDLOutputStream outputStream; + + public nsXPIDLOutputStream( nsIXPIDLOutputStream outputStream ) { + this.outputStream = outputStream; + } + + public void close() { + outputStream.close(); + } + + public void flush() { + outputStream.flush(); + } + + public void write(byte[] b, int off, int len) throws IOException { + outputStream.write( len, b ); + } + + public void write( int b ) throws IOException { + byte buf[] = new byte[1]; + buf[0] = (byte)b; + write( buf, 0, 1 ); + } +} diff --git a/mozilla/java/plugins/wrappers/java/nsXPIDLPlugin.java b/mozilla/java/plugins/wrappers/java/nsXPIDLPlugin.java new file mode 100644 index 00000000000..c2692a8d43b --- /dev/null +++ b/mozilla/java/plugins/wrappers/java/nsXPIDLPlugin.java @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +import org.mozilla.xpcom.*; +import org.mozilla.pluglet.*; +import org.mozilla.pluglet.mozilla.*; + +public class nsXPIDLPlugin implements nsIXPIDLPlugin { + + public PlugletFactory plugin; + + public nsXPIDLPlugin( PlugletFactory plugin ) { + this.plugin = plugin; + } + + public Object createPluginInstance( nsISupports aOuter, + IID iid, + String pluginMIMEType ) { + return plugin.createPluglet( pluginMIMEType ); + } + + public void initialize() { + // ??? Where can I take PlugletManager in this place? + } + + public void shutdown() { + plugin.shutdown(); + } + + // from nsIFactory + public void lockFactory( boolean lock ) { + } + + public Object createInstance( nsISupports instance, IID iid ) { + return createPluginInstance( instance, iid, null ); + } + + // from nsISupports + public Object queryInterface( IID iid ) { + Object result; + if( nsISupports.IID.equals(iid) + || nsIXPIDLPlugin.IID.equals(iid) ) { + result = this; + } else { + result = null; + } + return result; + } +} diff --git a/mozilla/java/plugins/wrappers/java/nsXPIDLPluginInstance.java b/mozilla/java/plugins/wrappers/java/nsXPIDLPluginInstance.java new file mode 100644 index 00000000000..e911c92e0d9 --- /dev/null +++ b/mozilla/java/plugins/wrappers/java/nsXPIDLPluginInstance.java @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +import org.mozilla.xpcom.*; +import org.mozilla.pluglet.*; +import org.mozilla.pluglet.mozilla.*; + +public class nsXPIDLPluginInstance implements nsIXPIDLPluginInstance { + + public Pluglet instance; + + public nsXPIDLPluginInstance( Pluglet instance ) { + this.instance = instance; + } + + public void destroy() { + instance.destroy(); + } + + public void initialize( nsIXPIDLPluginInstancePeer peer ) { + PlugletPeer pPeer = new nsXPIDLPluginInstancePeer( peer ); + instance.initialize( pPeer ); + } + + public nsIXPIDLPluginStreamListener newStream() { + return new nsXPIDLPluginStreamListener( instance.newStream() ); + } + + public void start() { + instance.start(); + } + + public void stop() { + instance.stop(); + } + + // from nsISupports + public Object queryInterface( IID iid ) { + Object result; + if( nsISupports.IID.equals(iid) + || nsIXPIDLPluginInstance.IID.equals(iid) ) { + result = this; + } else { + result = null; + } + return result; + } +} diff --git a/mozilla/java/plugins/wrappers/java/nsXPIDLPluginInstancePeer.java b/mozilla/java/plugins/wrappers/java/nsXPIDLPluginInstancePeer.java new file mode 100644 index 00000000000..eeaf5463efa --- /dev/null +++ b/mozilla/java/plugins/wrappers/java/nsXPIDLPluginInstancePeer.java @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +import org.mozilla.xpcom.*; +import org.mozilla.pluglet.*; +import org.mozilla.pluglet.mozilla.*; + +public class nsXPIDLPluginInstancePeer implements PlugletPeer { + + public nsIXPIDLPluginInstancePeer instancePeer; + + public nsXPIDLPluginInstancePeer( nsIXPIDLPluginInstancePeer instancePeer ) { + this.instancePeer = instancePeer; + } + + public java.lang.String getMIMEType() { + return instancePeer.getMIMEType(); + } + + public int getMode() { + return instancePeer.getMode(); + } + + public java.lang.String getValue(int variable) { + return instancePeer.getValue( variable ); + } + + public java.io.OutputStream newStream(java.lang.String type, java.lang.String target) { + return new nsXPIDLOutputStream( instancePeer.newStream( type, target ) ); + } + + public void setWindowSize( int width, int height) { + instancePeer.setWindowSize( width, height ); + } + + public void showStatus( java.lang.String message ) { + instancePeer.showStatus( message ); + } + + public PlugletTagInfo getTagInfo() { + return new nsXPIDLPluginTagInfo2( instancePeer.getTagInfo() ); + } +} diff --git a/mozilla/java/plugins/wrappers/java/nsXPIDLPluginManager.java b/mozilla/java/plugins/wrappers/java/nsXPIDLPluginManager.java new file mode 100644 index 00000000000..4550be5d73f --- /dev/null +++ b/mozilla/java/plugins/wrappers/java/nsXPIDLPluginManager.java @@ -0,0 +1,91 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +import org.mozilla.xpcom.*; +import org.mozilla.pluglet.*; +import org.mozilla.pluglet.mozilla.*; + +public class nsXPIDLPluginManager implements PlugletManager { + + public nsIXPIDLPluginManager pluginManager; + + public nsXPIDLPluginManager() { + } + + public nsXPIDLPluginManager( nsIXPIDLPluginManager pluginManager ) { + this.pluginManager = pluginManager; + } + + public void getURL( Pluglet pluglet, + java.net.URL url, + java.lang.String target, + PlugletStreamListener streamListener, + java.lang.String altHost, + java.net.URL referrer, + boolean forceJSEnabled ) { + nsISupports pInstance = new nsXPIDLPluginInstance( pluglet ); + nsIXPIDLPluginStreamListener sListener = new nsXPIDLPluginStreamListener( streamListener ); + pluginManager.getURL( pInstance, + url.toString(), + target, + sListener, + altHost, + referrer.toString(), + forceJSEnabled ); + } + + public void postURL( Pluglet pluglet, + java.net.URL url, + int postDataLen, + byte[] postData, + boolean isFile, + java.lang.String target, + PlugletStreamListener streamListener, + java.lang.String altHost, + java.net.URL referrer, + boolean forceJSEnabled, + int postHeadersLength, + byte[] postHeaders) { + nsISupports pInstance = new nsXPIDLPluginInstance( pluglet ); + nsIXPIDLPluginStreamListener sListener = new nsXPIDLPluginStreamListener( streamListener ); + pluginManager.postURL( pInstance, + url.toString(), + postDataLen, + postData, + postHeadersLength, + new String(postHeaders), + isFile, + target, + sListener, + altHost, + referrer.toString(), + forceJSEnabled ); + } + + public void reloadPluglets( boolean reloadPages ) { + pluginManager.reloadPlugins( reloadPages ); + } + + public java.lang.String userAgent() { + return pluginManager.userAgent(); + } +} diff --git a/mozilla/java/plugins/wrappers/java/nsXPIDLPluginManager2.java b/mozilla/java/plugins/wrappers/java/nsXPIDLPluginManager2.java new file mode 100644 index 00000000000..461bcb17553 --- /dev/null +++ b/mozilla/java/plugins/wrappers/java/nsXPIDLPluginManager2.java @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +import org.mozilla.xpcom.*; +import org.mozilla.pluglet.*; +import org.mozilla.pluglet.mozilla.*; + +public class nsXPIDLPluginManager2 extends nsXPIDLPluginManager implements PlugletManager2 { + + public nsIXPIDLPluginManager2 pluginManager; + + public nsXPIDLPluginManager2( nsIXPIDLPluginManager2 pluginManager ) { + this.pluginManager = pluginManager; + } + + public void beginWaitCursor() { + pluginManager.beginWaitCursor(); + } + + public void endWaitCursor() { + pluginManager.endWaitCursor(); + } + + public String findProxyForURL( java.net.URL url ) { + return pluginManager.findProxyForURL( url.toString() ); + } + + public boolean supportsURLProtocol( String protocol ) { + return pluginManager.supportsURLProtocol( protocol ); + } + + public boolean isURLProtocolSupported( String protocol ) { + return pluginManager.supportsURLProtocol( protocol ); + } +} diff --git a/mozilla/java/plugins/wrappers/java/nsXPIDLPluginStreamInfo.java b/mozilla/java/plugins/wrappers/java/nsXPIDLPluginStreamInfo.java new file mode 100644 index 00000000000..db93916f406 --- /dev/null +++ b/mozilla/java/plugins/wrappers/java/nsXPIDLPluginStreamInfo.java @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +import org.mozilla.xpcom.*; +import org.mozilla.pluglet.*; +import org.mozilla.pluglet.mozilla.*; + +public class nsXPIDLPluginStreamInfo implements PlugletStreamInfo { + + public nsIXPIDLPluginStreamInfo streamInfo; + + public nsXPIDLPluginStreamInfo( nsIXPIDLPluginStreamInfo streamInfo ) { + this.streamInfo = streamInfo; + } + + public java.lang.String getContentType() { + return streamInfo.getContentType(); + } + + public int getLastModified() { + return streamInfo.getLastModified(); + } + + public int getLength() { + return streamInfo.getLength(); + } + + public java.lang.String getURL() { + return streamInfo.getURL(); + } + + public boolean isSeekable() { + return streamInfo.isSeekable(); + } + + public void requestRead( ByteRanges ranges ) { + } +} diff --git a/mozilla/java/plugins/wrappers/java/nsXPIDLPluginStreamListener.java b/mozilla/java/plugins/wrappers/java/nsXPIDLPluginStreamListener.java new file mode 100644 index 00000000000..1c52512b31b --- /dev/null +++ b/mozilla/java/plugins/wrappers/java/nsXPIDLPluginStreamListener.java @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +import org.mozilla.xpcom.*; +import org.mozilla.pluglet.*; +import org.mozilla.pluglet.mozilla.*; + +public class nsXPIDLPluginStreamListener implements nsIXPIDLPluginStreamListener { + + public PlugletStreamListener streamListener; + + public nsXPIDLPluginStreamListener( PlugletStreamListener streamListener ) { + this.streamListener = streamListener; + } + + public int getStreamType() { + return streamListener.getStreamType(); + } + + public void onDataAvailable( nsIXPIDLPluginStreamInfo streamInfo, + nsIXPIDLInputStream input, + int length) { + PlugletStreamInfo sInfo = new nsXPIDLPluginStreamInfo( streamInfo ); + java.io.InputStream iStream = new nsXPIDLInputStream( input ); + streamListener.onDataAvailable( sInfo, iStream, length ); + } + + public void onFileAvailable( nsIXPIDLPluginStreamInfo streamInfo, + String fileName ) { + PlugletStreamInfo sInfo = new nsXPIDLPluginStreamInfo( streamInfo ); + streamListener.onFileAvailable( sInfo, fileName ); + } + + public void onStartBinding( nsIXPIDLPluginStreamInfo streamInfo ) { + PlugletStreamInfo sInfo = new nsXPIDLPluginStreamInfo( streamInfo ); + streamListener.onStartBinding( sInfo ); + } + + public void onStopBinding( nsIXPIDLPluginStreamInfo streamInfo, int status) { + PlugletStreamInfo sInfo = new nsXPIDLPluginStreamInfo( streamInfo ); + streamListener.onStopBinding( sInfo, status ); + } + + // from nsISupports + public Object queryInterface( IID iid ) { + Object result; + if( nsISupports.IID.equals(iid) + || nsIXPIDLPluginStreamListener.IID.equals(iid) ) { + result = this; + } else { + result = null; + } + return result; + } +} diff --git a/mozilla/java/plugins/wrappers/java/nsXPIDLPluginTagInfo.java b/mozilla/java/plugins/wrappers/java/nsXPIDLPluginTagInfo.java new file mode 100644 index 00000000000..5862de3ce1b --- /dev/null +++ b/mozilla/java/plugins/wrappers/java/nsXPIDLPluginTagInfo.java @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +import org.mozilla.xpcom.*; +import org.mozilla.pluglet.*; +import org.mozilla.pluglet.mozilla.*; + +public class nsXPIDLPluginTagInfo implements PlugletTagInfo { + + public nsIXPIDLPluginTagInfo tagInfo; + + public String getAttribute( String name ) { + return tagInfo.getAttribute( name ); + } + + public java.util.Properties getAttributes() { + // get atts + int[] count = new int[1]; + String[][] names = new String[1][]; + String[][] values = new String[1][]; + tagInfo.getAttributes( count, names, values ); + + // create props + java.util.Properties props = new java.util.Properties(); + for( int i = 0; i < count[0]; i++ ) { + props.setProperty( names[0][i], values[0][i] ); + } + + // return props + return props; + } + + public Object getDOMElement() { + return null; + } +} diff --git a/mozilla/java/plugins/wrappers/java/nsXPIDLPluginTagInfo2.java b/mozilla/java/plugins/wrappers/java/nsXPIDLPluginTagInfo2.java new file mode 100644 index 00000000000..2e7e17d49c5 --- /dev/null +++ b/mozilla/java/plugins/wrappers/java/nsXPIDLPluginTagInfo2.java @@ -0,0 +1,99 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +import org.mozilla.xpcom.*; +import org.mozilla.pluglet.*; +import org.mozilla.pluglet.mozilla.*; + +public class nsXPIDLPluginTagInfo2 extends nsXPIDLPluginTagInfo implements PlugletTagInfo2 { + + public nsIXPIDLPluginTagInfo2 tagInfo; + + public nsXPIDLPluginTagInfo2( nsIXPIDLPluginTagInfo2 tagInfo ) { + this.tagInfo = tagInfo; + } + + public String getAlignment() { + return tagInfo.getAlignment(); + } + + public String getParameter( String name ) { + return tagInfo.getParameter( name ); + } + + public java.util.Properties getParameters() { + // get atts + int[] count = new int[1]; + String[][] names = new String[1][]; + String[][] values = new String[1][]; + tagInfo.getParameters( count, names, values ); + + // create props + java.util.Properties props = new java.util.Properties(); + for( int i = 0; i < count[0]; i++ ) { + props.setProperty( names[0][i], values[0][i] ); + } + + // return props + return props; + } + + public int getBorderHorizSpace() { + return tagInfo.getBorderHorizSpace(); + } + + public int getBorderVertSpace() { + return tagInfo.getBorderVertSpace(); + } + + public String getDocumentBase() { + return tagInfo.getDocumentBase(); + } + + public String getDocumentEncoding() { + return tagInfo.getDocumentEncoding(); + } + + public String getTagText() { + return tagInfo.getTagText(); + } + + public String getTagType() { + return tagInfo.getTagType(); + } + + public int getUniqueID() { + return tagInfo.getUniqueID(); + } + + public int getHeight() { + return tagInfo.getHeight(); + } + + public int getWidth() { + return tagInfo.getWidth(); + } + + public Object getDOMElement() { + return null; + } +} diff --git a/mozilla/java/plugins/wrappers/public/Makefile b/mozilla/java/plugins/wrappers/public/Makefile new file mode 100644 index 00000000000..3b37d97a13a --- /dev/null +++ b/mozilla/java/plugins/wrappers/public/Makefile @@ -0,0 +1,54 @@ +#!gmake +# +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/NPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# Serge Pikalev +# + +DEPTH = ../../../.. +topsrcdir = ../../../.. +srcdir = . +VPATH = . + + + +include $(DEPTH)/config/autoconf.mk +include $(topsrcdir)/config/config.mk + +XPIDL_MODULE = bcPluginWrappers +XPIDLSRCS = \ + nsIXPIDLPlugin.idl \ + nsIXPIDLPluginInstance.idl \ + nsIXPIDLPluginStreamListener.idl \ + nsIXPIDLPluginManager.idl \ + nsIXPIDLPluginManager2.idl \ + nsIXPIDLPluginInstancePeer.idl \ + nsIXPIDLPluginTagInfo.idl \ + nsIXPIDLPluginTagInfo2.idl \ + nsIXPIDLPluginStreamInfo.idl \ + nsIXPIDLInputStream.idl \ + nsIXPIDLOutputStream.idl \ + $(NULL) + +DSO_LDOPTS += \ + $(XPCOM_LIBS) \ + $(NSPR_LIBS) \ + $(NULL) + +include $(topsrcdir)/config/rules.mk diff --git a/mozilla/java/plugins/wrappers/public/Makefile.in b/mozilla/java/plugins/wrappers/public/Makefile.in new file mode 100644 index 00000000000..4192a3b1a3d --- /dev/null +++ b/mozilla/java/plugins/wrappers/public/Makefile.in @@ -0,0 +1,54 @@ +#!gmake +# +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/NPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# Serge Pikalev +# + +DEPTH = ../../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + + + +include $(DEPTH)/config/autoconf.mk +include $(topsrcdir)/config/config.mk + +XPIDL_MODULE = bcPluginWrappers +XPIDLSRCS = \ + nsIXPIDLPlugin.idl \ + nsIXPIDLPluginInstance.idl \ + nsIXPIDLPluginStreamListener.idl \ + nsIXPIDLPluginManager.idl \ + nsIXPIDLPluginManager2.idl \ + nsIXPIDLPluginInstancePeer.idl \ + nsIXPIDLPluginTagInfo.idl \ + nsIXPIDLPluginTagInfo2.idl \ + nsIXPIDLPluginStreamInfo.idl \ + nsIXPIDLInputStream.idl \ + nsIXPIDLOutputStream.idl \ + $(NULL) + +DSO_LDOPTS += \ + $(XPCOM_LIBS) \ + $(NSPR_LIBS) \ + $(NULL) + +include $(topsrcdir)/config/rules.mk diff --git a/mozilla/java/plugins/wrappers/public/nsIXPIDLInputStream.idl b/mozilla/java/plugins/wrappers/public/nsIXPIDLInputStream.idl new file mode 100644 index 00000000000..35651df293f --- /dev/null +++ b/mozilla/java/plugins/wrappers/public/nsIXPIDLInputStream.idl @@ -0,0 +1,34 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsISupports.idl" + +#pragma prefix + +[scriptable, uuid(b3199ec2-37c6-4c41-9e18-2a655bc4400e)] +interface nsIXPIDLInputStream : nsISupports +{ + void close(); + unsigned long available(); + unsigned long read( in unsigned long count, + [array, size_is(count)] in octet buf ); +}; diff --git a/mozilla/java/plugins/wrappers/public/nsIXPIDLOutputStream.idl b/mozilla/java/plugins/wrappers/public/nsIXPIDLOutputStream.idl new file mode 100644 index 00000000000..83a110b2f4a --- /dev/null +++ b/mozilla/java/plugins/wrappers/public/nsIXPIDLOutputStream.idl @@ -0,0 +1,34 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsISupports.idl" + +#pragma prefix + +[scriptable, uuid(5be17648-6b93-4a17-9d2e-e2fdcff738ee)] +interface nsIXPIDLOutputStream : nsISupports +{ + void close(); + void flush(); + unsigned long write( in unsigned long count, + [array, size_is(count)] in octet buf ); +}; diff --git a/mozilla/java/plugins/wrappers/public/nsIXPIDLPlugin.idl b/mozilla/java/plugins/wrappers/public/nsIXPIDLPlugin.idl new file mode 100644 index 00000000000..10ed1e0b050 --- /dev/null +++ b/mozilla/java/plugins/wrappers/public/nsIXPIDLPlugin.idl @@ -0,0 +1,36 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsIFactory.idl" + +#pragma prefix + +[scriptable, uuid(41019dc6-8d53-41fb-b70a-feaa72cfd48b)] +interface nsIXPIDLPlugin : nsIFactory +{ + void createPluginInstance(in nsISupports aOuter, + in nsIIDRef iid, + in string pluginMIMEType, + [retval, iid_is(iid)] out nsQIResult result); + void initialize(); + void shutdown(); +}; diff --git a/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginInstance.idl b/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginInstance.idl new file mode 100644 index 00000000000..b20cbeedbf1 --- /dev/null +++ b/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginInstance.idl @@ -0,0 +1,40 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsISupports.idl" + +#include "nsIXPIDLPluginInstancePeer.idl" +#include "nsIXPIDLPluginStreamListener.idl" + +#pragma prefix + +[scriptable, uuid(31e78e3a-dcd1-425e-a938-e04260771738)] +interface nsIXPIDLPluginInstance : nsISupports +{ + void destroy(); + void initialize( in nsIXPIDLPluginInstancePeer peer ); + nsIXPIDLPluginStreamListener newStream(); + // void print( ... ); + // void setWindow( ... ); + void start(); + void stop(); +}; diff --git a/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginInstancePeer.idl b/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginInstancePeer.idl new file mode 100644 index 00000000000..15cc33b3282 --- /dev/null +++ b/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginInstancePeer.idl @@ -0,0 +1,41 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsISupports.idl" + +#include "nsIXPIDLPluginTagInfo2.idl" +#include "nsIXPIDLOutputStream.idl" + +#pragma prefix + +[scriptable, uuid(20cb8d75-b224-46a5-a30f-73a65445e9b3)] +interface nsIXPIDLPluginInstancePeer : nsISupports +{ + readonly attribute string MIMEType; + readonly attribute unsigned long mode; + readonly attribute nsIXPIDLPluginTagInfo2 tagInfo; + string getValue( in long variable ); + nsIXPIDLOutputStream newStream( in string type, in string target ); + void setWindowSize( in unsigned long width, + in unsigned long height ); + void showStatus( in string message ); +}; diff --git a/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginManager.idl b/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginManager.idl new file mode 100644 index 00000000000..975080ebb6b --- /dev/null +++ b/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginManager.idl @@ -0,0 +1,53 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsISupports.idl" + +#include "nsIXPIDLPluginStreamListener.idl" + +#pragma prefix + +[scriptable, uuid(f17f6008-e31f-4410-b59b-0bd7df4e4f9b)] +interface nsIXPIDLPluginManager : nsISupports +{ + void getURL( in nsISupports pliginInstance, + in string url, + in string target, + in nsIXPIDLPluginStreamListener streamListener, + in string altHost, + in string referrer, + in boolean forceJSEnabled ); + void postURL( in nsISupports pliginInstance, + in string url, + in unsigned long postDataLength, + [array, size_is(postDataLength)] in octet postData, + in unsigned long postHeadersLength, + in string postHeaders, + in boolean isFile, + in string target, + in nsIXPIDLPluginStreamListener streamListener, + in string altHost, + in string referrer, + in boolean forceJSEnabled ); + void reloadPlugins( in boolean reloadPages ); + string userAgent(); +}; diff --git a/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginManager2.idl b/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginManager2.idl new file mode 100644 index 00000000000..0b2871f7bed --- /dev/null +++ b/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginManager2.idl @@ -0,0 +1,34 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsIXPIDLPluginManager.idl" + +#pragma prefix + +[scriptable, uuid(33731e21-dfe3-4abc-b921-8cd6ccfb0e32)] +interface nsIXPIDLPluginManager2 : nsIXPIDLPluginManager +{ + void beginWaitCursor(); + void endWaitCursor(); + string findProxyForURL( in string url ); + boolean supportsURLProtocol( in string protocol ); +}; diff --git a/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginStreamInfo.idl b/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginStreamInfo.idl new file mode 100644 index 00000000000..3db820a34b5 --- /dev/null +++ b/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginStreamInfo.idl @@ -0,0 +1,38 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsISupports.idl" + +#pragma prefix + +[scriptable, uuid(1bd1e109-7b4c-4820-a80d-2e04b709e74a)] +interface nsIXPIDLPluginStreamInfo : nsISupports +{ + readonly attribute string contentType; + readonly attribute unsigned long lastModified; + readonly attribute unsigned long length; + readonly attribute wstring URL; + boolean isSeekable(); + void requestRead( in unsigned long count, + [array, size_is(count)] in long offsets, + [array, size_is(count)] in unsigned long lengths ); +}; diff --git a/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginStreamListener.idl b/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginStreamListener.idl new file mode 100644 index 00000000000..f29c6b4db23 --- /dev/null +++ b/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginStreamListener.idl @@ -0,0 +1,48 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsISupports.idl" + +#include "nsIXPIDLPluginStreamInfo.idl" +#include "nsIXPIDLInputStream.idl" + +#pragma prefix + +[scriptable, uuid(c26d873a-9a7d-48D2-8a52-e6d67eafd9c9)] +interface nsIXPIDLPluginStreamListener : nsISupports +{ + const unsigned long STREAM_TYPE_NORMAL = 1; + const unsigned long STREAM_TYPE_SEEK = 2; + const unsigned long STREAM_TYPE_AS_FILE = 3; + const unsigned long STREAM_TYPE_AS_FILE_ONLY = 4; + + readonly attribute unsigned long streamType; + + void onDataAvailable( in nsIXPIDLPluginStreamInfo streamInfo, + in nsIXPIDLInputStream input, + in unsigned long length ); + void onFileAvailable( in nsIXPIDLPluginStreamInfo streamInfo, + in wstring fileName ); + void onStartBinding( in nsIXPIDLPluginStreamInfo streamInfo ); + void onStopBinding( in nsIXPIDLPluginStreamInfo streamInfo, + in long status ); +}; diff --git a/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginTagInfo.idl b/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginTagInfo.idl new file mode 100644 index 00000000000..d62515e07d5 --- /dev/null +++ b/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginTagInfo.idl @@ -0,0 +1,34 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsISupports.idl" + +#pragma prefix + +[scriptable, uuid(b6506c8a-aaa7-4dd7-a3aa-cb3632f40a48)] +interface nsIXPIDLPluginTagInfo : nsISupports +{ + string getAttribute( in string name ); + void getAttributes( out unsigned long count, + [array, size_is(count)] out string names, + [array, size_is(count)] out string values ); +}; diff --git a/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginTagInfo2.idl b/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginTagInfo2.idl new file mode 100644 index 00000000000..1b531b5b24f --- /dev/null +++ b/mozilla/java/plugins/wrappers/public/nsIXPIDLPluginTagInfo2.idl @@ -0,0 +1,44 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Sun Microsystems, + * Inc. Portions created by Sun are + * Copyright (C) 1999 Sun Microsystems, Inc. All + * Rights Reserved. + * + * Contributor(s): + * Serge Pikalev + */ + +#include "nsIXPIDLPluginTagInfo.idl" + +#pragma prefix + +[scriptable, uuid(144542ea-52a5-466f-ac65-a34ecbd9966e)] +interface nsIXPIDLPluginTagInfo2 : nsIXPIDLPluginTagInfo +{ + readonly attribute string alignment; + string getParameter( in string name ); + void getParameters( out unsigned long count, + [array, size_is(count)] out string names, + [array, size_is(count)] out string values ); + readonly attribute unsigned long borderHorizSpace; + readonly attribute unsigned long borderVertSpace; + readonly attribute string documentBase; + readonly attribute string documentEncoding; + readonly attribute unsigned long height; + readonly attribute unsigned long width; + readonly attribute string tagText; + readonly attribute string tagType; + readonly attribute unsigned long uniqueID; +};