Breaking out new plugin APIs into separate classes. Moving lib/plugin into a module.

This commit is contained in:
warren 1998-07-09 08:42:58 +00:00
Родитель 432b260fed
Коммит 51518f8b05
58 изменённых файлов: 12914 добавлений и 0 удалений

31
modules/plugin/Makefile Normal file
Просмотреть файл

@ -0,0 +1,31 @@
#//------------------------------------------------------------------------
#//
#// Makefile to build the MODULES/OJI tree
#//
#//------------------------------------------------------------------------
#//------------------------------------------------------------------------
#//
#// Specify the depth of the current directory relative to the
#// root of NS
#//
#//------------------------------------------------------------------------
DEPTH=../..
#//------------------------------------------------------------------------
#//
#// Specify any "command" targets. (ie. DIRS, INSTALL_FILES, ...)
#// (these must come before the common makefiles are included)
#//
#// DIRS - There are subdirectories to process
#//
#//------------------------------------------------------------------------
DIRS= public src
#//------------------------------------------------------------------------
#//
#// Include the common makefile rules
#//
#//------------------------------------------------------------------------
include $(DEPTH)/config/rules.mk

Просмотреть файл

@ -0,0 +1,41 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
#
# This is a list of local files which get copied to the mozilla:dist directory
#
nsIFileUtilities.h
nsIJRILiveConnectPlugin.h
nsIJRILiveConnectPluginInstancePeer.h
nsILiveConnectPlugin.h
nsILiveConnectPluginInstancePeer.h
nsIPlugin.h
nsIPluginInstance.h
nsIPluginInstancePeer.h
nsIPluginInstancePeer2.h
nsIPluginManager.h
nsIPluginManager2.h
nsIPluginStream.h
nsIPluginStreamPeer.h
nsIPluginStreamPeer2.h
nsIPluginTagInfo.h
nsIPluginTagInfo2.h
nsISeekablePluginStreamPeer.h
nsIWindowlessPluginInstancePeer.h
nsplugin.h
nsplugindefs.h

Просмотреть файл

@ -0,0 +1,44 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
DEPTH = ../../..
MODULE = plugin
EXPORTS = \
nsIFileUtilities.h \
nsIJRILiveConnectPlugin.h \
nsIJRILiveConnectPluginInstancePeer.h \
nsILiveConnectPlugin.h \
nsILiveConnectPluginInstancePeer.h \
nsIPlugin.h \
nsIPluginInstance.h \
nsIPluginInstancePeer.h \
nsIPluginInstancePeer2.h \
nsIPluginManager.h \
nsIPluginManager2.h \
nsIPluginStream.h \
nsIPluginStreamPeer.h \
nsIPluginStreamPeer2.h \
nsIPluginTagInfo.h \
nsIPluginTagInfo2.h \
nsISeekablePluginStreamPeer.h \
nsIWindowlessPluginInstancePeer.h \
nsplugin.h \
nsplugindefs.h
include $(DEPTH)/config/rules.mk

Просмотреть файл

@ -0,0 +1,47 @@
#!gmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
IGNORE_MANIFEST=1
DEPTH = ..\..\..
MODULE = plugin
EXPORTS = \
nsIFileUtilities.h \
nsIJRILiveConnectPlugin.h \
nsIJRILiveConnectPluginInstancePeer.h \
nsILiveConnectPlugin.h \
nsILiveConnectPluginInstancePeer.h \
nsIPlugin.h \
nsIPluginInstance.h \
nsIPluginInstancePeer.h \
nsIPluginInstancePeer2.h \
nsIPluginManager.h \
nsIPluginManager2.h \
nsIPluginStream.h \
nsIPluginStreamPeer.h \
nsIPluginStreamPeer2.h \
nsIPluginTagInfo.h \
nsIPluginTagInfo2.h \
nsISeekablePluginStreamPeer.h \
nsIWindowlessPluginInstancePeer.h \
nsplugin.h \
nsplugindefs.h
include <$(DEPTH)/config/rules.mak>

Просмотреть файл

