*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
This commit is contained in:
idk%eng.sun.com
2001-07-06 06:45:11 +00:00
parent 06d7c27a90
commit 544599af51
50 changed files with 3065 additions and 0 deletions

View File

@@ -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 <sep@sparc.spb.su>
#
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

View File

@@ -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 <sep@sparc.spb.su>
#
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

View File

@@ -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 <sep@sparc.spb.su>
*/
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;
}
}
}

View File

@@ -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 <sep@sparc.spb.su>
*/
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 );
}
}

View File

@@ -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 <sep@sparc.spb.su>
*/
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;
}
}

View File

@@ -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 <sep@sparc.spb.su>
*/
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;
}
}

View File

@@ -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 <sep@sparc.spb.su>
*/
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() );
}
}

View File

@@ -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 <sep@sparc.spb.su>
*/
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();
}
}

View File

@@ -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 <sep@sparc.spb.su>
*/
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 );
}
}

View File

@@ -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 <sep@sparc.spb.su>
*/
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 ) {
}
}

View File

@@ -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 <sep@sparc.spb.su>
*/
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;
}
}

View File

@@ -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 <sep@sparc.spb.su>
*/
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;
}
}

View File

@@ -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 <sep@sparc.spb.su>
*/
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;
}
}