@ -0,0 +1,75 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIFileUtilities_h___
#define nsIFileUtilities_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// File Utilities Interface
// This interface reflects operations only available in Communicator 5.0.
class nsIFileUtilities : public nsISupports {
public:
// QueryInterface on nsIPluginManager to get this.
NS_IMETHOD_(const char*)
GetProgramPath(void) = 0;
NS_IMETHOD_(const char*)
GetTempDirPath(void) = 0;
enum FileNameType { SIGNED_APPLET_DBNAME, TEMP_FILENAME };
NS_IMETHOD_(nsresult)
GetFileName(const char* fn, FileNameType type,
char* resultBuf, PRUint32 bufLen) = 0;
NS_IMETHOD_(nsresult)
NewTempFileName(const char* prefix, char* resultBuf, PRUint32 bufLen) = 0;
};
#define NS_IFILEUTILITIES_IID \
{ /* 89a31ce0-019a-11d2-815b-006008119d7a */ \
0x89a31ce0, \
0x019a, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIFileUtilities_h___ */

Просмотреть файл

@ -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 Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIJRILiveConnectPlugin_h__
#define nsIJRILiveConnectPlugin_h__
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// JRI-Based LiveConnect Classes
////////////////////////////////////////////////////////////////////////////////
//
// This stuff is here so that the browser can support older JRI-based
// LiveConnected plugins (when using old plugin to new C++-style plugin
// adapter code).
//
// Warning: Don't use this anymore, unless you're sure that you have to!
////////////////////////////////////////////////////////////////////////////////
#include "jri.h" // ancient
////////////////////////////////////////////////////////////////////////////////
// JRILiveConnect Plugin Interface
// This interface defines additional entry points that a plugin developer needs
// to implement in order for the plugin to support JRI-based LiveConnect,
// i.e. be scriptable by Java or JavaScript.
class nsIJRILiveConnectPlugin : public nsIPlugin {
public:
// (Corresponds to NPP_GetJavaClass.)
NS_IMETHOD_(jref)
GetJavaClass(void) = 0;
};
#define NS_IJRILIVECONNECTPLUGIN_IID \
{ /* c94058e0-f772-11d1-815b-006008119d7a */ \
0xc94058e0, \
0xf772, \
0x11d1, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIJRILiveConnectPlugin_h__ */

Просмотреть файл

Просмотреть файл

@ -0,0 +1,65 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsILiveConnectPlugin_h__
#define nsILiveConnectPlugin_h__
#include "nsplugindefs.h"
#include "jni.h" // standard JVM API
////////////////////////////////////////////////////////////////////////////////
// LiveConnect Plugin Interface
// This interface defines additional entry points that a plugin developer needs
// to implement in order for the plugin to support JNI-based LiveConnect,
// i.e. be scriptable by Java or JavaScript.
class nsILiveConnectPlugin : public nsIPlugin {
public:
// (New JNI-based entry point, roughly corresponds to NPP_GetJavaClass.)
NS_IMETHOD_(jclass)
GetJavaClass(void) = 0;
};
#define NS_ILIVECONNECTPLUGIN_IID \
{ /* cf134df0-a1bc-11d1-85b1-00805f0e4dfe */ \
0xcf134df0, \
0xa1bc, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsILiveConnectPlugin_h__ */

Просмотреть файл

Просмотреть файл

@ -0,0 +1,97 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPlugin_h___
#define nsIPlugin_h___
#include "nsplugindefs.h"
#include "nsIFactory.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Interface
// This is the minimum interface plugin developers need to support in order to
// implement a plugin. The plugin manager may QueryInterface for more specific
// plugin types, e.g. nsILiveConnectPlugin.
struct nsIPlugin : public nsIFactory {
public:
// This call initializes the plugin and will be called before any new
// instances are created. It is passed browserInterfaces on which QueryInterface
// may be used to obtain an nsIPluginManager, and other interfaces.
NS_IMETHOD_(nsPluginError)
Initialize(nsISupports* browserInterfaces) = 0;
// (Corresponds to NPP_Shutdown.)
// Called when the browser is done with the plugin factory, or when
// the plugin is disabled by the user.
NS_IMETHOD_(nsPluginError)
Shutdown(void) = 0;
// (Corresponds to NPP_GetMIMEDescription.)
NS_IMETHOD_(const char*)
GetMIMEDescription(void) = 0;
// (Corresponds to NPP_GetValue.)
NS_IMETHOD_(nsPluginError)
GetValue(nsPluginVariable variable, void *value) = 0;
// (Corresponds to NPP_SetValue.)
NS_IMETHOD_(nsPluginError)
SetValue(nsPluginVariable variable, void *value) = 0;
// The old NPP_New call has been factored into two plugin instance methods:
//
// CreateInstance -- called once, after the plugin instance is created. This
// method is used to initialize the new plugin instance (although the actual
// plugin instance object will be created by the plugin manager).
//
// nsIPluginInstance::Start -- called when the plugin instance is to be
// started. This happens in two circumstances: (1) after the plugin instance
// is first initialized, and (2) after a plugin instance is returned to
// (e.g. by going back in the window history) after previously being stopped
// by the Stop method.
};
#define NS_IPLUGIN_IID \
{ /* df773070-0199-11d2-815b-006008119d7a */ \
0xdf773070, \
0x0199, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPlugin_h___ */

Просмотреть файл

@ -0,0 +1,111 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPluginInstance_h___
#define nsIPluginInstance_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Instance Interface
// (Corresponds to NPP object.)
class nsIPluginInstance : public nsISupports {
public:
NS_IMETHOD_(nsPluginError)
Initialize(nsIPluginInstancePeer* peer) = 0;
// Required backpointer to the peer.
NS_IMETHOD_(nsIPluginInstancePeer*)
GetPeer(void) = 0;
// See comment for nsIPlugin::CreateInstance, above.
NS_IMETHOD_(nsPluginError)
Start(void) = 0;
// The old NPP_Destroy call has been factored into two plugin instance
// methods:
//
// Stop -- called when the plugin instance is to be stopped (e.g. by
// displaying another plugin manager window, causing the page containing
// the plugin to become removed from the display).
//
// Release -- called once, before the plugin instance peer is to be
// destroyed. This method is used to destroy the plugin instance.
NS_IMETHOD_(nsPluginError)
Stop(void) = 0;
NS_IMETHOD_(nsPluginError)
Destroy(void) = 0;
// (Corresponds to NPP_SetWindow.)
NS_IMETHOD_(nsPluginError)
SetWindow(nsPluginWindow* window) = 0;
// (Corresponds to NPP_NewStream.)
NS_IMETHOD_(nsPluginError)
NewStream(nsIPluginStreamPeer* peer, nsIPluginStream* *result) = 0;
// (Corresponds to NPP_Print.)
NS_IMETHOD_(void)
Print(nsPluginPrint* platformPrint) = 0;
// (Corresponds to NPP_HandleEvent.)
// Note that for Unix and Mac the nsPluginEvent structure is different
// from the old NPEvent structure -- it's no longer the native event
// record, but is instead a struct. This was done for future extensibility,
// and so that the Mac could receive the window argument too. For Windows
// and OS2, it's always been a struct, so there's no change for them.
NS_IMETHOD_(PRInt16)
HandleEvent(nsPluginEvent* event) = 0;
// (Corresponds to NPP_URLNotify.)
NS_IMETHOD_(void)
URLNotify(const char* url, const char* target,
nsPluginReason reason, void* notifyData) = 0;
};
#define NS_IPLUGININSTANCE_IID \
{ /* ebe00f40-0199-11d2-815b-006008119d7a */ \
0xebe00f40, \
0x0199, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPluginInstance_h___ */

Просмотреть файл

@ -0,0 +1,80 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPluginInstancePeer_h___
#define nsIPluginInstancePeer_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Instance Peer Interface
enum nsPluginTagType {
nsPluginTagType_Unknown,
nsPluginTagType_Embed,
nsPluginTagType_Object,
nsPluginTagType_Applet
};
class nsIPluginInstancePeer : public nsISupports {
public:
// (Corresponds to NPP_New's MIMEType argument.)
NS_IMETHOD_(nsMIMEType)
GetMIMEType(void) = 0;
// (Corresponds to NPP_New's mode argument.)
NS_IMETHOD_(nsPluginType)
GetMode(void) = 0;
// (Corresponds to NPN_NewStream.)
NS_IMETHOD_(nsPluginError)
NewStream(nsMIMEType type, const char* target, nsIOutputStream* *result) = 0;
// (Corresponds to NPN_Status.)
NS_IMETHOD_(void)
ShowStatus(const char* message) = 0;
};
#define NS_IPLUGININSTANCEPEER_IID \
{ /* 4b7cea20-019b-11d2-815b-006008119d7a */ \
0x4b7cea20, \
0x019b, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPluginInstancePeer_h___ */

Просмотреть файл

Просмотреть файл

@ -0,0 +1,128 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPluginManager_h___
#define nsIPluginManager_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Manager Interface
// This interface defines the minimum set of functionality that a plugin
// manager will support if it implements plugins. Plugin implementations can
// QueryInterface to determine if a plugin manager implements more specific
// APIs for the plugin to use.
class nsIPluginManager : public nsISupports {
public:
// (Corresponds to NPN_ReloadPlugins.)
NS_IMETHOD_(void)
ReloadPlugins(PRBool reloadPages) = 0;
// (Corresponds to NPN_MemAlloc.)
NS_IMETHOD_(void*)
MemAlloc(PRUint32 size) = 0;
// (Corresponds to NPN_MemFree.)
NS_IMETHOD_(void)
MemFree(void* ptr) = 0;
// (Corresponds to NPN_MemFlush.)
NS_IMETHOD_(PRUint32)
MemFlush(PRUint32 size) = 0;
// (Corresponds to NPN_UserAgent.)
NS_IMETHOD_(const char*)
UserAgent(void) = 0;
// (Corresponds to NPN_GetValue.)
NS_IMETHOD_(nsPluginError)
GetValue(nsPluginManagerVariable variable, void *value) = 0;
// (Corresponds to NPN_SetValue.)
NS_IMETHOD_(nsPluginError)
SetValue(nsPluginManagerVariable variable, void *value) = 0;
// (Corresponds to NPN_GetURL and NPN_GetURLNotify.)
// notifyData: When present, URLNotify is called passing the notifyData back
// to the client. When NULL, this call behaves like NPN_GetURL.
// New arguments:
// peer: A plugin instance peer. The peer's window will be used to display
// progress information. If NULL, the load happens in the background.
// altHost: An IP-address string that will be used instead of the host
// specified in the URL. This is used to prevent DNS-spoofing attacks.
// Can be defaulted to NULL meaning use the host in the URL.
// referrer:
// forceJSEnabled: Forces JavaScript to be enabled for 'javascript:' URLs,
// even if the user currently has JavaScript disabled.
NS_IMETHOD_(nsPluginError)
GetURL(nsISupports* peer, const char* url, const char* target, void* notifyData = NULL,
const char* altHost = NULL, const char* referrer = NULL,
PRBool forceJSEnabled = PR_FALSE) = 0;
// (Corresponds to NPN_PostURL and NPN_PostURLNotify.)
// notifyData: When present, URLNotify is called passing the notifyData back
// to the client. When NULL, this call behaves like NPN_GetURL.
// New arguments:
// peer: A plugin instance peer. The peer's window will be used to display
// progress information. If NULL, the load happens in the background.
// altHost: An IP-address string that will be used instead of the host
// specified in the URL. This is used to prevent DNS-spoofing attacks.
// Can be defaulted to NULL meaning use the host in the URL.
// referrer:
// forceJSEnabled: Forces JavaScript to be enabled for 'javascript:' URLs,
// even if the user currently has JavaScript disabled.
// postHeaders: A string containing post headers.
// postHeadersLength: The length of the post headers string.
NS_IMETHOD_(nsPluginError)
PostURL(nsISupports* peer, const char* url, const char* target, PRUint32 bufLen,
const char* buf, PRBool file, void* notifyData = NULL,
const char* altHost = NULL, const char* referrer = NULL,
PRBool forceJSEnabled = PR_FALSE,
PRUint32 postHeadersLength = 0, const char* postHeaders = NULL) = 0;
};
#define NS_IPLUGINMANAGER_IID \
{ /* f10b9600-a1bc-11d1-85b1-00805f0e4dfe */ \
0xf10b9600, \
0xa1bc, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPluginManager_h___ */

Просмотреть файл

@ -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 Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPluginManager2_h___
#define nsIPluginManager2_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Manager 2 Interface
// These extensions to nsIPluginManager are only available in Communicator 5.0.
class nsIPluginManager2 : public nsIPluginManager {
public:
NS_IMETHOD_(void)
BeginWaitCursor(void) = 0;
NS_IMETHOD_(void)
EndWaitCursor(void) = 0;
NS_IMETHOD_(PRBool)
SupportsURLProtocol(const char* protocol) = 0;
};
#define NS_IPLUGINMANAGER2_IID \
{ /* 29c4ae70-019a-11d2-815b-006008119d7a */ \
0x29c4ae70, \
0x019a, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPluginManager2_h___ */

Просмотреть файл

@ -0,0 +1,66 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPluginStream_h___
#define nsIPluginStream_h___
#include "nsplugindefs.h"
#include "nsIOutputStream.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Stream Interface
class nsIPluginStream : public nsIOutputStream {
public:
// (Corresponds to NPP_NewStream's stype return parameter.)
NS_IMETHOD_(NPStreamType)
GetStreamType(void) = 0;
// (Corresponds to NPP_StreamAsFile.)
NS_IMETHOD_(void)
AsFile(const char* fname) = 0;
};
#define NS_IPLUGINSTREAM_IID \
{ /* f287dd50-0199-11d2-815b-006008119d7a */ \
0xf287dd50, \
0x0199, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPluginStream_h___ */

Просмотреть файл

@ -0,0 +1,84 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPluginStreamPeer_h___
#define nsIPluginStreamPeer_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Stream Peer Interface
// A plugin stream peer is passed to a plugin instance's NewStream call in
// order to indicate that a new stream is to be created and be read by the
// plugin instance.
class nsIPluginStreamPeer : public nsISupports {
public:
// (Corresponds to NPStream's url field.)
NS_IMETHOD_(const char*)
GetURL(void) = 0;
// (Corresponds to NPStream's end field.)
NS_IMETHOD_(PRUint32)
GetEnd(void) = 0;
// (Corresponds to NPStream's lastmodified field.)
NS_IMETHOD_(PRUint32)
GetLastModified(void) = 0;
// (Corresponds to NPStream's notifyData field.)
NS_IMETHOD_(void*)
GetNotifyData(void) = 0;
// (Corresponds to NPP_DestroyStream's reason argument.)
NS_IMETHOD_(nsPluginReason)
GetReason(void) = 0;
// (Corresponds to NPP_NewStream's MIMEType argument.)
NS_IMETHOD_(nsMIMEType)
GetMIMEType(void) = 0;
};
#define NS_IPLUGINSTREAMPEER_IID \
{ /* 717b1e90-019b-11d2-815b-006008119d7a */ \
0x717b1e90, \
0x019b, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPluginStreamPeer_h___ */

Просмотреть файл

@ -0,0 +1,70 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPluginStreamPeer2_h___
#define nsIPluginStreamPeer2_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Stream Peer Interface
// These extensions to nsIPluginStreamPeer are only available in Communicator 5.0.
class nsIPluginStreamPeer2 : public nsIPluginStreamPeer {
public:
NS_IMETHOD_(PRUint32)
GetContentLength(void) = 0;
NS_IMETHOD_(PRUint32)
GetHeaderFieldCount(void) = 0;
NS_IMETHOD_(const char*)
GetHeaderFieldKey(PRUint32 index) = 0;
NS_IMETHOD_(const char*)
GetHeaderField(PRUint32 index) = 0;
};
#define NS_IPLUGINSTREAMPEER2_IID \
{ /* 77083af0-019b-11d2-815b-006008119d7a */ \
0x77083af0, \
0x019b, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPluginStreamPeer2_h___ */

Просмотреть файл

@ -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 Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPluginTagInfo_h___
#define nsIPluginTagInfo_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Tag Info Interface
// This interface provides information about the HTML tag on the page.
// Some day this might get superseded by a DOM API.
class nsIPluginTagInfo : public nsISupports {
public:
// QueryInterface on nsIPluginInstancePeer to get this.
// (Corresponds to NPP_New's argc, argn, and argv arguments.)
// Get a ptr to the paired list of attribute names and values,
// returns the length of the array.
//
// Each name or value is a null-terminated string.
NS_IMETHOD_(nsPluginError)
GetAttributes(PRUint16& n, const char*const*& names, const char*const*& values) = 0;
// Get the value for the named attribute. Returns NULL
// if the attribute was not set.
NS_IMETHOD_(const char*)
GetAttribute(const char* name) = 0;
};
#define NS_IPLUGINTAGINFO_IID \
{ /* 5f1ec1d0-019b-11d2-815b-006008119d7a */ \
0x5f1ec1d0, \
0x019b, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPluginTagInfo_h___ */

Просмотреть файл

@ -0,0 +1,110 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPluginTagInfo2_h___
#define nsIPluginTagInfo2_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Tag Info Interface
// These extensions to nsIPluginTagInfo are only available in Communicator 5.0.
class nsIPluginTagInfo2 : public nsIPluginTagInfo {
public:
// QueryInterface on nsIPluginInstancePeer to get this.
// Get the type of the HTML tag that was used ot instantiate this
// plugin. Currently supported tags are EMBED, OBJECT and APPLET.
NS_IMETHOD_(nsPluginTagType)
GetTagType(void) = 0;
// Get the complete text of the HTML tag that was
// used to instantiate this plugin
NS_IMETHOD_(const char *)
GetTagText(void) = 0;
// Get a ptr to the paired list of parameter names and values,
// returns the length of the array.
//
// Each name or value is a null-terminated string.
NS_IMETHOD_(nsPluginError)
GetParameters(PRUint16& n, const char*const*& names, const char*const*& values) = 0;
// Get the value for the named parameter. Returns null
// if the parameter was not set.
NS_IMETHOD_(const char*)
GetParameter(const char* name) = 0;
NS_IMETHOD_(const char*)
GetDocumentBase(void) = 0;
// Return an encoding whose name is specified in:
// http://java.sun.com/products/jdk/1.1/docs/guide/intl/intl.doc.html#25303
NS_IMETHOD_(const char*)
GetDocumentEncoding(void) = 0;
NS_IMETHOD_(const char*)
GetAlignment(void) = 0;
NS_IMETHOD_(PRUint32)
GetWidth(void) = 0;
NS_IMETHOD_(PRUint32)
GetHeight(void) = 0;
NS_IMETHOD_(PRUint32)
GetBorderVertSpace(void) = 0;
NS_IMETHOD_(PRUint32)
GetBorderHorizSpace(void) = 0;
// Returns a unique id for the current document on which the
// plugin is displayed.
NS_IMETHOD_(PRUint32)
GetUniqueID(void) = 0;
};
#define NS_IPLUGINTAGINFO2_IID \
{ /* 6a49c9a0-019b-11d2-815b-006008119d7a */ \
0x6a49c9a0, \
0x019b, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPluginTagInfo2_h___ */

Просмотреть файл

@ -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 Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsISeekablePluginStreamPeer_h___
#define nsISeekablePluginStreamPeer_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// Seekable Plugin Stream Peer Interface
// The browser implements this subclass of plugin stream peer if a stream
// is seekable. Plugins can query interface for this type, and call the
// RequestRead method to seek to a particular position in the stream.
class nsISeekablePluginStreamPeer : public nsISupports {
public:
// QueryInterface for this class corresponds to NPP_NewStream's
// seekable argument.
// (Corresponds to NPN_RequestRead.)
NS_IMETHOD_(nsPluginError)
RequestRead(nsByteRange* rangeList) = 0;
};
#define NS_ISEEKABLEPLUGINSTREAMPEER_IID \
{ /* 7e028d20-019b-11d2-815b-006008119d7a */ \
0x7e028d20, \
0x019b, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsISeekablePluginStreamPeer_h___ */

Просмотреть файл

Просмотреть файл

@ -0,0 +1,238 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>This is the master header file that includes most of the other headers
* you'll need to write a plugin.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* The following diagram depicts the relationships between various objects
* implementing the new plugin interfaces. QueryInterface can be used to switch
* between interfaces in the same box:
*
*
* the plugin (only 1)
* +----------------------+
* | nsIPlugin or |<- - - - - -NSGetFactory()
* | nsILiveConnectPlugin |
* +----------------------+
* |
* |
* | instances (many) streams to receive URL data (many)
* | +-------------------+ +-----------------+
* | | nsIPluginInstance |+ | nsIPluginStream |+
* | | || | ||
* | +-------------------+| +-----------------+|
* | +------|-----------+ +------|---------+
* | | |
* | PLUGIN SIDE |peer |peer
*~~~~|~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~
* | BROWSER SIDE | |
* | v v
* | +---------------------------------+ +----------------------------+
* | | nsIPluginInstancePeer |+ | nsIPluginStreamPeer |+
* | | nsIPluginInstancePeer2 || | nsISeekablePluginStreamPeer||
* | | nsIWindowlessPluginInstancePeer || | nsIPluginstreamPeer2 ||
* | | nsILiveConnectPluginInstancePeer|| +----------------------------+|
* | | nsIPluginTagInfo || +---------------------------+
* | | nsIPluginTagInfo2 ||
* | +---------------------------------+|
* | +--------------------------------+
* |
* |
* v the browser (only 1)
* +---------------------+
* | nsIPluginManager |
* | nsIPluginManager2 |
* | nsIFileUtilities |
* | nsIPref |
* | nsICacheManager ... |
* +---------------------+
*
*/
#ifndef nsplugins_h___
#define nsplugins_h___
#include "nsRepository.h" // for NSGetFactory
////////////////////////////////////////////////////////////////////////////////
/**
* <B>Interfaces which must be implemented by a plugin</B>
* These interfaces have NPP equivalents in pre-5.0 browsers (see npapi.h).
*/
////////////////////////////////////////////////////////////////////////////////
/**
* NSGetFactory is the main entry point to the plugin's DLL. The plugin manager
* finds this symbol and calls it to create the plugin class. Once the plugin
* object is returned to the plugin manager, instances on the page are created
* by calling nsIPlugin::CreateInstance.
*/
// (Declared in nsRepository.h)
//extern "C" NS_EXPORT nsresult NSGetFactory(const nsCID &aClass,
// nsIFactory **aFactory);
/**
* A plugin object is used to create new plugin instances. It manages the
* global state of all plugins with the same implementation.
*/
#include "nsIPlugin.h"
/**
* A plugin instance represents a particular activation of a plugin on a page.
*/
#include "nsIPluginInstance.h"
/**
* A plugin stream gets instantiated when a plugin instance receives data from
* the browser.
*/
#include "nsIPluginStream.h"
/**
* The nsILiveConnectPlugin interface provides additional operations that a
* plugin must implement if it is to be controlled by JavaScript through
* LiveConnect.
*
* Note that this interface is part of a new JNI-based LiveConnect
* implementation and superceeds that provided prior to Communicator 5.0.
*/
#include "nsILiveConnectPlugin.h"
////////////////////////////////////////////////////////////////////////////////
/**
* <B>Interfaces implemented by the browser:
* These interfaces have NPN equivalents in pre-5.0 browsers (see npapi.h).
*/
////////////////////////////////////////////////////////////////////////////////
/**
* The plugin manager which is the main point of interaction with the browser
* and provides general operations needed by a plugin.
*/
#include "nsIPluginManager.h"
/**
* A plugin instance peer gets created by the browser and associated with each
* plugin instance to represent tag information and other callbacks needed by
* the plugin instance.
*/
#include "nsIPluginInstancePeer.h"
/**
* The nsIPluginTagInfo interface provides information about the html tag
* that was used to instantiate the plugin instance.
*
* To obtain: QueryInterface on nsIPluginInstancePeer
*/
#include "nsIPluginTagInfo.h"
/**
* The nsIWindowlessPluginInstancePeer provides additional operations for
* windowless plugins.
*
* To obtain: QueryInterface on nsIPluginInstancePeer
*/
#include "nsIWindowlessPluginInstancePeer.h"
/**
* A plugin stream peer gets create by the browser and associated with each
* plugin stream to represent stream and URL information, and provides
* other callbacks needed by the plugin stream.
*/
#include "nsIPluginStreamPeer.h"
/**
* The nsISeekablePluginStreamPeer provides additional operations for seekable
* plugin streams.
*
* To obtain: QueryInterface on nsIPluginStreamPeer
*/
#include "nsISeekablePluginStreamPeer.h"
////////////////////////////////////////////////////////////////////////////////
/**
* <B>Interfaces implemented by the browser (new for 5.0):
*/
////////////////////////////////////////////////////////////////////////////////
/**
* The nsIPluginManager2 interface provides additional plugin manager features
* only available in Communicator 5.0.
*
* To obtain: QueryInterface on nsIPluginManager
*/
#include "nsIPluginManager2.h"
/**
* The nsIFileUtilities interface provides operations to manage temporary
* files and directories.
*
* To obtain: QueryInterface on nsIPluginManager
*/
#include "nsIFileUtilities.h"
/**
* The nsIPluginInstancePeer2 interface provides additional plugin instance
* peer features only available in Communicator 5.0.
*
* To obtain: QueryInterface on nsIPluginInstancePeer
*/
#include "nsIPluginInstancePeer2.h"
/**
* The nsILiveConnectPluginInstancePeer allows plugins to be manipulated
* by JavaScript, providing basic scriptability.
*
* Note that this interface is part of a new JNI-based LiveConnect
* implementation and superceeds that provided prior to Communicator 5.0.
*
* To obtain: QueryInterface on nsIPluginInstancePeer
*/
#include "nsILiveConnectPluginInstancePeer.h"
/**
* The nsIPluginStreamPeer2 interface provides additional plugin stream
* peer features only available in Communicator 5.0.
*
* To obtain: QueryInterface on nsIPluginStreamPeer
*/
#include "nsIPluginStreamPeer2.h"
/**
* The nsIPluginTagInfo2 interface provides additional html tag information
* only available in Communicator 5.0.
*
* To obtain: QueryInterface on nsIPluginTagInfo
*/
#include "nsIPluginTagInfo2.h"
////////////////////////////////////////////////////////////////////////////////
#endif // nsplugins_h___

Просмотреть файл

@ -0,0 +1,365 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsplugindefs_h___
#define nsplugindefs_h___
#ifdef __OS2__
#pragma pack(1)
#endif
#ifdef XP_MAC
#include <Quickdraw.h>
#include <Events.h>
#endif
#ifdef XP_UNIX
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#endif
#ifdef XP_PC
#include <windef.h>
#endif
////////////////////////////////////////////////////////////////////////////////
/* The OS/2 version of Netscape uses RC_DATA to define the
mime types, file extentions, etc that are required.
Use a vertical bar to seperate types, end types with \0.
FileVersion and ProductVersion are 32bit ints, all other
entries are strings the MUST be terminated wwith a \0.
AN EXAMPLE:
RCDATA NS_INFO_ProductVersion { 1,0,0,1,}
RCDATA NS_INFO_MIMEType { "video/x-video|",
"video/x-flick\0" }
RCDATA NS_INFO_FileExtents { "avi|",
"flc\0" }
RCDATA NS_INFO_FileOpenName{ "MMOS2 video player(*.avi)|",
"MMOS2 Flc/Fli player(*.flc)\0" }
RCDATA NS_INFO_FileVersion { 1,0,0,1 }
RCDATA NS_INFO_CompanyName { "Netscape Communications\0" }
RCDATA NS_INFO_FileDescription { "NPAVI32 Extension DLL\0"
RCDATA NS_INFO_InternalName { "NPAVI32\0" )
RCDATA NS_INFO_LegalCopyright { "Copyright Netscape Communications \251 1996\0"
RCDATA NS_INFO_OriginalFilename { "NVAPI32.DLL" }
RCDATA NS_INFO_ProductName { "NPAVI32 Dynamic Link Library\0" }
*/
/* RC_DATA types for version info - required */
#define NS_INFO_ProductVersion 1
#define NS_INFO_MIMEType 2
#define NS_INFO_FileOpenName 3
#define NS_INFO_FileExtents 4
/* RC_DATA types for version info - used if found */
#define NS_INFO_FileDescription 5
#define NS_INFO_ProductName 6
/* RC_DATA types for version info - optional */
#define NS_INFO_CompanyName 7
#define NS_INFO_FileVersion 8
#define NS_INFO_InternalName 9
#define NS_INFO_LegalCopyright 10
#define NS_INFO_OriginalFilename 11
#ifndef RC_INVOKED
////////////////////////////////////////////////////////////////////////////////
// Structures and definitions
#ifdef XP_MAC
#pragma options align=mac68k
#endif
typedef const char* nsMIMEType;
struct nsByteRange {
PRInt32 offset; /* negative offset means from the end */
PRUint32 length;
struct nsByteRange* next;
};
struct nsRect {
PRUint16 top;
PRUint16 left;
PRUint16 bottom;
PRUint16 right;
};
////////////////////////////////////////////////////////////////////////////////
// Unix specific structures and definitions
#ifdef XP_UNIX
#include <stdio.h>
/*
* Callback Structures.
*
* These are used to pass additional platform specific information.
*/
enum nsPluginCallbackType {
nsPluginCallbackType_SetWindow = 1,
nsPluginCallbackType_Print
};
struct nsPluginAnyCallbackStruct {
PRInt32 type;
};
struct nsPluginSetWindowCallbackStruct {
PRInt32 type;
Display* display;
Visual* visual;
Colormap colormap;
PRUint32 depth;
};
struct nsPluginPrintCallbackStruct {
PRInt32 type;
FILE* fp;
};
#endif /* XP_UNIX */
////////////////////////////////////////////////////////////////////////////////
// List of variable names for which NPP_GetValue shall be implemented
enum nsPluginVariable {
nsPluginVariable_NameString = 1,
nsPluginVariable_DescriptionString,
nsPluginVariable_WindowBool, // XXX go away
nsPluginVariable_TransparentBool, // XXX go away?
nsPluginVariable_JavaClass, // XXX go away
nsPluginVariable_WindowSize,
nsPluginVariable_TimerInterval
// XXX add MIMEDescription (for unix) (but GetValue is on the instance, not the class)
};
// List of variable names for which NPN_GetValue is implemented by Mozilla
enum nsPluginManagerVariable {
nsPluginManagerVariable_XDisplay = 1,
nsPluginManagerVariable_XtAppContext,
nsPluginManagerVariable_NetscapeWindow,
nsPluginManagerVariable_JavascriptEnabledBool, // XXX prefs accessor api
nsPluginManagerVariable_ASDEnabledBool, // XXX prefs accessor api
nsPluginManagerVariable_IsOfflineBool // XXX prefs accessor api
};
////////////////////////////////////////////////////////////////////////////////
enum nsPluginType {
nsPluginType_Embedded = 1,
nsPluginType_Full
};
// XXX this can go away now
enum NPStreamType {
NPStreamType_Normal = 1,
NPStreamType_Seek,
NPStreamType_AsFile,
NPStreamType_AsFileOnly
};
#define NP_STREAM_MAXREADY (((unsigned)(~0)<<1)>>1)
/*
* The type of a NPWindow - it specifies the type of the data structure
* returned in the window field.
*/
enum nsPluginWindowType {
nsPluginWindowType_Window = 1,
nsPluginWindowType_Drawable
};
struct nsPluginWindow {
void* window; /* Platform specific window handle */
/* OS/2: x - Position of bottom left corner */
/* OS/2: y - relative to visible netscape window */
PRUint32 x; /* Position of top left corner relative */
PRUint32 y; /* to a netscape page. */
PRUint32 width; /* Maximum window size */
PRUint32 height;
nsRect clipRect; /* Clipping rectangle in port coordinates */
/* Used by MAC only. */
#ifdef XP_UNIX
void* ws_info; /* Platform-dependent additonal data */
#endif /* XP_UNIX */
nsPluginWindowType type; /* Is this a window or a drawable? */
};
struct nsPluginFullPrint {
PRBool pluginPrinted; /* Set TRUE if plugin handled fullscreen */
/* printing */
PRBool printOne; /* TRUE if plugin should print one copy */
/* to default printer */
void* platformPrint; /* Platform-specific printing info */
};
struct nsPluginEmbedPrint {
nsPluginWindow window;
void* platformPrint; /* Platform-specific printing info */
};
struct nsPluginPrint {
nsPluginType mode; /* NP_FULL or nsPluginType_Embedded */
union
{
nsPluginFullPrint fullPrint; /* if mode is NP_FULL */
nsPluginEmbedPrint embedPrint; /* if mode is nsPluginType_Embedded */
} print;
};
struct nsPluginEvent {
#if defined(XP_MAC)
EventRecord* event;
void* window;
#elif defined(XP_PC)
uint16 event;
uint32 wParam;
uint32 lParam;
#elif defined(XP_OS2)
uint32 event;
uint32 wParam;
uint32 lParam;
#elif defined(XP_UNIX)
XEvent event;
#endif
};
#ifdef XP_MAC
typedef RgnHandle nsRegion;
#elif defined(XP_PC)
typedef HRGN nsRegion;
#elif defined(XP_UNIX)
typedef Region nsRegion;
#else
typedef void *nsRegion;
#endif
////////////////////////////////////////////////////////////////////////////////
// Mac-specific structures and definitions.
#ifdef XP_MAC
struct NPPort {
CGrafPtr port; /* Grafport */
PRInt32 portx; /* position inside the topmost window */
PRInt32 porty;
};
/*
* Non-standard event types that can be passed to HandleEvent
*/
#define getFocusEvent (osEvt + 16)
#define loseFocusEvent (osEvt + 17)
#define adjustCursorEvent (osEvt + 18)
#define menuCommandEvent (osEvt + 19)
#endif /* XP_MAC */
////////////////////////////////////////////////////////////////////////////////
// Error and Reason Code definitions
enum nsPluginError {
nsPluginError_Base = 0,
nsPluginError_NoError = 0,
nsPluginError_GenericError,
nsPluginError_InvalidInstanceError,
nsPluginError_InvalidFunctableError,
nsPluginError_ModuleLoadFailedError,
nsPluginError_OutOfMemoryError,
nsPluginError_InvalidPluginError,
nsPluginError_InvalidPluginDirError,
nsPluginError_IncompatibleVersionError,
nsPluginError_InvalidParam,
nsPluginError_InvalidUrl,
nsPluginError_FileNotFound,
nsPluginError_NoData,
nsPluginError_StreamNotSeekable
};
#define NPCallFailed( code ) ((code) != nsPluginError_NoError)
enum nsPluginReason {
nsPluginReason_Base = 0,
nsPluginReason_Done = 0,
nsPluginReason_NetworkErr,
nsPluginReason_UserBreak,
nsPluginReason_NoReason
};
////////////////////////////////////////////////////////////////////////////////
// Classes
////////////////////////////////////////////////////////////////////////////////
// Classes that must be implemented by the plugin DLL:
struct nsIPlugin; // plugin class (MIME-type handler)
class nsILiveConnectPlugin; // subclass of nsIPlugin
class nsIPluginInstance; // plugin instance
class nsIPluginStream; // stream to receive data from the browser
// Classes that are implemented by the browser:
class nsIPluginManager; // minimum browser requirements
class nsIFileUtilities; // file utilities (accessible from nsIPluginManager)
class nsIPluginInstancePeer; // parts of nsIPluginInstance implemented by the browser
class nsIWindowlessPluginInstancePeer; // subclass of nsIPluginInstancePeer for windowless plugins
class nsIPluginTagInfo; // describes html tag (accessible from nsIPluginInstancePeer)
class nsILiveConnectPluginInstancePeer; // subclass of nsIPluginInstancePeer
class nsIPluginStreamPeer; // parts of nsIPluginStream implemented by the browser
class nsISeekablePluginStreamPeer; // seekable subclass of nsIPluginStreamPeer
////////////////////////////////////////////////////////////////////////////////
#ifdef XP_MAC
#pragma options align=reset
#endif
#endif /* RC_INVOKED */
#ifdef __OS2__
#pragma pack()
#endif
#endif // nsplugindefs_h___

Просмотреть файл

@ -0,0 +1,30 @@
#//------------------------------------------------------------------------
#//
#// Makefile to build the MODULES\APPLET tree
#//
#//------------------------------------------------------------------------
#//------------------------------------------------------------------------
#//
#// Specify the depth of the current directory relative to the
#// root of NS
#//
#//------------------------------------------------------------------------
DEPTH=..\..
#//------------------------------------------------------------------------
#//
#// Specify any "command" targets. (ie. DIRS, INSTALL_FILES, ...)
#// (these must come before the common makefiles are included)
#//
#// DIRS - There are subdirectories to process
#//
#//------------------------------------------------------------------------
DIRS= public src
#//------------------------------------------------------------------------
#//
#// Include the common makefile rules
#//
#//------------------------------------------------------------------------
include <$(DEPTH)\config\rules.mak>

Просмотреть файл

@ -0,0 +1,41 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
#
# This is a list of local files which get copied to the mozilla:dist directory
#
nsIFileUtilities.h
nsIJRILiveConnectPlugin.h
nsIJRILiveConnectPluginInstancePeer.h
nsILiveConnectPlugin.h
nsILiveConnectPluginInstancePeer.h
nsIPlugin.h
nsIPluginInstance.h
nsIPluginInstancePeer.h
nsIPluginInstancePeer2.h
nsIPluginManager.h
nsIPluginManager2.h
nsIPluginStream.h
nsIPluginStreamPeer.h
nsIPluginStreamPeer2.h
nsIPluginTagInfo.h
nsIPluginTagInfo2.h
nsISeekablePluginStreamPeer.h
nsIWindowlessPluginInstancePeer.h
nsplugin.h
nsplugindefs.h

Просмотреть файл

@ -0,0 +1,44 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
DEPTH = ../../..
MODULE = plugin
EXPORTS = \
nsIFileUtilities.h \
nsIJRILiveConnectPlugin.h \
nsIJRILiveConnectPluginInstancePeer.h \
nsILiveConnectPlugin.h \
nsILiveConnectPluginInstancePeer.h \
nsIPlugin.h \
nsIPluginInstance.h \
nsIPluginInstancePeer.h \
nsIPluginInstancePeer2.h \
nsIPluginManager.h \
nsIPluginManager2.h \
nsIPluginStream.h \
nsIPluginStreamPeer.h \
nsIPluginStreamPeer2.h \
nsIPluginTagInfo.h \
nsIPluginTagInfo2.h \
nsISeekablePluginStreamPeer.h \
nsIWindowlessPluginInstancePeer.h \
nsplugin.h \
nsplugindefs.h
include $(DEPTH)/config/rules.mk

Просмотреть файл

@ -0,0 +1,47 @@
#!gmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
IGNORE_MANIFEST=1
DEPTH = ..\..\..
MODULE = plugin
EXPORTS = \
nsIFileUtilities.h \
nsIJRILiveConnectPlugin.h \
nsIJRILiveConnectPluginInstancePeer.h \
nsILiveConnectPlugin.h \
nsILiveConnectPluginInstancePeer.h \
nsIPlugin.h \
nsIPluginInstance.h \
nsIPluginInstancePeer.h \
nsIPluginInstancePeer2.h \
nsIPluginManager.h \
nsIPluginManager2.h \
nsIPluginStream.h \
nsIPluginStreamPeer.h \
nsIPluginStreamPeer2.h \
nsIPluginTagInfo.h \
nsIPluginTagInfo2.h \
nsISeekablePluginStreamPeer.h \
nsIWindowlessPluginInstancePeer.h \
nsplugin.h \
nsplugindefs.h
include <$(DEPTH)/config/rules.mak>

Просмотреть файл

@ -0,0 +1,75 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIFileUtilities_h___
#define nsIFileUtilities_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// File Utilities Interface
// This interface reflects operations only available in Communicator 5.0.
class nsIFileUtilities : public nsISupports {
public:
// QueryInterface on nsIPluginManager to get this.
NS_IMETHOD_(const char*)
GetProgramPath(void) = 0;
NS_IMETHOD_(const char*)
GetTempDirPath(void) = 0;
enum FileNameType { SIGNED_APPLET_DBNAME, TEMP_FILENAME };
NS_IMETHOD_(nsresult)
GetFileName(const char* fn, FileNameType type,
char* resultBuf, PRUint32 bufLen) = 0;
NS_IMETHOD_(nsresult)
NewTempFileName(const char* prefix, char* resultBuf, PRUint32 bufLen) = 0;
};
#define NS_IFILEUTILITIES_IID \
{ /* 89a31ce0-019a-11d2-815b-006008119d7a */ \
0x89a31ce0, \
0x019a, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIFileUtilities_h___ */

Просмотреть файл

@ -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 Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIJRILiveConnectPlugin_h__
#define nsIJRILiveConnectPlugin_h__
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// JRI-Based LiveConnect Classes
////////////////////////////////////////////////////////////////////////////////
//
// This stuff is here so that the browser can support older JRI-based
// LiveConnected plugins (when using old plugin to new C++-style plugin
// adapter code).
//
// Warning: Don't use this anymore, unless you're sure that you have to!
////////////////////////////////////////////////////////////////////////////////
#include "jri.h" // ancient
////////////////////////////////////////////////////////////////////////////////
// JRILiveConnect Plugin Interface
// This interface defines additional entry points that a plugin developer needs
// to implement in order for the plugin to support JRI-based LiveConnect,
// i.e. be scriptable by Java or JavaScript.
class nsIJRILiveConnectPlugin : public nsIPlugin {
public:
// (Corresponds to NPP_GetJavaClass.)
NS_IMETHOD_(jref)
GetJavaClass(void) = 0;
};
#define NS_IJRILIVECONNECTPLUGIN_IID \
{ /* c94058e0-f772-11d1-815b-006008119d7a */ \
0xc94058e0, \
0xf772, \
0x11d1, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIJRILiveConnectPlugin_h__ */

Просмотреть файл

Просмотреть файл

@ -0,0 +1,65 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsILiveConnectPlugin_h__
#define nsILiveConnectPlugin_h__
#include "nsplugindefs.h"
#include "jni.h" // standard JVM API
////////////////////////////////////////////////////////////////////////////////
// LiveConnect Plugin Interface
// This interface defines additional entry points that a plugin developer needs
// to implement in order for the plugin to support JNI-based LiveConnect,
// i.e. be scriptable by Java or JavaScript.
class nsILiveConnectPlugin : public nsIPlugin {
public:
// (New JNI-based entry point, roughly corresponds to NPP_GetJavaClass.)
NS_IMETHOD_(jclass)
GetJavaClass(void) = 0;
};
#define NS_ILIVECONNECTPLUGIN_IID \
{ /* cf134df0-a1bc-11d1-85b1-00805f0e4dfe */ \
0xcf134df0, \
0xa1bc, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsILiveConnectPlugin_h__ */

Просмотреть файл

Просмотреть файл

@ -0,0 +1,97 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPlugin_h___
#define nsIPlugin_h___
#include "nsplugindefs.h"
#include "nsIFactory.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Interface
// This is the minimum interface plugin developers need to support in order to
// implement a plugin. The plugin manager may QueryInterface for more specific
// plugin types, e.g. nsILiveConnectPlugin.
struct nsIPlugin : public nsIFactory {
public:
// This call initializes the plugin and will be called before any new
// instances are created. It is passed browserInterfaces on which QueryInterface
// may be used to obtain an nsIPluginManager, and other interfaces.
NS_IMETHOD_(nsPluginError)
Initialize(nsISupports* browserInterfaces) = 0;
// (Corresponds to NPP_Shutdown.)
// Called when the browser is done with the plugin factory, or when
// the plugin is disabled by the user.
NS_IMETHOD_(nsPluginError)
Shutdown(void) = 0;
// (Corresponds to NPP_GetMIMEDescription.)
NS_IMETHOD_(const char*)
GetMIMEDescription(void) = 0;
// (Corresponds to NPP_GetValue.)
NS_IMETHOD_(nsPluginError)
GetValue(nsPluginVariable variable, void *value) = 0;
// (Corresponds to NPP_SetValue.)
NS_IMETHOD_(nsPluginError)
SetValue(nsPluginVariable variable, void *value) = 0;
// The old NPP_New call has been factored into two plugin instance methods:
//
// CreateInstance -- called once, after the plugin instance is created. This
// method is used to initialize the new plugin instance (although the actual
// plugin instance object will be created by the plugin manager).
//
// nsIPluginInstance::Start -- called when the plugin instance is to be
// started. This happens in two circumstances: (1) after the plugin instance
// is first initialized, and (2) after a plugin instance is returned to
// (e.g. by going back in the window history) after previously being stopped
// by the Stop method.
};
#define NS_IPLUGIN_IID \
{ /* df773070-0199-11d2-815b-006008119d7a */ \
0xdf773070, \
0x0199, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPlugin_h___ */

Просмотреть файл

@ -0,0 +1,111 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPluginInstance_h___
#define nsIPluginInstance_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Instance Interface
// (Corresponds to NPP object.)
class nsIPluginInstance : public nsISupports {
public:
NS_IMETHOD_(nsPluginError)
Initialize(nsIPluginInstancePeer* peer) = 0;
// Required backpointer to the peer.
NS_IMETHOD_(nsIPluginInstancePeer*)
GetPeer(void) = 0;
// See comment for nsIPlugin::CreateInstance, above.
NS_IMETHOD_(nsPluginError)
Start(void) = 0;
// The old NPP_Destroy call has been factored into two plugin instance
// methods:
//
// Stop -- called when the plugin instance is to be stopped (e.g. by
// displaying another plugin manager window, causing the page containing
// the plugin to become removed from the display).
//
// Release -- called once, before the plugin instance peer is to be
// destroyed. This method is used to destroy the plugin instance.
NS_IMETHOD_(nsPluginError)
Stop(void) = 0;
NS_IMETHOD_(nsPluginError)
Destroy(void) = 0;
// (Corresponds to NPP_SetWindow.)
NS_IMETHOD_(nsPluginError)
SetWindow(nsPluginWindow* window) = 0;
// (Corresponds to NPP_NewStream.)
NS_IMETHOD_(nsPluginError)
NewStream(nsIPluginStreamPeer* peer, nsIPluginStream* *result) = 0;
// (Corresponds to NPP_Print.)
NS_IMETHOD_(void)
Print(nsPluginPrint* platformPrint) = 0;
// (Corresponds to NPP_HandleEvent.)
// Note that for Unix and Mac the nsPluginEvent structure is different
// from the old NPEvent structure -- it's no longer the native event
// record, but is instead a struct. This was done for future extensibility,
// and so that the Mac could receive the window argument too. For Windows
// and OS2, it's always been a struct, so there's no change for them.
NS_IMETHOD_(PRInt16)
HandleEvent(nsPluginEvent* event) = 0;
// (Corresponds to NPP_URLNotify.)
NS_IMETHOD_(void)
URLNotify(const char* url, const char* target,
nsPluginReason reason, void* notifyData) = 0;
};
#define NS_IPLUGININSTANCE_IID \
{ /* ebe00f40-0199-11d2-815b-006008119d7a */ \
0xebe00f40, \
0x0199, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPluginInstance_h___ */

Просмотреть файл

@ -0,0 +1,80 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPluginInstancePeer_h___
#define nsIPluginInstancePeer_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Instance Peer Interface
enum nsPluginTagType {
nsPluginTagType_Unknown,
nsPluginTagType_Embed,
nsPluginTagType_Object,
nsPluginTagType_Applet
};
class nsIPluginInstancePeer : public nsISupports {
public:
// (Corresponds to NPP_New's MIMEType argument.)
NS_IMETHOD_(nsMIMEType)
GetMIMEType(void) = 0;
// (Corresponds to NPP_New's mode argument.)
NS_IMETHOD_(nsPluginType)
GetMode(void) = 0;
// (Corresponds to NPN_NewStream.)
NS_IMETHOD_(nsPluginError)
NewStream(nsMIMEType type, const char* target, nsIOutputStream* *result) = 0;
// (Corresponds to NPN_Status.)
NS_IMETHOD_(void)
ShowStatus(const char* message) = 0;
};
#define NS_IPLUGININSTANCEPEER_IID \
{ /* 4b7cea20-019b-11d2-815b-006008119d7a */ \
0x4b7cea20, \
0x019b, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPluginInstancePeer_h___ */

Просмотреть файл

Просмотреть файл

@ -0,0 +1,128 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPluginManager_h___
#define nsIPluginManager_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Manager Interface
// This interface defines the minimum set of functionality that a plugin
// manager will support if it implements plugins. Plugin implementations can
// QueryInterface to determine if a plugin manager implements more specific
// APIs for the plugin to use.
class nsIPluginManager : public nsISupports {
public:
// (Corresponds to NPN_ReloadPlugins.)
NS_IMETHOD_(void)
ReloadPlugins(PRBool reloadPages) = 0;
// (Corresponds to NPN_MemAlloc.)
NS_IMETHOD_(void*)
MemAlloc(PRUint32 size) = 0;
// (Corresponds to NPN_MemFree.)
NS_IMETHOD_(void)
MemFree(void* ptr) = 0;
// (Corresponds to NPN_MemFlush.)
NS_IMETHOD_(PRUint32)
MemFlush(PRUint32 size) = 0;
// (Corresponds to NPN_UserAgent.)
NS_IMETHOD_(const char*)
UserAgent(void) = 0;
// (Corresponds to NPN_GetValue.)
NS_IMETHOD_(nsPluginError)
GetValue(nsPluginManagerVariable variable, void *value) = 0;
// (Corresponds to NPN_SetValue.)
NS_IMETHOD_(nsPluginError)
SetValue(nsPluginManagerVariable variable, void *value) = 0;
// (Corresponds to NPN_GetURL and NPN_GetURLNotify.)
// notifyData: When present, URLNotify is called passing the notifyData back
// to the client. When NULL, this call behaves like NPN_GetURL.
// New arguments:
// peer: A plugin instance peer. The peer's window will be used to display
// progress information. If NULL, the load happens in the background.
// altHost: An IP-address string that will be used instead of the host
// specified in the URL. This is used to prevent DNS-spoofing attacks.
// Can be defaulted to NULL meaning use the host in the URL.
// referrer:
// forceJSEnabled: Forces JavaScript to be enabled for 'javascript:' URLs,
// even if the user currently has JavaScript disabled.
NS_IMETHOD_(nsPluginError)
GetURL(nsISupports* peer, const char* url, const char* target, void* notifyData = NULL,
const char* altHost = NULL, const char* referrer = NULL,
PRBool forceJSEnabled = PR_FALSE) = 0;
// (Corresponds to NPN_PostURL and NPN_PostURLNotify.)
// notifyData: When present, URLNotify is called passing the notifyData back
// to the client. When NULL, this call behaves like NPN_GetURL.
// New arguments:
// peer: A plugin instance peer. The peer's window will be used to display
// progress information. If NULL, the load happens in the background.
// altHost: An IP-address string that will be used instead of the host
// specified in the URL. This is used to prevent DNS-spoofing attacks.
// Can be defaulted to NULL meaning use the host in the URL.
// referrer:
// forceJSEnabled: Forces JavaScript to be enabled for 'javascript:' URLs,
// even if the user currently has JavaScript disabled.
// postHeaders: A string containing post headers.
// postHeadersLength: The length of the post headers string.
NS_IMETHOD_(nsPluginError)
PostURL(nsISupports* peer, const char* url, const char* target, PRUint32 bufLen,
const char* buf, PRBool file, void* notifyData = NULL,
const char* altHost = NULL, const char* referrer = NULL,
PRBool forceJSEnabled = PR_FALSE,
PRUint32 postHeadersLength = 0, const char* postHeaders = NULL) = 0;
};
#define NS_IPLUGINMANAGER_IID \
{ /* f10b9600-a1bc-11d1-85b1-00805f0e4dfe */ \
0xf10b9600, \
0xa1bc, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPluginManager_h___ */

Просмотреть файл

@ -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 Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPluginManager2_h___
#define nsIPluginManager2_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Manager 2 Interface
// These extensions to nsIPluginManager are only available in Communicator 5.0.
class nsIPluginManager2 : public nsIPluginManager {
public:
NS_IMETHOD_(void)
BeginWaitCursor(void) = 0;
NS_IMETHOD_(void)
EndWaitCursor(void) = 0;
NS_IMETHOD_(PRBool)
SupportsURLProtocol(const char* protocol) = 0;
};
#define NS_IPLUGINMANAGER2_IID \
{ /* 29c4ae70-019a-11d2-815b-006008119d7a */ \
0x29c4ae70, \
0x019a, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPluginManager2_h___ */

Просмотреть файл

@ -0,0 +1,66 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPluginStream_h___
#define nsIPluginStream_h___
#include "nsplugindefs.h"
#include "nsIOutputStream.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Stream Interface
class nsIPluginStream : public nsIOutputStream {
public:
// (Corresponds to NPP_NewStream's stype return parameter.)
NS_IMETHOD_(NPStreamType)
GetStreamType(void) = 0;
// (Corresponds to NPP_StreamAsFile.)
NS_IMETHOD_(void)
AsFile(const char* fname) = 0;
};
#define NS_IPLUGINSTREAM_IID \
{ /* f287dd50-0199-11d2-815b-006008119d7a */ \
0xf287dd50, \
0x0199, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPluginStream_h___ */

Просмотреть файл

@ -0,0 +1,84 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPluginStreamPeer_h___
#define nsIPluginStreamPeer_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Stream Peer Interface
// A plugin stream peer is passed to a plugin instance's NewStream call in
// order to indicate that a new stream is to be created and be read by the
// plugin instance.
class nsIPluginStreamPeer : public nsISupports {
public:
// (Corresponds to NPStream's url field.)
NS_IMETHOD_(const char*)
GetURL(void) = 0;
// (Corresponds to NPStream's end field.)
NS_IMETHOD_(PRUint32)
GetEnd(void) = 0;
// (Corresponds to NPStream's lastmodified field.)
NS_IMETHOD_(PRUint32)
GetLastModified(void) = 0;
// (Corresponds to NPStream's notifyData field.)
NS_IMETHOD_(void*)
GetNotifyData(void) = 0;
// (Corresponds to NPP_DestroyStream's reason argument.)
NS_IMETHOD_(nsPluginReason)
GetReason(void) = 0;
// (Corresponds to NPP_NewStream's MIMEType argument.)
NS_IMETHOD_(nsMIMEType)
GetMIMEType(void) = 0;
};
#define NS_IPLUGINSTREAMPEER_IID \
{ /* 717b1e90-019b-11d2-815b-006008119d7a */ \
0x717b1e90, \
0x019b, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPluginStreamPeer_h___ */

Просмотреть файл

@ -0,0 +1,70 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPluginStreamPeer2_h___
#define nsIPluginStreamPeer2_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Stream Peer Interface
// These extensions to nsIPluginStreamPeer are only available in Communicator 5.0.
class nsIPluginStreamPeer2 : public nsIPluginStreamPeer {
public:
NS_IMETHOD_(PRUint32)
GetContentLength(void) = 0;
NS_IMETHOD_(PRUint32)
GetHeaderFieldCount(void) = 0;
NS_IMETHOD_(const char*)
GetHeaderFieldKey(PRUint32 index) = 0;
NS_IMETHOD_(const char*)
GetHeaderField(PRUint32 index) = 0;
};
#define NS_IPLUGINSTREAMPEER2_IID \
{ /* 77083af0-019b-11d2-815b-006008119d7a */ \
0x77083af0, \
0x019b, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPluginStreamPeer2_h___ */

Просмотреть файл

@ -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 Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPluginTagInfo_h___
#define nsIPluginTagInfo_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Tag Info Interface
// This interface provides information about the HTML tag on the page.
// Some day this might get superseded by a DOM API.
class nsIPluginTagInfo : public nsISupports {
public:
// QueryInterface on nsIPluginInstancePeer to get this.
// (Corresponds to NPP_New's argc, argn, and argv arguments.)
// Get a ptr to the paired list of attribute names and values,
// returns the length of the array.
//
// Each name or value is a null-terminated string.
NS_IMETHOD_(nsPluginError)
GetAttributes(PRUint16& n, const char*const*& names, const char*const*& values) = 0;
// Get the value for the named attribute. Returns NULL
// if the attribute was not set.
NS_IMETHOD_(const char*)
GetAttribute(const char* name) = 0;
};
#define NS_IPLUGINTAGINFO_IID \
{ /* 5f1ec1d0-019b-11d2-815b-006008119d7a */ \
0x5f1ec1d0, \
0x019b, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPluginTagInfo_h___ */

Просмотреть файл

@ -0,0 +1,110 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsIPluginTagInfo2_h___
#define nsIPluginTagInfo2_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// Plugin Tag Info Interface
// These extensions to nsIPluginTagInfo are only available in Communicator 5.0.
class nsIPluginTagInfo2 : public nsIPluginTagInfo {
public:
// QueryInterface on nsIPluginInstancePeer to get this.
// Get the type of the HTML tag that was used ot instantiate this
// plugin. Currently supported tags are EMBED, OBJECT and APPLET.
NS_IMETHOD_(nsPluginTagType)
GetTagType(void) = 0;
// Get the complete text of the HTML tag that was
// used to instantiate this plugin
NS_IMETHOD_(const char *)
GetTagText(void) = 0;
// Get a ptr to the paired list of parameter names and values,
// returns the length of the array.
//
// Each name or value is a null-terminated string.
NS_IMETHOD_(nsPluginError)
GetParameters(PRUint16& n, const char*const*& names, const char*const*& values) = 0;
// Get the value for the named parameter. Returns null
// if the parameter was not set.
NS_IMETHOD_(const char*)
GetParameter(const char* name) = 0;
NS_IMETHOD_(const char*)
GetDocumentBase(void) = 0;
// Return an encoding whose name is specified in:
// http://java.sun.com/products/jdk/1.1/docs/guide/intl/intl.doc.html#25303
NS_IMETHOD_(const char*)
GetDocumentEncoding(void) = 0;
NS_IMETHOD_(const char*)
GetAlignment(void) = 0;
NS_IMETHOD_(PRUint32)
GetWidth(void) = 0;
NS_IMETHOD_(PRUint32)
GetHeight(void) = 0;
NS_IMETHOD_(PRUint32)
GetBorderVertSpace(void) = 0;
NS_IMETHOD_(PRUint32)
GetBorderHorizSpace(void) = 0;
// Returns a unique id for the current document on which the
// plugin is displayed.
NS_IMETHOD_(PRUint32)
GetUniqueID(void) = 0;
};
#define NS_IPLUGINTAGINFO2_IID \
{ /* 6a49c9a0-019b-11d2-815b-006008119d7a */ \
0x6a49c9a0, \
0x019b, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIPluginTagInfo2_h___ */

Просмотреть файл

@ -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 Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this interface fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsISeekablePluginStreamPeer_h___
#define nsISeekablePluginStreamPeer_h___
#include "nsplugindefs.h"
////////////////////////////////////////////////////////////////////////////////
// Seekable Plugin Stream Peer Interface
// The browser implements this subclass of plugin stream peer if a stream
// is seekable. Plugins can query interface for this type, and call the
// RequestRead method to seek to a particular position in the stream.
class nsISeekablePluginStreamPeer : public nsISupports {
public:
// QueryInterface for this class corresponds to NPP_NewStream's
// seekable argument.
// (Corresponds to NPN_RequestRead.)
NS_IMETHOD_(nsPluginError)
RequestRead(nsByteRange* rangeList) = 0;
};
#define NS_ISEEKABLEPLUGINSTREAMPEER_IID \
{ /* 7e028d20-019b-11d2-815b-006008119d7a */ \
0x7e028d20, \
0x019b, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsISeekablePluginStreamPeer_h___ */

Просмотреть файл

Просмотреть файл

@ -0,0 +1,238 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>This is the master header file that includes most of the other headers
* you'll need to write a plugin.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* The following diagram depicts the relationships between various objects
* implementing the new plugin interfaces. QueryInterface can be used to switch
* between interfaces in the same box:
*
*
* the plugin (only 1)
* +----------------------+
* | nsIPlugin or |<- - - - - -NSGetFactory()
* | nsILiveConnectPlugin |
* +----------------------+
* |
* |
* | instances (many) streams to receive URL data (many)
* | +-------------------+ +-----------------+
* | | nsIPluginInstance |+ | nsIPluginStream |+
* | | || | ||
* | +-------------------+| +-----------------+|
* | +------|-----------+ +------|---------+
* | | |
* | PLUGIN SIDE |peer |peer
*~~~~|~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~
* | BROWSER SIDE | |
* | v v
* | +---------------------------------+ +----------------------------+
* | | nsIPluginInstancePeer |+ | nsIPluginStreamPeer |+
* | | nsIPluginInstancePeer2 || | nsISeekablePluginStreamPeer||
* | | nsIWindowlessPluginInstancePeer || | nsIPluginstreamPeer2 ||
* | | nsILiveConnectPluginInstancePeer|| +----------------------------+|
* | | nsIPluginTagInfo || +---------------------------+
* | | nsIPluginTagInfo2 ||
* | +---------------------------------+|
* | +--------------------------------+
* |
* |
* v the browser (only 1)
* +---------------------+
* | nsIPluginManager |
* | nsIPluginManager2 |
* | nsIFileUtilities |
* | nsIPref |
* | nsICacheManager ... |
* +---------------------+
*
*/
#ifndef nsplugins_h___
#define nsplugins_h___
#include "nsRepository.h" // for NSGetFactory
////////////////////////////////////////////////////////////////////////////////
/**
* <B>Interfaces which must be implemented by a plugin</B>
* These interfaces have NPP equivalents in pre-5.0 browsers (see npapi.h).
*/
////////////////////////////////////////////////////////////////////////////////
/**
* NSGetFactory is the main entry point to the plugin's DLL. The plugin manager
* finds this symbol and calls it to create the plugin class. Once the plugin
* object is returned to the plugin manager, instances on the page are created
* by calling nsIPlugin::CreateInstance.
*/
// (Declared in nsRepository.h)
//extern "C" NS_EXPORT nsresult NSGetFactory(const nsCID &aClass,
// nsIFactory **aFactory);
/**
* A plugin object is used to create new plugin instances. It manages the
* global state of all plugins with the same implementation.
*/
#include "nsIPlugin.h"
/**
* A plugin instance represents a particular activation of a plugin on a page.
*/
#include "nsIPluginInstance.h"
/**
* A plugin stream gets instantiated when a plugin instance receives data from
* the browser.
*/
#include "nsIPluginStream.h"
/**
* The nsILiveConnectPlugin interface provides additional operations that a
* plugin must implement if it is to be controlled by JavaScript through
* LiveConnect.
*
* Note that this interface is part of a new JNI-based LiveConnect
* implementation and superceeds that provided prior to Communicator 5.0.
*/
#include "nsILiveConnectPlugin.h"
////////////////////////////////////////////////////////////////////////////////
/**
* <B>Interfaces implemented by the browser:
* These interfaces have NPN equivalents in pre-5.0 browsers (see npapi.h).
*/
////////////////////////////////////////////////////////////////////////////////
/**
* The plugin manager which is the main point of interaction with the browser
* and provides general operations needed by a plugin.
*/
#include "nsIPluginManager.h"
/**
* A plugin instance peer gets created by the browser and associated with each
* plugin instance to represent tag information and other callbacks needed by
* the plugin instance.
*/
#include "nsIPluginInstancePeer.h"
/**
* The nsIPluginTagInfo interface provides information about the html tag
* that was used to instantiate the plugin instance.
*
* To obtain: QueryInterface on nsIPluginInstancePeer
*/
#include "nsIPluginTagInfo.h"
/**
* The nsIWindowlessPluginInstancePeer provides additional operations for
* windowless plugins.
*
* To obtain: QueryInterface on nsIPluginInstancePeer
*/
#include "nsIWindowlessPluginInstancePeer.h"
/**
* A plugin stream peer gets create by the browser and associated with each
* plugin stream to represent stream and URL information, and provides
* other callbacks needed by the plugin stream.
*/
#include "nsIPluginStreamPeer.h"
/**
* The nsISeekablePluginStreamPeer provides additional operations for seekable
* plugin streams.
*
* To obtain: QueryInterface on nsIPluginStreamPeer
*/
#include "nsISeekablePluginStreamPeer.h"
////////////////////////////////////////////////////////////////////////////////
/**
* <B>Interfaces implemented by the browser (new for 5.0):
*/
////////////////////////////////////////////////////////////////////////////////
/**
* The nsIPluginManager2 interface provides additional plugin manager features
* only available in Communicator 5.0.
*
* To obtain: QueryInterface on nsIPluginManager
*/
#include "nsIPluginManager2.h"
/**
* The nsIFileUtilities interface provides operations to manage temporary
* files and directories.
*
* To obtain: QueryInterface on nsIPluginManager
*/
#include "nsIFileUtilities.h"
/**
* The nsIPluginInstancePeer2 interface provides additional plugin instance
* peer features only available in Communicator 5.0.
*
* To obtain: QueryInterface on nsIPluginInstancePeer
*/
#include "nsIPluginInstancePeer2.h"
/**
* The nsILiveConnectPluginInstancePeer allows plugins to be manipulated
* by JavaScript, providing basic scriptability.
*
* Note that this interface is part of a new JNI-based LiveConnect
* implementation and superceeds that provided prior to Communicator 5.0.
*
* To obtain: QueryInterface on nsIPluginInstancePeer
*/
#include "nsILiveConnectPluginInstancePeer.h"
/**
* The nsIPluginStreamPeer2 interface provides additional plugin stream
* peer features only available in Communicator 5.0.
*
* To obtain: QueryInterface on nsIPluginStreamPeer
*/
#include "nsIPluginStreamPeer2.h"
/**
* The nsIPluginTagInfo2 interface provides additional html tag information
* only available in Communicator 5.0.
*
* To obtain: QueryInterface on nsIPluginTagInfo
*/
#include "nsIPluginTagInfo2.h"
////////////////////////////////////////////////////////////////////////////////
#endif // nsplugins_h___

Просмотреть файл

@ -0,0 +1,365 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
////////////////////////////////////////////////////////////////////////////////
/**
* <B>INTERFACE TO NETSCAPE COMMUNICATOR PLUGINS (NEW C++ API).</B>
*
* <P>This superscedes the old plugin API (npapi.h, npupp.h), and
* eliminates the need for glue files: npunix.c, npwin.cpp and npmac.cpp that
* get linked with the plugin. You will however need to link with the "backward
* adapter" (badapter.cpp) in order to allow your plugin to run in pre-5.0
* browsers.
*
* <P>See nsplugin.h for an overview of how this fits with the
* overall plugin architecture.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef nsplugindefs_h___
#define nsplugindefs_h___
#ifdef __OS2__
#pragma pack(1)
#endif
#ifdef XP_MAC
#include <Quickdraw.h>
#include <Events.h>
#endif
#ifdef XP_UNIX
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#endif
#ifdef XP_PC
#include <windef.h>
#endif
////////////////////////////////////////////////////////////////////////////////
/* The OS/2 version of Netscape uses RC_DATA to define the
mime types, file extentions, etc that are required.
Use a vertical bar to seperate types, end types with \0.
FileVersion and ProductVersion are 32bit ints, all other
entries are strings the MUST be terminated wwith a \0.
AN EXAMPLE:
RCDATA NS_INFO_ProductVersion { 1,0,0,1,}
RCDATA NS_INFO_MIMEType { "video/x-video|",
"video/x-flick\0" }
RCDATA NS_INFO_FileExtents { "avi|",
"flc\0" }
RCDATA NS_INFO_FileOpenName{ "MMOS2 video player(*.avi)|",
"MMOS2 Flc/Fli player(*.flc)\0" }
RCDATA NS_INFO_FileVersion { 1,0,0,1 }
RCDATA NS_INFO_CompanyName { "Netscape Communications\0" }
RCDATA NS_INFO_FileDescription { "NPAVI32 Extension DLL\0"
RCDATA NS_INFO_InternalName { "NPAVI32\0" )
RCDATA NS_INFO_LegalCopyright { "Copyright Netscape Communications \251 1996\0"
RCDATA NS_INFO_OriginalFilename { "NVAPI32.DLL" }
RCDATA NS_INFO_ProductName { "NPAVI32 Dynamic Link Library\0" }
*/
/* RC_DATA types for version info - required */
#define NS_INFO_ProductVersion 1
#define NS_INFO_MIMEType 2
#define NS_INFO_FileOpenName 3
#define NS_INFO_FileExtents 4
/* RC_DATA types for version info - used if found */
#define NS_INFO_FileDescription 5
#define NS_INFO_ProductName 6
/* RC_DATA types for version info - optional */
#define NS_INFO_CompanyName 7
#define NS_INFO_FileVersion 8
#define NS_INFO_InternalName 9
#define NS_INFO_LegalCopyright 10
#define NS_INFO_OriginalFilename 11
#ifndef RC_INVOKED
////////////////////////////////////////////////////////////////////////////////
// Structures and definitions
#ifdef XP_MAC
#pragma options align=mac68k
#endif
typedef const char* nsMIMEType;
struct nsByteRange {
PRInt32 offset; /* negative offset means from the end */
PRUint32 length;
struct nsByteRange* next;
};
struct nsRect {
PRUint16 top;
PRUint16 left;
PRUint16 bottom;
PRUint16 right;
};
////////////////////////////////////////////////////////////////////////////////
// Unix specific structures and definitions
#ifdef XP_UNIX
#include <stdio.h>
/*
* Callback Structures.
*
* These are used to pass additional platform specific information.
*/
enum nsPluginCallbackType {
nsPluginCallbackType_SetWindow = 1,
nsPluginCallbackType_Print
};
struct nsPluginAnyCallbackStruct {
PRInt32 type;
};
struct nsPluginSetWindowCallbackStruct {
PRInt32 type;
Display* display;
Visual* visual;
Colormap colormap;
PRUint32 depth;
};
struct nsPluginPrintCallbackStruct {
PRInt32 type;
FILE* fp;
};
#endif /* XP_UNIX */
////////////////////////////////////////////////////////////////////////////////
// List of variable names for which NPP_GetValue shall be implemented
enum nsPluginVariable {
nsPluginVariable_NameString = 1,
nsPluginVariable_DescriptionString,
nsPluginVariable_WindowBool, // XXX go away
nsPluginVariable_TransparentBool, // XXX go away?
nsPluginVariable_JavaClass, // XXX go away
nsPluginVariable_WindowSize,
nsPluginVariable_TimerInterval
// XXX add MIMEDescription (for unix) (but GetValue is on the instance, not the class)
};
// List of variable names for which NPN_GetValue is implemented by Mozilla
enum nsPluginManagerVariable {
nsPluginManagerVariable_XDisplay = 1,
nsPluginManagerVariable_XtAppContext,
nsPluginManagerVariable_NetscapeWindow,
nsPluginManagerVariable_JavascriptEnabledBool, // XXX prefs accessor api
nsPluginManagerVariable_ASDEnabledBool, // XXX prefs accessor api
nsPluginManagerVariable_IsOfflineBool // XXX prefs accessor api
};
////////////////////////////////////////////////////////////////////////////////
enum nsPluginType {
nsPluginType_Embedded = 1,
nsPluginType_Full
};
// XXX this can go away now
enum NPStreamType {
NPStreamType_Normal = 1,
NPStreamType_Seek,
NPStreamType_AsFile,
NPStreamType_AsFileOnly
};
#define NP_STREAM_MAXREADY (((unsigned)(~0)<<1)>>1)
/*
* The type of a NPWindow - it specifies the type of the data structure
* returned in the window field.
*/
enum nsPluginWindowType {
nsPluginWindowType_Window = 1,
nsPluginWindowType_Drawable
};
struct nsPluginWindow {
void* window; /* Platform specific window handle */
/* OS/2: x - Position of bottom left corner */
/* OS/2: y - relative to visible netscape window */
PRUint32 x; /* Position of top left corner relative */
PRUint32 y; /* to a netscape page. */
PRUint32 width; /* Maximum window size */
PRUint32 height;
nsRect clipRect; /* Clipping rectangle in port coordinates */
/* Used by MAC only. */
#ifdef XP_UNIX
void* ws_info; /* Platform-dependent additonal data */
#endif /* XP_UNIX */
nsPluginWindowType type; /* Is this a window or a drawable? */
};
struct nsPluginFullPrint {
PRBool pluginPrinted; /* Set TRUE if plugin handled fullscreen */
/* printing */
PRBool printOne; /* TRUE if plugin should print one copy */
/* to default printer */
void* platformPrint; /* Platform-specific printing info */
};
struct nsPluginEmbedPrint {
nsPluginWindow window;
void* platformPrint; /* Platform-specific printing info */
};
struct nsPluginPrint {
nsPluginType mode; /* NP_FULL or nsPluginType_Embedded */
union
{
nsPluginFullPrint fullPrint; /* if mode is NP_FULL */
nsPluginEmbedPrint embedPrint; /* if mode is nsPluginType_Embedded */
} print;
};
struct nsPluginEvent {
#if defined(XP_MAC)
EventRecord* event;
void* window;
#elif defined(XP_PC)
uint16 event;
uint32 wParam;
uint32 lParam;
#elif defined(XP_OS2)
uint32 event;
uint32 wParam;
uint32 lParam;
#elif defined(XP_UNIX)
XEvent event;
#endif
};
#ifdef XP_MAC
typedef RgnHandle nsRegion;
#elif defined(XP_PC)
typedef HRGN nsRegion;
#elif defined(XP_UNIX)
typedef Region nsRegion;
#else
typedef void *nsRegion;
#endif
////////////////////////////////////////////////////////////////////////////////
// Mac-specific structures and definitions.
#ifdef XP_MAC
struct NPPort {
CGrafPtr port; /* Grafport */
PRInt32 portx; /* position inside the topmost window */
PRInt32 porty;
};
/*
* Non-standard event types that can be passed to HandleEvent
*/
#define getFocusEvent (osEvt + 16)
#define loseFocusEvent (osEvt + 17)
#define adjustCursorEvent (osEvt + 18)
#define menuCommandEvent (osEvt + 19)
#endif /* XP_MAC */
////////////////////////////////////////////////////////////////////////////////
// Error and Reason Code definitions
enum nsPluginError {
nsPluginError_Base = 0,
nsPluginError_NoError = 0,
nsPluginError_GenericError,
nsPluginError_InvalidInstanceError,
nsPluginError_InvalidFunctableError,
nsPluginError_ModuleLoadFailedError,
nsPluginError_OutOfMemoryError,
nsPluginError_InvalidPluginError,
nsPluginError_InvalidPluginDirError,
nsPluginError_IncompatibleVersionError,
nsPluginError_InvalidParam,
nsPluginError_InvalidUrl,
nsPluginError_FileNotFound,
nsPluginError_NoData,
nsPluginError_StreamNotSeekable
};
#define NPCallFailed( code ) ((code) != nsPluginError_NoError)
enum nsPluginReason {
nsPluginReason_Base = 0,
nsPluginReason_Done = 0,
nsPluginReason_NetworkErr,
nsPluginReason_UserBreak,
nsPluginReason_NoReason
};
////////////////////////////////////////////////////////////////////////////////
// Classes
////////////////////////////////////////////////////////////////////////////////
// Classes that must be implemented by the plugin DLL:
struct nsIPlugin; // plugin class (MIME-type handler)
class nsILiveConnectPlugin; // subclass of nsIPlugin
class nsIPluginInstance; // plugin instance
class nsIPluginStream; // stream to receive data from the browser
// Classes that are implemented by the browser:
class nsIPluginManager; // minimum browser requirements
class nsIFileUtilities; // file utilities (accessible from nsIPluginManager)
class nsIPluginInstancePeer; // parts of nsIPluginInstance implemented by the browser
class nsIWindowlessPluginInstancePeer; // subclass of nsIPluginInstancePeer for windowless plugins
class nsIPluginTagInfo; // describes html tag (accessible from nsIPluginInstancePeer)
class nsILiveConnectPluginInstancePeer; // subclass of nsIPluginInstancePeer
class nsIPluginStreamPeer; // parts of nsIPluginStream implemented by the browser
class nsISeekablePluginStreamPeer; // seekable subclass of nsIPluginStreamPeer
////////////////////////////////////////////////////////////////////////////////
#ifdef XP_MAC
#pragma options align=reset
#endif
#endif /* RC_INVOKED */
#ifdef __OS2__
#pragma pack()
#endif
#endif // nsplugindefs_h___

Просмотреть файл

@ -0,0 +1,25 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
#
# This is a list of local files which get copied to the mozilla:dist directory
#
nppg.h
npupp.h
npglue.h
nppriv.h

Просмотреть файл

@ -0,0 +1,46 @@
#!gmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
DEPTH = ../../..
MODULE = plug
LIBRARY_NAME = plug
CSRCS = npassoc.c
CPPSRCS = nsplugin.cpp
EXPORTS = nppg.h npupp.h npglue.h nppriv.h
REQUIRES = lay layer js style applet nspr dbm img util java pref xpcom netcnvts oji ojiimpl
ifeq ($(subst /,_,$(shell uname -s)),OS2)
CPPSRCS = npwplat.cpp
REQUIRES += xp libfont os2font jtools
endif
CPPSRCS += npglue.cpp
include $(DEPTH)/config/rules.mk
ifeq ($(subst /,_,$(shell uname -s)),OS2)
INCLUDES += -I$(DEPTH)/cmd/os2fe/nfc/include -I$(DEPTH)/cmd/os2fe -I$(DEPTH)/cmd/winfe
endif
INCLUDES += -I.
$(LIBRARY): $(OBJS)

Просмотреть файл

@ -0,0 +1,47 @@
#!gmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
IGNORE_MANIFEST=1
DEPTH= ..\..\..
MODULE = plugimpl
EXPORTS = \
nppg.h \
npupp.h \
npglue.h \
nppriv.h
LIBRARY_NAME = plug
LINCS = -I$(DIST)\include \
-I$(PUBLIC)\plugin \
-I$(PUBLIC)\java \
-I$(PUBLIC)\pref \
-I$(PUBLIC)\js \
-I$(PUBLIC)\lay \
-I$(PUBLIC)\style \
-I$(PUBLIC)\xpcom \
-I$(PUBLIC)\oji \
-I$(PUBLIC)\ojiimpl
OBJS = .\$(OBJDIR)\npassoc.obj \
.\$(OBJDIR)\npglue.obj
include <$(DEPTH)/config/rules.mak>

Просмотреть файл

@ -0,0 +1,239 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* npassoc.c $Revision: 1.1 $
* some xp mime-type file extension associations
*/
#include "npassoc.h"
#include "xp_mem.h"
#include "xp_mcom.h"
#include "net.h"
static NPFileTypeAssoc *np_fassoc_list=0; /* should use xp hash */
extern void NET_cdataAdd(NET_cdataStruct *cd);
#define NP_MAX_EXTS 64
static char *np_array[NP_MAX_EXTS];
/* allocate and fill a null-terminated array of extensions from
a comma and space delimited list */
static char **
np_parse_exts(const char *exts)
{
char *p, *e, **res;
int n=0;
if(!exts)
return 0;
/* p is the current position, e is the start of the nth extension */
for(e=p=(char *)exts; *p; p++)
{
if( (*p==' ') || (*p==',') )
{
if(*e == '.') e++;
if(p>e)
{
if(!(np_array[n] = (char *)XP_ALLOC(p-e+1)))
return 0;
XP_MEMCPY(np_array[n], e, (p-e));
*(np_array[n]+(p-e)) = 0;
n++;
e = p+1;
}
}
}
if(*e == '.') e++;
if(p>e)
{
if(!(np_array[n] = (char *)XP_ALLOC(p-e+1)))
return 0;
XP_MEMCPY(np_array[n], e, (p-e));
*(np_array[n]+(p-e)) = 0;
n++;
}
if(!(res = (char **)XP_ALLOC((n+1)*sizeof(char *))))
return 0;
XP_MEMCPY(res, np_array, n*sizeof(char *));
res[n] = 0;
return res;
}
/* construct a file association from a mime type.
* - extensions is a list of comma/space separated file extensions
* with or without leading .s
* - filetype is platform specific data for this list of extensions,
* currently creator on mac and open file dialog descriptions on win.
* filetype is callee owned data and must remain valid
*/
NPFileTypeAssoc *
NPL_NewFileAssociation(const char *MIMEType, const char *extensions, const char *description, void *fileType)
{
NPFileTypeAssoc *fassoc = 0;
/* make a file association struct */
if(!(fassoc=XP_NEW_ZAP(NPFileTypeAssoc)))
return 0;
StrAllocCopy((fassoc->type), MIMEType ? MIMEType : "");
StrAllocCopy((fassoc->description), description ? description : "");
StrAllocCopy((fassoc->extentstring), extensions ? extensions : "");
fassoc->fileType = fileType; /* caller owns this data */
fassoc->extentlist = np_parse_exts(extensions);
return fassoc;
}
/* deletes a file association. Returns the platform specific fileType
data that we dont know how to dispose of.
*/
void *
NPL_DeleteFileAssociation(NPFileTypeAssoc *fassoc)
{
void* fileType;
if (!fassoc)
return NULL;
fileType = fassoc->fileType;
NPL_RemoveFileAssociation(fassoc);
if (fassoc->type)
{
XP_FREE(fassoc->type);
fassoc->type = NULL;
}
if (fassoc->description)
{
XP_FREE(fassoc->description);
fassoc->description = NULL;
}
if (fassoc->extentstring)
{
XP_FREE(fassoc->extentstring);
fassoc->extentstring = NULL;
}
{
char** charPtrPtr;
for (charPtrPtr = &fassoc->extentlist[0]; *charPtrPtr; *charPtrPtr=0, charPtrPtr++)
XP_FREE(*charPtrPtr);
fassoc->extentlist = NULL;
}
XP_FREE(fassoc);
return fileType;
}
/* Register a file association with us and netlib.
*/
void
NPL_RegisterFileAssociation(NPFileTypeAssoc *fassoc)
{
if (fassoc)
{
fassoc->pNext = np_fassoc_list;
np_fassoc_list = fassoc;
NET_cdataCommit(fassoc->type, fassoc->extentstring);
/*
* We need to add the description, too, which unfortunately requires
* looking the cinfo up AGAIN and setting the desc field...
*/
if (fassoc->description)
{
NET_cdataStruct temp;
NET_cdataStruct* cdata;
XP_BZERO(&temp, sizeof(temp));
temp.ci.type = fassoc->type;
cdata = NET_cdataExist(&temp);
XP_ASSERT(cdata);
if (cdata)
StrAllocCopy(cdata->ci.desc, fassoc->description);
}
}
}
/* Unregister a file association.
*/
NPFileTypeAssoc *
NPL_RemoveFileAssociation(NPFileTypeAssoc *fassoc)
{
NPFileTypeAssoc *f = np_fassoc_list;
if(!fassoc)
return 0;
/* unregister with netlib */
if(fassoc == np_fassoc_list)
np_fassoc_list = np_fassoc_list->pNext;
else
{
for(; f; f=f->pNext)
if(f->pNext == fassoc)
{
NPFileTypeAssoc *ft;
ft = f->pNext;
f->pNext = f->pNext->pNext;
f = ft;
break;
}
}
return f;
}
/* returns a linked list of registered associations.
* if type is NULL you get the entire list else the association matching
* that MIME type
*/
NPFileTypeAssoc *
NPL_GetFileAssociation(const char *type)
{
NPFileTypeAssoc *f=NULL;
if(!np_fassoc_list)
return NULL;
if(type==NULL)
return np_fassoc_list;
for(f=np_fassoc_list; f; f=f->pNext)
if(!(XP_STRCMP(type, f->type)))
return f;
return NULL;
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

730
modules/plugin/src/npglue.h Normal file
Просмотреть файл

@ -0,0 +1,730 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef npglue_h__
#define npglue_h__
#if defined(__cplusplus)
extern "C" {
#endif
#include "net.h"
#include "np.h"
#include "nppg.h"
#include "client.h"
#include "xpassert.h"
#include "ntypes.h"
#include "fe_proto.h"
#include "cvactive.h"
#include "gui.h" /* For XP_AppCodeName */
#include "merrors.h"
#include "xpgetstr.h"
#ifdef JAVA
#include "java.h"
#endif
#include "nppriv.h"
#include "shist.h"
#include "prefapi.h"
#include "proto.h"
#ifdef MOCHA
#include "libmocha.h"
#include "libevent.h"
#include "layout.h" /* XXX From ../layout */
#endif
#ifdef LAYERS
#include "layers.h"
#endif /* LAYERS */
#include "nsplugin.h"
#include "nsAgg.h" /* nsPluginManager aggregates nsJVMManager */
#ifdef OJI
#include "nsjvm.h"
#else /* OJI */
/* Just define a dummy struct for nsIJVMManager. In the
plugin code, it is never actually dereferenced outside of an
`#ifdef OJI'. */
struct nsIJVMManager;
#endif /* OJI */
extern int XP_PLUGIN_LOADING_PLUGIN;
extern int MK_BAD_CONNECT;
extern int XP_PLUGIN_NOT_FOUND;
extern int XP_PLUGIN_CANT_LOAD_PLUGIN;
extern int XP_PROGRESS_STARTING_JAVA;
#define NP_LOCK 1
#define NP_UNLOCK 0
#define NPTRACE(n, msg) TRACEMSG(msg)
#define RANGE_EQUALS "bytes="
/* @@@@ steal the private call from netlib */
extern void NET_SetCallNetlibAllTheTime(MWContext *context, char *caller);
extern void NET_ClearCallNetlibAllTheTime(MWContext *context, char *caller);
#if defined(XP_WIN) || defined(XP_OS2)
/* Can't include FEEMBED.H because it's full of C++ */
extern NET_StreamClass *EmbedStream(int iFormatOut, void *pDataObj, URL_Struct *pUrlData, MWContext *pContext);
extern void EmbedUrlExit(URL_Struct *pUrl, int iStatus, MWContext *pContext);
#endif
extern void NET_RegisterAllEncodingConverters(char* format_in, FO_Present_Types format_out);
/* Internal prototypes */
void
NPL_EmbedURLExit(URL_Struct *urls, int status, MWContext *cx);
void
NPL_URLExit(URL_Struct *urls, int status, MWContext *cx);
void
np_streamAsFile(np_stream* stream);
NPError
np_switchHandlers(np_instance* instance,
np_handle* newHandle,
np_mimetype* newMimeType,
char* requestedType);
NET_StreamClass*
np_newstream(URL_Struct *urls, np_handle *handle, np_instance *instance);
void
np_findPluginType(NPMIMEType type, void* pdesc, np_handle** outHandle, np_mimetype** outMimetype);
void
np_enablePluginType(np_handle* handle, np_mimetype* mimetype, XP_Bool enabled);
void
np_bindContext(NPEmbeddedApp* app, MWContext* cx);
void
np_unbindContext(NPEmbeddedApp* app, MWContext* cx);
void
np_deleteapp(MWContext* cx, NPEmbeddedApp* app);
np_instance*
np_newinstance(np_handle *handle, MWContext *cx, NPEmbeddedApp *app,
np_mimetype *mimetype, char *requestedType);
void
np_delete_instance(np_instance *instance);
void
np_recover_mochaWindow(JRIEnv * env, np_instance * instance);
XP_Bool
np_FakeHTMLStream(URL_Struct* urls, MWContext* cx, char * fakehtml);
/* Navigator plug-in API function prototypes */
/*
* Use this macro before each exported function
* (between the return address and the function
* itself), to ensure that the function has the
* right calling conventions on Win16.
*/
#ifdef XP_WIN16
#define NP_EXPORT __export
#elif defined(XP_OS2)
#define NP_EXPORT _System
#else
#define NP_EXPORT
#endif
NPError NP_EXPORT
npn_requestread(NPStream *pstream, NPByteRange *rangeList);
NPError NP_EXPORT
npn_geturlnotify(NPP npp, const char* relativeURL, const char* target, void* notifyData);
NPError NP_EXPORT
npn_getvalue(NPP npp, NPNVariable variable, void *r_value);
NPError NP_EXPORT
npn_setvalue(NPP npp, NPPVariable variable, void *r_value);
NPError NP_EXPORT
npn_geturl(NPP npp, const char* relativeURL, const char* target);
NPError NP_EXPORT
npn_posturlnotify(NPP npp, const char* relativeURL, const char *target,
uint32 len, const char *buf, NPBool file, void* notifyData);
NPError NP_EXPORT
npn_posturl(NPP npp, const char* relativeURL, const char *target, uint32 len,
const char *buf, NPBool file);
NPError
np_geturlinternal(NPP npp, const char* relativeURL, const char* target,
const char* altHost, const char* referer, PRBool forceJSEnabled,
NPBool notify, void* notifyData);
NPError
np_posturlinternal(NPP npp, const char* relativeURL, const char *target,
const char* altHost, const char* referer, PRBool forceJSEnabled,
uint32 len, const char *buf, NPBool file, NPBool notify, void* notifyData);
NPError NP_EXPORT
npn_newstream(NPP npp, NPMIMEType type, const char* window, NPStream** pstream);
int32 NP_EXPORT
npn_write(NPP npp, NPStream *pstream, int32 len, void *buffer);
NPError NP_EXPORT
npn_destroystream(NPP npp, NPStream *pstream, NPError reason);
void NP_EXPORT
npn_status(NPP npp, const char *message);
void NP_EXPORT
npn_registerwindow(NPP npp, void* window);
void NP_EXPORT
npn_unregisterwindow(NPP npp, void* window);
int16 NP_EXPORT
npn_allocateMenuID(NPP npp, XP_Bool isSubmenu);
#if defined(XP_MAC) && !defined(powerc)
#pragma pointers_in_D0
#endif
const char* NP_EXPORT
npn_useragent(NPP npp);
#if defined(XP_MAC) && !defined(powerc)
#pragma pointers_in_A0
#endif
#if defined(XP_MAC) && !defined(powerc)
#pragma pointers_in_D0
#endif
void* NP_EXPORT
npn_memalloc (uint32 size);
#if defined(XP_MAC) && !defined(powerc)
#pragma pointers_in_A0
#endif
void NP_EXPORT
npn_memfree (void *ptr);
uint32 NP_EXPORT
npn_memflush(uint32 size);
void NP_EXPORT
npn_reloadplugins(NPBool reloadPages);
void NP_EXPORT
npn_invalidaterect(NPP npp, NPRect *invalidRect);
void NP_EXPORT
npn_invalidateregion(NPP npp, NPRegion invalidRegion);
void NP_EXPORT
npn_forceredraw(NPP npp);
#if defined(XP_MAC) && !defined(powerc)
#pragma pointers_in_D0
#endif
#if defined(OJI)
JNIEnv* NP_EXPORT
npn_getJavaEnv(PRThread *pPRThread);
#else
JRIEnv* NP_EXPORT
npn_getJavaEnv(void);
#endif
#if defined(XP_MAC) && !defined(powerc)
#pragma pointers_in_A0
#endif
#if defined(XP_MAC) && !defined(powerc)
#pragma pointers_in_D0
#endif
jref NP_EXPORT
npn_getJavaPeer(NPP npp);
#if defined(XP_MAC) && !defined(powerc)
#pragma pointers_in_A0
#endif
/* End of function prototypes */
/* this is a hack for now */
#define NP_MAXBUF (0xE000)
////////////////////////////////////////////////////////////////////////////////
class nsPluginManager : public nsIPluginManager2 {
public:
////////////////////////////////////////////////////////////////////////////
// from nsIPluginManager:
// (Corresponds to NPN_ReloadPlugins.)
NS_IMETHOD_(void)
ReloadPlugins(PRBool reloadPages);
// (Corresponds to NPN_MemAlloc.)
NS_IMETHOD_(void*)
MemAlloc(PRUint32 size);
// (Corresponds to NPN_MemFree.)
NS_IMETHOD_(void)
MemFree(void* ptr);
// (Corresponds to NPN_MemFlush.)
NS_IMETHOD_(PRUint32)
MemFlush(PRUint32 size);
// (Corresponds to NPN_UserAgent.)
NS_IMETHOD_(const char*)
UserAgent(void);
// (Corresponds to NPN_GetURL and NPN_GetURLNotify.)
NS_IMETHOD_(nsPluginError)
GetURL(nsISupports* peer, const char* url, const char* target, void* notifyData,
const char* altHost, const char* referer, PRBool forceJSEnabled);
// (Corresponds to NPN_PostURL and NPN_PostURLNotify.)
NS_IMETHOD_(nsPluginError)
PostURL(nsISupports* peer, const char* url, const char* target,
PRUint32 len, const char* buf, PRBool file, void* notifyData,
const char* altHost, const char* referer, PRBool forceJSEnabled,
PRUint32 postHeadersLength, const char* postHeaders);
////////////////////////////////////////////////////////////////////////////
// from nsIPluginManager2:
NS_IMETHOD_(void)
BeginWaitCursor(void);
NS_IMETHOD_(void)
EndWaitCursor(void);
NS_IMETHOD_(PRBool)
SupportsURLProtocol(const char* protocol);
////////////////////////////////////////////////////////////////////////////
// nsPluginManager specific methods:
NS_DECL_AGGREGATED
static NS_METHOD
Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
protected:
nsPluginManager(nsISupports* outer);
virtual ~nsPluginManager(void);
// aggregated interfaces:
nsIJVMManager* GetJVMMgr(const nsIID& aIID);
nsISupports* fJVMMgr;
PRUint16 fWaiting;
void* fOldCursor;
};
extern nsPluginManager* thePluginManager;
////////////////////////////////////////////////////////////////////////////////
class nsFileUtilities : public nsIFileUtilities {
public:
////////////////////////////////////////////////////////////////////////////
// from nsIFileUtilities:
NS_IMETHOD_(const char*)
GetProgramPath(void);
NS_IMETHOD_(const char*)
GetTempDirPath(void);
NS_IMETHOD_(nsresult)
GetFileName(const char* fn, FileNameType type,
char* resultBuf, PRUint32 bufLen);
NS_IMETHOD_(nsresult)
NewTempFileName(const char* prefix, char* resultBuf, PRUint32 bufLen);
////////////////////////////////////////////////////////////////////////////
// nsFileUtilities specific methods:
nsFileUtilities(nsISupports* outer);
virtual ~nsFileUtilities(void);
NS_DECL_AGGREGATED
void SetProgramPath(const char* path) { fProgramPath = path; }
protected:
const char* fProgramPath;
};
////////////////////////////////////////////////////////////////////////////////
typedef struct JSContext JSContext;
class nsPluginTagInfo;
class nsPluginInstancePeer : public nsIPluginInstancePeer2,
public nsILiveConnectPluginInstancePeer,
public nsIWindowlessPluginInstancePeer
{
public:
////////////////////////////////////////////////////////////////////////////
// from nsIPluginInstancePeer:
// (Corresponds to NPP_New's MIMEType argument.)
NS_IMETHOD_(nsMIMEType)
GetMIMEType(void);
// (Corresponds to NPP_New's mode argument.)
NS_IMETHOD_(nsPluginType)
GetMode(void);
// (Corresponds to NPN_NewStream.)
NS_IMETHOD_(nsPluginError)
NewStream(nsMIMEType type, const char* target, nsIOutputStream* *result);
// (Corresponds to NPN_Status.)
NS_IMETHOD_(void)
ShowStatus(const char* message);
// (Corresponds to NPN_GetValue.)
NS_IMETHOD_(nsPluginError)
GetValue(nsPluginManagerVariable variable, void *value);
// (Corresponds to NPN_SetValue.)
NS_IMETHOD_(nsPluginError)
SetValue(nsPluginVariable variable, void *value);
////////////////////////////////////////////////////////////////////////////
// from nsIPluginInstancePeer2:
NS_IMETHOD_(void)
RegisterWindow(void* window);
NS_IMETHOD_(void)
UnregisterWindow(void* window);
NS_IMETHOD_(PRInt16)
AllocateMenuID(PRBool isSubmenu);
// On the mac (and most likely win16), network activity can
// only occur on the main thread. Therefore, we provide a hook
// here for the case that the main thread needs to tickle itself.
// In this case, we make sure that we give up the monitor so that
// the tickle code can notify it without freezing.
NS_IMETHOD_(PRBool)
Tickle(void);
////////////////////////////////////////////////////////////////////////////
// from nsIJRILiveConnectPluginInstancePeer:
// (Corresponds to NPN_GetJavaPeer.)
NS_IMETHOD_(jobject)
GetJavaPeer(void);
////////////////////////////////////////////////////////////////////////////
// from nsIWindowlessPluginInstancePeer:
// (Corresponds to NPN_InvalidateRect.)
NS_IMETHOD_(void)
InvalidateRect(nsRect *invalidRect);
// (Corresponds to NPN_InvalidateRegion.)
NS_IMETHOD_(void)
InvalidateRegion(nsRegion invalidRegion);
// (Corresponds to NPN_ForceRedraw.)
NS_IMETHOD_(void)
ForceRedraw(void);
////////////////////////////////////////////////////////////////////////////
// nsPluginInstancePeer specific methods:
nsPluginInstancePeer(NPP npp);
virtual ~nsPluginInstancePeer(void);
NS_DECL_AGGREGATED
nsIPluginInstance* GetUserInstance(void) {
userInst->AddRef();
return userInst;
}
void SetUserInstance(nsIPluginInstance* inst) {
userInst = inst;
}
NPP GetNPP(void) { return npp; }
JSContext *GetJSContext(void);
MWContext *GetMWContext(void);
protected:
// NPP is the old plugin structure. If we were implementing this
// from scratch we wouldn't use it, but for now we're calling the old
// npglue.c routines wherever possible.
NPP npp;
nsIPluginInstance* userInst;
nsPluginTagInfo* tagInfo;
};
#define NS_PLUGININSTANCEPEER_CID \
{ /* 766432d0-01ba-11d2-815b-006008119d7a */ \
0x766432d0, \
0x01ba, \
0x11d2, \
{0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
class nsPluginTagInfo : public nsIPluginTagInfo2 {
public:
////////////////////////////////////////////////////////////////////////////
// from nsIPluginTagInfo:
// Get a ptr to the paired list of attribute names and values,
// returns the length of the array.
//
// Each name or value is a null-terminated string.
//
NS_IMETHOD_(nsPluginError)
GetAttributes(PRUint16& n, const char*const*& names, const char*const*& values);
// Get the value for the named attribute. Returns null
// if the attribute was not set.
NS_IMETHOD_(const char*)
GetAttribute(const char* name);
////////////////////////////////////////////////////////////////////////////
// from nsIPluginTagInfo2:
// Get the type of the HTML tag that was used ot instantiate this
// plugin. Currently supported tags are EMBED, OBJECT and APPLET.
NS_IMETHOD_(nsPluginTagType)
GetTagType(void);
// Get the complete text of the HTML tag that was
// used to instantiate this plugin
NS_IMETHOD_(const char *)
GetTagText(void);
// Get a ptr to the paired list of parameter names and values,
// returns the length of the array.
//
// Each name or value is a null-terminated string.
NS_IMETHOD_(nsPluginError)
GetParameters(PRUint16& n, const char*const*& names, const char*const*& values);
// Get the value for the named parameter. Returns null
// if the parameter was not set.
NS_IMETHOD_(const char*)
GetParameter(const char* name);
NS_IMETHOD_(const char*)
GetDocumentBase(void);
// Return an encoding whose name is specified in:
// http://java.sun.com/products/jdk/1.1/docs/guide/intl/intl.doc.html#25303
NS_IMETHOD_(const char*)
GetDocumentEncoding(void);
NS_IMETHOD_(const char*)
GetAlignment(void);
NS_IMETHOD_(PRUint32)
GetWidth(void);
NS_IMETHOD_(PRUint32)
GetHeight(void);
NS_IMETHOD_(PRUint32)
GetBorderVertSpace(void);
NS_IMETHOD_(PRUint32)
GetBorderHorizSpace(void);
// Returns a unique id for the current document on which the
// plugin is displayed.
NS_IMETHOD_(PRUint32)
GetUniqueID(void);
////////////////////////////////////////////////////////////////////////////
// nsPluginTagInfo specific methods:
nsPluginTagInfo(NPP npp);
virtual ~nsPluginTagInfo(void);
NS_DECL_AGGREGATED
protected:
LO_CommonPluginStruct* GetLayoutElement(void)
{
np_instance* instance = (np_instance*) npp->ndata;
NPEmbeddedApp* app = instance->app;
np_data* ndata = (np_data*) app->np_data;
return (LO_CommonPluginStruct*)ndata->lo_struct;
}
// aggregated interfaces:
nsISupports* fJVMPluginTagInfo;
NPP npp;
PRUint32 fUniqueID;
};
////////////////////////////////////////////////////////////////////////////////
class nsPluginManagerStream : public nsIOutputStream {
public:
////////////////////////////////////////////////////////////////////////////
// from nsIBaseStream:
NS_IMETHOD
Close(void);
////////////////////////////////////////////////////////////////////////////
// from nsIOutputStream:
NS_IMETHOD_(PRInt32)
Write(const char* aBuf, PRInt32 aOffset, PRInt32 aCount,
nsresult *errorResult);
////////////////////////////////////////////////////////////////////////////
// nsPluginManagerStream specific methods:
nsPluginManagerStream(NPP npp, NPStream* pstr);
virtual ~nsPluginManagerStream(void);
NS_DECL_ISUPPORTS
protected:
NPP npp;
NPStream* pstream;
};
////////////////////////////////////////////////////////////////////////////////
class nsPluginStreamPeer :
virtual public nsIPluginStreamPeer2,
virtual public nsISeekablePluginStreamPeer
{
public:
////////////////////////////////////////////////////////////////////////////
// from nsIPluginStreamPeer:
// (Corresponds to NPStream's url field.)
NS_IMETHOD_(const char*)
GetURL(void);
// (Corresponds to NPStream's end field.)
NS_IMETHOD_(PRUint32)
GetEnd(void);
// (Corresponds to NPStream's lastmodified field.)
NS_IMETHOD_(PRUint32)
GetLastModified(void);
// (Corresponds to NPStream's notifyData field.)
NS_IMETHOD_(void*)
GetNotifyData(void);
// (Corresponds to NPP_DestroyStream's reason argument.)
NS_IMETHOD_(nsPluginReason)
GetReason(void);
// (Corresponds to NPP_NewStream's MIMEType argument.)
NS_IMETHOD_(nsMIMEType)
GetMIMEType(void);
////////////////////////////////////////////////////////////////////////////
// from nsIPluginStreamPeer2:
NS_IMETHOD_(PRUint32)
GetContentLength(void);
NS_IMETHOD_(PRUint32)
GetHeaderFieldCount(void);
NS_IMETHOD_(const char*)
GetHeaderFieldKey(PRUint32 index);
NS_IMETHOD_(const char*)
GetHeaderField(PRUint32 index);
////////////////////////////////////////////////////////////////////////////
// from nsISeekablePluginStreamPeer:
// (Corresponds to NPN_RequestRead.)
NS_IMETHOD_(nsPluginError)
RequestRead(nsByteRange* rangeList);
////////////////////////////////////////////////////////////////////////////
// nsPluginStreamPeer specific methods:
nsPluginStreamPeer(URL_Struct *urls, np_stream *stream);
virtual ~nsPluginStreamPeer(void);
NS_DECL_ISUPPORTS
nsIPluginStream* GetUserStream(void) {
return userStream;
}
void SetUserStream(nsIPluginStream* str) {
userStream = str;
}
void SetReason(nsPluginReason r) {
reason = r;
}
protected:
nsIPluginStream* userStream;
URL_Struct *urls;
np_stream *stream;
nsPluginReason reason;
};
////////////////////////////////////////////////////////////////////////////////
#if defined(__cplusplus)
} /* extern "C" */
#endif
#endif /* npglue_h__ */

65
modules/plugin/src/nppg.h Normal file
Просмотреть файл

@ -0,0 +1,65 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* nppg.h $Revision: 1.1 $
* Prototypes for functions exported by the FEs and called by libplugin.
* Some (perhaps all) of these prototypes could be moved to fe_proto.h.
* Protypes for functions exported by libplugin are in np.h.
*/
#ifndef _NPPG_H
#define _NPPG_H
#include "npapi.h"
#include "npupp.h"
struct _np_handle;
XP_BEGIN_PROTOS
extern void FE_RegisterPlugins(void);
extern NPPluginFuncs* FE_LoadPlugin(void *plugin, NPNetscapeFuncs *, struct _np_handle* handle);
extern void FE_UnloadPlugin(void *plugin, struct _np_handle* handle);
extern void FE_EmbedURLExit(URL_Struct *urls, int status, MWContext *cx);
extern void FE_ShowScrollBars(MWContext *context, XP_Bool show);
#if defined (XP_WIN) || defined(XP_OS2)
extern void FE_FreeEmbedSessionData(MWContext *context, NPEmbeddedApp* pApp);
#endif
#ifdef XP_MAC
extern void FE_PluginProgress(MWContext *context, const char *message);
extern void FE_ResetRefreshURLTimer(MWContext *context);
extern void FE_RegisterWindow(void* plugin, void* window);
extern void FE_UnregisterWindow(void* plugin, void* window);
extern SInt16 FE_AllocateMenuID(void *plugin, XP_Bool isSubmenu);
#endif
#ifdef XP_UNIX
extern NPError FE_PluginGetValue(void *pdesc, NPNVariable variable, void *r_value);
#else
extern NPError FE_PluginGetValue(MWContext *context, NPEmbeddedApp *app, NPNVariable variable, void *r_value);
#endif /* XP_UNIX */
#ifdef XP_WIN32
void* WFE_BeginSetModuleState();
void WFE_EndSetModuleState(void*);
#endif
XP_END_PROTOS
#endif /* _NPPG_H */

153
modules/plugin/src/nppriv.h Normal file
Просмотреть файл

@ -0,0 +1,153 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _NPPRIV_H_
#define _NPPRIV_H_
#include "xp_core.h"
#include "xp_mem.h"
#include "xp_trace.h"
#include "xp_mcom.h"
#include "lo_ele.h"
#include "npupp.h"
#include "npassoc.h"
#include "npapi.h"
#define ISFUNCPTR(x) (x != NULL)
#define PLUGIN_TIMER_EVENT
typedef struct _np_handle np_handle;
typedef struct _np_mimetype np_mimetype;
typedef struct _np_instance np_instance;
typedef struct _np_stream np_stream;
typedef struct _np_data np_data;
typedef struct _np_urlsnode np_urlsnode;
typedef struct _np_reconnect np_reconnect;
struct nsIPlugin;
typedef enum {
NPDataNormal = 0, /* URL_Struct.fe_data -> NPEmbeddedApp.np_data -> np_data */
NPDataCache = 1, /* LO_EmbedStruct.session_data -> np_data */
NPDataCached = 2, /* LO_EmbedStruct.session_data -> np_data */
NPDataSaved = 3 /* LO_EmbedStruct.session_data -> np_data */
} NPDataState;
struct _np_data {
NPDataState state;
np_handle *handle;
NPEmbeddedApp *app;
NPSavedData *sdata;
/* Not valid in state NPDataSaved! */
np_instance *instance;
LO_EmbedStruct *lo_struct;
int32 refs;
XP_Bool streamStarted;
};
struct _np_handle {
np_handle *next;
NPPluginFuncs *f;
void *pdesc; /* pd glue description */
int32 refs;
np_instance *instances;
np_mimetype *mimetypes;
char *name;
char *filename;
char *description;
struct nsIPlugin* userPlugin;
};
struct _np_mimetype {
np_mimetype* next;
NPMIMEType type;
NPFileTypeAssoc *fassoc;
np_handle* handle;
XP_Bool enabled;
};
struct _np_instance {
np_handle *handle;
np_mimetype *mimetype;
char *typeString;
np_instance *next;
NPEmbeddedApp *app;
NPP npp;
MWContext *cx;
np_stream *streams;
uint16 type;
int reentrant;
URL_Struct *delayedload;
XP_List *url_list;
JRIEnv* javaEnv;
#ifdef OJI
jobject javaInstance;
#else
JRIGlobalRef javaInstance;
#endif /* OJI */
XP_Bool windowed; /* TRUE = has its own window, FALSE = windowless */
XP_Bool transparent; /* TRUE = transparent, FALSE = opaque */
XP_Bool calling_netlib_all_the_time;
JRIGlobalRef mochaWindow;
#ifdef PLUGIN_TIMER_EVENT
void* timeout;
uint32 interval;
#endif
#ifdef LAYERS
CL_Layer *layer;
#endif /* LAYERS */
};
struct _np_stream {
np_instance *instance;
np_handle *handle;
np_stream *next;
NPStream *pstream;
char *url; /* convenience */
URL_Struct *initial_urls;
NET_StreamClass *nstream;
int32 len;
int init;
int seek; /* 0 normal, -1 turn, 1 seek, 2 discard */
int seekable;
int dontclose;
int asfile;
int islocked;
int32 offset;
NPByteRange *deferred;
NET_StreamClass *prev_stream;
};
struct _np_urlsnode {
URL_Struct *urls;
void* notifyData;
XP_Bool cached;
XP_Bool notify;
};
/* MWContext.pluginReconnect -> np_reconnect */
struct _np_reconnect {
np_mimetype* mimetype;
char* requestedtype;
NPEmbeddedApp* app;
};
#endif /* _NPPRIV_H_ */

1225
modules/plugin/src/npupp.h Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу